From b9ff262d861ad56abb41e7527a0552a933e70855 Mon Sep 17 00:00:00 2001 From: Robert Osinski Date: Mon, 16 Oct 2023 08:56:37 +0000 Subject: [PATCH 001/196] ECC-1705: GRIB2 templates for WMO Fast-track 2024-1 --- definitions/grib2/boot.def | 2 +- definitions/grib2/tables/33/4.0.table | 114 ++++++++++++++++++ definitions/grib2/tables/33/4.103.table | 9 ++ definitions/grib2/tables/33/4.104.table | 15 +++ definitions/grib2/tables/33/4.105.table | 6 + definitions/grib2/template.4.119.def | 10 ++ definitions/grib2/template.4.120.def | 10 ++ definitions/grib2/template.4.121.def | 11 ++ definitions/grib2/template.4.122.def | 11 ++ definitions/grib2/template.4.123.def | 12 ++ .../grib2/template.4.focalStatistics.def | 34 ++++++ .../template.4.probabilityLargeEnsemble.def | 27 +++++ 12 files changed, 260 insertions(+), 1 deletion(-) create mode 100644 definitions/grib2/tables/33/4.0.table create mode 100644 definitions/grib2/tables/33/4.103.table create mode 100644 definitions/grib2/tables/33/4.104.table create mode 100644 definitions/grib2/tables/33/4.105.table create mode 100644 definitions/grib2/template.4.119.def create mode 100644 definitions/grib2/template.4.120.def create mode 100644 definitions/grib2/template.4.121.def create mode 100644 definitions/grib2/template.4.122.def create mode 100644 definitions/grib2/template.4.123.def create mode 100644 definitions/grib2/template.4.focalStatistics.def create mode 100644 definitions/grib2/template.4.probabilityLargeEnsemble.def diff --git a/definitions/grib2/boot.def b/definitions/grib2/boot.def index 296dba179..fc3604f6a 100644 --- a/definitions/grib2/boot.def +++ b/definitions/grib2/boot.def @@ -11,7 +11,7 @@ # See https://community.wmo.int/activity-areas/wmo-codes/manual-codes/latest-version constant tablesVersionLatestOfficial = 31 : edition_specific; # If this is different from the official version, then it is the pre-operational version -constant tablesVersionLatest = 31 : edition_specific; +constant tablesVersionLatest = 33 : edition_specific; constant million = 1000000 : hidden; constant grib2divider = 1000000; diff --git a/definitions/grib2/tables/33/4.0.table b/definitions/grib2/tables/33/4.0.table new file mode 100644 index 000000000..4a079ddc0 --- /dev/null +++ b/definitions/grib2/tables/33/4.0.table @@ -0,0 +1,114 @@ +# Code table 4.0 - Product definition template number +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 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 +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +35 35 Satellite product with or without associated quality values +# 36-39 Reserved +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 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 atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 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 aerosol +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +49 49 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +# 50 Reserved +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +# 52 Reserved +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time +56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (deprecated) +57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +58 58 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +59 59 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (corrected version of template 4.56) +60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +62 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 +63 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 +# 64-66 Reserved +67 67 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 atmospheric chemical constituents based on a distribution function +68 68 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function +# 69 Reserved +70 70 Post-processing analysis or forecast at a horizontal level or in a horizontal layer at a point in time +71 71 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +72 72 Post-processing 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 +73 73 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +# 74-75 Reserved +76 76 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents with source or sink +77 77 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents with source or sink +78 78 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 atmospheric chemical constituents with source or sink +79 79 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents with source or sink +80 80 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol with source or sink +81 81 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol with source or sink +82 82 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 aerosol with source or sink +83 83 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol with source or sink +84 84 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol with source or sink +85 85 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol +86 86 Quantile forecasts at a horizontal level or in a horizontal layer at a point in time +87 87 Quantile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +88 88 Analysis or forecast at a horizontal level or in a horizontal layer at a specified local time +# 89-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +92 92 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a specified local time +93 93 Post-processing analysis or forecast at a horizontal level or in a horizontal layer at a specified local time +94 94 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a specified local time +95 95 Average, accumulation, extreme values or other statiscally processed value at a horizontal level or in a horizontal layer at a specified local time +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 99 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for wave 2D spectra with explicit list of frequencies and directions +100 100 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for wave 2D spectra with explicit list of frequencies and directions +101 101 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for wave 2D spectra with frequencies and directions defined by formulae +102 102 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for wave 2D spectra with frequencies and directions defined by formulae +103 103 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for waves selected by period range +104 104 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for waves selected by period range +105 105 Anomalies, significance and other derived products from an analysis or forecast in relation to a reference period at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +106 106 Anomalies, significance and other derived products from an individual ensemble forecast, control and perturbed in relation to a reference period at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +107 107 Anomalies, significance and other derived products from derived forecasts based on all ensemble members in relation to a reference period at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +108 108 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for generic optical products +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 products +110 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 +111 111 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for generic optical products +112 112 Anomalies, significance and other derived products as probability forecasts in relation to a reference period at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 113-118 Reserved +119 119 Probability forecasts from large ensembles at a horizontal level or in a horizontal layer at a point in time +120 120 Probability forecasts from large ensembles at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +121 121 Probability forecasts from large ensembles with spatiotemporal processing based on focal (moving window) statistics at a horizontal level or in a horizontal layer at a point in time +122 122 Probability forecasts from large ensembles with spatiotemporal processing based on focal (moving window) statistics at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +123 123 Probability forecasts from large ensembles with spatiotemporal processing based on focal (moving window) statistics in relation to a reference period at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 124-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing +# 1102-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/33/4.103.table b/definitions/grib2/tables/33/4.103.table new file mode 100644 index 000000000..b6c108e63 --- /dev/null +++ b/definitions/grib2/tables/33/4.103.table @@ -0,0 +1,9 @@ +# Code table 4.103 - Spatial vicinity type +0 0 Circle [m] +1 1 Rectangle [m,m] +2 2 Square [m] +3 3 Wedge [m,degree,degree] +4 4 Number of grid cells [-,-] +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.104.table b/definitions/grib2/tables/33/4.104.table new file mode 100644 index 000000000..3192e59bf --- /dev/null +++ b/definitions/grib2/tables/33/4.104.table @@ -0,0 +1,15 @@ +# Code table 4.104 - Spatial and temporal vicinity processing +0 0 Average +#1 1 Reserved +2 2 Maximum +3 3 Minimum +4 4 Range +#5 5 Reserved +6 6 Standard deviation +#7-10 Reserved +11 11 Sum +#12-189 Reserved +190 190 Quantile +191 191 Categorical (yes, no) +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.105.table b/definitions/grib2/tables/33/4.105.table new file mode 100644 index 000000000..ec5467e99 --- /dev/null +++ b/definitions/grib2/tables/33/4.105.table @@ -0,0 +1,6 @@ +# Code table 4.105 - Spatial and temporal vicinity missing data +0 0 Ignore missing data +1 1 No data +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/template.4.119.def b/definitions/grib2/template.4.119.def new file mode 100644 index 000000000..ef464a00f --- /dev/null +++ b/definitions/grib2/template.4.119.def @@ -0,0 +1,10 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.119, Probability forecasts from large ensembles at a horizontal level or in a horizontal layer at a point in time + +include "grib2/template.4.parameter.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.probabilityLargeEnsemble.def" diff --git a/definitions/grib2/template.4.120.def b/definitions/grib2/template.4.120.def new file mode 100644 index 000000000..9ad2f90bd --- /dev/null +++ b/definitions/grib2/template.4.120.def @@ -0,0 +1,10 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.120, Probability forecasts from large ensembles at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval + +include "grib2/template.4.parameter.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.probabilityLargeEnsemble.def" +include "grib2/template.4.statistical.def" diff --git a/definitions/grib2/template.4.121.def b/definitions/grib2/template.4.121.def new file mode 100644 index 000000000..73bba193b --- /dev/null +++ b/definitions/grib2/template.4.121.def @@ -0,0 +1,11 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.121, Probability forecasts with spatiotemporal processing based on focal (moving window) statistics at a horizontal level or in a horizontal layer at a point in time + +include "grib2/template.4.parameter.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.probabilityLargeEnsemble.def" +include "grib2/template.4.focalStatistics.def" diff --git a/definitions/grib2/template.4.122.def b/definitions/grib2/template.4.122.def new file mode 100644 index 000000000..40bf98240 --- /dev/null +++ b/definitions/grib2/template.4.122.def @@ -0,0 +1,11 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.122, Probability forecasts with spatiotemporal processing based on focal (moving window) statistics at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval + +include "grib2/template.4.parameter.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.probabilityLargeEnsemble.def" +include "grib2/template.4.statistical.def" +include "grib2/template.4.focalStatistics.def" diff --git a/definitions/grib2/template.4.123.def b/definitions/grib2/template.4.123.def new file mode 100644 index 000000000..a70b9643c --- /dev/null +++ b/definitions/grib2/template.4.123.def @@ -0,0 +1,12 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.123, Probability forecasts from large ensembles with spatiotemporal processing based on focal (moving window) statistics in relation to a reference period at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval + +include "grib2/template.4.parameter.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" +include "grib2/template.4.probabilityLargeEnsemble.def" +include "grib2/template.4.referenceperiod.def" +include "grib2/template.4.focalStatistics.def" diff --git a/definitions/grib2/template.4.focalStatistics.def b/definitions/grib2/template.4.focalStatistics.def new file mode 100644 index 000000000..8aa8d2a33 --- /dev/null +++ b/definitions/grib2/template.4.focalStatistics.def @@ -0,0 +1,34 @@ +codetable[1] spatialVicinityType ('4.103.table',masterDir,localDir)=255 ; + +unsigned[1] numberOfSpatialVicinityValues = 1 : edition_specific; +alias nspatvals = numberOfSpatialVicinityValues; + +spatialVicintiyList list(numberOfSpatialVicinityValues) +{ + # n-th spatial vicinity value + unsigned[4] spatialVicinityValue=0 : dump; +} + +codetable[1] spatialVicinityProcessing ('4.104.table',masterDir,localDir)=255 ; + +signed[2] spatialVicinityProcessingArgument1 = 255 : dump ; + +signed[2] spatialVicinityProcessingArgument2 = 255 : dump ; + +codetable[1] spatialVicinityMissingData ('4.105.table',masterDir,localDir)=0 ; + +## UUID of irregular kernel +#byte[16] uuidOfIrregularKernel : dump; + +## UUID of spatial vicinity weights +#byte[16] uuidOfSpatialVicinityWeights : dump; + +codetable[1] temporalVicinityProcessing ('4.104.table',masterDir,localDir)=255 ; + +codetable[1] temporalVicinityUnit ('4.4.table',masterDir,localDir)=255 ; + +unsigned[4] temporalVicinityTowardsPast : dump; +unsigned[4] temporalVicinityTowardsFuture : dump; + +## UUID of temporal vicinity weights +#byte[16] uuidOfTemporalVicinityWeights : dump; diff --git a/definitions/grib2/template.4.probabilityLargeEnsemble.def b/definitions/grib2/template.4.probabilityLargeEnsemble.def new file mode 100644 index 000000000..cb309e4a9 --- /dev/null +++ b/definitions/grib2/template.4.probabilityLargeEnsemble.def @@ -0,0 +1,27 @@ +# (C) Copyright 2005- ECMWF. + +# Type of ensemble forecast +codetable[1] typeOfEnsembleForecast ('4.6.table',masterDir,localDir) = 255 : dump; + +# Number of forecasts in ensemble +unsigned[4] numberOfForecastsInEnsemble : dump; +alias totalNumber=numberOfForecastsInEnsemble; + +unsigned[1] forecastProbabilityNumber : dump; + +unsigned[1] totalNumberOfForecastProbabilities : dump; + +codetable[1] probabilityType ('4.9.table',masterDir,localDir) : dump; +meta probabilityTypeName codetable_title(probabilityType): read_only; + +signed[1] scaleFactorOfLowerLimit : can_be_missing,dump ; +signed[4] scaledValueOfLowerLimit : can_be_missing,dump ; + +meta lowerLimit from_scale_factor_scaled_value( + scaleFactorOfLowerLimit, scaledValueOfLowerLimit): can_be_missing; + +signed[1] scaleFactorOfUpperLimit : can_be_missing,dump; +signed[4] scaledValueOfUpperLimit : can_be_missing,dump; + +meta upperLimit from_scale_factor_scaled_value( + scaleFactorOfUpperLimit, scaledValueOfUpperLimit): can_be_missing; From 3b6040a4926a937bc482cad573b39092a8b75b93 Mon Sep 17 00:00:00 2001 From: Robert Osinski Date: Mon, 16 Oct 2023 10:59:05 +0000 Subject: [PATCH 002/196] ECC-1705: Added new table entries --- definitions/grib2/tables/33/4.101.table | 12 ++++++++++++ definitions/grib2/tables/33/4.2.0.191.table | 12 ++++++++++++ definitions/grib2/tables/33/4.7.table | 15 +++++++++++++++ definitions/grib2/tables/33/4.9.table | 14 ++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 definitions/grib2/tables/33/4.101.table create mode 100644 definitions/grib2/tables/33/4.2.0.191.table create mode 100644 definitions/grib2/tables/33/4.7.table create mode 100644 definitions/grib2/tables/33/4.9.table diff --git a/definitions/grib2/tables/33/4.101.table b/definitions/grib2/tables/33/4.101.table new file mode 100644 index 000000000..001c77d32 --- /dev/null +++ b/definitions/grib2/tables/33/4.101.table @@ -0,0 +1,12 @@ +# Code table 4.101 - Type of relationship to reference dataset +0 0 Anomaly +1 1 Standardized anomaly +2 2 Significance (Wilcoxon-Mann-Whitney) +3 3 Climatology +# 4-19 Reserved +20 20 Extreme Forecast Index (EFI) +21 21 Shift of Tails (SOT) +22 22 Anomaly of probabilities +# 23-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.191.table b/definitions/grib2/tables/33/4.2.0.191.table new file mode 100644 index 000000000..fd5ef50f0 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.191.table @@ -0,0 +1,12 @@ +# Product discipline 0 - Meteorological products, parameter category 191: miscellaneous +0 0 Seconds prior to initial reference time (defined in Section 1) (s) +1 1 Geographical latitude (deg N) +2 2 Geographical longitude (deg E) +3 3 Days since last observation (d) +# 4-4 Reserved +5 5 Hurricane track in spatiotemporal vicinity [boolean] +6 6 Tropical Storm track in spatiotemporal vicinity [boolean] +7 7 Tropical Depression track in spatiotemporal vicinity [boolean] +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.7.table b/definitions/grib2/tables/33/4.7.table new file mode 100644 index 000000000..128fa317f --- /dev/null +++ b/definitions/grib2/tables/33/4.7.table @@ -0,0 +1,15 @@ +# Code table 4.7 - Derived forecast +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +10 10 Variance of all ensemble members +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.9.table b/definitions/grib2/tables/33/4.9.table new file mode 100644 index 000000000..db9928fd3 --- /dev/null +++ b/definitions/grib2/tables/33/4.9.table @@ -0,0 +1,14 @@ +# Code table 4.9 - Probability type +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +5 5 Probability of event equal to lower limit +6 6 Probability of event in above normal category +7 7 Probability of event in near normal category +8 8 Probability of event in below normal category +9 9 Probability based on counts of categorical yes/no per member +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing From a78865c91fd84912f4664dc736bfbcfa04fff328 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Fri, 15 Mar 2024 21:07:54 +0000 Subject: [PATCH 003/196] Prepare migration --- .gitignore | 3 +++ .../todo}/grib_accessor_class_abstract_long_vector.cc | 0 src/{ => accessor/todo}/grib_accessor_class_abstract_vector.cc | 0 src/{ => accessor/todo}/grib_accessor_class_ascii.cc | 0 src/{ => accessor/todo}/grib_accessor_class_bit.cc | 0 src/{ => accessor/todo}/grib_accessor_class_bitmap.cc | 0 src/{ => accessor/todo}/grib_accessor_class_bits.cc | 0 src/{ => accessor/todo}/grib_accessor_class_bits_per_value.cc | 0 src/{ => accessor/todo}/grib_accessor_class_blob.cc | 0 src/{ => accessor/todo}/grib_accessor_class_budgdate.cc | 0 src/{ => accessor/todo}/grib_accessor_class_bufr_data_array.cc | 0 .../todo}/grib_accessor_class_bufr_data_element.cc | 0 .../todo}/grib_accessor_class_bufr_elements_table.cc | 0 .../todo}/grib_accessor_class_bufr_extract_area_subsets.cc | 0 .../todo}/grib_accessor_class_bufr_extract_datetime_subsets.cc | 0 .../todo}/grib_accessor_class_bufr_extract_subsets.cc | 0 src/{ => accessor/todo}/grib_accessor_class_bufr_group.cc | 0 .../todo}/grib_accessor_class_bufr_simple_thinning.cc | 0 .../todo}/grib_accessor_class_bufr_string_values.cc | 0 .../todo}/grib_accessor_class_bufrdc_expanded_descriptors.cc | 0 src/{ => accessor/todo}/grib_accessor_class_bytes.cc | 0 .../grib_accessor_class_change_alternative_row_scanning.cc | 0 .../todo}/grib_accessor_class_change_scanning_direction.cc | 0 .../todo}/grib_accessor_class_check_internal_version.cc | 0 src/{ => accessor/todo}/grib_accessor_class_closest_date.cc | 0 src/{ => accessor/todo}/grib_accessor_class_codeflag.cc | 0 src/{ => accessor/todo}/grib_accessor_class_codetable.cc | 0 src/{ => accessor/todo}/grib_accessor_class_codetable_title.cc | 0 src/{ => accessor/todo}/grib_accessor_class_codetable_units.cc | 0 src/{ => accessor/todo}/grib_accessor_class_concept.cc | 0 src/{ => accessor/todo}/grib_accessor_class_constant.cc | 0 src/{ => accessor/todo}/grib_accessor_class_count_file.cc | 0 src/{ => accessor/todo}/grib_accessor_class_count_missing.cc | 0 src/{ => accessor/todo}/grib_accessor_class_count_total.cc | 0 .../todo}/grib_accessor_class_data_apply_bitmap.cc | 0 .../todo}/grib_accessor_class_data_apply_boustrophedonic.cc | 0 .../grib_accessor_class_data_apply_boustrophedonic_bitmap.cc | 0 .../todo}/grib_accessor_class_data_ccsds_packing.cc | 0 .../todo}/grib_accessor_class_data_complex_packing.cc | 0 .../todo}/grib_accessor_class_data_dummy_field.cc | 0 .../todo}/grib_accessor_class_data_g1complex_packing.cc | 0 ...ccessor_class_data_g1second_order_constant_width_packing.cc | 0 ...essor_class_data_g1second_order_general_extended_packing.cc | 0 .../grib_accessor_class_data_g1second_order_general_packing.cc | 0 ...ib_accessor_class_data_g1second_order_row_by_row_packing.cc | 0 .../todo}/grib_accessor_class_data_g1secondary_bitmap.cc | 0 .../todo}/grib_accessor_class_data_g1shsimple_packing.cc | 0 .../todo}/grib_accessor_class_data_g1simple_packing.cc | 0 .../todo}/grib_accessor_class_data_g22order_packing.cc | 0 .../todo}/grib_accessor_class_data_g2bifourier_packing.cc | 0 .../todo}/grib_accessor_class_data_g2complex_packing.cc | 0 .../todo}/grib_accessor_class_data_g2secondary_bitmap.cc | 0 .../todo}/grib_accessor_class_data_g2shsimple_packing.cc | 0 .../todo}/grib_accessor_class_data_g2simple_packing.cc | 0 ..._accessor_class_data_g2simple_packing_with_preprocessing.cc | 0 .../todo}/grib_accessor_class_data_jpeg2000_packing.cc | 0 .../todo}/grib_accessor_class_data_png_packing.cc | 0 .../todo}/grib_accessor_class_data_raw_packing.cc | 0 .../todo}/grib_accessor_class_data_run_length_packing.cc | 0 .../todo}/grib_accessor_class_data_secondary_bitmap.cc | 0 src/{ => accessor/todo}/grib_accessor_class_data_sh_packed.cc | 0 .../todo}/grib_accessor_class_data_sh_unpacked.cc | 0 .../todo}/grib_accessor_class_data_shsimple_packing.cc | 0 .../todo}/grib_accessor_class_data_simple_packing.cc | 0 .../todo}/grib_accessor_class_decimal_precision.cc | 0 src/{ => accessor/todo}/grib_accessor_class_dictionary.cc | 0 src/{ => accessor/todo}/grib_accessor_class_dirty.cc | 0 src/{ => accessor/todo}/grib_accessor_class_divdouble.cc | 0 src/{ => accessor/todo}/grib_accessor_class_double.cc | 0 src/{ => accessor/todo}/grib_accessor_class_element.cc | 0 src/{ => accessor/todo}/grib_accessor_class_evaluate.cc | 0 .../todo}/grib_accessor_class_expanded_descriptors.cc | 0 .../grib_accessor_class_from_scale_factor_scaled_value.cc | 0 .../todo}/grib_accessor_class_g1_half_byte_codeflag.cc | 0 .../todo}/grib_accessor_class_g1_message_length.cc | 0 .../todo}/grib_accessor_class_g1_section4_length.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g1bitmap.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g1date.cc | 0 .../todo}/grib_accessor_class_g1day_of_the_year_date.cc | 0 .../todo}/grib_accessor_class_g1end_of_interval_monthly.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g1fcperiod.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g1forecastmonth.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g1monthlydate.cc | 0 .../grib_accessor_class_g1number_of_coded_values_sh_complex.cc | 0 .../grib_accessor_class_g1number_of_coded_values_sh_simple.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g1step_range.cc | 0 .../todo}/grib_accessor_class_g1verificationdate.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g2_aerosol.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g2_chemical.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g2_eps.cc | 0 .../todo}/grib_accessor_class_g2_mars_labeling.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g2bitmap.cc | 0 .../todo}/grib_accessor_class_g2bitmap_present.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g2date.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g2end_step.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g2grid.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g2latlon.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g2level.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g2lon.cc | 0 src/{ => accessor/todo}/grib_accessor_class_g2step_range.cc | 0 .../todo}/grib_accessor_class_gaussian_grid_name.cc | 0 src/{ => accessor/todo}/grib_accessor_class_gds_is_present.cc | 0 .../todo}/grib_accessor_class_gds_not_present_bitmap.cc | 0 src/{ => accessor/todo}/grib_accessor_class_gen.cc | 0 src/{ => accessor/todo}/grib_accessor_class_getenv.cc | 0 src/{ => accessor/todo}/grib_accessor_class_global_gaussian.cc | 0 src/{ => accessor/todo}/grib_accessor_class_group.cc | 0 src/{ => accessor/todo}/grib_accessor_class_gts_header.cc | 0 src/{ => accessor/todo}/grib_accessor_class_hash_array.cc | 0 src/{ => accessor/todo}/grib_accessor_class_headers_only.cc | 0 src/{ => accessor/todo}/grib_accessor_class_ibmfloat.cc | 0 src/{ => accessor/todo}/grib_accessor_class_ieeefloat.cc | 0 src/{ => accessor/todo}/grib_accessor_class_ifs_param.cc | 0 src/{ => accessor/todo}/grib_accessor_class_iterator.cc | 0 src/{ => accessor/todo}/grib_accessor_class_julian_date.cc | 0 src/{ => accessor/todo}/grib_accessor_class_julian_day.cc | 0 src/{ => accessor/todo}/grib_accessor_class_ksec1expver.cc | 0 src/{ => accessor/todo}/grib_accessor_class_label.cc | 0 src/{ => accessor/todo}/grib_accessor_class_latitudes.cc | 0 .../todo}/grib_accessor_class_latlon_increment.cc | 0 src/{ => accessor/todo}/grib_accessor_class_latlonvalues.cc | 0 src/{ => accessor/todo}/grib_accessor_class_library_version.cc | 0 .../todo}/grib_accessor_class_local_definition.cc | 0 src/{ => accessor/todo}/grib_accessor_class_long.cc | 0 src/{ => accessor/todo}/grib_accessor_class_long_vector.cc | 0 src/{ => accessor/todo}/grib_accessor_class_longitudes.cc | 0 src/{ => accessor/todo}/grib_accessor_class_lookup.cc | 0 src/{ => accessor/todo}/grib_accessor_class_mars_param.cc | 0 src/{ => accessor/todo}/grib_accessor_class_mars_step.cc | 0 src/{ => accessor/todo}/grib_accessor_class_md5.cc | 0 src/{ => accessor/todo}/grib_accessor_class_message.cc | 0 src/{ => accessor/todo}/grib_accessor_class_message_copy.cc | 0 src/{ => accessor/todo}/grib_accessor_class_multdouble.cc | 0 src/{ => accessor/todo}/grib_accessor_class_nearest.cc | 0 src/{ => accessor/todo}/grib_accessor_class_non_alpha.cc | 0 .../todo}/grib_accessor_class_number_of_coded_values.cc | 0 .../todo}/grib_accessor_class_number_of_points.cc | 0 .../todo}/grib_accessor_class_number_of_points_gaussian.cc | 0 .../todo}/grib_accessor_class_number_of_values.cc | 0 .../grib_accessor_class_number_of_values_data_raw_packing.cc | 0 .../todo}/grib_accessor_class_octahedral_gaussian.cc | 0 src/{ => accessor/todo}/grib_accessor_class_octet_number.cc | 0 src/{ => accessor/todo}/grib_accessor_class_offset_file.cc | 0 src/{ => accessor/todo}/grib_accessor_class_offset_values.cc | 0 .../todo}/grib_accessor_class_optimal_step_units.cc | 0 .../todo}/grib_accessor_class_pack_bufr_values.cc | 0 src/{ => accessor/todo}/grib_accessor_class_packing_type.cc | 0 src/{ => accessor/todo}/grib_accessor_class_pad.cc | 0 src/{ => accessor/todo}/grib_accessor_class_padding.cc | 0 src/{ => accessor/todo}/grib_accessor_class_padto.cc | 0 src/{ => accessor/todo}/grib_accessor_class_padtoeven.cc | 0 src/{ => accessor/todo}/grib_accessor_class_padtomultiple.cc | 0 src/{ => accessor/todo}/grib_accessor_class_position.cc | 0 src/{ => accessor/todo}/grib_accessor_class_proj_string.cc | 0 src/{ => accessor/todo}/grib_accessor_class_raw.cc | 0 .../todo}/grib_accessor_class_rdbtime_guess_date.cc | 0 .../todo}/grib_accessor_class_reference_value_error.cc | 0 src/{ => accessor/todo}/grib_accessor_class_round.cc | 0 src/{ => accessor/todo}/grib_accessor_class_scale.cc | 0 src/{ => accessor/todo}/grib_accessor_class_scale_values.cc | 0 .../todo}/grib_accessor_class_second_order_bits_per_value.cc | 0 src/{ => accessor/todo}/grib_accessor_class_section.cc | 0 src/{ => accessor/todo}/grib_accessor_class_section_length.cc | 0 src/{ => accessor/todo}/grib_accessor_class_section_padding.cc | 0 src/{ => accessor/todo}/grib_accessor_class_section_pointer.cc | 0 .../todo}/grib_accessor_class_select_step_template.cc | 0 .../todo}/grib_accessor_class_sexagesimal2decimal.cc | 0 src/{ => accessor/todo}/grib_accessor_class_signed.cc | 0 src/{ => accessor/todo}/grib_accessor_class_signed_bits.cc | 0 .../todo}/grib_accessor_class_simple_packing_error.cc | 0 src/{ => accessor/todo}/grib_accessor_class_size.cc | 0 src/{ => accessor/todo}/grib_accessor_class_smart_table.cc | 0 .../todo}/grib_accessor_class_smart_table_column.cc | 0 src/{ => accessor/todo}/grib_accessor_class_spd.cc | 0 .../todo}/grib_accessor_class_spectral_truncation.cc | 0 src/{ => accessor/todo}/grib_accessor_class_sprintf.cc | 0 src/{ => accessor/todo}/grib_accessor_class_statistics.cc | 0 .../todo}/grib_accessor_class_statistics_spectral.cc | 0 .../todo}/grib_accessor_class_step_human_readable.cc | 0 src/{ => accessor/todo}/grib_accessor_class_step_in_units.cc | 0 src/{ => accessor/todo}/grib_accessor_class_sum.cc | 0 src/{ => accessor/todo}/grib_accessor_class_suppressed.cc | 0 src/{ => accessor/todo}/grib_accessor_class_time.cc | 0 src/{ => accessor/todo}/grib_accessor_class_to_double.cc | 0 src/{ => accessor/todo}/grib_accessor_class_to_integer.cc | 0 src/{ => accessor/todo}/grib_accessor_class_to_string.cc | 0 src/{ => accessor/todo}/grib_accessor_class_transient.cc | 0 .../todo}/grib_accessor_class_transient_darray.cc | 0 src/{ => accessor/todo}/grib_accessor_class_trim.cc | 0 src/{ => accessor/todo}/grib_accessor_class_uint16.cc | 0 src/{ => accessor/todo}/grib_accessor_class_uint32.cc | 0 .../todo}/grib_accessor_class_uint32_little_endian.cc | 0 src/{ => accessor/todo}/grib_accessor_class_uint64.cc | 0 .../todo}/grib_accessor_class_uint64_little_endian.cc | 0 src/{ => accessor/todo}/grib_accessor_class_uint8.cc | 0 .../todo}/grib_accessor_class_unexpanded_descriptors.cc | 0 .../todo}/grib_accessor_class_unpack_bufr_values.cc | 0 src/{ => accessor/todo}/grib_accessor_class_unsigned.cc | 0 src/{ => accessor/todo}/grib_accessor_class_unsigned_bits.cc | 0 src/{ => accessor/todo}/grib_accessor_class_validity_date.cc | 0 src/{ => accessor/todo}/grib_accessor_class_validity_time.cc | 0 src/{ => accessor/todo}/grib_accessor_class_values.cc | 0 src/{ => accessor/todo}/grib_accessor_class_variable.cc | 0 src/{ => accessor/todo}/grib_accessor_class_vector.cc | 0 src/{ => accessor/todo}/grib_accessor_class_when.cc | 0 205 files changed, 3 insertions(+) rename src/{ => accessor/todo}/grib_accessor_class_abstract_long_vector.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_abstract_vector.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_ascii.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bit.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bitmap.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bits.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bits_per_value.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_blob.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_budgdate.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bufr_data_array.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bufr_data_element.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bufr_elements_table.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bufr_extract_area_subsets.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bufr_extract_datetime_subsets.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bufr_extract_subsets.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bufr_group.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bufr_simple_thinning.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bufr_string_values.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bufrdc_expanded_descriptors.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_bytes.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_change_alternative_row_scanning.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_change_scanning_direction.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_check_internal_version.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_closest_date.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_codeflag.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_codetable.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_codetable_title.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_codetable_units.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_concept.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_constant.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_count_file.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_count_missing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_count_total.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_apply_bitmap.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_apply_boustrophedonic.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_ccsds_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_complex_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_dummy_field.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g1complex_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g1second_order_constant_width_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g1second_order_general_extended_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g1second_order_general_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g1second_order_row_by_row_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g1secondary_bitmap.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g1shsimple_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g1simple_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g22order_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g2bifourier_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g2complex_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g2secondary_bitmap.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g2shsimple_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g2simple_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_jpeg2000_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_png_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_raw_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_run_length_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_secondary_bitmap.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_sh_packed.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_sh_unpacked.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_shsimple_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_data_simple_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_decimal_precision.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_dictionary.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_dirty.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_divdouble.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_double.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_element.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_evaluate.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_expanded_descriptors.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_from_scale_factor_scaled_value.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1_half_byte_codeflag.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1_message_length.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1_section4_length.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1bitmap.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1date.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1day_of_the_year_date.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1end_of_interval_monthly.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1fcperiod.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1forecastmonth.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1monthlydate.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1number_of_coded_values_sh_complex.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1number_of_coded_values_sh_simple.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1step_range.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g1verificationdate.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2_aerosol.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2_chemical.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2_eps.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2_mars_labeling.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2bitmap.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2bitmap_present.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2date.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2end_step.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2grid.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2latlon.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2level.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2lon.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_g2step_range.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_gaussian_grid_name.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_gds_is_present.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_gds_not_present_bitmap.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_gen.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_getenv.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_global_gaussian.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_group.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_gts_header.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_hash_array.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_headers_only.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_ibmfloat.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_ieeefloat.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_ifs_param.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_iterator.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_julian_date.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_julian_day.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_ksec1expver.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_label.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_latitudes.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_latlon_increment.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_latlonvalues.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_library_version.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_local_definition.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_long.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_long_vector.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_longitudes.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_lookup.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_mars_param.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_mars_step.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_md5.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_message.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_message_copy.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_multdouble.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_nearest.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_non_alpha.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_number_of_coded_values.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_number_of_points.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_number_of_points_gaussian.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_number_of_values.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_number_of_values_data_raw_packing.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_octahedral_gaussian.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_octet_number.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_offset_file.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_offset_values.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_optimal_step_units.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_pack_bufr_values.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_packing_type.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_pad.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_padding.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_padto.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_padtoeven.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_padtomultiple.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_position.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_proj_string.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_raw.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_rdbtime_guess_date.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_reference_value_error.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_round.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_scale.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_scale_values.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_second_order_bits_per_value.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_section.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_section_length.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_section_padding.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_section_pointer.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_select_step_template.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_sexagesimal2decimal.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_signed.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_signed_bits.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_simple_packing_error.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_size.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_smart_table.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_smart_table_column.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_spd.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_spectral_truncation.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_sprintf.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_statistics.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_statistics_spectral.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_step_human_readable.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_step_in_units.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_sum.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_suppressed.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_time.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_to_double.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_to_integer.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_to_string.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_transient.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_transient_darray.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_trim.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_uint16.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_uint32.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_uint32_little_endian.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_uint64.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_uint64_little_endian.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_uint8.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_unexpanded_descriptors.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_unpack_bufr_values.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_unsigned.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_unsigned_bits.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_validity_date.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_validity_time.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_values.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_variable.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_vector.cc (100%) rename src/{ => accessor/todo}/grib_accessor_class_when.cc (100%) diff --git a/.gitignore b/.gitignore index bfdfd9434..8791994fc 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,8 @@ grib_api.pc grib_api_f90.pc *.analyzerinfo *.snalyzerinfo +tags +src/convert_*.sh # compiled source # ################### @@ -72,3 +74,4 @@ data/bufr/*test build/ *.back +trash diff --git a/src/grib_accessor_class_abstract_long_vector.cc b/src/accessor/todo/grib_accessor_class_abstract_long_vector.cc similarity index 100% rename from src/grib_accessor_class_abstract_long_vector.cc rename to src/accessor/todo/grib_accessor_class_abstract_long_vector.cc diff --git a/src/grib_accessor_class_abstract_vector.cc b/src/accessor/todo/grib_accessor_class_abstract_vector.cc similarity index 100% rename from src/grib_accessor_class_abstract_vector.cc rename to src/accessor/todo/grib_accessor_class_abstract_vector.cc diff --git a/src/grib_accessor_class_ascii.cc b/src/accessor/todo/grib_accessor_class_ascii.cc similarity index 100% rename from src/grib_accessor_class_ascii.cc rename to src/accessor/todo/grib_accessor_class_ascii.cc diff --git a/src/grib_accessor_class_bit.cc b/src/accessor/todo/grib_accessor_class_bit.cc similarity index 100% rename from src/grib_accessor_class_bit.cc rename to src/accessor/todo/grib_accessor_class_bit.cc diff --git a/src/grib_accessor_class_bitmap.cc b/src/accessor/todo/grib_accessor_class_bitmap.cc similarity index 100% rename from src/grib_accessor_class_bitmap.cc rename to src/accessor/todo/grib_accessor_class_bitmap.cc diff --git a/src/grib_accessor_class_bits.cc b/src/accessor/todo/grib_accessor_class_bits.cc similarity index 100% rename from src/grib_accessor_class_bits.cc rename to src/accessor/todo/grib_accessor_class_bits.cc diff --git a/src/grib_accessor_class_bits_per_value.cc b/src/accessor/todo/grib_accessor_class_bits_per_value.cc similarity index 100% rename from src/grib_accessor_class_bits_per_value.cc rename to src/accessor/todo/grib_accessor_class_bits_per_value.cc diff --git a/src/grib_accessor_class_blob.cc b/src/accessor/todo/grib_accessor_class_blob.cc similarity index 100% rename from src/grib_accessor_class_blob.cc rename to src/accessor/todo/grib_accessor_class_blob.cc diff --git a/src/grib_accessor_class_budgdate.cc b/src/accessor/todo/grib_accessor_class_budgdate.cc similarity index 100% rename from src/grib_accessor_class_budgdate.cc rename to src/accessor/todo/grib_accessor_class_budgdate.cc diff --git a/src/grib_accessor_class_bufr_data_array.cc b/src/accessor/todo/grib_accessor_class_bufr_data_array.cc similarity index 100% rename from src/grib_accessor_class_bufr_data_array.cc rename to src/accessor/todo/grib_accessor_class_bufr_data_array.cc diff --git a/src/grib_accessor_class_bufr_data_element.cc b/src/accessor/todo/grib_accessor_class_bufr_data_element.cc similarity index 100% rename from src/grib_accessor_class_bufr_data_element.cc rename to src/accessor/todo/grib_accessor_class_bufr_data_element.cc diff --git a/src/grib_accessor_class_bufr_elements_table.cc b/src/accessor/todo/grib_accessor_class_bufr_elements_table.cc similarity index 100% rename from src/grib_accessor_class_bufr_elements_table.cc rename to src/accessor/todo/grib_accessor_class_bufr_elements_table.cc diff --git a/src/grib_accessor_class_bufr_extract_area_subsets.cc b/src/accessor/todo/grib_accessor_class_bufr_extract_area_subsets.cc similarity index 100% rename from src/grib_accessor_class_bufr_extract_area_subsets.cc rename to src/accessor/todo/grib_accessor_class_bufr_extract_area_subsets.cc diff --git a/src/grib_accessor_class_bufr_extract_datetime_subsets.cc b/src/accessor/todo/grib_accessor_class_bufr_extract_datetime_subsets.cc similarity index 100% rename from src/grib_accessor_class_bufr_extract_datetime_subsets.cc rename to src/accessor/todo/grib_accessor_class_bufr_extract_datetime_subsets.cc diff --git a/src/grib_accessor_class_bufr_extract_subsets.cc b/src/accessor/todo/grib_accessor_class_bufr_extract_subsets.cc similarity index 100% rename from src/grib_accessor_class_bufr_extract_subsets.cc rename to src/accessor/todo/grib_accessor_class_bufr_extract_subsets.cc diff --git a/src/grib_accessor_class_bufr_group.cc b/src/accessor/todo/grib_accessor_class_bufr_group.cc similarity index 100% rename from src/grib_accessor_class_bufr_group.cc rename to src/accessor/todo/grib_accessor_class_bufr_group.cc diff --git a/src/grib_accessor_class_bufr_simple_thinning.cc b/src/accessor/todo/grib_accessor_class_bufr_simple_thinning.cc similarity index 100% rename from src/grib_accessor_class_bufr_simple_thinning.cc rename to src/accessor/todo/grib_accessor_class_bufr_simple_thinning.cc diff --git a/src/grib_accessor_class_bufr_string_values.cc b/src/accessor/todo/grib_accessor_class_bufr_string_values.cc similarity index 100% rename from src/grib_accessor_class_bufr_string_values.cc rename to src/accessor/todo/grib_accessor_class_bufr_string_values.cc diff --git a/src/grib_accessor_class_bufrdc_expanded_descriptors.cc b/src/accessor/todo/grib_accessor_class_bufrdc_expanded_descriptors.cc similarity index 100% rename from src/grib_accessor_class_bufrdc_expanded_descriptors.cc rename to src/accessor/todo/grib_accessor_class_bufrdc_expanded_descriptors.cc diff --git a/src/grib_accessor_class_bytes.cc b/src/accessor/todo/grib_accessor_class_bytes.cc similarity index 100% rename from src/grib_accessor_class_bytes.cc rename to src/accessor/todo/grib_accessor_class_bytes.cc diff --git a/src/grib_accessor_class_change_alternative_row_scanning.cc b/src/accessor/todo/grib_accessor_class_change_alternative_row_scanning.cc similarity index 100% rename from src/grib_accessor_class_change_alternative_row_scanning.cc rename to src/accessor/todo/grib_accessor_class_change_alternative_row_scanning.cc diff --git a/src/grib_accessor_class_change_scanning_direction.cc b/src/accessor/todo/grib_accessor_class_change_scanning_direction.cc similarity index 100% rename from src/grib_accessor_class_change_scanning_direction.cc rename to src/accessor/todo/grib_accessor_class_change_scanning_direction.cc diff --git a/src/grib_accessor_class_check_internal_version.cc b/src/accessor/todo/grib_accessor_class_check_internal_version.cc similarity index 100% rename from src/grib_accessor_class_check_internal_version.cc rename to src/accessor/todo/grib_accessor_class_check_internal_version.cc diff --git a/src/grib_accessor_class_closest_date.cc b/src/accessor/todo/grib_accessor_class_closest_date.cc similarity index 100% rename from src/grib_accessor_class_closest_date.cc rename to src/accessor/todo/grib_accessor_class_closest_date.cc diff --git a/src/grib_accessor_class_codeflag.cc b/src/accessor/todo/grib_accessor_class_codeflag.cc similarity index 100% rename from src/grib_accessor_class_codeflag.cc rename to src/accessor/todo/grib_accessor_class_codeflag.cc diff --git a/src/grib_accessor_class_codetable.cc b/src/accessor/todo/grib_accessor_class_codetable.cc similarity index 100% rename from src/grib_accessor_class_codetable.cc rename to src/accessor/todo/grib_accessor_class_codetable.cc diff --git a/src/grib_accessor_class_codetable_title.cc b/src/accessor/todo/grib_accessor_class_codetable_title.cc similarity index 100% rename from src/grib_accessor_class_codetable_title.cc rename to src/accessor/todo/grib_accessor_class_codetable_title.cc diff --git a/src/grib_accessor_class_codetable_units.cc b/src/accessor/todo/grib_accessor_class_codetable_units.cc similarity index 100% rename from src/grib_accessor_class_codetable_units.cc rename to src/accessor/todo/grib_accessor_class_codetable_units.cc diff --git a/src/grib_accessor_class_concept.cc b/src/accessor/todo/grib_accessor_class_concept.cc similarity index 100% rename from src/grib_accessor_class_concept.cc rename to src/accessor/todo/grib_accessor_class_concept.cc diff --git a/src/grib_accessor_class_constant.cc b/src/accessor/todo/grib_accessor_class_constant.cc similarity index 100% rename from src/grib_accessor_class_constant.cc rename to src/accessor/todo/grib_accessor_class_constant.cc diff --git a/src/grib_accessor_class_count_file.cc b/src/accessor/todo/grib_accessor_class_count_file.cc similarity index 100% rename from src/grib_accessor_class_count_file.cc rename to src/accessor/todo/grib_accessor_class_count_file.cc diff --git a/src/grib_accessor_class_count_missing.cc b/src/accessor/todo/grib_accessor_class_count_missing.cc similarity index 100% rename from src/grib_accessor_class_count_missing.cc rename to src/accessor/todo/grib_accessor_class_count_missing.cc diff --git a/src/grib_accessor_class_count_total.cc b/src/accessor/todo/grib_accessor_class_count_total.cc similarity index 100% rename from src/grib_accessor_class_count_total.cc rename to src/accessor/todo/grib_accessor_class_count_total.cc diff --git a/src/grib_accessor_class_data_apply_bitmap.cc b/src/accessor/todo/grib_accessor_class_data_apply_bitmap.cc similarity index 100% rename from src/grib_accessor_class_data_apply_bitmap.cc rename to src/accessor/todo/grib_accessor_class_data_apply_bitmap.cc diff --git a/src/grib_accessor_class_data_apply_boustrophedonic.cc b/src/accessor/todo/grib_accessor_class_data_apply_boustrophedonic.cc similarity index 100% rename from src/grib_accessor_class_data_apply_boustrophedonic.cc rename to src/accessor/todo/grib_accessor_class_data_apply_boustrophedonic.cc diff --git a/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc b/src/accessor/todo/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc similarity index 100% rename from src/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc rename to src/accessor/todo/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/accessor/todo/grib_accessor_class_data_ccsds_packing.cc similarity index 100% rename from src/grib_accessor_class_data_ccsds_packing.cc rename to src/accessor/todo/grib_accessor_class_data_ccsds_packing.cc diff --git a/src/grib_accessor_class_data_complex_packing.cc b/src/accessor/todo/grib_accessor_class_data_complex_packing.cc similarity index 100% rename from src/grib_accessor_class_data_complex_packing.cc rename to src/accessor/todo/grib_accessor_class_data_complex_packing.cc diff --git a/src/grib_accessor_class_data_dummy_field.cc b/src/accessor/todo/grib_accessor_class_data_dummy_field.cc similarity index 100% rename from src/grib_accessor_class_data_dummy_field.cc rename to src/accessor/todo/grib_accessor_class_data_dummy_field.cc diff --git a/src/grib_accessor_class_data_g1complex_packing.cc b/src/accessor/todo/grib_accessor_class_data_g1complex_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g1complex_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g1complex_packing.cc diff --git a/src/grib_accessor_class_data_g1second_order_constant_width_packing.cc b/src/accessor/todo/grib_accessor_class_data_g1second_order_constant_width_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g1second_order_constant_width_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g1second_order_constant_width_packing.cc diff --git a/src/grib_accessor_class_data_g1second_order_general_extended_packing.cc b/src/accessor/todo/grib_accessor_class_data_g1second_order_general_extended_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g1second_order_general_extended_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g1second_order_general_extended_packing.cc diff --git a/src/grib_accessor_class_data_g1second_order_general_packing.cc b/src/accessor/todo/grib_accessor_class_data_g1second_order_general_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g1second_order_general_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g1second_order_general_packing.cc diff --git a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.cc b/src/accessor/todo/grib_accessor_class_data_g1second_order_row_by_row_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g1second_order_row_by_row_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g1second_order_row_by_row_packing.cc diff --git a/src/grib_accessor_class_data_g1secondary_bitmap.cc b/src/accessor/todo/grib_accessor_class_data_g1secondary_bitmap.cc similarity index 100% rename from src/grib_accessor_class_data_g1secondary_bitmap.cc rename to src/accessor/todo/grib_accessor_class_data_g1secondary_bitmap.cc diff --git a/src/grib_accessor_class_data_g1shsimple_packing.cc b/src/accessor/todo/grib_accessor_class_data_g1shsimple_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g1shsimple_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g1shsimple_packing.cc diff --git a/src/grib_accessor_class_data_g1simple_packing.cc b/src/accessor/todo/grib_accessor_class_data_g1simple_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g1simple_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g1simple_packing.cc diff --git a/src/grib_accessor_class_data_g22order_packing.cc b/src/accessor/todo/grib_accessor_class_data_g22order_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g22order_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g22order_packing.cc diff --git a/src/grib_accessor_class_data_g2bifourier_packing.cc b/src/accessor/todo/grib_accessor_class_data_g2bifourier_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g2bifourier_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g2bifourier_packing.cc diff --git a/src/grib_accessor_class_data_g2complex_packing.cc b/src/accessor/todo/grib_accessor_class_data_g2complex_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g2complex_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g2complex_packing.cc diff --git a/src/grib_accessor_class_data_g2secondary_bitmap.cc b/src/accessor/todo/grib_accessor_class_data_g2secondary_bitmap.cc similarity index 100% rename from src/grib_accessor_class_data_g2secondary_bitmap.cc rename to src/accessor/todo/grib_accessor_class_data_g2secondary_bitmap.cc diff --git a/src/grib_accessor_class_data_g2shsimple_packing.cc b/src/accessor/todo/grib_accessor_class_data_g2shsimple_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g2shsimple_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g2shsimple_packing.cc diff --git a/src/grib_accessor_class_data_g2simple_packing.cc b/src/accessor/todo/grib_accessor_class_data_g2simple_packing.cc similarity index 100% rename from src/grib_accessor_class_data_g2simple_packing.cc rename to src/accessor/todo/grib_accessor_class_data_g2simple_packing.cc diff --git a/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc b/src/accessor/todo/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc similarity index 100% rename from src/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc rename to src/accessor/todo/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc diff --git a/src/grib_accessor_class_data_jpeg2000_packing.cc b/src/accessor/todo/grib_accessor_class_data_jpeg2000_packing.cc similarity index 100% rename from src/grib_accessor_class_data_jpeg2000_packing.cc rename to src/accessor/todo/grib_accessor_class_data_jpeg2000_packing.cc diff --git a/src/grib_accessor_class_data_png_packing.cc b/src/accessor/todo/grib_accessor_class_data_png_packing.cc similarity index 100% rename from src/grib_accessor_class_data_png_packing.cc rename to src/accessor/todo/grib_accessor_class_data_png_packing.cc diff --git a/src/grib_accessor_class_data_raw_packing.cc b/src/accessor/todo/grib_accessor_class_data_raw_packing.cc similarity index 100% rename from src/grib_accessor_class_data_raw_packing.cc rename to src/accessor/todo/grib_accessor_class_data_raw_packing.cc diff --git a/src/grib_accessor_class_data_run_length_packing.cc b/src/accessor/todo/grib_accessor_class_data_run_length_packing.cc similarity index 100% rename from src/grib_accessor_class_data_run_length_packing.cc rename to src/accessor/todo/grib_accessor_class_data_run_length_packing.cc diff --git a/src/grib_accessor_class_data_secondary_bitmap.cc b/src/accessor/todo/grib_accessor_class_data_secondary_bitmap.cc similarity index 100% rename from src/grib_accessor_class_data_secondary_bitmap.cc rename to src/accessor/todo/grib_accessor_class_data_secondary_bitmap.cc diff --git a/src/grib_accessor_class_data_sh_packed.cc b/src/accessor/todo/grib_accessor_class_data_sh_packed.cc similarity index 100% rename from src/grib_accessor_class_data_sh_packed.cc rename to src/accessor/todo/grib_accessor_class_data_sh_packed.cc diff --git a/src/grib_accessor_class_data_sh_unpacked.cc b/src/accessor/todo/grib_accessor_class_data_sh_unpacked.cc similarity index 100% rename from src/grib_accessor_class_data_sh_unpacked.cc rename to src/accessor/todo/grib_accessor_class_data_sh_unpacked.cc diff --git a/src/grib_accessor_class_data_shsimple_packing.cc b/src/accessor/todo/grib_accessor_class_data_shsimple_packing.cc similarity index 100% rename from src/grib_accessor_class_data_shsimple_packing.cc rename to src/accessor/todo/grib_accessor_class_data_shsimple_packing.cc diff --git a/src/grib_accessor_class_data_simple_packing.cc b/src/accessor/todo/grib_accessor_class_data_simple_packing.cc similarity index 100% rename from src/grib_accessor_class_data_simple_packing.cc rename to src/accessor/todo/grib_accessor_class_data_simple_packing.cc diff --git a/src/grib_accessor_class_decimal_precision.cc b/src/accessor/todo/grib_accessor_class_decimal_precision.cc similarity index 100% rename from src/grib_accessor_class_decimal_precision.cc rename to src/accessor/todo/grib_accessor_class_decimal_precision.cc diff --git a/src/grib_accessor_class_dictionary.cc b/src/accessor/todo/grib_accessor_class_dictionary.cc similarity index 100% rename from src/grib_accessor_class_dictionary.cc rename to src/accessor/todo/grib_accessor_class_dictionary.cc diff --git a/src/grib_accessor_class_dirty.cc b/src/accessor/todo/grib_accessor_class_dirty.cc similarity index 100% rename from src/grib_accessor_class_dirty.cc rename to src/accessor/todo/grib_accessor_class_dirty.cc diff --git a/src/grib_accessor_class_divdouble.cc b/src/accessor/todo/grib_accessor_class_divdouble.cc similarity index 100% rename from src/grib_accessor_class_divdouble.cc rename to src/accessor/todo/grib_accessor_class_divdouble.cc diff --git a/src/grib_accessor_class_double.cc b/src/accessor/todo/grib_accessor_class_double.cc similarity index 100% rename from src/grib_accessor_class_double.cc rename to src/accessor/todo/grib_accessor_class_double.cc diff --git a/src/grib_accessor_class_element.cc b/src/accessor/todo/grib_accessor_class_element.cc similarity index 100% rename from src/grib_accessor_class_element.cc rename to src/accessor/todo/grib_accessor_class_element.cc diff --git a/src/grib_accessor_class_evaluate.cc b/src/accessor/todo/grib_accessor_class_evaluate.cc similarity index 100% rename from src/grib_accessor_class_evaluate.cc rename to src/accessor/todo/grib_accessor_class_evaluate.cc diff --git a/src/grib_accessor_class_expanded_descriptors.cc b/src/accessor/todo/grib_accessor_class_expanded_descriptors.cc similarity index 100% rename from src/grib_accessor_class_expanded_descriptors.cc rename to src/accessor/todo/grib_accessor_class_expanded_descriptors.cc diff --git a/src/grib_accessor_class_from_scale_factor_scaled_value.cc b/src/accessor/todo/grib_accessor_class_from_scale_factor_scaled_value.cc similarity index 100% rename from src/grib_accessor_class_from_scale_factor_scaled_value.cc rename to src/accessor/todo/grib_accessor_class_from_scale_factor_scaled_value.cc diff --git a/src/grib_accessor_class_g1_half_byte_codeflag.cc b/src/accessor/todo/grib_accessor_class_g1_half_byte_codeflag.cc similarity index 100% rename from src/grib_accessor_class_g1_half_byte_codeflag.cc rename to src/accessor/todo/grib_accessor_class_g1_half_byte_codeflag.cc diff --git a/src/grib_accessor_class_g1_message_length.cc b/src/accessor/todo/grib_accessor_class_g1_message_length.cc similarity index 100% rename from src/grib_accessor_class_g1_message_length.cc rename to src/accessor/todo/grib_accessor_class_g1_message_length.cc diff --git a/src/grib_accessor_class_g1_section4_length.cc b/src/accessor/todo/grib_accessor_class_g1_section4_length.cc similarity index 100% rename from src/grib_accessor_class_g1_section4_length.cc rename to src/accessor/todo/grib_accessor_class_g1_section4_length.cc diff --git a/src/grib_accessor_class_g1bitmap.cc b/src/accessor/todo/grib_accessor_class_g1bitmap.cc similarity index 100% rename from src/grib_accessor_class_g1bitmap.cc rename to src/accessor/todo/grib_accessor_class_g1bitmap.cc diff --git a/src/grib_accessor_class_g1date.cc b/src/accessor/todo/grib_accessor_class_g1date.cc similarity index 100% rename from src/grib_accessor_class_g1date.cc rename to src/accessor/todo/grib_accessor_class_g1date.cc diff --git a/src/grib_accessor_class_g1day_of_the_year_date.cc b/src/accessor/todo/grib_accessor_class_g1day_of_the_year_date.cc similarity index 100% rename from src/grib_accessor_class_g1day_of_the_year_date.cc rename to src/accessor/todo/grib_accessor_class_g1day_of_the_year_date.cc diff --git a/src/grib_accessor_class_g1end_of_interval_monthly.cc b/src/accessor/todo/grib_accessor_class_g1end_of_interval_monthly.cc similarity index 100% rename from src/grib_accessor_class_g1end_of_interval_monthly.cc rename to src/accessor/todo/grib_accessor_class_g1end_of_interval_monthly.cc diff --git a/src/grib_accessor_class_g1fcperiod.cc b/src/accessor/todo/grib_accessor_class_g1fcperiod.cc similarity index 100% rename from src/grib_accessor_class_g1fcperiod.cc rename to src/accessor/todo/grib_accessor_class_g1fcperiod.cc diff --git a/src/grib_accessor_class_g1forecastmonth.cc b/src/accessor/todo/grib_accessor_class_g1forecastmonth.cc similarity index 100% rename from src/grib_accessor_class_g1forecastmonth.cc rename to src/accessor/todo/grib_accessor_class_g1forecastmonth.cc diff --git a/src/grib_accessor_class_g1monthlydate.cc b/src/accessor/todo/grib_accessor_class_g1monthlydate.cc similarity index 100% rename from src/grib_accessor_class_g1monthlydate.cc rename to src/accessor/todo/grib_accessor_class_g1monthlydate.cc diff --git a/src/grib_accessor_class_g1number_of_coded_values_sh_complex.cc b/src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_complex.cc similarity index 100% rename from src/grib_accessor_class_g1number_of_coded_values_sh_complex.cc rename to src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_complex.cc diff --git a/src/grib_accessor_class_g1number_of_coded_values_sh_simple.cc b/src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_simple.cc similarity index 100% rename from src/grib_accessor_class_g1number_of_coded_values_sh_simple.cc rename to src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_simple.cc diff --git a/src/grib_accessor_class_g1step_range.cc b/src/accessor/todo/grib_accessor_class_g1step_range.cc similarity index 100% rename from src/grib_accessor_class_g1step_range.cc rename to src/accessor/todo/grib_accessor_class_g1step_range.cc diff --git a/src/grib_accessor_class_g1verificationdate.cc b/src/accessor/todo/grib_accessor_class_g1verificationdate.cc similarity index 100% rename from src/grib_accessor_class_g1verificationdate.cc rename to src/accessor/todo/grib_accessor_class_g1verificationdate.cc diff --git a/src/grib_accessor_class_g2_aerosol.cc b/src/accessor/todo/grib_accessor_class_g2_aerosol.cc similarity index 100% rename from src/grib_accessor_class_g2_aerosol.cc rename to src/accessor/todo/grib_accessor_class_g2_aerosol.cc diff --git a/src/grib_accessor_class_g2_chemical.cc b/src/accessor/todo/grib_accessor_class_g2_chemical.cc similarity index 100% rename from src/grib_accessor_class_g2_chemical.cc rename to src/accessor/todo/grib_accessor_class_g2_chemical.cc diff --git a/src/grib_accessor_class_g2_eps.cc b/src/accessor/todo/grib_accessor_class_g2_eps.cc similarity index 100% rename from src/grib_accessor_class_g2_eps.cc rename to src/accessor/todo/grib_accessor_class_g2_eps.cc diff --git a/src/grib_accessor_class_g2_mars_labeling.cc b/src/accessor/todo/grib_accessor_class_g2_mars_labeling.cc similarity index 100% rename from src/grib_accessor_class_g2_mars_labeling.cc rename to src/accessor/todo/grib_accessor_class_g2_mars_labeling.cc diff --git a/src/grib_accessor_class_g2bitmap.cc b/src/accessor/todo/grib_accessor_class_g2bitmap.cc similarity index 100% rename from src/grib_accessor_class_g2bitmap.cc rename to src/accessor/todo/grib_accessor_class_g2bitmap.cc diff --git a/src/grib_accessor_class_g2bitmap_present.cc b/src/accessor/todo/grib_accessor_class_g2bitmap_present.cc similarity index 100% rename from src/grib_accessor_class_g2bitmap_present.cc rename to src/accessor/todo/grib_accessor_class_g2bitmap_present.cc diff --git a/src/grib_accessor_class_g2date.cc b/src/accessor/todo/grib_accessor_class_g2date.cc similarity index 100% rename from src/grib_accessor_class_g2date.cc rename to src/accessor/todo/grib_accessor_class_g2date.cc diff --git a/src/grib_accessor_class_g2end_step.cc b/src/accessor/todo/grib_accessor_class_g2end_step.cc similarity index 100% rename from src/grib_accessor_class_g2end_step.cc rename to src/accessor/todo/grib_accessor_class_g2end_step.cc diff --git a/src/grib_accessor_class_g2grid.cc b/src/accessor/todo/grib_accessor_class_g2grid.cc similarity index 100% rename from src/grib_accessor_class_g2grid.cc rename to src/accessor/todo/grib_accessor_class_g2grid.cc diff --git a/src/grib_accessor_class_g2latlon.cc b/src/accessor/todo/grib_accessor_class_g2latlon.cc similarity index 100% rename from src/grib_accessor_class_g2latlon.cc rename to src/accessor/todo/grib_accessor_class_g2latlon.cc diff --git a/src/grib_accessor_class_g2level.cc b/src/accessor/todo/grib_accessor_class_g2level.cc similarity index 100% rename from src/grib_accessor_class_g2level.cc rename to src/accessor/todo/grib_accessor_class_g2level.cc diff --git a/src/grib_accessor_class_g2lon.cc b/src/accessor/todo/grib_accessor_class_g2lon.cc similarity index 100% rename from src/grib_accessor_class_g2lon.cc rename to src/accessor/todo/grib_accessor_class_g2lon.cc diff --git a/src/grib_accessor_class_g2step_range.cc b/src/accessor/todo/grib_accessor_class_g2step_range.cc similarity index 100% rename from src/grib_accessor_class_g2step_range.cc rename to src/accessor/todo/grib_accessor_class_g2step_range.cc diff --git a/src/grib_accessor_class_gaussian_grid_name.cc b/src/accessor/todo/grib_accessor_class_gaussian_grid_name.cc similarity index 100% rename from src/grib_accessor_class_gaussian_grid_name.cc rename to src/accessor/todo/grib_accessor_class_gaussian_grid_name.cc diff --git a/src/grib_accessor_class_gds_is_present.cc b/src/accessor/todo/grib_accessor_class_gds_is_present.cc similarity index 100% rename from src/grib_accessor_class_gds_is_present.cc rename to src/accessor/todo/grib_accessor_class_gds_is_present.cc diff --git a/src/grib_accessor_class_gds_not_present_bitmap.cc b/src/accessor/todo/grib_accessor_class_gds_not_present_bitmap.cc similarity index 100% rename from src/grib_accessor_class_gds_not_present_bitmap.cc rename to src/accessor/todo/grib_accessor_class_gds_not_present_bitmap.cc diff --git a/src/grib_accessor_class_gen.cc b/src/accessor/todo/grib_accessor_class_gen.cc similarity index 100% rename from src/grib_accessor_class_gen.cc rename to src/accessor/todo/grib_accessor_class_gen.cc diff --git a/src/grib_accessor_class_getenv.cc b/src/accessor/todo/grib_accessor_class_getenv.cc similarity index 100% rename from src/grib_accessor_class_getenv.cc rename to src/accessor/todo/grib_accessor_class_getenv.cc diff --git a/src/grib_accessor_class_global_gaussian.cc b/src/accessor/todo/grib_accessor_class_global_gaussian.cc similarity index 100% rename from src/grib_accessor_class_global_gaussian.cc rename to src/accessor/todo/grib_accessor_class_global_gaussian.cc diff --git a/src/grib_accessor_class_group.cc b/src/accessor/todo/grib_accessor_class_group.cc similarity index 100% rename from src/grib_accessor_class_group.cc rename to src/accessor/todo/grib_accessor_class_group.cc diff --git a/src/grib_accessor_class_gts_header.cc b/src/accessor/todo/grib_accessor_class_gts_header.cc similarity index 100% rename from src/grib_accessor_class_gts_header.cc rename to src/accessor/todo/grib_accessor_class_gts_header.cc diff --git a/src/grib_accessor_class_hash_array.cc b/src/accessor/todo/grib_accessor_class_hash_array.cc similarity index 100% rename from src/grib_accessor_class_hash_array.cc rename to src/accessor/todo/grib_accessor_class_hash_array.cc diff --git a/src/grib_accessor_class_headers_only.cc b/src/accessor/todo/grib_accessor_class_headers_only.cc similarity index 100% rename from src/grib_accessor_class_headers_only.cc rename to src/accessor/todo/grib_accessor_class_headers_only.cc diff --git a/src/grib_accessor_class_ibmfloat.cc b/src/accessor/todo/grib_accessor_class_ibmfloat.cc similarity index 100% rename from src/grib_accessor_class_ibmfloat.cc rename to src/accessor/todo/grib_accessor_class_ibmfloat.cc diff --git a/src/grib_accessor_class_ieeefloat.cc b/src/accessor/todo/grib_accessor_class_ieeefloat.cc similarity index 100% rename from src/grib_accessor_class_ieeefloat.cc rename to src/accessor/todo/grib_accessor_class_ieeefloat.cc diff --git a/src/grib_accessor_class_ifs_param.cc b/src/accessor/todo/grib_accessor_class_ifs_param.cc similarity index 100% rename from src/grib_accessor_class_ifs_param.cc rename to src/accessor/todo/grib_accessor_class_ifs_param.cc diff --git a/src/grib_accessor_class_iterator.cc b/src/accessor/todo/grib_accessor_class_iterator.cc similarity index 100% rename from src/grib_accessor_class_iterator.cc rename to src/accessor/todo/grib_accessor_class_iterator.cc diff --git a/src/grib_accessor_class_julian_date.cc b/src/accessor/todo/grib_accessor_class_julian_date.cc similarity index 100% rename from src/grib_accessor_class_julian_date.cc rename to src/accessor/todo/grib_accessor_class_julian_date.cc diff --git a/src/grib_accessor_class_julian_day.cc b/src/accessor/todo/grib_accessor_class_julian_day.cc similarity index 100% rename from src/grib_accessor_class_julian_day.cc rename to src/accessor/todo/grib_accessor_class_julian_day.cc diff --git a/src/grib_accessor_class_ksec1expver.cc b/src/accessor/todo/grib_accessor_class_ksec1expver.cc similarity index 100% rename from src/grib_accessor_class_ksec1expver.cc rename to src/accessor/todo/grib_accessor_class_ksec1expver.cc diff --git a/src/grib_accessor_class_label.cc b/src/accessor/todo/grib_accessor_class_label.cc similarity index 100% rename from src/grib_accessor_class_label.cc rename to src/accessor/todo/grib_accessor_class_label.cc diff --git a/src/grib_accessor_class_latitudes.cc b/src/accessor/todo/grib_accessor_class_latitudes.cc similarity index 100% rename from src/grib_accessor_class_latitudes.cc rename to src/accessor/todo/grib_accessor_class_latitudes.cc diff --git a/src/grib_accessor_class_latlon_increment.cc b/src/accessor/todo/grib_accessor_class_latlon_increment.cc similarity index 100% rename from src/grib_accessor_class_latlon_increment.cc rename to src/accessor/todo/grib_accessor_class_latlon_increment.cc diff --git a/src/grib_accessor_class_latlonvalues.cc b/src/accessor/todo/grib_accessor_class_latlonvalues.cc similarity index 100% rename from src/grib_accessor_class_latlonvalues.cc rename to src/accessor/todo/grib_accessor_class_latlonvalues.cc diff --git a/src/grib_accessor_class_library_version.cc b/src/accessor/todo/grib_accessor_class_library_version.cc similarity index 100% rename from src/grib_accessor_class_library_version.cc rename to src/accessor/todo/grib_accessor_class_library_version.cc diff --git a/src/grib_accessor_class_local_definition.cc b/src/accessor/todo/grib_accessor_class_local_definition.cc similarity index 100% rename from src/grib_accessor_class_local_definition.cc rename to src/accessor/todo/grib_accessor_class_local_definition.cc diff --git a/src/grib_accessor_class_long.cc b/src/accessor/todo/grib_accessor_class_long.cc similarity index 100% rename from src/grib_accessor_class_long.cc rename to src/accessor/todo/grib_accessor_class_long.cc diff --git a/src/grib_accessor_class_long_vector.cc b/src/accessor/todo/grib_accessor_class_long_vector.cc similarity index 100% rename from src/grib_accessor_class_long_vector.cc rename to src/accessor/todo/grib_accessor_class_long_vector.cc diff --git a/src/grib_accessor_class_longitudes.cc b/src/accessor/todo/grib_accessor_class_longitudes.cc similarity index 100% rename from src/grib_accessor_class_longitudes.cc rename to src/accessor/todo/grib_accessor_class_longitudes.cc diff --git a/src/grib_accessor_class_lookup.cc b/src/accessor/todo/grib_accessor_class_lookup.cc similarity index 100% rename from src/grib_accessor_class_lookup.cc rename to src/accessor/todo/grib_accessor_class_lookup.cc diff --git a/src/grib_accessor_class_mars_param.cc b/src/accessor/todo/grib_accessor_class_mars_param.cc similarity index 100% rename from src/grib_accessor_class_mars_param.cc rename to src/accessor/todo/grib_accessor_class_mars_param.cc diff --git a/src/grib_accessor_class_mars_step.cc b/src/accessor/todo/grib_accessor_class_mars_step.cc similarity index 100% rename from src/grib_accessor_class_mars_step.cc rename to src/accessor/todo/grib_accessor_class_mars_step.cc diff --git a/src/grib_accessor_class_md5.cc b/src/accessor/todo/grib_accessor_class_md5.cc similarity index 100% rename from src/grib_accessor_class_md5.cc rename to src/accessor/todo/grib_accessor_class_md5.cc diff --git a/src/grib_accessor_class_message.cc b/src/accessor/todo/grib_accessor_class_message.cc similarity index 100% rename from src/grib_accessor_class_message.cc rename to src/accessor/todo/grib_accessor_class_message.cc diff --git a/src/grib_accessor_class_message_copy.cc b/src/accessor/todo/grib_accessor_class_message_copy.cc similarity index 100% rename from src/grib_accessor_class_message_copy.cc rename to src/accessor/todo/grib_accessor_class_message_copy.cc diff --git a/src/grib_accessor_class_multdouble.cc b/src/accessor/todo/grib_accessor_class_multdouble.cc similarity index 100% rename from src/grib_accessor_class_multdouble.cc rename to src/accessor/todo/grib_accessor_class_multdouble.cc diff --git a/src/grib_accessor_class_nearest.cc b/src/accessor/todo/grib_accessor_class_nearest.cc similarity index 100% rename from src/grib_accessor_class_nearest.cc rename to src/accessor/todo/grib_accessor_class_nearest.cc diff --git a/src/grib_accessor_class_non_alpha.cc b/src/accessor/todo/grib_accessor_class_non_alpha.cc similarity index 100% rename from src/grib_accessor_class_non_alpha.cc rename to src/accessor/todo/grib_accessor_class_non_alpha.cc diff --git a/src/grib_accessor_class_number_of_coded_values.cc b/src/accessor/todo/grib_accessor_class_number_of_coded_values.cc similarity index 100% rename from src/grib_accessor_class_number_of_coded_values.cc rename to src/accessor/todo/grib_accessor_class_number_of_coded_values.cc diff --git a/src/grib_accessor_class_number_of_points.cc b/src/accessor/todo/grib_accessor_class_number_of_points.cc similarity index 100% rename from src/grib_accessor_class_number_of_points.cc rename to src/accessor/todo/grib_accessor_class_number_of_points.cc diff --git a/src/grib_accessor_class_number_of_points_gaussian.cc b/src/accessor/todo/grib_accessor_class_number_of_points_gaussian.cc similarity index 100% rename from src/grib_accessor_class_number_of_points_gaussian.cc rename to src/accessor/todo/grib_accessor_class_number_of_points_gaussian.cc diff --git a/src/grib_accessor_class_number_of_values.cc b/src/accessor/todo/grib_accessor_class_number_of_values.cc similarity index 100% rename from src/grib_accessor_class_number_of_values.cc rename to src/accessor/todo/grib_accessor_class_number_of_values.cc diff --git a/src/grib_accessor_class_number_of_values_data_raw_packing.cc b/src/accessor/todo/grib_accessor_class_number_of_values_data_raw_packing.cc similarity index 100% rename from src/grib_accessor_class_number_of_values_data_raw_packing.cc rename to src/accessor/todo/grib_accessor_class_number_of_values_data_raw_packing.cc diff --git a/src/grib_accessor_class_octahedral_gaussian.cc b/src/accessor/todo/grib_accessor_class_octahedral_gaussian.cc similarity index 100% rename from src/grib_accessor_class_octahedral_gaussian.cc rename to src/accessor/todo/grib_accessor_class_octahedral_gaussian.cc diff --git a/src/grib_accessor_class_octet_number.cc b/src/accessor/todo/grib_accessor_class_octet_number.cc similarity index 100% rename from src/grib_accessor_class_octet_number.cc rename to src/accessor/todo/grib_accessor_class_octet_number.cc diff --git a/src/grib_accessor_class_offset_file.cc b/src/accessor/todo/grib_accessor_class_offset_file.cc similarity index 100% rename from src/grib_accessor_class_offset_file.cc rename to src/accessor/todo/grib_accessor_class_offset_file.cc diff --git a/src/grib_accessor_class_offset_values.cc b/src/accessor/todo/grib_accessor_class_offset_values.cc similarity index 100% rename from src/grib_accessor_class_offset_values.cc rename to src/accessor/todo/grib_accessor_class_offset_values.cc diff --git a/src/grib_accessor_class_optimal_step_units.cc b/src/accessor/todo/grib_accessor_class_optimal_step_units.cc similarity index 100% rename from src/grib_accessor_class_optimal_step_units.cc rename to src/accessor/todo/grib_accessor_class_optimal_step_units.cc diff --git a/src/grib_accessor_class_pack_bufr_values.cc b/src/accessor/todo/grib_accessor_class_pack_bufr_values.cc similarity index 100% rename from src/grib_accessor_class_pack_bufr_values.cc rename to src/accessor/todo/grib_accessor_class_pack_bufr_values.cc diff --git a/src/grib_accessor_class_packing_type.cc b/src/accessor/todo/grib_accessor_class_packing_type.cc similarity index 100% rename from src/grib_accessor_class_packing_type.cc rename to src/accessor/todo/grib_accessor_class_packing_type.cc diff --git a/src/grib_accessor_class_pad.cc b/src/accessor/todo/grib_accessor_class_pad.cc similarity index 100% rename from src/grib_accessor_class_pad.cc rename to src/accessor/todo/grib_accessor_class_pad.cc diff --git a/src/grib_accessor_class_padding.cc b/src/accessor/todo/grib_accessor_class_padding.cc similarity index 100% rename from src/grib_accessor_class_padding.cc rename to src/accessor/todo/grib_accessor_class_padding.cc diff --git a/src/grib_accessor_class_padto.cc b/src/accessor/todo/grib_accessor_class_padto.cc similarity index 100% rename from src/grib_accessor_class_padto.cc rename to src/accessor/todo/grib_accessor_class_padto.cc diff --git a/src/grib_accessor_class_padtoeven.cc b/src/accessor/todo/grib_accessor_class_padtoeven.cc similarity index 100% rename from src/grib_accessor_class_padtoeven.cc rename to src/accessor/todo/grib_accessor_class_padtoeven.cc diff --git a/src/grib_accessor_class_padtomultiple.cc b/src/accessor/todo/grib_accessor_class_padtomultiple.cc similarity index 100% rename from src/grib_accessor_class_padtomultiple.cc rename to src/accessor/todo/grib_accessor_class_padtomultiple.cc diff --git a/src/grib_accessor_class_position.cc b/src/accessor/todo/grib_accessor_class_position.cc similarity index 100% rename from src/grib_accessor_class_position.cc rename to src/accessor/todo/grib_accessor_class_position.cc diff --git a/src/grib_accessor_class_proj_string.cc b/src/accessor/todo/grib_accessor_class_proj_string.cc similarity index 100% rename from src/grib_accessor_class_proj_string.cc rename to src/accessor/todo/grib_accessor_class_proj_string.cc diff --git a/src/grib_accessor_class_raw.cc b/src/accessor/todo/grib_accessor_class_raw.cc similarity index 100% rename from src/grib_accessor_class_raw.cc rename to src/accessor/todo/grib_accessor_class_raw.cc diff --git a/src/grib_accessor_class_rdbtime_guess_date.cc b/src/accessor/todo/grib_accessor_class_rdbtime_guess_date.cc similarity index 100% rename from src/grib_accessor_class_rdbtime_guess_date.cc rename to src/accessor/todo/grib_accessor_class_rdbtime_guess_date.cc diff --git a/src/grib_accessor_class_reference_value_error.cc b/src/accessor/todo/grib_accessor_class_reference_value_error.cc similarity index 100% rename from src/grib_accessor_class_reference_value_error.cc rename to src/accessor/todo/grib_accessor_class_reference_value_error.cc diff --git a/src/grib_accessor_class_round.cc b/src/accessor/todo/grib_accessor_class_round.cc similarity index 100% rename from src/grib_accessor_class_round.cc rename to src/accessor/todo/grib_accessor_class_round.cc diff --git a/src/grib_accessor_class_scale.cc b/src/accessor/todo/grib_accessor_class_scale.cc similarity index 100% rename from src/grib_accessor_class_scale.cc rename to src/accessor/todo/grib_accessor_class_scale.cc diff --git a/src/grib_accessor_class_scale_values.cc b/src/accessor/todo/grib_accessor_class_scale_values.cc similarity index 100% rename from src/grib_accessor_class_scale_values.cc rename to src/accessor/todo/grib_accessor_class_scale_values.cc diff --git a/src/grib_accessor_class_second_order_bits_per_value.cc b/src/accessor/todo/grib_accessor_class_second_order_bits_per_value.cc similarity index 100% rename from src/grib_accessor_class_second_order_bits_per_value.cc rename to src/accessor/todo/grib_accessor_class_second_order_bits_per_value.cc diff --git a/src/grib_accessor_class_section.cc b/src/accessor/todo/grib_accessor_class_section.cc similarity index 100% rename from src/grib_accessor_class_section.cc rename to src/accessor/todo/grib_accessor_class_section.cc diff --git a/src/grib_accessor_class_section_length.cc b/src/accessor/todo/grib_accessor_class_section_length.cc similarity index 100% rename from src/grib_accessor_class_section_length.cc rename to src/accessor/todo/grib_accessor_class_section_length.cc diff --git a/src/grib_accessor_class_section_padding.cc b/src/accessor/todo/grib_accessor_class_section_padding.cc similarity index 100% rename from src/grib_accessor_class_section_padding.cc rename to src/accessor/todo/grib_accessor_class_section_padding.cc diff --git a/src/grib_accessor_class_section_pointer.cc b/src/accessor/todo/grib_accessor_class_section_pointer.cc similarity index 100% rename from src/grib_accessor_class_section_pointer.cc rename to src/accessor/todo/grib_accessor_class_section_pointer.cc diff --git a/src/grib_accessor_class_select_step_template.cc b/src/accessor/todo/grib_accessor_class_select_step_template.cc similarity index 100% rename from src/grib_accessor_class_select_step_template.cc rename to src/accessor/todo/grib_accessor_class_select_step_template.cc diff --git a/src/grib_accessor_class_sexagesimal2decimal.cc b/src/accessor/todo/grib_accessor_class_sexagesimal2decimal.cc similarity index 100% rename from src/grib_accessor_class_sexagesimal2decimal.cc rename to src/accessor/todo/grib_accessor_class_sexagesimal2decimal.cc diff --git a/src/grib_accessor_class_signed.cc b/src/accessor/todo/grib_accessor_class_signed.cc similarity index 100% rename from src/grib_accessor_class_signed.cc rename to src/accessor/todo/grib_accessor_class_signed.cc diff --git a/src/grib_accessor_class_signed_bits.cc b/src/accessor/todo/grib_accessor_class_signed_bits.cc similarity index 100% rename from src/grib_accessor_class_signed_bits.cc rename to src/accessor/todo/grib_accessor_class_signed_bits.cc diff --git a/src/grib_accessor_class_simple_packing_error.cc b/src/accessor/todo/grib_accessor_class_simple_packing_error.cc similarity index 100% rename from src/grib_accessor_class_simple_packing_error.cc rename to src/accessor/todo/grib_accessor_class_simple_packing_error.cc diff --git a/src/grib_accessor_class_size.cc b/src/accessor/todo/grib_accessor_class_size.cc similarity index 100% rename from src/grib_accessor_class_size.cc rename to src/accessor/todo/grib_accessor_class_size.cc diff --git a/src/grib_accessor_class_smart_table.cc b/src/accessor/todo/grib_accessor_class_smart_table.cc similarity index 100% rename from src/grib_accessor_class_smart_table.cc rename to src/accessor/todo/grib_accessor_class_smart_table.cc diff --git a/src/grib_accessor_class_smart_table_column.cc b/src/accessor/todo/grib_accessor_class_smart_table_column.cc similarity index 100% rename from src/grib_accessor_class_smart_table_column.cc rename to src/accessor/todo/grib_accessor_class_smart_table_column.cc diff --git a/src/grib_accessor_class_spd.cc b/src/accessor/todo/grib_accessor_class_spd.cc similarity index 100% rename from src/grib_accessor_class_spd.cc rename to src/accessor/todo/grib_accessor_class_spd.cc diff --git a/src/grib_accessor_class_spectral_truncation.cc b/src/accessor/todo/grib_accessor_class_spectral_truncation.cc similarity index 100% rename from src/grib_accessor_class_spectral_truncation.cc rename to src/accessor/todo/grib_accessor_class_spectral_truncation.cc diff --git a/src/grib_accessor_class_sprintf.cc b/src/accessor/todo/grib_accessor_class_sprintf.cc similarity index 100% rename from src/grib_accessor_class_sprintf.cc rename to src/accessor/todo/grib_accessor_class_sprintf.cc diff --git a/src/grib_accessor_class_statistics.cc b/src/accessor/todo/grib_accessor_class_statistics.cc similarity index 100% rename from src/grib_accessor_class_statistics.cc rename to src/accessor/todo/grib_accessor_class_statistics.cc diff --git a/src/grib_accessor_class_statistics_spectral.cc b/src/accessor/todo/grib_accessor_class_statistics_spectral.cc similarity index 100% rename from src/grib_accessor_class_statistics_spectral.cc rename to src/accessor/todo/grib_accessor_class_statistics_spectral.cc diff --git a/src/grib_accessor_class_step_human_readable.cc b/src/accessor/todo/grib_accessor_class_step_human_readable.cc similarity index 100% rename from src/grib_accessor_class_step_human_readable.cc rename to src/accessor/todo/grib_accessor_class_step_human_readable.cc diff --git a/src/grib_accessor_class_step_in_units.cc b/src/accessor/todo/grib_accessor_class_step_in_units.cc similarity index 100% rename from src/grib_accessor_class_step_in_units.cc rename to src/accessor/todo/grib_accessor_class_step_in_units.cc diff --git a/src/grib_accessor_class_sum.cc b/src/accessor/todo/grib_accessor_class_sum.cc similarity index 100% rename from src/grib_accessor_class_sum.cc rename to src/accessor/todo/grib_accessor_class_sum.cc diff --git a/src/grib_accessor_class_suppressed.cc b/src/accessor/todo/grib_accessor_class_suppressed.cc similarity index 100% rename from src/grib_accessor_class_suppressed.cc rename to src/accessor/todo/grib_accessor_class_suppressed.cc diff --git a/src/grib_accessor_class_time.cc b/src/accessor/todo/grib_accessor_class_time.cc similarity index 100% rename from src/grib_accessor_class_time.cc rename to src/accessor/todo/grib_accessor_class_time.cc diff --git a/src/grib_accessor_class_to_double.cc b/src/accessor/todo/grib_accessor_class_to_double.cc similarity index 100% rename from src/grib_accessor_class_to_double.cc rename to src/accessor/todo/grib_accessor_class_to_double.cc diff --git a/src/grib_accessor_class_to_integer.cc b/src/accessor/todo/grib_accessor_class_to_integer.cc similarity index 100% rename from src/grib_accessor_class_to_integer.cc rename to src/accessor/todo/grib_accessor_class_to_integer.cc diff --git a/src/grib_accessor_class_to_string.cc b/src/accessor/todo/grib_accessor_class_to_string.cc similarity index 100% rename from src/grib_accessor_class_to_string.cc rename to src/accessor/todo/grib_accessor_class_to_string.cc diff --git a/src/grib_accessor_class_transient.cc b/src/accessor/todo/grib_accessor_class_transient.cc similarity index 100% rename from src/grib_accessor_class_transient.cc rename to src/accessor/todo/grib_accessor_class_transient.cc diff --git a/src/grib_accessor_class_transient_darray.cc b/src/accessor/todo/grib_accessor_class_transient_darray.cc similarity index 100% rename from src/grib_accessor_class_transient_darray.cc rename to src/accessor/todo/grib_accessor_class_transient_darray.cc diff --git a/src/grib_accessor_class_trim.cc b/src/accessor/todo/grib_accessor_class_trim.cc similarity index 100% rename from src/grib_accessor_class_trim.cc rename to src/accessor/todo/grib_accessor_class_trim.cc diff --git a/src/grib_accessor_class_uint16.cc b/src/accessor/todo/grib_accessor_class_uint16.cc similarity index 100% rename from src/grib_accessor_class_uint16.cc rename to src/accessor/todo/grib_accessor_class_uint16.cc diff --git a/src/grib_accessor_class_uint32.cc b/src/accessor/todo/grib_accessor_class_uint32.cc similarity index 100% rename from src/grib_accessor_class_uint32.cc rename to src/accessor/todo/grib_accessor_class_uint32.cc diff --git a/src/grib_accessor_class_uint32_little_endian.cc b/src/accessor/todo/grib_accessor_class_uint32_little_endian.cc similarity index 100% rename from src/grib_accessor_class_uint32_little_endian.cc rename to src/accessor/todo/grib_accessor_class_uint32_little_endian.cc diff --git a/src/grib_accessor_class_uint64.cc b/src/accessor/todo/grib_accessor_class_uint64.cc similarity index 100% rename from src/grib_accessor_class_uint64.cc rename to src/accessor/todo/grib_accessor_class_uint64.cc diff --git a/src/grib_accessor_class_uint64_little_endian.cc b/src/accessor/todo/grib_accessor_class_uint64_little_endian.cc similarity index 100% rename from src/grib_accessor_class_uint64_little_endian.cc rename to src/accessor/todo/grib_accessor_class_uint64_little_endian.cc diff --git a/src/grib_accessor_class_uint8.cc b/src/accessor/todo/grib_accessor_class_uint8.cc similarity index 100% rename from src/grib_accessor_class_uint8.cc rename to src/accessor/todo/grib_accessor_class_uint8.cc diff --git a/src/grib_accessor_class_unexpanded_descriptors.cc b/src/accessor/todo/grib_accessor_class_unexpanded_descriptors.cc similarity index 100% rename from src/grib_accessor_class_unexpanded_descriptors.cc rename to src/accessor/todo/grib_accessor_class_unexpanded_descriptors.cc diff --git a/src/grib_accessor_class_unpack_bufr_values.cc b/src/accessor/todo/grib_accessor_class_unpack_bufr_values.cc similarity index 100% rename from src/grib_accessor_class_unpack_bufr_values.cc rename to src/accessor/todo/grib_accessor_class_unpack_bufr_values.cc diff --git a/src/grib_accessor_class_unsigned.cc b/src/accessor/todo/grib_accessor_class_unsigned.cc similarity index 100% rename from src/grib_accessor_class_unsigned.cc rename to src/accessor/todo/grib_accessor_class_unsigned.cc diff --git a/src/grib_accessor_class_unsigned_bits.cc b/src/accessor/todo/grib_accessor_class_unsigned_bits.cc similarity index 100% rename from src/grib_accessor_class_unsigned_bits.cc rename to src/accessor/todo/grib_accessor_class_unsigned_bits.cc diff --git a/src/grib_accessor_class_validity_date.cc b/src/accessor/todo/grib_accessor_class_validity_date.cc similarity index 100% rename from src/grib_accessor_class_validity_date.cc rename to src/accessor/todo/grib_accessor_class_validity_date.cc diff --git a/src/grib_accessor_class_validity_time.cc b/src/accessor/todo/grib_accessor_class_validity_time.cc similarity index 100% rename from src/grib_accessor_class_validity_time.cc rename to src/accessor/todo/grib_accessor_class_validity_time.cc diff --git a/src/grib_accessor_class_values.cc b/src/accessor/todo/grib_accessor_class_values.cc similarity index 100% rename from src/grib_accessor_class_values.cc rename to src/accessor/todo/grib_accessor_class_values.cc diff --git a/src/grib_accessor_class_variable.cc b/src/accessor/todo/grib_accessor_class_variable.cc similarity index 100% rename from src/grib_accessor_class_variable.cc rename to src/accessor/todo/grib_accessor_class_variable.cc diff --git a/src/grib_accessor_class_vector.cc b/src/accessor/todo/grib_accessor_class_vector.cc similarity index 100% rename from src/grib_accessor_class_vector.cc rename to src/accessor/todo/grib_accessor_class_vector.cc diff --git a/src/grib_accessor_class_when.cc b/src/accessor/todo/grib_accessor_class_when.cc similarity index 100% rename from src/grib_accessor_class_when.cc rename to src/accessor/todo/grib_accessor_class_when.cc From 6647a213999fc2e4d6158555273be54072537774 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Sun, 17 Mar 2024 12:57:53 +0000 Subject: [PATCH 004/196] Create a todo list --- src/{ => accessor}/grib_accessor.cc | 0 src/{ => accessor}/grib_accessor.h | 0 src/accessor/{todo => }/grib_accessor_class_codetable.cc | 0 src/accessor/{todo => }/grib_accessor_class_constant.cc | 0 src/accessor/{todo => }/grib_accessor_class_iterator.cc | 0 src/accessor/{todo => }/grib_accessor_class_long.cc | 0 src/accessor/{todo => }/grib_accessor_class_nearest.cc | 0 src/accessor/{todo => }/grib_accessor_class_smart_table.cc | 0 src/accessor/{todo => }/grib_accessor_class_transient.cc | 0 src/accessor/{todo => }/grib_accessor_class_unsigned.cc | 0 src/accessor/{todo => }/grib_accessor_class_variable.cc | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename src/{ => accessor}/grib_accessor.cc (100%) rename src/{ => accessor}/grib_accessor.h (100%) rename src/accessor/{todo => }/grib_accessor_class_codetable.cc (100%) rename src/accessor/{todo => }/grib_accessor_class_constant.cc (100%) rename src/accessor/{todo => }/grib_accessor_class_iterator.cc (100%) rename src/accessor/{todo => }/grib_accessor_class_long.cc (100%) rename src/accessor/{todo => }/grib_accessor_class_nearest.cc (100%) rename src/accessor/{todo => }/grib_accessor_class_smart_table.cc (100%) rename src/accessor/{todo => }/grib_accessor_class_transient.cc (100%) rename src/accessor/{todo => }/grib_accessor_class_unsigned.cc (100%) rename src/accessor/{todo => }/grib_accessor_class_variable.cc (100%) diff --git a/src/grib_accessor.cc b/src/accessor/grib_accessor.cc similarity index 100% rename from src/grib_accessor.cc rename to src/accessor/grib_accessor.cc diff --git a/src/grib_accessor.h b/src/accessor/grib_accessor.h similarity index 100% rename from src/grib_accessor.h rename to src/accessor/grib_accessor.h diff --git a/src/accessor/todo/grib_accessor_class_codetable.cc b/src/accessor/grib_accessor_class_codetable.cc similarity index 100% rename from src/accessor/todo/grib_accessor_class_codetable.cc rename to src/accessor/grib_accessor_class_codetable.cc diff --git a/src/accessor/todo/grib_accessor_class_constant.cc b/src/accessor/grib_accessor_class_constant.cc similarity index 100% rename from src/accessor/todo/grib_accessor_class_constant.cc rename to src/accessor/grib_accessor_class_constant.cc diff --git a/src/accessor/todo/grib_accessor_class_iterator.cc b/src/accessor/grib_accessor_class_iterator.cc similarity index 100% rename from src/accessor/todo/grib_accessor_class_iterator.cc rename to src/accessor/grib_accessor_class_iterator.cc diff --git a/src/accessor/todo/grib_accessor_class_long.cc b/src/accessor/grib_accessor_class_long.cc similarity index 100% rename from src/accessor/todo/grib_accessor_class_long.cc rename to src/accessor/grib_accessor_class_long.cc diff --git a/src/accessor/todo/grib_accessor_class_nearest.cc b/src/accessor/grib_accessor_class_nearest.cc similarity index 100% rename from src/accessor/todo/grib_accessor_class_nearest.cc rename to src/accessor/grib_accessor_class_nearest.cc diff --git a/src/accessor/todo/grib_accessor_class_smart_table.cc b/src/accessor/grib_accessor_class_smart_table.cc similarity index 100% rename from src/accessor/todo/grib_accessor_class_smart_table.cc rename to src/accessor/grib_accessor_class_smart_table.cc diff --git a/src/accessor/todo/grib_accessor_class_transient.cc b/src/accessor/grib_accessor_class_transient.cc similarity index 100% rename from src/accessor/todo/grib_accessor_class_transient.cc rename to src/accessor/grib_accessor_class_transient.cc diff --git a/src/accessor/todo/grib_accessor_class_unsigned.cc b/src/accessor/grib_accessor_class_unsigned.cc similarity index 100% rename from src/accessor/todo/grib_accessor_class_unsigned.cc rename to src/accessor/grib_accessor_class_unsigned.cc diff --git a/src/accessor/todo/grib_accessor_class_variable.cc b/src/accessor/grib_accessor_class_variable.cc similarity index 100% rename from src/accessor/todo/grib_accessor_class_variable.cc rename to src/accessor/grib_accessor_class_variable.cc From be71970aa85b593d9ddfdc75b32804988115e8fb Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Sun, 17 Mar 2024 15:04:53 +0000 Subject: [PATCH 005/196] Abstract grib_accessor and grib_accessor_class --- src/accessor/grib_accessor_class_codetable.h | 47 ++ src/accessor/grib_accessor_class_constant.h | 27 + src/accessor/grib_accessor_class_gen.cc | 767 ++++++++++++++++++ src/accessor/grib_accessor_class_gen.h | 142 ++++ src/accessor/grib_accessor_class_iterator.h | 36 + src/accessor/grib_accessor_class_long.h | 22 + src/accessor/grib_accessor_class_nearest.h | 33 + .../grib_accessor_class_smart_table.h | 52 ++ src/accessor/grib_accessor_class_transient.h | 26 + src/accessor/grib_accessor_class_unsigned.h | 40 + src/accessor/grib_accessor_class_variable.h | 50 ++ src/accessor/grib_accessors_list.cc | 143 ++++ src/accessor/grib_accessors_list.h | 28 + 13 files changed, 1413 insertions(+) create mode 100644 src/accessor/grib_accessor_class_codetable.h create mode 100644 src/accessor/grib_accessor_class_constant.h create mode 100644 src/accessor/grib_accessor_class_gen.cc create mode 100644 src/accessor/grib_accessor_class_gen.h create mode 100644 src/accessor/grib_accessor_class_iterator.h create mode 100644 src/accessor/grib_accessor_class_long.h create mode 100644 src/accessor/grib_accessor_class_nearest.h create mode 100644 src/accessor/grib_accessor_class_smart_table.h create mode 100644 src/accessor/grib_accessor_class_transient.h create mode 100644 src/accessor/grib_accessor_class_unsigned.h create mode 100644 src/accessor/grib_accessor_class_variable.h create mode 100644 src/accessor/grib_accessors_list.cc create mode 100644 src/accessor/grib_accessors_list.h diff --git a/src/accessor/grib_accessor_class_codetable.h b/src/accessor/grib_accessor_class_codetable.h new file mode 100644 index 000000000..c77c6f72d --- /dev/null +++ b/src/accessor/grib_accessor_class_codetable.h @@ -0,0 +1,47 @@ +/* + * (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. + */ + +/***************************************** + * Enrico Fucile + ****************************************/ + +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" +#include + + +class grib_accessor_codetable_t : public grib_accessor_unsigned_t +{ +public: + const char* tablename; + const char* masterDir; + const char* localDir; + grib_codetable* table; + int table_loaded; +}; + +class grib_accessor_class_codetable_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor* create_empty_accessor() override { return new grib_accessor_codetable_t{}; } + grib_accessor_class_codetable_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + int get_native_type(grib_accessor*) override; + int pack_missing(grib_accessor*) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int pack_expression(grib_accessor*, grib_expression*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; diff --git a/src/accessor/grib_accessor_class_constant.h b/src/accessor/grib_accessor_class_constant.h new file mode 100644 index 000000000..0c4944c68 --- /dev/null +++ b/src/accessor/grib_accessor_class_constant.h @@ -0,0 +1,27 @@ +/* + * (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. + */ + + +/************************************* + * Enrico Fucile + **************************************/ + +#include "../grib_api_internal.h" +#include "grib_accessor_class_variable.h" + +class grib_accessor_constant_t : public grib_accessor_variable_t {}; + +class grib_accessor_class_constant_t : public grib_accessor_class_variable_t +{ +public: + grib_accessor_class_constant_t(const char* name) : grib_accessor_class_variable_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_constant_t{}; } + void init(grib_accessor*, const long, grib_arguments*) override; +}; diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc new file mode 100644 index 000000000..fb885700b --- /dev/null +++ b/src/accessor/grib_accessor_class_gen.cc @@ -0,0 +1,767 @@ +#include "grib_accessor.h" +#include "grib_accessor_class_gen.h" +#include + +// ======================== grib_accessor_gen ======================== + + + +void grib_accessor_gen_t::dump(grib_dumper* f) +{ + return cclass->dump(this, f); +} +int grib_accessor_gen_t::pack_missing() +{ + // grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); + return cclass->pack_missing(this); +} +// int grib_accessor_gen_t::pack_zero(grib_accessor* a) +// { +// return cclass->clear(a); +// } + +int grib_accessor_gen_t::is_missing_internal() +{ + return cclass->is_missing(this); +} + +int grib_accessor_gen_t::pack_double(const double* v, size_t* len) +{ + return cclass->pack_double(this, v, len); +} + +int grib_accessor_gen_t::pack_float(const float* v, size_t* len) +{ + return cclass->pack_float(this, v, len); +} + +int grib_accessor_gen_t::pack_expression(grib_expression* e) +{ + return cclass->pack_expression(this, e); +} + +int grib_accessor_gen_t::pack_string(const char* v, size_t* len) +{ + return cclass->pack_string(this, v, len); +} + +int grib_accessor_gen_t::pack_string_array(const char** v, size_t* len) +{ + return cclass->pack_string_array(this, v, len); +} + +int grib_accessor_gen_t::pack_long(const long* v, size_t* len) +{ + return cclass->pack_long(this, v, len); +} + +int grib_accessor_gen_t::pack_bytes(const unsigned char* v, size_t* len) +{ + return cclass->pack_bytes(this, v, len); +} + +int grib_accessor_gen_t::unpack_bytes(unsigned char* v, size_t* len) +{ + return cclass->unpack_bytes(this, v, len); +} + +int grib_accessor_gen_t::unpack_double_subarray(double* v, size_t start, size_t len) +{ + return cclass->unpack_double_subarray(this, v, start, len); +} + +int grib_accessor_gen_t::unpack_double(double* v, size_t* len) +{ + return cclass->unpack_double(this, v, len); +} + +int grib_accessor_gen_t::unpack_float(float* v, size_t* len) +{ + // return cclass->unpack_float(this, v, len); + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_gen_t::unpack_double_element(size_t i, double* v) +{ + return cclass->unpack_double_element(this, i, v); +} + +int grib_accessor_gen_t::unpack_float_element(size_t i, float* v) +{ + // return cclass->unpack_float_element(this, i, v); + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_gen_t::unpack_long(long* v, size_t* len) +{ + return cclass->unpack_long(this, v, len); +} + +long grib_accessor_gen_t::get_native_type() +{ + return cclass->get_native_type(this); +} + +long grib_accessor_gen_t::get_next_position_offset() +{ + return cclass->next_offset(this); +} + +long grib_accessor_gen_t::string_length() +{ + return cclass->string_length(this); +} + +long grib_accessor_gen_t::byte_offset() +{ + return cclass->byte_offset(this); +} + +long grib_accessor_gen_t::byte_count() +{ + return cclass->byte_count(this); +} + +int grib_accessor_gen_t::value_count(long* count) +{ + return cclass->value_count(this, count); +} + +int grib_accessor_gen_t::notify_change(grib_accessor* changed) +{ + return cclass->notify_change(this, changed); +} + +// 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 +int grib_accessor_gen_t::unpack_double_element_set(const size_t* index_array, size_t len, double* val_array) +{ + return cclass->unpack_double_element_set(this, index_array, len, val_array); +} +int grib_accessor_gen_t::unpack_float_element_set(const size_t* index_array, size_t len, float* val_array) +{ + throw std::runtime_error("grib_unpack_float_element_set not implemented"); +} +int grib_accessor_gen_t::unpack_string(char* v, size_t* len) +{ + return cclass->unpack_string(this, v, len); +} +int grib_accessor_gen_t::unpack_string_array(char** v, size_t* len) +{ + return cclass->unpack_string_array(this, v, len); +} + +void grib_accessor_gen_t::init_accessor(const long len, grib_arguments* args) +{ + this->cclass->init(this, len, args); +} + +grib_accessor* grib_accessor_gen_t::clone(grib_section* s, int* err) +{ + grib_context* ct = this->context; + grib_context_log(ct, GRIB_LOG_DEBUG, "clone %s ==> %s", cclass->name, this->name); + return cclass->make_clone(this, s, err); +} + +void grib_accessor_gen_t::update_size(size_t len) +{ + cclass->update_size(this, len); +} + +int grib_accessor_gen_t::nearest_smaller_value(double val, double* nearest) +{ + return cclass->nearest_smaller_value(this, val, nearest); +} + +size_t grib_accessor_gen_t::preferred_size(int from_handle) +{ + return cclass->preferred_size(this, from_handle); +} + +grib_accessor* grib_accessor_gen_t::next_accessor() +{ + return cclass->next(this, 0); +} + +void grib_accessor_gen_t::resize(size_t new_size) +{ + cclass->resize(this, new_size); +} + +// For this one, ALL destroy are called +void grib_accessor_delete(grib_context* ct, grib_accessor* a) +{ + free(a); +} + + + + +// ======================== grib_accessor_class_gen ======================== + + +grib_accessor_class_gen_t _grib_accessor_class_gen = grib_accessor_class_gen_t("gen"); +grib_accessor_class_gen_t* grib_accessor_class_gen = &_grib_accessor_class_gen; + +void grib_accessor_class_gen_t::init(grib_accessor* a, const long len, grib_arguments* param) +{ + grib_action* act = (grib_action*)(a->creator); + if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { + a->length = 0; + if (!a->vvalue) + a->vvalue = (grib_virtual_value*)grib_context_malloc_clear(a->context, sizeof(grib_virtual_value)); + a->vvalue->type = a->get_native_type(); + a->vvalue->length = len; + if (act->default_value != NULL) { + const char* p = 0; + size_t s_len = 1; + long l; + int ret = 0; + double d; + char tmp[1024]; + grib_expression* expression = grib_arguments_get_expression(grib_handle_of_accessor(a), act->default_value, 0); + int type = grib_expression_native_type(grib_handle_of_accessor(a), expression); + switch (type) { + case GRIB_TYPE_DOUBLE: + grib_expression_evaluate_double(grib_handle_of_accessor(a), expression, &d); + a->pack_double(&d, &s_len); + break; + + case GRIB_TYPE_LONG: + grib_expression_evaluate_long(grib_handle_of_accessor(a), expression, &l); + a->pack_long(&l, &s_len); + break; + + default: + s_len = sizeof(tmp); + p = grib_expression_evaluate_string(grib_handle_of_accessor(a), expression, tmp, &s_len, &ret); + if (ret != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to evaluate %s as string", a->name); + Assert(0); + } + s_len = strlen(p) + 1; + a->pack_string(p, &s_len); + break; + } + } + } + else { + a->length = len; + } +} + +void grib_accessor_class_gen_t::dump(grib_accessor* a, grib_dumper* dumper) +{ + const int type = a->get_native_type(); + switch (type) { + case GRIB_TYPE_STRING: + grib_dump_string(dumper, a, NULL); + break; + case GRIB_TYPE_DOUBLE: + grib_dump_double(dumper, a, NULL); + break; + case GRIB_TYPE_LONG: + grib_dump_long(dumper, a, NULL); + break; + default: + grib_dump_bytes(dumper, a, NULL); + } +} + +long grib_accessor_class_gen_t::next_offset(grib_accessor* a) +{ + return a->offset + a->length; +} + +int grib_accessor_class_gen_t::value_count(grib_accessor* a, long* count) +{ + *count = 1; + return 0; +} + +size_t grib_accessor_class_gen_t::string_length(grib_accessor* a) +{ + return 1024; +} + +long grib_accessor_class_gen_t::byte_count(grib_accessor* a) +{ + return a->length; +} + +int grib_accessor_class_gen_t::get_native_type(grib_accessor* a) +{ + grib_context_log(a->context, GRIB_LOG_ERROR, + "Accessor %s [%s] must implement 'get_native_type'", a->name, a->cclass->name); + return GRIB_TYPE_UNDEFINED; +} + +long grib_accessor_class_gen_t::byte_offset(grib_accessor* a) +{ + return a->offset; +} + +int grib_accessor_class_gen_t::unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len) +{ + unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; + const long length = a->byte_count(); + const long offset = a->byte_offset(); + + if (*len < length) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it is %ld bytes long", a->name, length); + *len = length; + return GRIB_ARRAY_TOO_SMALL; + } + + memcpy(val, buf + offset, length); + *len = length; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_gen_t::clear(grib_accessor* a) +{ + unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; + const long length = a->byte_count(); + const long offset = a->byte_offset(); + + memset(buf + offset, 0, length); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_gen_t::unpack_long(grib_accessor* a, long* v, size_t* len) +{ + int type = GRIB_TYPE_UNDEFINED; + //if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { + try { + double val = 0.0; + size_t l = 1; + a->unpack_double(&val, &l); + if (val == GRIB_MISSING_DOUBLE) + *v = GRIB_MISSING_LONG; + else + *v = (long)val; + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to long", a->name); + return GRIB_SUCCESS; + } + catch (std::runtime_error& e) { + // TODO(maee): log error + } + + //if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { + try { + char val[1024]; + size_t l = sizeof(val); + char* last = NULL; + a->unpack_string(val, &l); + + *v = strtol(val, &last, 10); + + if (*last == 0) { + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting string %s to long", a->name); + return GRIB_SUCCESS; + } + } + catch (std::runtime_error& e) { + // TODO(maee): log error + } + + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as long", 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; +} + +int grib_accessor_class_gen_t::unpack_double(grib_accessor* a, double* v, size_t* len) +{ + return unpack_helper(a, v, len); +} + +int grib_accessor_class_gen_t::unpack_float(grib_accessor* a, float* v, size_t* len) +{ + return unpack_helper(a, v, len); +} + +int grib_accessor_class_gen_t::unpack_string(grib_accessor* a, char* v, size_t* len) +{ + int err = 0; + //if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { + try { + double val = 0.0; + size_t l = 1; + err = a->unpack_double(&val, &l); + if (err) return err; + snprintf(v, 64, "%g", val); + *len = strlen(v); + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to string", a->name); + return GRIB_SUCCESS; + } + catch (std::runtime_error& e) { + // TODO(maee): log error + } + + //if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { + try { + long val = 0; + size_t l = 1; + err = a->unpack_long(&val, &l); + if (err) return err; + snprintf(v, 64, "%ld", val); + *len = strlen(v); + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to string\n", a->name); + return GRIB_SUCCESS; + } + catch (std::runtime_error& e) { + // TODO(maee): log error + } + + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_gen_t::unpack_string_array(grib_accessor* a, char** v, size_t* len) +{ + size_t length = 0; + + int err = grib_get_string_length_acc(a, &length); + if (err) + return err; + v[0] = (char*)grib_context_malloc_clear(a->context, length); + a->unpack_string(v[0], &length); // TODO(masn): check return value + *len = 1; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_gen_t::pack_expression(grib_accessor* a, grib_expression* e) +{ + size_t len = 1; + long lval = 0; + double dval = 0; + const char* cval = NULL; + int ret = 0; + grib_handle* hand = grib_handle_of_accessor(a); + + // Use the native type of the expression not the accessor + switch (grib_expression_native_type(hand, e)) { + case GRIB_TYPE_LONG: { + len = 1; + ret = grib_expression_evaluate_long(hand, e, &lval); + if (ret != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to set %s as long (from %s)", + a->name, e->cclass->name); + return ret; + } + /*if (hand->context->debug) + printf("ECCODES DEBUG grib_accessor_class_gen_t::pack_expression %s %ld\n", a->name,lval);*/ + return a->pack_long(&lval, &len); + } + + case GRIB_TYPE_DOUBLE: { + len = 1; + ret = grib_expression_evaluate_double(hand, e, &dval); + if (ret != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to set %s as double (from %s)", + a->name, e->cclass->name); + return ret; + } + /*if (hand->context->debug) + printf("ECCODES DEBUG grib_accessor_class_gen_t::pack_expression %s %g\n", a->name, dval);*/ + return a->pack_double(&dval, &len); + } + + case GRIB_TYPE_STRING: { + char tmp[1024]; + len = sizeof(tmp); + cval = grib_expression_evaluate_string(hand, e, tmp, &len, &ret); + if (ret != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to set %s as string (from %s)", + a->name, e->cclass->name); + return ret; + } + len = strlen(cval); + /*if (hand->context->debug) + printf("ECCODES DEBUG grib_accessor_class_gen_t::pack_expression %s %s\n", a->name, cval);*/ + return a->pack_string(cval, &len); + } + } + + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_gen_t::pack_long(grib_accessor* a, const long* v, size_t* len) +{ + grib_context* c = a->context; + //if (a->cclass->pack_double && a->cclass->pack_double != &pack_double) { + try { + double* val = (double*)grib_context_malloc(c, *len * (sizeof(double))); + if (!val) { + grib_context_log(c, GRIB_LOG_ERROR, "Unable to allocate %zu bytes", *len * (sizeof(double))); + return GRIB_OUT_OF_MEMORY; + } + for (size_t i = 0; i < *len; i++) + val[i] = v[i]; + int ret = a->pack_double(val, len); + grib_context_free(c, val); + return ret; + } + catch (std::runtime_error& e) { + // TODO(maee): log error + } + grib_context_log(c, GRIB_LOG_ERROR, "Should not pack '%s' as an integer", a->name); + //if (a->cclass->pack_string && a->cclass->pack_string != &pack_string) { + try { + grib_context_log(c, GRIB_LOG_ERROR, "Try packing as a string"); + } + catch (std::runtime_error& e) { + // TODO(maee): log error + } + return GRIB_NOT_IMPLEMENTED; +} + +int pack_double_array_as_long(grib_accessor* a, const double* v, size_t* len) +{ + grib_context* c = a->context; + int ret = GRIB_SUCCESS; + size_t numBytes = *len * (sizeof(long)); + long* lValues = (long*)grib_context_malloc(c, numBytes); + if (!lValues) { + grib_context_log(c, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", numBytes); + return GRIB_OUT_OF_MEMORY; + } + for (size_t i = 0; i < *len; i++) + lValues[i] = (long)v[i]; /* convert from double to long */ + ret = a->pack_long(lValues, len); + grib_context_free(c, lValues); + return ret; +} + +int grib_accessor_class_gen_t::pack_double(grib_accessor* a, const double* v, size_t* len) +{ + int do_pack_as_long = 0; + grib_context* c = a->context; + //if (a->cclass->pack_long && a->cclass->pack_long != &pack_long) { + try { + do_pack_as_long = 1; + } + //else { + catch (std::runtime_error& e) { + /* ECC-648: Special case of codetable */ + if (strcmp(a->cclass->name, "codetable") == 0) { + do_pack_as_long = 1; + } + // TODO(maee): replace try-catch logic + } + if (do_pack_as_long) { + return pack_double_array_as_long(a, v, len); + } + grib_context_log(c, GRIB_LOG_ERROR, "Should not pack '%s' as a double", a->name); + //if (a->cclass->pack_string && a->cclass->pack_string != &pack_string) { + try { + grib_context_log(c, GRIB_LOG_ERROR, "Try packing as a string"); + } + catch (std::runtime_error& e) { + // TODO(maee): replace try-catch logic + } + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_gen_t::pack_string_array(grib_accessor* a, const char** v, size_t* len) +{ + int err = 0; + size_t length = 0; + grib_accessor* as = 0; + + as = a; + long i = (long)*len - 1; + while (as && i >= 0) { + length = strlen(v[i]); + err = as->pack_string(v[i], &length); + if (err) + return err; + --i; + as = as->same; + } + return GRIB_SUCCESS; +} + +int grib_accessor_class_gen_t::pack_string(grib_accessor* a, const char* v, size_t* len) +{ + //if (a->cclass->pack_double && a->cclass->pack_double != &pack_double) { + try { + size_t l = 1; + char* endPtr = NULL; /* for error handling */ + double val = strtod(v, &endPtr); + if (*endPtr) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Invalid value (%s) for key '%s'. String cannot be converted to a double", + __func__, v, a->name); + return GRIB_WRONG_TYPE; + } + return a->pack_double(&val, &l); + } + catch (std::runtime_error& e) { + // TODO(maee): replace try-catch logic + } + + //if (a->cclass->pack_long && a->cclass->pack_long != &pack_long) { + try { + size_t l = 1; + long val = atol(v); + return a->pack_long(&val, &l); + } + catch (std::runtime_error& e) { + // TODO(maee): replace try-catch logic + } + + grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack '%s' as string", a->name); + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_gen_t::pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len) +{ + const size_t length = *len; + if (length != a->length) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "pack_bytes: Wrong size (%zu) for %s. It is %ld bytes long", + length, a->name, a->length); + return GRIB_BUFFER_TOO_SMALL; + } + grib_buffer_replace(a, val, length, 1, 1); + return GRIB_SUCCESS; +} + +void grib_accessor_class_gen_t::destroy(grib_context* ct, grib_accessor* a) +{ + grib_dependency_remove_observed(a); + grib_dependency_remove_observer(a); + if (a->vvalue != NULL) { + grib_context_free(ct, a->vvalue); + a->vvalue = NULL; + } + /*grib_context_log(ct,GRIB_LOG_DEBUG,"address=%p",a);*/ +} + +grib_section* grib_accessor_class_gen_t::sub_section(grib_accessor* a) +{ + return NULL; +} + +int grib_accessor_class_gen_t::notify_change(grib_accessor* self, grib_accessor* observed) +{ + /* Default behaviour is to notify creator */ + return grib_action_notify_change(self->creator, self, observed); +} + +void grib_accessor_class_gen_t::update_size(grib_accessor* a, size_t s) +{ + grib_context_log(a->context, GRIB_LOG_FATAL, + "Accessor %s [%s] must implement 'update_size'", a->name, a->cclass->name); +} + +grib_accessor* grib_accessor_class_gen_t::next(grib_accessor* a, int mod) +{ + grib_accessor* next = NULL; + if (a->next) { + next = a->next; + } + else { + if (a->parent->owner) + next = a->parent->owner->cclass->next(a->parent->owner, 0); + } + return next; +} + +int grib_accessor_class_gen_t::compare(grib_accessor* a, grib_accessor* b) +{ + return GRIB_NOT_IMPLEMENTED; +} + +/* Redefined in all padding */ + +size_t grib_accessor_class_gen_t::preferred_size(grib_accessor* a, int from_handle) +{ + return a->length; +} + +int grib_accessor_class_gen_t::is_missing(grib_accessor* a) +{ + int i = 0; + int is_missing = 1; + unsigned char ones = 0xff; + unsigned char* v = NULL; + + if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { + if (a->vvalue == NULL) { + grib_context_log(a->context, GRIB_LOG_ERROR, "%s internal error (flags=0x%lX)", a->name, a->flags); + Assert(!"grib_accessor_class_gen_t::is_missing(): a->vvalue == NULL"); + return 0; + } + return a->vvalue->missing; + } + Assert(a->length >= 0); + + v = grib_handle_of_accessor(a)->buffer->data + a->offset; + + for (i = 0; i < a->length; i++) { + if (*v != ones) { + is_missing = 0; + break; + } + v++; + } + + return is_missing; +} + +int grib_accessor_class_gen_t::unpack_double_element(grib_accessor* a, size_t i, double* val) +{ + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_gen_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) +{ + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_gen_t::unpack_double_subarray(grib_accessor* a, double* val, size_t start, size_t len) +{ + return GRIB_NOT_IMPLEMENTED; +} + +grib_accessor* grib_accessor_class_gen_t::make_clone(grib_accessor* a, grib_section* s, int* err) +{ + *err = GRIB_NOT_IMPLEMENTED; + return NULL; +} + + + + +grib_accessor_class_gen_t::~grib_accessor_class_gen_t(){}; + +void grib_accessor_class_gen_t::post_init(grib_accessor*){ + return; +}; +int grib_accessor_class_gen_t::pack_missing(grib_accessor*) { + throw std::runtime_error("grib_accessor_class_gen_t::pack_missing not implemented"); +}; +int grib_accessor_class_gen_t::pack_float(grib_accessor*, const float*, size_t* len) { + throw std::runtime_error("grib_accessor_class_gen_t::pack_float not implemented"); +}; +void grib_accessor_class_gen_t::resize(grib_accessor*, size_t) { + throw std::runtime_error("grib_accessor_class_gen_t::resize not implemented"); +}; +int grib_accessor_class_gen_t::nearest_smaller_value(grib_accessor*, double, double*) { + throw std::runtime_error("grib_accessor_class_gen_t::nearest_smaller_value not implemented"); +}; +int grib_accessor_class_gen_t::unpack_float_element(grib_accessor*, size_t, float*) { + throw std::runtime_error("grib_accessor_class_gen_t::unpack_float_element not implemented"); +}; +int unpack_element_set(grib_accessor*, const size_t*, size_t, double*) { + throw std::runtime_error("grib_accessor_class_gen_t::unpack_element_set not implemented"); +}; +int grib_accessor_class_gen_t::unpack_float_element_set(grib_accessor*, const size_t*, size_t, float*) { + throw std::runtime_error("grib_accessor_class_gen_t::unpack_float_element_set not implemented"); +}; diff --git a/src/accessor/grib_accessor_class_gen.h b/src/accessor/grib_accessor_class_gen.h new file mode 100644 index 000000000..df85efab8 --- /dev/null +++ b/src/accessor/grib_accessor_class_gen.h @@ -0,0 +1,142 @@ +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor.h" + +class grib_accessor_gen_t : public grib_accessor { + void init_accessor(const long, grib_arguments*) override; + void dump(grib_dumper* f) override; + int pack_missing() override; + //int grib_pack_zero(grib_accessor* a) override; + int is_missing_internal() override; + int pack_double(const double* v, size_t* len) override; + int pack_float(const float* v, size_t* len) override; + int pack_expression(grib_expression* e) override; + int pack_string(const char* v, size_t* len) override; + int pack_string_array(const char** v, size_t* len) override; + int pack_long(const long* v, size_t* len) override; + int pack_bytes(const unsigned char* v, size_t* len) override; + int unpack_bytes(unsigned char* v, size_t* len) override; + int unpack_double_subarray(double* v, size_t start, size_t len) override; + int unpack_double(double* v, size_t* len) override; + int unpack_float(float* v, size_t* len) override; + int unpack_double_element(size_t i, double* v) override; + int unpack_float_element(size_t i, float* v) override; + int unpack_double_element_set(const size_t* index_array, size_t len, double* val_array) override; + int unpack_float_element_set(const size_t* index_array, size_t len, float* val_array) override; + int unpack_string(char* v, size_t* len) override; + int unpack_string_array(char** v, size_t* len) override; + int unpack_long(long* v, size_t* len) override; + long get_native_type() override; + long get_next_position_offset() override; + long string_length() override; + long byte_offset() override; + long byte_count() override; + int value_count(long* count) override; + int notify_change(grib_accessor* changed) override; + grib_accessor* clone(grib_section* s, int* err) override; + void update_size(size_t len) override; + int nearest_smaller_value(double val, double* nearest) override; + size_t preferred_size(int from_handle) override; + grib_accessor* next_accessor() override; + void resize(size_t new_size) override; + //int compare_accessors(grib_accessor* a2, int compare_flags) override; + //int add_attribute(grib_accessor* attr, int nest_if_clash) override; + //grib_accessor* get_attribute_index(const char* name, int* index) override; + //int has_attributes() override; + //grib_accessor* get_attribute(const char* name) override; +}; + +class grib_accessor_class_gen_t : public grib_accessor_class +{ +public: + grib_accessor_class_gen_t(const char* name) : grib_accessor_class{name} {} + ~grib_accessor_class_gen_t(); + + grib_accessor* create_empty_accessor() override{ return new grib_accessor_gen_t(); } + grib_section* sub_section(grib_accessor* a) override; + int get_native_type(grib_accessor*) override; + int pack_missing(grib_accessor*) override; + int is_missing(grib_accessor*) override; + int pack_bytes(grib_accessor*, const unsigned char*, size_t* len) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_float(grib_accessor*, const float* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int pack_string_array(grib_accessor*, const char**, size_t* len) override; + int pack_expression(grib_accessor*, grib_expression*) override; + int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + size_t string_length(grib_accessor*) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void post_init(grib_accessor*) override; + int notify_change(grib_accessor*, grib_accessor*) override; + void update_size(grib_accessor*, size_t) override; + size_t preferred_size(grib_accessor*, int) override; + void resize(grib_accessor*, size_t) override; + int nearest_smaller_value(grib_accessor*, double, double*) override; + grib_accessor* next(grib_accessor*, int) override; + int compare(grib_accessor*, grib_accessor*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_float_element(grib_accessor*, size_t i, float* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; + int unpack_float_element_set(grib_accessor*, const size_t* index_array, size_t len, float* val_array) override; + int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len) override; + int clear(grib_accessor*) override; + grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; +}; + + +template +int unpack_helper(grib_accessor* a, T* v, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + int type = GRIB_TYPE_UNDEFINED; + const char* Tname = type_to_string(*v); + //if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { + try { + long val = 0; + size_t l = 1; + a->unpack_long(&val, &l); + *v = val; + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to %s", a->name, Tname); + return GRIB_SUCCESS; + } + catch (std::runtime_error& e) { + // TODO(maee): log error + } + + //if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { + try { + char val[1024]; + size_t l = sizeof(val); + char* last = NULL; + a->unpack_string(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 %s", a->name, Tname); + return GRIB_SUCCESS; + } + } + catch (std::runtime_error& e) { + // TODO(maee): log error + } + + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as %s", a->name, Tname); + 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/accessor/grib_accessor_class_iterator.h b/src/accessor/grib_accessor_class_iterator.h new file mode 100644 index 000000000..7288fa205 --- /dev/null +++ b/src/accessor/grib_accessor_class_iterator.h @@ -0,0 +1,36 @@ +/* + * (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. + */ + +/*************************** + * Enrico Fucile + *************************/ + +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_iterator_t : public grib_accessor_gen_t +{ +public: + grib_arguments* args; +}; + +class grib_accessor_class_iterator_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_iterator_t(const char* name) : grib_accessor_class_gen_t(name) {}; + grib_accessor* create_empty_accessor() override { return new grib_accessor_iterator_t{}; } + void init(grib_accessor* a, const long l, grib_arguments* args) override; + void dump(grib_accessor* a, grib_dumper* dumper) override; +}; + + +//grib_iterator* grib_iterator_new(const grib_handle* ch, unsigned long flags, int* error) diff --git a/src/accessor/grib_accessor_class_long.h b/src/accessor/grib_accessor_class_long.h new file mode 100644 index 000000000..a0b01f9ae --- /dev/null +++ b/src/accessor/grib_accessor_class_long.h @@ -0,0 +1,22 @@ +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_long_t : public grib_accessor_gen_t +{}; + +class grib_accessor_class_long_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_long_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_long_t{}; } + void init(grib_accessor* a, const long len, grib_arguments* arg) override; + int get_native_type(grib_accessor* a) override; + int pack_missing(grib_accessor* a) override; + int pack_string(grib_accessor* a, const char*, size_t* len) override; + int unpack_double(grib_accessor* a, double* val, size_t* len) override; + int unpack_string(grib_accessor* a, char*, size_t* len) override; + void dump(grib_accessor* a, grib_dumper*) override; + int compare(grib_accessor* a, grib_accessor*) override; +}; diff --git a/src/accessor/grib_accessor_class_nearest.h b/src/accessor/grib_accessor_class_nearest.h new file mode 100644 index 000000000..831afea60 --- /dev/null +++ b/src/accessor/grib_accessor_class_nearest.h @@ -0,0 +1,33 @@ +/* + * (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. + */ + +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_nearest_t : public grib_accessor_gen_t +{ +public: + grib_arguments* args; +}; + + +class grib_accessor_class_nearest_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_nearest_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_nearest_t{}; } + void init(grib_accessor* a, const long l, grib_arguments* args) override; + void dump(grib_accessor* a, grib_dumper* dumper) override; +}; + + +//grib_nearest* grib_nearest_new(const grib_handle* ch, int* error); diff --git a/src/accessor/grib_accessor_class_smart_table.h b/src/accessor/grib_accessor_class_smart_table.h new file mode 100644 index 000000000..b6146a981 --- /dev/null +++ b/src/accessor/grib_accessor_class_smart_table.h @@ -0,0 +1,52 @@ +/* + * (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. + */ + +/***************************************** + * Enrico Fucile + ****************************************/ + + +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" +#include + + +class grib_accessor_smart_table_t : public grib_accessor_unsigned_t +{ +public: + const char* values; + const char* tablename; + const char* masterDir; + const char* localDir; + const char* extraDir; + const char* extraTable; + int widthOfCode; + long* tableCodes; + size_t tableCodesSize; + grib_smart_table* table; + int dirty; +}; + + +class grib_accessor_class_smart_table_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_smart_table_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_smart_table_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; diff --git a/src/accessor/grib_accessor_class_transient.h b/src/accessor/grib_accessor_class_transient.h new file mode 100644 index 000000000..fa6771ecd --- /dev/null +++ b/src/accessor/grib_accessor_class_transient.h @@ -0,0 +1,26 @@ +/* + * (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. + */ + +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_variable.h" + +class grib_accessor_transient_t : public grib_accessor_variable_t { +public: +}; + +class grib_accessor_class_transient_t : public grib_accessor_class_variable_t { +public: + void init(grib_accessor* a, const long l, grib_arguments* args) override; + grib_accessor_class_transient_t(const char* name) : grib_accessor_class_variable_t(name) {}; + grib_accessor* create_empty_accessor() override { return new grib_accessor_transient_t{}; } +}; + diff --git a/src/accessor/grib_accessor_class_unsigned.h b/src/accessor/grib_accessor_class_unsigned.h new file mode 100644 index 000000000..99aadb93a --- /dev/null +++ b/src/accessor/grib_accessor_class_unsigned.h @@ -0,0 +1,40 @@ +/* + * (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. + */ + +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_unsigned_t : public grib_accessor_long_t +{ +public: + long nbytes; + grib_arguments* arg; +}; + + +class grib_accessor_class_unsigned_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_unsigned_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_unsigned_t{}; } + void init(grib_accessor* a, const long len, grib_arguments* arg) override; + void dump(grib_accessor* a, grib_dumper* dumper) override; + int unpack_long(grib_accessor* a, long* val, size_t* len) override; + int pack_long(grib_accessor* a, const long* val, size_t* len) override; + long byte_count(grib_accessor* a) override; + int value_count(grib_accessor* a, long* len) override; + long byte_offset(grib_accessor* a) override; + void update_size(grib_accessor* a, size_t s) override; + long next_offset(grib_accessor* a) override; + int is_missing(grib_accessor* a) override; + void destroy(grib_context* context, grib_accessor* a) override; +}; diff --git a/src/accessor/grib_accessor_class_variable.h b/src/accessor/grib_accessor_class_variable.h new file mode 100644 index 000000000..91c7f815d --- /dev/null +++ b/src/accessor/grib_accessor_class_variable.h @@ -0,0 +1,50 @@ +/* + * (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. + */ + +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor.h" +#include "grib_accessor_class_gen.h" + + +class grib_accessor_variable_t : public grib_accessor_gen_t +{ +public: + double dval; + float fval; + char* cval; + char* cname; + int type; +}; + +class grib_accessor_class_variable_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_variable_t(const char* name) : grib_accessor_class_gen_t(name) {}; + grib_accessor* create_empty_accessor() override { return new grib_accessor_variable_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_float(grib_accessor*, const float* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long byte_count(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; + grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; +}; diff --git a/src/accessor/grib_accessors_list.cc b/src/accessor/grib_accessors_list.cc new file mode 100644 index 000000000..29d8b1f0d --- /dev/null +++ b/src/accessor/grib_accessors_list.cc @@ -0,0 +1,143 @@ + +#include "grib_accessors_list.h" + +grib_accessors_list* grib_accessors_list_create(grib_context* c) +{ + return (grib_accessors_list*)grib_context_malloc_clear(c, sizeof(grib_accessors_list)); +} + +void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al) { + grib_accessors_list* tmp; + while (al) { + tmp = al->next_; + grib_context_free(c, al); + al = tmp; + } +} + + + + +int grib_accessors_list::value_count(size_t* count) +{ + long lcount = 0; + *count = 0; + grib_accessors_list* al = this; + while (al) { + al->accessor->value_count(&lcount); + *count += lcount; + al = al->next_; + } + return 0; +} + +void grib_accessors_list::push(grib_accessor* a, int rank) +{ + grib_accessors_list* last; + const grib_context* c = a->context; + + last = this->last(); + if (last && last->accessor) { + last->next_ = (grib_accessors_list*)grib_context_malloc_clear(c, sizeof(grib_accessors_list)); + last->next_->accessor = a; + last->next_->prev_ = last; + last->next_->rank = rank; + this->last_ = last->next_; + } + else { + this->accessor = a; + this->rank = rank; + this->last_ = this; + } +} + +grib_accessors_list* grib_accessors_list::last() +{ + return last_; +} + +grib_accessors_list::~grib_accessors_list() +{ + grib_accessors_list* tmp; + grib_context* c = grib_context_get_default(); + + grib_accessors_list* al = this; + while (al) { + tmp = al->next_; + //grib_accessor_delete(c, al->accessor); + grib_context_free(c, al); + al = tmp; + } +} + +int grib_accessors_list::unpack_long(long* val, size_t* buffer_len) +{ + int err = GRIB_SUCCESS; + size_t unpacked_len = 0; + size_t len = 0; + + grib_accessors_list* al = this; + while (al && err == GRIB_SUCCESS) { + len = *buffer_len - unpacked_len; + err = al->accessor->unpack_long(val + unpacked_len, &len); + unpacked_len += len; + al = al->next_; + } + + *buffer_len = unpacked_len; + return err; +} + +int grib_accessors_list::unpack_double(double* val, size_t* buffer_len) +{ + int err = GRIB_SUCCESS; + size_t unpacked_len = 0; + size_t len = 0; + + grib_accessors_list* al = this; + while (al && err == GRIB_SUCCESS) { + len = *buffer_len - unpacked_len; + err = al->accessor->unpack_double(val + unpacked_len, &len); + unpacked_len += len; + al = al->next_; + } + + *buffer_len = unpacked_len; + return err; +} + +int grib_accessors_list::unpack_float(float* val, size_t* buffer_len) +{ + int err = GRIB_SUCCESS; + size_t unpacked_len = 0; + size_t len = 0; + + grib_accessors_list* al = this; + while (al && err == GRIB_SUCCESS) { + len = *buffer_len - unpacked_len; + err = al->accessor->unpack_float(val + unpacked_len, &len); + unpacked_len += len; + al = al->next_; + } + + *buffer_len = unpacked_len; + return err; +} + +int grib_accessors_list::unpack_string(char** val, size_t* buffer_len) +{ + int err = GRIB_SUCCESS; + size_t unpacked_len = 0; + size_t len = 0; + + grib_accessors_list* al = this; + while (al && err == GRIB_SUCCESS) { + len = *buffer_len - unpacked_len; + err = al->accessor->unpack_string_array(val + unpacked_len, &len); + unpacked_len += len; + al = al->next_; + } + + *buffer_len = unpacked_len; + return err; +} diff --git a/src/accessor/grib_accessors_list.h b/src/accessor/grib_accessors_list.h new file mode 100644 index 000000000..f088414f5 --- /dev/null +++ b/src/accessor/grib_accessors_list.h @@ -0,0 +1,28 @@ +#pragma once + +#include "grib_accessor.h" + +struct grib_accessors_list +{ +public: + grib_accessors_list(); + ~grib_accessors_list(); + + int value_count(size_t* count); + void push(grib_accessor* a, int rank); + grib_accessors_list* last(); + int unpack_long(long* val, size_t* buffer_len); + int unpack_double(double* val, size_t* buffer_len); + int unpack_float(float* val, size_t* buffer_len); + int unpack_string(char** val, size_t* buffer_len); + + grib_accessor* accessor; + int rank; + grib_accessors_list* next_; + grib_accessors_list* prev_; + grib_accessors_list* last_; +}; + +//grib_accessors_list* grib_accessors_list_create(grib_context* c); +//void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al); + From 35b689a4d8a371be79fee7481979299bdec8011a Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Sun, 17 Mar 2024 16:44:07 +0000 Subject: [PATCH 006/196] Accessor backend ready for running accessors --- examples/C/grib_pthreads.c | 13 +- src/CMakeLists.txt | 414 ++++----- src/accessor/grib_accessor.cc | 786 +----------------- src/accessor/grib_accessor.h | 180 +++- src/accessor/grib_accessor_class_codetable.cc | 195 ++--- src/accessor/grib_accessor_class_constant.cc | 99 +-- src/accessor/grib_accessor_class_gen.cc | 5 +- src/accessor/grib_accessor_class_gen.h | 51 +- src/accessor/grib_accessor_class_iterator.cc | 98 +-- src/accessor/grib_accessor_class_long.cc | 141 +--- src/accessor/grib_accessor_class_nearest.cc | 98 +-- .../grib_accessor_class_smart_table.cc | 161 +--- src/accessor/grib_accessor_class_transient.cc | 92 +- src/accessor/grib_accessor_class_unsigned.cc | 149 +--- src/accessor/grib_accessor_class_variable.cc | 201 +---- src/action_class_gen.cc | 2 +- src/action_class_remove.cc | 2 +- src/action_class_transient_darray.cc | 2 +- src/bufr_keys_iterator.cc | 4 +- src/eccodes_prototypes.h | 68 +- src/grib_accessor_class.cc | 38 +- src/grib_accessor_class.h | 404 ++++----- src/grib_accessor_classes_hash.cc | 619 ++------------ src/grib_accessor_factory.h | 390 ++++----- src/grib_accessor_factory_hash_list | 390 ++++----- src/grib_api_internal.h | 157 +--- src/grib_buffer.cc | 18 +- src/grib_bufr_descriptor.cc | 6 +- src/grib_dependency.cc | 4 +- src/grib_dumper_class.cc | 10 +- src/grib_dumper_class_bufr_decode_C.cc | 26 +- src/grib_dumper_class_bufr_decode_filter.cc | 20 +- src/grib_dumper_class_bufr_decode_fortran.cc | 24 +- src/grib_dumper_class_bufr_decode_python.cc | 24 +- src/grib_dumper_class_bufr_encode_C.cc | 34 +- src/grib_dumper_class_bufr_encode_filter.cc | 34 +- src/grib_dumper_class_bufr_encode_fortran.cc | 34 +- src/grib_dumper_class_bufr_encode_python.cc | 34 +- src/grib_dumper_class_bufr_simple.cc | 36 +- src/grib_dumper_class_debug.cc | 34 +- src/grib_dumper_class_default.cc | 38 +- src/grib_dumper_class_grib_encode_C.cc | 16 +- src/grib_dumper_class_json.cc | 22 +- src/grib_dumper_class_serialize.cc | 14 +- src/grib_dumper_class_wmo.cc | 32 +- src/grib_handle.cc | 2 +- src/grib_keys_iterator.cc | 16 +- src/grib_loader_from_handle.cc | 28 +- src/grib_parse_utils.cc | 34 +- src/grib_query.cc | 49 +- src/grib_value.cc | 107 +-- tests/grib_unpack_subarray.cc | 4 +- tools/bufr_dump.cc | 5 +- 53 files changed, 1673 insertions(+), 3791 deletions(-) diff --git a/examples/C/grib_pthreads.c b/examples/C/grib_pthreads.c index 2dce9a4cd..d9b23344c 100644 --- a/examples/C/grib_pthreads.c +++ b/examples/C/grib_pthreads.c @@ -9,11 +9,22 @@ */ #include -#include "grib_api_internal.h" +#include +#include +/*#include "grib_api_internal.h"*/ #include "eccodes.h" #define NUM_THREADS 4 +void Assert(int condition) +{ + if (!condition) { + printf("Assertion failed\n"); + exit(1); + } +} + + /* Return 0 if numbers considered equal, otherwise 1 */ static int compare_doubles(double a, double b, double tolerance) { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 97cd81dfc..21548a39c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,6 +9,9 @@ # nor does it submit to any jurisdiction. # list( APPEND eccodes_src_files + ./accessor/grib_accessor.cc + ./accessor/grib_accessors_list.cc + ./grib_accessor_class.cc step_unit.cc step.cc step_utilities.cc @@ -20,9 +23,9 @@ list( APPEND eccodes_src_files action_class_gen.cc action_class_if.cc action_class_switch.cc - grib_accessor_class_g1fcperiod.cc - grib_accessor_class_g1end_of_interval_monthly.cc - grib_accessor_class_mars_param.cc + #grib_accessor_class_g1fcperiod.cc + #grib_accessor_class_g1end_of_interval_monthly.cc + #grib_accessor_class_mars_param.cc action_class_section.cc action_class_list.cc action_class_while.cc @@ -47,7 +50,6 @@ list( APPEND eccodes_src_files action_class_modify.cc action_class_transient_darray.cc eccodes.cc - grib_accessor.cc grib_concept.cc grib_hash_array.cc grib_bufr_descriptor.cc @@ -60,208 +62,208 @@ list( APPEND eccodes_src_files grib_iarray.cc grib_viarray.cc codes_memfs.cc - grib_accessor_class_ascii.cc - grib_accessor_class_bit.cc - grib_accessor_class_bitmap.cc - grib_accessor_class_bits.cc - grib_accessor_class_bits_per_value.cc - grib_accessor_class_bufr_elements_table.cc - grib_accessor_class_bufr_data_array.cc - grib_accessor_class_bufr_data_element.cc - grib_accessor_class_bufr_group.cc - grib_accessor_class_bufr_string_values.cc - grib_accessor_class_pack_bufr_values.cc - grib_accessor_class_unpack_bufr_values.cc - grib_accessor_class_group.cc - grib_accessor_class_non_alpha.cc - grib_accessor_class_g1bitmap.cc - grib_accessor_class_g2bitmap.cc - grib_accessor_class_concept.cc - grib_accessor_class_hash_array.cc - grib_accessor_class_decimal_precision.cc - grib_accessor_class_divdouble.cc - grib_accessor_class_multdouble.cc - grib_accessor_class_budgdate.cc - grib_accessor_class_validity_date.cc - grib_accessor_class_validity_time.cc - grib_accessor_class_bytes.cc - grib_accessor_class.cc - grib_accessor_class_change_alternative_row_scanning.cc - grib_accessor_class_change_scanning_direction.cc - grib_accessor_class_check_internal_version.cc - grib_accessor_class_codeflag.cc - grib_accessor_class_smart_table.cc - grib_accessor_class_smart_table_column.cc - grib_accessor_class_codetable.cc - grib_accessor_class_codetable_units.cc - grib_accessor_class_codetable_title.cc - grib_accessor_class_step_human_readable.cc - grib_accessor_class_count_file.cc - grib_accessor_class_count_total.cc - grib_accessor_class_double.cc - grib_accessor_class_element.cc - grib_accessor_class_evaluate.cc - grib_accessor_class_g1date.cc - grib_accessor_class_g1monthlydate.cc - grib_accessor_class_library_version.cc - grib_accessor_class_when.cc - grib_accessor_class_g1verificationdate.cc - grib_accessor_class_g1day_of_the_year_date.cc - grib_accessor_class_g1_half_byte_codeflag.cc - grib_accessor_class_g1forecastmonth.cc - grib_accessor_class_g1step_range.cc - grib_accessor_class_g2step_range.cc - grib_accessor_class_data_g22order_packing.cc - grib_accessor_class_mars_step.cc - grib_accessor_class_message_copy.cc - grib_accessor_class_dictionary.cc - grib_accessor_class_latlon_increment.cc - grib_accessor_class_g2date.cc - grib_accessor_class_g2level.cc - grib_accessor_class_g2end_step.cc - grib_accessor_class_g2latlon.cc - grib_accessor_class_g2lon.cc - grib_accessor_class_global_gaussian.cc - grib_accessor_class_gaussian_grid_name.cc - grib_accessor_class_gen.cc - grib_accessor_class_getenv.cc - grib_accessor_class_gts_header.cc - grib_accessor_class_ifs_param.cc - grib_accessor_class_julian_day.cc - grib_accessor_class_julian_date.cc - grib_accessor_class_closest_date.cc - grib_accessor_class_latlonvalues.cc - grib_accessor_class_latitudes.cc - grib_accessor_class_longitudes.cc - grib_accessor_class_offset_file.cc - grib_accessor_class_scale.cc - grib_accessor_class_from_scale_factor_scaled_value.cc - grib_accessor_class_g2bitmap_present.cc - grib_accessor_class_ibmfloat.cc - grib_accessor_class_ieeefloat.cc - grib_accessor_class_constant.cc - grib_accessor_class_iterator.cc - grib_accessor_class_message.cc - grib_accessor_class_nearest.cc - grib_accessor_class_ksec1expver.cc - grib_accessor_class_label.cc - grib_accessor_class_long.cc - grib_accessor_class_lookup.cc - grib_accessor_class_octahedral_gaussian.cc - grib_accessor_class_octet_number.cc - grib_accessor_class_headers_only.cc - grib_accessor_class_padding.cc - grib_accessor_class_pad.cc - grib_accessor_class_padto.cc - grib_accessor_class_padtoeven.cc - grib_accessor_class_padtomultiple.cc - grib_accessor_class_section_padding.cc - grib_accessor_class_packing_type.cc - grib_accessor_class_section_pointer.cc - grib_accessor_class_position.cc - grib_accessor_class_signed.cc - grib_accessor_class_signed_bits.cc - grib_accessor_class_section.cc - grib_accessor_class_step_in_units.cc - grib_accessor_class_optimal_step_units.cc - grib_accessor_class_section_length.cc - grib_accessor_class_g1_message_length.cc - grib_accessor_class_g1_section4_length.cc - grib_accessor_class_size.cc - grib_accessor_class_rdbtime_guess_date.cc - grib_accessor_class_scale_values.cc - grib_accessor_class_offset_values.cc - grib_accessor_class_sprintf.cc - grib_accessor_class_round.cc - grib_accessor_class_spectral_truncation.cc - grib_accessor_class_time.cc - grib_accessor_class_transient.cc - grib_accessor_class_trim.cc - grib_accessor_class_transient_darray.cc - grib_accessor_class_values.cc - grib_accessor_class_simple_packing_error.cc - grib_accessor_class_data_simple_packing.cc - grib_accessor_class_count_missing.cc - grib_accessor_class_data_sh_packed.cc - grib_accessor_class_data_sh_unpacked.cc - grib_accessor_class_number_of_values_data_raw_packing.cc - grib_accessor_class_data_g1simple_packing.cc - grib_accessor_class_data_g1shsimple_packing.cc - grib_accessor_class_data_shsimple_packing.cc - grib_accessor_class_data_dummy_field.cc - grib_accessor_class_variable.cc - grib_accessor_class_second_order_bits_per_value.cc - grib_accessor_class_data_g2simple_packing.cc - grib_accessor_class_data_g2simple_packing_with_preprocessing.cc - grib_accessor_class_data_g2shsimple_packing.cc - grib_accessor_class_data_g2complex_packing.cc - grib_accessor_class_data_g1second_order_row_by_row_packing.cc - grib_accessor_class_data_g1second_order_constant_width_packing.cc - grib_accessor_class_data_g1second_order_general_packing.cc - grib_accessor_class_data_g1second_order_general_extended_packing.cc - grib_accessor_class_g2grid.cc - grib_accessor_class_unexpanded_descriptors.cc - grib_accessor_class_expanded_descriptors.cc - grib_accessor_class_bufrdc_expanded_descriptors.cc - grib_accessor_class_data_apply_bitmap.cc - grib_accessor_class_data_apply_boustrophedonic.cc - grib_accessor_class_data_apply_boustrophedonic_bitmap.cc - grib_accessor_class_data_secondary_bitmap.cc - grib_accessor_class_data_g1secondary_bitmap.cc - grib_accessor_class_data_g2secondary_bitmap.cc - grib_accessor_class_data_jpeg2000_packing.cc - grib_accessor_class_data_png_packing.cc - grib_accessor_class_data_ccsds_packing.cc - grib_accessor_class_data_raw_packing.cc - grib_accessor_class_data_complex_packing.cc - grib_accessor_class_data_g1complex_packing.cc - grib_accessor_class_gds_not_present_bitmap.cc - grib_accessor_class_gds_is_present.cc - grib_accessor_class_select_step_template.cc - grib_accessor_class_local_definition.cc - grib_accessor_class_g2_eps.cc - grib_accessor_class_g2_aerosol.cc - grib_accessor_class_g2_chemical.cc - grib_accessor_class_g2_mars_labeling.cc - grib_accessor_class_md5.cc - grib_accessor_class_proj_string.cc + accessor/grib_accessor_class_gen.cc + #grib_accessor_class_ascii.cc + #grib_accessor_class_bit.cc + #grib_accessor_class_bitmap.cc + #grib_accessor_class_bits.cc + #grib_accessor_class_bits_per_value.cc + #grib_accessor_class_bufr_elements_table.cc + #grib_accessor_class_bufr_data_array.cc + #grib_accessor_class_bufr_data_element.cc + #grib_accessor_class_bufr_group.cc + #grib_accessor_class_bufr_string_values.cc + #grib_accessor_class_pack_bufr_values.cc + #grib_accessor_class_unpack_bufr_values.cc + #grib_accessor_class_group.cc + #grib_accessor_class_non_alpha.cc + #grib_accessor_class_g1bitmap.cc + #grib_accessor_class_g2bitmap.cc + #grib_accessor_class_concept.cc + #grib_accessor_class_hash_array.cc + #grib_accessor_class_decimal_precision.cc + #grib_accessor_class_divdouble.cc + #grib_accessor_class_multdouble.cc + #grib_accessor_class_budgdate.cc + #grib_accessor_class_validity_date.cc + #grib_accessor_class_validity_time.cc + #grib_accessor_class_bytes.cc + #grib_accessor_class_change_alternative_row_scanning.cc + #grib_accessor_class_change_scanning_direction.cc + #grib_accessor_class_check_internal_version.cc + #grib_accessor_class_codeflag.cc + accessor/grib_accessor_class_smart_table.cc + #grib_accessor_class_smart_table_column.cc + accessor/grib_accessor_class_codetable.cc + #grib_accessor_class_codetable_units.cc + #grib_accessor_class_codetable_title.cc + #grib_accessor_class_step_human_readable.cc + #grib_accessor_class_count_file.cc + #grib_accessor_class_count_total.cc + #grib_accessor_class_double.cc + #grib_accessor_class_element.cc + #grib_accessor_class_evaluate.cc + #grib_accessor_class_g1date.cc + #grib_accessor_class_g1monthlydate.cc + #grib_accessor_class_library_version.cc + #grib_accessor_class_when.cc + #grib_accessor_class_g1verificationdate.cc + #grib_accessor_class_g1day_of_the_year_date.cc + #grib_accessor_class_g1_half_byte_codeflag.cc + #grib_accessor_class_g1forecastmonth.cc + #grib_accessor_class_g1step_range.cc + #grib_accessor_class_g2step_range.cc + #grib_accessor_class_data_g22order_packing.cc + #grib_accessor_class_mars_step.cc + #grib_accessor_class_message_copy.cc + #grib_accessor_class_dictionary.cc + #grib_accessor_class_latlon_increment.cc + #grib_accessor_class_g2date.cc + #grib_accessor_class_g2level.cc + #grib_accessor_class_g2end_step.cc + #grib_accessor_class_g2latlon.cc + #grib_accessor_class_g2lon.cc + #grib_accessor_class_global_gaussian.cc + #grib_accessor_class_gaussian_grid_name.cc + #grib_accessor_class_gen.cc + #grib_accessor_class_getenv.cc + #grib_accessor_class_gts_header.cc + #grib_accessor_class_ifs_param.cc + #grib_accessor_class_julian_day.cc + #grib_accessor_class_julian_date.cc + #grib_accessor_class_closest_date.cc + #grib_accessor_class_latlonvalues.cc + #grib_accessor_class_latitudes.cc + #grib_accessor_class_longitudes.cc + #grib_accessor_class_offset_file.cc + #grib_accessor_class_scale.cc + #grib_accessor_class_from_scale_factor_scaled_value.cc + #grib_accessor_class_g2bitmap_present.cc + #grib_accessor_class_ibmfloat.cc + #grib_accessor_class_ieeefloat.cc + accessor/grib_accessor_class_constant.cc + accessor/grib_accessor_class_iterator.cc + #grib_accessor_class_message.cc + accessor/grib_accessor_class_nearest.cc + #grib_accessor_class_ksec1expver.cc + #grib_accessor_class_label.cc + accessor/grib_accessor_class_long.cc + #grib_accessor_class_lookup.cc + #grib_accessor_class_octahedral_gaussian.cc + #grib_accessor_class_octet_number.cc + #grib_accessor_class_headers_only.cc + #grib_accessor_class_padding.cc + #grib_accessor_class_pad.cc + #grib_accessor_class_padto.cc + #grib_accessor_class_padtoeven.cc + #grib_accessor_class_padtomultiple.cc + #grib_accessor_class_section_padding.cc + #grib_accessor_class_packing_type.cc + #grib_accessor_class_section_pointer.cc + #grib_accessor_class_position.cc + #grib_accessor_class_signed.cc + #grib_accessor_class_signed_bits.cc + #grib_accessor_class_section.cc + #grib_accessor_class_step_in_units.cc + #grib_accessor_class_optimal_step_units.cc + #grib_accessor_class_section_length.cc + #grib_accessor_class_g1_message_length.cc + #grib_accessor_class_g1_section4_length.cc + #grib_accessor_class_size.cc + #grib_accessor_class_rdbtime_guess_date.cc + #grib_accessor_class_scale_values.cc + #grib_accessor_class_offset_values.cc + #grib_accessor_class_sprintf.cc + #grib_accessor_class_round.cc + #grib_accessor_class_spectral_truncation.cc + #grib_accessor_class_time.cc + accessor/grib_accessor_class_transient.cc + #grib_accessor_class_trim.cc + #grib_accessor_class_transient_darray.cc + #grib_accessor_class_values.cc + #grib_accessor_class_simple_packing_error.cc + #grib_accessor_class_data_simple_packing.cc + #grib_accessor_class_count_missing.cc + #grib_accessor_class_data_sh_packed.cc + #grib_accessor_class_data_sh_unpacked.cc + #grib_accessor_class_number_of_values_data_raw_packing.cc + #grib_accessor_class_data_g1simple_packing.cc + #grib_accessor_class_data_g1shsimple_packing.cc + #grib_accessor_class_data_shsimple_packing.cc + #grib_accessor_class_data_dummy_field.cc + accessor/grib_accessor_class_variable.cc + #grib_accessor_class_second_order_bits_per_value.cc + #grib_accessor_class_data_g2simple_packing.cc + #grib_accessor_class_data_g2simple_packing_with_preprocessing.cc + #grib_accessor_class_data_g2shsimple_packing.cc + #grib_accessor_class_data_g2complex_packing.cc + #grib_accessor_class_data_g1second_order_row_by_row_packing.cc + #grib_accessor_class_data_g1second_order_constant_width_packing.cc + #grib_accessor_class_data_g1second_order_general_packing.cc + #grib_accessor_class_data_g1second_order_general_extended_packing.cc + #grib_accessor_class_g2grid.cc + #grib_accessor_class_unexpanded_descriptors.cc + #grib_accessor_class_expanded_descriptors.cc + #grib_accessor_class_bufrdc_expanded_descriptors.cc + #grib_accessor_class_data_apply_bitmap.cc + #grib_accessor_class_data_apply_boustrophedonic.cc + #grib_accessor_class_data_apply_boustrophedonic_bitmap.cc + #grib_accessor_class_data_secondary_bitmap.cc + #grib_accessor_class_data_g1secondary_bitmap.cc + #grib_accessor_class_data_g2secondary_bitmap.cc + #grib_accessor_class_data_jpeg2000_packing.cc + #grib_accessor_class_data_png_packing.cc + #grib_accessor_class_data_ccsds_packing.cc + #grib_accessor_class_data_raw_packing.cc + #grib_accessor_class_data_complex_packing.cc + #grib_accessor_class_data_g1complex_packing.cc + #grib_accessor_class_gds_not_present_bitmap.cc + #grib_accessor_class_gds_is_present.cc + #grib_accessor_class_select_step_template.cc + #grib_accessor_class_local_definition.cc + #grib_accessor_class_g2_eps.cc + #grib_accessor_class_g2_aerosol.cc + #grib_accessor_class_g2_chemical.cc + #grib_accessor_class_g2_mars_labeling.cc + #grib_accessor_class_md5.cc + #grib_accessor_class_proj_string.cc grib_jasper_encoding.cc grib_openjpeg_encoding.cc action_class_set_missing.cc - grib_accessor_class_number_of_points.cc - grib_accessor_class_suppressed.cc + #grib_accessor_class_number_of_points.cc + #grib_accessor_class_suppressed.cc grib_index.cc - grib_accessor_class_number_of_points_gaussian.cc - grib_accessor_class_number_of_values.cc - grib_accessor_class_number_of_coded_values.cc - grib_accessor_class_g1number_of_coded_values_sh_complex.cc - grib_accessor_class_g1number_of_coded_values_sh_simple.cc - grib_accessor_class_dirty.cc - grib_accessor_class_statistics.cc - grib_accessor_class_statistics_spectral.cc - grib_accessor_class_unsigned.cc - grib_accessor_class_unsigned_bits.cc - grib_accessor_class_raw.cc - grib_accessor_class_bufr_simple_thinning.cc - grib_accessor_class_bufr_extract_subsets.cc - grib_accessor_class_bufr_extract_area_subsets.cc - grib_accessor_class_bufr_extract_datetime_subsets.cc - grib_accessor_class_spd.cc - grib_accessor_class_sum.cc - grib_accessor_class_to_integer.cc - grib_accessor_class_to_double.cc - grib_accessor_class_to_string.cc - grib_accessor_class_sexagesimal2decimal.cc - grib_accessor_class_vector.cc - grib_accessor_class_long_vector.cc + #grib_accessor_class_number_of_points_gaussian.cc + #grib_accessor_class_number_of_values.cc + #grib_accessor_class_number_of_coded_values.cc + #grib_accessor_class_g1number_of_coded_values_sh_complex.cc + #grib_accessor_class_g1number_of_coded_values_sh_simple.cc + #grib_accessor_class_dirty.cc + #grib_accessor_class_statistics.cc + #grib_accessor_class_statistics_spectral.cc + accessor/grib_accessor_class_unsigned.cc + #grib_accessor_class_unsigned_bits.cc + #grib_accessor_class_raw.cc + #grib_accessor_class_bufr_simple_thinning.cc + #grib_accessor_class_bufr_extract_subsets.cc + #grib_accessor_class_bufr_extract_area_subsets.cc + #grib_accessor_class_bufr_extract_datetime_subsets.cc + #grib_accessor_class_spd.cc + #grib_accessor_class_sum.cc + #grib_accessor_class_to_integer.cc + #grib_accessor_class_to_double.cc + #grib_accessor_class_to_string.cc + #grib_accessor_class_sexagesimal2decimal.cc + #grib_accessor_class_vector.cc + #grib_accessor_class_long_vector.cc grib_gaussian_reduced.cc - grib_accessor_class_abstract_vector.cc - grib_accessor_class_abstract_long_vector.cc + #grib_accessor_class_abstract_vector.cc + #grib_accessor_class_abstract_long_vector.cc grib_loader_from_handle.cc grib_bits.cc grib_ibmfloat.cc grib_ieeefloat.cc - grib_accessor_class_reference_value_error.cc + #grib_accessor_class_reference_value_error.cc grib_memory.cc grib_buffer.cc grib_dumper.cc @@ -364,16 +366,16 @@ list( APPEND eccodes_src_files grib_yacc.h md5.h md5.cc - grib_accessor_class_uint16.cc - grib_accessor_class_uint32.cc - grib_accessor_class_uint32_little_endian.cc - grib_accessor_class_uint64.cc - grib_accessor_class_uint64_little_endian.cc - grib_accessor_class_uint8.cc - grib_accessor_class_blob.cc + #grib_accessor_class_uint16.cc + #grib_accessor_class_uint32.cc + #grib_accessor_class_uint32_little_endian.cc + #grib_accessor_class_uint64.cc + #grib_accessor_class_uint64_little_endian.cc + #grib_accessor_class_uint8.cc + #grib_accessor_class_blob.cc grib_optimize_decimal_factor.cc - grib_accessor_class_data_g2bifourier_packing.cc - grib_accessor_class_data_run_length_packing.cc + #grib_accessor_class_data_g2bifourier_packing.cc + #grib_accessor_class_data_run_length_packing.cc eccodes_windef.h # We ship our own generated lex/yacc C files grib_yacc.cc grib_lex.cc ) diff --git a/src/accessor/grib_accessor.cc b/src/accessor/grib_accessor.cc index a08f5348e..da14833bd 100644 --- a/src/accessor/grib_accessor.cc +++ b/src/accessor/grib_accessor.cc @@ -13,6 +13,7 @@ ***************************************************************************/ #include "grib_accessor.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 @@ -27,657 +28,40 @@ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) return (*a == 0 && *b == 0) ? 0 : 1; } -void grib_accessor_dump(grib_accessor* a, grib_dumper* f) -{ - grib_accessor_class* c = a->cclass; - while (c) { - if (c->dump) { - c->dump(a, f); - return; - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); -} - -int grib_pack_missing(grib_accessor* a) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); - while (c) { - if (c->pack_missing) { - return c->pack_missing(a); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -// int grib_pack_zero(grib_accessor* a) -// { -// grib_accessor_class* c = a->cclass; -// while (c) { -// if (c->clear) { -// return c->clear(a); -// } -// c = c->super ? *(c->super) : NULL; -// } -// DEBUG_ASSERT(0); -// return 0; -// } - -int grib_is_missing_internal(grib_accessor* a) -{ - grib_accessor_class* c = a->cclass; - // grib_context_log(a->context, GRIB_LOG_DEBUG, - // "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); - while (c) { - if (c->is_missing) { - return c->is_missing(a); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_pack_double(grib_accessor* a, const double* v, size_t* len) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); - while (c) { - if (c->pack_double) { - return c->pack_double(a, v, len); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - 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; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_pack_expression(grib_accessor* a, grib_expression* e) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); - while (c) { - if (c->pack_expression) { - return c->pack_expression(a, e); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_pack_string(grib_accessor* a, const char* v, size_t* len) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (string) %s",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?v:"(null)"); - while (c) { - if (c->pack_string) { - return c->pack_string(a, v, len); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_pack_string_array(grib_accessor* a, const char** v, size_t* len) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (string) %s",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?v:"(null)"); - while (c) { - if (c->pack_string_array) { - return c->pack_string_array(a, v, len); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_pack_long(grib_accessor* a, const long* v, size_t* len) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (long) %d",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); - while (c) { - if (c->pack_long) { - return c->pack_long(a, v, len); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_pack_bytes(grib_accessor* a, const unsigned char* v, size_t* len) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (bytes) %d",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); - while (c) { - if (c->pack_bytes) { - return c->pack_bytes(a, v, len); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_unpack_bytes(grib_accessor* a, unsigned char* v, size_t* len) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is unpacking (bytes)",(a->parent->owner)?(a->parent->owner->name):"root", a->name); - while (c) { - if (c->unpack_bytes) { - return c->unpack_bytes(a, v, len); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_unpack_double_subarray(grib_accessor* a, double* v, size_t start, size_t len) -{ - grib_accessor_class* c = a->cclass; - while (c) { - if (c->unpack_double_subarray) { - return c->unpack_double_subarray(a, v, start, len); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_unpack_double(grib_accessor* a, double* v, size_t* len) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is unpacking (double)",(a->parent->owner)?(a->parent->owner->name):"root", a->name); - while (c) { - if (c->unpack_double) { - return c->unpack_double(a, v, len); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -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); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - template <> -int grib_unpack(grib_accessor* a, double* v, size_t* len) +int grib_accessor::unpack(double* v, size_t* len) { - return grib_unpack_double(a, v, len); + return unpack_double(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) +int grib_accessor::unpack(float* v, size_t* len) { - grib_accessor_class* c = a->cclass; - while (c) { - if (c->unpack_double_element) { - return c->unpack_double_element(a, i, v); - } - c = c->super ? *(c->super) : NULL; - } - 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; + return unpack_float(v, len); } -// 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 -int grib_unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ - grib_accessor_class* c = a->cclass; - DEBUG_ASSERT(len > 0); - while (c) { - if (c->unpack_double_element_set) { - return c->unpack_double_element_set(a, index_array, len, val_array); - } - c = c->super ? *(c->super) : NULL; - } - 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; - // DEBUG_ASSERT(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) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is unpacking (string)",(a->parent->owner)?(a->parent->owner->name):"root", a->name ); - while (c) { - if (c->unpack_string) { - return c->unpack_string(a, v, len); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_unpack_string_array(grib_accessor* a, char** v, size_t* len) -{ - grib_accessor_class* c = a->cclass; - while (c) { - if (c->unpack_string_array) { - return c->unpack_string_array(a, v, len); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_accessors_list_unpack_long(grib_accessors_list* al, long* 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_long(al->accessor, val + unpacked_len, &len); - unpacked_len += len; - al = al->next; - } - - *buffer_len = unpacked_len; - return err; -} - -int grib_accessors_list_unpack_double(grib_accessors_list* al, double* 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_double(al->accessor, val + unpacked_len, &len); - unpacked_len += len; - al = al->next; - } - - *buffer_len = unpacked_len; - 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; - size_t unpacked_len = 0; - size_t len = 0; - - while (al && err == GRIB_SUCCESS) { - len = *buffer_len - unpacked_len; - err = grib_unpack_string_array(al->accessor, val + unpacked_len, &len); - unpacked_len += len; - al = al->next; - } - - *buffer_len = unpacked_len; - return err; -} - -int grib_unpack_long(grib_accessor* a, long* v, size_t* len) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is unpacking (long)",(a->parent->owner)?(a->parent->owner->name):"root", a->name ); - while (c) { - if (c->unpack_long) { - return c->unpack_long(a, v, len); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -long grib_accessor_get_native_type(grib_accessor* a) -{ - grib_accessor_class* c = NULL; - if (a) - c = a->cclass; - - while (c) { - if (c->get_native_type) - return c->get_native_type(a); - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -long grib_get_next_position_offset(grib_accessor* a) -{ - grib_accessor_class* c = NULL; - //grib_context_log(a->context, GRIB_LOG_DEBUG, - // "(%s)%s is checking next (long)",(a->parent->owner)?(a->parent->owner->name):"root", a->name ); - if (a) - c = a->cclass; - - while (c) { - if (c->next_offset) - return c->next_offset(a); - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -long grib_string_length(grib_accessor* a) -{ - grib_accessor_class* c = NULL; - if (a) - c = a->cclass; - - while (c) { - if (c->string_length) - return c->string_length(a); - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -long grib_byte_offset(grib_accessor* a) -{ - grib_accessor_class* c = NULL; - if (a) - c = a->cclass; - - while (c) { - if (c->byte_offset) - return c->byte_offset(a); - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -long grib_byte_count(grib_accessor* a) -{ - grib_accessor_class* c = NULL; - if (a) - c = a->cclass; - - while (c) { - if (c->byte_count) - return c->byte_count(a); - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_value_count(grib_accessor* a, long* count) -{ - grib_accessor_class* c = NULL; - int err = 0; - if (a) - c = a->cclass; - - while (c) { - if (c->value_count) { - err = c->value_count(a, count); - return err; - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -int grib_accessors_list_value_count(grib_accessors_list* al, size_t* count) -{ - long lcount = 0; - *count = 0; - while (al) { - grib_value_count(al->accessor, &lcount); - *count += lcount; - al = al->next; - } - return 0; -} - -int grib_accessor_notify_change(grib_accessor* a, grib_accessor* changed) -{ - grib_accessor_class* c = NULL; - if (a) - c = a->cclass; - - while (c) { - if (c->notify_change) - return c->notify_change(a, changed); - c = c->super ? *(c->super) : NULL; - } - if (a && a->cclass) - fprintf(stderr, "Error: notify_change not implemented for %s %s\n", a->cclass->name, a->name); - DEBUG_ASSERT(0); - return 0; -} - -// For this one, ALL init are called -static void init_accessor(grib_accessor_class* c, grib_accessor* a, const long len, grib_arguments* args) -{ - if (c) { - grib_accessor_class* s = c->super ? *(c->super) : NULL; - init_accessor(s, a, len, args); - if (c->init) - c->init(a, len, args); - } -} - -void grib_init_accessor(grib_accessor* a, const long len, grib_arguments* args) -{ - init_accessor(a->cclass, a, len, args); -} - -// For this one, ALL destroy are called -void grib_accessor_delete(grib_context* ct, grib_accessor* a) -{ - grib_accessor_class* c = a->cclass; - while (c) { - grib_accessor_class* s = c->super ? *(c->super) : NULL; - //printf("grib_accessor_delete: before destroy a=%p c->name=%s ==> a->name=%s\n", (void*)a, c->name, a->name); - if (c->destroy) { - c->destroy(ct, a); - } - c = s; - } - // printf("grib_accessor_delete before free a=%p\n", (void*)a); - grib_context_free(ct, a); -} - -grib_accessor* grib_accessor_clone(grib_accessor* a, grib_section* s, int* err) -{ - grib_accessor_class* c = a->cclass; - const grib_context* ct = a->context; - while (c) { - grib_accessor_class* super = c->super ? *(c->super) : NULL; - grib_context_log(ct, GRIB_LOG_DEBUG, "clone %s ==> %s", c->name, a->name); - if (c->make_clone) { - return c->make_clone(a, s, err); - } - c = super; - } - return 0; -} - -void grib_update_size(grib_accessor* a, size_t len) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, - // "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); - while (c) { - if (c->update_size) { - c->update_size(a, len); - return; - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); -} - -int grib_nearest_smaller_value(grib_accessor* a, double val, double* nearest) -{ - grib_accessor_class* c = a->cclass; - while (c) { - if (c->nearest_smaller_value) { - return c->nearest_smaller_value(a, val, nearest); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - - -size_t grib_preferred_size(grib_accessor* a, int from_handle) -{ - grib_accessor_class* c = a->cclass; - // grib_context_log(a->context, GRIB_LOG_DEBUG, - // "(%s)%s is packing (long) %d",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); - while (c) { - if (c->preferred_size) { - return c->preferred_size(a, from_handle); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -grib_accessor* grib_next_accessor(grib_accessor* a) -{ - grib_accessor_class* c = a->cclass; - while (c) { - if (c->next) { - return c->next(a, 1); - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return 0; -} - -void grib_resize(grib_accessor* a, size_t new_size) -{ - grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, - // "(%s)%s is packing (long) %d",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); - while (c) { - if (c->resize) { - c->resize(a, new_size); - return; - } - c = c->super ? *(c->super) : NULL; - } - DEBUG_ASSERT(0); - return; -} - -int grib_compare_accessors(grib_accessor* a1, grib_accessor* a2, int compare_flags) +int grib_accessor::compare_accessors(grib_accessor* a2, int compare_flags) { int ret = 0; long type1 = 0; long type2 = 0; int type_mismatch = 0; grib_accessor_class* c1 = NULL; + grib_accessor* a1 = this; if ((compare_flags & GRIB_COMPARE_NAMES) && grib_inline_strcmp(a1->name, a2->name)) return GRIB_NAME_MISMATCH; if (compare_flags & GRIB_COMPARE_TYPES) { - type1 = grib_accessor_get_native_type(a1); - type2 = grib_accessor_get_native_type(a2); + type1 = a1->get_native_type(); + type2 = a2->get_native_type(); type_mismatch = type1 != type2 ? 1 : 0; } - ret = GRIB_UNABLE_TO_COMPARE_ACCESSORS; + // ret = GRIB_UNABLE_TO_COMPARE_ACCESSORS; c1 = a1->cclass; - while (c1) { - if (c1->compare) { - ret = c1->compare(a1, a2); - break; - } - c1 = c1->super ? *(c1->super) : NULL; - } + ret = c1->compare(a1, a2); if (ret == GRIB_VALUE_MISMATCH && type_mismatch) ret = GRIB_TYPE_AND_VALUE_MISMATCH; @@ -685,24 +69,15 @@ int grib_compare_accessors(grib_accessor* a1, grib_accessor* a2, int compare_fla return ret; } -// int grib_accessor_clear_attributes(grib_accessor* a) -// { -// int id; -// for (id=0;idattributes[id]=NULL; -// } -// return 0; -// } - -int grib_accessor_add_attribute(grib_accessor* a, grib_accessor* attr, int nest_if_clash) +int grib_accessor::add_attribute(grib_accessor* attr, int nest_if_clash) { int id = 0; int idx = 0; grib_accessor* same = NULL; - grib_accessor* aloc = a; + grib_accessor* aloc = this; - if (grib_accessor_has_attributes(a)) { - same = grib_accessor_get_attribute_index(a, attr->name, &id); + if (this->has_attributes()) { + same = this->get_attribute_index(attr->name, &id); } if (same) { @@ -717,76 +92,34 @@ int grib_accessor_add_attribute(grib_accessor* a, grib_accessor* attr, int nest_ aloc->attributes[id] = attr; attr->parent_as_attribute = aloc; if (aloc->same) - attr->same = grib_accessor_get_attribute_index(aloc->same, attr->name, &idx); + attr->same = aloc->same->get_attribute_index(attr->name, &idx); - grib_context_log(a->context, GRIB_LOG_DEBUG, "added attribute %s->%s", a->name, attr->name); + grib_context_log(this->context, GRIB_LOG_DEBUG, "added attribute %s->%s", this->name, attr->name); return GRIB_SUCCESS; } } return GRIB_TOO_MANY_ATTRIBUTES; } -// int grib_accessor_replace_attribute(grib_accessor* a, grib_accessor* attr) -// { -// int id = 0; -// int idx = 0; -// if (grib_accessor_get_attribute_index(a, attr->name, &id) != NULL) { -// grib_accessor_delete(a->context, a->attributes[id]); -// a->attributes[id] = attr; -// attr->parent_as_attribute = a; -// if (a->same) -// attr->same = grib_accessor_get_attribute_index(a->same, attr->name, &idx); -// } -// else { -// grib_accessor_add_attribute(a, attr, 0); -// } -// return GRIB_SUCCESS; -// } - -// int grib_accessor_delete_attribute(grib_accessor* a, const char* name) -// { -// int id = 0; -// if (grib_accessor_get_attribute_index(a, name, &id) != NULL) { -// grib_accessor_delete(a->context, a->attributes[id]); -// a->attributes[id] = NULL; -// return GRIB_SUCCESS; -// } -// else { -// return GRIB_NOT_FOUND; -// } -// } - -// grib_accessor* grib_accessor_get_attribute_by_index(grib_accessor* a, int index) -// { -// if (index < MAX_ACCESSOR_ATTRIBUTES) -// return a->attributes[index]; -// return NULL; -// } - -// const char* grib_accessor_get_name(grib_accessor* a) -// { -// return a->name; -// } - -grib_accessor* grib_accessor_get_attribute_index(grib_accessor* a, const char* name, int* index) +grib_accessor* grib_accessor::get_attribute_index(const char* name, int* index) { int i = 0; - while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - if (!grib_inline_strcmp(a->attributes[i]->name, name)) { + while (i < MAX_ACCESSOR_ATTRIBUTES && this->attributes[i]) { + if (!grib_inline_strcmp(this->attributes[i]->name, name)) { *index = i; - return a->attributes[i]; + return this->attributes[i]; } i++; } return NULL; } -int grib_accessor_has_attributes(grib_accessor* a) +int grib_accessor::has_attributes() { - return a->attributes[0] ? 1 : 0; + return this->attributes[0] ? 1 : 0; } -grib_accessor* grib_accessor_get_attribute(grib_accessor* a, const char* name) +grib_accessor* grib_accessor::get_attribute(const char* name) { int index = 0; const char* p = 0; @@ -797,79 +130,18 @@ grib_accessor* grib_accessor_get_attribute(grib_accessor* a, const char* name) while (*(p + 1) != '\0' && (*p != '-' || *(p + 1) != '>')) p++; if (*(p + 1) == '\0') { - return grib_accessor_get_attribute_index(a, name, &index); + return this->get_attribute_index(name, &index); } else { size_t size = p - name; attribute_name = p + 2; - basename = (char*)grib_context_malloc_clear(a->context, size + 1); + basename = (char*)grib_context_malloc_clear(this->context, size + 1); basename = (char*)memcpy(basename, name, size); - acc = grib_accessor_get_attribute_index(a, basename, &index); - grib_context_free(a->context, basename); + acc = this->get_attribute_index(basename, &index); + grib_context_free(this->context, basename); if (acc) - return grib_accessor_get_attribute(acc, attribute_name); + return acc->get_attribute(attribute_name); else return NULL; } } - -grib_accessors_list* grib_accessors_list_create(grib_context* c) -{ - return (grib_accessors_list*)grib_context_malloc_clear(c, sizeof(grib_accessors_list)); -} - -void grib_accessors_list_push(grib_accessors_list* al, grib_accessor* a, int rank) -{ - grib_accessors_list* last; - const grib_context* c = a->context; - - last = grib_accessors_list_last(al); - if (last && last->accessor) { - last->next = (grib_accessors_list*)grib_context_malloc_clear(c, sizeof(grib_accessors_list)); - last->next->accessor = a; - last->next->prev = last; - last->next->rank = rank; - al->last = last->next; - } - else { - al->accessor = a; - al->rank = rank; - al->last = al; - } -} - -grib_accessors_list* grib_accessors_list_last(grib_accessors_list* al) -{ - // grib_accessors_list* last=al; - // grib_accessors_list* next=al->next; - // while(next) { - // last=next; - // next=last->next; - // } - return al->last; -} - -// grib_accessors_list* grib_accessors_list_find(grib_accessors_list* al, const grib_accessor* a) -// { -// grib_accessors_list* last = al; -// grib_accessors_list* next = al->next; -// while (next) { -// if (last->accessor == a) -// return last; -// last = next; -// next = last->next; -// } -// return NULL; -// } - -void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al) -{ - grib_accessors_list* tmp; - - while (al) { - tmp = al->next; - //grib_accessor_delete(c, al->accessor); - grib_context_free(c, al); - al = tmp; - } -} diff --git a/src/accessor/grib_accessor.h b/src/accessor/grib_accessor.h index 10fa228f7..d79e30111 100644 --- a/src/accessor/grib_accessor.h +++ b/src/accessor/grib_accessor.h @@ -10,6 +10,182 @@ #pragma once -#include "grib_api_internal.h" +#include "../grib_api_internal.h" +#include "../grib_value.h" +#include + +class grib_accessor +{ +public: + grib_accessor() : name(nullptr), name_space(nullptr), context(nullptr), h(nullptr), creator(nullptr), length(0), offset(0), parent(nullptr), next(nullptr), previous(nullptr), cclass(nullptr), flags(0), sub_section(nullptr), dirty(0), same(nullptr), loop(0), vvalue(nullptr), set(nullptr), parent_as_attribute(nullptr) {} + virtual ~grib_accessor() {} + + template int unpack(T* v, size_t* len); + + virtual void init_accessor(const long, grib_arguments*) = 0; + virtual void dump(grib_dumper* f) = 0; + virtual int pack_missing() = 0; + //virtual int grib_pack_zero(grib_accessor* a) = 0; + virtual int is_missing_internal() = 0; + virtual int pack_double(const double* v, size_t* len) = 0; + virtual int pack_float(const float* v, size_t* len) = 0; + virtual int pack_expression(grib_expression* e) = 0; + virtual int pack_string(const char* v, size_t* len) = 0; + virtual int pack_string_array(const char** v, size_t* len) = 0; + virtual int pack_long(const long* v, size_t* len) = 0; + virtual int pack_bytes(const unsigned char* v, size_t* len) = 0; + virtual int unpack_bytes(unsigned char* v, size_t* len) = 0; + virtual int unpack_double_subarray(double* v, size_t start, size_t len) = 0; + virtual int unpack_double(double* v, size_t* len) = 0; + virtual int unpack_float(float* v, size_t* len) = 0; + virtual int unpack_double_element(size_t i, double* v) = 0; + virtual int unpack_float_element(size_t i, float* v) = 0; + virtual int unpack_double_element_set(const size_t* index_array, size_t len, double* val_array) = 0; + virtual int unpack_float_element_set(const size_t* index_array, size_t len, float* val_array) = 0; + virtual int unpack_string(char* v, size_t* len) = 0; + virtual int unpack_string_array(char** v, size_t* len) = 0; + virtual int unpack_long(long* v, size_t* len) = 0; + virtual long get_native_type() = 0; + virtual long get_next_position_offset() = 0; + virtual long string_length() = 0; + virtual long byte_offset() = 0; + virtual long byte_count() = 0; + virtual int value_count(long* count) = 0; + virtual int notify_change(grib_accessor* changed) = 0; + virtual grib_accessor* clone(grib_section* s, int* err) = 0; + virtual void update_size(size_t len) = 0; + virtual int nearest_smaller_value(double val, double* nearest) = 0; + virtual size_t preferred_size(int from_handle) = 0; + virtual grib_accessor* next_accessor() = 0; + virtual void resize(size_t new_size) = 0; + virtual void destroy(grib_context* ct) = 0; + + virtual int compare_accessors(grib_accessor* a2, int compare_flags); + virtual int add_attribute(grib_accessor* attr, int nest_if_clash); + virtual grib_accessor* get_attribute_index(const char* name, int* index); + virtual int has_attributes(); + virtual grib_accessor* get_attribute(const char* name); + + + const char* name; /** < name of the accessor */ + const char* name_space; /** < namespace to which the accessor belongs */ + grib_context* context; + grib_handle* h; + grib_action* creator; /** < action that created the accessor */ + long length; /** < byte length of the accessor */ + long offset; /** < offset of the data in the buffer */ + grib_section* parent; /** < section to which the accessor is attached */ + grib_accessor* next; /** < next accessor in list */ + grib_accessor* previous; /** < next accessor in list */ + grib_accessor_class* cclass; /** < behaviour of the accessor */ + unsigned long flags; /** < Various flags */ + grib_section* sub_section; + + const char* all_names[MAX_ACCESSOR_NAMES]; /** < name of the accessor */ + const char* all_name_spaces[MAX_ACCESSOR_NAMES]; /** < namespace to which the accessor belongs */ + int dirty; + + grib_accessor* same; /** < accessors with the same name */ + long loop; /** < used in lists */ + grib_virtual_value* vvalue; /** < virtual value used when transient flag on **/ + const char* set; + grib_accessor* attributes[MAX_ACCESSOR_ATTRIBUTES]; /** < attributes are accessors */ + grib_accessor* parent_as_attribute; +}; + +class grib_accessor_class +{ +public: + const char* name; + + grib_accessor_class(const char* name) : name(name){} + virtual ~grib_accessor_class(){} + + virtual grib_accessor* create_empty_accessor() = 0; + virtual grib_section* sub_section(grib_accessor* a) = 0; + virtual int get_native_type(grib_accessor*) = 0; + virtual int pack_missing(grib_accessor*) = 0; + virtual int is_missing(grib_accessor*) = 0; + virtual int pack_bytes(grib_accessor*, const unsigned char*, size_t* len) = 0; + virtual int pack_double(grib_accessor*, const double* val, size_t* len) = 0; + virtual int pack_float(grib_accessor*, const float* val, size_t* len) = 0; + virtual int pack_long(grib_accessor*, const long* val, size_t* len) = 0; + virtual int pack_string(grib_accessor*, const char*, size_t* len) = 0; + virtual int pack_string_array(grib_accessor*, const char**, size_t* len) = 0; + virtual int pack_expression(grib_accessor*, grib_expression*) = 0; + virtual int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) = 0; + virtual int unpack_double(grib_accessor*, double* val, size_t* len) = 0; + virtual int unpack_float(grib_accessor*, float* val, size_t* len) = 0; + virtual int unpack_long(grib_accessor*, long* val, size_t* len) = 0; + virtual int unpack_string(grib_accessor*, char*, size_t* len) = 0; + virtual int unpack_string_array(grib_accessor*, char**, size_t* len) = 0; + virtual size_t string_length(grib_accessor*) = 0; + virtual long byte_count(grib_accessor*) = 0; + virtual long byte_offset(grib_accessor*) = 0; + virtual long next_offset(grib_accessor*) = 0; + virtual int value_count(grib_accessor*, long*) = 0; + virtual void destroy(grib_context*, grib_accessor*) = 0; + virtual void dump(grib_accessor*, grib_dumper*) = 0; + virtual void init(grib_accessor*, const long, grib_arguments*) = 0; + virtual void post_init(grib_accessor*) = 0; + virtual int notify_change(grib_accessor*, grib_accessor*) = 0; + virtual void update_size(grib_accessor*, size_t) = 0; + virtual size_t preferred_size(grib_accessor*, int) = 0; + virtual void resize(grib_accessor*,size_t) = 0; + virtual int nearest_smaller_value (grib_accessor*, double, double*) = 0; + virtual grib_accessor* next(grib_accessor*, int) = 0; + virtual int compare(grib_accessor*, grib_accessor*) = 0; + virtual int unpack_double_element(grib_accessor*, size_t i, double* val) = 0; + virtual int unpack_float_element(grib_accessor*, size_t i, float* val) = 0; + virtual int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) = 0; + virtual int unpack_float_element_set(grib_accessor*, const size_t* index_array, size_t len, float* val_array) = 0; + virtual int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len) = 0; + virtual int clear(grib_accessor*) = 0; + virtual grib_accessor* make_clone(grib_accessor*, grib_section*, int*) = 0; +}; + + +template +int unpack_helper(grib_accessor* a, T* v, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + int type = GRIB_TYPE_UNDEFINED; + const char* Tname = type_to_string(*v); + //if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { + try { + long val = 0; + size_t l = 1; + a->unpack_long(&val, &l); + *v = val; + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to %s", a->name, Tname); + return GRIB_SUCCESS; + } + catch (std::runtime_error& e) { + // TODO(maee): log error + } + + //if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { + try { + char val[1024]; + size_t l = sizeof(val); + char* last = NULL; + a->unpack_string(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 %s", a->name, Tname); + return GRIB_SUCCESS; + } + } + catch (std::runtime_error& e) { + // TODO(maee): log error + } + + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as %s", a->name, Tname); + 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; +} -template int grib_unpack(grib_accessor* a, T* v, size_t* len); diff --git a/src/accessor/grib_accessor_class_codetable.cc b/src/accessor/grib_accessor_class_codetable.cc index 9e39ed633..696370ba9 100644 --- a/src/accessor/grib_accessor_class_codetable.cc +++ b/src/accessor/grib_accessor_class_codetable.cc @@ -12,14 +12,19 @@ * Enrico Fucile ****************************************/ -#include "grib_api_internal.h" +#include "grib_accessor_class_codetable.h" #include + +grib_accessor_class_codetable_t _grib_accessor_class_codetable("codetable"); +grib_accessor_class* grib_accessor_class_codetable = &_grib_accessor_class_codetable; + + #if GRIB_PTHREADS static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; -static void thread_init() +void thread_init() { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); @@ -31,7 +36,7 @@ static void thread_init() static int once = 0; static omp_nest_lock_t mutex1; -static void thread_init() +void thread_init() { GRIB_OMP_CRITICAL(lock_grib_accessor_class_codetable_c) { @@ -43,123 +48,19 @@ static void thread_init() } #endif -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_unsigned - IMPLEMENTS = init;dump;unpack_string;pack_expression;unpack_long - IMPLEMENTS = value_count;pack_string; destroy; get_native_type;pack_missing - MEMBERS = const char* tablename - MEMBERS = const char* masterDir - MEMBERS = const char* localDir - MEMBERS = grib_codetable* table - MEMBERS = int table_loaded - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl -*/ +int grib_load_codetable(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_codetable* t); -static int get_native_type(grib_accessor*); -static int pack_missing(grib_accessor*); -static int pack_string(grib_accessor*, const char*, size_t* len); -static int pack_expression(grib_accessor*, grib_expression*); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_codetable +void grib_accessor_class_codetable_t::init(grib_accessor* a, const long len, grib_arguments* params) { - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in codetable */ - const char* tablename; - const char* masterDir; - const char* localDir; - grib_codetable* table; - int table_loaded; -} grib_accessor_codetable; - -extern grib_accessor_class* grib_accessor_class_unsigned; - -static grib_accessor_class _grib_accessor_class_codetable = { - &grib_accessor_class_unsigned, /* super */ - "codetable", /* name */ - sizeof(grib_accessor_codetable), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - &pack_missing, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - &pack_expression, /* 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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_codetable = &_grib_accessor_class_codetable; - -/* END_CLASS_IMP */ + grib_accessor_class_unsigned_t::init(a, len, params); -static int grib_load_codetable(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_codetable* t); - -static void init(grib_accessor* a, const long len, grib_arguments* params) -{ int n = 0; long new_len = len; grib_handle* hand = grib_handle_of_accessor(a); - grib_accessor_codetable* self = (grib_accessor_codetable*)a; + grib_accessor_codetable_t* self = (grib_accessor_codetable_t*)a; grib_action* act = (grib_action*)(a->creator); DEBUG_ASSERT(len == self->nbytes); @@ -195,7 +96,7 @@ static void init(grib_accessor* a, const long len, grib_arguments* params) a->length = 0; if (!a->vvalue) a->vvalue = (grib_virtual_value*)grib_context_malloc_clear(a->context, sizeof(grib_virtual_value)); - a->vvalue->type = grib_accessor_get_native_type(a); + a->vvalue->type = a->get_native_type(); a->vvalue->length = new_len; if (act->default_value != NULL) { const char* p = 0; @@ -209,12 +110,12 @@ static void init(grib_accessor* a, const long len, grib_arguments* params) switch (type) { case GRIB_TYPE_DOUBLE: grib_expression_evaluate_double(hand, expression, &d); - grib_pack_double(a, &d, &s_len); + a->pack_double(&d, &s_len); break; case GRIB_TYPE_LONG: grib_expression_evaluate_long(grib_handle_of_accessor(a), expression, &l); - grib_pack_long(a, &l, &s_len); + a->pack_long(&l, &s_len); break; default: @@ -271,7 +172,7 @@ static void dump_codetable(grib_codetable* atable) #endif static grib_codetable* load_table(grib_accessor* a) { - grib_accessor_codetable* self = (grib_accessor_codetable*)a; + grib_accessor_codetable_t* self = (grib_accessor_codetable_t*)a; size_t size = 0; grib_handle* h = ((grib_accessor*)self)->parent->h; grib_context* c = h->context; @@ -342,7 +243,7 @@ static grib_codetable* load_table(grib_accessor* a) size = a->vvalue->length * 8; } else { - size = grib_byte_count((grib_accessor*)self) * 8; + size = ((grib_accessor*)self)->byte_count() * 8; } size = (1ULL << size); /* 2^size - 64bits */ @@ -370,7 +271,7 @@ static grib_codetable* load_table(grib_accessor* a) return t; } -static int grib_load_codetable(grib_context* c, const char* filename, +int grib_load_codetable(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_codetable* t) { char line[1024]; @@ -538,10 +439,10 @@ int codes_codetable_get_contents_malloc(const grib_handle* h, const char* key, c return GRIB_INVALID_ARGUMENT; // key is not a codetable } - const grib_accessor_codetable* ca = (const grib_accessor_codetable*)aa; // could be dynamic_cast + const grib_accessor_codetable_t* ca = (const grib_accessor_codetable_t*)aa; // could be dynamic_cast // Decode the key itself. This will either fetch it from the cache or place it there - if ((err = grib_unpack_long(aa, &lvalue, &size)) != GRIB_SUCCESS) { + if ((err = aa->unpack_long(&lvalue, &size)) != GRIB_SUCCESS) { return err; } @@ -612,9 +513,9 @@ int codes_codetable_check_abbreviation(const grib_handle* h, const char* key, co return err; } -static void dump(grib_accessor* a, grib_dumper* dumper) +void grib_accessor_class_codetable_t::dump(grib_accessor* a, grib_dumper* dumper) { - grib_accessor_codetable* self = (grib_accessor_codetable*)a; + grib_accessor_codetable_t* self = (grib_accessor_codetable_t*)a; char comment[2048]; grib_codetable* table; @@ -627,7 +528,7 @@ static void dump(grib_accessor* a, grib_dumper* dumper) } table = self->table; - grib_unpack_long(a, &value, &llen); + a->unpack_long(&value, &llen); if (value == GRIB_MISSING_LONG) { if (a->length < 4) { @@ -670,9 +571,9 @@ static void dump(grib_accessor* a, grib_dumper* dumper) grib_dump_long(dumper, a, comment); } -static int unpack_string(grib_accessor* a, char* buffer, size_t* len) +int grib_accessor_class_codetable_t::unpack_string(grib_accessor* a, char* buffer, size_t* len) { - grib_accessor_codetable* self = (grib_accessor_codetable*)a; + grib_accessor_codetable_t* self = (grib_accessor_codetable_t*)a; grib_codetable* table = NULL; size_t size = 1; @@ -681,7 +582,7 @@ static int unpack_string(grib_accessor* a, char* buffer, size_t* len) char tmp[1024]; size_t l = 0; - if ((err = grib_unpack_long(a, &value, &size)) != GRIB_SUCCESS) + if ((err = a->unpack_long(&value, &size)) != GRIB_SUCCESS) return err; if (!self->table_loaded) { @@ -714,14 +615,14 @@ static int unpack_string(grib_accessor* a, char* buffer, size_t* len) return GRIB_SUCCESS; } -static int value_count(grib_accessor* a, long* count) +int grib_accessor_class_codetable_t::value_count(grib_accessor* a, long* count) { *count = 1; return 0; } // Return true if the input is an integer (non-negative) -static bool is_number(const char* s) +bool is_number(const char* s) { while (*s) { if (!isdigit(*s)) @@ -731,27 +632,27 @@ static bool is_number(const char* s) return true; } -static bool strings_equal(const char* s1, const char* s2, bool case_sensitive) +bool strings_equal(const char* s1, const char* s2, bool case_sensitive) { if (case_sensitive) return (strcmp(s1, s2) == 0); return (strcmp_nocase(s1, s2) == 0); } -static int pack_string(grib_accessor* a, const char* buffer, size_t* len) +int grib_accessor_class_codetable_t::pack_string(grib_accessor* a, const char* buffer, size_t* len) { long lValue = 0; Assert(buffer); if (is_number(buffer) && string_to_long(buffer, &lValue, 1) == GRIB_SUCCESS) { // ECC-1654: If value is a pure number, just pack as long size_t l = 1; - return grib_pack_long(a, &lValue, &l); + return a->pack_long(&lValue, &l); } if (STR_EQUAL_NOCASE(buffer, "missing")) { return pack_missing(a); } - grib_accessor_codetable* self = (grib_accessor_codetable*)a; + grib_accessor_codetable_t* self = (grib_accessor_codetable_t*)a; grib_codetable* table = NULL; long i = 0; size_t size = 1; @@ -779,7 +680,7 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t* len) for (i = 0; i < table->size; i++) { if (table->entries[i].abbreviation) { if (strings_equal(table->entries[i].abbreviation, buffer, case_sensitive)) { - return grib_pack_long(a, &i, &size); + return a->pack_long(&i, &size); } } } @@ -798,12 +699,12 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t* len) switch (type) { case GRIB_TYPE_DOUBLE: grib_expression_evaluate_double(grib_handle_of_accessor(a), expression, &d); - grib_pack_double(a, &d, &s_len); + a->pack_double(&d, &s_len); break; case GRIB_TYPE_LONG: grib_expression_evaluate_long(grib_handle_of_accessor(a), expression, &l); - grib_pack_long(a, &l, &s_len); + a->pack_long(&l, &s_len); break; default: @@ -837,7 +738,7 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t* len) return GRIB_ENCODING_ERROR; } -static int pack_expression(grib_accessor* a, grib_expression* e) +int grib_accessor_class_codetable_t::pack_expression(grib_accessor* a, grib_expression* e) { const char* cval = NULL; int ret = 0; @@ -848,7 +749,7 @@ static int pack_expression(grib_accessor* a, grib_expression* e) if (strcmp(e->cclass->name, "long") == 0) { grib_expression_evaluate_long(hand, e, &lval); /* TODO: check return value */ //if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_codetable::pack_expression %s %ld\n", a->name,lval); - ret = grib_pack_long(a, &lval, &len); + ret = a->pack_long(&lval, &len); } else { char tmp[1024]; @@ -863,12 +764,12 @@ static int pack_expression(grib_accessor* a, grib_expression* e) len = strlen(cval) + 1; //if (hand->context->debug) // printf("ECCODES DEBUG grib_accessor_class_codetable::pack_expression %s %s\n", a->name, cval); - ret = grib_pack_string(a, cval, &len); + ret = a->pack_string(cval, &len); } return ret; } -static void destroy(grib_context* context, grib_accessor* a) +void grib_accessor_class_codetable_t::destroy(grib_context* context, grib_accessor* a) { if (a->vvalue != NULL) { grib_context_free(context, a->vvalue); @@ -876,7 +777,7 @@ static void destroy(grib_context* context, grib_accessor* a) } } -static int get_native_type(grib_accessor* a) +int grib_accessor_class_codetable_t::get_native_type(grib_accessor* a) { int type = GRIB_TYPE_LONG; /*printf("---------- %s flags=%ld GRIB_ACCESSOR_FLAG_STRING_TYPE=%d\n", @@ -886,16 +787,16 @@ static int get_native_type(grib_accessor* a) return type; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) +int grib_accessor_class_codetable_t::unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_codetable* self = (grib_accessor_codetable*)a; + grib_accessor_codetable_t* self = (grib_accessor_codetable_t*)a; long rlen = 0, i = 0; long pos = a->offset * 8; grib_handle* hand = NULL; #ifdef DEBUG { - int err = grib_value_count(a, &rlen); + int err = a->value_count(&rlen); Assert(!err); Assert(rlen == 1); } @@ -908,9 +809,9 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) } if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %ld values", + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%lu) for %s, it contains %ld values", *len, a->name, rlen); - *len = rlen; + *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -934,12 +835,12 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int pack_missing(grib_accessor* a) +int grib_accessor_class_codetable_t::pack_missing(grib_accessor* a) { // Many of the code tables do have a 'Missing' entry (all bits = 1) // So it is more user-friendly to allow setting codetable keys to // missing. For tables that do not have such an entry, an error is issued - grib_accessor_codetable* self = (grib_accessor_codetable*)a; + grib_accessor_codetable_t* self = (grib_accessor_codetable_t*)a; grib_handle* h = grib_handle_of_accessor(a); const long nbytes = a->length; @@ -949,7 +850,7 @@ static int pack_missing(grib_accessor* a) int err = codes_codetable_check_code_figure(h, a->name, maxVal); if (!err) { size_t l = 1; - return grib_pack_long(a, &maxVal, &l); + return a->pack_long(&maxVal, &l); } grib_context_log(a->context, GRIB_LOG_ERROR, "There is no 'missing' entry in Code Table %s (%s)", diff --git a/src/accessor/grib_accessor_class_constant.cc b/src/accessor/grib_accessor_class_constant.cc index b54de5b88..ed30a6365 100644 --- a/src/accessor/grib_accessor_class_constant.cc +++ b/src/accessor/grib_accessor_class_constant.cc @@ -8,104 +8,13 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ +#include "grib_accessor_class_constant.h" -/************************************* - * Enrico Fucile - **************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_variable - IMPLEMENTS = init - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_constant -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in variable */ - double dval; - float fval; - char* cval; - char* cname; - int type; - /* Members defined in constant */ -} grib_accessor_constant; - -extern grib_accessor_class* grib_accessor_class_variable; - -static grib_accessor_class _grib_accessor_class_constant = { - &grib_accessor_class_variable, /* super */ - "constant", /* name */ - sizeof(grib_accessor_constant), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_constant_t _grib_accessor_class_constant{"constant"}; grib_accessor_class* grib_accessor_class_constant = &_grib_accessor_class_constant; -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) +void grib_accessor_class_constant_t::init(grib_accessor* a, const long len, grib_arguments* arg) { + grib_accessor_class_variable_t::init(a, len, arg); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index fb885700b..08f2f1bba 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -189,9 +189,10 @@ void grib_accessor_gen_t::resize(size_t new_size) } // For this one, ALL destroy are called -void grib_accessor_delete(grib_context* ct, grib_accessor* a) +void grib_accessor_gen_t::destroy(grib_context* ct) { - free(a); + cclass->destroy(ct, this); + delete this; } diff --git a/src/accessor/grib_accessor_class_gen.h b/src/accessor/grib_accessor_class_gen.h index df85efab8..d68ad4320 100644 --- a/src/accessor/grib_accessor_class_gen.h +++ b/src/accessor/grib_accessor_class_gen.h @@ -40,11 +40,7 @@ class grib_accessor_gen_t : public grib_accessor { size_t preferred_size(int from_handle) override; grib_accessor* next_accessor() override; void resize(size_t new_size) override; - //int compare_accessors(grib_accessor* a2, int compare_flags) override; - //int add_attribute(grib_accessor* attr, int nest_if_clash) override; - //grib_accessor* get_attribute_index(const char* name, int* index) override; - //int has_attributes() override; - //grib_accessor* get_attribute(const char* name) override; + void destroy(grib_context* ct) override; }; class grib_accessor_class_gen_t : public grib_accessor_class @@ -95,48 +91,3 @@ class grib_accessor_class_gen_t : public grib_accessor_class int clear(grib_accessor*) override; grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; }; - - -template -int unpack_helper(grib_accessor* a, T* v, size_t* len) -{ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - int type = GRIB_TYPE_UNDEFINED; - const char* Tname = type_to_string(*v); - //if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { - try { - long val = 0; - size_t l = 1; - a->unpack_long(&val, &l); - *v = val; - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to %s", a->name, Tname); - return GRIB_SUCCESS; - } - catch (std::runtime_error& e) { - // TODO(maee): log error - } - - //if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { - try { - char val[1024]; - size_t l = sizeof(val); - char* last = NULL; - a->unpack_string(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 %s", a->name, Tname); - return GRIB_SUCCESS; - } - } - catch (std::runtime_error& e) { - // TODO(maee): log error - } - - grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as %s", a->name, Tname); - 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/accessor/grib_accessor_class_iterator.cc b/src/accessor/grib_accessor_class_iterator.cc index 2a5fc815b..138146747 100644 --- a/src/accessor/grib_accessor_class_iterator.cc +++ b/src/accessor/grib_accessor_class_iterator.cc @@ -13,101 +13,19 @@ *************************/ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;dump - MEMBERS=grib_arguments* args - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_iterator -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in iterator */ - grib_arguments* args; -} grib_accessor_iterator; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_iterator = { - &grib_accessor_class_gen, /* super */ - "iterator", /* name */ - sizeof(grib_accessor_iterator), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_iterator.h" +grib_accessor_class_iterator_t _grib_accessor_class_iterator{"iterator"}; grib_accessor_class* grib_accessor_class_iterator = &_grib_accessor_class_iterator; -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* args) +void grib_accessor_class_iterator_t::init(grib_accessor* a, const long l, grib_arguments* args) { - grib_accessor_iterator* self = (grib_accessor_iterator*)a; + grib_accessor_class_gen_t::init(a, l, args); + grib_accessor_iterator_t* self = (grib_accessor_iterator_t*)a; self->args = args; } -static void dump(grib_accessor* a, grib_dumper* dumper) +void grib_accessor_class_iterator_t::dump(grib_accessor* a, grib_dumper* dumper) { /* TODO: pass args */ grib_dump_label(dumper, a, NULL); @@ -117,11 +35,11 @@ grib_iterator* grib_iterator_new(const grib_handle* ch, unsigned long flags, int { grib_handle* h = (grib_handle*)ch; grib_accessor* a = NULL; - grib_accessor_iterator* ita = NULL; + grib_accessor_iterator_t* ita = NULL; grib_iterator* iter = NULL; *error = GRIB_NOT_IMPLEMENTED; a = grib_find_accessor(h, "ITERATOR"); - ita = (grib_accessor_iterator*)a; + ita = (grib_accessor_iterator_t*)a; if (!a) return NULL; diff --git a/src/accessor/grib_accessor_class_long.cc b/src/accessor/grib_accessor_class_long.cc index 5eb10fec5..a1f125f25 100644 --- a/src/accessor/grib_accessor_class_long.cc +++ b/src/accessor/grib_accessor_class_long.cc @@ -1,120 +1,23 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = get_native_type;pack_missing; - IMPLEMENTS = unpack_string; pack_string - IMPLEMENTS = unpack_double - IMPLEMENTS = dump - IMPLEMENTS = compare - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_missing(grib_accessor*); -static int pack_string(grib_accessor*, const char*, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_long -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ -} grib_accessor_long; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_long = { - &grib_accessor_class_gen, /* super */ - "long", /* name */ - sizeof(grib_accessor_long), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - &pack_missing, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_long.h" +grib_accessor_class_long_t _grib_accessor_class_long{"long"}; grib_accessor_class* grib_accessor_class_long = &_grib_accessor_class_long; -/* END_CLASS_IMP */ +void grib_accessor_class_long_t::init(grib_accessor* a, const long len, grib_arguments* arg) { + grib_accessor_class_gen_t::init(a, len, arg); +} -static int get_native_type(grib_accessor* a) +int grib_accessor_class_long_t::get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; } -static void dump(grib_accessor* a, grib_dumper* dumper) +void grib_accessor_class_long_t::dump(grib_accessor* a, grib_dumper* dumper) { grib_dump_long(dumper, a, NULL); } -static int unpack_string(grib_accessor* a, char* v, size_t* len) +int grib_accessor_class_long_t::unpack_string(grib_accessor* a, char* v, size_t* len) { long val = 0; size_t l = 1; @@ -122,7 +25,7 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) char format[32] = "%ld"; grib_handle* h = grib_handle_of_accessor(a); - grib_unpack_long(a, &val, &l); + a->unpack_long(&val, &l); /* TODO: We should catch all errors but in this case the test ERA_Gen.sh will fail * as the output from grib_ls will be different */ @@ -152,18 +55,18 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) return GRIB_SUCCESS; } -static int pack_missing(grib_accessor* a) +int grib_accessor_class_long_t::pack_missing(grib_accessor* a) { size_t len = 1; long value = GRIB_MISSING_LONG; if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) - return grib_pack_long(a, &value, &len); + return a->pack_long(&value, &len); return GRIB_VALUE_CANNOT_BE_MISSING; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) +int grib_accessor_class_long_t::unpack_double(grib_accessor* a, double* val, size_t* len) { size_t rlen = 0; long count = 0; @@ -172,7 +75,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) long oneval = 0; int ret = GRIB_SUCCESS; - ret = grib_value_count(a, &count); + ret = a->value_count(&count); if (ret) return ret; rlen = count; @@ -184,7 +87,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } if (rlen == 1) { - ret = grib_unpack_long(a, &oneval, &rlen); + ret = a->unpack_long(&oneval, &rlen); if (ret != GRIB_SUCCESS) return ret; *val = oneval; @@ -196,7 +99,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) if (!values) return GRIB_OUT_OF_MEMORY; - ret = grib_unpack_long(a, values, &rlen); + ret = a->unpack_long(values, &rlen); if (ret != GRIB_SUCCESS) { grib_context_free(a->context, values); return ret; @@ -210,7 +113,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } -static int compare(grib_accessor* a, grib_accessor* b) +int grib_accessor_class_long_t::compare(grib_accessor* a, grib_accessor* b) { int retval = 0; long* aval = 0; @@ -221,12 +124,12 @@ static int compare(grib_accessor* a, grib_accessor* b) size_t blen = 0; int err = 0; - err = grib_value_count(a, &count); + err = a->value_count(&count); if (err) return err; alen = count; - err = grib_value_count(b, &count); + err = a->value_count(&count); if (err) return err; blen = count; @@ -237,8 +140,8 @@ static int compare(grib_accessor* a, grib_accessor* b) aval = (long*)grib_context_malloc(a->context, alen * sizeof(long)); bval = (long*)grib_context_malloc(b->context, blen * sizeof(long)); - grib_unpack_long(a, aval, &alen); - grib_unpack_long(b, bval, &blen); + a->unpack_long(aval, &alen); + b->unpack_long(bval, &blen); retval = GRIB_SUCCESS; for (size_t i=0; ipack_long(&v, len); } diff --git a/src/accessor/grib_accessor_class_nearest.cc b/src/accessor/grib_accessor_class_nearest.cc index b1a3138d3..6dbac1722 100644 --- a/src/accessor/grib_accessor_class_nearest.cc +++ b/src/accessor/grib_accessor_class_nearest.cc @@ -8,102 +8,20 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;dump - MEMBERS=grib_arguments* args - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_nearest -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in nearest */ - grib_arguments* args; -} grib_accessor_nearest; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_nearest = { - &grib_accessor_class_gen, /* super */ - "nearest", /* name */ - sizeof(grib_accessor_nearest), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_nearest.h" +grib_accessor_class_nearest_t _grib_accessor_class_nearest{"nearest"}; grib_accessor_class* grib_accessor_class_nearest = &_grib_accessor_class_nearest; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* args) +void grib_accessor_class_nearest_t::init(grib_accessor* a, const long l, grib_arguments* args) { - grib_accessor_nearest* self = (grib_accessor_nearest*)a; + grib_accessor_class_gen_t::init(a, l, args); + grib_accessor_nearest_t* self = (grib_accessor_nearest_t*)a; self->args = args; } -static void dump(grib_accessor* a, grib_dumper* dumper) +void grib_accessor_class_nearest_t::dump(grib_accessor* a, grib_dumper* dumper) { /* TODO: pass args */ grib_dump_label(dumper, a, NULL); @@ -113,11 +31,11 @@ grib_nearest* grib_nearest_new(const grib_handle* ch, int* error) { grib_handle* h = (grib_handle*)ch; grib_accessor* a = NULL; - grib_accessor_nearest* na = NULL; + grib_accessor_nearest_t* na = NULL; grib_nearest* n = NULL; *error = GRIB_NOT_IMPLEMENTED; a = grib_find_accessor(h, "NEAREST"); - na = (grib_accessor_nearest*)a; + na = (grib_accessor_nearest_t*)a; if (!a) return NULL; diff --git a/src/accessor/grib_accessor_class_smart_table.cc b/src/accessor/grib_accessor_class_smart_table.cc index 70f964c7d..4d1997854 100644 --- a/src/accessor/grib_accessor_class_smart_table.cc +++ b/src/accessor/grib_accessor_class_smart_table.cc @@ -12,127 +12,12 @@ * Enrico Fucile ****************************************/ -#include "grib_api_internal.h" +#include "grib_accessor_class_smart_table.h" #include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_unsigned - IMPLEMENTS = init;dump;unpack_string;unpack_long - IMPLEMENTS = value_count; destroy; get_native_type; - MEMBERS = const char* values - MEMBERS = const char* tablename - MEMBERS = const char* masterDir - MEMBERS = const char* localDir - MEMBERS = const char* extraDir - MEMBERS = const char* extraTable - MEMBERS = int widthOfCode - MEMBERS = long* tableCodes - MEMBERS = size_t tableCodesSize - MEMBERS = grib_smart_table* table - MEMBERS = int dirty - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_smart_table -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in smart_table */ - const char* values; - const char* tablename; - const char* masterDir; - const char* localDir; - const char* extraDir; - const char* extraTable; - int widthOfCode; - long* tableCodes; - size_t tableCodesSize; - grib_smart_table* table; - int dirty; -} grib_accessor_smart_table; - -extern grib_accessor_class* grib_accessor_class_unsigned; - -static grib_accessor_class _grib_accessor_class_smart_table = { - &grib_accessor_class_unsigned, /* super */ - "smart_table", /* name */ - sizeof(grib_accessor_smart_table), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_smart_table_t _grib_accessor_class_smart_table{"smart_table"}; grib_accessor_class* grib_accessor_class_smart_table = &_grib_accessor_class_smart_table; -/* END_CLASS_IMP */ - #if GRIB_PTHREADS static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -149,7 +34,7 @@ static void thread_init() static int once = 0; static omp_nest_lock_t mutex; -static void thread_init() +void thread_init() { GRIB_OMP_CRITICAL(lock_grib_accessor_class_smart_table_c) { @@ -161,12 +46,14 @@ static void thread_init() } #endif -static int grib_load_smart_table(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_smart_table* t); +int grib_load_smart_table(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_smart_table* t); -static void init(grib_accessor* a, const long len, grib_arguments* params) +void grib_accessor_class_smart_table_t::init(grib_accessor* a, const long len, grib_arguments* params) { + grib_accessor_class_unsigned_t::init(a, len, params); + int n = 0; - grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; + grib_accessor_smart_table_t* self = (grib_accessor_smart_table_t*)a; grib_handle* hand = grib_handle_of_accessor(a); self->values = grib_arguments_get_name(hand, params, n++); @@ -184,9 +71,9 @@ static void init(grib_accessor* a, const long len, grib_arguments* params) self->tableCodes = 0; } -static grib_smart_table* load_table(grib_accessor* a) +grib_smart_table* load_table(grib_accessor* a) { - grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; + grib_accessor_smart_table_t* self = (grib_accessor_smart_table_t*)a; size_t size = 0; grib_handle* h = ((grib_accessor*)self)->parent->h; grib_context* c = h->context; @@ -279,7 +166,7 @@ static grib_smart_table* load_table(grib_accessor* a) return t; } -static int grib_load_smart_table(grib_context* c, const char* filename, +int grib_load_smart_table(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_smart_table* t) { char line[1024] = {0,}; @@ -397,14 +284,14 @@ void grib_smart_table_delete(grib_context* c) } } -static void dump(grib_accessor* a, grib_dumper* dumper) +void grib_accessor_class_smart_table_t::dump(grib_accessor* a, grib_dumper* dumper) { grib_dump_long(dumper, a, NULL); } -static int unpack_string(grib_accessor* a, char* buffer, size_t* len) +int grib_accessor_class_smart_table_t::unpack_string(grib_accessor* a, char* buffer, size_t* len) { - grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; + grib_accessor_smart_table_t* self = (grib_accessor_smart_table_t*)a; grib_smart_table* table = NULL; size_t size = 1; @@ -413,7 +300,7 @@ static int unpack_string(grib_accessor* a, char* buffer, size_t* len) char tmp[1024]; size_t l = 0; - if ((err = grib_unpack_long(a, &value, &size)) != GRIB_SUCCESS) + if ((err = a->unpack_long(&value, &size)) != GRIB_SUCCESS) return err; if (!self->table) @@ -441,9 +328,9 @@ static int unpack_string(grib_accessor* a, char* buffer, size_t* len) return GRIB_SUCCESS; } -static int get_table_codes(grib_accessor* a) +int get_table_codes(grib_accessor* a) { - grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; + grib_accessor_smart_table_t* self = (grib_accessor_smart_table_t*)a; size_t size = 0; long* v = 0; int err = 0; @@ -493,10 +380,10 @@ static int get_table_codes(grib_accessor* a) return 0; } -static int value_count(grib_accessor* a, long* count) +int grib_accessor_class_smart_table_t::value_count(grib_accessor* a, long* count) { int err = 0; - grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; + grib_accessor_smart_table_t* self = (grib_accessor_smart_table_t*)a; *count = 0; if (!self->values) @@ -509,9 +396,9 @@ static int value_count(grib_accessor* a, long* count) return GRIB_SUCCESS; } -static void destroy(grib_context* context, grib_accessor* a) +void grib_accessor_class_smart_table_t::destroy(grib_context* context, grib_accessor* a) { - grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; + grib_accessor_smart_table_t* self = (grib_accessor_smart_table_t*)a; if (a->vvalue != NULL) { grib_context_free(context, a->vvalue); a->vvalue = NULL; @@ -520,7 +407,7 @@ static void destroy(grib_context* context, grib_accessor* a) grib_context_free(a->context, self->tableCodes); } -static int get_native_type(grib_accessor* a) +int grib_accessor_class_smart_table_t::get_native_type(grib_accessor* a) { int type = GRIB_TYPE_LONG; /*printf("---------- %s flags=%ld GRIB_ACCESSOR_FLAG_STRING_TYPE=%d\n", @@ -530,10 +417,10 @@ static int get_native_type(grib_accessor* a) return type; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) +int grib_accessor_class_smart_table_t::unpack_long(grib_accessor* a, long* val, size_t* len) { int err = 0; - grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; + grib_accessor_smart_table_t* self = (grib_accessor_smart_table_t*)a; size_t i; if (!self->values) diff --git a/src/accessor/grib_accessor_class_transient.cc b/src/accessor/grib_accessor_class_transient.cc index c51886c20..0cda763d0 100644 --- a/src/accessor/grib_accessor_class_transient.cc +++ b/src/accessor/grib_accessor_class_transient.cc @@ -8,93 +8,13 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" +#include "grib_accessor_class_transient.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_variable - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - - -typedef struct grib_accessor_transient -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in variable */ - double dval; - float fval; - char* cval; - char* cname; - int type; - /* Members defined in transient */ -} grib_accessor_transient; - -extern grib_accessor_class* grib_accessor_class_variable; - -static grib_accessor_class _grib_accessor_class_transient = { - &grib_accessor_class_variable, /* super */ - "transient", /* name */ - sizeof(grib_accessor_transient), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; +grib_accessor_class_transient_t _grib_accessor_class_transient{"transient"}; +grib_accessor_class* grib_accessor_class_transient = &_grib_accessor_class_transient; -grib_accessor_class* grib_accessor_class_transient = &_grib_accessor_class_transient; +void grib_accessor_class_transient_t::init(grib_accessor* a, const long l, grib_arguments* args) { + grib_accessor_class_variable_t::init(a, l, args); +} -/* END_CLASS_IMP */ diff --git a/src/accessor/grib_accessor_class_unsigned.cc b/src/accessor/grib_accessor_class_unsigned.cc index f1202b0d0..b5615ac37 100644 --- a/src/accessor/grib_accessor_class_unsigned.cc +++ b/src/accessor/grib_accessor_class_unsigned.cc @@ -8,117 +8,17 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init;dump;is_missing - IMPLEMENTS = next_offset - IMPLEMENTS = byte_count - IMPLEMENTS = value_count - IMPLEMENTS = byte_offset - IMPLEMENTS = update_size; destroy - MEMBERS = long nbytes - MEMBERS = grib_arguments* arg - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int is_missing(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static long byte_count(grib_accessor*); -static long byte_offset(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); - -typedef struct grib_accessor_unsigned -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -} grib_accessor_unsigned; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_unsigned = { - &grib_accessor_class_long, /* super */ - "unsigned", /* name */ - sizeof(grib_accessor_unsigned), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - &is_missing, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; +#include "grib_accessor_class_unsigned.h" +grib_accessor_class_unsigned_t _grib_accessor_class_unsigned("unsigned"); grib_accessor_class* grib_accessor_class_unsigned = &_grib_accessor_class_unsigned; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* arg) +void grib_accessor_class_unsigned_t::init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_accessor_unsigned* self = (grib_accessor_unsigned*)a; - self->arg = NULL; + grib_accessor_class_long_t::init(a, len, arg); + grib_accessor_unsigned_t* self = (grib_accessor_unsigned_t*)a; self->arg = arg; self->nbytes = len; @@ -131,17 +31,17 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg) } else { long count = 0; - grib_value_count(a, &count); + a->value_count(&count); a->length = len * count; a->vvalue = NULL; } } -static void dump(grib_accessor* a, grib_dumper* dumper) +void grib_accessor_class_unsigned_t::dump(grib_accessor* a, grib_dumper* dumper) { long rlen = 0; - grib_value_count(a, &rlen); + a->value_count(&rlen); if (rlen == 1) grib_dump_long(dumper, a, NULL); else @@ -158,14 +58,15 @@ static const unsigned long ones[] = { /* See GRIB-490 */ static const unsigned long all_ones = -1; -static int value_is_missing(long val) + +int value_is_missing(long val) { return (val == GRIB_MISSING_LONG || val == all_ones); } int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t* len, int check) { - grib_accessor_unsigned* self = (grib_accessor_unsigned*)a; + grib_accessor_unsigned_t* self = (grib_accessor_unsigned_t*)a; int ret = 0; long off = 0; long rlen = 0; @@ -176,7 +77,7 @@ int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t* len, in unsigned long i = 0; unsigned long missing = 0; - err = grib_value_count(a, &rlen); + err = a->value_count(&rlen); if (err) return err; @@ -260,9 +161,9 @@ int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t* len, in return ret; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) +int grib_accessor_class_unsigned_t::unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_unsigned* self = (grib_accessor_unsigned*)a; + grib_accessor_unsigned_t* self = (grib_accessor_unsigned_t*)a; long rlen = 0; unsigned long i = 0; unsigned long missing = 0; @@ -271,7 +172,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) long pos = a->offset * 8; grib_handle* hand = grib_handle_of_accessor(a); - err = grib_value_count(a, &count); + err = a->value_count(&count); if (err) return err; rlen = count; @@ -304,20 +205,20 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) +int grib_accessor_class_unsigned_t::pack_long(grib_accessor* a, const long* val, size_t* len) { /* See GRIB-262 as example of why we do the checks */ return pack_long_unsigned_helper(a, val, len, /*check=*/1); } -static long byte_count(grib_accessor* a) +long grib_accessor_class_unsigned_t::byte_count(grib_accessor* a) { return a->length; } -static int value_count(grib_accessor* a, long* len) +int grib_accessor_class_unsigned_t::value_count(grib_accessor* a, long* len) { - grib_accessor_unsigned* self = (grib_accessor_unsigned*)a; + grib_accessor_unsigned_t* self = (grib_accessor_unsigned_t*)a; if (!self->arg) { *len = 1; return 0; @@ -325,22 +226,22 @@ static int value_count(grib_accessor* a, long* len) return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); } -static long byte_offset(grib_accessor* a) +long grib_accessor_class_unsigned_t::byte_offset(grib_accessor* a) { return a->offset; } -static void update_size(grib_accessor* a, size_t s) +void grib_accessor_class_unsigned_t::update_size(grib_accessor* a, size_t s) { a->length = s; } -static long next_offset(grib_accessor* a) +long grib_accessor_class_unsigned_t::next_offset(grib_accessor* a) { - return grib_byte_offset(a) + grib_byte_count(a); + return a->byte_offset() + a->byte_count(); } -static int is_missing(grib_accessor* a) +int grib_accessor_class_unsigned_t::is_missing(grib_accessor* a) { int i = 0; unsigned char ff = 0xff; @@ -361,7 +262,7 @@ static int is_missing(grib_accessor* a) return 1; } -static void destroy(grib_context* context, grib_accessor* a) +void grib_accessor_class_unsigned_t::destroy(grib_context* context, grib_accessor* a) { if (a->vvalue != NULL) grib_context_free(context, a->vvalue); diff --git a/src/accessor/grib_accessor_class_variable.cc b/src/accessor/grib_accessor_class_variable.cc index 8c5bbe7b0..879da527b 100644 --- a/src/accessor/grib_accessor_class_variable.cc +++ b/src/accessor/grib_accessor_class_variable.cc @@ -8,124 +8,13 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" +#include "grib_accessor_class_variable.h" #include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = unpack_float; pack_float - IMPLEMENTS = unpack_string;pack_string;string_length - IMPLEMENTS = unpack_long;pack_long;destroy;byte_count - IMPLEMENTS = init;dump;value_count;get_native_type - IMPLEMENTS = compare; make_clone - MEMBERS=double dval - MEMBERS=float fval - MEMBERS=char* cval - MEMBERS=char* cname - MEMBERS=int type - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 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 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 size_t string_length(grib_accessor*); -static long byte_count(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static int compare(grib_accessor*, grib_accessor*); -static grib_accessor* make_clone(grib_accessor*, grib_section*, int*); - -typedef struct grib_accessor_variable -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in variable */ - double dval; - float fval; - char* cval; - char* cname; - int type; -} grib_accessor_variable; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_variable = { - &grib_accessor_class_gen, /* super */ - "variable", /* name */ - sizeof(grib_accessor_variable), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - &pack_float, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - &make_clone, /* clone accessor */ -}; +grib_accessor_class_variable_t _grib_accessor_class_variable{"variable"}; grib_accessor_class* grib_accessor_class_variable = &_grib_accessor_class_variable; -/* END_CLASS_IMP */ - // // This accessor is used for: // constant @@ -134,9 +23,11 @@ grib_accessor_class* grib_accessor_class_variable = &_grib_accessor_class_variab #define MAX_VARIABLE_STRING_LENGTH 255 -static void init(grib_accessor* a, const long length, grib_arguments* args) +void grib_accessor_class_variable_t::init(grib_accessor* a, const long length, grib_arguments* args) { - grib_accessor_variable* self = (grib_accessor_variable*)a; + grib_accessor_class_gen_t::init(a, length, args); + + grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; grib_handle* hand = grib_handle_of_accessor(a); grib_expression* expression = grib_arguments_get_expression(hand, args, 0); const char* p = 0; @@ -153,12 +44,12 @@ static void init(grib_accessor* a, const long length, grib_arguments* args) switch (self->type) { case GRIB_TYPE_DOUBLE: grib_expression_evaluate_double(hand, expression, &d); - pack_double(a, &d, &len); + a->pack_double(&d, &len); break; case GRIB_TYPE_LONG: grib_expression_evaluate_long(hand, expression, &l); - pack_long(a, &l, &len); + a->pack_long(&l, &len); break; default: { @@ -171,7 +62,7 @@ static void init(grib_accessor* a, const long length, grib_arguments* args) return; } len = strlen(p) + 1; - pack_string(a, p, &len); + a->pack_string(p, &len); break; } } @@ -180,13 +71,13 @@ static void init(grib_accessor* a, const long length, grib_arguments* args) void accessor_variable_set_type(grib_accessor* a, int type) { - grib_accessor_variable* self = (grib_accessor_variable*)a; + grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; self->type = type; } -static void dump(grib_accessor* a, grib_dumper* dumper) +void grib_accessor_class_variable_t::dump(grib_accessor* a, grib_dumper* dumper) { - const grib_accessor_variable* self = (grib_accessor_variable*)a; + const grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; switch (self->type) { case GRIB_TYPE_DOUBLE: grib_dump_double(dumper, a, NULL); @@ -202,9 +93,9 @@ static void dump(grib_accessor* a, grib_dumper* dumper) } } -static int pack_double(grib_accessor* a, const double* val, size_t* len) +int grib_accessor_class_variable_t::pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_variable* self = (grib_accessor_variable*)a; + grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; const double dval = *val; if (*len != 1) { @@ -227,9 +118,9 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return GRIB_SUCCESS; } -static int pack_float(grib_accessor* a, const float* val, size_t* len) +int grib_accessor_class_variable_t::pack_float(grib_accessor* a, const float* val, size_t* len) { - grib_accessor_variable* self = (grib_accessor_variable*)a; + grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; const double fval = *val; if (*len != 1) { @@ -247,9 +138,9 @@ static int pack_float(grib_accessor* a, const float* val, size_t* len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) +int grib_accessor_class_variable_t::pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_variable* self = (grib_accessor_variable*)a; + grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; if (*len != 1) { grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains 1 value", a->name); @@ -264,9 +155,9 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) +int grib_accessor_class_variable_t::unpack_double(grib_accessor* a, double* val, size_t* len) { - const grib_accessor_variable* self = (grib_accessor_variable*)a; + const grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; if (*len < 1) { grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it contains %d values", a->name, 1); @@ -278,9 +169,9 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_float(grib_accessor* a, float* val, size_t* len) +int grib_accessor_class_variable_t::unpack_float(grib_accessor* a, float* val, size_t* len) { - const grib_accessor_variable* self = (grib_accessor_variable*)a; + const grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; if (*len < 1) { grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it contains %d values", a->name, 1); @@ -292,9 +183,9 @@ static int unpack_float(grib_accessor* a, float* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) +int grib_accessor_class_variable_t::unpack_long(grib_accessor* a, long* val, size_t* len) { - const grib_accessor_variable* self = (grib_accessor_variable*)a; + const grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; if (*len < 1) { grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); @@ -306,15 +197,15 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int get_native_type(grib_accessor* a) +int grib_accessor_class_variable_t::get_native_type(grib_accessor* a) { - const grib_accessor_variable* self = (grib_accessor_variable*)a; + const grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; return self->type; } -static void destroy(grib_context* c, grib_accessor* a) +void grib_accessor_class_variable_t::destroy(grib_context* c, grib_accessor* a) { - grib_accessor_variable* self = (grib_accessor_variable*)a; + grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; int i = 0; grib_context_free(c, self->cval); @@ -323,15 +214,15 @@ static void destroy(grib_context* c, grib_accessor* a) /* Note: BUFR operator descriptors are variables and have attributes so need to free them */ while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - grib_accessor_delete(c, a->attributes[i]); + a->attributes[i]->destroy(c); a->attributes[i] = NULL; ++i; } } -static int unpack_string(grib_accessor* a, char* val, size_t* len) +int grib_accessor_class_variable_t::unpack_string(grib_accessor* a, char* val, size_t* len) { - grib_accessor_variable* self = (grib_accessor_variable*)a; + grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; char buf[80]; char* p = buf; @@ -358,9 +249,9 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t* len) +int grib_accessor_class_variable_t::pack_string(grib_accessor* a, const char* val, size_t* len) { - grib_accessor_variable* self = (grib_accessor_variable*)a; + grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; const grib_context* c = a->context; grib_context_free(c, self->cval); @@ -372,27 +263,27 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return GRIB_SUCCESS; } -static int value_count(grib_accessor* a, long* count) +int grib_accessor_class_variable_t::value_count(grib_accessor* a, long* count) { *count = 1; return 0; } -static size_t string_length(grib_accessor* a) +size_t grib_accessor_class_variable_t::string_length(grib_accessor* a) { - const grib_accessor_variable* self = (grib_accessor_variable*)a; + const grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; if (self->type == GRIB_TYPE_STRING) return strlen(self->cval); else return MAX_VARIABLE_STRING_LENGTH; } -static long byte_count(grib_accessor* a) +long grib_accessor_class_variable_t::byte_count(grib_accessor* a) { return a->length; } -static int compare(grib_accessor* a, grib_accessor* b) +int grib_accessor_class_variable_t::compare(grib_accessor* a, grib_accessor* b) { int retval = GRIB_SUCCESS; double* aval = 0; @@ -403,12 +294,12 @@ static int compare(grib_accessor* a, grib_accessor* b) int err = 0; long count = 0; - err = grib_value_count(a, &count); + err = a->value_count(&count); if (err) return err; alen = count; - err = grib_value_count(b, &count); + err = b->value_count(&count); if (err) return err; blen = count; @@ -419,8 +310,8 @@ static int compare(grib_accessor* a, grib_accessor* b) aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - grib_unpack_double(a, aval, &alen); - grib_unpack_double(b, bval, &blen); + a->unpack_double(aval, &alen); + b->unpack_double(bval, &blen); retval = GRIB_SUCCESS; retval = GRIB_SUCCESS; @@ -434,11 +325,11 @@ static int compare(grib_accessor* a, grib_accessor* b) return retval; } -static grib_accessor* make_clone(grib_accessor* a, grib_section* s, int* err) +grib_accessor* grib_accessor_class_variable_t::make_clone(grib_accessor* a, grib_section* s, int* err) { grib_accessor* the_clone = NULL; - const grib_accessor_variable* self = (grib_accessor_variable*)a; - grib_accessor_variable* variableAccessor = NULL; + const grib_accessor_variable_t* self = (grib_accessor_variable_t*)a; + grib_accessor_variable_t* variableAccessor = NULL; grib_action creator = {0,}; creator.op = (char*)"variable"; creator.name_space = (char*)""; @@ -449,7 +340,7 @@ static grib_accessor* make_clone(grib_accessor* a, grib_section* s, int* err) the_clone->parent = NULL; the_clone->h = s->h; the_clone->flags = a->flags; - variableAccessor = (grib_accessor_variable*)the_clone; + variableAccessor = (grib_accessor_variable_t*)the_clone; variableAccessor->cname = creator.name; /* ECC-765: Store for later freeing memory */ *err = 0; diff --git a/src/action_class_gen.cc b/src/action_class_gen.cc index 641aa3c92..722391c7f 100644 --- a/src/action_class_gen.cc +++ b/src/action_class_gen.cc @@ -152,7 +152,7 @@ static int create_accessor(grib_section* p, grib_action* act, grib_loader* loade static int notify_change(grib_action* act, grib_accessor* notified, grib_accessor* changed) { if (act->default_value) - return grib_pack_expression(notified, grib_arguments_get_expression(grib_handle_of_accessor(notified), act->default_value, 0)); + return notified->pack_expression(grib_arguments_get_expression(grib_handle_of_accessor(notified), act->default_value, 0)); return GRIB_SUCCESS; } diff --git a/src/action_class_remove.cc b/src/action_class_remove.cc index 40f5079a7..a334a79f1 100644 --- a/src/action_class_remove.cc +++ b/src/action_class_remove.cc @@ -110,7 +110,7 @@ static void remove_accessor(grib_accessor* a) a->next->previous = a->previous; - grib_accessor_delete(s->h->context, a); + a->destroy(s->h->context); } static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) diff --git a/src/action_class_transient_darray.cc b/src/action_class_transient_darray.cc index 673f83502..276dcf3fa 100644 --- a/src/action_class_transient_darray.cc +++ b/src/action_class_transient_darray.cc @@ -117,7 +117,7 @@ static int execute(grib_action* act, grib_handle* h) if (a->flags & GRIB_ACCESSOR_FLAG_CONSTRAINT) grib_dependency_observe_arguments(a, act->default_value); - return grib_pack_double(a, self->darray->v, &len); + return a->pack_double(self->darray->v, &len); } static void dump(grib_action* act, FILE* f, int lvl) diff --git a/src/bufr_keys_iterator.cc b/src/bufr_keys_iterator.cc index e1ab89697..d22b0349b 100644 --- a/src/bufr_keys_iterator.cc +++ b/src/bufr_keys_iterator.cc @@ -176,7 +176,7 @@ int codes_bufr_keys_iterator_next(bufr_keys_iterator* kiter) return 1; } else { - kiter->current = grib_next_accessor(kiter->current); + kiter->current = kiter->current->next_accessor(); kiter->attributes = 0; if (kiter->prefix) { grib_context_free(kiter->current->context, kiter->prefix); @@ -187,7 +187,7 @@ int codes_bufr_keys_iterator_next(bufr_keys_iterator* kiter) } while (kiter->current && skip(kiter)) - kiter->current = grib_next_accessor(kiter->current); + kiter->current = kiter->current->next_accessor(); return kiter->current != NULL; } diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 7905f7978..30fcd82b0 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1,13 +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. - */ - #pragma once #ifdef ECCODES_ON_WINDOWS @@ -116,52 +106,6 @@ grib_action* grib_action_create_modify(grib_context* context, const char* name, grib_action* grib_action_create_transient_darray(grib_context* context, const char* name, grib_darray* darray, int flags); /* grib_accessor.cc*/ -void grib_accessor_dump(grib_accessor* a, grib_dumper* f); -int grib_pack_missing(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); -int grib_pack_long(grib_accessor* a, const long* v, size_t* len); -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); -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); -long grib_get_next_position_offset(grib_accessor* a); -long grib_string_length(grib_accessor* a); -long grib_byte_offset(grib_accessor* a); -long grib_byte_count(grib_accessor* a); -int grib_value_count(grib_accessor* a, long* count); -int grib_accessors_list_value_count(grib_accessors_list* al, size_t* count); -int grib_accessor_notify_change(grib_accessor* a, grib_accessor* changed); -void grib_init_accessor(grib_accessor* a, const long len, grib_arguments* args); -void grib_accessor_delete(grib_context* ct, grib_accessor* a); -grib_accessor* grib_accessor_clone(grib_accessor* a, grib_section* s, int* err); -void grib_update_size(grib_accessor* a, size_t len); -int grib_nearest_smaller_value(grib_accessor* a, double val, double* nearest); -size_t grib_preferred_size(grib_accessor* a, int from_handle); -grib_accessor* grib_next_accessor(grib_accessor* a); -void grib_resize(grib_accessor* a, size_t new_size); -int grib_compare_accessors(grib_accessor* a1, grib_accessor* a2, int compare_flags); -int grib_accessor_add_attribute(grib_accessor* a, grib_accessor* attr, int nest_if_clash); -grib_accessor* grib_accessor_get_attribute_index(grib_accessor* a, const char* name, int* index); -int grib_accessor_has_attributes(grib_accessor* a); -grib_accessor* grib_accessor_get_attribute(grib_accessor* a, const char* name); grib_accessors_list* grib_accessors_list_create(grib_context* c); void grib_accessors_list_push(grib_accessors_list* al, grib_accessor* a, int rank); grib_accessors_list* grib_accessors_list_last(grib_accessors_list* al); @@ -262,10 +206,13 @@ void grib_viarray_delete_content(grib_context* c, grib_viarray* v); /* grib_accessor_class_bits_per_value.cc*/ /* grib_accessor_class_bufr_data_array.cc*/ -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); +// ===== TODO(maee): Reenable these functions ===== +//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); +// ===== END ===== + /* grib_accessor_class_bufr_data_element.cc*/ void accessor_bufr_data_element_set_index(grib_accessor* a, long index); @@ -928,6 +875,7 @@ grib_handle* grib_fieldset_retrieve(grib_fieldset* set, int i, int* err); /* grib_filepool.cc*/ void grib_file_pool_clean(void); +grib_file* grib_file_pool_get_files(void); grib_file* grib_file_open(const char* filename, const char* mode, int* err); void grib_file_pool_delete_file(grib_file* file); void grib_file_close(const char* filename, int force, int* err); diff --git a/src/grib_accessor_class.cc b/src/grib_accessor_class.cc index 9cdd04b97..63c2fede6 100644 --- a/src/grib_accessor_class.cc +++ b/src/grib_accessor_class.cc @@ -15,7 +15,7 @@ /* This file is generated by ./make_class.pl */ -#include "grib_accessor_class.h" +#include "accessor/grib_accessor.h" #if GRIB_PTHREADS static pthread_once_t once = PTHREAD_ONCE_INIT; @@ -139,7 +139,7 @@ grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator, c = *((grib_accessor_classes_hash(creator->op, strlen(creator->op)))->cclass); #endif - a = (grib_accessor*)grib_context_malloc_clear(p->h->context, c->size); + a = c->create_empty_accessor(); a->name = creator->name; a->name_space = creator->name_space; @@ -159,7 +159,7 @@ grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator, a->set = creator->set; if (p->block->last) { - a->offset = grib_get_next_position_offset(p->block->last); + a->offset = p->block->last->get_next_position_offset(); //printf("offset: p->block->last %s %s %ld %ld\n", // p->block->last->cclass->name, @@ -176,8 +176,8 @@ grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator, a->cclass = c; - grib_init_accessor(a, len, params); - size = grib_get_next_position_offset(a); + a->init_accessor(len, params); + size = a->get_next_position_offset(); if (size > p->h->buffer->ulength) { if (!p->h->buffer->growable) { @@ -189,7 +189,7 @@ grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator, a->offset + a->length, p->h->buffer->ulength); - grib_accessor_delete(p->h->context, a); + a->destroy(p->h->context); return NULL; } else { @@ -223,10 +223,10 @@ static void link_same_attributes(grib_accessor* a, grib_accessor* b) grib_accessor* bAttribute = NULL; if (a == NULL || b == NULL) return; - if (!grib_accessor_has_attributes(b)) + if (!b->has_attributes()) return; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - bAttribute = grib_accessor_get_attribute_index(b, a->attributes[i]->name, &idx); + bAttribute = b->get_attribute_index(a->attributes[i]->name, &idx); if (bAttribute) a->attributes[i]->same = bAttribute; i++; @@ -270,8 +270,10 @@ void grib_section_post_init(grib_section* s) while (a) { grib_accessor_class* c = a->cclass; - if (c->post_init) - c->post_init(a); + //if (c->post_init) + // c->post_init(a); + c->post_init(a); + if (a->sub_section) grib_section_post_init(a->sub_section); a = a->next; @@ -313,13 +315,13 @@ int grib_section_adjust_sizes(grib_section* s, int update, int depth) if (s->aclength) { size_t len = 1; long plen = 0; - int lret = grib_unpack_long(s->aclength, &plen, &len); + int lret = s->aclength->unpack_long(&plen, &len); Assert(lret == GRIB_SUCCESS); /* This happens when there is some padding */ if ((plen != length) || force_update) { if (update) { plen = length; - lret = grib_pack_long(s->aclength, &plen, &len); + lret = s->aclength->pack_long(&plen, &len); if (lret != GRIB_SUCCESS) return lret; s->padding = 0; @@ -358,7 +360,7 @@ int grib_get_block_length(grib_section* s, size_t* l) // if(s->aclength) { // size_t len = 1; // long plen = 0; -// int ret = grib_unpack_long(s->aclength, &plen, &len); +// int ret = s->aclength->unpack_long(&plen, &len); // if(ret == GRIB_SUCCESS && plen != 0) // { // *l = plen; @@ -371,13 +373,13 @@ int grib_get_block_length(grib_section* s, size_t* l) // return GRIB_SUCCESS; // } // // no accessor for block length -// if(s->owner) *l = grib_get_next_position_offset(s->block->last) - s->owner->offset; -// else *l = grib_get_next_position_offset(s->block->last); +// if(s->owner) *l = s->block->last->get_next_position_offset() - s->owner->offset; +// else *l = s->block->last->get_next_position_offset(); // if(s->aclength) { // size_t len = 1; // long plen = *l; -// int ret = grib_pack_long(s->aclength, &plen, &len); +// int ret = s->aclength->pack_long(&plen, &len); // if(ret != GRIB_SUCCESS) // ; // if(s->h->context->debug) @@ -397,7 +399,7 @@ grib_accessor* find_paddings(grib_section* s) if (p) return p; - if (grib_preferred_size(a, 0) != a->length) + if (a->preferred_size(0) != a->length) return a; a = a->next; @@ -414,7 +416,7 @@ void grib_update_paddings(grib_section* s) /* while((changed = find_paddings(s)) != NULL) */ while ((changed = find_paddings(s->h->root)) != NULL) { Assert(changed != last); - grib_resize(changed, grib_preferred_size(changed, 0)); + changed->resize(changed->preferred_size(0)); last = changed; } } diff --git a/src/grib_accessor_class.h b/src/grib_accessor_class.h index 0c569decd..fd0370719 100644 --- a/src/grib_accessor_class.h +++ b/src/grib_accessor_class.h @@ -1,206 +1,216 @@ -/* This file is automatically generated by ./make_class.pl, do not edit */ -extern grib_accessor_class* grib_accessor_class_abstract_long_vector; -extern grib_accessor_class* grib_accessor_class_abstract_vector; -extern grib_accessor_class* grib_accessor_class_ascii; -extern grib_accessor_class* grib_accessor_class_bit; -extern grib_accessor_class* grib_accessor_class_bitmap; -extern grib_accessor_class* grib_accessor_class_bits; -extern grib_accessor_class* grib_accessor_class_bits_per_value; -extern grib_accessor_class* grib_accessor_class_blob; -extern grib_accessor_class* grib_accessor_class_budgdate; -extern grib_accessor_class* grib_accessor_class_bufr_data_array; -extern grib_accessor_class* grib_accessor_class_bufr_data_element; -extern grib_accessor_class* grib_accessor_class_bufr_elements_table; -extern grib_accessor_class* grib_accessor_class_bufr_extract_area_subsets; -extern grib_accessor_class* grib_accessor_class_bufr_extract_datetime_subsets; -extern grib_accessor_class* grib_accessor_class_bufr_extract_subsets; -extern grib_accessor_class* grib_accessor_class_bufr_group; -extern grib_accessor_class* grib_accessor_class_bufr_simple_thinning; -extern grib_accessor_class* grib_accessor_class_bufr_string_values; -extern grib_accessor_class* grib_accessor_class_bufrdc_expanded_descriptors; -extern grib_accessor_class* grib_accessor_class_bytes; -extern grib_accessor_class* grib_accessor_class_change_alternative_row_scanning; -extern grib_accessor_class* grib_accessor_class_change_scanning_direction; -extern grib_accessor_class* grib_accessor_class_check_internal_version; -extern grib_accessor_class* grib_accessor_class_closest_date; -extern grib_accessor_class* grib_accessor_class_codeflag; +#include "grib_api_internal.h" + +//extern grib_accessor_class* grib_accessor_class_abstract_long_vector; +//extern grib_accessor_class* grib_accessor_class_abstract_vector; +//extern grib_accessor_class* grib_accessor_class_ascii; +//extern grib_accessor_class* grib_accessor_class_bit; +//extern grib_accessor_class* grib_accessor_class_bitmap; +//extern grib_accessor_class* grib_accessor_class_bits; +//extern grib_accessor_class* grib_accessor_class_bits_per_value; +//extern grib_accessor_class* grib_accessor_class_blob; +//extern grib_accessor_class* grib_accessor_class_budgdate; +//extern grib_accessor_class* grib_accessor_class_bufr_data_array; +//extern grib_accessor_class* grib_accessor_class_bufr_data_element; +//extern grib_accessor_class* grib_accessor_class_bufr_elements_table; +//extern grib_accessor_class* grib_accessor_class_bufr_extract_area_subsets; +//extern grib_accessor_class* grib_accessor_class_bufr_extract_datetime_subsets; +//extern grib_accessor_class* grib_accessor_class_bufr_extract_subsets; +//extern grib_accessor_class* grib_accessor_class_bufr_group; +//extern grib_accessor_class* grib_accessor_class_bufr_simple_thinning; +//extern grib_accessor_class* grib_accessor_class_bufr_string_values; +//extern grib_accessor_class* grib_accessor_class_bufrdc_expanded_descriptors; +//extern grib_accessor_class* grib_accessor_class_bytes; +//extern grib_accessor_class* grib_accessor_class_change_alternative_row_scanning; +//extern grib_accessor_class* grib_accessor_class_change_scanning_direction; +//extern grib_accessor_class* grib_accessor_class_check_internal_version; +//extern grib_accessor_class* grib_accessor_class_closest_date; +//extern grib_accessor_class* grib_accessor_class_codeflag; +#include "accessor/grib_accessor_class_codetable.h" extern grib_accessor_class* grib_accessor_class_codetable; -extern grib_accessor_class* grib_accessor_class_codetable_title; -extern grib_accessor_class* grib_accessor_class_codetable_units; -extern grib_accessor_class* grib_accessor_class_concept; +//extern grib_accessor_class* grib_accessor_class_codetable_title; +//extern grib_accessor_class* grib_accessor_class_codetable_units; +//extern grib_accessor_class* grib_accessor_class_concept; +#include "accessor/grib_accessor_class_constant.h" extern grib_accessor_class* grib_accessor_class_constant; -extern grib_accessor_class* grib_accessor_class_count_file; -extern grib_accessor_class* grib_accessor_class_count_missing; -extern grib_accessor_class* grib_accessor_class_count_total; -extern grib_accessor_class* grib_accessor_class_data_apply_bitmap; -extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic; -extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic_bitmap; -extern grib_accessor_class* grib_accessor_class_data_ccsds_packing; -extern grib_accessor_class* grib_accessor_class_data_complex_packing; -extern grib_accessor_class* grib_accessor_class_data_dummy_field; -extern grib_accessor_class* grib_accessor_class_data_g1complex_packing; -extern grib_accessor_class* grib_accessor_class_data_g1second_order_constant_width_packing; -extern grib_accessor_class* grib_accessor_class_data_g1second_order_general_extended_packing; -extern grib_accessor_class* grib_accessor_class_data_g1second_order_general_packing; -extern grib_accessor_class* grib_accessor_class_data_g1second_order_row_by_row_packing; -extern grib_accessor_class* grib_accessor_class_data_g1secondary_bitmap; -extern grib_accessor_class* grib_accessor_class_data_g1shsimple_packing; -extern grib_accessor_class* grib_accessor_class_data_g1simple_packing; -extern grib_accessor_class* grib_accessor_class_data_g22order_packing; -extern grib_accessor_class* grib_accessor_class_data_g2bifourier_packing; -extern grib_accessor_class* grib_accessor_class_data_g2complex_packing; -extern grib_accessor_class* grib_accessor_class_data_g2secondary_bitmap; -extern grib_accessor_class* grib_accessor_class_data_g2shsimple_packing; -extern grib_accessor_class* grib_accessor_class_data_g2simple_packing; -extern grib_accessor_class* grib_accessor_class_data_g2simple_packing_with_preprocessing; -extern grib_accessor_class* grib_accessor_class_data_jpeg2000_packing; -extern grib_accessor_class* grib_accessor_class_data_png_packing; -extern grib_accessor_class* grib_accessor_class_data_raw_packing; -extern grib_accessor_class* grib_accessor_class_data_run_length_packing; -extern grib_accessor_class* grib_accessor_class_data_secondary_bitmap; -extern grib_accessor_class* grib_accessor_class_data_sh_packed; -extern grib_accessor_class* grib_accessor_class_data_sh_unpacked; -extern grib_accessor_class* grib_accessor_class_data_shsimple_packing; -extern grib_accessor_class* grib_accessor_class_data_simple_packing; -extern grib_accessor_class* grib_accessor_class_decimal_precision; -extern grib_accessor_class* grib_accessor_class_dictionary; -extern grib_accessor_class* grib_accessor_class_dirty; -extern grib_accessor_class* grib_accessor_class_divdouble; -extern grib_accessor_class* grib_accessor_class_double; -extern grib_accessor_class* grib_accessor_class_element; -extern grib_accessor_class* grib_accessor_class_evaluate; -extern grib_accessor_class* grib_accessor_class_expanded_descriptors; -extern grib_accessor_class* grib_accessor_class_from_scale_factor_scaled_value; -extern grib_accessor_class* grib_accessor_class_g1_half_byte_codeflag; -extern grib_accessor_class* grib_accessor_class_g1_message_length; -extern grib_accessor_class* grib_accessor_class_g1_section4_length; -extern grib_accessor_class* grib_accessor_class_g1bitmap; -extern grib_accessor_class* grib_accessor_class_g1date; -extern grib_accessor_class* grib_accessor_class_g1day_of_the_year_date; -extern grib_accessor_class* grib_accessor_class_g1end_of_interval_monthly; -extern grib_accessor_class* grib_accessor_class_g1fcperiod; -extern grib_accessor_class* grib_accessor_class_g1forecastmonth; -extern grib_accessor_class* grib_accessor_class_g1monthlydate; -extern grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_complex; -extern grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_simple; -extern grib_accessor_class* grib_accessor_class_g1step_range; -extern grib_accessor_class* grib_accessor_class_g1verificationdate; -extern grib_accessor_class* grib_accessor_class_g2_aerosol; -extern grib_accessor_class* grib_accessor_class_g2_chemical; -extern grib_accessor_class* grib_accessor_class_g2_eps; -extern grib_accessor_class* grib_accessor_class_g2_mars_labeling; -extern grib_accessor_class* grib_accessor_class_g2bitmap; -extern grib_accessor_class* grib_accessor_class_g2bitmap_present; -extern grib_accessor_class* grib_accessor_class_g2date; -extern grib_accessor_class* grib_accessor_class_g2end_step; -extern grib_accessor_class* grib_accessor_class_g2grid; -extern grib_accessor_class* grib_accessor_class_g2latlon; -extern grib_accessor_class* grib_accessor_class_g2level; -extern grib_accessor_class* grib_accessor_class_g2lon; -extern grib_accessor_class* grib_accessor_class_g2step_range; -extern grib_accessor_class* grib_accessor_class_gaussian_grid_name; -extern grib_accessor_class* grib_accessor_class_gds_is_present; -extern grib_accessor_class* grib_accessor_class_gds_not_present_bitmap; -extern grib_accessor_class* grib_accessor_class_gen; -extern grib_accessor_class* grib_accessor_class_getenv; -extern grib_accessor_class* grib_accessor_class_global_gaussian; -extern grib_accessor_class* grib_accessor_class_group; -extern grib_accessor_class* grib_accessor_class_group_copy; -extern grib_accessor_class* grib_accessor_class_gts_header; -extern grib_accessor_class* grib_accessor_class_hash_array; -extern grib_accessor_class* grib_accessor_class_headers_only; -extern grib_accessor_class* grib_accessor_class_ibmfloat; -extern grib_accessor_class* grib_accessor_class_ieeefloat; -extern grib_accessor_class* grib_accessor_class_ifs_param; +//extern grib_accessor_class* grib_accessor_class_count_file; +//extern grib_accessor_class* grib_accessor_class_count_missing; +//extern grib_accessor_class* grib_accessor_class_count_total; +//extern grib_accessor_class* grib_accessor_class_data_apply_bitmap; +//extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic; +//extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic_bitmap; +//extern grib_accessor_class* grib_accessor_class_data_ccsds_packing; +//extern grib_accessor_class* grib_accessor_class_data_complex_packing; +//extern grib_accessor_class* grib_accessor_class_data_dummy_field; +//extern grib_accessor_class* grib_accessor_class_data_g1complex_packing; +//extern grib_accessor_class* grib_accessor_class_data_g1second_order_constant_width_packing; +//extern grib_accessor_class* grib_accessor_class_data_g1second_order_general_extended_packing; +//extern grib_accessor_class* grib_accessor_class_data_g1second_order_general_packing; +//extern grib_accessor_class* grib_accessor_class_data_g1second_order_row_by_row_packing; +//extern grib_accessor_class* grib_accessor_class_data_g1secondary_bitmap; +//extern grib_accessor_class* grib_accessor_class_data_g1shsimple_packing; +//extern grib_accessor_class* grib_accessor_class_data_g1simple_packing; +//extern grib_accessor_class* grib_accessor_class_data_g22order_packing; +//extern grib_accessor_class* grib_accessor_class_data_g2bifourier_packing; +//extern grib_accessor_class* grib_accessor_class_data_g2complex_packing; +//extern grib_accessor_class* grib_accessor_class_data_g2secondary_bitmap; +//extern grib_accessor_class* grib_accessor_class_data_g2shsimple_packing; +//extern grib_accessor_class* grib_accessor_class_data_g2simple_packing; +//extern grib_accessor_class* grib_accessor_class_data_g2simple_packing_with_preprocessing; +//extern grib_accessor_class* grib_accessor_class_data_jpeg2000_packing; +//extern grib_accessor_class* grib_accessor_class_data_png_packing; +//extern grib_accessor_class* grib_accessor_class_data_raw_packing; +//extern grib_accessor_class* grib_accessor_class_data_run_length_packing; +//extern grib_accessor_class* grib_accessor_class_data_secondary_bitmap; +//extern grib_accessor_class* grib_accessor_class_data_sh_packed; +//extern grib_accessor_class* grib_accessor_class_data_sh_unpacked; +//extern grib_accessor_class* grib_accessor_class_data_shsimple_packing; +//extern grib_accessor_class* grib_accessor_class_data_simple_packing; +//extern grib_accessor_class* grib_accessor_class_decimal_precision; +//extern grib_accessor_class* grib_accessor_class_dictionary; +//extern grib_accessor_class* grib_accessor_class_dirty; +//extern grib_accessor_class* grib_accessor_class_divdouble; +//extern grib_accessor_class* grib_accessor_class_double; +//extern grib_accessor_class* grib_accessor_class_element; +//extern grib_accessor_class* grib_accessor_class_evaluate; +//extern grib_accessor_class* grib_accessor_class_expanded_descriptors; +//extern grib_accessor_class* grib_accessor_class_from_scale_factor_scaled_value; +//extern grib_accessor_class* grib_accessor_class_g1_half_byte_codeflag; +//extern grib_accessor_class* grib_accessor_class_g1_message_length; +//extern grib_accessor_class* grib_accessor_class_g1_section4_length; +//extern grib_accessor_class* grib_accessor_class_g1bitmap; +//extern grib_accessor_class* grib_accessor_class_g1date; +//extern grib_accessor_class* grib_accessor_class_g1day_of_the_year_date; +//extern grib_accessor_class* grib_accessor_class_g1end_of_interval_monthly; +//extern grib_accessor_class* grib_accessor_class_g1fcperiod; +//extern grib_accessor_class* grib_accessor_class_g1forecastmonth; +//extern grib_accessor_class* grib_accessor_class_g1monthlydate; +//extern grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_complex; +//extern grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_simple; +//extern grib_accessor_class* grib_accessor_class_g1step_range; +//extern grib_accessor_class* grib_accessor_class_g1verificationdate; +//extern grib_accessor_class* grib_accessor_class_g2_aerosol; +//extern grib_accessor_class* grib_accessor_class_g2_chemical; +//extern grib_accessor_class* grib_accessor_class_g2_eps; +//extern grib_accessor_class* grib_accessor_class_g2_mars_labeling; +//extern grib_accessor_class* grib_accessor_class_g2bitmap; +//extern grib_accessor_class* grib_accessor_class_g2bitmap_present; +//extern grib_accessor_class* grib_accessor_class_g2date; +//extern grib_accessor_class* grib_accessor_class_g2end_step; +//extern grib_accessor_class* grib_accessor_class_g2grid; +//extern grib_accessor_class* grib_accessor_class_g2latlon; +//extern grib_accessor_class* grib_accessor_class_g2level; +//extern grib_accessor_class* grib_accessor_class_g2lon; +//extern grib_accessor_class* grib_accessor_class_g2step_range; +//extern grib_accessor_class* grib_accessor_class_gaussian_grid_name; +//extern grib_accessor_class* grib_accessor_class_gds_is_present; +//extern grib_accessor_class* grib_accessor_class_gds_not_present_bitmap; +//extern grib_accessor_class* grib_accessor_class_gen; +//extern grib_accessor_class* grib_accessor_class_getenv; +//extern grib_accessor_class* grib_accessor_class_global_gaussian; +//extern grib_accessor_class* grib_accessor_class_group; +//extern grib_accessor_class* grib_accessor_class_group_copy; +//extern grib_accessor_class* grib_accessor_class_gts_header; +//extern grib_accessor_class* grib_accessor_class_hash_array; +//extern grib_accessor_class* grib_accessor_class_headers_only; +//extern grib_accessor_class* grib_accessor_class_ibmfloat; +//extern grib_accessor_class* grib_accessor_class_ieeefloat; +//extern grib_accessor_class* grib_accessor_class_ifs_param; +#include "accessor/grib_accessor_class_iterator.h" extern grib_accessor_class* grib_accessor_class_iterator; -extern grib_accessor_class* grib_accessor_class_julian_date; -extern grib_accessor_class* grib_accessor_class_julian_day; -extern grib_accessor_class* grib_accessor_class_ksec1expver; -extern grib_accessor_class* grib_accessor_class_label; -extern grib_accessor_class* grib_accessor_class_latitudes; -extern grib_accessor_class* grib_accessor_class_latlon_increment; -extern grib_accessor_class* grib_accessor_class_latlonvalues; -extern grib_accessor_class* grib_accessor_class_library_version; -extern grib_accessor_class* grib_accessor_class_local_definition; +//extern grib_accessor_class* grib_accessor_class_julian_date; +//extern grib_accessor_class* grib_accessor_class_julian_day; +//extern grib_accessor_class* grib_accessor_class_ksec1expver; +//extern grib_accessor_class* grib_accessor_class_label; +//extern grib_accessor_class* grib_accessor_class_latitudes; +//extern grib_accessor_class* grib_accessor_class_latlon_increment; +//extern grib_accessor_class* grib_accessor_class_latlonvalues; +//extern grib_accessor_class* grib_accessor_class_library_version; +//extern grib_accessor_class* grib_accessor_class_local_definition; +#include "accessor/grib_accessor_class_long.h" extern grib_accessor_class* grib_accessor_class_long; -extern grib_accessor_class* grib_accessor_class_long_vector; -extern grib_accessor_class* grib_accessor_class_longitudes; -extern grib_accessor_class* grib_accessor_class_lookup; -extern grib_accessor_class* grib_accessor_class_mars_param; -extern grib_accessor_class* grib_accessor_class_mars_step; -extern grib_accessor_class* grib_accessor_class_md5; -extern grib_accessor_class* grib_accessor_class_message; -extern grib_accessor_class* grib_accessor_class_message_copy; -extern grib_accessor_class* grib_accessor_class_multdouble; +//extern grib_accessor_class* grib_accessor_class_long_vector; +//extern grib_accessor_class* grib_accessor_class_longitudes; +//extern grib_accessor_class* grib_accessor_class_lookup; +//extern grib_accessor_class* grib_accessor_class_mars_param; +//extern grib_accessor_class* grib_accessor_class_mars_step; +//extern grib_accessor_class* grib_accessor_class_md5; +//extern grib_accessor_class* grib_accessor_class_message; +//extern grib_accessor_class* grib_accessor_class_message_copy; +//extern grib_accessor_class* grib_accessor_class_multdouble; +#include "accessor/grib_accessor_class_nearest.h" extern grib_accessor_class* grib_accessor_class_nearest; -extern grib_accessor_class* grib_accessor_class_non_alpha; -extern grib_accessor_class* grib_accessor_class_number_of_coded_values; -extern grib_accessor_class* grib_accessor_class_number_of_points; -extern grib_accessor_class* grib_accessor_class_number_of_points_gaussian; -extern grib_accessor_class* grib_accessor_class_number_of_values; -extern grib_accessor_class* grib_accessor_class_number_of_values_data_raw_packing; -extern grib_accessor_class* grib_accessor_class_octahedral_gaussian; -extern grib_accessor_class* grib_accessor_class_octet_number; -extern grib_accessor_class* grib_accessor_class_offset_file; -extern grib_accessor_class* grib_accessor_class_offset_values; -extern grib_accessor_class* grib_accessor_class_optimal_step_units; -extern grib_accessor_class* grib_accessor_class_pack_bufr_values; -extern grib_accessor_class* grib_accessor_class_packing_type; -extern grib_accessor_class* grib_accessor_class_pad; -extern grib_accessor_class* grib_accessor_class_padding; -extern grib_accessor_class* grib_accessor_class_padto; -extern grib_accessor_class* grib_accessor_class_padtoeven; -extern grib_accessor_class* grib_accessor_class_padtomultiple; -extern grib_accessor_class* grib_accessor_class_position; -extern grib_accessor_class* grib_accessor_class_proj_string; -extern grib_accessor_class* grib_accessor_class_raw; -extern grib_accessor_class* grib_accessor_class_rdbtime_guess_date; -extern grib_accessor_class* grib_accessor_class_reference_value_error; -extern grib_accessor_class* grib_accessor_class_round; -extern grib_accessor_class* grib_accessor_class_scale; -extern grib_accessor_class* grib_accessor_class_scale_values; -extern grib_accessor_class* grib_accessor_class_second_order_bits_per_value; -extern grib_accessor_class* grib_accessor_class_section; -extern grib_accessor_class* grib_accessor_class_section_length; -extern grib_accessor_class* grib_accessor_class_section_padding; -extern grib_accessor_class* grib_accessor_class_section_pointer; -extern grib_accessor_class* grib_accessor_class_select_step_template; -extern grib_accessor_class* grib_accessor_class_sexagesimal2decimal; -extern grib_accessor_class* grib_accessor_class_signed; -extern grib_accessor_class* grib_accessor_class_signed_bits; -extern grib_accessor_class* grib_accessor_class_simple_packing_error; -extern grib_accessor_class* grib_accessor_class_size; +//extern grib_accessor_class* grib_accessor_class_non_alpha; +//extern grib_accessor_class* grib_accessor_class_number_of_coded_values; +//extern grib_accessor_class* grib_accessor_class_number_of_points; +//extern grib_accessor_class* grib_accessor_class_number_of_points_gaussian; +//extern grib_accessor_class* grib_accessor_class_number_of_values; +//extern grib_accessor_class* grib_accessor_class_number_of_values_data_raw_packing; +//extern grib_accessor_class* grib_accessor_class_octahedral_gaussian; +//extern grib_accessor_class* grib_accessor_class_octet_number; +//extern grib_accessor_class* grib_accessor_class_offset_file; +//extern grib_accessor_class* grib_accessor_class_offset_values; +//extern grib_accessor_class* grib_accessor_class_optimal_step_units; +//extern grib_accessor_class* grib_accessor_class_pack_bufr_values; +//extern grib_accessor_class* grib_accessor_class_packing_type; +//extern grib_accessor_class* grib_accessor_class_pad; +//extern grib_accessor_class* grib_accessor_class_padding; +//extern grib_accessor_class* grib_accessor_class_padto; +//extern grib_accessor_class* grib_accessor_class_padtoeven; +//extern grib_accessor_class* grib_accessor_class_padtomultiple; +//extern grib_accessor_class* grib_accessor_class_position; +//extern grib_accessor_class* grib_accessor_class_proj_string; +//extern grib_accessor_class* grib_accessor_class_raw; +//extern grib_accessor_class* grib_accessor_class_rdbtime_guess_date; +//extern grib_accessor_class* grib_accessor_class_reference_value_error; +//extern grib_accessor_class* grib_accessor_class_round; +//extern grib_accessor_class* grib_accessor_class_scale; +//extern grib_accessor_class* grib_accessor_class_scale_values; +//extern grib_accessor_class* grib_accessor_class_second_order_bits_per_value; +//extern grib_accessor_class* grib_accessor_class_section; +//extern grib_accessor_class* grib_accessor_class_section_length; +//extern grib_accessor_class* grib_accessor_class_section_padding; +//extern grib_accessor_class* grib_accessor_class_section_pointer; +//extern grib_accessor_class* grib_accessor_class_select_step_template; +//extern grib_accessor_class* grib_accessor_class_sexagesimal2decimal; +//extern grib_accessor_class* grib_accessor_class_signed; +//extern grib_accessor_class* grib_accessor_class_signed_bits; +//extern grib_accessor_class* grib_accessor_class_simple_packing_error; +//extern grib_accessor_class* grib_accessor_class_size; +#include "accessor/grib_accessor_class_smart_table.h" extern grib_accessor_class* grib_accessor_class_smart_table; -extern grib_accessor_class* grib_accessor_class_smart_table_column; -extern grib_accessor_class* grib_accessor_class_spd; -extern grib_accessor_class* grib_accessor_class_spectral_truncation; -extern grib_accessor_class* grib_accessor_class_sprintf; -extern grib_accessor_class* grib_accessor_class_statistics; -extern grib_accessor_class* grib_accessor_class_statistics_spectral; -extern grib_accessor_class* grib_accessor_class_step_human_readable; -extern grib_accessor_class* grib_accessor_class_step_in_units; -extern grib_accessor_class* grib_accessor_class_sum; -extern grib_accessor_class* grib_accessor_class_suppressed; -extern grib_accessor_class* grib_accessor_class_time; -extern grib_accessor_class* grib_accessor_class_to_double; -extern grib_accessor_class* grib_accessor_class_to_integer; -extern grib_accessor_class* grib_accessor_class_to_string; +//extern grib_accessor_class* grib_accessor_class_smart_table_column; +//extern grib_accessor_class* grib_accessor_class_spd; +//extern grib_accessor_class* grib_accessor_class_spectral_truncation; +//extern grib_accessor_class* grib_accessor_class_sprintf; +//extern grib_accessor_class* grib_accessor_class_statistics; +//extern grib_accessor_class* grib_accessor_class_statistics_spectral; +//extern grib_accessor_class* grib_accessor_class_step_human_readable; +//extern grib_accessor_class* grib_accessor_class_step_in_units; +//extern grib_accessor_class* grib_accessor_class_sum; +//extern grib_accessor_class* grib_accessor_class_suppressed; +//extern grib_accessor_class* grib_accessor_class_time; +//extern grib_accessor_class* grib_accessor_class_to_double; +//extern grib_accessor_class* grib_accessor_class_to_integer; +//extern grib_accessor_class* grib_accessor_class_to_string; +#include "accessor/grib_accessor_class_transient.h" extern grib_accessor_class* grib_accessor_class_transient; -extern grib_accessor_class* grib_accessor_class_transient_darray; -extern grib_accessor_class* grib_accessor_class_trim; -extern grib_accessor_class* grib_accessor_class_uint16; -extern grib_accessor_class* grib_accessor_class_uint32; -extern grib_accessor_class* grib_accessor_class_uint32_little_endian; -extern grib_accessor_class* grib_accessor_class_uint64; -extern grib_accessor_class* grib_accessor_class_uint64_little_endian; -extern grib_accessor_class* grib_accessor_class_uint8; -extern grib_accessor_class* grib_accessor_class_unexpanded_descriptors; -extern grib_accessor_class* grib_accessor_class_unpack_bufr_values; +//extern grib_accessor_class* grib_accessor_class_transient_darray; +//extern grib_accessor_class* grib_accessor_class_trim; +//extern grib_accessor_class* grib_accessor_class_uint16; +//extern grib_accessor_class* grib_accessor_class_uint32; +//extern grib_accessor_class* grib_accessor_class_uint32_little_endian; +//extern grib_accessor_class* grib_accessor_class_uint64; +//extern grib_accessor_class* grib_accessor_class_uint64_little_endian; +//extern grib_accessor_class* grib_accessor_class_uint8; +//extern grib_accessor_class* grib_accessor_class_unexpanded_descriptors; +//extern grib_accessor_class* grib_accessor_class_unpack_bufr_values; +#include "accessor/grib_accessor_class_unsigned.h" extern grib_accessor_class* grib_accessor_class_unsigned; -extern grib_accessor_class* grib_accessor_class_unsigned_bits; -extern grib_accessor_class* grib_accessor_class_validity_date; -extern grib_accessor_class* grib_accessor_class_validity_time; -extern grib_accessor_class* grib_accessor_class_values; +//extern grib_accessor_class* grib_accessor_class_unsigned_bits; +//extern grib_accessor_class* grib_accessor_class_validity_date; +//extern grib_accessor_class* grib_accessor_class_validity_time; +//extern grib_accessor_class* grib_accessor_class_values; +#include "accessor/grib_accessor_class_variable.h" extern grib_accessor_class* grib_accessor_class_variable; -extern grib_accessor_class* grib_accessor_class_vector; -extern grib_accessor_class* grib_accessor_class_when; +//extern grib_accessor_class* grib_accessor_class_vector; +//extern grib_accessor_class* grib_accessor_class_when; diff --git a/src/grib_accessor_classes_hash.cc b/src/grib_accessor_classes_hash.cc index 5617c9456..dd88339f7 100644 --- a/src/grib_accessor_classes_hash.cc +++ b/src/grib_accessor_classes_hash.cc @@ -1,6 +1,6 @@ /* ANSI-C code produced by gperf version 3.1 */ /* Command-line: 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 */ -/* Computed positions: -k'1-2,5,7,11' */ +/* Computed positions: -k'1' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ @@ -37,12 +37,12 @@ #line 6 "accessor_class_list.gperf" struct accessor_class_hash { const char *name; grib_accessor_class **cclass;}; -#define TOTAL_KEYWORDS 205 +#define TOTAL_KEYWORDS 10 #define MIN_WORD_LENGTH 1 -#define MAX_WORD_LENGTH 44 +#define MAX_WORD_LENGTH 11 #define MIN_HASH_VALUE 1 -#define MAX_HASH_VALUE 506 -/* maximum key range = 506, duplicates = 0 */ +#define MAX_HASH_VALUE 14 +/* maximum key range = 14, duplicates = 0 */ #ifdef __GNUC__ @@ -51,64 +51,39 @@ struct accessor_class_hash { const char *name; grib_accessor_class **cclass;}; #endif #endif -static unsigned int grib_accessor_classes_get_id (const char *str, size_t len) +static unsigned int +grib_accessor_classes_get_id (const char *str, size_t len) { - static const unsigned short asso_values[] = + static const unsigned char asso_values[] = { - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 0, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 1, 145, - 23, 6, 2, 507, 4, 507, 1, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 0, 507, 0, 69, 84, - 0, 0, 161, 24, 187, 1, 8, 9, 87, 102, - 13, 51, 6, 507, 118, 1, 40, 59, 171, 0, - 4, 6, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, + 15, 15, 15, 15, 15, 6, 15, 15, 0, 15, + 0, 15, 15, 15, 15, 2, 3, 3, 0, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15 }; - unsigned int hval = len; - - switch (hval) - { - default: - hval += asso_values[(unsigned char)str[10]]; - /*FALLTHROUGH*/ - case 10: - case 9: - case 8: - case 7: - hval += asso_values[(unsigned char)str[6]]; - /*FALLTHROUGH*/ - case 6: - case 5: - hval += asso_values[(unsigned char)str[4]]; - /*FALLTHROUGH*/ - case 4: - case 3: - case 2: - hval += asso_values[(unsigned char)str[1]]; - /*FALLTHROUGH*/ - case 1: - hval += asso_values[(unsigned char)str[0]]; - break; - } - return hval; + return len + asso_values[(unsigned char)str[0]]; } static const struct accessor_class_hash classes[] = @@ -116,524 +91,42 @@ static const struct accessor_class_hash classes[] = {""}, #line 9 "accessor_class_list.gperf" {" "}, - {""}, {""}, {""}, {""}, -#line 179 "accessor_class_list.gperf" - {"size", &grib_accessor_class_size}, -#line 12 "accessor_class_list.gperf" - {"ascii", &grib_accessor_class_ascii}, -#line 176 "accessor_class_list.gperf" - {"signed", &grib_accessor_class_signed}, -#line 156 "accessor_class_list.gperf" - {"pad", &grib_accessor_class_pad}, -#line 182 "accessor_class_list.gperf" - {"spd", &grib_accessor_class_spd}, - {""}, -#line 75 "accessor_class_list.gperf" - {"dirty", &grib_accessor_class_dirty}, - {""}, -#line 177 "accessor_class_list.gperf" - {"signed_bits", &grib_accessor_class_signed_bits}, - {""}, -#line 66 "accessor_class_list.gperf" - {"data_raw_packing", &grib_accessor_class_data_raw_packing}, - {""}, {""}, {""}, -#line 72 "accessor_class_list.gperf" - {"data_simple_packing", &grib_accessor_class_data_simple_packing}, -#line 68 "accessor_class_list.gperf" - {"data_secondary_bitmap", &grib_accessor_class_data_secondary_bitmap}, -#line 170 "accessor_class_list.gperf" - {"section", &grib_accessor_class_section}, -#line 43 "accessor_class_list.gperf" - {"data_apply_bitmap", &grib_accessor_class_data_apply_bitmap}, - {""}, -#line 74 "accessor_class_list.gperf" - {"dictionary", &grib_accessor_class_dictionary}, - {""}, -#line 112 "accessor_class_list.gperf" - {"gen", &grib_accessor_class_gen}, -#line 64 "accessor_class_list.gperf" - {"data_jpeg2000_packing", &grib_accessor_class_data_jpeg2000_packing}, -#line 65 "accessor_class_list.gperf" - {"data_png_packing", &grib_accessor_class_data_png_packing}, -#line 172 "accessor_class_list.gperf" - {"section_padding", &grib_accessor_class_section_padding}, -#line 173 "accessor_class_list.gperf" - {"section_pointer", &grib_accessor_class_section_pointer}, -#line 44 "accessor_class_list.gperf" - {"data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic}, - {""}, {""}, {""}, {""}, -#line 80 "accessor_class_list.gperf" - {"expanded_descriptors", &grib_accessor_class_expanded_descriptors}, -#line 157 "accessor_class_list.gperf" - {"padding", &grib_accessor_class_padding}, -#line 45 "accessor_class_list.gperf" - {"data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap}, -#line 110 "accessor_class_list.gperf" - {"gds_is_present", &grib_accessor_class_gds_is_present}, -#line 169 "accessor_class_list.gperf" - {"second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value}, -#line 171 "accessor_class_list.gperf" - {"section_length", &grib_accessor_class_section_length}, -#line 113 "accessor_class_list.gperf" - {"getenv", &grib_accessor_class_getenv}, -#line 57 "accessor_class_list.gperf" - {"data_g22order_packing", &grib_accessor_class_data_g22order_packing}, -#line 191 "accessor_class_list.gperf" - {"time", &grib_accessor_class_time}, - {""}, -#line 61 "accessor_class_list.gperf" - {"data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing}, - {""}, -#line 155 "accessor_class_list.gperf" - {"packing_type", &grib_accessor_class_packing_type}, -#line 62 "accessor_class_list.gperf" - {"data_g2simple_packing", &grib_accessor_class_data_g2simple_packing}, -#line 59 "accessor_class_list.gperf" - {"data_g2complex_packing", &grib_accessor_class_data_g2complex_packing}, {""}, {""}, -#line 104 "accessor_class_list.gperf" - {"g2grid", &grib_accessor_class_g2grid}, - {""}, {""}, {""}, -#line 103 "accessor_class_list.gperf" - {"g2end_step", &grib_accessor_class_g2end_step}, -#line 98 "accessor_class_list.gperf" - {"g2_eps", &grib_accessor_class_g2_eps}, +#line 132 "accessor_class_list.gperf" + {"long", &grib_accessor_class_long}, + {""}, {""}, #line 142 "accessor_class_list.gperf" {"nearest", &grib_accessor_class_nearest}, - {""}, -#line 158 "accessor_class_list.gperf" - {"padto", &grib_accessor_class_padto}, -#line 189 "accessor_class_list.gperf" - {"sum", &grib_accessor_class_sum}, - {""}, -#line 107 "accessor_class_list.gperf" - {"g2lon", &grib_accessor_class_g2lon}, -#line 203 "accessor_class_list.gperf" - {"uint8", &grib_accessor_class_uint8}, - {""}, -#line 188 "accessor_class_list.gperf" - {"step_in_units", &grib_accessor_class_step_in_units}, -#line 63 "accessor_class_list.gperf" - {"data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing}, -#line 201 "accessor_class_list.gperf" - {"uint64", &grib_accessor_class_uint64}, -#line 47 "accessor_class_list.gperf" - {"data_complex_packing", &grib_accessor_class_data_complex_packing}, -#line 199 "accessor_class_list.gperf" - {"uint32", &grib_accessor_class_uint32}, -#line 13 "accessor_class_list.gperf" - {"bit", &grib_accessor_class_bit}, -#line 15 "accessor_class_list.gperf" - {"bits", &grib_accessor_class_bits}, -#line 48 "accessor_class_list.gperf" - {"data_dummy_field", &grib_accessor_class_data_dummy_field}, -#line 14 "accessor_class_list.gperf" - {"bitmap", &grib_accessor_class_bitmap}, -#line 124 "accessor_class_list.gperf" - {"julian_day", &grib_accessor_class_julian_day}, -#line 123 "accessor_class_list.gperf" - {"julian_date", &grib_accessor_class_julian_date}, -#line 143 "accessor_class_list.gperf" - {"non_alpha", &grib_accessor_class_non_alpha}, - {""}, -#line 29 "accessor_class_list.gperf" - {"bytes", &grib_accessor_class_bytes}, -#line 67 "accessor_class_list.gperf" - {"data_run_length_packing", &grib_accessor_class_data_run_length_packing}, -#line 108 "accessor_class_list.gperf" - {"g2step_range", &grib_accessor_class_g2step_range}, -#line 16 "accessor_class_list.gperf" - {"bits_per_value", &grib_accessor_class_bits_per_value}, - {""}, {""}, {""}, {""}, {""}, -#line 167 "accessor_class_list.gperf" - {"scale", &grib_accessor_class_scale}, - {""}, -#line 185 "accessor_class_list.gperf" - {"statistics", &grib_accessor_class_statistics}, -#line 102 "accessor_class_list.gperf" - {"g2date", &grib_accessor_class_g2date}, -#line 145 "accessor_class_list.gperf" - {"number_of_points", &grib_accessor_class_number_of_points}, -#line 100 "accessor_class_list.gperf" - {"g2bitmap", &grib_accessor_class_g2bitmap}, - {""}, -#line 60 "accessor_class_list.gperf" - {"data_g2secondary_bitmap", &grib_accessor_class_data_g2secondary_bitmap}, -#line 58 "accessor_class_list.gperf" - {"data_g2bifourier_packing", &grib_accessor_class_data_g2bifourier_packing}, -#line 111 "accessor_class_list.gperf" - {"gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap}, -#line 122 "accessor_class_list.gperf" - {"iterator", &grib_accessor_class_iterator}, -#line 186 "accessor_class_list.gperf" - {"statistics_spectral", &grib_accessor_class_statistics_spectral}, -#line 46 "accessor_class_list.gperf" - {"data_ccsds_packing", &grib_accessor_class_data_ccsds_packing}, -#line 146 "accessor_class_list.gperf" - {"number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian}, +#line 211 "accessor_class_list.gperf" + {"variable", &grib_accessor_class_variable}, +#line 39 "accessor_class_list.gperf" + {"constant", &grib_accessor_class_constant}, +#line 35 "accessor_class_list.gperf" + {"codetable", &grib_accessor_class_codetable}, #line 206 "accessor_class_list.gperf" {"unsigned", &grib_accessor_class_unsigned}, -#line 138 "accessor_class_list.gperf" - {"md5", &grib_accessor_class_md5}, - {""}, {""}, -#line 96 "accessor_class_list.gperf" - {"g2_aerosol", &grib_accessor_class_g2_aerosol}, -#line 139 "accessor_class_list.gperf" - {"message", &grib_accessor_class_message}, -#line 207 "accessor_class_list.gperf" - {"unsigned_bits", &grib_accessor_class_unsigned_bits}, -#line 174 "accessor_class_list.gperf" - {"select_step_template", &grib_accessor_class_select_step_template}, -#line 136 "accessor_class_list.gperf" - {"mars_param", &grib_accessor_class_mars_param}, -#line 204 "accessor_class_list.gperf" - {"unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors}, -#line 193 "accessor_class_list.gperf" - {"to_integer", &grib_accessor_class_to_integer}, - {""}, {""}, {""}, -#line 178 "accessor_class_list.gperf" - {"simple_packing_error", &grib_accessor_class_simple_packing_error}, -#line 187 "accessor_class_list.gperf" - {"step_human_readable", &grib_accessor_class_step_human_readable}, -#line 140 "accessor_class_list.gperf" - {"message_copy", &grib_accessor_class_message_copy}, -#line 163 "accessor_class_list.gperf" - {"raw", &grib_accessor_class_raw}, - {""}, {""}, -#line 202 "accessor_class_list.gperf" - {"uint64_little_endian", &grib_accessor_class_uint64_little_endian}, - {""}, -#line 200 "accessor_class_list.gperf" - {"uint32_little_endian", &grib_accessor_class_uint32_little_endian}, -#line 114 "accessor_class_list.gperf" - {"global_gaussian", &grib_accessor_class_global_gaussian}, - {""}, {""}, -#line 76 "accessor_class_list.gperf" - {"divdouble", &grib_accessor_class_divdouble}, - {""}, -#line 175 "accessor_class_list.gperf" - {"sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal}, -#line 99 "accessor_class_list.gperf" - {"g2_mars_labeling", &grib_accessor_class_g2_mars_labeling}, -#line 78 "accessor_class_list.gperf" - {"element", &grib_accessor_class_element}, -#line 160 "accessor_class_list.gperf" - {"padtomultiple", &grib_accessor_class_padtomultiple}, -#line 127 "accessor_class_list.gperf" - {"latitudes", &grib_accessor_class_latitudes}, -#line 164 "accessor_class_list.gperf" - {"rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date}, - {""}, {""}, {""}, -#line 194 "accessor_class_list.gperf" - {"to_string", &grib_accessor_class_to_string}, -#line 132 "accessor_class_list.gperf" - {"long", &grib_accessor_class_long}, -#line 19 "accessor_class_list.gperf" - {"bufr_data_array", &grib_accessor_class_bufr_data_array}, -#line 77 "accessor_class_list.gperf" - {"double", &grib_accessor_class_double}, -#line 20 "accessor_class_list.gperf" - {"bufr_data_element", &grib_accessor_class_bufr_data_element}, -#line 105 "accessor_class_list.gperf" - {"g2latlon", &grib_accessor_class_g2latlon}, - {""}, {""}, -#line 26 "accessor_class_list.gperf" - {"bufr_simple_thinning", &grib_accessor_class_bufr_simple_thinning}, - {""}, -#line 137 "accessor_class_list.gperf" - {"mars_step", &grib_accessor_class_mars_step}, - {""}, -#line 115 "accessor_class_list.gperf" - {"group", &grib_accessor_class_group}, - {""}, -#line 28 "accessor_class_list.gperf" - {"bufrdc_expanded_descriptors", &grib_accessor_class_bufrdc_expanded_descriptors}, -#line 161 "accessor_class_list.gperf" - {"position", &grib_accessor_class_position}, - {""}, {""}, {""}, -#line 17 "accessor_class_list.gperf" - {"blob", &grib_accessor_class_blob}, -#line 109 "accessor_class_list.gperf" - {"gaussian_grid_name", &grib_accessor_class_gaussian_grid_name}, -#line 197 "accessor_class_list.gperf" - {"trim", &grib_accessor_class_trim}, - {""}, {""}, -#line 119 "accessor_class_list.gperf" - {"ibmfloat", &grib_accessor_class_ibmfloat}, - {""}, {""}, #line 195 "accessor_class_list.gperf" {"transient", &grib_accessor_class_transient}, -#line 55 "accessor_class_list.gperf" - {"data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing}, - {""}, {""}, -#line 56 "accessor_class_list.gperf" - {"data_g1simple_packing", &grib_accessor_class_data_g1simple_packing}, -#line 49 "accessor_class_list.gperf" - {"data_g1complex_packing", &grib_accessor_class_data_g1complex_packing}, -#line 166 "accessor_class_list.gperf" - {"round", &grib_accessor_class_round}, -#line 196 "accessor_class_list.gperf" - {"transient_darray", &grib_accessor_class_transient_darray}, -#line 18 "accessor_class_list.gperf" - {"budgdate", &grib_accessor_class_budgdate}, -#line 210 "accessor_class_list.gperf" - {"values", &grib_accessor_class_values}, -#line 144 "accessor_class_list.gperf" - {"number_of_coded_values", &grib_accessor_class_number_of_coded_values}, -#line 126 "accessor_class_list.gperf" - {"label", &grib_accessor_class_label}, - {""}, {""}, -#line 38 "accessor_class_list.gperf" - {"concept", &grib_accessor_class_concept}, - {""}, -#line 183 "accessor_class_list.gperf" - {"spectral_truncation", &grib_accessor_class_spectral_truncation}, - {""}, {""}, -#line 83 "accessor_class_list.gperf" - {"g1_message_length", &grib_accessor_class_g1_message_length}, -#line 184 "accessor_class_list.gperf" - {"sprintf", &grib_accessor_class_sprintf}, -#line 190 "accessor_class_list.gperf" - {"suppressed", &grib_accessor_class_suppressed}, - {""}, -#line 213 "accessor_class_list.gperf" - {"when", &grib_accessor_class_when}, - {""}, {""}, #line 180 "accessor_class_list.gperf" {"smart_table", &grib_accessor_class_smart_table}, - {""}, -#line 39 "accessor_class_list.gperf" - {"constant", &grib_accessor_class_constant}, - {""}, {""}, -#line 162 "accessor_class_list.gperf" - {"proj_string", &grib_accessor_class_proj_string}, -#line 150 "accessor_class_list.gperf" - {"octet_number", &grib_accessor_class_octet_number}, -#line 181 "accessor_class_list.gperf" - {"smart_table_column", &grib_accessor_class_smart_table_column}, - {""}, -#line 135 "accessor_class_list.gperf" - {"lookup", &grib_accessor_class_lookup}, - {""}, -#line 94 "accessor_class_list.gperf" - {"g1step_range", &grib_accessor_class_g1step_range}, -#line 73 "accessor_class_list.gperf" - {"decimal_precision", &grib_accessor_class_decimal_precision}, - {""}, -#line 134 "accessor_class_list.gperf" - {"longitudes", &grib_accessor_class_longitudes}, -#line 70 "accessor_class_list.gperf" - {"data_sh_unpacked", &grib_accessor_class_data_sh_unpacked}, -#line 27 "accessor_class_list.gperf" - {"bufr_string_values", &grib_accessor_class_bufr_string_values}, -#line 198 "accessor_class_list.gperf" - {"uint16", &grib_accessor_class_uint16}, - {""}, {""}, -#line 71 "accessor_class_list.gperf" - {"data_shsimple_packing", &grib_accessor_class_data_shsimple_packing}, -#line 86 "accessor_class_list.gperf" - {"g1date", &grib_accessor_class_g1date}, - {""}, -#line 85 "accessor_class_list.gperf" - {"g1bitmap", &grib_accessor_class_g1bitmap}, - {""}, -#line 54 "accessor_class_list.gperf" - {"data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap}, -#line 192 "accessor_class_list.gperf" - {"to_double", &grib_accessor_class_to_double}, -#line 101 "accessor_class_list.gperf" - {"g2bitmap_present", &grib_accessor_class_g2bitmap_present}, -#line 120 "accessor_class_list.gperf" - {"ieeefloat", &grib_accessor_class_ieeefloat}, -#line 151 "accessor_class_list.gperf" - {"offset_file", &grib_accessor_class_offset_file}, -#line 208 "accessor_class_list.gperf" - {"validity_date", &grib_accessor_class_validity_date}, -#line 209 "accessor_class_list.gperf" - {"validity_time", &grib_accessor_class_validity_time}, - {""}, -#line 130 "accessor_class_list.gperf" - {"library_version", &grib_accessor_class_library_version}, -#line 212 "accessor_class_list.gperf" - {"vector", &grib_accessor_class_vector}, -#line 84 "accessor_class_list.gperf" - {"g1_section4_length", &grib_accessor_class_g1_section4_length}, -#line 141 "accessor_class_list.gperf" - {"multdouble", &grib_accessor_class_multdouble}, -#line 52 "accessor_class_list.gperf" - {"data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing}, - {""}, {""}, -#line 53 "accessor_class_list.gperf" - {"data_g1second_order_row_by_row_packing", &grib_accessor_class_data_g1second_order_row_by_row_packing}, - {""}, -#line 24 "accessor_class_list.gperf" - {"bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets}, -#line 159 "accessor_class_list.gperf" - {"padtoeven", &grib_accessor_class_padtoeven}, -#line 50 "accessor_class_list.gperf" - {"data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing}, - {""}, -#line 51 "accessor_class_list.gperf" - {"data_g1second_order_general_extended_packing", &grib_accessor_class_data_g1second_order_general_extended_packing}, -#line 22 "accessor_class_list.gperf" - {"bufr_extract_area_subsets", &grib_accessor_class_bufr_extract_area_subsets}, - {""}, {""}, {""}, -#line 23 "accessor_class_list.gperf" - {"bufr_extract_datetime_subsets", &grib_accessor_class_bufr_extract_datetime_subsets}, - {""}, -#line 21 "accessor_class_list.gperf" - {"bufr_elements_table", &grib_accessor_class_bufr_elements_table}, - {""}, {""}, {""}, {""}, -#line 154 "accessor_class_list.gperf" - {"pack_bufr_values", &grib_accessor_class_pack_bufr_values}, -#line 35 "accessor_class_list.gperf" - {"codetable", &grib_accessor_class_codetable}, -#line 131 "accessor_class_list.gperf" - {"local_definition", &grib_accessor_class_local_definition}, - {""}, -#line 25 "accessor_class_list.gperf" - {"bufr_group", &grib_accessor_class_bufr_group}, - {""}, -#line 88 "accessor_class_list.gperf" - {"g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly}, -#line 147 "accessor_class_list.gperf" - {"number_of_values", &grib_accessor_class_number_of_values}, - {""}, -#line 116 "accessor_class_list.gperf" - {"gts_header", &grib_accessor_class_gts_header}, - {""}, -#line 33 "accessor_class_list.gperf" - {"closest_date", &grib_accessor_class_closest_date}, -#line 153 "accessor_class_list.gperf" - {"optimal_step_units", &grib_accessor_class_optimal_step_units}, - {""}, -#line 211 "accessor_class_list.gperf" - {"variable", &grib_accessor_class_variable}, -#line 133 "accessor_class_list.gperf" - {"long_vector", &grib_accessor_class_long_vector}, -#line 168 "accessor_class_list.gperf" - {"scale_values", &grib_accessor_class_scale_values}, - {""}, {""}, {""}, -#line 128 "accessor_class_list.gperf" - {"latlon_increment", &grib_accessor_class_latlon_increment}, - {""}, {""}, {""}, -#line 148 "accessor_class_list.gperf" - {"number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing}, - {""}, -#line 79 "accessor_class_list.gperf" - {"evaluate", &grib_accessor_class_evaluate}, - {""}, {""}, {""}, {""}, {""}, -#line 152 "accessor_class_list.gperf" - {"offset_values", &grib_accessor_class_offset_values}, -#line 69 "accessor_class_list.gperf" - {"data_sh_packed", &grib_accessor_class_data_sh_packed}, -#line 11 "accessor_class_list.gperf" - {"abstract_vector", &grib_accessor_class_abstract_vector}, -#line 118 "accessor_class_list.gperf" - {"headers_only", &grib_accessor_class_headers_only}, -#line 125 "accessor_class_list.gperf" - {"ksec1expver", &grib_accessor_class_ksec1expver}, - {""}, {""}, -#line 41 "accessor_class_list.gperf" - {"count_missing", &grib_accessor_class_count_missing}, -#line 205 "accessor_class_list.gperf" - {"unpack_bufr_values", &grib_accessor_class_unpack_bufr_values}, - {""}, {""}, -#line 121 "accessor_class_list.gperf" - {"ifs_param", &grib_accessor_class_ifs_param}, - {""}, {""}, {""}, -#line 36 "accessor_class_list.gperf" - {"codetable_title", &grib_accessor_class_codetable_title}, - {""}, {""}, {""}, -#line 89 "accessor_class_list.gperf" - {"g1fcperiod", &grib_accessor_class_g1fcperiod}, -#line 34 "accessor_class_list.gperf" - {"codeflag", &grib_accessor_class_codeflag}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 106 "accessor_class_list.gperf" - {"g2level", &grib_accessor_class_g2level}, -#line 42 "accessor_class_list.gperf" - {"count_total", &grib_accessor_class_count_total}, - {""}, -#line 117 "accessor_class_list.gperf" - {"hash_array", &grib_accessor_class_hash_array}, - {""}, {""}, -#line 37 "accessor_class_list.gperf" - {"codetable_units", &grib_accessor_class_codetable_units}, - {""}, {""}, -#line 129 "accessor_class_list.gperf" - {"latlonvalues", &grib_accessor_class_latlonvalues}, - {""}, {""}, {""}, {""}, -#line 30 "accessor_class_list.gperf" - {"change_alternative_row_scanning", &grib_accessor_class_change_alternative_row_scanning}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 31 "accessor_class_list.gperf" - {"change_scanning_direction", &grib_accessor_class_change_scanning_direction}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 149 "accessor_class_list.gperf" - {"octahedral_gaussian", &grib_accessor_class_octahedral_gaussian}, -#line 10 "accessor_class_list.gperf" - {"abstract_long_vector", &grib_accessor_class_abstract_long_vector}, - {""}, {""}, {""}, -#line 40 "accessor_class_list.gperf" - {"count_file", &grib_accessor_class_count_file}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 91 "accessor_class_list.gperf" - {"g1monthlydate", &grib_accessor_class_g1monthlydate}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 82 "accessor_class_list.gperf" - {"g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag}, - {""}, -#line 81 "accessor_class_list.gperf" - {"from_scale_factor_scaled_value", &grib_accessor_class_from_scale_factor_scaled_value}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 32 "accessor_class_list.gperf" - {"check_internal_version", &grib_accessor_class_check_internal_version}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, -#line 97 "accessor_class_list.gperf" - {"g2_chemical", &grib_accessor_class_g2_chemical}, -#line 87 "accessor_class_list.gperf" - {"g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date}, - {""}, {""}, {""}, {""}, {""}, -#line 165 "accessor_class_list.gperf" - {"reference_value_error", &grib_accessor_class_reference_value_error}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 93 "accessor_class_list.gperf" - {"g1number_of_coded_values_sh_simple", &grib_accessor_class_g1number_of_coded_values_sh_simple}, -#line 92 "accessor_class_list.gperf" - {"g1number_of_coded_values_sh_complex", &grib_accessor_class_g1number_of_coded_values_sh_complex}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, -#line 90 "accessor_class_list.gperf" - {"g1forecastmonth", &grib_accessor_class_g1forecastmonth}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 95 "accessor_class_list.gperf" - {"g1verificationdate", &grib_accessor_class_g1verificationdate} +#line 122 "accessor_class_list.gperf" + {"iterator", &grib_accessor_class_iterator} }; -static const struct accessor_class_hash* grib_accessor_classes_hash(const char *str, size_t len) +const struct accessor_class_hash * +grib_accessor_classes_hash (const char *str, size_t len) +{ + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { unsigned int key = grib_accessor_classes_get_id (str, len); -#ifdef DEBUG + if (key <= MAX_HASH_VALUE) { - const char *s; - Assert( len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH ); - Assert( key <= MAX_HASH_VALUE ); - s = classes[key].name; - Assert( *str == *s && strcmp(str + 1, s + 1)==0 ); - } -#endif + const char *s = classes[key].name; + if (*str == *s && !strcmp (str + 1, s + 1)) return &classes[key]; + } + } + return 0; } diff --git a/src/grib_accessor_factory.h b/src/grib_accessor_factory.h index 2f889a0c6..644d2e89b 100644 --- a/src/grib_accessor_factory.h +++ b/src/grib_accessor_factory.h @@ -1,205 +1,205 @@ /* This file is automatically generated by ./make_class.pl, do not edit */ -{ "abstract_long_vector", &grib_accessor_class_abstract_long_vector, }, -{ "abstract_vector", &grib_accessor_class_abstract_vector, }, -{ "ascii", &grib_accessor_class_ascii, }, -{ "bit", &grib_accessor_class_bit, }, -{ "bitmap", &grib_accessor_class_bitmap, }, -{ "bits", &grib_accessor_class_bits, }, -{ "bits_per_value", &grib_accessor_class_bits_per_value, }, -{ "blob", &grib_accessor_class_blob, }, -{ "budgdate", &grib_accessor_class_budgdate, }, -{ "bufr_data_array", &grib_accessor_class_bufr_data_array, }, -{ "bufr_data_element", &grib_accessor_class_bufr_data_element, }, -{ "bufr_elements_table", &grib_accessor_class_bufr_elements_table, }, -{ "bufr_extract_area_subsets", &grib_accessor_class_bufr_extract_area_subsets, }, -{ "bufr_extract_datetime_subsets", &grib_accessor_class_bufr_extract_datetime_subsets, }, -{ "bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets, }, -{ "bufr_group", &grib_accessor_class_bufr_group, }, -{ "bufr_simple_thinning", &grib_accessor_class_bufr_simple_thinning, }, -{ "bufr_string_values", &grib_accessor_class_bufr_string_values, }, -{ "bufrdc_expanded_descriptors", &grib_accessor_class_bufrdc_expanded_descriptors, }, -{ "bytes", &grib_accessor_class_bytes, }, -{ "change_alternative_row_scanning", &grib_accessor_class_change_alternative_row_scanning, }, -{ "change_scanning_direction", &grib_accessor_class_change_scanning_direction, }, -{ "check_internal_version", &grib_accessor_class_check_internal_version, }, -{ "closest_date", &grib_accessor_class_closest_date, }, -{ "codeflag", &grib_accessor_class_codeflag, }, +//{ "abstract_long_vector", &grib_accessor_class_abstract_long_vector, }, +//{ "abstract_vector", &grib_accessor_class_abstract_vector, }, +//{ "ascii", &grib_accessor_class_ascii, }, +//{ "bit", &grib_accessor_class_bit, }, +//{ "bitmap", &grib_accessor_class_bitmap, }, +//{ "bits", &grib_accessor_class_bits, }, +//{ "bits_per_value", &grib_accessor_class_bits_per_value, }, +//{ "blob", &grib_accessor_class_blob, }, +//{ "budgdate", &grib_accessor_class_budgdate, }, +//{ "bufr_data_array", &grib_accessor_class_bufr_data_array, }, +//{ "bufr_data_element", &grib_accessor_class_bufr_data_element, }, +//{ "bufr_elements_table", &grib_accessor_class_bufr_elements_table, }, +//{ "bufr_extract_area_subsets", &grib_accessor_class_bufr_extract_area_subsets, }, +//{ "bufr_extract_datetime_subsets", &grib_accessor_class_bufr_extract_datetime_subsets, }, +//{ "bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets, }, +//{ "bufr_group", &grib_accessor_class_bufr_group, }, +//{ "bufr_simple_thinning", &grib_accessor_class_bufr_simple_thinning, }, +//{ "bufr_string_values", &grib_accessor_class_bufr_string_values, }, +//{ "bufrdc_expanded_descriptors", &grib_accessor_class_bufrdc_expanded_descriptors, }, +//{ "bytes", &grib_accessor_class_bytes, }, +//{ "change_alternative_row_scanning", &grib_accessor_class_change_alternative_row_scanning, }, +//{ "change_scanning_direction", &grib_accessor_class_change_scanning_direction, }, +//{ "check_internal_version", &grib_accessor_class_check_internal_version, }, +//{ "closest_date", &grib_accessor_class_closest_date, }, +//{ "codeflag", &grib_accessor_class_codeflag, }, { "codetable", &grib_accessor_class_codetable, }, -{ "codetable_title", &grib_accessor_class_codetable_title, }, -{ "codetable_units", &grib_accessor_class_codetable_units, }, -{ "concept", &grib_accessor_class_concept, }, +//{ "codetable_title", &grib_accessor_class_codetable_title, }, +//{ "codetable_units", &grib_accessor_class_codetable_units, }, +//{ "concept", &grib_accessor_class_concept, }, { "constant", &grib_accessor_class_constant, }, -{ "count_file", &grib_accessor_class_count_file, }, -{ "count_missing", &grib_accessor_class_count_missing, }, -{ "count_total", &grib_accessor_class_count_total, }, -{ "data_apply_bitmap", &grib_accessor_class_data_apply_bitmap, }, -{ "data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic, }, -{ "data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap, }, -{ "data_ccsds_packing", &grib_accessor_class_data_ccsds_packing, }, -{ "data_complex_packing", &grib_accessor_class_data_complex_packing, }, -{ "data_dummy_field", &grib_accessor_class_data_dummy_field, }, -{ "data_g1complex_packing", &grib_accessor_class_data_g1complex_packing, }, -{ "data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing, }, -{ "data_g1second_order_general_extended_packing", &grib_accessor_class_data_g1second_order_general_extended_packing, }, -{ "data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing, }, -{ "data_g1second_order_row_by_row_packing", &grib_accessor_class_data_g1second_order_row_by_row_packing, }, -{ "data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap, }, -{ "data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing, }, -{ "data_g1simple_packing", &grib_accessor_class_data_g1simple_packing, }, -{ "data_g22order_packing", &grib_accessor_class_data_g22order_packing, }, -{ "data_g2bifourier_packing", &grib_accessor_class_data_g2bifourier_packing, }, -{ "data_g2complex_packing", &grib_accessor_class_data_g2complex_packing, }, -{ "data_g2secondary_bitmap", &grib_accessor_class_data_g2secondary_bitmap, }, -{ "data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing, }, -{ "data_g2simple_packing", &grib_accessor_class_data_g2simple_packing, }, -{ "data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing, }, -{ "data_jpeg2000_packing", &grib_accessor_class_data_jpeg2000_packing, }, -{ "data_png_packing", &grib_accessor_class_data_png_packing, }, -{ "data_raw_packing", &grib_accessor_class_data_raw_packing, }, -{ "data_run_length_packing", &grib_accessor_class_data_run_length_packing, }, -{ "data_secondary_bitmap", &grib_accessor_class_data_secondary_bitmap, }, -{ "data_sh_packed", &grib_accessor_class_data_sh_packed, }, -{ "data_sh_unpacked", &grib_accessor_class_data_sh_unpacked, }, -{ "data_shsimple_packing", &grib_accessor_class_data_shsimple_packing, }, -{ "data_simple_packing", &grib_accessor_class_data_simple_packing, }, -{ "decimal_precision", &grib_accessor_class_decimal_precision, }, -{ "dictionary", &grib_accessor_class_dictionary, }, -{ "dirty", &grib_accessor_class_dirty, }, -{ "divdouble", &grib_accessor_class_divdouble, }, -{ "double", &grib_accessor_class_double, }, -{ "element", &grib_accessor_class_element, }, -{ "evaluate", &grib_accessor_class_evaluate, }, -{ "expanded_descriptors", &grib_accessor_class_expanded_descriptors, }, -{ "from_scale_factor_scaled_value", &grib_accessor_class_from_scale_factor_scaled_value, }, -{ "g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag, }, -{ "g1_message_length", &grib_accessor_class_g1_message_length, }, -{ "g1_section4_length", &grib_accessor_class_g1_section4_length, }, -{ "g1bitmap", &grib_accessor_class_g1bitmap, }, -{ "g1date", &grib_accessor_class_g1date, }, -{ "g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date, }, -{ "g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly, }, -{ "g1fcperiod", &grib_accessor_class_g1fcperiod, }, -{ "g1forecastmonth", &grib_accessor_class_g1forecastmonth, }, -{ "g1monthlydate", &grib_accessor_class_g1monthlydate, }, -{ "g1number_of_coded_values_sh_complex", &grib_accessor_class_g1number_of_coded_values_sh_complex, }, -{ "g1number_of_coded_values_sh_simple", &grib_accessor_class_g1number_of_coded_values_sh_simple, }, -{ "g1step_range", &grib_accessor_class_g1step_range, }, -{ "g1verificationdate", &grib_accessor_class_g1verificationdate, }, -{ "g2_aerosol", &grib_accessor_class_g2_aerosol, }, -{ "g2_chemical", &grib_accessor_class_g2_chemical, }, -{ "g2_eps", &grib_accessor_class_g2_eps, }, -{ "g2_mars_labeling", &grib_accessor_class_g2_mars_labeling, }, -{ "g2bitmap", &grib_accessor_class_g2bitmap, }, -{ "g2bitmap_present", &grib_accessor_class_g2bitmap_present, }, -{ "g2date", &grib_accessor_class_g2date, }, -{ "g2end_step", &grib_accessor_class_g2end_step, }, -{ "g2grid", &grib_accessor_class_g2grid, }, -{ "g2latlon", &grib_accessor_class_g2latlon, }, -{ "g2level", &grib_accessor_class_g2level, }, -{ "g2lon", &grib_accessor_class_g2lon, }, -{ "g2step_range", &grib_accessor_class_g2step_range, }, -{ "gaussian_grid_name", &grib_accessor_class_gaussian_grid_name, }, -{ "gds_is_present", &grib_accessor_class_gds_is_present, }, -{ "gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap, }, -{ "gen", &grib_accessor_class_gen, }, -{ "getenv", &grib_accessor_class_getenv, }, -{ "global_gaussian", &grib_accessor_class_global_gaussian, }, -{ "group", &grib_accessor_class_group, }, -{ "gts_header", &grib_accessor_class_gts_header, }, -{ "hash_array", &grib_accessor_class_hash_array, }, -{ "headers_only", &grib_accessor_class_headers_only, }, -{ "ibmfloat", &grib_accessor_class_ibmfloat, }, -{ "ieeefloat", &grib_accessor_class_ieeefloat, }, -{ "ifs_param", &grib_accessor_class_ifs_param, }, +//{ "count_file", &grib_accessor_class_count_file, }, +//{ "count_missing", &grib_accessor_class_count_missing, }, +//{ "count_total", &grib_accessor_class_count_total, }, +//{ "data_apply_bitmap", &grib_accessor_class_data_apply_bitmap, }, +//{ "data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic, }, +//{ "data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap, }, +//{ "data_ccsds_packing", &grib_accessor_class_data_ccsds_packing, }, +//{ "data_complex_packing", &grib_accessor_class_data_complex_packing, }, +//{ "data_dummy_field", &grib_accessor_class_data_dummy_field, }, +//{ "data_g1complex_packing", &grib_accessor_class_data_g1complex_packing, }, +//{ "data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing, }, +//{ "data_g1second_order_general_extended_packing", &grib_accessor_class_data_g1second_order_general_extended_packing, }, +//{ "data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing, }, +//{ "data_g1second_order_row_by_row_packing", &grib_accessor_class_data_g1second_order_row_by_row_packing, }, +//{ "data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap, }, +//{ "data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing, }, +//{ "data_g1simple_packing", &grib_accessor_class_data_g1simple_packing, }, +//{ "data_g22order_packing", &grib_accessor_class_data_g22order_packing, }, +//{ "data_g2bifourier_packing", &grib_accessor_class_data_g2bifourier_packing, }, +//{ "data_g2complex_packing", &grib_accessor_class_data_g2complex_packing, }, +//{ "data_g2secondary_bitmap", &grib_accessor_class_data_g2secondary_bitmap, }, +//{ "data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing, }, +//{ "data_g2simple_packing", &grib_accessor_class_data_g2simple_packing, }, +//{ "data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing, }, +//{ "data_jpeg2000_packing", &grib_accessor_class_data_jpeg2000_packing, }, +//{ "data_png_packing", &grib_accessor_class_data_png_packing, }, +//{ "data_raw_packing", &grib_accessor_class_data_raw_packing, }, +//{ "data_run_length_packing", &grib_accessor_class_data_run_length_packing, }, +//{ "data_secondary_bitmap", &grib_accessor_class_data_secondary_bitmap, }, +//{ "data_sh_packed", &grib_accessor_class_data_sh_packed, }, +//{ "data_sh_unpacked", &grib_accessor_class_data_sh_unpacked, }, +//{ "data_shsimple_packing", &grib_accessor_class_data_shsimple_packing, }, +//{ "data_simple_packing", &grib_accessor_class_data_simple_packing, }, +//{ "decimal_precision", &grib_accessor_class_decimal_precision, }, +//{ "dictionary", &grib_accessor_class_dictionary, }, +//{ "dirty", &grib_accessor_class_dirty, }, +//{ "divdouble", &grib_accessor_class_divdouble, }, +//{ "double", &grib_accessor_class_double, }, +//{ "element", &grib_accessor_class_element, }, +//{ "evaluate", &grib_accessor_class_evaluate, }, +//{ "expanded_descriptors", &grib_accessor_class_expanded_descriptors, }, +//{ "from_scale_factor_scaled_value", &grib_accessor_class_from_scale_factor_scaled_value, }, +//{ "g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag, }, +//{ "g1_message_length", &grib_accessor_class_g1_message_length, }, +//{ "g1_section4_length", &grib_accessor_class_g1_section4_length, }, +//{ "g1bitmap", &grib_accessor_class_g1bitmap, }, +//{ "g1date", &grib_accessor_class_g1date, }, +//{ "g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date, }, +//{ "g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly, }, +//{ "g1fcperiod", &grib_accessor_class_g1fcperiod, }, +//{ "g1forecastmonth", &grib_accessor_class_g1forecastmonth, }, +//{ "g1monthlydate", &grib_accessor_class_g1monthlydate, }, +//{ "g1number_of_coded_values_sh_complex", &grib_accessor_class_g1number_of_coded_values_sh_complex, }, +//{ "g1number_of_coded_values_sh_simple", &grib_accessor_class_g1number_of_coded_values_sh_simple, }, +//{ "g1step_range", &grib_accessor_class_g1step_range, }, +//{ "g1verificationdate", &grib_accessor_class_g1verificationdate, }, +//{ "g2_aerosol", &grib_accessor_class_g2_aerosol, }, +//{ "g2_chemical", &grib_accessor_class_g2_chemical, }, +//{ "g2_eps", &grib_accessor_class_g2_eps, }, +//{ "g2_mars_labeling", &grib_accessor_class_g2_mars_labeling, }, +//{ "g2bitmap", &grib_accessor_class_g2bitmap, }, +//{ "g2bitmap_present", &grib_accessor_class_g2bitmap_present, }, +//{ "g2date", &grib_accessor_class_g2date, }, +//{ "g2end_step", &grib_accessor_class_g2end_step, }, +//{ "g2grid", &grib_accessor_class_g2grid, }, +//{ "g2latlon", &grib_accessor_class_g2latlon, }, +//{ "g2level", &grib_accessor_class_g2level, }, +//{ "g2lon", &grib_accessor_class_g2lon, }, +//{ "g2step_range", &grib_accessor_class_g2step_range, }, +//{ "gaussian_grid_name", &grib_accessor_class_gaussian_grid_name, }, +//{ "gds_is_present", &grib_accessor_class_gds_is_present, }, +//{ "gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap, }, +//{ "gen", &grib_accessor_class_gen, }, +//{ "getenv", &grib_accessor_class_getenv, }, +//{ "global_gaussian", &grib_accessor_class_global_gaussian, }, +//{ "group", &grib_accessor_class_group, }, +//{ "gts_header", &grib_accessor_class_gts_header, }, +//{ "hash_array", &grib_accessor_class_hash_array, }, +//{ "headers_only", &grib_accessor_class_headers_only, }, +//{ "ibmfloat", &grib_accessor_class_ibmfloat, }, +//{ "ieeefloat", &grib_accessor_class_ieeefloat, }, +//{ "ifs_param", &grib_accessor_class_ifs_param, }, { "iterator", &grib_accessor_class_iterator, }, -{ "julian_date", &grib_accessor_class_julian_date, }, -{ "julian_day", &grib_accessor_class_julian_day, }, -{ "ksec1expver", &grib_accessor_class_ksec1expver, }, -{ "label", &grib_accessor_class_label, }, -{ "latitudes", &grib_accessor_class_latitudes, }, -{ "latlon_increment", &grib_accessor_class_latlon_increment, }, -{ "latlonvalues", &grib_accessor_class_latlonvalues, }, -{ "library_version", &grib_accessor_class_library_version, }, -{ "local_definition", &grib_accessor_class_local_definition, }, +//{ "julian_date", &grib_accessor_class_julian_date, }, +//{ "julian_day", &grib_accessor_class_julian_day, }, +//{ "ksec1expver", &grib_accessor_class_ksec1expver, }, +//{ "label", &grib_accessor_class_label, }, +//{ "latitudes", &grib_accessor_class_latitudes, }, +//{ "latlon_increment", &grib_accessor_class_latlon_increment, }, +//{ "latlonvalues", &grib_accessor_class_latlonvalues, }, +//{ "library_version", &grib_accessor_class_library_version, }, +//{ "local_definition", &grib_accessor_class_local_definition, }, { "long", &grib_accessor_class_long, }, -{ "long_vector", &grib_accessor_class_long_vector, }, -{ "longitudes", &grib_accessor_class_longitudes, }, -{ "lookup", &grib_accessor_class_lookup, }, -{ "mars_param", &grib_accessor_class_mars_param, }, -{ "mars_step", &grib_accessor_class_mars_step, }, -{ "md5", &grib_accessor_class_md5, }, -{ "message", &grib_accessor_class_message, }, -{ "message_copy", &grib_accessor_class_message_copy, }, -{ "multdouble", &grib_accessor_class_multdouble, }, +//{ "long_vector", &grib_accessor_class_long_vector, }, +//{ "longitudes", &grib_accessor_class_longitudes, }, +//{ "lookup", &grib_accessor_class_lookup, }, +//{ "mars_param", &grib_accessor_class_mars_param, }, +//{ "mars_step", &grib_accessor_class_mars_step, }, +//{ "md5", &grib_accessor_class_md5, }, +//{ "message", &grib_accessor_class_message, }, +//{ "message_copy", &grib_accessor_class_message_copy, }, +//{ "multdouble", &grib_accessor_class_multdouble, }, { "nearest", &grib_accessor_class_nearest, }, -{ "non_alpha", &grib_accessor_class_non_alpha, }, -{ "number_of_coded_values", &grib_accessor_class_number_of_coded_values, }, -{ "number_of_points", &grib_accessor_class_number_of_points, }, -{ "number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian, }, -{ "number_of_values", &grib_accessor_class_number_of_values, }, -{ "number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing, }, -{ "octahedral_gaussian", &grib_accessor_class_octahedral_gaussian, }, -{ "octet_number", &grib_accessor_class_octet_number, }, -{ "offset_file", &grib_accessor_class_offset_file, }, -{ "offset_values", &grib_accessor_class_offset_values, }, -{ "optimal_step_units", &grib_accessor_class_optimal_step_units, }, -{ "pack_bufr_values", &grib_accessor_class_pack_bufr_values, }, -{ "packing_type", &grib_accessor_class_packing_type, }, -{ "pad", &grib_accessor_class_pad, }, -{ "padding", &grib_accessor_class_padding, }, -{ "padto", &grib_accessor_class_padto, }, -{ "padtoeven", &grib_accessor_class_padtoeven, }, -{ "padtomultiple", &grib_accessor_class_padtomultiple, }, -{ "position", &grib_accessor_class_position, }, -{ "proj_string", &grib_accessor_class_proj_string, }, -{ "raw", &grib_accessor_class_raw, }, -{ "rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date, }, -{ "reference_value_error", &grib_accessor_class_reference_value_error, }, -{ "round", &grib_accessor_class_round, }, -{ "scale", &grib_accessor_class_scale, }, -{ "scale_values", &grib_accessor_class_scale_values, }, -{ "second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value, }, -{ "section", &grib_accessor_class_section, }, -{ "section_length", &grib_accessor_class_section_length, }, -{ "section_padding", &grib_accessor_class_section_padding, }, -{ "section_pointer", &grib_accessor_class_section_pointer, }, -{ "select_step_template", &grib_accessor_class_select_step_template, }, -{ "sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal, }, -{ "signed", &grib_accessor_class_signed, }, -{ "signed_bits", &grib_accessor_class_signed_bits, }, -{ "simple_packing_error", &grib_accessor_class_simple_packing_error, }, -{ "size", &grib_accessor_class_size, }, +//{ "non_alpha", &grib_accessor_class_non_alpha, }, +//{ "number_of_coded_values", &grib_accessor_class_number_of_coded_values, }, +//{ "number_of_points", &grib_accessor_class_number_of_points, }, +//{ "number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian, }, +//{ "number_of_values", &grib_accessor_class_number_of_values, }, +//{ "number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing, }, +//{ "octahedral_gaussian", &grib_accessor_class_octahedral_gaussian, }, +//{ "octet_number", &grib_accessor_class_octet_number, }, +//{ "offset_file", &grib_accessor_class_offset_file, }, +//{ "offset_values", &grib_accessor_class_offset_values, }, +//{ "optimal_step_units", &grib_accessor_class_optimal_step_units, }, +//{ "pack_bufr_values", &grib_accessor_class_pack_bufr_values, }, +//{ "packing_type", &grib_accessor_class_packing_type, }, +//{ "pad", &grib_accessor_class_pad, }, +//{ "padding", &grib_accessor_class_padding, }, +//{ "padto", &grib_accessor_class_padto, }, +//{ "padtoeven", &grib_accessor_class_padtoeven, }, +//{ "padtomultiple", &grib_accessor_class_padtomultiple, }, +//{ "position", &grib_accessor_class_position, }, +//{ "proj_string", &grib_accessor_class_proj_string, }, +//{ "raw", &grib_accessor_class_raw, }, +//{ "rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date, }, +//{ "reference_value_error", &grib_accessor_class_reference_value_error, }, +//{ "round", &grib_accessor_class_round, }, +//{ "scale", &grib_accessor_class_scale, }, +//{ "scale_values", &grib_accessor_class_scale_values, }, +//{ "second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value, }, +//{ "section", &grib_accessor_class_section, }, +//{ "section_length", &grib_accessor_class_section_length, }, +//{ "section_padding", &grib_accessor_class_section_padding, }, +//{ "section_pointer", &grib_accessor_class_section_pointer, }, +//{ "select_step_template", &grib_accessor_class_select_step_template, }, +//{ "sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal, }, +//{ "signed", &grib_accessor_class_signed, }, +//{ "signed_bits", &grib_accessor_class_signed_bits, }, +//{ "simple_packing_error", &grib_accessor_class_simple_packing_error, }, +//{ "size", &grib_accessor_class_size, }, { "smart_table", &grib_accessor_class_smart_table, }, -{ "smart_table_column", &grib_accessor_class_smart_table_column, }, -{ "spd", &grib_accessor_class_spd, }, -{ "spectral_truncation", &grib_accessor_class_spectral_truncation, }, -{ "sprintf", &grib_accessor_class_sprintf, }, -{ "statistics", &grib_accessor_class_statistics, }, -{ "statistics_spectral", &grib_accessor_class_statistics_spectral, }, -{ "step_human_readable", &grib_accessor_class_step_human_readable, }, -{ "step_in_units", &grib_accessor_class_step_in_units, }, -{ "sum", &grib_accessor_class_sum, }, -{ "suppressed", &grib_accessor_class_suppressed, }, -{ "time", &grib_accessor_class_time, }, -{ "to_double", &grib_accessor_class_to_double, }, -{ "to_integer", &grib_accessor_class_to_integer, }, -{ "to_string", &grib_accessor_class_to_string, }, +//{ "smart_table_column", &grib_accessor_class_smart_table_column, }, +//{ "spd", &grib_accessor_class_spd, }, +//{ "spectral_truncation", &grib_accessor_class_spectral_truncation, }, +//{ "sprintf", &grib_accessor_class_sprintf, }, +//{ "statistics", &grib_accessor_class_statistics, }, +//{ "statistics_spectral", &grib_accessor_class_statistics_spectral, }, +//{ "step_human_readable", &grib_accessor_class_step_human_readable, }, +//{ "step_in_units", &grib_accessor_class_step_in_units, }, +//{ "sum", &grib_accessor_class_sum, }, +//{ "suppressed", &grib_accessor_class_suppressed, }, +//{ "time", &grib_accessor_class_time, }, +//{ "to_double", &grib_accessor_class_to_double, }, +//{ "to_integer", &grib_accessor_class_to_integer, }, +//{ "to_string", &grib_accessor_class_to_string, }, { "transient", &grib_accessor_class_transient, }, -{ "transient_darray", &grib_accessor_class_transient_darray, }, -{ "trim", &grib_accessor_class_trim, }, -{ "uint16", &grib_accessor_class_uint16, }, -{ "uint32", &grib_accessor_class_uint32, }, -{ "uint32_little_endian", &grib_accessor_class_uint32_little_endian, }, -{ "uint64", &grib_accessor_class_uint64, }, -{ "uint64_little_endian", &grib_accessor_class_uint64_little_endian, }, -{ "uint8", &grib_accessor_class_uint8, }, -{ "unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors, }, -{ "unpack_bufr_values", &grib_accessor_class_unpack_bufr_values, }, +//{ "transient_darray", &grib_accessor_class_transient_darray, }, +//{ "trim", &grib_accessor_class_trim, }, +//{ "uint16", &grib_accessor_class_uint16, }, +//{ "uint32", &grib_accessor_class_uint32, }, +//{ "uint32_little_endian", &grib_accessor_class_uint32_little_endian, }, +//{ "uint64", &grib_accessor_class_uint64, }, +//{ "uint64_little_endian", &grib_accessor_class_uint64_little_endian, }, +//{ "uint8", &grib_accessor_class_uint8, }, +//{ "unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors, }, +//{ "unpack_bufr_values", &grib_accessor_class_unpack_bufr_values, }, { "unsigned", &grib_accessor_class_unsigned, }, -{ "unsigned_bits", &grib_accessor_class_unsigned_bits, }, -{ "validity_date", &grib_accessor_class_validity_date, }, -{ "validity_time", &grib_accessor_class_validity_time, }, -{ "values", &grib_accessor_class_values, }, +//{ "unsigned_bits", &grib_accessor_class_unsigned_bits, }, +//{ "validity_date", &grib_accessor_class_validity_date, }, +//{ "validity_time", &grib_accessor_class_validity_time, }, +//{ "values", &grib_accessor_class_values, }, { "variable", &grib_accessor_class_variable, }, -{ "vector", &grib_accessor_class_vector, }, -{ "when", &grib_accessor_class_when, }, +//{ "vector", &grib_accessor_class_vector, }, +//{ "when", &grib_accessor_class_when, }, diff --git a/src/grib_accessor_factory_hash_list b/src/grib_accessor_factory_hash_list index 1f7687f38..136aedc43 100644 --- a/src/grib_accessor_factory_hash_list +++ b/src/grib_accessor_factory_hash_list @@ -1,206 +1,206 @@ /* This file is automatically generated by ./make_class.pl, do not edit */ -abstract_long_vector, &grib_accessor_class_abstract_long_vector -abstract_vector, &grib_accessor_class_abstract_vector -ascii, &grib_accessor_class_ascii -bit, &grib_accessor_class_bit -bitmap, &grib_accessor_class_bitmap -bits, &grib_accessor_class_bits -bits_per_value, &grib_accessor_class_bits_per_value -blob, &grib_accessor_class_blob -budgdate, &grib_accessor_class_budgdate -bufr_data_array, &grib_accessor_class_bufr_data_array -bufr_data_element, &grib_accessor_class_bufr_data_element -bufr_elements_table, &grib_accessor_class_bufr_elements_table -bufr_extract_area_subsets, &grib_accessor_class_bufr_extract_area_subsets -bufr_extract_datetime_subsets, &grib_accessor_class_bufr_extract_datetime_subsets -bufr_extract_subsets, &grib_accessor_class_bufr_extract_subsets -bufr_group, &grib_accessor_class_bufr_group -bufr_simple_thinning, &grib_accessor_class_bufr_simple_thinning -bufr_string_values, &grib_accessor_class_bufr_string_values -bufrdc_expanded_descriptors, &grib_accessor_class_bufrdc_expanded_descriptors -bytes, &grib_accessor_class_bytes -change_alternative_row_scanning, &grib_accessor_class_change_alternative_row_scanning -change_scanning_direction, &grib_accessor_class_change_scanning_direction -check_internal_version, &grib_accessor_class_check_internal_version -closest_date, &grib_accessor_class_closest_date -codeflag, &grib_accessor_class_codeflag +#abstract_long_vector, &grib_accessor_class_abstract_long_vector +#abstract_vector, &grib_accessor_class_abstract_vector +#ascii, &grib_accessor_class_ascii +#bit, &grib_accessor_class_bit +#bitmap, &grib_accessor_class_bitmap +#bits, &grib_accessor_class_bits +#bits_per_value, &grib_accessor_class_bits_per_value +#blob, &grib_accessor_class_blob +#budgdate, &grib_accessor_class_budgdate +#bufr_data_array, &grib_accessor_class_bufr_data_array +#bufr_data_element, &grib_accessor_class_bufr_data_element +#bufr_elements_table, &grib_accessor_class_bufr_elements_table +#bufr_extract_area_subsets, &grib_accessor_class_bufr_extract_area_subsets +#bufr_extract_datetime_subsets, &grib_accessor_class_bufr_extract_datetime_subsets +#bufr_extract_subsets, &grib_accessor_class_bufr_extract_subsets +#bufr_group, &grib_accessor_class_bufr_group +#bufr_simple_thinning, &grib_accessor_class_bufr_simple_thinning +#bufr_string_values, &grib_accessor_class_bufr_string_values +#bufrdc_expanded_descriptors, &grib_accessor_class_bufrdc_expanded_descriptors +#bytes, &grib_accessor_class_bytes +#change_alternative_row_scanning, &grib_accessor_class_change_alternative_row_scanning +#change_scanning_direction, &grib_accessor_class_change_scanning_direction +#check_internal_version, &grib_accessor_class_check_internal_version +#closest_date, &grib_accessor_class_closest_date +#codeflag, &grib_accessor_class_codeflag codetable, &grib_accessor_class_codetable -codetable_title, &grib_accessor_class_codetable_title -codetable_units, &grib_accessor_class_codetable_units -concept, &grib_accessor_class_concept +#codetable_title, &grib_accessor_class_codetable_title +#codetable_units, &grib_accessor_class_codetable_units +#concept, &grib_accessor_class_concept constant, &grib_accessor_class_constant -count_file, &grib_accessor_class_count_file -count_missing, &grib_accessor_class_count_missing -count_total, &grib_accessor_class_count_total -data_apply_bitmap, &grib_accessor_class_data_apply_bitmap -data_apply_boustrophedonic, &grib_accessor_class_data_apply_boustrophedonic -data_apply_boustrophedonic_bitmap, &grib_accessor_class_data_apply_boustrophedonic_bitmap -data_ccsds_packing, &grib_accessor_class_data_ccsds_packing -data_complex_packing, &grib_accessor_class_data_complex_packing -data_dummy_field, &grib_accessor_class_data_dummy_field -data_g1complex_packing, &grib_accessor_class_data_g1complex_packing -data_g1second_order_constant_width_packing, &grib_accessor_class_data_g1second_order_constant_width_packing -data_g1second_order_general_extended_packing, &grib_accessor_class_data_g1second_order_general_extended_packing -data_g1second_order_general_packing, &grib_accessor_class_data_g1second_order_general_packing -data_g1second_order_row_by_row_packing, &grib_accessor_class_data_g1second_order_row_by_row_packing -data_g1secondary_bitmap, &grib_accessor_class_data_g1secondary_bitmap -data_g1shsimple_packing, &grib_accessor_class_data_g1shsimple_packing -data_g1simple_packing, &grib_accessor_class_data_g1simple_packing -data_g22order_packing, &grib_accessor_class_data_g22order_packing -data_g2bifourier_packing, &grib_accessor_class_data_g2bifourier_packing -data_g2complex_packing, &grib_accessor_class_data_g2complex_packing -data_g2secondary_bitmap, &grib_accessor_class_data_g2secondary_bitmap -data_g2shsimple_packing, &grib_accessor_class_data_g2shsimple_packing -data_g2simple_packing, &grib_accessor_class_data_g2simple_packing -data_g2simple_packing_with_preprocessing, &grib_accessor_class_data_g2simple_packing_with_preprocessing -data_jpeg2000_packing, &grib_accessor_class_data_jpeg2000_packing -data_png_packing, &grib_accessor_class_data_png_packing -data_raw_packing, &grib_accessor_class_data_raw_packing -data_run_length_packing, &grib_accessor_class_data_run_length_packing -data_secondary_bitmap, &grib_accessor_class_data_secondary_bitmap -data_sh_packed, &grib_accessor_class_data_sh_packed -data_sh_unpacked, &grib_accessor_class_data_sh_unpacked -data_shsimple_packing, &grib_accessor_class_data_shsimple_packing -data_simple_packing, &grib_accessor_class_data_simple_packing -decimal_precision, &grib_accessor_class_decimal_precision -dictionary, &grib_accessor_class_dictionary -dirty, &grib_accessor_class_dirty -divdouble, &grib_accessor_class_divdouble -double, &grib_accessor_class_double -element, &grib_accessor_class_element -evaluate, &grib_accessor_class_evaluate -expanded_descriptors, &grib_accessor_class_expanded_descriptors -from_scale_factor_scaled_value, &grib_accessor_class_from_scale_factor_scaled_value -g1_half_byte_codeflag, &grib_accessor_class_g1_half_byte_codeflag -g1_message_length, &grib_accessor_class_g1_message_length -g1_section4_length, &grib_accessor_class_g1_section4_length -g1bitmap, &grib_accessor_class_g1bitmap -g1date, &grib_accessor_class_g1date -g1day_of_the_year_date, &grib_accessor_class_g1day_of_the_year_date -g1end_of_interval_monthly, &grib_accessor_class_g1end_of_interval_monthly -g1fcperiod, &grib_accessor_class_g1fcperiod -g1forecastmonth, &grib_accessor_class_g1forecastmonth -g1monthlydate, &grib_accessor_class_g1monthlydate -g1number_of_coded_values_sh_complex, &grib_accessor_class_g1number_of_coded_values_sh_complex -g1number_of_coded_values_sh_simple, &grib_accessor_class_g1number_of_coded_values_sh_simple -g1step_range, &grib_accessor_class_g1step_range -g1verificationdate, &grib_accessor_class_g1verificationdate -g2_aerosol, &grib_accessor_class_g2_aerosol -g2_chemical, &grib_accessor_class_g2_chemical -g2_eps, &grib_accessor_class_g2_eps -g2_mars_labeling, &grib_accessor_class_g2_mars_labeling -g2bitmap, &grib_accessor_class_g2bitmap -g2bitmap_present, &grib_accessor_class_g2bitmap_present -g2date, &grib_accessor_class_g2date -g2end_step, &grib_accessor_class_g2end_step -g2grid, &grib_accessor_class_g2grid -g2latlon, &grib_accessor_class_g2latlon -g2level, &grib_accessor_class_g2level -g2lon, &grib_accessor_class_g2lon -g2step_range, &grib_accessor_class_g2step_range -gaussian_grid_name, &grib_accessor_class_gaussian_grid_name -gds_is_present, &grib_accessor_class_gds_is_present -gds_not_present_bitmap, &grib_accessor_class_gds_not_present_bitmap -gen, &grib_accessor_class_gen -getenv, &grib_accessor_class_getenv -global_gaussian, &grib_accessor_class_global_gaussian -group, &grib_accessor_class_group -gts_header, &grib_accessor_class_gts_header -hash_array, &grib_accessor_class_hash_array -headers_only, &grib_accessor_class_headers_only -ibmfloat, &grib_accessor_class_ibmfloat -ieeefloat, &grib_accessor_class_ieeefloat -ifs_param, &grib_accessor_class_ifs_param +#count_file, &grib_accessor_class_count_file +#count_missing, &grib_accessor_class_count_missing +#count_total, &grib_accessor_class_count_total +#data_apply_bitmap, &grib_accessor_class_data_apply_bitmap +#data_apply_boustrophedonic, &grib_accessor_class_data_apply_boustrophedonic +#data_apply_boustrophedonic_bitmap, &grib_accessor_class_data_apply_boustrophedonic_bitmap +#data_ccsds_packing, &grib_accessor_class_data_ccsds_packing +#data_complex_packing, &grib_accessor_class_data_complex_packing +#data_dummy_field, &grib_accessor_class_data_dummy_field +#data_g1complex_packing, &grib_accessor_class_data_g1complex_packing +#data_g1second_order_constant_width_packing, &grib_accessor_class_data_g1second_order_constant_width_packing +#data_g1second_order_general_extended_packing, &grib_accessor_class_data_g1second_order_general_extended_packing +#data_g1second_order_general_packing, &grib_accessor_class_data_g1second_order_general_packing +#data_g1second_order_row_by_row_packing, &grib_accessor_class_data_g1second_order_row_by_row_packing +#data_g1secondary_bitmap, &grib_accessor_class_data_g1secondary_bitmap +#data_g1shsimple_packing, &grib_accessor_class_data_g1shsimple_packing +#data_g1simple_packing, &grib_accessor_class_data_g1simple_packing +#data_g22order_packing, &grib_accessor_class_data_g22order_packing +#data_g2bifourier_packing, &grib_accessor_class_data_g2bifourier_packing +#data_g2complex_packing, &grib_accessor_class_data_g2complex_packing +#data_g2secondary_bitmap, &grib_accessor_class_data_g2secondary_bitmap +#data_g2shsimple_packing, &grib_accessor_class_data_g2shsimple_packing +#data_g2simple_packing, &grib_accessor_class_data_g2simple_packing +#data_g2simple_packing_with_preprocessing, &grib_accessor_class_data_g2simple_packing_with_preprocessing +#data_jpeg2000_packing, &grib_accessor_class_data_jpeg2000_packing +#data_png_packing, &grib_accessor_class_data_png_packing +#data_raw_packing, &grib_accessor_class_data_raw_packing +#data_run_length_packing, &grib_accessor_class_data_run_length_packing +#data_secondary_bitmap, &grib_accessor_class_data_secondary_bitmap +#data_sh_packed, &grib_accessor_class_data_sh_packed +#data_sh_unpacked, &grib_accessor_class_data_sh_unpacked +#data_shsimple_packing, &grib_accessor_class_data_shsimple_packing +#data_simple_packing, &grib_accessor_class_data_simple_packing +#decimal_precision, &grib_accessor_class_decimal_precision +#dictionary, &grib_accessor_class_dictionary +#dirty, &grib_accessor_class_dirty +#divdouble, &grib_accessor_class_divdouble +#double, &grib_accessor_class_double +#element, &grib_accessor_class_element +#evaluate, &grib_accessor_class_evaluate +#expanded_descriptors, &grib_accessor_class_expanded_descriptors +#from_scale_factor_scaled_value, &grib_accessor_class_from_scale_factor_scaled_value +#g1_half_byte_codeflag, &grib_accessor_class_g1_half_byte_codeflag +#g1_message_length, &grib_accessor_class_g1_message_length +#g1_section4_length, &grib_accessor_class_g1_section4_length +#g1bitmap, &grib_accessor_class_g1bitmap +#g1date, &grib_accessor_class_g1date +#g1day_of_the_year_date, &grib_accessor_class_g1day_of_the_year_date +#g1end_of_interval_monthly, &grib_accessor_class_g1end_of_interval_monthly +#g1fcperiod, &grib_accessor_class_g1fcperiod +#g1forecastmonth, &grib_accessor_class_g1forecastmonth +#g1monthlydate, &grib_accessor_class_g1monthlydate +#g1number_of_coded_values_sh_complex, &grib_accessor_class_g1number_of_coded_values_sh_complex +#g1number_of_coded_values_sh_simple, &grib_accessor_class_g1number_of_coded_values_sh_simple +#g1step_range, &grib_accessor_class_g1step_range +#g1verificationdate, &grib_accessor_class_g1verificationdate +#g2_aerosol, &grib_accessor_class_g2_aerosol +#g2_chemical, &grib_accessor_class_g2_chemical +#g2_eps, &grib_accessor_class_g2_eps +#g2_mars_labeling, &grib_accessor_class_g2_mars_labeling +#g2bitmap, &grib_accessor_class_g2bitmap +#g2bitmap_present, &grib_accessor_class_g2bitmap_present +#g2date, &grib_accessor_class_g2date +#g2end_step, &grib_accessor_class_g2end_step +#g2grid, &grib_accessor_class_g2grid +#g2latlon, &grib_accessor_class_g2latlon +#g2level, &grib_accessor_class_g2level +#g2lon, &grib_accessor_class_g2lon +#g2step_range, &grib_accessor_class_g2step_range +#gaussian_grid_name, &grib_accessor_class_gaussian_grid_name +#gds_is_present, &grib_accessor_class_gds_is_present +#gds_not_present_bitmap, &grib_accessor_class_gds_not_present_bitmap +#gen, &grib_accessor_class_gen +#getenv, &grib_accessor_class_getenv +#global_gaussian, &grib_accessor_class_global_gaussian +#group, &grib_accessor_class_group +#gts_header, &grib_accessor_class_gts_header +#hash_array, &grib_accessor_class_hash_array +#headers_only, &grib_accessor_class_headers_only +#ibmfloat, &grib_accessor_class_ibmfloat +#ieeefloat, &grib_accessor_class_ieeefloat +#ifs_param, &grib_accessor_class_ifs_param iterator, &grib_accessor_class_iterator -julian_date, &grib_accessor_class_julian_date -julian_day, &grib_accessor_class_julian_day -ksec1expver, &grib_accessor_class_ksec1expver -label, &grib_accessor_class_label -latitudes, &grib_accessor_class_latitudes -latlon_increment, &grib_accessor_class_latlon_increment -latlonvalues, &grib_accessor_class_latlonvalues -library_version, &grib_accessor_class_library_version -local_definition, &grib_accessor_class_local_definition +#julian_date, &grib_accessor_class_julian_date +#julian_day, &grib_accessor_class_julian_day +#ksec1expver, &grib_accessor_class_ksec1expver +#label, &grib_accessor_class_label +#latitudes, &grib_accessor_class_latitudes +#latlon_increment, &grib_accessor_class_latlon_increment +#latlonvalues, &grib_accessor_class_latlonvalues +#library_version, &grib_accessor_class_library_version +#local_definition, &grib_accessor_class_local_definition long, &grib_accessor_class_long -long_vector, &grib_accessor_class_long_vector -longitudes, &grib_accessor_class_longitudes -lookup, &grib_accessor_class_lookup -mars_param, &grib_accessor_class_mars_param -mars_step, &grib_accessor_class_mars_step -md5, &grib_accessor_class_md5 -message, &grib_accessor_class_message -message_copy, &grib_accessor_class_message_copy -multdouble, &grib_accessor_class_multdouble +#long_vector, &grib_accessor_class_long_vector +#longitudes, &grib_accessor_class_longitudes +#lookup, &grib_accessor_class_lookup +#mars_param, &grib_accessor_class_mars_param +#mars_step, &grib_accessor_class_mars_step +#md5, &grib_accessor_class_md5 +#message, &grib_accessor_class_message +#message_copy, &grib_accessor_class_message_copy +#multdouble, &grib_accessor_class_multdouble nearest, &grib_accessor_class_nearest -non_alpha, &grib_accessor_class_non_alpha -number_of_coded_values, &grib_accessor_class_number_of_coded_values -number_of_points, &grib_accessor_class_number_of_points -number_of_points_gaussian, &grib_accessor_class_number_of_points_gaussian -number_of_values, &grib_accessor_class_number_of_values -number_of_values_data_raw_packing, &grib_accessor_class_number_of_values_data_raw_packing -octahedral_gaussian, &grib_accessor_class_octahedral_gaussian -octet_number, &grib_accessor_class_octet_number -offset_file, &grib_accessor_class_offset_file -offset_values, &grib_accessor_class_offset_values -optimal_step_units, &grib_accessor_class_optimal_step_units -pack_bufr_values, &grib_accessor_class_pack_bufr_values -packing_type, &grib_accessor_class_packing_type -pad, &grib_accessor_class_pad -padding, &grib_accessor_class_padding -padto, &grib_accessor_class_padto -padtoeven, &grib_accessor_class_padtoeven -padtomultiple, &grib_accessor_class_padtomultiple -position, &grib_accessor_class_position -proj_string, &grib_accessor_class_proj_string -raw, &grib_accessor_class_raw -rdbtime_guess_date, &grib_accessor_class_rdbtime_guess_date -reference_value_error, &grib_accessor_class_reference_value_error -round, &grib_accessor_class_round -scale, &grib_accessor_class_scale -scale_values, &grib_accessor_class_scale_values -second_order_bits_per_value, &grib_accessor_class_second_order_bits_per_value -section, &grib_accessor_class_section -section_length, &grib_accessor_class_section_length -section_padding, &grib_accessor_class_section_padding -section_pointer, &grib_accessor_class_section_pointer -select_step_template, &grib_accessor_class_select_step_template -sexagesimal2decimal, &grib_accessor_class_sexagesimal2decimal -signed, &grib_accessor_class_signed -signed_bits, &grib_accessor_class_signed_bits -simple_packing_error, &grib_accessor_class_simple_packing_error -size, &grib_accessor_class_size +#non_alpha, &grib_accessor_class_non_alpha +#number_of_coded_values, &grib_accessor_class_number_of_coded_values +#number_of_points, &grib_accessor_class_number_of_points +#number_of_points_gaussian, &grib_accessor_class_number_of_points_gaussian +#number_of_values, &grib_accessor_class_number_of_values +#number_of_values_data_raw_packing, &grib_accessor_class_number_of_values_data_raw_packing +#octahedral_gaussian, &grib_accessor_class_octahedral_gaussian +#octet_number, &grib_accessor_class_octet_number +#offset_file, &grib_accessor_class_offset_file +#offset_values, &grib_accessor_class_offset_values +#optimal_step_units, &grib_accessor_class_optimal_step_units +#pack_bufr_values, &grib_accessor_class_pack_bufr_values +#packing_type, &grib_accessor_class_packing_type +#pad, &grib_accessor_class_pad +#padding, &grib_accessor_class_padding +#padto, &grib_accessor_class_padto +#padtoeven, &grib_accessor_class_padtoeven +#padtomultiple, &grib_accessor_class_padtomultiple +#position, &grib_accessor_class_position +#proj_string, &grib_accessor_class_proj_string +#raw, &grib_accessor_class_raw +#rdbtime_guess_date, &grib_accessor_class_rdbtime_guess_date +#reference_value_error, &grib_accessor_class_reference_value_error +#round, &grib_accessor_class_round +#scale, &grib_accessor_class_scale +#scale_values, &grib_accessor_class_scale_values +#second_order_bits_per_value, &grib_accessor_class_second_order_bits_per_value +#section, &grib_accessor_class_section +#section_length, &grib_accessor_class_section_length +#section_padding, &grib_accessor_class_section_padding +#section_pointer, &grib_accessor_class_section_pointer +#select_step_template, &grib_accessor_class_select_step_template +#sexagesimal2decimal, &grib_accessor_class_sexagesimal2decimal +#signed, &grib_accessor_class_signed +#signed_bits, &grib_accessor_class_signed_bits +#simple_packing_error, &grib_accessor_class_simple_packing_error +#size, &grib_accessor_class_size smart_table, &grib_accessor_class_smart_table -smart_table_column, &grib_accessor_class_smart_table_column -spd, &grib_accessor_class_spd -spectral_truncation, &grib_accessor_class_spectral_truncation -sprintf, &grib_accessor_class_sprintf -statistics, &grib_accessor_class_statistics -statistics_spectral, &grib_accessor_class_statistics_spectral -step_human_readable, &grib_accessor_class_step_human_readable -step_in_units, &grib_accessor_class_step_in_units -sum, &grib_accessor_class_sum -suppressed, &grib_accessor_class_suppressed -time, &grib_accessor_class_time -to_double, &grib_accessor_class_to_double -to_integer, &grib_accessor_class_to_integer -to_string, &grib_accessor_class_to_string +#smart_table_column, &grib_accessor_class_smart_table_column +#spd, &grib_accessor_class_spd +#spectral_truncation, &grib_accessor_class_spectral_truncation +#sprintf, &grib_accessor_class_sprintf +#statistics, &grib_accessor_class_statistics +#statistics_spectral, &grib_accessor_class_statistics_spectral +#step_human_readable, &grib_accessor_class_step_human_readable +#step_in_units, &grib_accessor_class_step_in_units +#sum, &grib_accessor_class_sum +#suppressed, &grib_accessor_class_suppressed +#time, &grib_accessor_class_time +#to_double, &grib_accessor_class_to_double +#to_integer, &grib_accessor_class_to_integer +#to_string, &grib_accessor_class_to_string transient, &grib_accessor_class_transient -transient_darray, &grib_accessor_class_transient_darray -trim, &grib_accessor_class_trim -uint16, &grib_accessor_class_uint16 -uint32, &grib_accessor_class_uint32 -uint32_little_endian, &grib_accessor_class_uint32_little_endian -uint64, &grib_accessor_class_uint64 -uint64_little_endian, &grib_accessor_class_uint64_little_endian -uint8, &grib_accessor_class_uint8 -unexpanded_descriptors, &grib_accessor_class_unexpanded_descriptors -unpack_bufr_values, &grib_accessor_class_unpack_bufr_values +#transient_darray, &grib_accessor_class_transient_darray +#trim, &grib_accessor_class_trim +#uint16, &grib_accessor_class_uint16 +#uint32, &grib_accessor_class_uint32 +#uint32_little_endian, &grib_accessor_class_uint32_little_endian +#uint64, &grib_accessor_class_uint64 +#uint64_little_endian, &grib_accessor_class_uint64_little_endian +#uint8, &grib_accessor_class_uint8 +#unexpanded_descriptors, &grib_accessor_class_unexpanded_descriptors +#unpack_bufr_values, &grib_accessor_class_unpack_bufr_values unsigned, &grib_accessor_class_unsigned -unsigned_bits, &grib_accessor_class_unsigned_bits -validity_date, &grib_accessor_class_validity_date -validity_time, &grib_accessor_class_validity_time -values, &grib_accessor_class_values +#unsigned_bits, &grib_accessor_class_unsigned_bits +#validity_date, &grib_accessor_class_validity_date +#validity_time, &grib_accessor_class_validity_time +#values, &grib_accessor_class_values variable, &grib_accessor_class_variable -vector, &grib_accessor_class_vector -when, &grib_accessor_class_when +#vector, &grib_accessor_class_vector +#when, &grib_accessor_class_when diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index e54b76615..0cff18a9b 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -240,7 +240,7 @@ typedef struct grib_action_file grib_action_file; typedef struct grib_action_file_list grib_action_file_list; typedef struct grib_block_of_accessors grib_block_of_accessors; typedef struct grib_buffer grib_buffer; -typedef struct grib_accessor_class grib_accessor_class; +class grib_accessor_class; typedef struct grib_action grib_action; typedef struct grib_action_class grib_action_class; typedef struct grib_section grib_section; @@ -248,7 +248,7 @@ typedef struct grib_packer grib_packer; typedef struct grib_codetable grib_codetable; typedef struct grib_smart_table grib_smart_table; -typedef struct grib_accessor grib_accessor; +class grib_accessor; typedef struct grib_iterator_class grib_iterator_class; typedef struct grib_nearest_class grib_nearest_class; typedef struct grib_dumper grib_dumper; @@ -281,53 +281,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); -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); -typedef int (*accessor_unpack_string_array_proc)(grib_accessor*, char**, size_t* len); -typedef int (*accessor_unpack_bytes_proc)(grib_accessor*, unsigned char*, size_t* len); -typedef int (*accessor_get_native_type_proc)(grib_accessor*); -typedef int (*accessor_notify_change_proc)(grib_accessor*, grib_accessor*); -typedef void (*accessor_update_size_proc)(grib_accessor*, size_t); -typedef size_t (*accessor_preferred_size_proc)(grib_accessor*, int); -typedef void (*accessor_resize_proc)(grib_accessor*, size_t); - -typedef grib_accessor* (*accessor_next_proc)(grib_accessor*, int); -typedef grib_section* (*accessor_sub_section_proc)(grib_accessor*); - -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); -typedef int (*accessor_pack_expression_proc)(grib_accessor*, grib_expression*); -typedef int (*accessor_clear_proc)(grib_accessor*); -typedef grib_accessor* (*accessor_clone_proc)(grib_accessor*, grib_section*, int*); - -typedef void (*accessor_init_class_proc)(grib_accessor_class*); - -typedef int (*accessor_compare_proc)(grib_accessor*, grib_accessor*); -typedef size_t (*accessor_string_proc)(grib_accessor*); -typedef int (*accessor_value_with_ret_proc)(grib_accessor*, long*); -typedef long (*accessor_value_proc)(grib_accessor*); -typedef void (*accessor_dump_proc)(grib_accessor*, grib_dumper*); -typedef void (*accessor_init_proc)(grib_accessor*, const long len, grib_arguments*); -typedef void (*accessor_post_init_proc)(grib_accessor*); - -typedef int (*accessor_nearest_proc)(grib_accessor*, double, double*); typedef long (*grib_binop_long_proc)(long, long); typedef long (*grib_unop_long_proc)(long); @@ -411,16 +364,7 @@ struct grib_action char* debug_info; /** purely for debugging and tracing */ }; -typedef struct grib_accessors_list grib_accessors_list; - -struct grib_accessors_list -{ - grib_accessor* accessor; - int rank; - grib_accessors_list* next; - grib_accessors_list* prev; - grib_accessors_list* last; -}; +class grib_accessors_list; typedef int (*action_create_accessors_handle_proc)(grib_section* p, grib_action* a, grib_loader* h); typedef int (*action_notify_change_proc)(grib_action* a, grib_accessor* observer, grib_accessor* observed); @@ -495,34 +439,6 @@ struct grib_virtual_value int type; }; -struct grib_accessor -{ - const char* name; /** < name of the accessor */ - const char* name_space; /** < namespace to which the accessor belongs */ - grib_context* context; - grib_handle* h; - grib_action* creator; /** < action that created the accessor */ - long length; /** < byte length of the accessor */ - long offset; /** < offset of the data in the buffer */ - grib_section* parent; /** < section to which the accessor is attached */ - grib_accessor* next; /** < next accessor in list */ - grib_accessor* previous; /** < next accessor in list */ - grib_accessor_class* cclass; /** < behaviour of the accessor */ - unsigned long flags; /** < Various flags */ - grib_section* sub_section; - - const char* all_names[MAX_ACCESSOR_NAMES]; /** < name of the accessor */ - const char* all_name_spaces[MAX_ACCESSOR_NAMES]; /** < namespace to which the accessor belongs */ - int dirty; - - grib_accessor* same; /** < accessors with the same name */ - long loop; /** < used in lists */ - grib_virtual_value* vvalue; /** < virtual value used when transient flag on **/ - const char* set; - grib_accessor* attributes[MAX_ACCESSOR_ATTRIBUTES]; /** < attributes are accessors */ - grib_accessor* parent_as_attribute; -}; - #define GRIB_ACCESSOR_FLAG_READ_ONLY (1 << 1) #define GRIB_ACCESSOR_FLAG_DUMP (1 << 2) #define GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC (1 << 3) @@ -856,71 +772,6 @@ struct grib_multi_handle size_t length; }; -struct grib_accessor_class -{ - grib_accessor_class** super; - const char* name; - size_t size; - - int inited; - accessor_init_class_proc init_class; - - accessor_init_proc init; - accessor_post_init_proc post_init; - accessor_destroy_proc destroy; - - accessor_dump_proc dump; - accessor_value_proc next_offset; - - accessor_string_proc string_length; - accessor_value_with_ret_proc value_count; - - accessor_value_proc byte_count; - accessor_value_proc byte_offset; - - accessor_get_native_type_proc get_native_type; - - accessor_sub_section_proc sub_section; - - accessor_pack_missing_proc pack_missing; - accessor_pack_is_missing_proc is_missing; - - accessor_pack_long_proc pack_long; - 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; - - accessor_pack_string_array_proc pack_string_array; - accessor_unpack_string_array_proc unpack_string_array; - - accessor_pack_bytes_proc pack_bytes; - accessor_unpack_bytes_proc unpack_bytes; - - accessor_pack_expression_proc pack_expression; - - accessor_notify_change_proc notify_change; - accessor_update_size_proc update_size; - - accessor_preferred_size_proc preferred_size; - accessor_resize_proc resize; - - accessor_nearest_proc nearest_smaller_value; - 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; -}; typedef struct grib_multi_support grib_multi_support; struct grib_multi_support @@ -1461,6 +1312,8 @@ typedef struct j2k_encode_helper #ifdef __cplusplus } +#include "accessor/grib_accessor.h" +#include "accessor/grib_accessors_list.h" #endif #endif diff --git a/src/grib_buffer.cc b/src/grib_buffer.cc index 525e59f31..89313429d 100644 --- a/src/grib_buffer.cc +++ b/src/grib_buffer.cc @@ -152,10 +152,10 @@ static void update_offsets_after(grib_accessor* a, long len) // { // int ret; // if(s->owner) -// plen = grib_get_next_position_offset(s->block->last) - s->owner->offset; +// plen = s->block->last->get_next_position_offset() - s->owner->offset; // else -// plen = grib_get_next_position_offset(s->block->last); -// if((ret = grib_pack_long(s->aclength, &plen, &len)) != GRIB_SUCCESS) +// plen = s->block->last->get_next_position_offset(); +// if((ret = s->aclength->pack_long(&plen, &len)) != GRIB_SUCCESS) // ; // // if(s->h->context->debug) @@ -174,19 +174,19 @@ static void update_offsets_after(grib_accessor* a, long len) // { // int ret; // if(s->owner) -// plen = grib_get_next_position_offset(s->block->last) - s->owner->offset; +// plen = s->block->last->get_next_position_offset() - s->owner->offset; // else -// plen = grib_get_next_position_offset(s->block->last); +// plen = s->block->last->get_next_position_offset(); // /* if(s->owner) */ // /* s->owner->length = plen; */ // /* if(s->aclength) */ -// if((ret = grib_pack_long(s->aclength, &plen, &len)) != GRIB_SUCCESS) +// if((ret = s->aclength->pack_long(&plen, &len)) != GRIB_SUCCESS) // ; // if(s->h->context->debug) // { // printf("SECTION updating length %ld .. %s\n",plen,s->owner->name); // printf("NEXT_POS = %ld, owner offset= %ld %s %s\n", -// grib_get_next_position_offset(s->block->last), +// s->block->last->get_next_position_offset(), // s->owner ? s->owner->offset : 0L, s->owner->name, // s->block->last->name); // } @@ -199,7 +199,7 @@ int grib_buffer_replace(grib_accessor* a, const unsigned char* data, size_t newsize, int update_lengths, int update_paddings) { size_t offset = a->offset; - long oldsize = grib_get_next_position_offset(a) - offset; + long oldsize = a->get_next_position_offset() - offset; long increase = (long)newsize - (long)oldsize; grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; @@ -231,7 +231,7 @@ int grib_buffer_replace(grib_accessor* a, const unsigned char* data, if (increase) { update_offsets_after(a, increase); if (update_lengths) { - grib_update_size(a, newsize); + a->update_size(newsize); int err = grib_section_adjust_sizes(grib_handle_of_accessor(a)->root, 1, 0); if (err) return err; if (update_paddings) diff --git a/src/grib_bufr_descriptor.cc b/src/grib_bufr_descriptor.cc index fcaeeac46..ef6bc1fbc 100644 --- a/src/grib_bufr_descriptor.cc +++ b/src/grib_bufr_descriptor.cc @@ -14,7 +14,11 @@ bufr_descriptor* grib_bufr_descriptor_new(grib_accessor* tables_accessor, int code, int silent, int* err) { - bufr_descriptor* ret = accessor_bufr_elements_table_get_descriptor(tables_accessor, code, err); + // ===== TODO(maee): Enable this when grib_accessor_class_bufr_elements_table.cc is moved to C++ ===== + throw std::runtime_error("grib_bufr_descriptor_new not implemented"); + bufr_descriptor* ret = NULL; + //bufr_descriptor* ret = accessor_bufr_elements_table_get_descriptor(tables_accessor, code, err); + // ===== END TODO ===== if (!silent && *err) grib_context_log(tables_accessor->context, GRIB_LOG_ERROR, "unable to get descriptor %06d from table", code); diff --git a/src/grib_dependency.cc b/src/grib_dependency.cc index 4c417173e..37c89dbbf 100644 --- a/src/grib_dependency.cc +++ b/src/grib_dependency.cc @@ -124,7 +124,7 @@ int grib_dependency_notify_change(grib_accessor* observed) while (d) { if (d->run) { /*printf("grib_dependency_notify_change %s %s %p\n", observed->name, d->observer ? d->observer->name : "?", (void*)d->observer);*/ - if (d->observer && (ret = grib_accessor_notify_change(d->observer, observed)) != GRIB_SUCCESS) + if (d->observer && (ret = d->observer->notify_change(observed)) != GRIB_SUCCESS) return ret; } d = d->next; @@ -149,7 +149,7 @@ int grib_dependency_notify_change_h(grib_handle* h, grib_accessor* observed) while (d) { if (d->run) { /*printf("grib_dependency_notify_change %s %s %p\n",observed->name,d->observer ? d->observer->name : "?", (void*)d->observer);*/ - if (d->observer && (ret = grib_accessor_notify_change(d->observer, observed)) != GRIB_SUCCESS) + if (d->observer && (ret = d->observer->notify_change(observed)) != GRIB_SUCCESS) return ret; } d = d->next; diff --git a/src/grib_dumper_class.cc b/src/grib_dumper_class.cc index abd1cbf02..eca1610b0 100644 --- a/src/grib_dumper_class.cc +++ b/src/grib_dumper_class.cc @@ -52,7 +52,7 @@ void grib_dump_accessors_block(grib_dumper* dumper, grib_block_of_accessors* blo { grib_accessor* a = block->first; while (a) { - grib_accessor_dump(a, dumper); + a->dump(dumper); a = a->next; } } @@ -61,8 +61,8 @@ void grib_dump_accessors_list(grib_dumper* dumper, grib_accessors_list* al) { grib_accessors_list* cur = al; while (cur) { - grib_accessor_dump(cur->accessor, dumper); - cur = cur->next; + cur->accessor->dump(dumper); + cur = cur->next_; } } @@ -70,7 +70,7 @@ int grib_print(grib_handle* h, const char* name, grib_dumper* d) { grib_accessor* act = grib_find_accessor(h, name); if (act) { - grib_accessor_dump(act, d); + act->dump(d); return GRIB_SUCCESS; } return GRIB_NOT_FOUND; @@ -106,7 +106,7 @@ void grib_dump_keys(grib_handle* h, FILE* f, const char* mode, unsigned long fla for (i = 0; i < num_keys; ++i) { acc = grib_find_accessor(h, keys[i]); if (acc) - grib_accessor_dump(acc, dumper); + acc->dump(dumper); } grib_dumper_delete(dumper); } diff --git a/src/grib_dumper_class_bufr_decode_C.cc b/src/grib_dumper_class_bufr_decode_C.cc index 49805279b..6811cdf94 100644 --- a/src/grib_dumper_class_bufr_decode_C.cc +++ b/src/grib_dumper_class_bufr_decode_C.cc @@ -150,11 +150,11 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size <= 1) { - err = grib_unpack_double(a, &value, &size); + err = a->unpack_double(&value, &size); } self->empty = 0; @@ -220,11 +220,11 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size <= 1) { - err = grib_unpack_double(a, &value, &size); + err = a->unpack_double(&value, &size); } self->empty = 0; @@ -279,7 +279,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { @@ -305,7 +305,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } if (size <= 1) { - err = grib_unpack_long(a, &value, &size); + err = a->unpack_long(&value, &size); } self->empty = 0; @@ -368,11 +368,11 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size <= 1) { - err = grib_unpack_long(a, &value, &size); + err = a->unpack_long(&value, &size); } self->empty = 0; @@ -428,7 +428,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a, &value, &size); + a->unpack_double(&value, &size); self->empty = 0; r = compute_bufr_key_rank(h, self->keys, a->name); @@ -477,7 +477,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_string(d, a, comment); @@ -497,7 +497,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm return; } - err = grib_unpack_string_array(a, values, &size); + err = a->unpack_string_array(values, &size); if (self->isLeaf == 0) { if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) @@ -545,7 +545,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) self->empty = 0; - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, a->name); if (grib_is_missing_string(a, (unsigned char*)value, size)) { @@ -656,7 +656,7 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; - switch (grib_accessor_get_native_type(a->attributes[i])) { + switch (a->attributes[i]->get_native_type()) { case GRIB_TYPE_LONG: dump_long_attribute(d, a->attributes[i], prefix); break; diff --git a/src/grib_dumper_class_bufr_decode_filter.cc b/src/grib_dumper_class_bufr_decode_filter.cc index 0fff0fc14..87cb0e2fe 100644 --- a/src/grib_dumper_class_bufr_decode_filter.cc +++ b/src/grib_dumper_class_bufr_decode_filter.cc @@ -140,11 +140,11 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size <= 1) { - err = grib_unpack_double(a, &value, &size); + err = a->unpack_double(&value, &size); } self->begin = 0; @@ -199,11 +199,11 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size <= 1) { - err = grib_unpack_double(a, &value, &size); + err = a->unpack_double(&value, &size); } self->empty = 0; @@ -244,7 +244,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { @@ -270,7 +270,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } if (size <= 1) { - err = grib_unpack_long(a, &value, &size); + err = a->unpack_long(&value, &size); } self->begin = 0; @@ -353,7 +353,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a, &value, &size); + a->unpack_double(&value, &size); self->begin = 0; self->empty = 0; @@ -399,7 +399,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_string(d, a, comment); @@ -457,7 +457,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) self->empty = 0; - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, a->name); if (grib_is_missing_string(a, (unsigned char*)value, size)) { @@ -569,7 +569,7 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix /* fprintf(out,"\"%s\" : ",a->attributes[i]->name); */ flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; - switch (grib_accessor_get_native_type(a->attributes[i])) { + switch (a->attributes[i]->get_native_type()) { case GRIB_TYPE_LONG: dump_long_attribute(d, a->attributes[i], prefix); break; diff --git a/src/grib_dumper_class_bufr_decode_fortran.cc b/src/grib_dumper_class_bufr_decode_fortran.cc index b07f59b49..dbc4ed271 100644 --- a/src/grib_dumper_class_bufr_decode_fortran.cc +++ b/src/grib_dumper_class_bufr_decode_fortran.cc @@ -142,11 +142,11 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size <= 1) { - err = grib_unpack_double(a, &value, &size); + err = a->unpack_double(&value, &size); } self->empty = 0; @@ -202,11 +202,11 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size <= 1) { - err = grib_unpack_double(a, &value, &size); + err = a->unpack_double(&value, &size); } self->empty = 0; @@ -249,7 +249,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { @@ -275,7 +275,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } if (size <= 1) { - err = grib_unpack_long(a, &value, &size); + err = a->unpack_long(&value, &size); } self->empty = 0; @@ -331,11 +331,11 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size <= 1) { - err = grib_unpack_long(a, &value, &size); + err = a->unpack_long(&value, &size); } self->empty = 0; @@ -384,7 +384,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a, &value, &size); + a->unpack_double(&value, &size); self->empty = 0; r = compute_bufr_key_rank(h, self->keys, a->name); @@ -429,7 +429,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_string(d, a, comment); @@ -485,7 +485,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) self->empty = 0; - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, a->name); if (grib_is_missing_string(a, (unsigned char*)value, size)) { @@ -595,7 +595,7 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; - switch (grib_accessor_get_native_type(a->attributes[i])) { + switch (a->attributes[i]->get_native_type()) { case GRIB_TYPE_LONG: dump_long_attribute(d, a->attributes[i], prefix); break; diff --git a/src/grib_dumper_class_bufr_decode_python.cc b/src/grib_dumper_class_bufr_decode_python.cc index 632cbe98b..3e2edc70a 100644 --- a/src/grib_dumper_class_bufr_decode_python.cc +++ b/src/grib_dumper_class_bufr_decode_python.cc @@ -150,11 +150,11 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size <= 1) { - err = grib_unpack_double(a, &value, &size); + err = a->unpack_double(&value, &size); } self->empty = 0; @@ -213,11 +213,11 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size <= 1) { - err = grib_unpack_double(a, &value, &size); + err = a->unpack_double(&value, &size); } self->empty = 0; @@ -265,7 +265,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { @@ -291,7 +291,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } if (size <= 1) { - err = grib_unpack_long(a, &value, &size); + err = a->unpack_long(&value, &size); } self->empty = 0; @@ -345,11 +345,11 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size <= 1) { - err = grib_unpack_long(a, &value, &size); + err = a->unpack_long(&value, &size); } self->empty = 0; @@ -397,7 +397,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a, &value, &size); + a->unpack_double(&value, &size); self->empty = 0; r = compute_bufr_key_rank(h, self->keys, a->name); @@ -445,7 +445,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_string(d, a, comment); @@ -498,7 +498,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) self->empty = 0; - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, a->name); if (grib_is_missing_string(a, (unsigned char*)value, size)) { @@ -605,7 +605,7 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; - switch (grib_accessor_get_native_type(a->attributes[i])) { + switch (a->attributes[i]->get_native_type()) { case GRIB_TYPE_LONG: dump_long_attribute(d, a->attributes[i], prefix); break; diff --git a/src/grib_dumper_class_bufr_encode_C.cc b/src/grib_dumper_class_bufr_encode_C.cc index 568a035bb..915649814 100644 --- a/src/grib_dumper_class_bufr_encode_C.cc +++ b/src/grib_dumper_class_bufr_encode_C.cc @@ -168,15 +168,15 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); + err = a->unpack_double(&value, &size2); } Assert(size2 == size); @@ -264,15 +264,15 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); + err = a->unpack_double(&value, &size2); } Assert(size2 == size); @@ -357,7 +357,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { @@ -385,10 +385,10 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -488,15 +488,15 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -568,7 +568,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a, &value, &size); + a->unpack_double(&value, &size); self->empty = 0; r = compute_bufr_key_rank(h, self->keys, a->name); @@ -614,7 +614,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_string(d, a, comment); @@ -633,7 +633,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm return; } - err = grib_unpack_string_array(a, values, &size); + err = a->unpack_string_array(values, &size); for (i = 0; i < size - 1; i++) { fprintf(self->dumper.out, " svalues[%lu]=\"%s\"; \n", (unsigned long)i, values[i]); } @@ -697,7 +697,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) self->empty = 0; - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, acc_name); if (grib_is_missing_string(a, (unsigned char*)value, size)) { @@ -833,7 +833,7 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; - switch (grib_accessor_get_native_type(a->attributes[i])) { + switch (a->attributes[i]->get_native_type()) { case GRIB_TYPE_LONG: dump_long_attribute(d, a->attributes[i], prefix); break; diff --git a/src/grib_dumper_class_bufr_encode_filter.cc b/src/grib_dumper_class_bufr_encode_filter.cc index 49c4d19ef..a90ab0f56 100644 --- a/src/grib_dumper_class_bufr_encode_filter.cc +++ b/src/grib_dumper_class_bufr_encode_filter.cc @@ -144,15 +144,15 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); + err = a->unpack_double(&value, &size2); } Assert(size2 == size); @@ -234,15 +234,15 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); + err = a->unpack_double(&value, &size2); } Assert(size2 == size); @@ -306,7 +306,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { @@ -333,10 +333,10 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -416,15 +416,15 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -489,7 +489,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a, &value, &size); + a->unpack_double(&value, &size); self->begin = 0; self->empty = 0; @@ -538,7 +538,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_string(d, a, comment); @@ -563,7 +563,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm return; } - err = grib_unpack_string_array(a, values, &size); + err = a->unpack_string_array(values, &size); fprintf(self->dumper.out, "{"); depth += 2; @@ -624,7 +624,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) self->begin = 0; self->empty = 0; - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, a->name); if (grib_is_missing_string(a, (unsigned char*)value, size)) { @@ -759,7 +759,7 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix /* fprintf(out,"\"%s\" : ",a->attributes[i]->name); */ flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; - switch (grib_accessor_get_native_type(a->attributes[i])) { + switch (a->attributes[i]->get_native_type()) { case GRIB_TYPE_LONG: dump_long_attribute(d, a->attributes[i], prefix); break; diff --git a/src/grib_dumper_class_bufr_encode_fortran.cc b/src/grib_dumper_class_bufr_encode_fortran.cc index e76bd0872..1e6cd3bd7 100644 --- a/src/grib_dumper_class_bufr_encode_fortran.cc +++ b/src/grib_dumper_class_bufr_encode_fortran.cc @@ -217,15 +217,15 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); + err = a->unpack_double(&value, &size2); } Assert(size2 == size); @@ -312,15 +312,15 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); + err = a->unpack_double(&value, &size2); } Assert(size2 == size); @@ -406,7 +406,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { @@ -433,10 +433,10 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -535,15 +535,15 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -620,7 +620,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a, &value, &size); + a->unpack_double(&value, &size); self->empty = 0; r = compute_bufr_key_rank(h, self->keys, a->name); @@ -665,7 +665,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_string(d, a, comment); @@ -685,7 +685,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm return; } - err = grib_unpack_string_array(a, values, &size); + err = a->unpack_string_array(values, &size); for (i = 0; i < size - 1; i++) { fprintf(self->dumper.out, " \"%s\", &\n", values[i]); @@ -747,7 +747,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) self->empty = 0; - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, acc_name); if (grib_is_missing_string(a, (unsigned char*)value, size)) { @@ -880,7 +880,7 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; - switch (grib_accessor_get_native_type(a->attributes[i])) { + switch (a->attributes[i]->get_native_type()) { case GRIB_TYPE_LONG: dump_long_attribute(d, a->attributes[i], prefix); break; diff --git a/src/grib_dumper_class_bufr_encode_python.cc b/src/grib_dumper_class_bufr_encode_python.cc index 34367c913..565bc34ac 100644 --- a/src/grib_dumper_class_bufr_encode_python.cc +++ b/src/grib_dumper_class_bufr_encode_python.cc @@ -164,15 +164,15 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); + err = a->unpack_double(&value, &size2); } Assert(size2 == size); @@ -258,15 +258,15 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); + err = a->unpack_double(&value, &size2); } Assert(size2 == size); @@ -351,7 +351,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { @@ -378,10 +378,10 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -478,15 +478,15 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -558,7 +558,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a, &value, &size); + a->unpack_double(&value, &size); self->empty = 0; r = compute_bufr_key_rank(h, self->keys, a->name); @@ -603,7 +603,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_string(d, a, comment); @@ -620,7 +620,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm return; } - err = grib_unpack_string_array(a, values, &size); + err = a->unpack_string_array(values, &size); for (i = 0; i < size - 1; i++) { fprintf(self->dumper.out, " \"%s\", \n", values[i]); @@ -680,7 +680,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) self->empty = 0; - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, acc_name); if (grib_is_missing_string(a, (unsigned char*)value, size)) { @@ -814,7 +814,7 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; - switch (grib_accessor_get_native_type(a->attributes[i])) { + switch (a->attributes[i]->get_native_type()) { case GRIB_TYPE_LONG: dump_long_attribute(d, a->attributes[i], prefix); break; diff --git a/src/grib_dumper_class_bufr_simple.cc b/src/grib_dumper_class_bufr_simple.cc index ca4701f38..868b81ba5 100644 --- a/src/grib_dumper_class_bufr_simple.cc +++ b/src/grib_dumper_class_bufr_simple.cc @@ -141,15 +141,15 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); + err = a->unpack_double(&value, &size2); } Assert(size2 == size); @@ -231,15 +231,15 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); + err = a->unpack_double(&value, &size2); } Assert(size2 == size); @@ -304,7 +304,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { @@ -314,7 +314,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) /* Note: the "subsetNumber" key is only there for UNCOMPRESSED BUFR messages */ if (self->numberOfSubsets > 1 && strcmp(a->name, "subsetNumber") == 0) { - err = grib_unpack_long(a, &value, &size); + err = a->unpack_long(&value, &size); DEBUG_ASSERT(!err); fprintf(self->dumper.out, "%s=%ld\n", a->name, value); DEBUG_ASSERT(!grib_is_missing_long(a, value)); @@ -340,10 +340,10 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -432,15 +432,15 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -504,7 +504,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a, &value, &size); + a->unpack_double(&value, &size); self->empty = 0; @@ -554,7 +554,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_string(d, a, comment); @@ -576,7 +576,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm return; } - err = grib_unpack_string_array(a, values, &size); + err = a->unpack_string_array(values, &size); fprintf(self->dumper.out, "{"); for (i = 0; i < size - 1; i++) { @@ -631,7 +631,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) self->empty = 0; - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); if (err) { fprintf(self->dumper.out, " *** ERR=%d (%s) [dump_string on '%s']", err, grib_get_error_message(err), acc_name); return; @@ -768,7 +768,7 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix /* fprintf(out,"\"%s\" : ",a->attributes[i]->name); */ flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; - switch (grib_accessor_get_native_type(a->attributes[i])) { + switch (a->attributes[i]->get_native_type()) { case GRIB_TYPE_LONG: dump_long_attribute(d, a->attributes[i], prefix); break; diff --git a/src/grib_dumper_class_debug.cc b/src/grib_dumper_class_debug.cc index 77206c829..ead1c7cf4 100644 --- a/src/grib_dumper_class_debug.cc +++ b/src/grib_dumper_class_debug.cc @@ -188,14 +188,14 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = a->unpack_long(values, &size); } else { - err = grib_unpack_long(a, &value, &size); + err = a->unpack_long(&value, &size); } set_begin_end(d, a); @@ -234,14 +234,14 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } } else { - if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && a->is_missing_internal()) fprintf(self->dumper.out, "%ld-%ld %s %s = MISSING", self->begin, self->theEnd, a->creator->op, a->name); else fprintf(self->dumper.out, "%ld-%ld %s %s = %ld", self->begin, self->theEnd, a->creator->op, a->name, value); if (comment) fprintf(self->dumper.out, " [%s]", comment); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) - fprintf(self->dumper.out, " (%s)", grib_get_type_name(grib_accessor_get_native_type(a))); + fprintf(self->dumper.out, " (%s)", grib_get_type_name(a->get_native_type())); if ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) fprintf(self->dumper.out, " %s", "(can be missing)"); if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) @@ -266,7 +266,7 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_debug* self = (grib_dumper_debug*)d; long value = 0; size_t size = 1; - int err = grib_unpack_long(a, &value, &size); + int err = a->unpack_long(&value, &size); int i; if (a->length == 0 && @@ -303,7 +303,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_debug* self = (grib_dumper_debug*)d; double value = 0; size_t size = 1; - int err = grib_unpack_double(a, &value, &size); + int err = a->unpack_double(&value, &size); int i; if (a->length == 0 && @@ -315,14 +315,14 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) for (i = 0; i < d->depth; i++) fprintf(self->dumper.out, " "); - if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && a->is_missing_internal()) fprintf(self->dumper.out, "%ld-%ld %s %s = MISSING", self->begin, self->theEnd, a->creator->op, a->name); else fprintf(self->dumper.out, "%ld-%ld %s %s = %g", self->begin, self->theEnd, a->creator->op, a->name, value); if (comment) fprintf(self->dumper.out, " [%s]", comment); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) - fprintf(self->dumper.out, " (%s)", grib_get_type_name(grib_accessor_get_native_type(a))); + fprintf(self->dumper.out, " (%s)", grib_get_type_name(a->get_native_type())); if (err) fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_debug::dump_double]", err, grib_get_error_message(err)); aliases(d, a); @@ -342,7 +342,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) return; grib_get_string_length_acc(a, &size); - if ((size < 2) && grib_is_missing_internal(a)) { + if ((size < 2) && a->is_missing_internal()) { /* GRIB-302: transients and missing keys. Need to re-adjust the size */ size = 10; /* big enough to hold the string "missing" */ } @@ -350,7 +350,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) value = (char*)grib_context_malloc_clear(a->context, size); if (!value) return; - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); if (err) strcpy(value, ""); @@ -372,7 +372,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) if (comment) fprintf(self->dumper.out, " [%s]", comment); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) - fprintf(self->dumper.out, " (%s)", grib_get_type_name(grib_accessor_get_native_type(a))); + fprintf(self->dumper.out, " (%s)", grib_get_type_name(a->get_native_type())); if (err) fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_debug::dump_string]", err, grib_get_error_message(err)); @@ -412,7 +412,7 @@ static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) fprintf(self->dumper.out, "\n"); - err = grib_unpack_bytes(a, buf, &size); + err = a->unpack_bytes(buf, &size); if (err) { grib_context_free(d->context, buf); fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_debug::dump_bytes]\n}", err, grib_get_error_message(err)); @@ -463,7 +463,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_double(d, a, NULL); @@ -489,7 +489,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) fprintf(self->dumper.out, "\n"); - err = grib_unpack_double(a, buf, &size); + err = a->unpack_double(buf, &size); if (err) { grib_context_free(d->context, buf); fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_debug::dump_values]\n}", err, grib_get_error_message(err)); @@ -567,10 +567,10 @@ static void set_begin_end(grib_dumper* d, grib_accessor* a) grib_dumper_debug* self = (grib_dumper_debug*)d; if ((d->option_flags & GRIB_DUMP_FLAG_OCTET) != 0) { self->begin = a->offset - self->section_offset + 1; - self->theEnd = grib_get_next_position_offset(a) - self->section_offset; + self->theEnd = a->get_next_position_offset() - self->section_offset; } else { self->begin = a->offset; - self->theEnd = grib_get_next_position_offset(a); + self->theEnd = a->get_next_position_offset(); } } diff --git a/src/grib_dumper_class_default.cc b/src/grib_dumper_class_default.cc index e9bfdc702..819344cbe 100644 --- a/src/grib_dumper_class_default.cc +++ b/src/grib_dumper_class_default.cc @@ -147,7 +147,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; print_offset(self->dumper.out, d, a); @@ -159,10 +159,10 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -195,7 +195,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) grib_context_free(a->context, values); } else { - if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && a->is_missing_internal()) fprintf(self->dumper.out, "%s = MISSING;", a->name); else fprintf(self->dumper.out, "%s = %ld;", a->name, value); @@ -224,12 +224,12 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) int err = 0; int isDouble = 0; - switch (grib_accessor_get_native_type(a)) { + switch (a->get_native_type()) { case GRIB_TYPE_LONG: - grib_unpack_long(a, &lvalue, &size); + a->unpack_long(&lvalue, &size); break; case GRIB_TYPE_DOUBLE: - grib_unpack_double(a, &dvalue, &size); + a->unpack_double(&dvalue, &size); isDouble = 1; break; default: @@ -269,7 +269,7 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) else fprintf(self->dumper.out, " "); - if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && a->is_missing_internal()) fprintf(self->dumper.out, "%s = MISSING;", a->name); else { if (isDouble) @@ -292,7 +292,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_default* self = (grib_dumper_default*)d; double value = 0; size_t size = 1; - int err = grib_unpack_double(a, &value, &size); + int err = a->unpack_double(&value, &size); if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; @@ -318,7 +318,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) else fprintf(self->dumper.out, " "); - if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && a->is_missing_internal()) fprintf(self->dumper.out, "%s = MISSING;", a->name); else fprintf(self->dumper.out, "%s = %g;", a->name, value); @@ -341,7 +341,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm int tab = 0; long count = 0; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_string(d, a, comment); @@ -354,7 +354,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm return; } - err = grib_unpack_string_array(a, values, &size); + err = a->unpack_string_array(values, &size); if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; @@ -420,7 +420,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) return; } - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); p = value; while (*p) { @@ -449,7 +449,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) else fprintf(self->dumper.out, " "); - if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && a->is_missing_internal()) fprintf(self->dumper.out, "%s = MISSING;", a->name); else fprintf(self->dumper.out, "%s = %s;", a->name, value); @@ -499,7 +499,7 @@ static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) // fprintf(self->dumper.out,"\n"); -// err = grib_unpack_bytes(a,buf,&size); +// err = a->unpack_bytes(buf,&size); // if(err){ // grib_context_free(d->context,buf); // fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_default::dump_bytes]\n}",err,grib_get_error_message(err)); @@ -549,7 +549,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_double(d, a, NULL); @@ -562,7 +562,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { char type_name[32] = ""; - const long native_type = grib_accessor_get_native_type(a); + const long native_type = a->get_native_type(); if (native_type == GRIB_TYPE_LONG) strcpy(type_name, "(int)"); else if (native_type == GRIB_TYPE_DOUBLE) @@ -596,7 +596,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) fprintf(self->dumper.out, "\n"); - err = grib_unpack_double(a, buf, &size); + err = a->unpack_double(buf, &size); if (err) { grib_context_free(d->context, buf); @@ -690,7 +690,7 @@ static void print_offset(FILE* out, grib_dumper* d, grib_accessor* a) grib_handle* h = grib_handle_of_accessor(a); theBegin = a->offset - self->section_offset + 1; - theEnd = grib_get_next_position_offset(a) - self->section_offset; + theEnd = a->get_next_position_offset() - self->section_offset; if ((d->option_flags & GRIB_DUMP_FLAG_HEXADECIMAL) != 0 && a->length != 0) { if (theBegin == theEnd) { diff --git a/src/grib_dumper_class_grib_encode_C.cc b/src/grib_dumper_class_grib_encode_C.cc index 5ecb6953d..5c41e11a0 100644 --- a/src/grib_dumper_class_grib_encode_C.cc +++ b/src/grib_dumper_class_grib_encode_C.cc @@ -130,7 +130,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; long value; size_t size = 1; - int err = grib_unpack_long(a, &value, &size); + int err = a->unpack_long(&value, &size); if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) return; @@ -161,7 +161,7 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; long value; size_t size = 1; - int err = grib_unpack_long(a, &value, &size); + int err = a->unpack_long(&value, &size); int i; char buf[1024]; @@ -201,7 +201,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; double value; size_t size = 1; - int err = grib_unpack_double(a, &value, &size); + int err = a->unpack_double(&value, &size); if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return; @@ -221,7 +221,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; char value[1024]; size_t size = sizeof(value); - int err = grib_unpack_string(a, value, &size); + int err = a->unpack_string(value, &size); if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return; @@ -260,7 +260,7 @@ static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) return; } - err = grib_unpack_bytes(a, buf, &size); + err = a->unpack_bytes(buf, &size); if (err) { grib_context_free(d->context, buf); fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_grib_encode_C::dump_bytes]\n}", err, grib_get_error_message(err)); @@ -305,7 +305,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) || ((a->flags & GRIB_ACCESSOR_FLAG_DATA) && (d->option_flags & GRIB_DUMP_FLAG_NO_DATA))) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { @@ -313,7 +313,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) return; } - type = grib_accessor_get_native_type(a); + type = a->get_native_type(); switch (type) { case GRIB_TYPE_LONG: snprintf(stype, sizeof(stype), "%s", "long"); @@ -331,7 +331,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) return; } - err = grib_unpack_double(a, buf, &size); + err = a->unpack_double(buf, &size); if (err) { grib_context_free(d->context, buf); diff --git a/src/grib_dumper_class_json.cc b/src/grib_dumper_class_json.cc index a3b052844..dd0210521 100644 --- a/src/grib_dumper_class_json.cc +++ b/src/grib_dumper_class_json.cc @@ -129,15 +129,15 @@ static void dump_values(grib_dumper* d, grib_accessor* a) return; h = grib_handle_of_accessor(a); - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); + err = a->unpack_double(&value, &size2); } Assert(size2 == size); (void)err; /* TODO */ @@ -222,15 +222,15 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); + err = a->unpack_long(&value, &size2); } Assert(size2 == size); @@ -327,7 +327,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_unpack_double(a, &value, &size); + a->unpack_double(&value, &size); if (self->begin == 0 && self->empty == 0 && self->isAttribute == 0) fprintf(self->dumper.out, ",\n"); @@ -374,7 +374,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { dump_string(d, a, comment); @@ -401,7 +401,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm return; } - err = grib_unpack_string_array(a, values, &size); + err = a->unpack_string_array(values, &size); if (self->isLeaf == 0) { fprintf(self->dumper.out, "%-*s", depth, " "); @@ -470,7 +470,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) self->empty = 0; - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); if (err) { snprintf(value, sizeof(value), " *** ERR=%d (%s) [dump_string on '%s']", err, grib_get_error_message(err), a->name); @@ -582,7 +582,7 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a) fprintf(out, "\"%s\" : ", a->attributes[i]->name); flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; - switch (grib_accessor_get_native_type(a->attributes[i])) { + switch (a->attributes[i]->get_native_type()) { case GRIB_TYPE_LONG: dump_long(d, a->attributes[i], 0); break; diff --git a/src/grib_dumper_class_serialize.cc b/src/grib_dumper_class_serialize.cc index 6dc4d5c87..57f10cee0 100644 --- a/src/grib_dumper_class_serialize.cc +++ b/src/grib_dumper_class_serialize.cc @@ -102,7 +102,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_serialize* self = (grib_dumper_serialize*)d; long value = 0; size_t size = 1; - int err = grib_unpack_long(a, &value, &size); + int err = a->unpack_long(&value, &size); if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) return; @@ -136,7 +136,7 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_serialize* self = (grib_dumper_serialize*)d; long value; size_t size = 1; - int err = grib_unpack_long(a, &value, &size); + int err = a->unpack_long(&value, &size); if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) return; @@ -171,7 +171,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_serialize* self = (grib_dumper_serialize*)d; double value; size_t size = 1; - int err = grib_unpack_double(a, &value, &size); + int err = a->unpack_double(&value, &size); if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) return; @@ -200,7 +200,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_serialize* self = (grib_dumper_serialize*)d; char value[1024] = {0,}; size_t size = sizeof(value); - int err = grib_unpack_string(a, value, &size); + int err = a->unpack_string(value, &size); int i; char* p = value; @@ -261,7 +261,7 @@ static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) fprintf(self->dumper.out, "\n"); - err = grib_unpack_bytes(a, buf, &size); + err = a->unpack_bytes(buf, &size); if (err) { grib_context_free(d->context, buf); fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_serialize::dump_bytes]\n}", err, grib_get_error_message(err)); @@ -319,7 +319,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (self->format) { @@ -376,7 +376,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) fprintf(self->dumper.out, "\n"); - err = grib_unpack_double(a, buf, &size); + err = a->unpack_double(buf, &size); if (err) { grib_context_free(d->context, buf); diff --git a/src/grib_dumper_class_wmo.cc b/src/grib_dumper_class_wmo.cc index 814ed016f..3949e97a2 100644 --- a/src/grib_dumper_class_wmo.cc +++ b/src/grib_dumper_class_wmo.cc @@ -152,15 +152,15 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = a->unpack_long(values, &size); } else { - err = grib_unpack_long(a, &value, &size); + err = a->unpack_long(&value, &size); } if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && @@ -192,7 +192,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } } else { - if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && a->is_missing_internal()) fprintf(self->dumper.out, "%s = MISSING", a->name); else fprintf(self->dumper.out, "%s = %ld", a->name, value); @@ -228,7 +228,7 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - err = grib_unpack_long(a, &value, &size); + err = a->unpack_long(&value, &size); set_begin_end(d, a); //for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); @@ -274,7 +274,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - err = grib_unpack_double(a, &value, &size); + err = a->unpack_double(&value, &size); set_begin_end(d, a); //for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); @@ -283,7 +283,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) fprintf(self->dumper.out, "%s (double) ", a->creator->op); - if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && a->is_missing_internal()) fprintf(self->dumper.out, "%s = MISSING", a->name); else fprintf(self->dumper.out, "%s = %g", a->name, value); @@ -317,7 +317,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) grib_context_log(a->context, GRIB_LOG_ERROR, "unable to allocate %zu bytes", size); return; } - err = grib_unpack_string(a, value, &size); + err = a->unpack_string(value, &size); p = value; set_begin_end(d, a); @@ -381,7 +381,7 @@ static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) fprintf(self->dumper.out, "\n"); - err = grib_unpack_bytes(a, buf, &size); + err = a->unpack_bytes(buf, &size); if (err) { grib_context_free(d->context, buf); fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_wmo::dump_bytes]\n}", err, grib_get_error_message(err)); @@ -433,7 +433,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - grib_value_count(a, &count); + a->value_count(&count); size = count; if (size == 1) { @@ -452,7 +452,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) print_offset(self->dumper.out, self->begin, self->theEnd, 12); // ECC-1749 if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { char type_name[32] = ""; - const long native_type = grib_accessor_get_native_type(a); + const long native_type = a->get_native_type(); if (native_type == GRIB_TYPE_LONG) strcpy(type_name, "(int)"); else if (native_type == GRIB_TYPE_DOUBLE) @@ -476,7 +476,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) fprintf(self->dumper.out, "\n"); - err = grib_unpack_double(a, buf, &size); + err = a->unpack_double(buf, &size); if (err) { grib_context_free(d->context, buf); @@ -566,11 +566,11 @@ static void set_begin_end(grib_dumper* d, grib_accessor* a) grib_dumper_wmo* self = (grib_dumper_wmo*)d; if ((d->option_flags & GRIB_DUMP_FLAG_OCTET) != 0) { self->begin = a->offset - self->section_offset + 1; - self->theEnd = grib_get_next_position_offset(a) - self->section_offset; + self->theEnd = a->get_next_position_offset() - self->section_offset; } else { self->begin = a->offset; - self->theEnd = grib_get_next_position_offset(a); + self->theEnd = a->get_next_position_offset(); } } @@ -604,7 +604,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm return; c = a->context; - grib_value_count(a, &count); + a->value_count(&count); if (count == 0) return; size = count; @@ -619,7 +619,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm return; } - err = grib_unpack_string_array(a, values, &size); + err = a->unpack_string_array(values, &size); // print_offset(self->dumper.out,d,a); print_offset(self->dumper.out, self->begin, self->theEnd); diff --git a/src/grib_handle.cc b/src/grib_handle.cc index 732537f12..08b6f7eaa 100644 --- a/src/grib_handle.cc +++ b/src/grib_handle.cc @@ -99,7 +99,7 @@ void grib_empty_section(grib_context* c, grib_section* b) grib_section_delete(c, current->sub_section); current->sub_section = 0; } - grib_accessor_delete(c, current); + current->destroy(c); current = next; } b->block->first = b->block->last = 0; diff --git a/src/grib_keys_iterator.cc b/src/grib_keys_iterator.cc index 854b4a2c5..06c112c04 100644 --- a/src/grib_keys_iterator.cc +++ b/src/grib_keys_iterator.cc @@ -165,11 +165,11 @@ int grib_keys_iterator_next(grib_keys_iterator* kiter) kiter->at_start = 0; } else { - kiter->current = grib_next_accessor(kiter->current); + kiter->current = kiter->current->next_accessor(); } while (kiter->current && skip(kiter)) - kiter->current = grib_next_accessor(kiter->current); + kiter->current = kiter->current->next_accessor(); return kiter->current != NULL; } @@ -200,29 +200,29 @@ 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) { - return grib_unpack_long(kiter->current, v, len); + return kiter->current->unpack_long(v, len); } int grib_keys_iterator_get_double(const grib_keys_iterator* kiter, double* v, size_t* len) { - return grib_unpack_double(kiter->current, v, len); + return kiter->current->unpack_double(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); + return kiter->current->unpack_float(v, len); } int grib_keys_iterator_get_string(const grib_keys_iterator* kiter, char* v, size_t* len) { - return grib_unpack_string(kiter->current, v, len); + return kiter->current->unpack_string(v, len); } int grib_keys_iterator_get_bytes(const grib_keys_iterator* kiter, unsigned char* v, size_t* len) { - return grib_unpack_bytes(kiter->current, v, len); + return kiter->current->unpack_bytes(v, len); } int grib_keys_iterator_get_native_type(const grib_keys_iterator* kiter) { - return grib_accessor_get_native_type(kiter->current); + return kiter->current->get_native_type(); } diff --git a/src/grib_loader_from_handle.cc b/src/grib_loader_from_handle.cc index a423c31cc..a0d1fec6e 100644 --- a/src/grib_loader_from_handle.cc +++ b/src/grib_loader_from_handle.cc @@ -23,14 +23,14 @@ static int copy_values(grib_handle* h, grib_accessor* ga) /*printf("SET VALUES %s\n",h->values[j][i].name);*/ switch (h->values[j][i].type) { case GRIB_TYPE_LONG: - return grib_pack_long(ga, &h->values[j][i].long_value, &len); + return ga->pack_long(&h->values[j][i].long_value, &len); case GRIB_TYPE_DOUBLE: - return grib_pack_double(ga, &h->values[j][i].double_value, &len); + return ga->pack_double(&h->values[j][i].double_value, &len); case GRIB_TYPE_STRING: len = strlen(h->values[j][i].string_value); - return grib_pack_string(ga, h->values[j][i].string_value, &len); + return ga->pack_string(h->values[j][i].string_value, &len); } } } @@ -46,7 +46,7 @@ int grib_lookup_long_from_handle(grib_context* gc, grib_loader* loader, const ch grib_accessor* b = grib_find_accessor(h, name); size_t len = 1; if (b) - return grib_unpack_long(b, value, &len); + return b->unpack_long(value, &len); /* TODO: fix me. For now, we don't fail on a lookup. */ *value = -1; @@ -76,7 +76,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ if (default_value) { grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying: setting %s to default value", ga->name); - grib_pack_expression(ga, grib_arguments_get_expression(h, default_value, 0)); + ga->pack_expression(grib_arguments_get_expression(h, default_value, 0)); } if ((ga->flags & GRIB_ACCESSOR_FLAG_NO_COPY) || @@ -149,11 +149,11 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ } if ((ga->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) && grib_is_missing(h, name, &e) && e == GRIB_SUCCESS && len == 1) { - grib_pack_missing(ga); + ga->pack_missing(); pack_missing = 1; } - const long ga_type = grib_accessor_get_native_type(ga); + const long ga_type = ga->get_native_type(); if ((ga->flags & GRIB_ACCESSOR_FLAG_COPY_IF_CHANGING_EDITION) && !loader->changing_edition) { // See ECC-1560 and ECC-1644 @@ -169,7 +169,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ ret = grib_get_string_internal(h, name, sval, &len); if (ret == GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying string %s to %s", sval, name); - ret = grib_pack_string(ga, sval, &len); + ret = ga->pack_string(sval, &len); } grib_context_free(h->context, sval); @@ -199,7 +199,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ *lval = 0; /* Reset to a reasonable value */ } } - ret = grib_pack_long(ga, lval, &len); + ret = ga->pack_long(lval, &len); } } @@ -220,7 +220,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ ret = GRIB_SUCCESS; } else - ret = grib_pack_double(ga, dval, &len); + ret = ga->pack_double(dval, &len); } grib_context_free(h->context, dval); @@ -229,13 +229,13 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ case GRIB_TYPE_BYTES: ao = grib_find_accessor(h, name); - len = grib_byte_count(ao); + len = ao->byte_count(); uval = (unsigned char*)grib_context_malloc(h->context, len * sizeof(char)); - ret = grib_unpack_bytes(ao, uval, &len); + ret = ao->unpack_bytes(uval, &len); /* ret = grib_get_bytes_internal(h,name,uval,&len); */ if (ret == GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying %d byte(s) to %s", len, name); - ret = grib_pack_bytes(ga, uval, &len); + ret = ga->pack_bytes(uval, &len); } grib_context_free(h->context, uval); @@ -247,7 +247,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ default: grib_context_log(h->context, GRIB_LOG_ERROR, - "Copying %s, cannot establish type %ld [%s]", name, grib_accessor_get_native_type(ga), ga->creator->cclass->name); + "Copying %s, cannot establish type %ld [%s]", name, ga->get_native_type(), ga->creator->cclass->name); break; } diff --git a/src/grib_parse_utils.cc b/src/grib_parse_utils.cc index 1d014995c..51de29332 100644 --- a/src/grib_parse_utils.cc +++ b/src/grib_parse_utils.cc @@ -117,16 +117,16 @@ int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* una switch (type) { case GRIB_TYPE_STRING: replen = 1024; - ret = grib_unpack_string(a, val, &replen); + ret = a->unpack_string(val, &replen); break; case GRIB_TYPE_DOUBLE: replen = 1; - ret = grib_unpack_double(a, &dval, &replen); + ret = a->unpack_double(&dval, &replen); snprintf(val, sizeof(val), "%.12g", dval); break; case GRIB_TYPE_LONG: replen = 1; - ret = grib_unpack_long(a, &lval, &replen); + ret = a->unpack_long(&lval, &replen); snprintf(val, sizeof(val), "%d", (int)lval); break; default: @@ -194,11 +194,11 @@ int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* una // grib_handle* h = grib_handle_of_accessor(a); // if (type == -1) -// type = grib_accessor_get_native_type(a); +// type = a->get_native_type(); // switch (type) { // case GRIB_TYPE_STRING: // replen = sizeof(sbuf) / sizeof(*sbuf); -// ret = grib_unpack_string(a, sbuf, &replen); +// ret = a->unpack_string(sbuf, &replen); // fprintf(out, "%s", sbuf); // break; // case GRIB_TYPE_DOUBLE: @@ -206,7 +206,7 @@ int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* una // myseparator = separator ? (char*)separator : default_separator; // if (name[0] == '/' || name[0] == '#') { // long count; -// ret = grib_value_count(a, &count); +// ret = a->value_count(&count); // size = count; // } // else { @@ -216,7 +216,7 @@ int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* una // dval = (double*)grib_context_malloc_clear(h->context, sizeof(double) * size); // if (name[0] == '/' || name[0] == '#') { // replen = size; -// ret = grib_unpack_double(a, dval, &replen); +// ret = a->unpack_double(dval, &replen); // } // else { // replen = 0; @@ -247,7 +247,7 @@ int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* una // myseparator = separator ? (char*)separator : default_separator; // if (name[0] == '/' || name[0] == '#') { // long count; -// ret = grib_value_count(a, &count); +// ret = a->value_count(&count); // size = count; // } // else { @@ -257,7 +257,7 @@ int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* una // lval = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); // if (name[0] == '/' || name[0] == '#') { // replen = size; -// ret = grib_unpack_long(a, lval, &replen); +// ret = a->unpack_long(lval, &replen); // } // else { // replen = 0; @@ -286,7 +286,7 @@ int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* una // case GRIB_TYPE_BYTES: // replen = a->length; // sval = (char*)grib_context_malloc(h->context, replen * sizeof(char)); -// ret = grib_unpack_string(a, sval, &replen); +// ret = a->unpack_string(sval, &replen); // p = sval; // while ((replen--) > 0) // fprintf(out, "%c", *(p++)); @@ -321,15 +321,15 @@ int grib_accessors_list_print(grib_handle* h, grib_accessors_list* al, const cha maxcols = INT_MAX; if (type == -1) - type = grib_accessor_get_native_type(al->accessor); - grib_accessors_list_value_count(al, &size); + type = al->accessor->get_native_type(); + al->value_count(&size); switch (type) { case GRIB_TYPE_STRING: myseparator = separator ? (char*)separator : default_separator; if (size == 1) { char sbuf[1024] = {0,}; len = sizeof(sbuf); - ret = grib_unpack_string(al->accessor, sbuf, &len); + ret = al->accessor->unpack_string(sbuf, &len); if (grib_is_missing_string(al->accessor, (unsigned char*)sbuf, len)) { fprintf(out, "%s", "MISSING"); } @@ -341,7 +341,7 @@ int grib_accessors_list_print(grib_handle* h, grib_accessors_list* al, const cha int cols = 0; j = 0; cvals = (char**)grib_context_malloc_clear(h->context, sizeof(char*) * size); - grib_accessors_list_unpack_string(al, cvals, &size); + al->unpack_string(cvals, &size); for (j = 0; j < size; j++) { *newline = 1; fprintf(out, "%s", cvals[j]); @@ -362,7 +362,7 @@ int grib_accessors_list_print(grib_handle* h, grib_accessors_list* al, const cha myformat = format ? (char*)format : double_format; myseparator = separator ? (char*)separator : default_separator; dval = (double*)grib_context_malloc_clear(h->context, sizeof(double) * size); - ret = grib_accessors_list_unpack_double(al, dval, &size); + ret = al->unpack_double(dval, &size); if (size == 1) fprintf(out, myformat, dval[0]); else { @@ -387,7 +387,7 @@ int grib_accessors_list_print(grib_handle* h, grib_accessors_list* al, const cha myformat = format ? (char*)format : long_format; myseparator = separator ? (char*)separator : default_separator; lval = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); - ret = grib_accessors_list_unpack_long(al, lval, &size); + ret = al->unpack_long(lval, &size); if (size == 1) fprintf(out, myformat, lval[0]); else { @@ -411,7 +411,7 @@ int grib_accessors_list_print(grib_handle* h, grib_accessors_list* al, const cha case GRIB_TYPE_BYTES: replen = a->length; bval = (unsigned char*)grib_context_malloc(h->context, replen * sizeof(unsigned char)); - ret = grib_unpack_bytes(al->accessor, bval, &replen); + ret = al->accessor->unpack_bytes(bval, &replen); for (j = 0; j < replen; j++) { fprintf(out, "%02x", bval[j]); } diff --git a/src/grib_query.cc b/src/grib_query.cc index 253217c0b..e8d82541d 100644 --- a/src/grib_query.cc +++ b/src/grib_query.cc @@ -213,7 +213,11 @@ static char* get_condition(const char* name, codes_condition* condition) static grib_accessor* _search_by_rank(grib_accessor* a, const char* name, int rank) { - grib_trie_with_rank* t = accessor_bufr_data_array_get_dataAccessorsTrie(a); + // ===== TODO(maee): Enable when grib_accessor_class_bufr_data_array.cc is moved to C++ ===== + throw "grib_accessor_class_bufr_data_array.cc is not yet moved to C++"; + grib_trie_with_rank* t = NULL; + //grib_trie_with_rank* t = accessor_bufr_data_array_get_dataAccessorsTrie(a); + // ===== END TODO ===== grib_accessor* ret = (grib_accessor*)grib_trie_with_rank_get(t, name, rank); return ret; } @@ -257,14 +261,14 @@ static int get_single_long_val(grib_accessor* a, long* result) size_t size = 1; if (c->bufr_multi_element_constant_arrays) { long count = 0; - grib_value_count(a, &count); + a->value_count(&count); if (count > 1) { size_t i = 0; long val0 = 0; int is_constant = 1; long* values = (long*)grib_context_malloc_clear(c, sizeof(long) * count); size = count; - err = grib_unpack_long(a, values, &size); + err = a->unpack_long(values, &size); val0 = values[0]; for (i = 0; i < size; i++) { if (val0 != values[i]) { @@ -281,11 +285,11 @@ static int get_single_long_val(grib_accessor* a, long* result) } } else { - err = grib_unpack_long(a, result, &size); + err = a->unpack_long(result, &size); } } else { - err = grib_unpack_long(a, result, &size); + err = a->unpack_long(result, &size); } return err; } @@ -296,14 +300,14 @@ static int get_single_double_val(grib_accessor* a, double* result) size_t size = 1; if (c->bufr_multi_element_constant_arrays) { long count = 0; - grib_value_count(a, &count); + a->value_count(&count); if (count > 1) { size_t i = 0; double val0 = 0; int is_constant = 1; double* values = (double*)grib_context_malloc_clear(c, sizeof(double) * count); size = count; - err = grib_unpack_double(a, values, &size); + err = a->unpack_double(values, &size); val0 = values[0]; for (i = 0; i < size; i++) { if (val0 != values[i]) { @@ -320,11 +324,11 @@ static int get_single_double_val(grib_accessor* a, double* result) } } else { - err = grib_unpack_double(a, result, &size); + err = a->unpack_double(result, &size); } } else { - err = grib_unpack_double(a, result, &size); + err = a->unpack_double(result, &size); } return err; } @@ -377,27 +381,27 @@ static void search_from_accessors_list(grib_accessors_list* al, const grib_acces while (al && al != end && al->accessor) { if (grib_inline_strcmp(al->accessor->name, accessor_name) == 0) { if (attribute_name[0]) { - accessor_result = grib_accessor_get_attribute(al->accessor, attribute_name); + accessor_result = al->accessor->get_attribute(attribute_name); } else { accessor_result = al->accessor; } if (accessor_result) { - grib_accessors_list_push(result, accessor_result, al->rank); + result->push(accessor_result, al->rank); } } - al = al->next; + al = al->next_; } if (al == end && al->accessor) { if (grib_inline_strcmp(al->accessor->name, accessor_name) == 0) { if (attribute_name[0]) { - accessor_result = grib_accessor_get_attribute(al->accessor, attribute_name); + accessor_result = al->accessor->get_attribute(attribute_name); } else { accessor_result = al->accessor; } if (accessor_result) { - grib_accessors_list_push(result, accessor_result, al->rank); + result->push(accessor_result, al->rank); } } } @@ -416,7 +420,7 @@ static void search_accessors_list_by_condition(grib_accessors_list* al, const ch if (start && !condition_true(al->accessor, condition)) end = al; } - if (start != NULL && (end != NULL || al->next == NULL)) { + if (start != NULL && (end != NULL || al->next_ == NULL)) { if (end == NULL) end = al; search_from_accessors_list(start, end, name, result); @@ -424,7 +428,7 @@ static void search_accessors_list_by_condition(grib_accessors_list* al, const ch start = NULL; end = NULL; } - al = al->next; + al = al->next_; } } @@ -434,7 +438,10 @@ static grib_accessors_list* search_by_condition(grib_handle* h, const char* name grib_accessors_list* result = NULL; grib_accessor* data = search_and_cache(h, "dataAccessors", 0); if (data && condition->left) { - al = accessor_bufr_data_array_get_dataAccessors(data); + // ===== TODO(maee): Enable when grib_accessor_class_bufr_data_array.cc is moved to C++ ===== + //al = accessor_bufr_data_array_get_dataAccessors(data); + throw "grib_accessor_class_bufr_data_array.cc is not yet moved to C++"; + // ===== END TODO ===== if (!al) return NULL; result = (grib_accessors_list*)grib_context_malloc_clear(al->accessor->context, sizeof(grib_accessors_list)); @@ -452,7 +459,7 @@ static void grib_find_same_and_push(grib_accessors_list* al, grib_accessor* a) { if (a) { grib_find_same_and_push(al, a->same); - grib_accessors_list_push(al, a, al->rank); + al->push(a, al->rank); } } @@ -484,7 +491,7 @@ grib_accessors_list* grib_find_accessors_list(const grib_handle* ch, const char* int r; al = (grib_accessors_list*)grib_context_malloc_clear(h->context, sizeof(grib_accessors_list)); str2 = get_rank(h->context, name, &r); - grib_accessors_list_push(al, a, r); + al->push(a, r); grib_context_free(h->context, str2); } } @@ -585,7 +592,7 @@ grib_accessor* grib_find_accessor(const grib_handle* h, const char* name) aret = a; } else if (a) { - aret = grib_accessor_get_attribute(a, attribute_name); + aret = a->get_attribute(attribute_name); grib_context_free(h->context, accessor_name); } } @@ -600,7 +607,7 @@ grib_accessor* grib_find_accessor(const grib_handle* h, const char* name) // *err = GRIB_NOT_FOUND; // return NULL; // } -// if ((act = grib_accessor_get_attribute(a, attr_name)) == NULL) { +// if ((act = a->get_attribute(attr_name)) == NULL) { // *err = GRIB_ATTRIBUTE_NOT_FOUND; // return NULL; // } diff --git a/src/grib_value.cc b/src/grib_value.cc index 1320bc9b7..2913d5849 100644 --- a/src/grib_value.cc +++ b/src/grib_value.cc @@ -13,9 +13,10 @@ #include "grib_api_internal.h" #include "grib_value.h" -#include "grib_accessor.h" +//#include "grib_accessor.h" #include #include +#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 */ @@ -70,7 +71,7 @@ int grib_set_expression(grib_handle* h, const char* name, grib_expression* e) if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return GRIB_READ_ONLY; - ret = grib_pack_expression(a, e); + ret = a->pack_expression(e); if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } @@ -92,7 +93,7 @@ int grib_set_long_internal(grib_handle* h, const char* name, long val) fprintf(stderr, "ECCODES DEBUG grib_set_long_internal %s=%ld\n", name, val); if (a) { - ret = grib_pack_long(a, &val, &l); + ret = a->pack_long(&val, &l); if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } @@ -125,7 +126,7 @@ int grib_set_long(grib_handle* h, const char* name, long val) if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return GRIB_READ_ONLY; - ret = grib_pack_long(a, &val, &l); + ret = a->pack_long(&val, &l); if (ret == GRIB_SUCCESS) return grib_dependency_notify_change(a); @@ -151,7 +152,7 @@ int grib_set_double_internal(grib_handle* h, const char* name, double val) fprintf(stderr, "ECCODES DEBUG grib_set_double_internal %s=%.10g\n", name, val); if (a) { - ret = grib_pack_double(a, &val, &l); + ret = a->pack_double(&val, &l); if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } @@ -357,7 +358,7 @@ int grib_set_double(grib_handle* h, const char* name, double val) if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return GRIB_READ_ONLY; - ret = grib_pack_double(a, &val, &l); + ret = a->pack_double(&val, &l); if (ret == GRIB_SUCCESS) return grib_dependency_notify_change(a); @@ -378,7 +379,7 @@ int grib_set_string_internal(grib_handle* h, const char* name, fprintf(stderr, "ECCODES DEBUG grib_set_string_internal %s=%s\n", name, val); if (a) { - ret = grib_pack_string(a, val, length); + ret = a->pack_string(val, length); if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } @@ -475,7 +476,7 @@ int grib_set_string(grib_handle* h, const char* name, const char* val, size_t* l if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return GRIB_READ_ONLY; - ret = grib_pack_string(a, val, length); + ret = a->pack_string(val, length); if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } @@ -504,7 +505,7 @@ int grib_set_string_array(grib_handle* h, const char* name, const char** val, si if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return GRIB_READ_ONLY; - ret = grib_pack_string_array(a, val, &length); + ret = a->pack_string_array(val, &length); if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } @@ -519,7 +520,7 @@ int grib_set_string_array(grib_handle* h, const char* name, const char** val, si // grib_accessor* a = NULL; // a = grib_find_accessor(h, name); // if (a) { -// ret = grib_pack_bytes(a, val, length); +// ret = a->pack_bytes(val, length); // if (ret == GRIB_SUCCESS) { // return grib_dependency_notify_change(a); // } @@ -540,7 +541,7 @@ int grib_set_bytes(grib_handle* h, const char* name, const unsigned char* val, s /* if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) */ /* return GRIB_READ_ONLY; */ - ret = grib_pack_bytes(a, val, length); + ret = a->pack_bytes(val, length); if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } @@ -557,7 +558,7 @@ int grib_set_bytes(grib_handle* h, const char* name, const unsigned char* val, s // if (a) { // if (a->length == 0) // return 0; -// if ((ret = grib_pack_zero(a)) != GRIB_SUCCESS) +// if ((ret = a->grib_pack_zero()) != GRIB_SUCCESS) // grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to clear %s (%s)", // name, grib_get_error_message(ret)); // return ret; @@ -581,7 +582,7 @@ int grib_set_missing(grib_handle* h, const char* name) if (h->context->debug) fprintf(stderr, "ECCODES DEBUG grib_set_missing %s\n", name); - ret = grib_pack_missing(a); + ret = a->pack_missing(); if (ret == GRIB_SUCCESS) return grib_dependency_notify_change(a); } @@ -637,7 +638,7 @@ int grib_accessor_is_missing(grib_accessor* a, int* err) *err = GRIB_SUCCESS; if (a) { if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) - return grib_is_missing_internal(a); + return a->is_missing_internal(); else return 0; } @@ -697,7 +698,7 @@ static int _grib_set_double_array_internal(grib_handle* h, grib_accessor* a, if (err == GRIB_SUCCESS) { size_t len = buffer_len - *encoded_length; if (len) { - err = grib_pack_double(a, val + *encoded_length, &len); + err = a->pack_double(val + *encoded_length, &len); *encoded_length += len; if (err == GRIB_SUCCESS) { /* See ECC-778 */ @@ -729,7 +730,7 @@ static int _grib_set_double_array(grib_handle* h, const char* name, if (name[0] == '/' || name[0] == '#') { if (check && (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) return GRIB_READ_ONLY; - err = grib_pack_double(a, val, &length); + err = a->pack_double(val, &length); encoded = length; } else @@ -754,7 +755,7 @@ int grib_set_double_array_internal(grib_handle* h, const char* name, const doubl if (length == 0) { grib_accessor* a = grib_find_accessor(h, name); - ret = grib_pack_double(a, val, &length); + ret = a->pack_double(val, &length); } else { ret = _grib_set_double_array(h, name, val, length, 0); @@ -783,7 +784,7 @@ static int __grib_set_double_array(grib_handle* h, const char* name, const doubl if (length == 0) { grib_accessor* a = grib_find_accessor(h, name); - return grib_pack_double(a, val, &length); + return a->pack_double(val, &length); } /*second order doesn't have a proper representation for constant fields @@ -873,7 +874,7 @@ static int _grib_set_long_array_internal(grib_handle* h, grib_accessor* a, const if (err == GRIB_SUCCESS) { size_t len = buffer_len - *encoded_length; if (len) { - err = grib_pack_long(a, val + *encoded_length, &len); + err = a->pack_long(val + *encoded_length, &len); *encoded_length += len; } else { @@ -915,7 +916,7 @@ static int _grib_set_long_array(grib_handle* h, const char* name, const long* va if (name[0] == '/' || name[0] == '#') { if (check && (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) return GRIB_READ_ONLY; - err = grib_pack_long(a, val, &length); + err = a->pack_long(val, &length); encoded = length; } else @@ -989,14 +990,14 @@ int grib_get_long(const grib_handle* h, const char* name, long* val) al = grib_find_accessors_list(h, name); if (!al) return GRIB_NOT_FOUND; - ret = grib_unpack_long(al->accessor, val, &length); + ret = al->accessor->unpack_long(val, &length); grib_context_free(h->context, al); } else { a = grib_find_accessor(h, name); if (!a) return GRIB_NOT_FOUND; - ret = grib_unpack_long(a, val, &length); + ret = a->unpack_long(val, &length); } return ret; } @@ -1024,14 +1025,14 @@ int grib_get_double(const grib_handle* h, const char* name, double* val) al = grib_find_accessors_list(h, name); if (!al) return GRIB_NOT_FOUND; - ret = grib_unpack_double(al->accessor, val, &length); + ret = al->accessor->unpack_double(val, &length); grib_context_free(h->context, al); } else { a = grib_find_accessor(h, name); if (!a) return GRIB_NOT_FOUND; - ret = grib_unpack_double(a, val, &length); + ret = a->unpack_double(val, &length); } return ret; } @@ -1047,14 +1048,14 @@ int grib_get_float(const grib_handle* h, const char* name, float* val) al = grib_find_accessors_list(h, name); if (!al) return GRIB_NOT_FOUND; - ret = grib_unpack_float(al->accessor, val, &length); + ret = al->accessor->unpack_float(val, &length); grib_context_free(h->context, al); } else { a = grib_find_accessor(h, name); if (!a) return GRIB_NOT_FOUND; - ret = grib_unpack_float(a, val, &length); + ret = a->unpack_float(val, &length); } return ret; } @@ -1076,7 +1077,7 @@ int grib_get_double_element(const grib_handle* h, const char* name, int i, doubl grib_accessor* act = grib_find_accessor(h, name); if (act) { - return grib_unpack_double_element(act, i, val); + return act->unpack_double_element(i, val); } return GRIB_NOT_FOUND; } @@ -1085,7 +1086,7 @@ int grib_get_float_element(const grib_handle* h, const char* name, int i, float* grib_accessor* act = grib_find_accessor(h, name); if (act) { - return grib_unpack_float_element(act, i, val); + return act->unpack_float_element(i, val); } return GRIB_NOT_FOUND; } @@ -1118,7 +1119,7 @@ int grib_get_double_element_set(const grib_handle* h, const char* name, const si grib_accessor* acc = grib_find_accessor(h, name); if (acc) { - return grib_unpack_double_element_set(acc, index_array, len, val_array); + return acc->unpack_double_element_set(index_array, len, val_array); } return GRIB_NOT_FOUND; } @@ -1127,7 +1128,7 @@ int grib_get_float_element_set(const grib_handle* h, const char* name, const siz grib_accessor* acc = grib_find_accessor(h, name); if (acc) { - return grib_unpack_float_element_set(acc, index_array, len, val_array); + return acc->unpack_float_element_set(index_array, len, val_array); } return GRIB_NOT_FOUND; } @@ -1168,7 +1169,7 @@ int grib_get_double_elements(const grib_handle* h, const char* name, const int* return GRIB_OUT_OF_MEMORY; } - err = grib_unpack_double(act, values, &size); + err = act->unpack_double(values, &size); if (!err) { for (j = 0; j < len; j++) { val_array[j] = values[index_array[j]]; @@ -1206,7 +1207,7 @@ int grib_get_string(const grib_handle* h, const char* name, char* val, size_t* l al = grib_find_accessors_list(h, name); if (!al) return GRIB_NOT_FOUND; - ret = grib_unpack_string(al->accessor, val, length); + ret = al->accessor->unpack_string(val, length); grib_context_free(h->context, al); return ret; } @@ -1214,7 +1215,7 @@ int grib_get_string(const grib_handle* h, const char* name, char* val, size_t* l a = grib_find_accessor(h, name); if (!a) return GRIB_NOT_FOUND; - return grib_unpack_string(a, val, length); + return a->unpack_string(val, length); } } @@ -1232,7 +1233,7 @@ int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, s { int err = 0; grib_accessor* act = grib_find_accessor(h, name); - err = act ? grib_unpack_bytes(act, val, length) : GRIB_NOT_FOUND; + err = act ? act->unpack_bytes(val, length) : GRIB_NOT_FOUND; if (err) grib_context_log(h->context, GRIB_LOG_ERROR, "grib_get_bytes %s failed %s", name, grib_get_error_message(err)); @@ -1251,14 +1252,14 @@ int grib_get_native_type(const grib_handle* h, const char* name, int* type) al = grib_find_accessors_list(h, name); if (!al) return GRIB_NOT_FOUND; - *type = grib_accessor_get_native_type(al->accessor); + *type = al->accessor->get_native_type(); grib_context_free(h->context, al); } else { a = grib_find_accessor(h, name); if (!a) return GRIB_NOT_FOUND; - *type = grib_accessor_get_native_type(a); + *type = a->get_native_type(); } return GRIB_SUCCESS; @@ -1273,13 +1274,13 @@ int grib_get_native_type(const grib_handle* h, const char* name, int* type) 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"); + //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); if (err == GRIB_SUCCESS) { size_t len = buffer_len - *decoded_length; - err = grib_unpack(a, val + *decoded_length, &len); + err = a->unpack(val + *decoded_length, &len); *decoded_length += len; } @@ -1311,7 +1312,7 @@ int grib_get_double_array(const grib_handle* h, const char* name, double* val, s al = grib_find_accessors_list(h, name); if (!al) return GRIB_NOT_FOUND; - ret = grib_accessors_list_unpack_double(al, val, length); + ret = al->unpack_double(val, length); grib_accessors_list_delete(h->context, al); return ret; } @@ -1320,7 +1321,7 @@ 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(a, val, length); + return a->unpack(val, length); } else { *length = 0; @@ -1364,7 +1365,7 @@ int grib_get_string_length_acc(grib_accessor* a, size_t* size) *size = 0; while (a) { - s = grib_string_length(a); + s = a->string_length(); if (s > *size) *size = s; a = a->same; @@ -1407,7 +1408,7 @@ int grib_get_size_acc(const grib_handle* h, grib_accessor* a, size_t* size) *size = 0; while (a) { if (err == 0) { - err = grib_value_count(a, &count); + err = a->value_count(&count); if (err) return err; *size += count; @@ -1429,7 +1430,7 @@ int grib_get_size(const grib_handle* ch, const char* name, size_t* size) al = grib_find_accessors_list(h, name); if (!al) return GRIB_NOT_FOUND; - ret = grib_accessors_list_value_count(al, size); + ret = al->value_count(size); grib_accessors_list_delete(h->context, al); return ret; } @@ -1439,7 +1440,7 @@ int grib_get_size(const grib_handle* ch, const char* name, size_t* size) return GRIB_NOT_FOUND; if (name[0] == '#') { long count = *size; - ret = grib_value_count(a, &count); + ret = a->value_count(&count); *size = count; return ret; } @@ -1471,7 +1472,7 @@ int grib_get_offset(const grib_handle* ch, const char* key, size_t* val) const grib_handle* h = (grib_handle*)ch; grib_accessor* act = grib_find_accessor(h, key); if (act) { - *val = (size_t)grib_byte_offset(act); + *val = (size_t) act->byte_offset(); return GRIB_SUCCESS; } return GRIB_NOT_FOUND; @@ -1484,7 +1485,7 @@ static int grib_get_string_array_internal_(const grib_handle* h, grib_accessor* if (err == GRIB_SUCCESS) { size_t len = buffer_len - *decoded_length; - err = grib_unpack_string_array(a, val + *decoded_length, &len); + err = a->unpack_string_array(val + *decoded_length, &len); *decoded_length += len; } @@ -1506,7 +1507,7 @@ int grib_get_string_array(const grib_handle* h, const char* name, char** val, si al = grib_find_accessors_list(h, name); if (!al) return GRIB_NOT_FOUND; - ret = grib_accessors_list_unpack_string(al, val, length); + ret = al->unpack_string(val, length); grib_context_free(h->context, al); return ret; } @@ -1515,7 +1516,7 @@ int grib_get_string_array(const grib_handle* h, const char* name, char** val, si if (!a) return GRIB_NOT_FOUND; if (name[0] == '#') { - return grib_unpack_string_array(a, val, length); + return a->unpack_string_array(val, length); } else { *length = 0; @@ -1531,7 +1532,7 @@ static int _grib_get_long_array_internal(const grib_handle* h, grib_accessor* a, if (err == GRIB_SUCCESS) { size_t len = buffer_len - *decoded_length; - err = grib_unpack_long(a, val + *decoded_length, &len); + err = a->unpack_long(val + *decoded_length, &len); *decoded_length += len; } @@ -1565,7 +1566,7 @@ int grib_get_long_array(const grib_handle* h, const char* name, long* val, size_ al = grib_find_accessors_list(h, name); if (!al) return GRIB_NOT_FOUND; - ret = grib_accessors_list_unpack_long(al, val, length); + ret = al->unpack_long(val, length); grib_context_free(h->context, al); } else { @@ -1573,7 +1574,7 @@ int grib_get_long_array(const grib_handle* h, const char* name, long* val, size_ if (!a) return GRIB_NOT_FOUND; if (name[0] == '#') { - return grib_unpack_long(a, val, length); + return a->unpack_long(val, length); } else { *length = 0; @@ -1838,7 +1839,7 @@ int grib_get_nearest_smaller_value(grib_handle* h, const char* name, { grib_accessor* act = grib_find_accessor(h, name); Assert(act); - return grib_nearest_smaller_value(act, val, nearest); + return act->nearest_smaller_value(val, nearest); } void grib_print_values(const char* title, grib_values* values, FILE* out) @@ -2028,5 +2029,5 @@ int codes_compare_key(grib_handle* h1, grib_handle* h2, const char* key, int com return GRIB_NOT_FOUND; } - return grib_compare_accessors(a1, a2, GRIB_COMPARE_TYPES); + return a1->compare_accessors(a2, GRIB_COMPARE_TYPES); } diff --git a/tests/grib_unpack_subarray.cc b/tests/grib_unpack_subarray.cc index 3321b4040..1a7bfadab 100644 --- a/tests/grib_unpack_subarray.cc +++ b/tests/grib_unpack_subarray.cc @@ -34,12 +34,12 @@ int main(int argc, char** argv) Assert(sub_values); size_t len = nvalues; - GRIB_CHECK(grib_unpack_double(a, all_values, &len), 0); + GRIB_CHECK(a->unpack_double(all_values, &len), 0); size_t start = nvalues / 10; len = nvalues / 5; printf("nvalues=%zu, start=%zu, len=%zu\n", nvalues, start, len); - GRIB_CHECK(grib_unpack_double_subarray(a, sub_values, start, len), 0); + GRIB_CHECK(a->unpack_double_subarray(sub_values, start, len), 0); for (size_t i = 0; i < len; ++i) { //printf("sub[%zu]=%.10e\n", start + i, sub_values[i]); Assert(all_values[start+i] == sub_values[i]); diff --git a/tools/bufr_dump.cc b/tools/bufr_dump.cc index ae4c485cc..679ec79a3 100644 --- a/tools/bufr_dump.cc +++ b/tools/bufr_dump.cc @@ -475,7 +475,10 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) } } a = grib_find_accessor(h, "numericValues"); - al = accessor_bufr_data_array_get_dataAccessors(a); + // ===== TODO(maee): Reanable this ==== + //al = accessor_bufr_data_array_get_dataAccessors(a); + throw std::runtime_error("Functionality disabled"); + // ===== TODO(maee): Reanable this ==== options->dump_flags = GRIB_DUMP_FLAG_ALL_ATTRIBUTES; codes_dump_bufr_flat(al, h, stdout, options->dump_mode, options->dump_flags, 0); break; From c598a51954c8f5e1a41919b930b59217e0b7a9d2 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 18 Mar 2024 12:55:12 +0000 Subject: [PATCH 007/196] Add "accessor/" prefix to grib_accessor_class_*.cc --- src/CMakeLists.txt | 396 ++++++++++++++++++++++----------------------- 1 file changed, 198 insertions(+), 198 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 21548a39c..53e2c3b1d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,9 +9,9 @@ # nor does it submit to any jurisdiction. # list( APPEND eccodes_src_files - ./accessor/grib_accessor.cc - ./accessor/grib_accessors_list.cc - ./grib_accessor_class.cc + accessor/grib_accessor.cc + accessor/grib_accessors_list.cc + grib_accessor_class.cc step_unit.cc step.cc step_utilities.cc @@ -23,9 +23,9 @@ list( APPEND eccodes_src_files action_class_gen.cc action_class_if.cc action_class_switch.cc - #grib_accessor_class_g1fcperiod.cc - #grib_accessor_class_g1end_of_interval_monthly.cc - #grib_accessor_class_mars_param.cc + #accessor/grib_accessor_class_g1fcperiod.cc + #accessor/grib_accessor_class_g1end_of_interval_monthly.cc + #accessor/grib_accessor_class_mars_param.cc action_class_section.cc action_class_list.cc action_class_while.cc @@ -63,207 +63,207 @@ list( APPEND eccodes_src_files grib_viarray.cc codes_memfs.cc accessor/grib_accessor_class_gen.cc - #grib_accessor_class_ascii.cc - #grib_accessor_class_bit.cc - #grib_accessor_class_bitmap.cc - #grib_accessor_class_bits.cc - #grib_accessor_class_bits_per_value.cc - #grib_accessor_class_bufr_elements_table.cc - #grib_accessor_class_bufr_data_array.cc - #grib_accessor_class_bufr_data_element.cc - #grib_accessor_class_bufr_group.cc - #grib_accessor_class_bufr_string_values.cc - #grib_accessor_class_pack_bufr_values.cc - #grib_accessor_class_unpack_bufr_values.cc - #grib_accessor_class_group.cc - #grib_accessor_class_non_alpha.cc - #grib_accessor_class_g1bitmap.cc - #grib_accessor_class_g2bitmap.cc - #grib_accessor_class_concept.cc - #grib_accessor_class_hash_array.cc - #grib_accessor_class_decimal_precision.cc - #grib_accessor_class_divdouble.cc - #grib_accessor_class_multdouble.cc - #grib_accessor_class_budgdate.cc - #grib_accessor_class_validity_date.cc - #grib_accessor_class_validity_time.cc - #grib_accessor_class_bytes.cc - #grib_accessor_class_change_alternative_row_scanning.cc - #grib_accessor_class_change_scanning_direction.cc - #grib_accessor_class_check_internal_version.cc - #grib_accessor_class_codeflag.cc + #accessor/grib_accessor_class_ascii.cc + #accessor/grib_accessor_class_bit.cc + #accessor/grib_accessor_class_bitmap.cc + #accessor/grib_accessor_class_bits.cc + #accessor/grib_accessor_class_bits_per_value.cc + #accessor/grib_accessor_class_bufr_elements_table.cc + #accessor/grib_accessor_class_bufr_data_array.cc + #accessor/grib_accessor_class_bufr_data_element.cc + #accessor/grib_accessor_class_bufr_group.cc + #accessor/grib_accessor_class_bufr_string_values.cc + #accessor/grib_accessor_class_pack_bufr_values.cc + #accessor/grib_accessor_class_unpack_bufr_values.cc + #accessor/grib_accessor_class_group.cc + #accessor/grib_accessor_class_non_alpha.cc + #accessor/grib_accessor_class_g1bitmap.cc + #accessor/grib_accessor_class_g2bitmap.cc + #accessor/grib_accessor_class_concept.cc + #accessor/grib_accessor_class_hash_array.cc + #accessor/grib_accessor_class_decimal_precision.cc + #accessor/grib_accessor_class_divdouble.cc + #accessor/grib_accessor_class_multdouble.cc + #accessor/grib_accessor_class_budgdate.cc + #accessor/grib_accessor_class_validity_date.cc + #accessor/grib_accessor_class_validity_time.cc + #accessor/grib_accessor_class_bytes.cc + #accessor/grib_accessor_class_change_alternative_row_scanning.cc + #accessor/grib_accessor_class_change_scanning_direction.cc + #accessor/grib_accessor_class_check_internal_version.cc + #accessor/grib_accessor_class_codeflag.cc accessor/grib_accessor_class_smart_table.cc - #grib_accessor_class_smart_table_column.cc + #accessor/grib_accessor_class_smart_table_column.cc accessor/grib_accessor_class_codetable.cc - #grib_accessor_class_codetable_units.cc - #grib_accessor_class_codetable_title.cc - #grib_accessor_class_step_human_readable.cc - #grib_accessor_class_count_file.cc - #grib_accessor_class_count_total.cc - #grib_accessor_class_double.cc - #grib_accessor_class_element.cc - #grib_accessor_class_evaluate.cc - #grib_accessor_class_g1date.cc - #grib_accessor_class_g1monthlydate.cc - #grib_accessor_class_library_version.cc - #grib_accessor_class_when.cc - #grib_accessor_class_g1verificationdate.cc - #grib_accessor_class_g1day_of_the_year_date.cc - #grib_accessor_class_g1_half_byte_codeflag.cc - #grib_accessor_class_g1forecastmonth.cc - #grib_accessor_class_g1step_range.cc - #grib_accessor_class_g2step_range.cc - #grib_accessor_class_data_g22order_packing.cc - #grib_accessor_class_mars_step.cc - #grib_accessor_class_message_copy.cc - #grib_accessor_class_dictionary.cc - #grib_accessor_class_latlon_increment.cc - #grib_accessor_class_g2date.cc - #grib_accessor_class_g2level.cc - #grib_accessor_class_g2end_step.cc - #grib_accessor_class_g2latlon.cc - #grib_accessor_class_g2lon.cc - #grib_accessor_class_global_gaussian.cc - #grib_accessor_class_gaussian_grid_name.cc - #grib_accessor_class_gen.cc - #grib_accessor_class_getenv.cc - #grib_accessor_class_gts_header.cc - #grib_accessor_class_ifs_param.cc - #grib_accessor_class_julian_day.cc - #grib_accessor_class_julian_date.cc - #grib_accessor_class_closest_date.cc - #grib_accessor_class_latlonvalues.cc - #grib_accessor_class_latitudes.cc - #grib_accessor_class_longitudes.cc - #grib_accessor_class_offset_file.cc - #grib_accessor_class_scale.cc - #grib_accessor_class_from_scale_factor_scaled_value.cc - #grib_accessor_class_g2bitmap_present.cc - #grib_accessor_class_ibmfloat.cc - #grib_accessor_class_ieeefloat.cc + #accessor/grib_accessor_class_codetable_units.cc + #accessor/grib_accessor_class_codetable_title.cc + #accessor/grib_accessor_class_step_human_readable.cc + #accessor/grib_accessor_class_count_file.cc + #accessor/grib_accessor_class_count_total.cc + #accessor/grib_accessor_class_double.cc + #accessor/grib_accessor_class_element.cc + #accessor/grib_accessor_class_evaluate.cc + #accessor/grib_accessor_class_g1date.cc + #accessor/grib_accessor_class_g1monthlydate.cc + #accessor/grib_accessor_class_library_version.cc + #accessor/grib_accessor_class_when.cc + #accessor/grib_accessor_class_g1verificationdate.cc + #accessor/grib_accessor_class_g1day_of_the_year_date.cc + #accessor/grib_accessor_class_g1_half_byte_codeflag.cc + #accessor/grib_accessor_class_g1forecastmonth.cc + #accessor/grib_accessor_class_g1step_range.cc + #accessor/grib_accessor_class_g2step_range.cc + #accessor/grib_accessor_class_data_g22order_packing.cc + #accessor/grib_accessor_class_mars_step.cc + #accessor/grib_accessor_class_message_copy.cc + #accessor/grib_accessor_class_dictionary.cc + #accessor/grib_accessor_class_latlon_increment.cc + #accessor/grib_accessor_class_g2date.cc + #accessor/grib_accessor_class_g2level.cc + #accessor/grib_accessor_class_g2end_step.cc + #accessor/grib_accessor_class_g2latlon.cc + #accessor/grib_accessor_class_g2lon.cc + #accessor/grib_accessor_class_global_gaussian.cc + #accessor/grib_accessor_class_gaussian_grid_name.cc + #accessor/grib_accessor_class_gen.cc + #accessor/grib_accessor_class_getenv.cc + #accessor/grib_accessor_class_gts_header.cc + #accessor/grib_accessor_class_ifs_param.cc + #accessor/grib_accessor_class_julian_day.cc + #accessor/grib_accessor_class_julian_date.cc + #accessor/grib_accessor_class_closest_date.cc + #accessor/grib_accessor_class_latlonvalues.cc + #accessor/grib_accessor_class_latitudes.cc + #accessor/grib_accessor_class_longitudes.cc + #accessor/grib_accessor_class_offset_file.cc + #accessor/grib_accessor_class_scale.cc + #accessor/grib_accessor_class_from_scale_factor_scaled_value.cc + #accessor/grib_accessor_class_g2bitmap_present.cc + #accessor/grib_accessor_class_ibmfloat.cc + #accessor/grib_accessor_class_ieeefloat.cc accessor/grib_accessor_class_constant.cc accessor/grib_accessor_class_iterator.cc - #grib_accessor_class_message.cc + #accessor/grib_accessor_class_message.cc accessor/grib_accessor_class_nearest.cc - #grib_accessor_class_ksec1expver.cc - #grib_accessor_class_label.cc + #accessor/grib_accessor_class_ksec1expver.cc + #accessor/grib_accessor_class_label.cc accessor/grib_accessor_class_long.cc - #grib_accessor_class_lookup.cc - #grib_accessor_class_octahedral_gaussian.cc - #grib_accessor_class_octet_number.cc - #grib_accessor_class_headers_only.cc - #grib_accessor_class_padding.cc - #grib_accessor_class_pad.cc - #grib_accessor_class_padto.cc - #grib_accessor_class_padtoeven.cc - #grib_accessor_class_padtomultiple.cc - #grib_accessor_class_section_padding.cc - #grib_accessor_class_packing_type.cc - #grib_accessor_class_section_pointer.cc - #grib_accessor_class_position.cc - #grib_accessor_class_signed.cc - #grib_accessor_class_signed_bits.cc - #grib_accessor_class_section.cc - #grib_accessor_class_step_in_units.cc - #grib_accessor_class_optimal_step_units.cc - #grib_accessor_class_section_length.cc - #grib_accessor_class_g1_message_length.cc - #grib_accessor_class_g1_section4_length.cc - #grib_accessor_class_size.cc - #grib_accessor_class_rdbtime_guess_date.cc - #grib_accessor_class_scale_values.cc - #grib_accessor_class_offset_values.cc - #grib_accessor_class_sprintf.cc - #grib_accessor_class_round.cc - #grib_accessor_class_spectral_truncation.cc - #grib_accessor_class_time.cc + #accessor/grib_accessor_class_lookup.cc + #accessor/grib_accessor_class_octahedral_gaussian.cc + #accessor/grib_accessor_class_octet_number.cc + #accessor/grib_accessor_class_headers_only.cc + #accessor/grib_accessor_class_padding.cc + #accessor/grib_accessor_class_pad.cc + #accessor/grib_accessor_class_padto.cc + #accessor/grib_accessor_class_padtoeven.cc + #accessor/grib_accessor_class_padtomultiple.cc + #accessor/grib_accessor_class_section_padding.cc + #accessor/grib_accessor_class_packing_type.cc + #accessor/grib_accessor_class_section_pointer.cc + #accessor/grib_accessor_class_position.cc + #accessor/grib_accessor_class_signed.cc + #accessor/grib_accessor_class_signed_bits.cc + #accessor/grib_accessor_class_section.cc + #accessor/grib_accessor_class_step_in_units.cc + #accessor/grib_accessor_class_optimal_step_units.cc + #accessor/grib_accessor_class_section_length.cc + #accessor/grib_accessor_class_g1_message_length.cc + #accessor/grib_accessor_class_g1_section4_length.cc + #accessor/grib_accessor_class_size.cc + #accessor/grib_accessor_class_rdbtime_guess_date.cc + #accessor/grib_accessor_class_scale_values.cc + #accessor/grib_accessor_class_offset_values.cc + #accessor/grib_accessor_class_sprintf.cc + #accessor/grib_accessor_class_round.cc + #accessor/grib_accessor_class_spectral_truncation.cc + #accessor/grib_accessor_class_time.cc accessor/grib_accessor_class_transient.cc - #grib_accessor_class_trim.cc - #grib_accessor_class_transient_darray.cc - #grib_accessor_class_values.cc - #grib_accessor_class_simple_packing_error.cc - #grib_accessor_class_data_simple_packing.cc - #grib_accessor_class_count_missing.cc - #grib_accessor_class_data_sh_packed.cc - #grib_accessor_class_data_sh_unpacked.cc - #grib_accessor_class_number_of_values_data_raw_packing.cc - #grib_accessor_class_data_g1simple_packing.cc - #grib_accessor_class_data_g1shsimple_packing.cc - #grib_accessor_class_data_shsimple_packing.cc - #grib_accessor_class_data_dummy_field.cc + #accessor/grib_accessor_class_trim.cc + #accessor/grib_accessor_class_transient_darray.cc + #accessor/grib_accessor_class_values.cc + #accessor/grib_accessor_class_simple_packing_error.cc + #accessor/grib_accessor_class_data_simple_packing.cc + #accessor/grib_accessor_class_count_missing.cc + #accessor/grib_accessor_class_data_sh_packed.cc + #accessor/grib_accessor_class_data_sh_unpacked.cc + #accessor/grib_accessor_class_number_of_values_data_raw_packing.cc + #accessor/grib_accessor_class_data_g1simple_packing.cc + #accessor/grib_accessor_class_data_g1shsimple_packing.cc + #accessor/grib_accessor_class_data_shsimple_packing.cc + #accessor/grib_accessor_class_data_dummy_field.cc accessor/grib_accessor_class_variable.cc - #grib_accessor_class_second_order_bits_per_value.cc - #grib_accessor_class_data_g2simple_packing.cc - #grib_accessor_class_data_g2simple_packing_with_preprocessing.cc - #grib_accessor_class_data_g2shsimple_packing.cc - #grib_accessor_class_data_g2complex_packing.cc - #grib_accessor_class_data_g1second_order_row_by_row_packing.cc - #grib_accessor_class_data_g1second_order_constant_width_packing.cc - #grib_accessor_class_data_g1second_order_general_packing.cc - #grib_accessor_class_data_g1second_order_general_extended_packing.cc - #grib_accessor_class_g2grid.cc - #grib_accessor_class_unexpanded_descriptors.cc - #grib_accessor_class_expanded_descriptors.cc - #grib_accessor_class_bufrdc_expanded_descriptors.cc - #grib_accessor_class_data_apply_bitmap.cc - #grib_accessor_class_data_apply_boustrophedonic.cc - #grib_accessor_class_data_apply_boustrophedonic_bitmap.cc - #grib_accessor_class_data_secondary_bitmap.cc - #grib_accessor_class_data_g1secondary_bitmap.cc - #grib_accessor_class_data_g2secondary_bitmap.cc - #grib_accessor_class_data_jpeg2000_packing.cc - #grib_accessor_class_data_png_packing.cc - #grib_accessor_class_data_ccsds_packing.cc - #grib_accessor_class_data_raw_packing.cc - #grib_accessor_class_data_complex_packing.cc - #grib_accessor_class_data_g1complex_packing.cc - #grib_accessor_class_gds_not_present_bitmap.cc - #grib_accessor_class_gds_is_present.cc - #grib_accessor_class_select_step_template.cc - #grib_accessor_class_local_definition.cc - #grib_accessor_class_g2_eps.cc - #grib_accessor_class_g2_aerosol.cc - #grib_accessor_class_g2_chemical.cc - #grib_accessor_class_g2_mars_labeling.cc - #grib_accessor_class_md5.cc - #grib_accessor_class_proj_string.cc + #accessor/grib_accessor_class_second_order_bits_per_value.cc + #accessor/grib_accessor_class_data_g2simple_packing.cc + #accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc + #accessor/grib_accessor_class_data_g2shsimple_packing.cc + #accessor/grib_accessor_class_data_g2complex_packing.cc + #accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc + #accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc + #accessor/grib_accessor_class_data_g1second_order_general_packing.cc + #accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc + #accessor/grib_accessor_class_g2grid.cc + #accessor/grib_accessor_class_unexpanded_descriptors.cc + #accessor/grib_accessor_class_expanded_descriptors.cc + #accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc + #accessor/grib_accessor_class_data_apply_bitmap.cc + #accessor/grib_accessor_class_data_apply_boustrophedonic.cc + #accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc + #accessor/grib_accessor_class_data_secondary_bitmap.cc + #accessor/grib_accessor_class_data_g1secondary_bitmap.cc + #accessor/grib_accessor_class_data_g2secondary_bitmap.cc + #accessor/grib_accessor_class_data_jpeg2000_packing.cc + #accessor/grib_accessor_class_data_png_packing.cc + #accessor/grib_accessor_class_data_ccsds_packing.cc + #accessor/grib_accessor_class_data_raw_packing.cc + #accessor/grib_accessor_class_data_complex_packing.cc + #accessor/grib_accessor_class_data_g1complex_packing.cc + #accessor/grib_accessor_class_gds_not_present_bitmap.cc + #accessor/grib_accessor_class_gds_is_present.cc + #accessor/grib_accessor_class_select_step_template.cc + #accessor/grib_accessor_class_local_definition.cc + #accessor/grib_accessor_class_g2_eps.cc + #accessor/grib_accessor_class_g2_aerosol.cc + #accessor/grib_accessor_class_g2_chemical.cc + #accessor/grib_accessor_class_g2_mars_labeling.cc + #accessor/grib_accessor_class_md5.cc + #accessor/grib_accessor_class_proj_string.cc grib_jasper_encoding.cc grib_openjpeg_encoding.cc action_class_set_missing.cc - #grib_accessor_class_number_of_points.cc - #grib_accessor_class_suppressed.cc + #accessor/grib_accessor_class_number_of_points.cc + #accessor/grib_accessor_class_suppressed.cc grib_index.cc - #grib_accessor_class_number_of_points_gaussian.cc - #grib_accessor_class_number_of_values.cc - #grib_accessor_class_number_of_coded_values.cc - #grib_accessor_class_g1number_of_coded_values_sh_complex.cc - #grib_accessor_class_g1number_of_coded_values_sh_simple.cc - #grib_accessor_class_dirty.cc - #grib_accessor_class_statistics.cc - #grib_accessor_class_statistics_spectral.cc + #accessor/grib_accessor_class_number_of_points_gaussian.cc + #accessor/grib_accessor_class_number_of_values.cc + #accessor/grib_accessor_class_number_of_coded_values.cc + #accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc + #accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc + #accessor/grib_accessor_class_dirty.cc + #accessor/grib_accessor_class_statistics.cc + #accessor/grib_accessor_class_statistics_spectral.cc accessor/grib_accessor_class_unsigned.cc - #grib_accessor_class_unsigned_bits.cc - #grib_accessor_class_raw.cc - #grib_accessor_class_bufr_simple_thinning.cc - #grib_accessor_class_bufr_extract_subsets.cc - #grib_accessor_class_bufr_extract_area_subsets.cc - #grib_accessor_class_bufr_extract_datetime_subsets.cc - #grib_accessor_class_spd.cc - #grib_accessor_class_sum.cc - #grib_accessor_class_to_integer.cc - #grib_accessor_class_to_double.cc - #grib_accessor_class_to_string.cc - #grib_accessor_class_sexagesimal2decimal.cc - #grib_accessor_class_vector.cc - #grib_accessor_class_long_vector.cc + #accessor/grib_accessor_class_unsigned_bits.cc + #accessor/grib_accessor_class_raw.cc + #accessor/grib_accessor_class_bufr_simple_thinning.cc + #accessor/grib_accessor_class_bufr_extract_subsets.cc + #accessor/grib_accessor_class_bufr_extract_area_subsets.cc + #accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc + #accessor/grib_accessor_class_spd.cc + #accessor/grib_accessor_class_sum.cc + #accessor/grib_accessor_class_to_integer.cc + #accessor/grib_accessor_class_to_double.cc + #accessor/grib_accessor_class_to_string.cc + #accessor/grib_accessor_class_sexagesimal2decimal.cc + #accessor/grib_accessor_class_vector.cc + #accessor/grib_accessor_class_long_vector.cc grib_gaussian_reduced.cc - #grib_accessor_class_abstract_vector.cc - #grib_accessor_class_abstract_long_vector.cc + #accessor/grib_accessor_class_abstract_vector.cc + #accessor/grib_accessor_class_abstract_long_vector.cc grib_loader_from_handle.cc grib_bits.cc grib_ibmfloat.cc grib_ieeefloat.cc - #grib_accessor_class_reference_value_error.cc + #accessor/grib_accessor_class_reference_value_error.cc grib_memory.cc grib_buffer.cc grib_dumper.cc @@ -366,16 +366,16 @@ list( APPEND eccodes_src_files grib_yacc.h md5.h md5.cc - #grib_accessor_class_uint16.cc - #grib_accessor_class_uint32.cc - #grib_accessor_class_uint32_little_endian.cc - #grib_accessor_class_uint64.cc - #grib_accessor_class_uint64_little_endian.cc - #grib_accessor_class_uint8.cc - #grib_accessor_class_blob.cc + #accessor/grib_accessor_class_uint16.cc + #accessor/grib_accessor_class_uint32.cc + #accessor/grib_accessor_class_uint32_little_endian.cc + #accessor/grib_accessor_class_uint64.cc + #accessor/grib_accessor_class_uint64_little_endian.cc + #accessor/grib_accessor_class_uint8.cc + #accessor/grib_accessor_class_blob.cc grib_optimize_decimal_factor.cc - #grib_accessor_class_data_g2bifourier_packing.cc - #grib_accessor_class_data_run_length_packing.cc + #accessor/grib_accessor_class_data_g2bifourier_packing.cc + #accessor/grib_accessor_class_data_run_length_packing.cc eccodes_windef.h # We ship our own generated lex/yacc C files grib_yacc.cc grib_lex.cc ) From f1d68aa7f63357b394945f85143244461fb9249b Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 18 Mar 2024 22:41:56 +0000 Subject: [PATCH 008/196] 18% tests passed, 276 tests failed out of 337 --- examples/C/grib_pthreads.c | 2 +- src/CMakeLists.txt | 391 +++++----- ...rib_accessor_class_abstract_long_vector.cc | 17 + ...grib_accessor_class_abstract_long_vector.h | 33 + .../grib_accessor_class_abstract_vector.cc | 17 + .../grib_accessor_class_abstract_vector.h | 32 + src/accessor/grib_accessor_class_ascii.cc | 164 +++++ src/accessor/grib_accessor_class_ascii.h | 42 ++ src/accessor/grib_accessor_class_bit.cc | 79 ++ src/accessor/grib_accessor_class_bit.h | 35 + src/accessor/grib_accessor_class_bitmap.cc | 175 +++++ src/accessor/grib_accessor_class_bitmap.h | 45 ++ .../{todo => }/grib_accessor_class_bits.cc | 170 +---- src/accessor/grib_accessor_class_bits.h | 45 ++ .../grib_accessor_class_bits_per_value.cc | 73 ++ .../grib_accessor_class_bits_per_value.h | 35 + src/accessor/grib_accessor_class_blob.cc | 42 ++ src/accessor/grib_accessor_class_blob.h | 34 + src/accessor/grib_accessor_class_budgdate.cc | 82 +++ src/accessor/grib_accessor_class_budgdate.h | 36 + .../grib_accessor_class_bufr_data_array.cc | 530 ++++---------- .../grib_accessor_class_bufr_data_array.h | 93 +++ .../grib_accessor_class_bufr_data_element.cc | 254 ++----- .../grib_accessor_class_bufr_data_element.h | 56 ++ ...grib_accessor_class_bufr_elements_table.cc | 137 +--- .../grib_accessor_class_bufr_elements_table.h | 39 + ...ccessor_class_bufr_extract_area_subsets.cc | 128 +--- ...accessor_class_bufr_extract_area_subsets.h | 43 ++ ...sor_class_bufr_extract_datetime_subsets.cc | 114 +-- ...ssor_class_bufr_extract_datetime_subsets.h | 36 + ...rib_accessor_class_bufr_extract_subsets.cc | 58 ++ ...grib_accessor_class_bufr_extract_subsets.h | 37 + .../grib_accessor_class_bufr_group.cc | 39 + src/accessor/grib_accessor_class_bufr_group.h | 31 + ...rib_accessor_class_bufr_simple_thinning.cc | 114 +++ ...grib_accessor_class_bufr_simple_thinning.h | 39 + .../grib_accessor_class_bufr_string_values.cc | 84 +++ .../grib_accessor_class_bufr_string_values.h | 38 + ...essor_class_bufrdc_expanded_descriptors.cc | 98 +++ ...cessor_class_bufrdc_expanded_descriptors.h | 37 + src/accessor/grib_accessor_class_bytes.cc | 99 +++ src/accessor/grib_accessor_class_bytes.h | 35 + ...r_class_change_alternative_row_scanning.cc | 117 +++ ...or_class_change_alternative_row_scanning.h | 38 + ...ccessor_class_change_scanning_direction.cc | 121 +--- ...accessor_class_change_scanning_direction.h | 42 ++ ...b_accessor_class_check_internal_version.cc | 51 ++ ...ib_accessor_class_check_internal_version.h | 33 + .../grib_accessor_class_closest_date.cc | 126 +--- .../grib_accessor_class_closest_date.h | 43 ++ src/accessor/grib_accessor_class_codeflag.cc | 119 +++ src/accessor/grib_accessor_class_codeflag.h | 34 + .../grib_accessor_class_codetable_title.cc | 69 ++ .../grib_accessor_class_codetable_title.h | 34 + .../grib_accessor_class_codetable_units.cc | 70 ++ .../grib_accessor_class_codetable_units.h | 34 + .../{todo => }/grib_accessor_class_concept.cc | 186 +---- src/accessor/grib_accessor_class_concept.h | 43 ++ .../grib_accessor_class_count_file.cc | 28 + src/accessor/grib_accessor_class_count_file.h | 32 + .../grib_accessor_class_count_missing.cc | 117 +-- .../grib_accessor_class_count_missing.h | 37 + .../grib_accessor_class_count_total.cc | 28 + .../grib_accessor_class_count_total.h | 32 + .../grib_accessor_class_data_apply_bitmap.cc | 179 +---- .../grib_accessor_class_data_apply_bitmap.h | 46 ++ ...cessor_class_data_apply_boustrophedonic.cc | 145 +--- ...ccessor_class_data_apply_boustrophedonic.h | 44 ++ ...class_data_apply_boustrophedonic_bitmap.cc | 157 +--- ..._class_data_apply_boustrophedonic_bitmap.h | 45 ++ .../grib_accessor_class_data_ccsds_packing.cc | 195 +---- .../grib_accessor_class_data_ccsds_packing.h | 47 ++ ...rib_accessor_class_data_complex_packing.cc | 173 +---- ...grib_accessor_class_data_complex_packing.h | 45 ++ .../grib_accessor_class_data_dummy_field.cc | 102 +++ .../grib_accessor_class_data_dummy_field.h | 37 + ...b_accessor_class_data_g1complex_packing.cc | 112 +++ ...ib_accessor_class_data_g1complex_packing.h | 37 + ...a_g1second_order_constant_width_packing.cc | 177 +---- ...ta_g1second_order_constant_width_packing.h | 53 ++ ...g1second_order_general_extended_packing.cc | 220 +----- ..._g1second_order_general_extended_packing.h | 65 ++ ...ass_data_g1second_order_general_packing.cc | 173 +---- ...lass_data_g1second_order_general_packing.h | 51 ++ ..._data_g1second_order_row_by_row_packing.cc | 171 +---- ...s_data_g1second_order_row_by_row_packing.h | 51 ++ ..._accessor_class_data_g1secondary_bitmap.cc | 128 ++++ ...b_accessor_class_data_g1secondary_bitmap.h | 34 + ..._accessor_class_data_g1shsimple_packing.cc | 64 ++ ...b_accessor_class_data_g1shsimple_packing.h | 32 + ...ib_accessor_class_data_g1simple_packing.cc | 136 +--- ...rib_accessor_class_data_g1simple_packing.h | 37 + ...ib_accessor_class_data_g22order_packing.cc | 227 +----- ...rib_accessor_class_data_g22order_packing.h | 57 ++ ...accessor_class_data_g2bifourier_packing.cc | 193 +---- ..._accessor_class_data_g2bifourier_packing.h | 47 ++ ...b_accessor_class_data_g2complex_packing.cc | 47 ++ ...ib_accessor_class_data_g2complex_packing.h | 34 + ..._accessor_class_data_g2secondary_bitmap.cc | 107 +++ ...b_accessor_class_data_g2secondary_bitmap.h | 34 + ..._accessor_class_data_g2shsimple_packing.cc | 92 +++ ...b_accessor_class_data_g2shsimple_packing.h | 36 + ...ib_accessor_class_data_g2simple_packing.cc | 157 +--- ...rib_accessor_class_data_g2simple_packing.h | 34 + ...ata_g2simple_packing_with_preprocessing.cc | 179 +++++ ...data_g2simple_packing_with_preprocessing.h | 36 + ...ib_accessor_class_data_jpeg2000_packing.cc | 185 +---- ...rib_accessor_class_data_jpeg2000_packing.h | 46 ++ .../grib_accessor_class_data_png_packing.cc | 191 +---- .../grib_accessor_class_data_png_packing.h | 46 ++ .../grib_accessor_class_data_raw_packing.cc | 194 +++++ .../grib_accessor_class_data_raw_packing.h | 38 + ..._accessor_class_data_run_length_packing.cc | 134 +--- ...b_accessor_class_data_run_length_packing.h | 40 ++ ...ib_accessor_class_data_secondary_bitmap.cc | 118 +++ ...rib_accessor_class_data_secondary_bitmap.h | 38 + .../grib_accessor_class_data_sh_packed.cc | 147 +--- .../grib_accessor_class_data_sh_packed.h | 43 ++ .../grib_accessor_class_data_sh_unpacked.cc | 147 +--- .../grib_accessor_class_data_sh_unpacked.h | 43 ++ ...ib_accessor_class_data_shsimple_packing.cc | 60 ++ ...rib_accessor_class_data_shsimple_packing.h | 37 + ...grib_accessor_class_data_simple_packing.cc | 186 +---- .../grib_accessor_class_data_simple_packing.h | 48 ++ .../grib_accessor_class_decimal_precision.cc | 103 +++ .../grib_accessor_class_decimal_precision.h | 37 + .../grib_accessor_class_dictionary.cc | 129 +--- src/accessor/grib_accessor_class_dictionary.h | 42 ++ src/accessor/grib_accessor_class_dirty.cc | 47 ++ src/accessor/grib_accessor_class_dirty.h | 34 + src/accessor/grib_accessor_class_divdouble.cc | 43 ++ src/accessor/grib_accessor_class_divdouble.h | 34 + src/accessor/grib_accessor_class_double.cc | 105 +++ src/accessor/grib_accessor_class_double.h | 35 + .../{todo => }/grib_accessor_class_element.cc | 117 +-- src/accessor/grib_accessor_class_element.h | 36 + src/accessor/grib_accessor_class_evaluate.cc | 33 + src/accessor/grib_accessor_class_evaluate.h | 33 + ...rib_accessor_class_expanded_descriptors.cc | 200 +----- ...grib_accessor_class_expanded_descriptors.h | 47 ++ ...or_class_from_scale_factor_scaled_value.cc | 125 +--- ...sor_class_from_scale_factor_scaled_value.h | 37 + ...ib_accessor_class_g1_half_byte_codeflag.cc | 60 ++ ...rib_accessor_class_g1_half_byte_codeflag.h | 35 + .../grib_accessor_class_g1_message_length.cc | 110 +-- .../grib_accessor_class_g1_message_length.h | 34 + .../grib_accessor_class_g1_section4_length.cc | 53 ++ .../grib_accessor_class_g1_section4_length.h | 34 + src/accessor/grib_accessor_class_g1bitmap.cc | 98 +++ src/accessor/grib_accessor_class_g1bitmap.h | 35 + .../{todo => }/grib_accessor_class_g1date.cc | 124 +--- src/accessor/grib_accessor_class_g1date.h | 39 + ...b_accessor_class_g1day_of_the_year_date.cc | 60 ++ ...ib_accessor_class_g1day_of_the_year_date.h | 33 + ...ccessor_class_g1end_of_interval_monthly.cc | 135 ++++ ...accessor_class_g1end_of_interval_monthly.h | 36 + .../grib_accessor_class_g1fcperiod.cc | 42 ++ src/accessor/grib_accessor_class_g1fcperiod.h | 31 + .../grib_accessor_class_g1forecastmonth.cc | 129 +--- .../grib_accessor_class_g1forecastmonth.h | 40 ++ .../grib_accessor_class_g1monthlydate.cc | 41 ++ .../grib_accessor_class_g1monthlydate.h | 33 + ...ass_g1number_of_coded_values_sh_complex.cc | 81 +++ ...lass_g1number_of_coded_values_sh_complex.h | 40 ++ ...lass_g1number_of_coded_values_sh_simple.cc | 62 ++ ...class_g1number_of_coded_values_sh_simple.h | 37 + .../grib_accessor_class_g1step_range.cc | 164 +---- .../grib_accessor_class_g1step_range.h | 48 ++ .../grib_accessor_class_g1verificationdate.cc | 64 ++ .../grib_accessor_class_g1verificationdate.h | 35 + .../grib_accessor_class_g2_aerosol.cc | 114 +++ src/accessor/grib_accessor_class_g2_aerosol.h | 37 + .../grib_accessor_class_g2_chemical.cc | 116 +-- .../grib_accessor_class_g2_chemical.h | 37 + .../{todo => }/grib_accessor_class_g2_eps.cc | 121 +--- src/accessor/grib_accessor_class_g2_eps.h | 39 + .../grib_accessor_class_g2_mars_labeling.cc | 159 +---- .../grib_accessor_class_g2_mars_labeling.h | 47 ++ src/accessor/grib_accessor_class_g2bitmap.cc | 75 ++ src/accessor/grib_accessor_class_g2bitmap.h | 34 + .../grib_accessor_class_g2bitmap_present.cc | 59 ++ .../grib_accessor_class_g2bitmap_present.h | 34 + src/accessor/grib_accessor_class_g2date.cc | 82 +++ src/accessor/grib_accessor_class_g2date.h | 37 + .../grib_accessor_class_g2end_step.cc | 207 +----- src/accessor/grib_accessor_class_g2end_step.h | 56 ++ .../{todo => }/grib_accessor_class_g2grid.cc | 136 +--- src/accessor/grib_accessor_class_g2grid.h | 42 ++ src/accessor/grib_accessor_class_g2latlon.cc | 115 +++ src/accessor/grib_accessor_class_g2latlon.h | 38 + .../{todo => }/grib_accessor_class_g2level.cc | 134 +--- src/accessor/grib_accessor_class_g2level.h | 40 ++ src/accessor/grib_accessor_class_g2lon.cc | 58 ++ src/accessor/grib_accessor_class_g2lon.h | 34 + .../grib_accessor_class_g2step_range.cc | 143 +--- .../grib_accessor_class_g2step_range.h | 41 ++ .../grib_accessor_class_gaussian_grid_name.cc | 84 +++ .../grib_accessor_class_gaussian_grid_name.h | 37 + .../grib_accessor_class_gds_is_present.cc | 86 +++ .../grib_accessor_class_gds_is_present.h | 37 + ...b_accessor_class_gds_not_present_bitmap.cc | 109 +++ ...ib_accessor_class_gds_not_present_bitmap.h | 40 ++ src/accessor/grib_accessor_class_getenv.cc | 62 ++ src/accessor/grib_accessor_class_getenv.h | 38 + .../grib_accessor_class_global_gaussian.cc | 126 +--- .../grib_accessor_class_global_gaussian.h | 44 ++ src/accessor/grib_accessor_class_group.cc | 160 +++++ src/accessor/grib_accessor_class_group.h | 41 ++ .../grib_accessor_class_gts_header.cc | 61 ++ src/accessor/grib_accessor_class_gts_header.h | 36 + .../grib_accessor_class_hash_array.cc | 176 +++++ src/accessor/grib_accessor_class_hash_array.h | 45 ++ .../grib_accessor_class_headers_only.cc | 33 + .../grib_accessor_class_headers_only.h | 33 + src/accessor/grib_accessor_class_ibmfloat.cc | 150 ++++ src/accessor/grib_accessor_class_ibmfloat.h | 40 ++ src/accessor/grib_accessor_class_ieeefloat.cc | 123 ++++ src/accessor/grib_accessor_class_ieeefloat.h | 37 + src/accessor/grib_accessor_class_ifs_param.cc | 93 +++ src/accessor/grib_accessor_class_ifs_param.h | 36 + .../grib_accessor_class_julian_date.cc | 163 +---- .../grib_accessor_class_julian_date.h | 48 ++ .../grib_accessor_class_julian_day.cc | 107 +++ src/accessor/grib_accessor_class_julian_day.h | 40 ++ .../grib_accessor_class_ksec1expver.cc | 95 +++ .../grib_accessor_class_ksec1expver.h | 34 + src/accessor/grib_accessor_class_label.cc | 40 ++ src/accessor/grib_accessor_class_label.h | 34 + .../grib_accessor_class_latitudes.cc | 127 +--- src/accessor/grib_accessor_class_latitudes.h | 38 + .../grib_accessor_class_latlon_increment.cc | 125 +--- .../grib_accessor_class_latlon_increment.h | 43 ++ .../grib_accessor_class_latlonvalues.cc | 76 ++ .../grib_accessor_class_latlonvalues.h | 34 + .../grib_accessor_class_library_version.cc | 46 ++ .../grib_accessor_class_library_version.h | 33 + .../grib_accessor_class_local_definition.cc | 136 +--- .../grib_accessor_class_local_definition.h | 43 ++ .../grib_accessor_class_long_vector.cc | 95 +++ .../grib_accessor_class_long_vector.h | 37 + .../grib_accessor_class_longitudes.cc | 123 +--- src/accessor/grib_accessor_class_longitudes.h | 38 + src/accessor/grib_accessor_class_lookup.cc | 133 ++++ src/accessor/grib_accessor_class_lookup.h | 42 ++ .../grib_accessor_class_mars_param.cc | 53 ++ src/accessor/grib_accessor_class_mars_param.h | 36 + src/accessor/grib_accessor_class_mars_step.cc | 115 +++ src/accessor/grib_accessor_class_mars_step.h | 40 ++ .../{todo => }/grib_accessor_class_md5.cc | 126 +--- src/accessor/grib_accessor_class_md5.h | 39 + src/accessor/grib_accessor_class_message.cc | 75 ++ src/accessor/grib_accessor_class_message.h | 36 + .../grib_accessor_class_message_copy.cc | 59 ++ .../grib_accessor_class_message_copy.h | 36 + .../grib_accessor_class_multdouble.cc | 40 ++ src/accessor/grib_accessor_class_multdouble.h | 34 + src/accessor/grib_accessor_class_non_alpha.cc | 112 +++ src/accessor/grib_accessor_class_non_alpha.h | 39 + ...b_accessor_class_number_of_coded_values.cc | 66 ++ ...ib_accessor_class_number_of_coded_values.h | 37 + .../grib_accessor_class_number_of_points.cc | 80 +++ .../grib_accessor_class_number_of_points.h | 36 + ...ccessor_class_number_of_points_gaussian.cc | 148 +--- ...accessor_class_number_of_points_gaussian.h | 42 ++ .../grib_accessor_class_number_of_values.cc | 67 ++ .../grib_accessor_class_number_of_values.h | 38 + ...class_number_of_values_data_raw_packing.cc | 63 ++ ..._class_number_of_values_data_raw_packing.h | 35 + ...grib_accessor_class_octahedral_gaussian.cc | 120 ++++ .../grib_accessor_class_octahedral_gaussian.h | 37 + .../grib_accessor_class_octet_number.cc | 47 ++ .../grib_accessor_class_octet_number.h | 35 + .../grib_accessor_class_offset_file.cc | 55 ++ .../grib_accessor_class_offset_file.h | 33 + .../grib_accessor_class_offset_values.cc | 83 +++ .../grib_accessor_class_offset_values.h | 35 + .../grib_accessor_class_optimal_step_units.cc | 144 +--- .../grib_accessor_class_optimal_step_units.h | 44 ++ .../grib_accessor_class_pack_bufr_values.cc | 69 ++ .../grib_accessor_class_pack_bufr_values.h | 42 ++ .../grib_accessor_class_packing_type.cc | 74 ++ .../grib_accessor_class_packing_type.h | 37 + src/accessor/grib_accessor_class_pad.cc | 36 + src/accessor/grib_accessor_class_pad.h | 34 + src/accessor/grib_accessor_class_padding.cc | 58 ++ src/accessor/grib_accessor_class_padding.h | 37 + src/accessor/grib_accessor_class_padto.cc | 45 ++ src/accessor/grib_accessor_class_padto.h | 34 + src/accessor/grib_accessor_class_padtoeven.cc | 48 ++ src/accessor/grib_accessor_class_padtoeven.h | 34 + .../grib_accessor_class_padtomultiple.cc | 40 ++ .../grib_accessor_class_padtomultiple.h | 34 + src/accessor/grib_accessor_class_position.cc | 50 ++ src/accessor/grib_accessor_class_position.h | 34 + .../grib_accessor_class_proj_string.cc | 137 +--- .../grib_accessor_class_proj_string.h | 35 + src/accessor/grib_accessor_class_raw.cc | 117 +++ src/accessor/grib_accessor_class_raw.h | 41 ++ .../grib_accessor_class_rdbtime_guess_date.cc | 76 ++ .../grib_accessor_class_rdbtime_guess_date.h | 38 + ...ib_accessor_class_reference_value_error.cc | 50 ++ ...rib_accessor_class_reference_value_error.h | 34 + src/accessor/grib_accessor_class_round.cc | 69 ++ src/accessor/grib_accessor_class_round.h | 32 + src/accessor/grib_accessor_class_scale.cc | 134 ++++ src/accessor/grib_accessor_class_scale.h | 39 + .../grib_accessor_class_scale_values.cc | 85 +++ .../grib_accessor_class_scale_values.h | 35 + ...essor_class_second_order_bits_per_value.cc | 120 +--- ...cessor_class_second_order_bits_per_value.h | 37 + src/accessor/grib_accessor_class_section.cc | 95 +++ src/accessor/grib_accessor_class_section.h | 37 + .../grib_accessor_class_section_length.cc | 34 + .../grib_accessor_class_section_length.h | 33 + .../grib_accessor_class_section_padding.cc | 70 ++ .../grib_accessor_class_section_padding.h | 33 + .../grib_accessor_class_section_pointer.cc | 97 +++ .../grib_accessor_class_section_pointer.h | 38 + ...rib_accessor_class_select_step_template.cc | 113 +-- ...grib_accessor_class_select_step_template.h | 36 + ...grib_accessor_class_sexagesimal2decimal.cc | 146 ++++ .../grib_accessor_class_sexagesimal2decimal.h | 34 + .../{todo => }/grib_accessor_class_signed.cc | 160 +---- src/accessor/grib_accessor_class_signed.h | 42 ++ .../grib_accessor_class_signed_bits.cc | 152 ++++ .../grib_accessor_class_signed_bits.h | 40 ++ ...rib_accessor_class_simple_packing_error.cc | 70 ++ ...grib_accessor_class_simple_packing_error.h | 37 + src/accessor/grib_accessor_class_size.cc | 35 + src/accessor/grib_accessor_class_size.h | 33 + .../grib_accessor_class_smart_table_column.cc | 177 +++++ .../grib_accessor_class_smart_table_column.h | 39 + src/accessor/grib_accessor_class_spd.cc | 158 ++++ src/accessor/grib_accessor_class_spd.h | 40 ++ ...grib_accessor_class_spectral_truncation.cc | 81 +++ .../grib_accessor_class_spectral_truncation.h | 36 + .../{todo => }/grib_accessor_class_sprintf.cc | 110 +-- src/accessor/grib_accessor_class_sprintf.h | 35 + .../grib_accessor_class_statistics.cc | 143 +--- src/accessor/grib_accessor_class_statistics.h | 38 + ...grib_accessor_class_statistics_spectral.cc | 165 +++++ .../grib_accessor_class_statistics_spectral.h | 40 ++ ...grib_accessor_class_step_human_readable.cc | 79 ++ .../grib_accessor_class_step_human_readable.h | 35 + .../grib_accessor_class_step_in_units.cc | 146 +--- .../grib_accessor_class_step_in_units.h | 43 ++ src/accessor/grib_accessor_class_sum.cc | 107 +++ src/accessor/grib_accessor_class_sum.h | 35 + .../grib_accessor_class_suppressed.cc | 65 ++ src/accessor/grib_accessor_class_suppressed.h | 37 + src/accessor/grib_accessor_class_time.cc | 113 +++ src/accessor/grib_accessor_class_time.h | 37 + src/accessor/grib_accessor_class_to_double.cc | 130 ++++ src/accessor/grib_accessor_class_to_double.h | 43 ++ .../grib_accessor_class_to_integer.cc | 132 ++++ src/accessor/grib_accessor_class_to_integer.h | 45 ++ src/accessor/grib_accessor_class_to_string.cc | 120 ++++ src/accessor/grib_accessor_class_to_string.h | 42 ++ .../grib_accessor_class_transient_darray.cc | 111 +++ .../grib_accessor_class_transient_darray.h | 41 ++ src/accessor/grib_accessor_class_trim.cc | 76 ++ src/accessor/grib_accessor_class_trim.h | 37 + src/accessor/grib_accessor_class_uint16.cc | 35 + src/accessor/grib_accessor_class_uint16.h | 32 + src/accessor/grib_accessor_class_uint32.cc | 35 + src/accessor/grib_accessor_class_uint32.h | 32 + ...rib_accessor_class_uint32_little_endian.cc | 35 + ...grib_accessor_class_uint32_little_endian.h | 32 + src/accessor/grib_accessor_class_uint64.cc | 51 ++ src/accessor/grib_accessor_class_uint64.h | 32 + ...rib_accessor_class_uint64_little_endian.cc | 51 ++ ...grib_accessor_class_uint64_little_endian.h | 32 + src/accessor/grib_accessor_class_uint8.cc | 37 + src/accessor/grib_accessor_class_uint8.h | 32 + ...b_accessor_class_unexpanded_descriptors.cc | 132 ++++ ...ib_accessor_class_unexpanded_descriptors.h | 39 + .../grib_accessor_class_unpack_bufr_values.cc | 98 +++ .../grib_accessor_class_unpack_bufr_values.h | 42 ++ .../grib_accessor_class_unsigned_bits.cc | 159 +++++ .../grib_accessor_class_unsigned_bits.h | 40 ++ .../grib_accessor_class_validity_date.cc | 96 +++ .../grib_accessor_class_validity_date.h | 39 + .../grib_accessor_class_validity_time.cc | 116 +++ .../grib_accessor_class_validity_time.h | 39 + src/accessor/grib_accessor_class_values.cc | 139 ++++ src/accessor/grib_accessor_class_values.h | 44 ++ src/accessor/grib_accessor_class_vector.cc | 57 ++ src/accessor/grib_accessor_class_vector.h | 34 + src/accessor/grib_accessor_class_when.cc | 35 + src/accessor/grib_accessor_class_when.h | 34 + ...rib_accessor_class_abstract_long_vector.cc | 103 --- .../grib_accessor_class_abstract_vector.cc | 98 --- .../todo/grib_accessor_class_ascii.cc | 278 -------- src/accessor/todo/grib_accessor_class_bit.cc | 170 ----- .../todo/grib_accessor_class_bitmap.cc | 297 -------- .../grib_accessor_class_bits_per_value.cc | 165 ----- src/accessor/todo/grib_accessor_class_blob.cc | 128 ---- .../todo/grib_accessor_class_budgdate.cc | 174 ----- ...rib_accessor_class_bufr_extract_subsets.cc | 152 ---- .../todo/grib_accessor_class_bufr_group.cc | 126 ---- ...rib_accessor_class_bufr_simple_thinning.cc | 211 ------ .../grib_accessor_class_bufr_string_values.cc | 189 ----- ...essor_class_bufrdc_expanded_descriptors.cc | 206 ------ .../todo/grib_accessor_class_bytes.cc | 192 ----- ...r_class_change_alternative_row_scanning.cc | 212 ------ ...b_accessor_class_check_internal_version.cc | 136 ---- .../todo/grib_accessor_class_codeflag.cc | 216 ------ .../grib_accessor_class_codetable_title.cc | 171 ----- .../grib_accessor_class_codetable_units.cc | 171 ----- .../todo/grib_accessor_class_count_file.cc | 114 --- .../todo/grib_accessor_class_count_total.cc | 116 --- .../grib_accessor_class_data_dummy_field.cc | 219 ------ ...b_accessor_class_data_g1complex_packing.cc | 235 ------ ..._accessor_class_data_g1secondary_bitmap.cc | 220 ------ ..._accessor_class_data_g1shsimple_packing.cc | 150 ---- ...b_accessor_class_data_g2complex_packing.cc | 164 ----- ..._accessor_class_data_g2secondary_bitmap.cc | 199 ------ ..._accessor_class_data_g2shsimple_packing.cc | 188 ----- ...ata_g2simple_packing_with_preprocessing.cc | 287 -------- .../grib_accessor_class_data_raw_packing.cc | 306 -------- ...ib_accessor_class_data_secondary_bitmap.cc | 214 ------ ...ib_accessor_class_data_shsimple_packing.cc | 153 ---- .../grib_accessor_class_decimal_precision.cc | 199 ------ .../todo/grib_accessor_class_dirty.cc | 138 ---- .../todo/grib_accessor_class_divdouble.cc | 129 ---- .../todo/grib_accessor_class_double.cc | 201 ------ .../todo/grib_accessor_class_evaluate.cc | 118 --- ...ib_accessor_class_g1_half_byte_codeflag.cc | 150 ---- .../grib_accessor_class_g1_section4_length.cc | 143 ---- .../todo/grib_accessor_class_g1bitmap.cc | 206 ------ ...b_accessor_class_g1day_of_the_year_date.cc | 152 ---- ...ccessor_class_g1end_of_interval_monthly.cc | 234 ------ .../todo/grib_accessor_class_g1fcperiod.cc | 134 ---- .../todo/grib_accessor_class_g1monthlydate.cc | 132 ---- ...ass_g1number_of_coded_values_sh_complex.cc | 183 ----- ...lass_g1number_of_coded_values_sh_simple.cc | 158 ---- .../grib_accessor_class_g1verificationdate.cc | 154 ---- .../todo/grib_accessor_class_g2_aerosol.cc | 210 ------ .../todo/grib_accessor_class_g2bitmap.cc | 178 ----- .../grib_accessor_class_g2bitmap_present.cc | 150 ---- .../todo/grib_accessor_class_g2date.cc | 175 ----- .../todo/grib_accessor_class_g2latlon.cc | 215 ------ .../todo/grib_accessor_class_g2lon.cc | 149 ---- .../grib_accessor_class_gaussian_grid_name.cc | 176 ----- .../grib_accessor_class_gds_is_present.cc | 183 ----- ...b_accessor_class_gds_not_present_bitmap.cc | 216 ------ src/accessor/todo/grib_accessor_class_gen.cc | 675 ------------------ .../todo/grib_accessor_class_getenv.cc | 157 ---- .../todo/grib_accessor_class_group.cc | 272 ------- .../todo/grib_accessor_class_gts_header.cc | 152 ---- .../todo/grib_accessor_class_hash_array.cc | 293 -------- .../todo/grib_accessor_class_headers_only.cc | 116 --- .../todo/grib_accessor_class_ibmfloat.cc | 264 ------- .../todo/grib_accessor_class_ieeefloat.cc | 226 ------ .../todo/grib_accessor_class_ifs_param.cc | 188 ----- .../todo/grib_accessor_class_julian_day.cc | 209 ------ .../todo/grib_accessor_class_ksec1expver.cc | 185 ----- .../todo/grib_accessor_class_label.cc | 125 ---- .../todo/grib_accessor_class_latlonvalues.cc | 164 ----- .../grib_accessor_class_library_version.cc | 130 ---- .../todo/grib_accessor_class_long_vector.cc | 208 ------ .../todo/grib_accessor_class_lookup.cc | 242 ------- .../todo/grib_accessor_class_mars_param.cc | 144 ---- .../todo/grib_accessor_class_mars_step.cc | 218 ------ .../todo/grib_accessor_class_message.cc | 166 ----- .../todo/grib_accessor_class_message_copy.cc | 151 ---- .../todo/grib_accessor_class_multdouble.cc | 127 ---- .../todo/grib_accessor_class_non_alpha.cc | 215 ------ ...b_accessor_class_number_of_coded_values.cc | 162 ----- .../grib_accessor_class_number_of_points.cc | 174 ----- .../grib_accessor_class_number_of_values.cc | 165 ----- ...class_number_of_values_data_raw_packing.cc | 165 ----- ...grib_accessor_class_octahedral_gaussian.cc | 216 ------ .../todo/grib_accessor_class_octet_number.cc | 136 ---- .../todo/grib_accessor_class_offset_file.cc | 141 ---- .../todo/grib_accessor_class_offset_values.cc | 175 ----- .../grib_accessor_class_pack_bufr_values.cc | 177 ----- .../todo/grib_accessor_class_packing_type.cc | 167 ----- src/accessor/todo/grib_accessor_class_pad.cc | 126 ---- .../todo/grib_accessor_class_padding.cc | 151 ---- .../todo/grib_accessor_class_padto.cc | 136 ---- .../todo/grib_accessor_class_padtoeven.cc | 139 ---- .../todo/grib_accessor_class_padtomultiple.cc | 132 ---- .../todo/grib_accessor_class_position.cc | 137 ---- src/accessor/todo/grib_accessor_class_raw.cc | 219 ------ .../grib_accessor_class_rdbtime_guess_date.cc | 172 ----- ...ib_accessor_class_reference_value_error.cc | 142 ---- .../todo/grib_accessor_class_round.cc | 154 ---- .../todo/grib_accessor_class_scale.cc | 237 ------ .../todo/grib_accessor_class_scale_values.cc | 177 ----- .../todo/grib_accessor_class_section.cc | 194 ----- .../grib_accessor_class_section_length.cc | 122 ---- .../grib_accessor_class_section_padding.cc | 155 ---- .../grib_accessor_class_section_pointer.cc | 194 ----- ...grib_accessor_class_sexagesimal2decimal.cc | 241 ------- .../todo/grib_accessor_class_signed_bits.cc | 258 ------- ...rib_accessor_class_simple_packing_error.cc | 163 ----- src/accessor/todo/grib_accessor_class_size.cc | 119 --- .../grib_accessor_class_smart_table_column.cc | 294 -------- src/accessor/todo/grib_accessor_class_spd.cc | 264 ------- ...grib_accessor_class_spectral_truncation.cc | 177 ----- ...grib_accessor_class_statistics_spectral.cc | 277 ------- ...grib_accessor_class_step_human_readable.cc | 169 ----- src/accessor/todo/grib_accessor_class_sum.cc | 203 ------ .../todo/grib_accessor_class_suppressed.cc | 162 ----- src/accessor/todo/grib_accessor_class_time.cc | 208 ------ .../todo/grib_accessor_class_to_double.cc | 241 ------- .../todo/grib_accessor_class_to_integer.cc | 245 ------- .../todo/grib_accessor_class_to_string.cc | 227 ------ .../grib_accessor_class_transient_darray.cc | 214 ------ src/accessor/todo/grib_accessor_class_trim.cc | 170 ----- .../todo/grib_accessor_class_uint16.cc | 118 --- .../todo/grib_accessor_class_uint32.cc | 118 --- ...rib_accessor_class_uint32_little_endian.cc | 118 --- .../todo/grib_accessor_class_uint64.cc | 134 ---- ...rib_accessor_class_uint64_little_endian.cc | 134 ---- .../todo/grib_accessor_class_uint8.cc | 120 ---- ...b_accessor_class_unexpanded_descriptors.cc | 236 ------ .../grib_accessor_class_unpack_bufr_values.cc | 207 ------ .../todo/grib_accessor_class_unsigned_bits.cc | 265 ------- .../todo/grib_accessor_class_validity_date.cc | 229 ------ .../todo/grib_accessor_class_validity_time.cc | 249 ------- .../todo/grib_accessor_class_values.cc | 259 ------- .../todo/grib_accessor_class_vector.cc | 162 ----- src/accessor/todo/grib_accessor_class_when.cc | 122 ---- src/eccodes_prototypes.h | 7 - src/grib_accessor_class.h | 392 +++++----- src/grib_accessor_classes_hash.cc | 597 ++++++++++++++-- src/grib_accessor_factory.h | 390 +++++----- src/grib_accessor_factory_hash_list | 390 +++++----- src/shared_functions.cc | 47 ++ src/shared_functions.h | 9 + 532 files changed, 21431 insertions(+), 34120 deletions(-) create mode 100644 src/accessor/grib_accessor_class_abstract_long_vector.cc create mode 100644 src/accessor/grib_accessor_class_abstract_long_vector.h create mode 100644 src/accessor/grib_accessor_class_abstract_vector.cc create mode 100644 src/accessor/grib_accessor_class_abstract_vector.h create mode 100644 src/accessor/grib_accessor_class_ascii.cc create mode 100644 src/accessor/grib_accessor_class_ascii.h create mode 100644 src/accessor/grib_accessor_class_bit.cc create mode 100644 src/accessor/grib_accessor_class_bit.h create mode 100644 src/accessor/grib_accessor_class_bitmap.cc create mode 100644 src/accessor/grib_accessor_class_bitmap.h rename src/accessor/{todo => }/grib_accessor_class_bits.cc (51%) create mode 100644 src/accessor/grib_accessor_class_bits.h create mode 100644 src/accessor/grib_accessor_class_bits_per_value.cc create mode 100644 src/accessor/grib_accessor_class_bits_per_value.h create mode 100644 src/accessor/grib_accessor_class_blob.cc create mode 100644 src/accessor/grib_accessor_class_blob.h create mode 100644 src/accessor/grib_accessor_class_budgdate.cc create mode 100644 src/accessor/grib_accessor_class_budgdate.h rename src/accessor/{todo => }/grib_accessor_class_bufr_data_array.cc (87%) create mode 100644 src/accessor/grib_accessor_class_bufr_data_array.h rename src/accessor/{todo => }/grib_accessor_class_bufr_data_element.cc (68%) create mode 100644 src/accessor/grib_accessor_class_bufr_data_element.h rename src/accessor/{todo => }/grib_accessor_class_bufr_elements_table.cc (68%) create mode 100644 src/accessor/grib_accessor_class_bufr_elements_table.h rename src/accessor/{todo => }/grib_accessor_class_bufr_extract_area_subsets.cc (57%) create mode 100644 src/accessor/grib_accessor_class_bufr_extract_area_subsets.h rename src/accessor/{todo => }/grib_accessor_class_bufr_extract_datetime_subsets.cc (76%) create mode 100644 src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h create mode 100644 src/accessor/grib_accessor_class_bufr_extract_subsets.cc create mode 100644 src/accessor/grib_accessor_class_bufr_extract_subsets.h create mode 100644 src/accessor/grib_accessor_class_bufr_group.cc create mode 100644 src/accessor/grib_accessor_class_bufr_group.h create mode 100644 src/accessor/grib_accessor_class_bufr_simple_thinning.cc create mode 100644 src/accessor/grib_accessor_class_bufr_simple_thinning.h create mode 100644 src/accessor/grib_accessor_class_bufr_string_values.cc create mode 100644 src/accessor/grib_accessor_class_bufr_string_values.h create mode 100644 src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc create mode 100644 src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h create mode 100644 src/accessor/grib_accessor_class_bytes.cc create mode 100644 src/accessor/grib_accessor_class_bytes.h create mode 100644 src/accessor/grib_accessor_class_change_alternative_row_scanning.cc create mode 100644 src/accessor/grib_accessor_class_change_alternative_row_scanning.h rename src/accessor/{todo => }/grib_accessor_class_change_scanning_direction.cc (57%) create mode 100644 src/accessor/grib_accessor_class_change_scanning_direction.h create mode 100644 src/accessor/grib_accessor_class_check_internal_version.cc create mode 100644 src/accessor/grib_accessor_class_check_internal_version.h rename src/accessor/{todo => }/grib_accessor_class_closest_date.cc (57%) create mode 100644 src/accessor/grib_accessor_class_closest_date.h create mode 100644 src/accessor/grib_accessor_class_codeflag.cc create mode 100644 src/accessor/grib_accessor_class_codeflag.h create mode 100644 src/accessor/grib_accessor_class_codetable_title.cc create mode 100644 src/accessor/grib_accessor_class_codetable_title.h create mode 100644 src/accessor/grib_accessor_class_codetable_units.cc create mode 100644 src/accessor/grib_accessor_class_codetable_units.h rename src/accessor/{todo => }/grib_accessor_class_concept.cc (71%) create mode 100644 src/accessor/grib_accessor_class_concept.h create mode 100644 src/accessor/grib_accessor_class_count_file.cc create mode 100644 src/accessor/grib_accessor_class_count_file.h rename src/accessor/{todo => }/grib_accessor_class_count_missing.cc (55%) create mode 100644 src/accessor/grib_accessor_class_count_missing.h create mode 100644 src/accessor/grib_accessor_class_count_total.cc create mode 100644 src/accessor/grib_accessor_class_count_total.h rename src/accessor/{todo => }/grib_accessor_class_data_apply_bitmap.cc (64%) create mode 100644 src/accessor/grib_accessor_class_data_apply_bitmap.h rename src/accessor/{todo => }/grib_accessor_class_data_apply_boustrophedonic.cc (61%) create mode 100644 src/accessor/grib_accessor_class_data_apply_boustrophedonic.h rename src/accessor/{todo => }/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc (69%) create mode 100644 src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h rename src/accessor/{todo => }/grib_accessor_class_data_ccsds_packing.cc (77%) create mode 100644 src/accessor/grib_accessor_class_data_ccsds_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_complex_packing.cc (82%) create mode 100644 src/accessor/grib_accessor_class_data_complex_packing.h create mode 100644 src/accessor/grib_accessor_class_data_dummy_field.cc create mode 100644 src/accessor/grib_accessor_class_data_dummy_field.h create mode 100644 src/accessor/grib_accessor_class_data_g1complex_packing.cc create mode 100644 src/accessor/grib_accessor_class_data_g1complex_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_g1second_order_constant_width_packing.cc (58%) create mode 100644 src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_g1second_order_general_extended_packing.cc (85%) create mode 100644 src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_g1second_order_general_packing.cc (55%) create mode 100644 src/accessor/grib_accessor_class_data_g1second_order_general_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_g1second_order_row_by_row_packing.cc (64%) create mode 100644 src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h create mode 100644 src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc create mode 100644 src/accessor/grib_accessor_class_data_g1secondary_bitmap.h create mode 100644 src/accessor/grib_accessor_class_data_g1shsimple_packing.cc create mode 100644 src/accessor/grib_accessor_class_data_g1shsimple_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_g1simple_packing.cc (64%) create mode 100644 src/accessor/grib_accessor_class_data_g1simple_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_g22order_packing.cc (88%) create mode 100644 src/accessor/grib_accessor_class_data_g22order_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_g2bifourier_packing.cc (77%) create mode 100644 src/accessor/grib_accessor_class_data_g2bifourier_packing.h create mode 100644 src/accessor/grib_accessor_class_data_g2complex_packing.cc create mode 100644 src/accessor/grib_accessor_class_data_g2complex_packing.h create mode 100644 src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc create mode 100644 src/accessor/grib_accessor_class_data_g2secondary_bitmap.h create mode 100644 src/accessor/grib_accessor_class_data_g2shsimple_packing.cc create mode 100644 src/accessor/grib_accessor_class_data_g2shsimple_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_g2simple_packing.cc (51%) create mode 100644 src/accessor/grib_accessor_class_data_g2simple_packing.h create mode 100644 src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc create mode 100644 src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h rename src/accessor/{todo => }/grib_accessor_class_data_jpeg2000_packing.cc (73%) create mode 100644 src/accessor/grib_accessor_class_data_jpeg2000_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_png_packing.cc (75%) create mode 100644 src/accessor/grib_accessor_class_data_png_packing.h create mode 100644 src/accessor/grib_accessor_class_data_raw_packing.cc create mode 100644 src/accessor/grib_accessor_class_data_raw_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_run_length_packing.cc (73%) create mode 100644 src/accessor/grib_accessor_class_data_run_length_packing.h create mode 100644 src/accessor/grib_accessor_class_data_secondary_bitmap.cc create mode 100644 src/accessor/grib_accessor_class_data_secondary_bitmap.h rename src/accessor/{todo => }/grib_accessor_class_data_sh_packed.cc (63%) create mode 100644 src/accessor/grib_accessor_class_data_sh_packed.h rename src/accessor/{todo => }/grib_accessor_class_data_sh_unpacked.cc (61%) create mode 100644 src/accessor/grib_accessor_class_data_sh_unpacked.h create mode 100644 src/accessor/grib_accessor_class_data_shsimple_packing.cc create mode 100644 src/accessor/grib_accessor_class_data_shsimple_packing.h rename src/accessor/{todo => }/grib_accessor_class_data_simple_packing.cc (79%) create mode 100644 src/accessor/grib_accessor_class_data_simple_packing.h create mode 100644 src/accessor/grib_accessor_class_decimal_precision.cc create mode 100644 src/accessor/grib_accessor_class_decimal_precision.h rename src/accessor/{todo => }/grib_accessor_class_dictionary.cc (62%) create mode 100644 src/accessor/grib_accessor_class_dictionary.h create mode 100644 src/accessor/grib_accessor_class_dirty.cc create mode 100644 src/accessor/grib_accessor_class_dirty.h create mode 100644 src/accessor/grib_accessor_class_divdouble.cc create mode 100644 src/accessor/grib_accessor_class_divdouble.h create mode 100644 src/accessor/grib_accessor_class_double.cc create mode 100644 src/accessor/grib_accessor_class_double.h rename src/accessor/{todo => }/grib_accessor_class_element.cc (55%) create mode 100644 src/accessor/grib_accessor_class_element.h create mode 100644 src/accessor/grib_accessor_class_evaluate.cc create mode 100644 src/accessor/grib_accessor_class_evaluate.h rename src/accessor/{todo => }/grib_accessor_class_expanded_descriptors.cc (80%) create mode 100644 src/accessor/grib_accessor_class_expanded_descriptors.h rename src/accessor/{todo => }/grib_accessor_class_from_scale_factor_scaled_value.cc (59%) create mode 100644 src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h create mode 100644 src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc create mode 100644 src/accessor/grib_accessor_class_g1_half_byte_codeflag.h rename src/accessor/{todo => }/grib_accessor_class_g1_message_length.cc (53%) create mode 100644 src/accessor/grib_accessor_class_g1_message_length.h create mode 100644 src/accessor/grib_accessor_class_g1_section4_length.cc create mode 100644 src/accessor/grib_accessor_class_g1_section4_length.h create mode 100644 src/accessor/grib_accessor_class_g1bitmap.cc create mode 100644 src/accessor/grib_accessor_class_g1bitmap.h rename src/accessor/{todo => }/grib_accessor_class_g1date.cc (51%) create mode 100644 src/accessor/grib_accessor_class_g1date.h create mode 100644 src/accessor/grib_accessor_class_g1day_of_the_year_date.cc create mode 100644 src/accessor/grib_accessor_class_g1day_of_the_year_date.h create mode 100644 src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc create mode 100644 src/accessor/grib_accessor_class_g1end_of_interval_monthly.h create mode 100644 src/accessor/grib_accessor_class_g1fcperiod.cc create mode 100644 src/accessor/grib_accessor_class_g1fcperiod.h rename src/accessor/{todo => }/grib_accessor_class_g1forecastmonth.cc (58%) create mode 100644 src/accessor/grib_accessor_class_g1forecastmonth.h create mode 100644 src/accessor/grib_accessor_class_g1monthlydate.cc create mode 100644 src/accessor/grib_accessor_class_g1monthlydate.h create mode 100644 src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc create mode 100644 src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h create mode 100644 src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc create mode 100644 src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h rename src/accessor/{todo => }/grib_accessor_class_g1step_range.cc (79%) create mode 100644 src/accessor/grib_accessor_class_g1step_range.h create mode 100644 src/accessor/grib_accessor_class_g1verificationdate.cc create mode 100644 src/accessor/grib_accessor_class_g1verificationdate.h create mode 100644 src/accessor/grib_accessor_class_g2_aerosol.cc create mode 100644 src/accessor/grib_accessor_class_g2_aerosol.h rename src/accessor/{todo => }/grib_accessor_class_g2_chemical.cc (54%) create mode 100644 src/accessor/grib_accessor_class_g2_chemical.h rename src/accessor/{todo => }/grib_accessor_class_g2_eps.cc (58%) create mode 100644 src/accessor/grib_accessor_class_g2_eps.h rename src/accessor/{todo => }/grib_accessor_class_g2_mars_labeling.cc (75%) create mode 100644 src/accessor/grib_accessor_class_g2_mars_labeling.h create mode 100644 src/accessor/grib_accessor_class_g2bitmap.cc create mode 100644 src/accessor/grib_accessor_class_g2bitmap.h create mode 100644 src/accessor/grib_accessor_class_g2bitmap_present.cc create mode 100644 src/accessor/grib_accessor_class_g2bitmap_present.h create mode 100644 src/accessor/grib_accessor_class_g2date.cc create mode 100644 src/accessor/grib_accessor_class_g2date.h rename src/accessor/{todo => }/grib_accessor_class_g2end_step.cc (76%) create mode 100644 src/accessor/grib_accessor_class_g2end_step.h rename src/accessor/{todo => }/grib_accessor_class_g2grid.cc (58%) create mode 100644 src/accessor/grib_accessor_class_g2grid.h create mode 100644 src/accessor/grib_accessor_class_g2latlon.cc create mode 100644 src/accessor/grib_accessor_class_g2latlon.h rename src/accessor/{todo => }/grib_accessor_class_g2level.cc (66%) create mode 100644 src/accessor/grib_accessor_class_g2level.h create mode 100644 src/accessor/grib_accessor_class_g2lon.cc create mode 100644 src/accessor/grib_accessor_class_g2lon.h rename src/accessor/{todo => }/grib_accessor_class_g2step_range.cc (64%) create mode 100644 src/accessor/grib_accessor_class_g2step_range.h create mode 100644 src/accessor/grib_accessor_class_gaussian_grid_name.cc create mode 100644 src/accessor/grib_accessor_class_gaussian_grid_name.h create mode 100644 src/accessor/grib_accessor_class_gds_is_present.cc create mode 100644 src/accessor/grib_accessor_class_gds_is_present.h create mode 100644 src/accessor/grib_accessor_class_gds_not_present_bitmap.cc create mode 100644 src/accessor/grib_accessor_class_gds_not_present_bitmap.h create mode 100644 src/accessor/grib_accessor_class_getenv.cc create mode 100644 src/accessor/grib_accessor_class_getenv.h rename src/accessor/{todo => }/grib_accessor_class_global_gaussian.cc (64%) create mode 100644 src/accessor/grib_accessor_class_global_gaussian.h create mode 100644 src/accessor/grib_accessor_class_group.cc create mode 100644 src/accessor/grib_accessor_class_group.h create mode 100644 src/accessor/grib_accessor_class_gts_header.cc create mode 100644 src/accessor/grib_accessor_class_gts_header.h create mode 100644 src/accessor/grib_accessor_class_hash_array.cc create mode 100644 src/accessor/grib_accessor_class_hash_array.h create mode 100644 src/accessor/grib_accessor_class_headers_only.cc create mode 100644 src/accessor/grib_accessor_class_headers_only.h create mode 100644 src/accessor/grib_accessor_class_ibmfloat.cc create mode 100644 src/accessor/grib_accessor_class_ibmfloat.h create mode 100644 src/accessor/grib_accessor_class_ieeefloat.cc create mode 100644 src/accessor/grib_accessor_class_ieeefloat.h create mode 100644 src/accessor/grib_accessor_class_ifs_param.cc create mode 100644 src/accessor/grib_accessor_class_ifs_param.h rename src/accessor/{todo => }/grib_accessor_class_julian_date.cc (66%) create mode 100644 src/accessor/grib_accessor_class_julian_date.h create mode 100644 src/accessor/grib_accessor_class_julian_day.cc create mode 100644 src/accessor/grib_accessor_class_julian_day.h create mode 100644 src/accessor/grib_accessor_class_ksec1expver.cc create mode 100644 src/accessor/grib_accessor_class_ksec1expver.h create mode 100644 src/accessor/grib_accessor_class_label.cc create mode 100644 src/accessor/grib_accessor_class_label.h rename src/accessor/{todo => }/grib_accessor_class_latitudes.cc (59%) create mode 100644 src/accessor/grib_accessor_class_latitudes.h rename src/accessor/{todo => }/grib_accessor_class_latlon_increment.cc (61%) create mode 100644 src/accessor/grib_accessor_class_latlon_increment.h create mode 100644 src/accessor/grib_accessor_class_latlonvalues.cc create mode 100644 src/accessor/grib_accessor_class_latlonvalues.h create mode 100644 src/accessor/grib_accessor_class_library_version.cc create mode 100644 src/accessor/grib_accessor_class_library_version.h rename src/accessor/{todo => }/grib_accessor_class_local_definition.cc (72%) create mode 100644 src/accessor/grib_accessor_class_local_definition.h create mode 100644 src/accessor/grib_accessor_class_long_vector.cc create mode 100644 src/accessor/grib_accessor_class_long_vector.h rename src/accessor/{todo => }/grib_accessor_class_longitudes.cc (56%) create mode 100644 src/accessor/grib_accessor_class_longitudes.h create mode 100644 src/accessor/grib_accessor_class_lookup.cc create mode 100644 src/accessor/grib_accessor_class_lookup.h create mode 100644 src/accessor/grib_accessor_class_mars_param.cc create mode 100644 src/accessor/grib_accessor_class_mars_param.h create mode 100644 src/accessor/grib_accessor_class_mars_step.cc create mode 100644 src/accessor/grib_accessor_class_mars_step.h rename src/accessor/{todo => }/grib_accessor_class_md5.cc (51%) create mode 100644 src/accessor/grib_accessor_class_md5.h create mode 100644 src/accessor/grib_accessor_class_message.cc create mode 100644 src/accessor/grib_accessor_class_message.h create mode 100644 src/accessor/grib_accessor_class_message_copy.cc create mode 100644 src/accessor/grib_accessor_class_message_copy.h create mode 100644 src/accessor/grib_accessor_class_multdouble.cc create mode 100644 src/accessor/grib_accessor_class_multdouble.h create mode 100644 src/accessor/grib_accessor_class_non_alpha.cc create mode 100644 src/accessor/grib_accessor_class_non_alpha.h create mode 100644 src/accessor/grib_accessor_class_number_of_coded_values.cc create mode 100644 src/accessor/grib_accessor_class_number_of_coded_values.h create mode 100644 src/accessor/grib_accessor_class_number_of_points.cc create mode 100644 src/accessor/grib_accessor_class_number_of_points.h rename src/accessor/{todo => }/grib_accessor_class_number_of_points_gaussian.cc (72%) create mode 100644 src/accessor/grib_accessor_class_number_of_points_gaussian.h create mode 100644 src/accessor/grib_accessor_class_number_of_values.cc create mode 100644 src/accessor/grib_accessor_class_number_of_values.h create mode 100644 src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc create mode 100644 src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h create mode 100644 src/accessor/grib_accessor_class_octahedral_gaussian.cc create mode 100644 src/accessor/grib_accessor_class_octahedral_gaussian.h create mode 100644 src/accessor/grib_accessor_class_octet_number.cc create mode 100644 src/accessor/grib_accessor_class_octet_number.h create mode 100644 src/accessor/grib_accessor_class_offset_file.cc create mode 100644 src/accessor/grib_accessor_class_offset_file.h create mode 100644 src/accessor/grib_accessor_class_offset_values.cc create mode 100644 src/accessor/grib_accessor_class_offset_values.h rename src/accessor/{todo => }/grib_accessor_class_optimal_step_units.cc (54%) create mode 100644 src/accessor/grib_accessor_class_optimal_step_units.h create mode 100644 src/accessor/grib_accessor_class_pack_bufr_values.cc create mode 100644 src/accessor/grib_accessor_class_pack_bufr_values.h create mode 100644 src/accessor/grib_accessor_class_packing_type.cc create mode 100644 src/accessor/grib_accessor_class_packing_type.h create mode 100644 src/accessor/grib_accessor_class_pad.cc create mode 100644 src/accessor/grib_accessor_class_pad.h create mode 100644 src/accessor/grib_accessor_class_padding.cc create mode 100644 src/accessor/grib_accessor_class_padding.h create mode 100644 src/accessor/grib_accessor_class_padto.cc create mode 100644 src/accessor/grib_accessor_class_padto.h create mode 100644 src/accessor/grib_accessor_class_padtoeven.cc create mode 100644 src/accessor/grib_accessor_class_padtoeven.h create mode 100644 src/accessor/grib_accessor_class_padtomultiple.cc create mode 100644 src/accessor/grib_accessor_class_padtomultiple.h create mode 100644 src/accessor/grib_accessor_class_position.cc create mode 100644 src/accessor/grib_accessor_class_position.h rename src/accessor/{todo => }/grib_accessor_class_proj_string.cc (67%) create mode 100644 src/accessor/grib_accessor_class_proj_string.h create mode 100644 src/accessor/grib_accessor_class_raw.cc create mode 100644 src/accessor/grib_accessor_class_raw.h create mode 100644 src/accessor/grib_accessor_class_rdbtime_guess_date.cc create mode 100644 src/accessor/grib_accessor_class_rdbtime_guess_date.h create mode 100644 src/accessor/grib_accessor_class_reference_value_error.cc create mode 100644 src/accessor/grib_accessor_class_reference_value_error.h create mode 100644 src/accessor/grib_accessor_class_round.cc create mode 100644 src/accessor/grib_accessor_class_round.h create mode 100644 src/accessor/grib_accessor_class_scale.cc create mode 100644 src/accessor/grib_accessor_class_scale.h create mode 100644 src/accessor/grib_accessor_class_scale_values.cc create mode 100644 src/accessor/grib_accessor_class_scale_values.h rename src/accessor/{todo => }/grib_accessor_class_second_order_bits_per_value.cc (51%) create mode 100644 src/accessor/grib_accessor_class_second_order_bits_per_value.h create mode 100644 src/accessor/grib_accessor_class_section.cc create mode 100644 src/accessor/grib_accessor_class_section.h create mode 100644 src/accessor/grib_accessor_class_section_length.cc create mode 100644 src/accessor/grib_accessor_class_section_length.h create mode 100644 src/accessor/grib_accessor_class_section_padding.cc create mode 100644 src/accessor/grib_accessor_class_section_padding.h create mode 100644 src/accessor/grib_accessor_class_section_pointer.cc create mode 100644 src/accessor/grib_accessor_class_section_pointer.h rename src/accessor/{todo => }/grib_accessor_class_select_step_template.cc (60%) create mode 100644 src/accessor/grib_accessor_class_select_step_template.h create mode 100644 src/accessor/grib_accessor_class_sexagesimal2decimal.cc create mode 100644 src/accessor/grib_accessor_class_sexagesimal2decimal.h rename src/accessor/{todo => }/grib_accessor_class_signed.cc (51%) create mode 100644 src/accessor/grib_accessor_class_signed.h create mode 100644 src/accessor/grib_accessor_class_signed_bits.cc create mode 100644 src/accessor/grib_accessor_class_signed_bits.h create mode 100644 src/accessor/grib_accessor_class_simple_packing_error.cc create mode 100644 src/accessor/grib_accessor_class_simple_packing_error.h create mode 100644 src/accessor/grib_accessor_class_size.cc create mode 100644 src/accessor/grib_accessor_class_size.h create mode 100644 src/accessor/grib_accessor_class_smart_table_column.cc create mode 100644 src/accessor/grib_accessor_class_smart_table_column.h create mode 100644 src/accessor/grib_accessor_class_spd.cc create mode 100644 src/accessor/grib_accessor_class_spd.h create mode 100644 src/accessor/grib_accessor_class_spectral_truncation.cc create mode 100644 src/accessor/grib_accessor_class_spectral_truncation.h rename src/accessor/{todo => }/grib_accessor_class_sprintf.cc (54%) create mode 100644 src/accessor/grib_accessor_class_sprintf.h rename src/accessor/{todo => }/grib_accessor_class_statistics.cc (55%) create mode 100644 src/accessor/grib_accessor_class_statistics.h create mode 100644 src/accessor/grib_accessor_class_statistics_spectral.cc create mode 100644 src/accessor/grib_accessor_class_statistics_spectral.h create mode 100644 src/accessor/grib_accessor_class_step_human_readable.cc create mode 100644 src/accessor/grib_accessor_class_step_human_readable.h rename src/accessor/{todo => }/grib_accessor_class_step_in_units.cc (63%) create mode 100644 src/accessor/grib_accessor_class_step_in_units.h create mode 100644 src/accessor/grib_accessor_class_sum.cc create mode 100644 src/accessor/grib_accessor_class_sum.h create mode 100644 src/accessor/grib_accessor_class_suppressed.cc create mode 100644 src/accessor/grib_accessor_class_suppressed.h create mode 100644 src/accessor/grib_accessor_class_time.cc create mode 100644 src/accessor/grib_accessor_class_time.h create mode 100644 src/accessor/grib_accessor_class_to_double.cc create mode 100644 src/accessor/grib_accessor_class_to_double.h create mode 100644 src/accessor/grib_accessor_class_to_integer.cc create mode 100644 src/accessor/grib_accessor_class_to_integer.h create mode 100644 src/accessor/grib_accessor_class_to_string.cc create mode 100644 src/accessor/grib_accessor_class_to_string.h create mode 100644 src/accessor/grib_accessor_class_transient_darray.cc create mode 100644 src/accessor/grib_accessor_class_transient_darray.h create mode 100644 src/accessor/grib_accessor_class_trim.cc create mode 100644 src/accessor/grib_accessor_class_trim.h create mode 100644 src/accessor/grib_accessor_class_uint16.cc create mode 100644 src/accessor/grib_accessor_class_uint16.h create mode 100644 src/accessor/grib_accessor_class_uint32.cc create mode 100644 src/accessor/grib_accessor_class_uint32.h create mode 100644 src/accessor/grib_accessor_class_uint32_little_endian.cc create mode 100644 src/accessor/grib_accessor_class_uint32_little_endian.h create mode 100644 src/accessor/grib_accessor_class_uint64.cc create mode 100644 src/accessor/grib_accessor_class_uint64.h create mode 100644 src/accessor/grib_accessor_class_uint64_little_endian.cc create mode 100644 src/accessor/grib_accessor_class_uint64_little_endian.h create mode 100644 src/accessor/grib_accessor_class_uint8.cc create mode 100644 src/accessor/grib_accessor_class_uint8.h create mode 100644 src/accessor/grib_accessor_class_unexpanded_descriptors.cc create mode 100644 src/accessor/grib_accessor_class_unexpanded_descriptors.h create mode 100644 src/accessor/grib_accessor_class_unpack_bufr_values.cc create mode 100644 src/accessor/grib_accessor_class_unpack_bufr_values.h create mode 100644 src/accessor/grib_accessor_class_unsigned_bits.cc create mode 100644 src/accessor/grib_accessor_class_unsigned_bits.h create mode 100644 src/accessor/grib_accessor_class_validity_date.cc create mode 100644 src/accessor/grib_accessor_class_validity_date.h create mode 100644 src/accessor/grib_accessor_class_validity_time.cc create mode 100644 src/accessor/grib_accessor_class_validity_time.h create mode 100644 src/accessor/grib_accessor_class_values.cc create mode 100644 src/accessor/grib_accessor_class_values.h create mode 100644 src/accessor/grib_accessor_class_vector.cc create mode 100644 src/accessor/grib_accessor_class_vector.h create mode 100644 src/accessor/grib_accessor_class_when.cc create mode 100644 src/accessor/grib_accessor_class_when.h delete mode 100644 src/accessor/todo/grib_accessor_class_abstract_long_vector.cc delete mode 100644 src/accessor/todo/grib_accessor_class_abstract_vector.cc delete mode 100644 src/accessor/todo/grib_accessor_class_ascii.cc delete mode 100644 src/accessor/todo/grib_accessor_class_bit.cc delete mode 100644 src/accessor/todo/grib_accessor_class_bitmap.cc delete mode 100644 src/accessor/todo/grib_accessor_class_bits_per_value.cc delete mode 100644 src/accessor/todo/grib_accessor_class_blob.cc delete mode 100644 src/accessor/todo/grib_accessor_class_budgdate.cc delete mode 100644 src/accessor/todo/grib_accessor_class_bufr_extract_subsets.cc delete mode 100644 src/accessor/todo/grib_accessor_class_bufr_group.cc delete mode 100644 src/accessor/todo/grib_accessor_class_bufr_simple_thinning.cc delete mode 100644 src/accessor/todo/grib_accessor_class_bufr_string_values.cc delete mode 100644 src/accessor/todo/grib_accessor_class_bufrdc_expanded_descriptors.cc delete mode 100644 src/accessor/todo/grib_accessor_class_bytes.cc delete mode 100644 src/accessor/todo/grib_accessor_class_change_alternative_row_scanning.cc delete mode 100644 src/accessor/todo/grib_accessor_class_check_internal_version.cc delete mode 100644 src/accessor/todo/grib_accessor_class_codeflag.cc delete mode 100644 src/accessor/todo/grib_accessor_class_codetable_title.cc delete mode 100644 src/accessor/todo/grib_accessor_class_codetable_units.cc delete mode 100644 src/accessor/todo/grib_accessor_class_count_file.cc delete mode 100644 src/accessor/todo/grib_accessor_class_count_total.cc delete mode 100644 src/accessor/todo/grib_accessor_class_data_dummy_field.cc delete mode 100644 src/accessor/todo/grib_accessor_class_data_g1complex_packing.cc delete mode 100644 src/accessor/todo/grib_accessor_class_data_g1secondary_bitmap.cc delete mode 100644 src/accessor/todo/grib_accessor_class_data_g1shsimple_packing.cc delete mode 100644 src/accessor/todo/grib_accessor_class_data_g2complex_packing.cc delete mode 100644 src/accessor/todo/grib_accessor_class_data_g2secondary_bitmap.cc delete mode 100644 src/accessor/todo/grib_accessor_class_data_g2shsimple_packing.cc delete mode 100644 src/accessor/todo/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc delete mode 100644 src/accessor/todo/grib_accessor_class_data_raw_packing.cc delete mode 100644 src/accessor/todo/grib_accessor_class_data_secondary_bitmap.cc delete mode 100644 src/accessor/todo/grib_accessor_class_data_shsimple_packing.cc delete mode 100644 src/accessor/todo/grib_accessor_class_decimal_precision.cc delete mode 100644 src/accessor/todo/grib_accessor_class_dirty.cc delete mode 100644 src/accessor/todo/grib_accessor_class_divdouble.cc delete mode 100644 src/accessor/todo/grib_accessor_class_double.cc delete mode 100644 src/accessor/todo/grib_accessor_class_evaluate.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g1_half_byte_codeflag.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g1_section4_length.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g1bitmap.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g1day_of_the_year_date.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g1end_of_interval_monthly.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g1fcperiod.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g1monthlydate.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_complex.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_simple.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g1verificationdate.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g2_aerosol.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g2bitmap.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g2bitmap_present.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g2date.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g2latlon.cc delete mode 100644 src/accessor/todo/grib_accessor_class_g2lon.cc delete mode 100644 src/accessor/todo/grib_accessor_class_gaussian_grid_name.cc delete mode 100644 src/accessor/todo/grib_accessor_class_gds_is_present.cc delete mode 100644 src/accessor/todo/grib_accessor_class_gds_not_present_bitmap.cc delete mode 100644 src/accessor/todo/grib_accessor_class_gen.cc delete mode 100644 src/accessor/todo/grib_accessor_class_getenv.cc delete mode 100644 src/accessor/todo/grib_accessor_class_group.cc delete mode 100644 src/accessor/todo/grib_accessor_class_gts_header.cc delete mode 100644 src/accessor/todo/grib_accessor_class_hash_array.cc delete mode 100644 src/accessor/todo/grib_accessor_class_headers_only.cc delete mode 100644 src/accessor/todo/grib_accessor_class_ibmfloat.cc delete mode 100644 src/accessor/todo/grib_accessor_class_ieeefloat.cc delete mode 100644 src/accessor/todo/grib_accessor_class_ifs_param.cc delete mode 100644 src/accessor/todo/grib_accessor_class_julian_day.cc delete mode 100644 src/accessor/todo/grib_accessor_class_ksec1expver.cc delete mode 100644 src/accessor/todo/grib_accessor_class_label.cc delete mode 100644 src/accessor/todo/grib_accessor_class_latlonvalues.cc delete mode 100644 src/accessor/todo/grib_accessor_class_library_version.cc delete mode 100644 src/accessor/todo/grib_accessor_class_long_vector.cc delete mode 100644 src/accessor/todo/grib_accessor_class_lookup.cc delete mode 100644 src/accessor/todo/grib_accessor_class_mars_param.cc delete mode 100644 src/accessor/todo/grib_accessor_class_mars_step.cc delete mode 100644 src/accessor/todo/grib_accessor_class_message.cc delete mode 100644 src/accessor/todo/grib_accessor_class_message_copy.cc delete mode 100644 src/accessor/todo/grib_accessor_class_multdouble.cc delete mode 100644 src/accessor/todo/grib_accessor_class_non_alpha.cc delete mode 100644 src/accessor/todo/grib_accessor_class_number_of_coded_values.cc delete mode 100644 src/accessor/todo/grib_accessor_class_number_of_points.cc delete mode 100644 src/accessor/todo/grib_accessor_class_number_of_values.cc delete mode 100644 src/accessor/todo/grib_accessor_class_number_of_values_data_raw_packing.cc delete mode 100644 src/accessor/todo/grib_accessor_class_octahedral_gaussian.cc delete mode 100644 src/accessor/todo/grib_accessor_class_octet_number.cc delete mode 100644 src/accessor/todo/grib_accessor_class_offset_file.cc delete mode 100644 src/accessor/todo/grib_accessor_class_offset_values.cc delete mode 100644 src/accessor/todo/grib_accessor_class_pack_bufr_values.cc delete mode 100644 src/accessor/todo/grib_accessor_class_packing_type.cc delete mode 100644 src/accessor/todo/grib_accessor_class_pad.cc delete mode 100644 src/accessor/todo/grib_accessor_class_padding.cc delete mode 100644 src/accessor/todo/grib_accessor_class_padto.cc delete mode 100644 src/accessor/todo/grib_accessor_class_padtoeven.cc delete mode 100644 src/accessor/todo/grib_accessor_class_padtomultiple.cc delete mode 100644 src/accessor/todo/grib_accessor_class_position.cc delete mode 100644 src/accessor/todo/grib_accessor_class_raw.cc delete mode 100644 src/accessor/todo/grib_accessor_class_rdbtime_guess_date.cc delete mode 100644 src/accessor/todo/grib_accessor_class_reference_value_error.cc delete mode 100644 src/accessor/todo/grib_accessor_class_round.cc delete mode 100644 src/accessor/todo/grib_accessor_class_scale.cc delete mode 100644 src/accessor/todo/grib_accessor_class_scale_values.cc delete mode 100644 src/accessor/todo/grib_accessor_class_section.cc delete mode 100644 src/accessor/todo/grib_accessor_class_section_length.cc delete mode 100644 src/accessor/todo/grib_accessor_class_section_padding.cc delete mode 100644 src/accessor/todo/grib_accessor_class_section_pointer.cc delete mode 100644 src/accessor/todo/grib_accessor_class_sexagesimal2decimal.cc delete mode 100644 src/accessor/todo/grib_accessor_class_signed_bits.cc delete mode 100644 src/accessor/todo/grib_accessor_class_simple_packing_error.cc delete mode 100644 src/accessor/todo/grib_accessor_class_size.cc delete mode 100644 src/accessor/todo/grib_accessor_class_smart_table_column.cc delete mode 100644 src/accessor/todo/grib_accessor_class_spd.cc delete mode 100644 src/accessor/todo/grib_accessor_class_spectral_truncation.cc delete mode 100644 src/accessor/todo/grib_accessor_class_statistics_spectral.cc delete mode 100644 src/accessor/todo/grib_accessor_class_step_human_readable.cc delete mode 100644 src/accessor/todo/grib_accessor_class_sum.cc delete mode 100644 src/accessor/todo/grib_accessor_class_suppressed.cc delete mode 100644 src/accessor/todo/grib_accessor_class_time.cc delete mode 100644 src/accessor/todo/grib_accessor_class_to_double.cc delete mode 100644 src/accessor/todo/grib_accessor_class_to_integer.cc delete mode 100644 src/accessor/todo/grib_accessor_class_to_string.cc delete mode 100644 src/accessor/todo/grib_accessor_class_transient_darray.cc delete mode 100644 src/accessor/todo/grib_accessor_class_trim.cc delete mode 100644 src/accessor/todo/grib_accessor_class_uint16.cc delete mode 100644 src/accessor/todo/grib_accessor_class_uint32.cc delete mode 100644 src/accessor/todo/grib_accessor_class_uint32_little_endian.cc delete mode 100644 src/accessor/todo/grib_accessor_class_uint64.cc delete mode 100644 src/accessor/todo/grib_accessor_class_uint64_little_endian.cc delete mode 100644 src/accessor/todo/grib_accessor_class_uint8.cc delete mode 100644 src/accessor/todo/grib_accessor_class_unexpanded_descriptors.cc delete mode 100644 src/accessor/todo/grib_accessor_class_unpack_bufr_values.cc delete mode 100644 src/accessor/todo/grib_accessor_class_unsigned_bits.cc delete mode 100644 src/accessor/todo/grib_accessor_class_validity_date.cc delete mode 100644 src/accessor/todo/grib_accessor_class_validity_time.cc delete mode 100644 src/accessor/todo/grib_accessor_class_values.cc delete mode 100644 src/accessor/todo/grib_accessor_class_vector.cc delete mode 100644 src/accessor/todo/grib_accessor_class_when.cc create mode 100644 src/shared_functions.cc create mode 100644 src/shared_functions.h diff --git a/examples/C/grib_pthreads.c b/examples/C/grib_pthreads.c index d9b23344c..eab0a5e74 100644 --- a/examples/C/grib_pthreads.c +++ b/examples/C/grib_pthreads.c @@ -51,7 +51,7 @@ static void* process_grib(void* threadID) ProductKind prod_kind = 0; codes_handle* h = codes_grib_handle_new_from_samples(0, "regular_ll_pl_grib2"); - Assert(h); + Assert(h != NULL); CODES_CHECK(codes_get_product_kind(h, &prod_kind), 0); Assert(prod_kind == PRODUCT_GRIB); printf("Thread %ld running\n", tid); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 53e2c3b1d..28e037c21 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,6 +12,7 @@ list( APPEND eccodes_src_files accessor/grib_accessor.cc accessor/grib_accessors_list.cc grib_accessor_class.cc + shared_functions.cc step_unit.cc step.cc step_utilities.cc @@ -23,9 +24,9 @@ list( APPEND eccodes_src_files action_class_gen.cc action_class_if.cc action_class_switch.cc - #accessor/grib_accessor_class_g1fcperiod.cc - #accessor/grib_accessor_class_g1end_of_interval_monthly.cc - #accessor/grib_accessor_class_mars_param.cc + accessor/grib_accessor_class_g1fcperiod.cc + accessor/grib_accessor_class_g1end_of_interval_monthly.cc + accessor/grib_accessor_class_mars_param.cc action_class_section.cc action_class_list.cc action_class_while.cc @@ -63,207 +64,207 @@ list( APPEND eccodes_src_files grib_viarray.cc codes_memfs.cc accessor/grib_accessor_class_gen.cc - #accessor/grib_accessor_class_ascii.cc - #accessor/grib_accessor_class_bit.cc - #accessor/grib_accessor_class_bitmap.cc - #accessor/grib_accessor_class_bits.cc - #accessor/grib_accessor_class_bits_per_value.cc - #accessor/grib_accessor_class_bufr_elements_table.cc - #accessor/grib_accessor_class_bufr_data_array.cc - #accessor/grib_accessor_class_bufr_data_element.cc - #accessor/grib_accessor_class_bufr_group.cc - #accessor/grib_accessor_class_bufr_string_values.cc - #accessor/grib_accessor_class_pack_bufr_values.cc - #accessor/grib_accessor_class_unpack_bufr_values.cc - #accessor/grib_accessor_class_group.cc - #accessor/grib_accessor_class_non_alpha.cc - #accessor/grib_accessor_class_g1bitmap.cc - #accessor/grib_accessor_class_g2bitmap.cc - #accessor/grib_accessor_class_concept.cc - #accessor/grib_accessor_class_hash_array.cc - #accessor/grib_accessor_class_decimal_precision.cc - #accessor/grib_accessor_class_divdouble.cc - #accessor/grib_accessor_class_multdouble.cc - #accessor/grib_accessor_class_budgdate.cc - #accessor/grib_accessor_class_validity_date.cc - #accessor/grib_accessor_class_validity_time.cc - #accessor/grib_accessor_class_bytes.cc - #accessor/grib_accessor_class_change_alternative_row_scanning.cc - #accessor/grib_accessor_class_change_scanning_direction.cc - #accessor/grib_accessor_class_check_internal_version.cc - #accessor/grib_accessor_class_codeflag.cc + accessor/grib_accessor_class_ascii.cc + accessor/grib_accessor_class_bit.cc + accessor/grib_accessor_class_bitmap.cc + accessor/grib_accessor_class_bits.cc + accessor/grib_accessor_class_bits_per_value.cc + accessor/grib_accessor_class_bufr_elements_table.cc + accessor/grib_accessor_class_bufr_data_array.cc + accessor/grib_accessor_class_bufr_data_element.cc + accessor/grib_accessor_class_bufr_group.cc + accessor/grib_accessor_class_bufr_string_values.cc + accessor/grib_accessor_class_pack_bufr_values.cc + accessor/grib_accessor_class_unpack_bufr_values.cc + accessor/grib_accessor_class_group.cc + accessor/grib_accessor_class_non_alpha.cc + accessor/grib_accessor_class_g1bitmap.cc + accessor/grib_accessor_class_g2bitmap.cc + accessor/grib_accessor_class_concept.cc + accessor/grib_accessor_class_hash_array.cc + accessor/grib_accessor_class_decimal_precision.cc + accessor/grib_accessor_class_divdouble.cc + accessor/grib_accessor_class_multdouble.cc + accessor/grib_accessor_class_budgdate.cc + accessor/grib_accessor_class_validity_date.cc + accessor/grib_accessor_class_validity_time.cc + accessor/grib_accessor_class_bytes.cc + accessor/grib_accessor_class_change_alternative_row_scanning.cc + accessor/grib_accessor_class_change_scanning_direction.cc + accessor/grib_accessor_class_check_internal_version.cc + accessor/grib_accessor_class_codeflag.cc accessor/grib_accessor_class_smart_table.cc - #accessor/grib_accessor_class_smart_table_column.cc + accessor/grib_accessor_class_smart_table_column.cc accessor/grib_accessor_class_codetable.cc - #accessor/grib_accessor_class_codetable_units.cc - #accessor/grib_accessor_class_codetable_title.cc - #accessor/grib_accessor_class_step_human_readable.cc - #accessor/grib_accessor_class_count_file.cc - #accessor/grib_accessor_class_count_total.cc - #accessor/grib_accessor_class_double.cc - #accessor/grib_accessor_class_element.cc - #accessor/grib_accessor_class_evaluate.cc - #accessor/grib_accessor_class_g1date.cc - #accessor/grib_accessor_class_g1monthlydate.cc - #accessor/grib_accessor_class_library_version.cc - #accessor/grib_accessor_class_when.cc - #accessor/grib_accessor_class_g1verificationdate.cc - #accessor/grib_accessor_class_g1day_of_the_year_date.cc - #accessor/grib_accessor_class_g1_half_byte_codeflag.cc - #accessor/grib_accessor_class_g1forecastmonth.cc - #accessor/grib_accessor_class_g1step_range.cc - #accessor/grib_accessor_class_g2step_range.cc - #accessor/grib_accessor_class_data_g22order_packing.cc - #accessor/grib_accessor_class_mars_step.cc - #accessor/grib_accessor_class_message_copy.cc - #accessor/grib_accessor_class_dictionary.cc - #accessor/grib_accessor_class_latlon_increment.cc - #accessor/grib_accessor_class_g2date.cc - #accessor/grib_accessor_class_g2level.cc - #accessor/grib_accessor_class_g2end_step.cc - #accessor/grib_accessor_class_g2latlon.cc - #accessor/grib_accessor_class_g2lon.cc - #accessor/grib_accessor_class_global_gaussian.cc - #accessor/grib_accessor_class_gaussian_grid_name.cc - #accessor/grib_accessor_class_gen.cc - #accessor/grib_accessor_class_getenv.cc - #accessor/grib_accessor_class_gts_header.cc - #accessor/grib_accessor_class_ifs_param.cc - #accessor/grib_accessor_class_julian_day.cc - #accessor/grib_accessor_class_julian_date.cc - #accessor/grib_accessor_class_closest_date.cc - #accessor/grib_accessor_class_latlonvalues.cc - #accessor/grib_accessor_class_latitudes.cc - #accessor/grib_accessor_class_longitudes.cc - #accessor/grib_accessor_class_offset_file.cc - #accessor/grib_accessor_class_scale.cc - #accessor/grib_accessor_class_from_scale_factor_scaled_value.cc - #accessor/grib_accessor_class_g2bitmap_present.cc - #accessor/grib_accessor_class_ibmfloat.cc - #accessor/grib_accessor_class_ieeefloat.cc + accessor/grib_accessor_class_codetable_units.cc + accessor/grib_accessor_class_codetable_title.cc + accessor/grib_accessor_class_step_human_readable.cc + accessor/grib_accessor_class_count_file.cc + accessor/grib_accessor_class_count_total.cc + accessor/grib_accessor_class_double.cc + accessor/grib_accessor_class_element.cc + accessor/grib_accessor_class_evaluate.cc + accessor/grib_accessor_class_g1date.cc + accessor/grib_accessor_class_g1monthlydate.cc + accessor/grib_accessor_class_library_version.cc + accessor/grib_accessor_class_when.cc + accessor/grib_accessor_class_g1verificationdate.cc + accessor/grib_accessor_class_g1day_of_the_year_date.cc + accessor/grib_accessor_class_g1_half_byte_codeflag.cc + accessor/grib_accessor_class_g1forecastmonth.cc + accessor/grib_accessor_class_g1step_range.cc + accessor/grib_accessor_class_g2step_range.cc + accessor/grib_accessor_class_data_g22order_packing.cc + accessor/grib_accessor_class_mars_step.cc + accessor/grib_accessor_class_message_copy.cc + accessor/grib_accessor_class_dictionary.cc + accessor/grib_accessor_class_latlon_increment.cc + accessor/grib_accessor_class_g2date.cc + accessor/grib_accessor_class_g2level.cc + accessor/grib_accessor_class_g2end_step.cc + accessor/grib_accessor_class_g2latlon.cc + accessor/grib_accessor_class_g2lon.cc + accessor/grib_accessor_class_global_gaussian.cc + accessor/grib_accessor_class_gaussian_grid_name.cc + accessor/grib_accessor_class_gen.cc + accessor/grib_accessor_class_getenv.cc + accessor/grib_accessor_class_gts_header.cc + accessor/grib_accessor_class_ifs_param.cc + accessor/grib_accessor_class_julian_day.cc + accessor/grib_accessor_class_julian_date.cc + accessor/grib_accessor_class_closest_date.cc + accessor/grib_accessor_class_latlonvalues.cc + accessor/grib_accessor_class_latitudes.cc + accessor/grib_accessor_class_longitudes.cc + accessor/grib_accessor_class_offset_file.cc + accessor/grib_accessor_class_scale.cc + accessor/grib_accessor_class_from_scale_factor_scaled_value.cc + accessor/grib_accessor_class_g2bitmap_present.cc + accessor/grib_accessor_class_ibmfloat.cc + accessor/grib_accessor_class_ieeefloat.cc accessor/grib_accessor_class_constant.cc accessor/grib_accessor_class_iterator.cc - #accessor/grib_accessor_class_message.cc + accessor/grib_accessor_class_message.cc accessor/grib_accessor_class_nearest.cc - #accessor/grib_accessor_class_ksec1expver.cc - #accessor/grib_accessor_class_label.cc + accessor/grib_accessor_class_ksec1expver.cc + accessor/grib_accessor_class_label.cc accessor/grib_accessor_class_long.cc - #accessor/grib_accessor_class_lookup.cc - #accessor/grib_accessor_class_octahedral_gaussian.cc - #accessor/grib_accessor_class_octet_number.cc - #accessor/grib_accessor_class_headers_only.cc - #accessor/grib_accessor_class_padding.cc - #accessor/grib_accessor_class_pad.cc - #accessor/grib_accessor_class_padto.cc - #accessor/grib_accessor_class_padtoeven.cc - #accessor/grib_accessor_class_padtomultiple.cc - #accessor/grib_accessor_class_section_padding.cc - #accessor/grib_accessor_class_packing_type.cc - #accessor/grib_accessor_class_section_pointer.cc - #accessor/grib_accessor_class_position.cc - #accessor/grib_accessor_class_signed.cc - #accessor/grib_accessor_class_signed_bits.cc - #accessor/grib_accessor_class_section.cc - #accessor/grib_accessor_class_step_in_units.cc - #accessor/grib_accessor_class_optimal_step_units.cc - #accessor/grib_accessor_class_section_length.cc - #accessor/grib_accessor_class_g1_message_length.cc - #accessor/grib_accessor_class_g1_section4_length.cc - #accessor/grib_accessor_class_size.cc - #accessor/grib_accessor_class_rdbtime_guess_date.cc - #accessor/grib_accessor_class_scale_values.cc - #accessor/grib_accessor_class_offset_values.cc - #accessor/grib_accessor_class_sprintf.cc - #accessor/grib_accessor_class_round.cc - #accessor/grib_accessor_class_spectral_truncation.cc - #accessor/grib_accessor_class_time.cc + accessor/grib_accessor_class_lookup.cc + accessor/grib_accessor_class_octahedral_gaussian.cc + accessor/grib_accessor_class_octet_number.cc + accessor/grib_accessor_class_headers_only.cc + accessor/grib_accessor_class_padding.cc + accessor/grib_accessor_class_pad.cc + accessor/grib_accessor_class_padto.cc + accessor/grib_accessor_class_padtoeven.cc + accessor/grib_accessor_class_padtomultiple.cc + accessor/grib_accessor_class_section_padding.cc + accessor/grib_accessor_class_packing_type.cc + accessor/grib_accessor_class_section_pointer.cc + accessor/grib_accessor_class_position.cc + accessor/grib_accessor_class_signed.cc + accessor/grib_accessor_class_signed_bits.cc + accessor/grib_accessor_class_section.cc + accessor/grib_accessor_class_step_in_units.cc + accessor/grib_accessor_class_optimal_step_units.cc + accessor/grib_accessor_class_section_length.cc + accessor/grib_accessor_class_g1_message_length.cc + accessor/grib_accessor_class_g1_section4_length.cc + accessor/grib_accessor_class_size.cc + accessor/grib_accessor_class_rdbtime_guess_date.cc + accessor/grib_accessor_class_scale_values.cc + accessor/grib_accessor_class_offset_values.cc + accessor/grib_accessor_class_sprintf.cc + accessor/grib_accessor_class_round.cc + accessor/grib_accessor_class_spectral_truncation.cc + accessor/grib_accessor_class_time.cc accessor/grib_accessor_class_transient.cc - #accessor/grib_accessor_class_trim.cc - #accessor/grib_accessor_class_transient_darray.cc - #accessor/grib_accessor_class_values.cc - #accessor/grib_accessor_class_simple_packing_error.cc - #accessor/grib_accessor_class_data_simple_packing.cc - #accessor/grib_accessor_class_count_missing.cc - #accessor/grib_accessor_class_data_sh_packed.cc - #accessor/grib_accessor_class_data_sh_unpacked.cc - #accessor/grib_accessor_class_number_of_values_data_raw_packing.cc - #accessor/grib_accessor_class_data_g1simple_packing.cc - #accessor/grib_accessor_class_data_g1shsimple_packing.cc - #accessor/grib_accessor_class_data_shsimple_packing.cc - #accessor/grib_accessor_class_data_dummy_field.cc + accessor/grib_accessor_class_trim.cc + accessor/grib_accessor_class_transient_darray.cc + accessor/grib_accessor_class_values.cc + accessor/grib_accessor_class_simple_packing_error.cc + accessor/grib_accessor_class_data_simple_packing.cc + accessor/grib_accessor_class_count_missing.cc + accessor/grib_accessor_class_data_sh_packed.cc + accessor/grib_accessor_class_data_sh_unpacked.cc + accessor/grib_accessor_class_number_of_values_data_raw_packing.cc + accessor/grib_accessor_class_data_g1simple_packing.cc + accessor/grib_accessor_class_data_g1shsimple_packing.cc + accessor/grib_accessor_class_data_shsimple_packing.cc + accessor/grib_accessor_class_data_dummy_field.cc accessor/grib_accessor_class_variable.cc - #accessor/grib_accessor_class_second_order_bits_per_value.cc - #accessor/grib_accessor_class_data_g2simple_packing.cc - #accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc - #accessor/grib_accessor_class_data_g2shsimple_packing.cc - #accessor/grib_accessor_class_data_g2complex_packing.cc - #accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc - #accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc - #accessor/grib_accessor_class_data_g1second_order_general_packing.cc - #accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc - #accessor/grib_accessor_class_g2grid.cc - #accessor/grib_accessor_class_unexpanded_descriptors.cc - #accessor/grib_accessor_class_expanded_descriptors.cc - #accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc - #accessor/grib_accessor_class_data_apply_bitmap.cc - #accessor/grib_accessor_class_data_apply_boustrophedonic.cc - #accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc - #accessor/grib_accessor_class_data_secondary_bitmap.cc - #accessor/grib_accessor_class_data_g1secondary_bitmap.cc - #accessor/grib_accessor_class_data_g2secondary_bitmap.cc - #accessor/grib_accessor_class_data_jpeg2000_packing.cc - #accessor/grib_accessor_class_data_png_packing.cc - #accessor/grib_accessor_class_data_ccsds_packing.cc - #accessor/grib_accessor_class_data_raw_packing.cc - #accessor/grib_accessor_class_data_complex_packing.cc - #accessor/grib_accessor_class_data_g1complex_packing.cc - #accessor/grib_accessor_class_gds_not_present_bitmap.cc - #accessor/grib_accessor_class_gds_is_present.cc - #accessor/grib_accessor_class_select_step_template.cc - #accessor/grib_accessor_class_local_definition.cc - #accessor/grib_accessor_class_g2_eps.cc - #accessor/grib_accessor_class_g2_aerosol.cc - #accessor/grib_accessor_class_g2_chemical.cc - #accessor/grib_accessor_class_g2_mars_labeling.cc - #accessor/grib_accessor_class_md5.cc - #accessor/grib_accessor_class_proj_string.cc + accessor/grib_accessor_class_second_order_bits_per_value.cc + accessor/grib_accessor_class_data_g2simple_packing.cc + accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc + accessor/grib_accessor_class_data_g2shsimple_packing.cc + accessor/grib_accessor_class_data_g2complex_packing.cc + accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc + accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc + accessor/grib_accessor_class_data_g1second_order_general_packing.cc + accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc + accessor/grib_accessor_class_g2grid.cc + accessor/grib_accessor_class_unexpanded_descriptors.cc + accessor/grib_accessor_class_expanded_descriptors.cc + accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc + accessor/grib_accessor_class_data_apply_bitmap.cc + accessor/grib_accessor_class_data_apply_boustrophedonic.cc + accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc + accessor/grib_accessor_class_data_secondary_bitmap.cc + accessor/grib_accessor_class_data_g1secondary_bitmap.cc + accessor/grib_accessor_class_data_g2secondary_bitmap.cc + accessor/grib_accessor_class_data_jpeg2000_packing.cc + accessor/grib_accessor_class_data_png_packing.cc + accessor/grib_accessor_class_data_ccsds_packing.cc + accessor/grib_accessor_class_data_raw_packing.cc + accessor/grib_accessor_class_data_complex_packing.cc + accessor/grib_accessor_class_data_g1complex_packing.cc + accessor/grib_accessor_class_gds_not_present_bitmap.cc + accessor/grib_accessor_class_gds_is_present.cc + accessor/grib_accessor_class_select_step_template.cc + accessor/grib_accessor_class_local_definition.cc + accessor/grib_accessor_class_g2_eps.cc + accessor/grib_accessor_class_g2_aerosol.cc + accessor/grib_accessor_class_g2_chemical.cc + accessor/grib_accessor_class_g2_mars_labeling.cc + accessor/grib_accessor_class_md5.cc + accessor/grib_accessor_class_proj_string.cc grib_jasper_encoding.cc grib_openjpeg_encoding.cc action_class_set_missing.cc - #accessor/grib_accessor_class_number_of_points.cc - #accessor/grib_accessor_class_suppressed.cc + accessor/grib_accessor_class_number_of_points.cc + accessor/grib_accessor_class_suppressed.cc grib_index.cc - #accessor/grib_accessor_class_number_of_points_gaussian.cc - #accessor/grib_accessor_class_number_of_values.cc - #accessor/grib_accessor_class_number_of_coded_values.cc - #accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc - #accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc - #accessor/grib_accessor_class_dirty.cc - #accessor/grib_accessor_class_statistics.cc - #accessor/grib_accessor_class_statistics_spectral.cc + accessor/grib_accessor_class_number_of_points_gaussian.cc + accessor/grib_accessor_class_number_of_values.cc + accessor/grib_accessor_class_number_of_coded_values.cc + accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc + accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc + accessor/grib_accessor_class_dirty.cc + accessor/grib_accessor_class_statistics.cc + accessor/grib_accessor_class_statistics_spectral.cc accessor/grib_accessor_class_unsigned.cc - #accessor/grib_accessor_class_unsigned_bits.cc - #accessor/grib_accessor_class_raw.cc - #accessor/grib_accessor_class_bufr_simple_thinning.cc - #accessor/grib_accessor_class_bufr_extract_subsets.cc - #accessor/grib_accessor_class_bufr_extract_area_subsets.cc - #accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc - #accessor/grib_accessor_class_spd.cc - #accessor/grib_accessor_class_sum.cc - #accessor/grib_accessor_class_to_integer.cc - #accessor/grib_accessor_class_to_double.cc - #accessor/grib_accessor_class_to_string.cc - #accessor/grib_accessor_class_sexagesimal2decimal.cc - #accessor/grib_accessor_class_vector.cc - #accessor/grib_accessor_class_long_vector.cc + accessor/grib_accessor_class_unsigned_bits.cc + accessor/grib_accessor_class_raw.cc + accessor/grib_accessor_class_bufr_simple_thinning.cc + accessor/grib_accessor_class_bufr_extract_subsets.cc + accessor/grib_accessor_class_bufr_extract_area_subsets.cc + accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc + accessor/grib_accessor_class_spd.cc + accessor/grib_accessor_class_sum.cc + accessor/grib_accessor_class_to_integer.cc + accessor/grib_accessor_class_to_double.cc + accessor/grib_accessor_class_to_string.cc + accessor/grib_accessor_class_sexagesimal2decimal.cc + accessor/grib_accessor_class_vector.cc + accessor/grib_accessor_class_long_vector.cc grib_gaussian_reduced.cc - #accessor/grib_accessor_class_abstract_vector.cc - #accessor/grib_accessor_class_abstract_long_vector.cc + accessor/grib_accessor_class_abstract_vector.cc + accessor/grib_accessor_class_abstract_long_vector.cc grib_loader_from_handle.cc grib_bits.cc grib_ibmfloat.cc grib_ieeefloat.cc - #accessor/grib_accessor_class_reference_value_error.cc + accessor/grib_accessor_class_reference_value_error.cc grib_memory.cc grib_buffer.cc grib_dumper.cc @@ -366,16 +367,16 @@ list( APPEND eccodes_src_files grib_yacc.h md5.h md5.cc - #accessor/grib_accessor_class_uint16.cc - #accessor/grib_accessor_class_uint32.cc - #accessor/grib_accessor_class_uint32_little_endian.cc - #accessor/grib_accessor_class_uint64.cc - #accessor/grib_accessor_class_uint64_little_endian.cc - #accessor/grib_accessor_class_uint8.cc - #accessor/grib_accessor_class_blob.cc + accessor/grib_accessor_class_uint16.cc + accessor/grib_accessor_class_uint32.cc + accessor/grib_accessor_class_uint32_little_endian.cc + accessor/grib_accessor_class_uint64.cc + accessor/grib_accessor_class_uint64_little_endian.cc + accessor/grib_accessor_class_uint8.cc + accessor/grib_accessor_class_blob.cc grib_optimize_decimal_factor.cc - #accessor/grib_accessor_class_data_g2bifourier_packing.cc - #accessor/grib_accessor_class_data_run_length_packing.cc + accessor/grib_accessor_class_data_g2bifourier_packing.cc + accessor/grib_accessor_class_data_run_length_packing.cc eccodes_windef.h # We ship our own generated lex/yacc C files grib_yacc.cc grib_lex.cc ) diff --git a/src/accessor/grib_accessor_class_abstract_long_vector.cc b/src/accessor/grib_accessor_class_abstract_long_vector.cc new file mode 100644 index 000000000..ad0740841 --- /dev/null +++ b/src/accessor/grib_accessor_class_abstract_long_vector.cc @@ -0,0 +1,17 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_abstract_long_vector.h" + +grib_accessor_class_abstract_long_vector_t _grib_accessor_class_abstract_long_vector{"abstract_long_vector"}; +grib_accessor_class* grib_accessor_class_abstract_long_vector = &_grib_accessor_class_abstract_long_vector; + diff --git a/src/accessor/grib_accessor_class_abstract_long_vector.h b/src/accessor/grib_accessor_class_abstract_long_vector.h new file mode 100644 index 000000000..2961979d8 --- /dev/null +++ b/src/accessor/grib_accessor_class_abstract_long_vector.h @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_abstract_long_vector_h +#define eccodes_accessor_abstract_long_vector_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_abstract_long_vector_t : public grib_accessor_gen_t +{ +public: + /* Members defined in abstract_long_vector */ + long* v; + long pack_index; + int number_of_elements; +}; + +class grib_accessor_class_abstract_long_vector_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_abstract_long_vector_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_abstract_long_vector_t{}; } +}; +#endif /* eccodes_accessor_abstract_long_vector_h */ diff --git a/src/accessor/grib_accessor_class_abstract_vector.cc b/src/accessor/grib_accessor_class_abstract_vector.cc new file mode 100644 index 000000000..692e9c404 --- /dev/null +++ b/src/accessor/grib_accessor_class_abstract_vector.cc @@ -0,0 +1,17 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_abstract_vector.h" + +grib_accessor_class_abstract_vector_t _grib_accessor_class_abstract_vector{"abstract_vector"}; +grib_accessor_class* grib_accessor_class_abstract_vector = &_grib_accessor_class_abstract_vector; + diff --git a/src/accessor/grib_accessor_class_abstract_vector.h b/src/accessor/grib_accessor_class_abstract_vector.h new file mode 100644 index 000000000..df7e3fdbf --- /dev/null +++ b/src/accessor/grib_accessor_class_abstract_vector.h @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_abstract_vector_h +#define eccodes_accessor_abstract_vector_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_abstract_vector_t : public grib_accessor_double_t +{ +public: + /* Members defined in abstract_vector */ + double* v; + int number_of_elements; +}; + +class grib_accessor_class_abstract_vector_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_abstract_vector_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_abstract_vector_t{}; } +}; +#endif /* eccodes_accessor_abstract_vector_h */ diff --git a/src/accessor/grib_accessor_class_ascii.cc b/src/accessor/grib_accessor_class_ascii.cc new file mode 100644 index 000000000..4fedc7c60 --- /dev/null +++ b/src/accessor/grib_accessor_class_ascii.cc @@ -0,0 +1,164 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +grib_accessor_class_ascii_t _grib_accessor_class_ascii{"ascii"}; +grib_accessor_class* grib_accessor_class_ascii = &_grib_accessor_class_ascii; + + +void grib_accessor_class_ascii_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + a->length = len; + Assert(a->length >= 0); +} + +int grib_accessor_class_ascii_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +size_t grib_accessor_class_ascii_t::string_length(grib_accessor* a){ + return a->length; +} + +void grib_accessor_class_ascii_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_string(dumper, a, NULL); +} + +int grib_accessor_class_ascii_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_STRING; +} + +int grib_accessor_class_ascii_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + size_t i = 0; + grib_handle* hand = grib_handle_of_accessor(a); + const size_t alen = a->length; + + if (*len < (alen + 1)) { + const char* cclass_name = a->cclass->name; + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + cclass_name, a->name, alen+1, *len); + *len = alen + 1; + return GRIB_BUFFER_TOO_SMALL; + } + + for (i = 0; i < alen; i++) + val[i] = hand->buffer->data[a->offset + i]; + val[i] = 0; + *len = i; + return GRIB_SUCCESS; +} + +int grib_accessor_class_ascii_t::pack_string(grib_accessor* a, const char* val, size_t* len){ + size_t i = 0; + grib_handle* hand = grib_handle_of_accessor(a); + const size_t alen = a->length; + if (len[0] > (alen + 1)) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "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 < alen; i++) { + if (i < len[0]) + hand->buffer->data[a->offset + i] = val[i]; + else + hand->buffer->data[a->offset + i] = 0; + } + + return GRIB_SUCCESS; +} + +int grib_accessor_class_ascii_t::pack_long(grib_accessor* a, const long* v, size_t* len){ + grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as long (It's a string)", a->name); + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_ascii_t::pack_double(grib_accessor* a, const double* v, size_t* len){ + grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as double (It's a string)", a->name); + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_ascii_t::unpack_long(grib_accessor* a, long* v, size_t* len){ + char val[1024] = {0,}; + size_t l = sizeof(val); + size_t i = 0; + char* last = NULL; + int err = a->unpack_string(val, &l); + if (err) + return err; + + i = 0; + while (i < l - 1 && val[i] == ' ') + i++; + + if (val[i] == 0) { + *v = 0; + return 0; + } + if (val[i + 1] == ' ' && i < l - 2) + val[i + 1] = 0; + + *v = strtol(val, &last, 10); + + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); + return GRIB_SUCCESS; +} + +int grib_accessor_class_ascii_t::unpack_double(grib_accessor* a, double* v, size_t* len){ + char val[1024]; + size_t l = sizeof(val); + char* last = NULL; + + int err = a->unpack_string(val, &l); if (err) return err; + + *v = strtod(val, &last); + + if (*last == 0) { + 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_WARNING, "Cannot unpack %s as double. Hint: Try unpacking as string", a->name); + + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_ascii_t::compare(grib_accessor* a, grib_accessor* b){ + int retval = 0; + char* aval = 0; + char* bval = 0; + int err = 0; + + size_t alen = a->length+1; + size_t blen = b->length+1; + + if (alen != blen) + return GRIB_COUNT_MISMATCH; + + aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); + bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); + + err = a->unpack_string(aval, &alen); if (err) return err; + err = b->unpack_string(bval, &blen); if (err) return err; + + retval = GRIB_SUCCESS; + if (!STR_EQUAL(aval, bval)) + retval = GRIB_STRING_VALUE_MISMATCH; + + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); + + return retval; +} diff --git a/src/accessor/grib_accessor_class_ascii.h b/src/accessor/grib_accessor_class_ascii.h new file mode 100644 index 000000000..cb8e68bd7 --- /dev/null +++ b/src/accessor/grib_accessor_class_ascii.h @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_ascii_h +#define eccodes_accessor_ascii_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_ascii_t : public grib_accessor_gen_t +{ +public: + /* Members defined in ascii */ +}; + +class grib_accessor_class_ascii_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_ascii_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_ascii_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_ascii_h */ diff --git a/src/accessor/grib_accessor_class_bit.cc b/src/accessor/grib_accessor_class_bit.cc new file mode 100644 index 000000000..2cf31bd48 --- /dev/null +++ b/src/accessor/grib_accessor_class_bit.cc @@ -0,0 +1,79 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_bit.h" + +grib_accessor_class_bit_t _grib_accessor_class_bit{"bit"}; +grib_accessor_class* grib_accessor_class_bit = &_grib_accessor_class_bit; + + +void grib_accessor_class_bit_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_bit_t* self = (grib_accessor_bit_t*)a; + a->length = 0; + self->owner = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); + self->bit_index = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); +} + +int grib_accessor_class_bit_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_bit_t* self = (grib_accessor_bit_t*)a; + int ret = 0; + long data = 0; + + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit_t: unpack_long: Wrong size for %s, it contains %d values ", a->name, 1); + *len = 1; + return GRIB_ARRAY_TOO_SMALL; + } + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->owner, &data)) != GRIB_SUCCESS) { + *len = 0; + return ret; + } + + if (data & (1 << self->bit_index)) + *val = 1; + else + *val = 0; + + *len = 1; + return GRIB_SUCCESS; +} + +int grib_accessor_class_bit_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_bit_t* self = (grib_accessor_bit_t*)a; + + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit_t: pack_long: At least one value to pack for %s", a->name); + *len = 1; + return GRIB_ARRAY_TOO_SMALL; + } + + grib_accessor* owner = grib_find_accessor(grib_handle_of_accessor(a), self->owner); + if (!owner) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit_t: Cannot get the owner %s for computing the bit value of %s", + self->owner, a->name); + *len = 0; + return GRIB_NOT_FOUND; + } + + unsigned char* mdata = grib_handle_of_accessor(a)->buffer->data; + mdata += owner->byte_offset(); + /* Note: In the definitions, flagbit numbers go from 7 to 0 (the bit_index), while WMO convention is from 1 to 8 */ + if (a->context->debug) { + /* Print bit positions from 1 (MSB) */ + fprintf(stderr, "ECCODES DEBUG Setting bit %d in %s to %d\n", 8 - self->bit_index, owner->name, (*val > 0) ); + } + grib_set_bit(mdata, 7 - self->bit_index, *val > 0); + + *len = 1; + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_bit.h b/src/accessor/grib_accessor_class_bit.h new file mode 100644 index 000000000..3a9eee2d7 --- /dev/null +++ b/src/accessor/grib_accessor_class_bit.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bit_h +#define eccodes_accessor_bit_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_bit_t : public grib_accessor_long_t +{ +public: + /* Members defined in bit */ + const char* owner; + int bit_index; +}; + +class grib_accessor_class_bit_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_bit_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bit_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bit_h */ diff --git a/src/accessor/grib_accessor_class_bitmap.cc b/src/accessor/grib_accessor_class_bitmap.cc new file mode 100644 index 000000000..eb45c4464 --- /dev/null +++ b/src/accessor/grib_accessor_class_bitmap.cc @@ -0,0 +1,175 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_bitmap.h" + +grib_accessor_class_bitmap_t _grib_accessor_class_bitmap{"bitmap"}; +grib_accessor_class* grib_accessor_class_bitmap = &_grib_accessor_class_bitmap; + + + +void compute_size(grib_accessor* a){ + long slen = 0; + long off = 0; + grib_handle* hand = grib_handle_of_accessor(a); + + grib_accessor_bitmap_t* self = (grib_accessor_bitmap_t*)a; + grib_get_long_internal(hand, self->offsetbsec, &off); + grib_get_long_internal(hand, self->sLength, &slen); + + if (slen == 0) { + grib_accessor* seclen; + size_t size; + /* Assume reparsing */ + Assert(hand->loader != 0); + if (hand->loader != 0) { + seclen = grib_find_accessor(hand, self->sLength); + Assert(seclen); + grib_get_block_length(seclen->parent, &size); + slen = size; + } + } + + // printf("compute_size off=%ld slen=%ld a->offset=%ld\n", (long)off,(long)slen,(long)a->offset); + + a->length = off + (slen - a->offset); + + if (a->length < 0) { + /* Assume reparsing */ + /*Assert(hand->loader != 0);*/ + a->length = 0; + } + + Assert(a->length >= 0); +} + +void grib_accessor_class_bitmap_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_bitmap_t* self = (grib_accessor_bitmap_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; + + self->tableReference = grib_arguments_get_name(hand, arg, n++); + self->missing_value = grib_arguments_get_name(hand, arg, n++); + self->offsetbsec = grib_arguments_get_name(hand, arg, n++); + self->sLength = grib_arguments_get_name(hand, arg, n++); + + compute_size(a); +} + +long grib_accessor_class_bitmap_t::next_offset(grib_accessor* a){ + return a->byte_offset() + a->byte_count();} + +void grib_accessor_class_bitmap_t::dump(grib_accessor* a, grib_dumper* dumper){ + long len = 0; + char label[1024]; + + a->value_count(&len); + snprintf(label, 1024, "Bitmap of %ld values", len); + grib_dump_bytes(dumper, a, label); +} + +int grib_accessor_class_bitmap_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + long pos = a->offset * 8; + long tlen = 0; + const grib_handle* hand = grib_handle_of_accessor(a); + + int err = a->value_count(&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 = tlen; + return GRIB_ARRAY_TOO_SMALL; + } + + for (long i = 0; i < tlen; i++) { + val[i] = (long)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); + } + *len = tlen; + 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; + grib_handle* hand = grib_handle_of_accessor(a); + + int err = a->value_count(&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 = tlen; + return GRIB_ARRAY_TOO_SMALL; + } + + for (long i = 0; i < tlen; i++) { + val[i] = (T)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); + } + *len = tlen; + return GRIB_SUCCESS; +} + +int grib_accessor_class_bitmap_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + return unpack(a, val, len); +} + +int grib_accessor_class_bitmap_t::unpack_float(grib_accessor* a, float* val, size_t* len){ + return unpack(a, val, len); +} + +int grib_accessor_class_bitmap_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ + long pos = a->offset * 8; + + pos += idx; + *val = (double)grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, 1); + + return GRIB_SUCCESS; +} +int grib_accessor_class_bitmap_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ + for (size_t i=0; ilength = s; +} + +size_t grib_accessor_class_bitmap_t::string_length(grib_accessor* a){ + return a->length; +} + +int grib_accessor_class_bitmap_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_handle* hand = grib_handle_of_accessor(a); + const size_t l = a->length; + + if (*len < l) { + const char* cclass_name = a->cclass->name; + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + cclass_name, a->name, l, *len); + *len = l; + return GRIB_BUFFER_TOO_SMALL; + } + + for (long i = 0; i < a->length; i++) { + val[i] = hand->buffer->data[a->offset + i]; + } + + *len = a->length; + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_bitmap.h b/src/accessor/grib_accessor_class_bitmap.h new file mode 100644 index 000000000..d9b3ab9df --- /dev/null +++ b/src/accessor/grib_accessor_class_bitmap.h @@ -0,0 +1,45 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bitmap_h +#define eccodes_accessor_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_bytes.h" + +class grib_accessor_bitmap_t : public grib_accessor_bytes_t +{ +public: + /* Members defined in bitmap */ + const char* tableReference; + const char* missing_value; + const char* offsetbsec; + const char* sLength; +}; + +class grib_accessor_class_bitmap_t : public grib_accessor_class_bytes_t +{ +public: + grib_accessor_class_bitmap_t(const char* name) : grib_accessor_class_bytes_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bitmap_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_bitmap_h */ diff --git a/src/accessor/todo/grib_accessor_class_bits.cc b/src/accessor/grib_accessor_class_bits.cc similarity index 51% rename from src/accessor/todo/grib_accessor_class_bits.cc rename to src/accessor/grib_accessor_class_bits.cc index 5e86e2fef..b38de626c 100644 --- a/src/accessor/todo/grib_accessor_class_bits.cc +++ b/src/accessor/grib_accessor_class_bits.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,127 +9,15 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************** - * Enrico Fucile - **************************************/ - - #include "grib_api_internal.h" +#include "grib_accessor_class_bits.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = get_native_type - IMPLEMENTS = unpack_long; pack_long - IMPLEMENTS = unpack_bytes; byte_count - IMPLEMENTS = unpack_double; pack_double - IMPLEMENTS = unpack_string - IMPLEMENTS = init - MEMBERS=const char* argument - MEMBERS=long start - MEMBERS=long len - MEMBERS=double referenceValue - MEMBERS=double referenceValuePresent - MEMBERS=double scale - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 pack_long(grib_accessor*, const long* val, size_t* len); -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_long(grib_accessor*, long* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static long byte_count(grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_bits -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bits */ - const char* argument; - long start; - long len; - double referenceValue; - double referenceValuePresent; - double scale; -} grib_accessor_bits; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_bits = { - &grib_accessor_class_gen, /* super */ - "bits", /* name */ - sizeof(grib_accessor_bits), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - &unpack_bytes, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_bits_t _grib_accessor_class_bits{"bits"}; grib_accessor_class* grib_accessor_class_bits = &_grib_accessor_class_bits; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_bits* self = (grib_accessor_bits*)a; +void grib_accessor_class_bits_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_bits_t* self = (grib_accessor_bits_t*)a; grib_handle* hand = grib_handle_of_accessor(a); grib_expression* e = NULL; int n = 0; @@ -154,9 +43,8 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_bits* self = (grib_accessor_bits*)a; +int grib_accessor_class_bits_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_bits_t* self = (grib_accessor_bits_t*)a; grib_accessor* x = NULL; unsigned char* p = NULL; grib_handle* h = grib_handle_of_accessor(a); @@ -173,17 +61,15 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) if (!x) return GRIB_NOT_FOUND; - p = h->buffer->data + grib_byte_offset(x); - *val = grib_decode_unsigned_long(p, &start, length); + p = h->buffer->data + x->byte_offset(); *val = grib_decode_unsigned_long(p, &start, length); *len = 1; return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_bits* self = (grib_accessor_bits*)a; +int grib_accessor_class_bits_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_bits_t* self = (grib_accessor_bits_t*)a; grib_accessor* x = NULL; unsigned char* p = NULL; grib_handle* h = grib_handle_of_accessor(a); @@ -200,8 +86,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) if (!x) return GRIB_NOT_FOUND; - p = h->buffer->data + grib_byte_offset(x); - *val = grib_decode_unsigned_long(p, &start, length); + p = h->buffer->data + x->byte_offset(); *val = grib_decode_unsigned_long(p, &start, length); *val = ((long)*val + self->referenceValue) / self->scale; @@ -210,9 +95,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_bits* self = (grib_accessor_bits*)a; +int grib_accessor_class_bits_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_bits_t* self = (grib_accessor_bits_t*)a; grib_accessor* x = NULL; grib_handle* h = grib_handle_of_accessor(a); unsigned char* p = NULL; @@ -228,15 +112,13 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) if (!x) return GRIB_NOT_FOUND; - p = h->buffer->data + grib_byte_offset(x); - + p = h->buffer->data + x->byte_offset(); lval = round(*val * self->scale) - self->referenceValue; return grib_encode_unsigned_longb(p, lval, &start, length); } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_bits* self = (grib_accessor_bits*)a; +int grib_accessor_class_bits_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_bits_t* self = (grib_accessor_bits_t*)a; grib_accessor* x = NULL; grib_handle* h = grib_handle_of_accessor(a); unsigned char* p = NULL; @@ -285,14 +167,12 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_ENCODING_ERROR; } - p = h->buffer->data + grib_byte_offset(x); - return grib_encode_unsigned_longb(p, *val, &start, length); + p = h->buffer->data + x->byte_offset(); return grib_encode_unsigned_longb(p, *val, &start, length); } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_bits_t::get_native_type(grib_accessor* a){ int type = GRIB_TYPE_BYTES; - grib_accessor_bits* self = (grib_accessor_bits*)a; + grib_accessor_bits_t* self = (grib_accessor_bits_t*)a; if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) type = GRIB_TYPE_STRING; @@ -306,8 +186,7 @@ static int get_native_type(grib_accessor* a) return type; } -static int unpack_string(grib_accessor* a, char* v, size_t* len) -{ +int grib_accessor_class_bits_t::unpack_string(grib_accessor* a, char* v, size_t* len){ int ret = 0; double dval = 0; long lval = 0; @@ -328,20 +207,17 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) break; default: - super = *(a->cclass->super); - ret = super->unpack_string(a, v, len); + ret = grib_accessor_class_gen_t::unpack_string(a, v, len); } return ret; } -static long byte_count(grib_accessor* a) -{ +long grib_accessor_class_bits_t::byte_count(grib_accessor* a){ grib_context_log(a->context, GRIB_LOG_DEBUG, "byte_count of %s = %ld", a->name, a->length); return a->length; } -static int unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len) -{ +int grib_accessor_class_bits_t::unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len){ if (*len < a->length) { *len = a->length; return GRIB_ARRAY_TOO_SMALL; diff --git a/src/accessor/grib_accessor_class_bits.h b/src/accessor/grib_accessor_class_bits.h new file mode 100644 index 000000000..b5dd2977b --- /dev/null +++ b/src/accessor/grib_accessor_class_bits.h @@ -0,0 +1,45 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bits_h +#define eccodes_accessor_bits_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bits_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bits */ + const char* argument; + long start; + long len; + double referenceValue; + double referenceValuePresent; + double scale; +}; + +class grib_accessor_class_bits_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bits_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bits_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + long byte_count(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bits_h */ diff --git a/src/accessor/grib_accessor_class_bits_per_value.cc b/src/accessor/grib_accessor_class_bits_per_value.cc new file mode 100644 index 000000000..b5d3698e0 --- /dev/null +++ b/src/accessor/grib_accessor_class_bits_per_value.cc @@ -0,0 +1,73 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_bits_per_value.h" + +grib_accessor_class_bits_per_value_t _grib_accessor_class_bits_per_value{"bits_per_value"}; +grib_accessor_class* grib_accessor_class_bits_per_value = &_grib_accessor_class_bits_per_value; + + +void grib_accessor_class_bits_per_value_t::init(grib_accessor* a, const long l, grib_arguments* args){ + int n = 0; + grib_accessor_bits_per_value_t* self = (grib_accessor_bits_per_value_t*)a; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +int grib_accessor_class_bits_per_value_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + int ret = 0; + grib_accessor_bits_per_value_t* self = (grib_accessor_bits_per_value_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + + if ((ret = grib_get_long_internal(h, self->bits_per_value, val)) != GRIB_SUCCESS) + return ret; + + *len = 1; + return ret; +} + +int grib_accessor_class_bits_per_value_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + double* values = NULL; + size_t size = 0; + int ret = 0; + grib_accessor_bits_per_value_t* self = (grib_accessor_bits_per_value_t*)a; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; + + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; + + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return ret; + } + + if ((ret = grib_set_long_internal(h, self->bits_per_value, *val)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return ret; + } + + if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return ret; + } + + grib_context_free(c, values); + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_bits_per_value.h b/src/accessor/grib_accessor_class_bits_per_value.h new file mode 100644 index 000000000..59514fc05 --- /dev/null +++ b/src/accessor/grib_accessor_class_bits_per_value.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bits_per_value_h +#define eccodes_accessor_bits_per_value_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_bits_per_value_t : public grib_accessor_long_t +{ +public: + /* Members defined in bits_per_value */ + const char* values; + const char* bits_per_value; +}; + +class grib_accessor_class_bits_per_value_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_bits_per_value_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bits_per_value_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bits_per_value_h */ diff --git a/src/accessor/grib_accessor_class_blob.cc b/src/accessor/grib_accessor_class_blob.cc new file mode 100644 index 000000000..ddcfc9961 --- /dev/null +++ b/src/accessor/grib_accessor_class_blob.cc @@ -0,0 +1,42 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_blob.h" + +grib_accessor_class_blob_t _grib_accessor_class_blob{"blob"}; +grib_accessor_class* grib_accessor_class_blob = &_grib_accessor_class_blob; + + +void grib_accessor_class_blob_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, arg, 0), &a->length); + Assert(a->length >= 0); +} + +int grib_accessor_class_blob_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_BYTES; +} + +int grib_accessor_class_blob_t::unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len){ + if (*len < (size_t)a->length) { + *len = a->length; + return GRIB_ARRAY_TOO_SMALL; + } + *len = a->length; + + memcpy(buffer, grib_handle_of_accessor(a)->buffer->data + a->offset, *len); + + return GRIB_SUCCESS; +} + +void grib_accessor_class_blob_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_bytes(dumper, a, NULL); +} diff --git a/src/accessor/grib_accessor_class_blob.h b/src/accessor/grib_accessor_class_blob.h new file mode 100644 index 000000000..a2da98a03 --- /dev/null +++ b/src/accessor/grib_accessor_class_blob.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_blob_h +#define eccodes_accessor_blob_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_blob_t : public grib_accessor_gen_t +{ +public: + /* Members defined in blob */ +}; + +class grib_accessor_class_blob_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_blob_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_blob_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_blob_h */ diff --git a/src/accessor/grib_accessor_class_budgdate.cc b/src/accessor/grib_accessor_class_budgdate.cc new file mode 100644 index 000000000..1bfd6e7b9 --- /dev/null +++ b/src/accessor/grib_accessor_class_budgdate.cc @@ -0,0 +1,82 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_budgdate.h" + +grib_accessor_class_budgdate_t _grib_accessor_class_budgdate{"budgdate"}; +grib_accessor_class* grib_accessor_class_budgdate = &_grib_accessor_class_budgdate; + + +void grib_accessor_class_budgdate_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_budgdate_t* self = (grib_accessor_budgdate_t*)a; + int n = 0; + + self->year = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->month = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->day = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); +} + +int grib_accessor_class_budgdate_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + int ret = 0; + grib_accessor_budgdate_t* self = (grib_accessor_budgdate_t*)a; + + long year = 0; + long month = 0; + long day = 0; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->day, &day)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->month, &month)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->year, &year)) != GRIB_SUCCESS) + return ret; + + if (*len < 1) + return GRIB_WRONG_ARRAY_SIZE; + + val[0] = (1900 + year) * 10000 + month * 100 + day; + + return ret; +} + +/* TODO: Check for a valid date */ +int grib_accessor_class_budgdate_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + int ret = 0; + long v = val[0]; + grib_accessor_budgdate_t* self = (grib_accessor_budgdate_t*)a; + + long year = 0; + long month = 0; + long day = 0; + + if (*len != 1) + return GRIB_WRONG_ARRAY_SIZE; + + year = v / 10000; + v %= 10000; + month = v / 100; + v %= 100; + day = v; + + year -= 1900; + + Assert(year < 255); + + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->day, day)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->month, month)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->year, year)) != GRIB_SUCCESS) + return ret; + + return ret; +} diff --git a/src/accessor/grib_accessor_class_budgdate.h b/src/accessor/grib_accessor_class_budgdate.h new file mode 100644 index 000000000..c3fc849c7 --- /dev/null +++ b/src/accessor/grib_accessor_class_budgdate.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_budgdate_h +#define eccodes_accessor_budgdate_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_budgdate_t : public grib_accessor_long_t +{ +public: + /* Members defined in budgdate */ + const char* year; + const char* month; + const char* day; +}; + +class grib_accessor_class_budgdate_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_budgdate_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_budgdate_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_budgdate_h */ diff --git a/src/accessor/todo/grib_accessor_class_bufr_data_array.cc b/src/accessor/grib_accessor_class_bufr_data_array.cc similarity index 87% rename from src/accessor/todo/grib_accessor_class_bufr_data_array.cc rename to src/accessor/grib_accessor_class_bufr_data_array.cc index 3d044835a..ea32d69c4 100644 --- a/src/accessor/todo/grib_accessor_class_bufr_data_array.cc +++ b/src/accessor/grib_accessor_class_bufr_data_array.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -10,202 +11,11 @@ #include "grib_scaling.h" #include "grib_api_internal.h" +#include "grib_accessor_class_bufr_data_array.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init - IMPLEMENTS = dump;destroy - IMPLEMENTS = next_offset - IMPLEMENTS = byte_count; value_count - IMPLEMENTS = byte_offset; unpack_double - IMPLEMENTS = get_native_type - IMPLEMENTS = pack_long; unpack_double; pack_double - MEMBERS = const char* bufrDataEncodedName - MEMBERS = const char* numberOfSubsetsName - MEMBERS = const char* expandedDescriptorsName - MEMBERS = const char* flagsName - MEMBERS = const char* unitsName - MEMBERS = const char* elementsDescriptorsIndexName - MEMBERS = const char* compressedDataName - MEMBERS = bufr_descriptors_array* expanded - MEMBERS = grib_accessor* expandedAccessor - MEMBERS = int* canBeMissing - MEMBERS = long numberOfSubsets - MEMBERS = long compressedData - MEMBERS = grib_vdarray* numericValues - MEMBERS = grib_vsarray* stringValues - MEMBERS = grib_viarray* elementsDescriptorsIndex - MEMBERS = int do_decode - MEMBERS = int bitmapStartElementsDescriptorsIndex - MEMBERS = int bitmapCurrentElementsDescriptorsIndex - MEMBERS = int bitmapSize - MEMBERS = int bitmapStart - MEMBERS = int bitmapCurrent - MEMBERS = grib_accessors_list* dataAccessors - MEMBERS = int unpackMode - MEMBERS = int bitsToEndData - MEMBERS = grib_section* dataKeys - MEMBERS = double* inputBitmap - MEMBERS = int nInputBitmap - MEMBERS = int iInputBitmap - MEMBERS = long* inputReplications - MEMBERS = int nInputReplications - MEMBERS = int iInputReplications - MEMBERS = long* inputExtendedReplications - MEMBERS = int nInputExtendedReplications - MEMBERS = int iInputExtendedReplications - MEMBERS = long* inputShortReplications - MEMBERS = int nInputShortReplications - MEMBERS = int iInputShortReplications - 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 - MEMBERS = long refValIndex - MEMBERS = bufr_tableb_override* tableb_override - MEMBERS = int set_to_missing_if_out_of_range - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static long byte_count(grib_accessor*); -static long byte_offset(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_bufr_data_array -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bufr_data_array */ - const char* bufrDataEncodedName; - const char* numberOfSubsetsName; - const char* expandedDescriptorsName; - const char* flagsName; - const char* unitsName; - const char* elementsDescriptorsIndexName; - const char* compressedDataName; - bufr_descriptors_array* expanded; - grib_accessor* expandedAccessor; - int* canBeMissing; - long numberOfSubsets; - long compressedData; - grib_vdarray* numericValues; - grib_vsarray* stringValues; - grib_viarray* elementsDescriptorsIndex; - int do_decode; - int bitmapStartElementsDescriptorsIndex; - int bitmapCurrentElementsDescriptorsIndex; - int bitmapSize; - int bitmapStart; - int bitmapCurrent; - grib_accessors_list* dataAccessors; - int unpackMode; - int bitsToEndData; - grib_section* dataKeys; - double* inputBitmap; - int nInputBitmap; - int iInputBitmap; - long* inputReplications; - int nInputReplications; - int iInputReplications; - long* inputExtendedReplications; - int nInputExtendedReplications; - int iInputExtendedReplications; - long* inputShortReplications; - int nInputShortReplications; - int iInputShortReplications; - grib_iarray* iss_list; - grib_trie_with_rank* dataAccessorsTrie; - grib_sarray* tempStrings; - grib_vdarray* tempDoubleValues; - int change_ref_value_operand; - size_t refValListSize; - long* refValList; - long refValIndex; - bufr_tableb_override* tableb_override; - int set_to_missing_if_out_of_range; -} grib_accessor_bufr_data_array; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_bufr_data_array = { - &grib_accessor_class_gen, /* super */ - "bufr_data_array", /* name */ - sizeof(grib_accessor_bufr_data_array), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_bufr_data_array_t _grib_accessor_class_bufr_data_array{"bufr_data_array"}; grib_accessor_class* grib_accessor_class_bufr_data_array = &_grib_accessor_class_bufr_data_array; -/* END_CLASS_IMP */ #define MAX_NESTED_REPLICATIONS 8 @@ -225,33 +35,27 @@ grib_accessor_class* grib_accessor_class_bufr_data_array = &_grib_accessor_class return retval; \ } -static int process_elements(grib_accessor* a, int flag, long onlySubset, long startSubset, long endSubset); - -typedef int (*codec_element_proc)(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, grib_buffer* b, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex, grib_darray* dval, grib_sarray* sval); -typedef int (*codec_replication_proc)(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions); +int process_elements(grib_accessor* a, int flag, long onlySubset, long startSubset, long endSubset); +typedef int (*codec_element_proc)(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* b, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex, grib_darray* dval, grib_sarray* sval); +typedef int (*codec_replication_proc)(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions); -static int create_keys(const grib_accessor* a, long onlySubset, long startSubset, long endSubset); - -static void restart_bitmap(grib_accessor_bufr_data_array* self) -{ +int create_keys(const grib_accessor* a, long onlySubset, long startSubset, long endSubset); +void restart_bitmap(grib_accessor_bufr_data_array_t* self){ self->bitmapCurrent = -1; self->bitmapCurrentElementsDescriptorsIndex = self->bitmapStartElementsDescriptorsIndex - 1; } -static void cancel_bitmap(grib_accessor_bufr_data_array* self) -{ +void cancel_bitmap(grib_accessor_bufr_data_array_t* self){ self->bitmapCurrent = -1; self->bitmapStart = -1; } -static int is_bitmap_start_defined(grib_accessor_bufr_data_array* self) -{ +int is_bitmap_start_defined(grib_accessor_bufr_data_array_t* self){ return self->bitmapStart == -1 ? 0 : 1; } -static size_t get_length(grib_accessor* a) -{ - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; +size_t get_length(grib_accessor* a){ + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; size_t len = 0; const grib_handle* h = grib_handle_of_accessor(a); @@ -262,8 +66,7 @@ static size_t get_length(grib_accessor* a) } /* Operator 203YYY: Store the TableB code and changed reference value in linked list */ -static void tableB_override_store_ref_val(grib_context* c, grib_accessor_bufr_data_array* self, int code, long new_ref_val) -{ +void tableB_override_store_ref_val(grib_context* c, grib_accessor_bufr_data_array_t* self, int code, long new_ref_val){ bufr_tableb_override* tb = (bufr_tableb_override*)grib_context_malloc_clear(c, sizeof(bufr_tableb_override)); tb->code = code; tb->new_ref_val = new_ref_val; @@ -280,8 +83,7 @@ static void tableB_override_store_ref_val(grib_context* c, grib_accessor_bufr_da } /* Operator 203YYY: Retrieve changed reference value from linked list */ -static int tableB_override_get_ref_val(grib_accessor_bufr_data_array* self, int code, long* out_ref_val) -{ +int tableB_override_get_ref_val(grib_accessor_bufr_data_array_t* self, int code, long* out_ref_val){ bufr_tableb_override* p = self->tableb_override; while (p) { if (p->code == code) { @@ -294,8 +96,7 @@ static int tableB_override_get_ref_val(grib_accessor_bufr_data_array* self, int } /* Operator 203YYY: Clear and free linked list */ -static void tableB_override_clear(grib_context* c, grib_accessor_bufr_data_array* self) -{ +void tableB_override_clear(grib_context* c, grib_accessor_bufr_data_array_t* self){ bufr_tableb_override* tb = self->tableb_override; while (tb) { bufr_tableb_override* n = tb->next; @@ -306,8 +107,7 @@ static void tableB_override_clear(grib_context* c, grib_accessor_bufr_data_array } /* Operator 203YYY: Copy contents of linked list to the transient array key */ -static int tableB_override_set_key(grib_handle* h, grib_accessor_bufr_data_array* self) -{ +int tableB_override_set_key(grib_handle* h, grib_accessor_bufr_data_array_t* self){ int err = GRIB_SUCCESS; size_t size = 0; long* refVals = NULL; @@ -327,8 +127,7 @@ static int tableB_override_set_key(grib_handle* h, grib_accessor_bufr_data_array return err; } /* Check numBits is sufficient for entries in the overridden reference values list*/ -static int check_overridden_reference_values(const grib_context* c, long* refValList, size_t refValListSize, int numBits) -{ +int check_overridden_reference_values(const grib_context* c, long* refValList, size_t refValListSize, int numBits){ const long maxval = (1 << (numBits - 1)) - 1; const long minval = -(1 << (numBits - 1)); size_t i = 0; @@ -343,7 +142,7 @@ static int check_overridden_reference_values(const grib_context* c, long* refVal return GRIB_SUCCESS; } -// static void tableB_override_dump(grib_accessor_bufr_data_array *self) +// void tableB_override_dump(grib_accessor_bufr_data_array_t *self) // { // bufr_tableb_override* p = self->tableb_override; // int i = 1; @@ -357,9 +156,8 @@ static int check_overridden_reference_values(const grib_context* c, long* refVal #define DYN_ARRAY_SIZE_INIT 1000 /* Initial size for grib_iarray_new and grib_darray_new */ #define DYN_ARRAY_SIZE_INCR 1000 /* Increment size for grib_iarray_new and grib_darray_new */ -static void init(grib_accessor* a, const long v, grib_arguments* params) -{ - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; +void grib_accessor_class_bufr_data_array_t::init(grib_accessor* a, const long v, grib_arguments* params){ + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; int n = 0; const char* dataKeysName = NULL; grib_accessor* dataKeysAcc = NULL; @@ -397,7 +195,7 @@ static void init(grib_accessor* a, const long v, grib_arguments* params) /* Assert(a->length>=0); */ } -// static void clean_string(char* s,int len) +// void clean_string(char* s,int len) // { // int i=len-1; // while (i) { @@ -407,8 +205,7 @@ static void init(grib_accessor* a, const long v, grib_arguments* params) // } // } -static int check_end_data(grib_context* c, bufr_descriptor* bd, grib_accessor_bufr_data_array* self, int size) -{ +int check_end_data(grib_context* c, bufr_descriptor* bd, grib_accessor_bufr_data_array_t* self, int size){ const int saved_bitsToEndData = self->bitsToEndData; if (c->debug == 1) grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \tbitsToEndData=%d elementSize=%d", self->bitsToEndData, size); @@ -422,8 +219,7 @@ static int check_end_data(grib_context* c, bufr_descriptor* bd, grib_accessor_bu return 0; } -static void self_clear(grib_context* c, grib_accessor_bufr_data_array* self) -{ +void self_clear(grib_context* c, grib_accessor_bufr_data_array_t* self){ grib_context_free(c, self->canBeMissing); grib_vdarray_delete_content(c, self->numericValues); grib_vdarray_delete(c, self->numericValues); @@ -452,69 +248,62 @@ static void self_clear(grib_context* c, grib_accessor_bufr_data_array* self) if (self->inputBitmap) grib_context_free(c, self->inputBitmap); } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_bufr_data_array_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_DOUBLE; } -static long byte_count(grib_accessor* a) -{ +long grib_accessor_class_bufr_data_array_t::byte_count(grib_accessor* a){ return 0; } -static long byte_offset(grib_accessor* a) -{ +long grib_accessor_class_bufr_data_array_t::byte_offset(grib_accessor* a){ return a->offset; } -static long next_offset(grib_accessor* a) -{ +long grib_accessor_class_bufr_data_array_t::next_offset(grib_accessor* a){ return a->offset; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; +int grib_accessor_class_bufr_data_array_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; self->do_decode = 1; return GRIB_NOT_IMPLEMENTED; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; +int grib_accessor_class_bufr_data_array_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; self->do_decode = 1; return process_elements(a, PROCESS_ENCODE, 0, 0, 0); } grib_vsarray* accessor_bufr_data_array_get_stringValues(grib_accessor* a) { - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; process_elements(a, PROCESS_DECODE, 0, 0, 0); return self->stringValues; } grib_accessors_list* accessor_bufr_data_array_get_dataAccessors(grib_accessor* a) { - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; return self->dataAccessors; } grib_trie_with_rank* accessor_bufr_data_array_get_dataAccessorsTrie(grib_accessor* a) { - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; return self->dataAccessorsTrie; } void accessor_bufr_data_array_set_unpackMode(grib_accessor* a, int unpackMode) { - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; self->unpackMode = unpackMode; } -static int get_descriptors(grib_accessor* a) -{ - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; +int get_descriptors(grib_accessor* a){ + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; int ret = 0, i, numberOfDescriptors; grib_handle* h = grib_handle_of_accessor(a); grib_context* c = a->context; @@ -539,8 +328,8 @@ static int get_descriptors(grib_accessor* a) return ret; } -static int decode_string_array(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array* self) +int decode_string_array(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, + grib_accessor_bufr_data_array_t* self) { int ret = 0; int* err = &ret; @@ -597,9 +386,9 @@ static int decode_string_array(grib_context* c, unsigned char* data, long* pos, return ret; } -static grib_darray* decode_double_array(grib_context* c, unsigned char* data, long* pos, +grib_darray* decode_double_array(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, int canBeMissing, - grib_accessor_bufr_data_array* self, int* err) + grib_accessor_bufr_data_array_t* self, int* err) { grib_darray* ret = NULL; int j; @@ -680,8 +469,8 @@ static grib_darray* decode_double_array(grib_context* c, unsigned char* data, lo return ret; } -static int encode_string_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array* self, grib_sarray* stringValues) +int encode_string_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, + grib_accessor_bufr_data_array_t* self, grib_sarray* stringValues) { int err = 0, n, ival; int k, j, modifiedWidth, width; @@ -737,8 +526,7 @@ static int encode_string_array(grib_context* c, grib_buffer* buff, long* pos, bu return err; } -static void set_missing_long_to_double(grib_darray* dvalues) -{ +void set_missing_long_to_double(grib_darray* dvalues){ size_t i, n = grib_darray_used_size(dvalues); for (i = 0; i < n; i++) { if (dvalues->v[i] == GRIB_MISSING_LONG) @@ -747,7 +535,7 @@ static void set_missing_long_to_double(grib_darray* dvalues) } /* ECC-750: The 'factor' argument is 10^-scale */ -static int descriptor_get_min_max(bufr_descriptor* bd, long width, long reference, double factor, +int descriptor_get_min_max(bufr_descriptor* bd, long width, long reference, double factor, double* minAllowed, double* maxAllowed) { /* Maximum value is allowed to be the largest number (all bits 1) which means it's MISSING */ @@ -763,8 +551,8 @@ static int descriptor_get_min_max(bufr_descriptor* bd, long width, long referenc return GRIB_SUCCESS; } -static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array* self, grib_darray* dvalues) +int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, + grib_accessor_bufr_data_array_t* self, grib_darray* dvalues) { int err = 0; int j, i; @@ -981,8 +769,8 @@ static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bu return err; } -static int encode_double_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array* self, double value) +int encode_double_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, + grib_accessor_bufr_data_array_t* self, double value) { size_t lval; double maxAllowed, minAllowed; @@ -1028,8 +816,8 @@ static int encode_double_value(grib_context* c, grib_buffer* buff, long* pos, bu return err; } -static int encode_string_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array* self, char* sval) +int encode_string_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, + grib_accessor_bufr_data_array_t* self, char* sval) { int err = 0; int len; @@ -1044,8 +832,8 @@ static int encode_string_value(grib_context* c, grib_buffer* buff, long* pos, bu return err; } -static char* decode_string_value(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array* self, int* err) +char* decode_string_value(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, + grib_accessor_bufr_data_array_t* self, int* err) { char* sval = 0; int len; @@ -1067,9 +855,9 @@ static char* decode_string_value(grib_context* c, unsigned char* data, long* pos return sval; } -static double decode_double_value(grib_context* c, unsigned char* data, long* pos, +double decode_double_value(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, int canBeMissing, - grib_accessor_bufr_data_array* self, int* err) + grib_accessor_bufr_data_array_t* self, int* err) { size_t lval; int modifiedWidth, modifiedReference; @@ -1098,7 +886,7 @@ static double decode_double_value(grib_context* c, unsigned char* data, long* po return dval; } -static int decode_element(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, +int decode_element(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* b, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex, grib_darray* dval, grib_sarray* sval) { @@ -1180,7 +968,7 @@ static int decode_element(grib_context* c, grib_accessor_bufr_data_array* self, return err; } -static int decode_replication(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, +int decode_replication(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions) { int ret = 0; @@ -1245,8 +1033,7 @@ static int decode_replication(grib_context* c, grib_accessor_bufr_data_array* se return ret; } -static int encode_new_bitmap(grib_context* c, grib_buffer* buff, long* pos, int idx, grib_accessor_bufr_data_array* self) -{ +int encode_new_bitmap(grib_context* c, grib_buffer* buff, long* pos, int idx, grib_accessor_bufr_data_array_t* self){ grib_darray* doubleValues = NULL; int err = 0; double cdval = 0; @@ -1268,7 +1055,7 @@ static int encode_new_bitmap(grib_context* c, grib_buffer* buff, long* pos, int } /* Operator 203YYY: Change Reference Values: Encoding definition phase */ -static int encode_overridden_reference_value(grib_context* c, grib_accessor_bufr_data_array* self, +int encode_overridden_reference_value(grib_context* c, grib_accessor_bufr_data_array_t* self, grib_buffer* buff, long* pos, bufr_descriptor* bd) { int err = 0; @@ -1307,7 +1094,7 @@ static int encode_overridden_reference_value(grib_context* c, grib_accessor_bufr return err; } -static int encode_new_element(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, +int encode_new_element(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex, grib_darray* dval, grib_sarray* sval) { @@ -1367,7 +1154,7 @@ static int encode_new_element(grib_context* c, grib_accessor_bufr_data_array* se return err; } -static int encode_new_replication(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, +int encode_new_replication(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions) { int err = 0; @@ -1430,7 +1217,7 @@ static int encode_new_replication(grib_context* c, grib_accessor_bufr_data_array return err; } -static int encode_element(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, +int encode_element(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex, grib_darray* dval, grib_sarray* sval) { @@ -1501,7 +1288,7 @@ static int encode_element(grib_context* c, grib_accessor_bufr_data_array* self, return err; } -static int encode_replication(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, +int encode_replication(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions) { @@ -1517,7 +1304,7 @@ static int encode_replication(grib_context* c, grib_accessor_bufr_data_array* se return encode_element(c, self, subsetIndex, buff, data, pos, i, 0, elementIndex, dval, 0); } -static int build_bitmap(grib_accessor_bufr_data_array* self, unsigned char* data, long* pos, +int build_bitmap(grib_accessor_bufr_data_array_t* self, unsigned char* data, long* pos, int iel, grib_iarray* elementsDescriptorsIndex, int iBitmapOperator) { int bitmapSize = 0, iDelayedReplication = 0; @@ -1615,8 +1402,7 @@ static int build_bitmap(grib_accessor_bufr_data_array* self, unsigned char* data return GRIB_SUCCESS; } -static int consume_bitmap(grib_accessor_bufr_data_array* self, int iBitmapOperator) -{ +int consume_bitmap(grib_accessor_bufr_data_array_t* self, int iBitmapOperator){ int bitmapSize = 0, iDelayedReplication; int i; bufr_descriptor** descriptors = self->expanded->v; @@ -1646,7 +1432,7 @@ static int consume_bitmap(grib_accessor_bufr_data_array* self, int iBitmapOperat return GRIB_SUCCESS; } -static int build_bitmap_new_data(grib_accessor_bufr_data_array* self, unsigned char* data, long* pos, +int build_bitmap_new_data(grib_accessor_bufr_data_array_t* self, unsigned char* data, long* pos, int iel, grib_iarray* elementsDescriptorsIndex, int iBitmapOperator) { int bitmapSize = 0, iDelayedReplication = 0; @@ -1733,8 +1519,7 @@ static int build_bitmap_new_data(grib_accessor_bufr_data_array* self, unsigned c } /* ECC-1304: Will return an index if successful. In case of an error, a negative number is returned e.g. GRIB_WRONG_BITMAP_SIZE */ -static int get_next_bitmap_descriptor_index_new_bitmap(grib_accessor_bufr_data_array* self, grib_iarray* elementsDescriptorsIndex, int compressedData) -{ +int get_next_bitmap_descriptor_index_new_bitmap(grib_accessor_bufr_data_array_t* self, grib_iarray* elementsDescriptorsIndex, int compressedData){ int i; bufr_descriptor** descriptors = self->expanded->v; @@ -1771,8 +1556,7 @@ static int get_next_bitmap_descriptor_index_new_bitmap(grib_accessor_bufr_data_a } /* ECC-1304: Will return an index if successful. In case of an error, a negative number is returned e.g. GRIB_WRONG_BITMAP_SIZE */ -static int get_next_bitmap_descriptor_index(grib_accessor_bufr_data_array* self, grib_iarray* elementsDescriptorsIndex, grib_darray* numericValues) -{ +int get_next_bitmap_descriptor_index(grib_accessor_bufr_data_array_t* self, grib_iarray* elementsDescriptorsIndex, grib_darray* numericValues){ int i; bufr_descriptor** descriptors = self->expanded->v; @@ -1813,8 +1597,7 @@ static int get_next_bitmap_descriptor_index(grib_accessor_bufr_data_array* self, return elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]; } -static void push_zero_element(grib_accessor_bufr_data_array* self, grib_darray* dval) -{ +void push_zero_element(grib_accessor_bufr_data_array_t* self, grib_darray* dval){ grib_darray* d = 0; grib_accessor* a = (grib_accessor*)self; grib_context* c = a->context; @@ -1828,7 +1611,7 @@ static void push_zero_element(grib_accessor_bufr_data_array* self, grib_darray* } } -static grib_accessor* create_attribute_variable(const char* name, grib_section* section, int type, char* sval, double dval, long lval, unsigned long flags) +grib_accessor* create_attribute_variable(const char* name, grib_section* section, int type, char* sval, double dval, long lval, unsigned long flags) { grib_accessor* a = NULL; grib_action creator = {0,}; @@ -1846,26 +1629,22 @@ static grib_accessor* create_attribute_variable(const char* name, grib_section* len = 1; switch (type) { case GRIB_TYPE_LONG: - grib_pack_long(a, &lval, &len); - break; + a->pack_long(&lval, &len); break; case GRIB_TYPE_DOUBLE: - grib_pack_double(a, &dval, &len); - break; + a->pack_double(&dval, &len); break; case GRIB_TYPE_STRING: if (!sval) return NULL; /* Performance: No need for len=strlen(sval). It's not used. */ /* See grib_accessor_class_variable.c, pack_string() */ len = 0; - grib_pack_string(a, sval, &len); - break; + a->pack_string(sval, &len); break; } return a; } -static void set_creator_name(grib_action* creator, int code) -{ +void set_creator_name(grib_action* creator, int code){ switch (code) { case 222000: creator->name = (char*)"qualityInformationFollows"; @@ -1937,8 +1716,7 @@ static void set_creator_name(grib_action* creator, int code) } /* See ECC-741 */ -static int adding_extra_key_attributes(grib_handle* h) -{ +int adding_extra_key_attributes(grib_handle* h){ long skip = 0; /* default is to add */ int err = 0; err = grib_get_long(h, "skipExtraKeyAttributes", &skip); @@ -1947,11 +1725,11 @@ static int adding_extra_key_attributes(grib_handle* h) return (!skip); } -static grib_accessor* create_accessor_from_descriptor(const grib_accessor* a, grib_accessor* attribute, grib_section* section, +grib_accessor* create_accessor_from_descriptor(const grib_accessor* a, grib_accessor* attribute, grib_section* section, long ide, long subset, int add_dump_flag, int add_coord_flag, int count, int add_extra_attributes) { - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; char code[10] = {0,}; char* temp_str = NULL; int idx = 0; @@ -2014,13 +1792,13 @@ static grib_accessor* create_accessor_from_descriptor(const grib_accessor* a, gr if (attribute->attributes[i]) attribute->attributes[i]->parent=elementAccessor->parent; } */ - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); } attribute = create_attribute_variable("index", section, GRIB_TYPE_LONG, 0, 0, count, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); snprintf(code, sizeof(code), "%06ld", self->expanded->v[idx]->code); temp_str = grib_context_strdup(a->context, code); @@ -2028,28 +1806,28 @@ static grib_accessor* create_accessor_from_descriptor(const grib_accessor* a, gr if (!attribute) return NULL; grib_sarray_push(a->context, self->tempStrings, temp_str); /* ECC-325: store alloc'd string (due to strdup) for clean up later */ - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); if (add_extra_attributes) { attribute = create_attribute_variable("units", section, GRIB_TYPE_STRING, self->expanded->v[idx]->units, 0, 0, GRIB_ACCESSOR_FLAG_DUMP | flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); attribute = create_attribute_variable("scale", section, GRIB_TYPE_LONG, 0, 0, self->expanded->v[idx]->scale, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); attribute = create_attribute_variable("reference", section, GRIB_TYPE_DOUBLE, 0, self->expanded->v[idx]->reference, 0, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); attribute = create_attribute_variable("width", section, GRIB_TYPE_LONG, 0, 0, self->expanded->v[idx]->width, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); } break; case 2: @@ -2071,7 +1849,7 @@ static grib_accessor* create_accessor_from_descriptor(const grib_accessor* a, gr attribute = create_attribute_variable("index", section, GRIB_TYPE_LONG, 0, 0, count, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); } else { elementAccessor = grib_accessor_factory(section, &operatorCreator, 0, NULL); @@ -2080,13 +1858,13 @@ static grib_accessor* create_accessor_from_descriptor(const grib_accessor* a, gr attribute = create_attribute_variable("index", section, GRIB_TYPE_LONG, 0, 0, count, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); snprintf(code, sizeof(code), "%06ld", self->expanded->v[idx]->code); attribute = create_attribute_variable("code", section, GRIB_TYPE_STRING, code, 0, 0, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); } self->expanded->v[idx]->a = elementAccessor; break; @@ -2106,34 +1884,34 @@ static grib_accessor* create_accessor_from_descriptor(const grib_accessor* a, gr attribute = create_attribute_variable("index", section, GRIB_TYPE_LONG, 0, 0, count, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); snprintf(code, sizeof(code), "%06ld", self->expanded->v[idx]->code); attribute = create_attribute_variable("code", section, GRIB_TYPE_STRING, code, 0, 0, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); if (add_extra_attributes) { attribute = create_attribute_variable("units", section, GRIB_TYPE_STRING, self->expanded->v[idx]->units, 0, 0, GRIB_ACCESSOR_FLAG_DUMP); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); attribute = create_attribute_variable("scale", section, GRIB_TYPE_LONG, 0, 0, self->expanded->v[idx]->scale, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); attribute = create_attribute_variable("reference", section, GRIB_TYPE_DOUBLE, 0, self->expanded->v[idx]->reference, 0, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); attribute = create_attribute_variable("width", section, GRIB_TYPE_LONG, 0, 0, self->expanded->v[idx]->width, flags); if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor, attribute, 0); + elementAccessor->add_attribute(attribute, 0); } break; } @@ -2179,19 +1957,18 @@ static grib_accessor* get_element_from_bitmap(const grib_accessor* a, bitmap_s* while (bitmapVal) { len = 1; if (bitmap->cursor && bitmap->cursor->accessor) { - ret = grib_unpack_long(bitmap->cursor->accessor, &bitmapVal, &len); - } + ret = bitmap->cursor->accessor->unpack_long(&bitmapVal, &len); } else { return NULL; } if (ret != 0) return NULL; - bitmap->cursor = bitmap->cursor->next; + bitmap->cursor = bitmap->cursor->next_; if (bitmap->referredElement) - bitmap->referredElement = bitmap->referredElement->next; + bitmap->referredElement = bitmap->referredElement->next_; } - return bitmap->referredElement ? bitmap->referredElement->prev->accessor : NULL; + return bitmap->referredElement ? bitmap->referredElement->prev_->accessor : NULL; } // static GRIB_INLINE void reset_qualifiers(grib_accessor* significanceQualifierGroup[]) @@ -2201,8 +1978,7 @@ static grib_accessor* get_element_from_bitmap(const grib_accessor* a, bitmap_s* // significanceQualifierGroup[i]=0; // } -static void grib_convert_to_attribute(grib_accessor* a) -{ +void grib_convert_to_attribute(grib_accessor* a){ if (a->h == NULL && a->parent != NULL) { a->h = grib_handle_of_accessor(a); a->parent = NULL; @@ -2211,7 +1987,7 @@ static void grib_convert_to_attribute(grib_accessor* a) /* subsetList can be NULL in which case subsetListSize will be 0 */ static grib_iarray* set_subset_list( - grib_context* c, grib_accessor_bufr_data_array* self, + grib_context* c, grib_accessor_bufr_data_array_t* self, long onlySubset, long startSubset, long endSubset, const long* subsetList, size_t subsetListSize) { grib_iarray* list = grib_iarray_new(c, self->numberOfSubsets, 10); @@ -2249,8 +2025,7 @@ static grib_iarray* set_subset_list( return list; } -static int bitmap_ref_skip(grib_accessors_list* al, int* err) -{ +int bitmap_ref_skip(grib_accessors_list* al, int* err){ grib_accessor* acode = NULL; long code[1]; size_t l = 1; @@ -2258,11 +2033,10 @@ static int bitmap_ref_skip(grib_accessors_list* al, int* err) if (!al || !al->accessor) return 0; - acode = grib_accessor_get_attribute(al->accessor, "code"); + acode = al->accessor->get_attribute("code"); if (acode) - *err = grib_unpack_long(acode, code, &l); - else + *err = acode->unpack_long(code, &l); else return 1; switch (code[0]) { @@ -2283,18 +2057,16 @@ static int bitmap_ref_skip(grib_accessors_list* al, int* err) } /* Return 1 if the descriptor is an operator marking the start of a bitmap */ -static int is_bitmap_start_descriptor(grib_accessors_list* al, int* err) -{ +int is_bitmap_start_descriptor(grib_accessors_list* al, int* err){ grib_accessor* acode = NULL; long code[1]; size_t l = 1; if (!al || !al->accessor) return 0; - acode = grib_accessor_get_attribute(al->accessor, "code"); + acode = al->accessor->get_attribute("code"); if (acode) - *err = grib_unpack_long(acode, code, &l); - else + *err = acode->unpack_long(code, &l); else return 1; switch (code[0]) { @@ -2309,18 +2081,16 @@ static int is_bitmap_start_descriptor(grib_accessors_list* al, int* err) { //long index[1]; //grib_accessor* anindex=grib_accessor_get_attribute(al->accessor,"index"); - //grib_unpack_long(anindex,index,&l); - return 1; + //anindex->unpack_long(index,&l); return 1; } } return 0; } -static void print_bitmap_debug_info(grib_context* c, bitmap_s* bitmap, grib_accessors_list* bitmapStart, int bitmapSize) -{ +void print_bitmap_debug_info(grib_context* c, bitmap_s* bitmap, grib_accessors_list* bitmapStart, int bitmapSize){ int i = 0, ret = 0; fprintf(stderr, "ECCODES DEBUG: bitmap_init: bitmapSize=%d\n", bitmapSize); - bitmap->cursor = bitmapStart->next; + bitmap->cursor = bitmapStart->next_; bitmap->referredElement = bitmapStart; while (bitmap_ref_skip(bitmap->referredElement, &ret)) { @@ -2328,7 +2098,7 @@ static void print_bitmap_debug_info(grib_context* c, bitmap_s* bitmap, grib_acce if (is_bitmap_start_descriptor(bitmap->referredElement, &ret)) { is_bmp = 1; } - bitmap->referredElement = bitmap->referredElement->prev; + bitmap->referredElement = bitmap->referredElement->prev_; if (is_bmp) { break; } @@ -2337,7 +2107,7 @@ static void print_bitmap_debug_info(grib_context* c, bitmap_s* bitmap, grib_acce for (i = 1; i < bitmapSize; i++) { if (bitmap->referredElement) { fprintf(stderr, "ECCODES DEBUG:\t bitmap_init: i=%d |%s|\n", i, bitmap->referredElement->accessor->name); - bitmap->referredElement = bitmap->referredElement->prev; + bitmap->referredElement = bitmap->referredElement->prev_; } } } @@ -2346,13 +2116,13 @@ static int bitmap_init(grib_context* c, bitmap_s* bitmap, grib_accessors_list* bitmapStart, int bitmapSize, grib_accessors_list* lastAccessorInList) { int ret = 0, i; - bitmap->cursor = bitmapStart->next; + bitmap->cursor = bitmapStart->next_; if (bitmap->referredElementStart != NULL) { bitmap->referredElement = bitmap->referredElementStart; return ret; } bitmap->referredElement = bitmapStart; - /*while (bitmap_ref_skip(bitmap->referredElement,&ret)) bitmap->referredElement=bitmap->referredElement->prev;*/ + /*while (bitmap_ref_skip(bitmap->referredElement,&ret)) bitmap->referredElement=bitmap->referredElement->prev_;*/ /* See ECC-869 * We have to INCLUDE the replication factors that come after the bitmap operators */ @@ -2361,7 +2131,7 @@ static int bitmap_init(grib_context* c, bitmap_s* bitmap, if (is_bitmap_start_descriptor(bitmap->referredElement, &ret)) { is_bmp = 1; } - bitmap->referredElement = bitmap->referredElement->prev; + bitmap->referredElement = bitmap->referredElement->prev_; if (is_bmp) { break; } @@ -2375,7 +2145,7 @@ static int bitmap_init(grib_context* c, bitmap_s* bitmap, return GRIB_INTERNAL_ERROR; } /*printf(" bitmap_init: i=%d |%s|\n", i,bitmap->referredElement->accessor->name);*/ - bitmap->referredElement = bitmap->referredElement->prev; + bitmap->referredElement = bitmap->referredElement->prev_; } bitmap->referredElementStart = bitmap->referredElement; return ret; @@ -2383,13 +2153,13 @@ static int bitmap_init(grib_context* c, bitmap_s* bitmap, static grib_accessor* accessor_or_attribute_with_same_name(grib_accessor* a, const char* name) { - if (grib_accessor_has_attributes(a) == 0) { + if (a->has_attributes() == 0) { return a; } else { grib_accessor* ok = a; grib_accessor* next; - while ((next = grib_accessor_get_attribute(ok, name)) != NULL) { + while ((next = ok->get_attribute(name)) != NULL) { ok = next; } return ok; @@ -2408,14 +2178,12 @@ static grib_accessor* accessor_or_attribute_with_same_name(grib_accessor* a, con // return *r; // } -static int grib_data_accessors_trie_push(grib_trie_with_rank* accessorsTrie, grib_accessor* a) -{ +int grib_data_accessors_trie_push(grib_trie_with_rank* accessorsTrie, grib_accessor* a){ return grib_trie_with_rank_insert(accessorsTrie, a->name, a); } -static int create_keys(const grib_accessor* a, long onlySubset, long startSubset, long endSubset) -{ - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; +int create_keys(const grib_accessor* a, long onlySubset, long startSubset, long endSubset){ + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; int err = 0; int rank; grib_accessor* elementAccessor = 0; @@ -2509,7 +2277,7 @@ static int create_keys(const grib_accessor* a, long onlySubset, long startSubset /*if (associatedFieldAccessor) grib_accessor_delete(c, associatedFieldAccessor);*/ associatedFieldAccessor = NULL; if (associatedFieldSignificanceAccessor) { - grib_accessor_delete(c, associatedFieldSignificanceAccessor); + associatedFieldSignificanceAccessor->destroy(c); associatedFieldSignificanceAccessor = NULL; } for (ide = 0; ide < elementsInSubset; ide++) { @@ -2577,7 +2345,7 @@ static int create_keys(const grib_accessor* a, long onlySubset, long startSubset //return err; bitmapIndex--; } - bitmapStart[bitmapIndex] = grib_accessors_list_last(self->dataAccessors); + bitmapStart[bitmapIndex] = self->dataAccessors->last(); bitmapSize[bitmapIndex] = 1; if (self->expanded->v[idx - 1]->code == 31002 || self->expanded->v[idx - 1]->code == 31001) extraElement += 1; @@ -2659,11 +2427,10 @@ static int create_keys(const grib_accessor* a, long onlySubset, long startSubset creatorsn.name = (char*)"subsetNumber"; asn = grib_accessor_factory(section, &creatorsn, 0, NULL); accessor_variable_set_type(asn, GRIB_TYPE_LONG); - grib_pack_long(asn, &subsetNumber, &len); - + asn->pack_long(&subsetNumber, &len); grib_push_accessor(asn, section->block); rank = grib_data_accessors_trie_push(self->dataAccessorsTrie, asn); - grib_accessors_list_push(self->dataAccessors, asn, rank); + self->dataAccessors->push(asn, rank); } count++; elementAccessor = create_accessor_from_descriptor(a, associatedFieldAccessor, section, ide, iss, @@ -2681,16 +2448,17 @@ static int create_keys(const grib_accessor* a, long onlySubset, long startSubset if (elementFromBitmap && self->unpackMode == CODES_BUFR_UNPACK_STRUCTURE) { if (descriptor->code != 33007 && descriptor->code != 223255) { char* aname = grib_context_strdup(c, elementFromBitmap->name); - grib_accessor* newAccessor = grib_accessor_clone(elementAccessor, section, &err); + grib_accessor* newAccessor = elementAccessor->clone(section, &err); newAccessor->parent = groupSection; newAccessor->name = aname; grib_sarray_push(a->context, self->tempStrings, aname); grib_push_accessor(newAccessor, groupSection->block); rank = grib_data_accessors_trie_push(self->dataAccessorsTrie, newAccessor); - grib_accessors_list_push(self->dataAccessors, newAccessor, rank); + self->dataAccessors->push(newAccessor, rank); } - err = grib_accessor_add_attribute(accessor_or_attribute_with_same_name(elementFromBitmap, elementAccessor->name), elementAccessor, 1); + //err = grib_accessor_add_attribute(accessor_or_attribute_with_same_name(elementFromBitmap, elementAccessor->name), elementAccessor, 1); + err = accessor_or_attribute_with_same_name(elementFromBitmap, elementAccessor->name)->add_attribute( elementAccessor, 1); } else if (elementAccessor) { int add_key = 1; @@ -2700,17 +2468,17 @@ static int create_keys(const grib_accessor* a, long onlySubset, long startSubset associatedFieldAccessor = elementAccessor; grib_convert_to_attribute(associatedFieldAccessor); if (associatedFieldSignificanceAccessor) { - grib_accessor* newAccessor = grib_accessor_clone(associatedFieldSignificanceAccessor, section, &err); + grib_accessor* newAccessor = associatedFieldSignificanceAccessor->clone(section, &err); if (err) { grib_context_log(a->context, GRIB_LOG_ERROR,"Unable to clone accessor '%s'\n", associatedFieldSignificanceAccessor->name); return err; } - grib_accessor_add_attribute(associatedFieldAccessor, newAccessor, 1); + associatedFieldAccessor->add_attribute(newAccessor, 1); } break; case 31021: if (associatedFieldSignificanceAccessor) - grib_accessor_delete(c, associatedFieldSignificanceAccessor); + associatedFieldSignificanceAccessor->destroy(c); associatedFieldSignificanceAccessor = elementAccessor; break; /*case 33007:*/ @@ -2728,8 +2496,8 @@ static int create_keys(const grib_accessor* a, long onlySubset, long startSubset if (add_key) { grib_push_accessor(elementAccessor, section->block); rank = grib_data_accessors_trie_push(self->dataAccessorsTrie, elementAccessor); - grib_accessors_list_push(self->dataAccessors, elementAccessor, rank); - lastAccessorInList = grib_accessors_list_last(self->dataAccessors); + self->dataAccessors->push(elementAccessor, rank); + lastAccessorInList = self->dataAccessors->last(); } } } @@ -2739,8 +2507,7 @@ static int create_keys(const grib_accessor* a, long onlySubset, long startSubset return err; } -static void set_input_replications(grib_handle* h, grib_accessor_bufr_data_array* self) -{ +void set_input_replications(grib_handle* h, grib_accessor_bufr_data_array_t* self){ size_t nInputReplications; size_t nInputExtendedReplications; size_t nInputShortReplications; @@ -2785,8 +2552,7 @@ static void set_input_replications(grib_handle* h, grib_accessor_bufr_data_array } } -static void set_input_bitmap(grib_handle* h, grib_accessor_bufr_data_array* self) -{ +void set_input_bitmap(grib_handle* h, grib_accessor_bufr_data_array_t* self){ size_t nInputBitmap; self->nInputBitmap = -1; self->iInputBitmap = 0; @@ -2803,8 +2569,7 @@ static void set_input_bitmap(grib_handle* h, grib_accessor_bufr_data_array* self } } -static int set_to_missing_if_out_of_range(grib_handle* h) -{ +int set_to_missing_if_out_of_range(grib_handle* h){ /* First check if the transient key is set */ long setToMissingIfOutOfRange = 0; if (grib_get_long(h, "setToMissingIfOutOfRange", &setToMissingIfOutOfRange) == GRIB_SUCCESS && @@ -2815,8 +2580,7 @@ static int set_to_missing_if_out_of_range(grib_handle* h) return h->context->bufr_set_to_missing_if_out_of_range; } -static int process_elements(grib_accessor* a, int flag, long onlySubset, long startSubset, long endSubset) -{ +int process_elements(grib_accessor* a, int flag, long onlySubset, long startSubset, long endSubset){ int err = 0; long inr, innr, ir, ip; long n[MAX_NESTED_REPLICATIONS] = {0,}; @@ -2846,7 +2610,7 @@ static int process_elements(grib_accessor* a, int flag, long onlySubset, long st grib_darray* dval = NULL; grib_sarray* sval = NULL; - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; grib_handle* h = grib_handle_of_accessor(a); grib_context* c = h->context; @@ -3373,19 +3137,17 @@ static int process_elements(grib_accessor* a, int flag, long onlySubset, long st return err; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - // grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; +void grib_accessor_class_bufr_data_array_t::dump(grib_accessor* a, grib_dumper* dumper){ + // grib_accessor_bufr_data_array_t *self =(grib_accessor_bufr_data_array_t*)a; // int err=process_elements(a,PROCESS_DECODE); // grib_dump_section(dumper,a,self->dataKeys->block); return; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_bufr_data_array_t::value_count(grib_accessor* a, long* count){ int err = 0, l; long i; - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; err = process_elements(a, PROCESS_DECODE, 0, 0, 0); if (err) @@ -3405,13 +3167,12 @@ static int value_count(grib_accessor* a, long* count) return err; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_bufr_data_array_t::unpack_double(grib_accessor* a, double* val, size_t* len){ int err = 0, i, k, ii; int proc_flag = PROCESS_DECODE; size_t l = 0, elementsInSubset; long numberOfSubsets = 0; - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; if (self->unpackMode == CODES_BUFR_NEW_DATA) proc_flag = PROCESS_NEW_DATA; @@ -3459,9 +3220,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } -static void destroy(grib_context* c, grib_accessor* a) -{ - grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; +void grib_accessor_class_bufr_data_array_t::destroy(grib_context* c, grib_accessor* a){ + grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; self_clear(c, self); if (self->dataAccessors) grib_accessors_list_delete(c, self->dataAccessors); diff --git a/src/accessor/grib_accessor_class_bufr_data_array.h b/src/accessor/grib_accessor_class_bufr_data_array.h new file mode 100644 index 000000000..386d4ce9c --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_data_array.h @@ -0,0 +1,93 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_data_array_h +#define eccodes_accessor_bufr_data_array_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_data_array_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_data_array */ + const char* bufrDataEncodedName; + const char* numberOfSubsetsName; + const char* expandedDescriptorsName; + const char* flagsName; + const char* unitsName; + const char* elementsDescriptorsIndexName; + const char* compressedDataName; + bufr_descriptors_array* expanded; + grib_accessor* expandedAccessor; + int* canBeMissing; + long numberOfSubsets; + long compressedData; + grib_vdarray* numericValues; + grib_vsarray* stringValues; + grib_viarray* elementsDescriptorsIndex; + int do_decode; + int bitmapStartElementsDescriptorsIndex; + int bitmapCurrentElementsDescriptorsIndex; + int bitmapSize; + int bitmapStart; + int bitmapCurrent; + grib_accessors_list* dataAccessors; + int unpackMode; + int bitsToEndData; + grib_section* dataKeys; + double* inputBitmap; + int nInputBitmap; + int iInputBitmap; + long* inputReplications; + int nInputReplications; + int iInputReplications; + long* inputExtendedReplications; + int nInputExtendedReplications; + int iInputExtendedReplications; + long* inputShortReplications; + int nInputShortReplications; + int iInputShortReplications; + grib_iarray* iss_list; + grib_trie_with_rank* dataAccessorsTrie; + grib_sarray* tempStrings; + grib_vdarray* tempDoubleValues; + int change_ref_value_operand; + size_t refValListSize; + long* refValList; + long refValIndex; + bufr_tableb_override* tableb_override; + int set_to_missing_if_out_of_range; +}; + +class grib_accessor_class_bufr_data_array_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_data_array_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_data_array_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; + +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); +#endif /* eccodes_accessor_bufr_data_array_h */ diff --git a/src/accessor/todo/grib_accessor_class_bufr_data_element.cc b/src/accessor/grib_accessor_class_bufr_data_element.cc similarity index 68% rename from src/accessor/todo/grib_accessor_class_bufr_data_element.cc rename to src/accessor/grib_accessor_class_bufr_data_element.cc index 3301eb10f..295c0b13e 100644 --- a/src/accessor/todo/grib_accessor_class_bufr_data_element.cc +++ b/src/accessor/grib_accessor_class_bufr_data_element.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,144 +9,19 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - #include "grib_api_internal.h" +#include "grib_accessor_class_bufr_data_element.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;dump - IMPLEMENTS = unpack_string;unpack_string_array;unpack_long; unpack_double - IMPLEMENTS = unpack_double_element ; is_missing - IMPLEMENTS = pack_long; pack_double ; pack_string_array; pack_string; pack_missing - IMPLEMENTS = value_count; get_native_type; make_clone; destroy - MEMBERS = long index - MEMBERS = int type - MEMBERS = long compressedData - MEMBERS = long subsetNumber - MEMBERS = long numberOfSubsets - MEMBERS = bufr_descriptors_array* descriptors - MEMBERS = grib_vdarray* numericValues - MEMBERS = grib_vsarray* stringValues - MEMBERS = grib_viarray* elementsDescriptorsIndex - MEMBERS = char* cname - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_missing(grib_accessor*); -static int is_missing(grib_accessor*); -static int pack_double(grib_accessor*, const double* 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 unpack_double(grib_accessor*, double* 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 int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static int unpack_double_element(grib_accessor*, size_t i, double* val); -static grib_accessor* make_clone(grib_accessor*, grib_section*, int*); - -typedef struct grib_accessor_bufr_data_element -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bufr_data_element */ - long index; - int type; - long compressedData; - long subsetNumber; - long numberOfSubsets; - bufr_descriptors_array* descriptors; - grib_vdarray* numericValues; - grib_vsarray* stringValues; - grib_viarray* elementsDescriptorsIndex; - char* cname; -} grib_accessor_bufr_data_element; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_bufr_data_element = { - &grib_accessor_class_gen, /* super */ - "bufr_data_element", /* name */ - sizeof(grib_accessor_bufr_data_element), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - &pack_missing, /* pack_missing */ - &is_missing, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - &pack_string_array, /* pack_string_array */ - &unpack_string_array, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - &make_clone, /* clone accessor */ -}; - - +grib_accessor_class_bufr_data_element_t _grib_accessor_class_bufr_data_element{"bufr_data_element"}; grib_accessor_class* grib_accessor_class_bufr_data_element = &_grib_accessor_class_bufr_data_element; -/* END_CLASS_IMP */ static grib_accessor* make_clone(grib_accessor* a, grib_section* s, int* err) { grib_accessor* the_clone = NULL; grib_accessor* attribute = NULL; - grib_accessor_bufr_data_element* elementAccessor; - grib_accessor_bufr_data_element* self; + grib_accessor_bufr_data_element_t* elementAccessor; + grib_accessor_bufr_data_element_t* self; char* copied_name = NULL; int i; grib_action creator = {0,}; @@ -161,8 +37,8 @@ static grib_accessor* make_clone(grib_accessor* a, grib_section* s, int* err) the_clone = grib_accessor_factory(s, &creator, 0, NULL); copied_name = grib_context_strdup(a->context, a->name); the_clone->name = copied_name; - elementAccessor = (grib_accessor_bufr_data_element*)the_clone; - self = (grib_accessor_bufr_data_element*)a; + elementAccessor = (grib_accessor_bufr_data_element_t*)the_clone; + self = (grib_accessor_bufr_data_element_t*)a; the_clone->flags = a->flags; the_clone->parent = NULL; the_clone->h = s->h; @@ -179,9 +55,9 @@ static grib_accessor* make_clone(grib_accessor* a, grib_section* s, int* err) i = 0; while (a->attributes[i]) { - attribute = grib_accessor_clone(a->attributes[i], s, err); + attribute = a->attributes[i]->clone(s, err); /* attribute->parent=a->parent; */ - grib_accessor_add_attribute(the_clone, attribute, 0); + the_clone->add_attribute(attribute, 0); i++; } @@ -190,69 +66,67 @@ static grib_accessor* make_clone(grib_accessor* a, grib_section* s, int* err) void accessor_bufr_data_element_set_index(grib_accessor* a, long index) { - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; self->index = index; } void accessor_bufr_data_element_set_type(grib_accessor* a, int type) { - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; self->type = type; } void accessor_bufr_data_element_set_numberOfSubsets(grib_accessor* a, long numberOfSubsets) { - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; self->numberOfSubsets = numberOfSubsets; } void accessor_bufr_data_element_set_subsetNumber(grib_accessor* a, long subsetNumber) { - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; self->subsetNumber = subsetNumber; } void accessor_bufr_data_element_set_compressedData(grib_accessor* a, int compressedData) { - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; self->compressedData = compressedData; } void accessor_bufr_data_element_set_descriptors(grib_accessor* a, bufr_descriptors_array* descriptors) { - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; self->descriptors = descriptors; } void accessor_bufr_data_element_set_numericValues(grib_accessor* a, grib_vdarray* numericValues) { - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; self->numericValues = numericValues; } void accessor_bufr_data_element_set_stringValues(grib_accessor* a, grib_vsarray* stringValues) { - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; self->stringValues = stringValues; } void accessor_bufr_data_element_set_elementsDescriptorsIndex(grib_accessor* a, grib_viarray* elementsDescriptorsIndex) { - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; self->elementsDescriptorsIndex = elementsDescriptorsIndex; } -static void init(grib_accessor* a, const long len, grib_arguments* params) -{ - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; +void grib_accessor_class_bufr_data_element_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_BUFR_DATA; /* a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; */ self->cname = NULL; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_bufr_data_element_t::dump(grib_accessor* a, grib_dumper* dumper){ int type = get_native_type(a); switch (type) { @@ -268,9 +142,8 @@ static void dump(grib_accessor* a, grib_dumper* dumper) } } -static int unpack_string_array(grib_accessor* a, char** val, size_t* len) -{ - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; +int grib_accessor_class_bufr_data_element_t::unpack_string_array(grib_accessor* a, char** val, size_t* len){ + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = 0, idx = 0; size_t count = 0, i = 0; @@ -297,9 +170,8 @@ static int unpack_string_array(grib_accessor* a, char** val, size_t* len) return ret; } -static int pack_string_array(grib_accessor* a, const char** v, size_t* len) -{ - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; +int grib_accessor_class_bufr_data_element_t::pack_string_array(grib_accessor* a, const char** v, size_t* len){ + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = GRIB_SUCCESS, idx = 0; size_t i = 0; @@ -340,9 +212,8 @@ static int pack_string_array(grib_accessor* a, const char** v, size_t* len) return ret; } -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; +int grib_accessor_class_bufr_data_element_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; char* str = NULL; char* p = 0; size_t slen = 0; @@ -409,9 +280,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; +int grib_accessor_class_bufr_data_element_t::pack_string(grib_accessor* a, const char* val, size_t* len){ + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = GRIB_SUCCESS, idx = 0; char* s = NULL; @@ -432,9 +302,8 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return ret; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; +int grib_accessor_class_bufr_data_element_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = GRIB_SUCCESS; long count = 0, i = 0; @@ -461,9 +330,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; +int grib_accessor_class_bufr_data_element_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = GRIB_SUCCESS; long count = 0, i = 0; @@ -490,9 +358,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; +int grib_accessor_class_bufr_data_element_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = GRIB_SUCCESS; size_t count = 1, i = 0; grib_context* c = a->context; @@ -520,9 +387,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; +int grib_accessor_class_bufr_data_element_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = 0; size_t count = 1, i = 0; grib_context* c = a->context; @@ -550,11 +416,10 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return ret; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_bufr_data_element_t::value_count(grib_accessor* a, long* count){ int ret = 0, type = 0, idx = 0; size_t size = 0; - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; if (!self->compressedData) { *count = 1; @@ -577,10 +442,9 @@ static int value_count(grib_accessor* a, long* count) return ret; } -static int unpack_double_element(grib_accessor* a, size_t idx, double* val) -{ +int grib_accessor_class_bufr_data_element_t::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; + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = GRIB_SUCCESS; long count = 0; @@ -598,9 +462,8 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) return ret; } -static int get_native_type(grib_accessor* a) -{ - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; +int grib_accessor_class_bufr_data_element_t::get_native_type(grib_accessor* a){ + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = GRIB_TYPE_DOUBLE; DEBUG_ASSERT(self); switch (self->type) { @@ -624,16 +487,15 @@ static int get_native_type(grib_accessor* a) return ret; } -static void destroy(grib_context* ct, grib_accessor* a) -{ - grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; +void grib_accessor_class_bufr_data_element_t::destroy(grib_context* ct, grib_accessor* a){ + grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int i = 0; if (self->cname) grib_context_free(ct, self->cname); /* ECC-765 */ while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { /*grib_context_log(ct,GRIB_LOG_DEBUG,"deleting attribute %s->%s",a->name,a->attributes[i]->name);*/ /*printf("bufr_data_element destroy %s %p\n", a->attributes[i]->name, (void*)a->attributes[i]);*/ - grib_accessor_delete(ct, a->attributes[i]); + a->attributes[i]->destroy(ct); a->attributes[i] = NULL; i++; } @@ -641,8 +503,7 @@ static void destroy(grib_context* ct, grib_accessor* a) #define MAX_STRING_SIZE 4096 /* Return 1 if BUFR element(s) is/are missing, 0 otherwise. In case of decoding errors, also return 0 */ -static int is_missing(grib_accessor* a) -{ +int grib_accessor_class_bufr_data_element_t::is_missing(grib_accessor* a){ const int ktype = get_native_type(a); int err = 0, result = 1; /* default: assume all are missing */ long count = 0; @@ -657,11 +518,9 @@ static int is_missing(grib_accessor* a) size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(c, sizeof(long) * size); - err = grib_unpack_long(a, values, &size2); - } + err = a->unpack_long(values, &size2); } else { - err = grib_unpack_long(a, &value, &size2); - } + err = a->unpack_long(&value, &size2); } if (err) return 0; /* TODO: no way of propagating the error up */ Assert(size2 == size); if (size > 1) { @@ -684,11 +543,9 @@ static int is_missing(grib_accessor* a) size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size2); - } + err = a->unpack_double(values, &size2); } else { - err = grib_unpack_double(a, &value, &size2); - } + err = a->unpack_double(&value, &size2); } if (err) return 0; /* TODO: no way of propagating the error up */ Assert(size2 == size); if (size > 1) { @@ -710,8 +567,7 @@ static int is_missing(grib_accessor* a) size = count; if (size > 1) { values = (char**)grib_context_malloc_clear(a->context, size * sizeof(char*)); - err = grib_unpack_string_array(a, values, &size); - if (err) return 0; /* TODO: no way of propagating the error up */ + err = a->unpack_string_array(values, &size); if (err) return 0; /* TODO: no way of propagating the error up */ for (i = 0; i < size; i++) { if (!grib_is_missing_string(a, (unsigned char*)values[i], size)) { result = 0; @@ -723,8 +579,7 @@ static int is_missing(grib_accessor* a) } else { char value[MAX_STRING_SIZE] = {0,}; /* See ECC-710 */ size = MAX_STRING_SIZE; - err = grib_unpack_string(a, value, &size); - if (err) return 0; /* TODO: no way of propagating the error up */ + err = a->unpack_string(value, &size); if (err) return 0; /* TODO: no way of propagating the error up */ result = grib_is_missing_string(a, (unsigned char*)value, size); } } @@ -734,8 +589,7 @@ static int is_missing(grib_accessor* a) return result; } -static int pack_missing(grib_accessor* a) -{ +int grib_accessor_class_bufr_data_element_t::pack_missing(grib_accessor* a){ int ktype = GRIB_TYPE_UNDEFINED; int err = 0; size_t size = 1; diff --git a/src/accessor/grib_accessor_class_bufr_data_element.h b/src/accessor/grib_accessor_class_bufr_data_element.h new file mode 100644 index 000000000..d75afbe03 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_data_element.h @@ -0,0 +1,56 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_data_element_h +#define eccodes_accessor_bufr_data_element_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_data_element_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_data_element */ + long index; + int type; + long compressedData; + long subsetNumber; + long numberOfSubsets; + bufr_descriptors_array* descriptors; + grib_vdarray* numericValues; + grib_vsarray* stringValues; + grib_viarray* elementsDescriptorsIndex; + char* cname; +}; + +class grib_accessor_class_bufr_data_element_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_data_element_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_data_element_t{}; } + int get_native_type(grib_accessor*) override; + int pack_missing(grib_accessor*) override; + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int pack_string_array(grib_accessor*, const char**, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; +}; +#endif /* eccodes_accessor_bufr_data_element_h */ diff --git a/src/accessor/todo/grib_accessor_class_bufr_elements_table.cc b/src/accessor/grib_accessor_class_bufr_elements_table.cc similarity index 68% rename from src/accessor/todo/grib_accessor_class_bufr_elements_table.cc rename to src/accessor/grib_accessor_class_bufr_elements_table.cc index 4858ff63d..9b589c114 100644 --- a/src/accessor/todo/grib_accessor_class_bufr_elements_table.cc +++ b/src/accessor/grib_accessor_class_bufr_elements_table.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,12 +9,10 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - -#include "grib_scaling.h" #include "grib_api_internal.h" +#include "grib_accessor_class_bufr_elements_table.h" +#include "grib_scaling.h" + #if GRIB_PTHREADS static pthread_once_t once = PTHREAD_ONCE_INIT; @@ -31,7 +30,7 @@ static void thread_init() static int once = 0; static omp_nest_lock_t mutex1; -static void thread_init() +void thread_init() { GRIB_OMP_CRITICAL(lock_grib_accessor_class_bufr_elements_table_c) { @@ -43,107 +42,14 @@ static void thread_init() } #endif -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;unpack_string;unpack_long;unpack_double - IMPLEMENTS = value_count; get_native_type; - MEMBERS = const char* dictionary - MEMBERS = const char* masterDir - MEMBERS = const char* localDir - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_double(grib_accessor*, double* 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 value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_bufr_elements_table -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bufr_elements_table */ - const char* dictionary; - const char* masterDir; - const char* localDir; -} grib_accessor_bufr_elements_table; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_bufr_elements_table = { - &grib_accessor_class_gen, /* super */ - "bufr_elements_table", /* name */ - sizeof(grib_accessor_bufr_elements_table), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +grib_accessor_class_bufr_elements_table_t _grib_accessor_class_bufr_elements_table{"bufr_elements_table"}; grib_accessor_class* grib_accessor_class_bufr_elements_table = &_grib_accessor_class_bufr_elements_table; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* params) -{ +void grib_accessor_class_bufr_elements_table_t::init(grib_accessor* a, const long len, grib_arguments* params){ int n = 0; - grib_accessor_bufr_elements_table* self = (grib_accessor_bufr_elements_table*)a; + grib_accessor_bufr_elements_table_t* self = (grib_accessor_bufr_elements_table_t*)a; self->dictionary = grib_arguments_get_string(grib_handle_of_accessor(a), params, n++); self->masterDir = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); @@ -155,7 +61,7 @@ static void init(grib_accessor* a, const long len, grib_arguments* params) static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) { - grib_accessor_bufr_elements_table* self = (grib_accessor_bufr_elements_table*)a; + grib_accessor_bufr_elements_table_t* self = (grib_accessor_bufr_elements_table_t*)a; char* filename = NULL; char line[1024] = {0,}; @@ -273,8 +179,7 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) return dictionary; } -static int convert_type(const char* stype) -{ +int convert_type(const char* stype){ int ret = BUFR_DESCRIPTOR_TYPE_UNKNOWN; switch (stype[0]) { case 's': @@ -304,14 +209,13 @@ static int convert_type(const char* stype) return ret; } -static long atol_fast(const char* input) -{ +long atol_fast(const char* input){ if (strcmp(input, "0") == 0) return 0; return atol(input); } -static int bufr_get_from_table(grib_accessor* a, bufr_descriptor* v) -{ + +int bufr_get_from_table(grib_accessor* a, bufr_descriptor* v){ int ret = 0; char** list = 0; char code[7] = { 0 }; @@ -407,28 +311,23 @@ bufr_descriptor* accessor_bufr_elements_table_get_descriptor(grib_accessor* a, i return v; } -static int unpack_string(grib_accessor* a, char* buffer, size_t* len) -{ +int grib_accessor_class_bufr_elements_table_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ return GRIB_NOT_IMPLEMENTED; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_bufr_elements_table_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_bufr_elements_table_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_STRING; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ +int grib_accessor_class_bufr_elements_table_t::unpack_long(grib_accessor* a, long* val, size_t* len){ return GRIB_NOT_IMPLEMENTED; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_bufr_elements_table_t::unpack_double(grib_accessor* a, double* val, size_t* len){ return GRIB_NOT_IMPLEMENTED; } diff --git a/src/accessor/grib_accessor_class_bufr_elements_table.h b/src/accessor/grib_accessor_class_bufr_elements_table.h new file mode 100644 index 000000000..8ddd8a824 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_elements_table.h @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_elements_table_h +#define eccodes_accessor_bufr_elements_table_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_elements_table_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_elements_table */ + const char* dictionary; + const char* masterDir; + const char* localDir; +}; + +class grib_accessor_class_bufr_elements_table_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_elements_table_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_elements_table_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_elements_table_h */ diff --git a/src/accessor/todo/grib_accessor_class_bufr_extract_area_subsets.cc b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc similarity index 57% rename from src/accessor/todo/grib_accessor_class_bufr_extract_area_subsets.cc rename to src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc index 473a5148d..85eb98d0d 100644 --- a/src/accessor/todo/grib_accessor_class_bufr_extract_area_subsets.cc +++ b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,117 +10,14 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init; get_native_type - IMPLEMENTS = pack_long; - MEMBERS = const char* doExtractSubsets - MEMBERS = const char* numberOfSubsets - MEMBERS = const char* extractSubsetList - MEMBERS = const char* extractAreaWestLongitude - MEMBERS = const char* extractAreaEastLongitude - MEMBERS = const char* extractAreaNorthLatitude - MEMBERS = const char* extractAreaSouthLatitude - MEMBERS = const char* extractAreaLongitudeRank - MEMBERS = const char* extractAreaLatitudeRank - MEMBERS = const char* extractedAreaNumberOfSubsets - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_bufr_extract_area_subsets -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bufr_extract_area_subsets */ - const char* doExtractSubsets; - const char* numberOfSubsets; - const char* extractSubsetList; - const char* extractAreaWestLongitude; - const char* extractAreaEastLongitude; - const char* extractAreaNorthLatitude; - const char* extractAreaSouthLatitude; - const char* extractAreaLongitudeRank; - const char* extractAreaLatitudeRank; - const char* extractedAreaNumberOfSubsets; -} grib_accessor_bufr_extract_area_subsets; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_bufr_extract_area_subsets = { - &grib_accessor_class_gen, /* super */ - "bufr_extract_area_subsets", /* name */ - sizeof(grib_accessor_bufr_extract_area_subsets), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_bufr_extract_area_subsets.h" +grib_accessor_class_bufr_extract_area_subsets_t _grib_accessor_class_bufr_extract_area_subsets{"bufr_extract_area_subsets"}; grib_accessor_class* grib_accessor_class_bufr_extract_area_subsets = &_grib_accessor_class_bufr_extract_area_subsets; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_bufr_extract_area_subsets* self = (grib_accessor_bufr_extract_area_subsets*)a; +void grib_accessor_class_bufr_extract_area_subsets_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_bufr_extract_area_subsets_t* self = (grib_accessor_bufr_extract_area_subsets_t*)a; grib_handle* h = grib_handle_of_accessor(a); int n = 0; @@ -138,22 +36,19 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg) a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_bufr_extract_area_subsets_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_LONG; } /* Copy first element of array into all others */ -static void fill_in(double a[], long length) -{ +void fill_in(double a[], long length){ long i; for (i = 1; i < length; ++i) a[i] = a[0]; } -static int select_area(grib_accessor* a) -{ - grib_accessor_bufr_extract_area_subsets* self = (grib_accessor_bufr_extract_area_subsets*)a; +int select_area(grib_accessor* a){ + grib_accessor_bufr_extract_area_subsets_t* self = (grib_accessor_bufr_extract_area_subsets_t*)a; int ret = 0; long compressed = 0; @@ -281,9 +176,8 @@ static int select_area(grib_accessor* a) return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - /*grib_accessor_bufr_extract_area_subsets *self =(grib_accessor_bufr_extract_area_subsets*)a;*/ +int grib_accessor_class_bufr_extract_area_subsets_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + /*grib_accessor_bufr_extract_area_subsets_t *self =(grib_accessor_bufr_extract_area_subsets_t*)a;*/ if (*len == 0) return GRIB_SUCCESS; diff --git a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h new file mode 100644 index 000000000..d079f958e --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_extract_area_subsets_h +#define eccodes_accessor_bufr_extract_area_subsets_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_extract_area_subsets_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_extract_area_subsets */ + const char* doExtractSubsets; + const char* numberOfSubsets; + const char* extractSubsetList; + const char* extractAreaWestLongitude; + const char* extractAreaEastLongitude; + const char* extractAreaNorthLatitude; + const char* extractAreaSouthLatitude; + const char* extractAreaLongitudeRank; + const char* extractAreaLatitudeRank; + const char* extractedAreaNumberOfSubsets; +}; + +class grib_accessor_class_bufr_extract_area_subsets_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_extract_area_subsets_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_extract_area_subsets_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_extract_area_subsets_h */ diff --git a/src/accessor/todo/grib_accessor_class_bufr_extract_datetime_subsets.cc b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc similarity index 76% rename from src/accessor/todo/grib_accessor_class_bufr_extract_datetime_subsets.cc rename to src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc index d5ec98bf6..0568f02dc 100644 --- a/src/accessor/todo/grib_accessor_class_bufr_extract_datetime_subsets.cc +++ b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,104 +10,15 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init; get_native_type - IMPLEMENTS = pack_long; - MEMBERS = const char* doExtractSubsets - MEMBERS = const char* numberOfSubsets - MEMBERS = const char* extractSubsetList - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_bufr_extract_datetime_subsets -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bufr_extract_datetime_subsets */ - const char* doExtractSubsets; - const char* numberOfSubsets; - const char* extractSubsetList; -} grib_accessor_bufr_extract_datetime_subsets; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_bufr_extract_datetime_subsets = { - &grib_accessor_class_gen, /* super */ - "bufr_extract_datetime_subsets", /* name */ - sizeof(grib_accessor_bufr_extract_datetime_subsets), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_bufr_extract_datetime_subsets.h" +grib_accessor_class_bufr_extract_datetime_subsets_t _grib_accessor_class_bufr_extract_datetime_subsets{"bufr_extract_datetime_subsets"}; grib_accessor_class* grib_accessor_class_bufr_extract_datetime_subsets = &_grib_accessor_class_bufr_extract_datetime_subsets; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ +void grib_accessor_class_bufr_extract_datetime_subsets_t::init(grib_accessor* a, const long len, grib_arguments* arg){ int n = 0; - grib_accessor_bufr_extract_datetime_subsets* self = (grib_accessor_bufr_extract_datetime_subsets*)a; + grib_accessor_bufr_extract_datetime_subsets_t* self = (grib_accessor_bufr_extract_datetime_subsets_t*)a; a->length = 0; self->doExtractSubsets = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); @@ -116,14 +28,12 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg) a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_bufr_extract_datetime_subsets_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_LONG; } /* Convert input date to Julian number. If date is invalid, return -1 */ -static double date_to_julian(long year, long month, long day, long hour, long minute, double second) -{ +double date_to_julian(long year, long month, long day, long hour, long minute, double second){ double result = 0; /* Julian number in units of days */ /* For validating the date/time, we specify seconds as an integer */ @@ -194,11 +104,10 @@ static int build_long_array(grib_context* c, grib_handle* h, int compressed, return err; } -static int select_datetime(grib_accessor* a) -{ +int select_datetime(grib_accessor* a){ int ret = 0; long compressed = 0; - grib_accessor_bufr_extract_datetime_subsets* self = (grib_accessor_bufr_extract_datetime_subsets*)a; + grib_accessor_bufr_extract_datetime_subsets_t* self = (grib_accessor_bufr_extract_datetime_subsets_t*)a; grib_handle* h = grib_handle_of_accessor(a); grib_context* c = h->context; size_t n; @@ -423,9 +332,8 @@ static int select_datetime(grib_accessor* a) return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - /*grib_accessor_bufr_extract_datetime_subsets *self =(grib_accessor_bufr_extract_datetime_subsets*)a;*/ +int grib_accessor_class_bufr_extract_datetime_subsets_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + /*grib_accessor_bufr_extract_datetime_subsets_t *self =(grib_accessor_bufr_extract_datetime_subsets_t*)a;*/ if (*len == 0) return GRIB_SUCCESS; diff --git a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h new file mode 100644 index 000000000..7acfd35b3 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_extract_datetime_subsets_h +#define eccodes_accessor_bufr_extract_datetime_subsets_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_extract_datetime_subsets_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_extract_datetime_subsets */ + const char* doExtractSubsets; + const char* numberOfSubsets; + const char* extractSubsetList; +}; + +class grib_accessor_class_bufr_extract_datetime_subsets_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_extract_datetime_subsets_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_extract_datetime_subsets_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_extract_datetime_subsets_h */ diff --git a/src/accessor/grib_accessor_class_bufr_extract_subsets.cc b/src/accessor/grib_accessor_class_bufr_extract_subsets.cc new file mode 100644 index 000000000..6fbea28a2 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_extract_subsets.cc @@ -0,0 +1,58 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_bufr_extract_subsets.h" + +grib_accessor_class_bufr_extract_subsets_t _grib_accessor_class_bufr_extract_subsets{"bufr_extract_subsets"}; +grib_accessor_class* grib_accessor_class_bufr_extract_subsets = &_grib_accessor_class_bufr_extract_subsets; + + +void get_accessors(grib_accessor* a){ + grib_accessor_bufr_extract_subsets_t* self = (grib_accessor_bufr_extract_subsets_t*)a; + const grib_handle* h = grib_handle_of_accessor(a); + + if (self->packAccessor) + return; + self->numericValuesAccessor = grib_find_accessor(h, self->numericValues); + self->packAccessor = grib_find_accessor(h, self->pack); +} + +void grib_accessor_class_bufr_extract_subsets_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + int n = 0; + grib_accessor_bufr_extract_subsets_t* self = (grib_accessor_bufr_extract_subsets_t*)a; + + a->length = 0; + self->numericValues = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->pack = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; +} + +int grib_accessor_class_bufr_extract_subsets_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} + +int grib_accessor_class_bufr_extract_subsets_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_bufr_extract_subsets_t* self = (grib_accessor_bufr_extract_subsets_t*)a; + size_t l = 1; + long v[1]; + + get_accessors(a); + + v[0] = 1; + int err = self->packAccessor->pack_long(v, &l); if (err) { + if (err == GRIB_ENCODING_ERROR) + grib_context_log(a->context, GRIB_LOG_ERROR, "Could not extract subset(s).\n\tHint: Did you forget to set unpack=1?"); + return err; + } + + return err; +} diff --git a/src/accessor/grib_accessor_class_bufr_extract_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_subsets.h new file mode 100644 index 000000000..80392338d --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_extract_subsets.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_extract_subsets_h +#define eccodes_accessor_bufr_extract_subsets_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_extract_subsets_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_extract_subsets */ + const char* numericValues; + const char* pack; + grib_accessor* numericValuesAccessor; + grib_accessor* packAccessor; +}; + +class grib_accessor_class_bufr_extract_subsets_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_extract_subsets_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_extract_subsets_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_extract_subsets_h */ diff --git a/src/accessor/grib_accessor_class_bufr_group.cc b/src/accessor/grib_accessor_class_bufr_group.cc new file mode 100644 index 000000000..73075fcf1 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_group.cc @@ -0,0 +1,39 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_bufr_group.h" + +grib_accessor_class_bufr_group_t _grib_accessor_class_bufr_group{"bufr_group"}; +grib_accessor_class* grib_accessor_class_bufr_group = &_grib_accessor_class_bufr_group; + + +void grib_accessor_class_bufr_group_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_section(dumper, a, a->sub_section->block); +} + +static grib_accessor* next(grib_accessor* a, int explore) +{ + grib_accessor* next = NULL; + if (explore) { + next = a->sub_section->block->first; + if (!next) + next = a->next; + } + else { + next = a->next; + } + if (!next) { + if (a->parent->owner) + next = a->parent->owner->cclass->next(a->parent->owner, 0); + } + return next; +} diff --git a/src/accessor/grib_accessor_class_bufr_group.h b/src/accessor/grib_accessor_class_bufr_group.h new file mode 100644 index 000000000..84a202583 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_group.h @@ -0,0 +1,31 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_group_h +#define eccodes_accessor_bufr_group_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_variable.h" + +class grib_accessor_bufr_group_t : public grib_accessor_variable_t +{ +public: + /* Members defined in bufr_group */ +}; + +class grib_accessor_class_bufr_group_t : public grib_accessor_class_variable_t +{ +public: + grib_accessor_class_bufr_group_t(const char* name) : grib_accessor_class_variable_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_group_t{}; } + void dump(grib_accessor*, grib_dumper*) override; +}; +#endif /* eccodes_accessor_bufr_group_h */ diff --git a/src/accessor/grib_accessor_class_bufr_simple_thinning.cc b/src/accessor/grib_accessor_class_bufr_simple_thinning.cc new file mode 100644 index 000000000..1743104fd --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_simple_thinning.cc @@ -0,0 +1,114 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_bufr_simple_thinning.h" + +grib_accessor_class_bufr_simple_thinning_t _grib_accessor_class_bufr_simple_thinning{"bufr_simple_thinning"}; +grib_accessor_class* grib_accessor_class_bufr_simple_thinning = &_grib_accessor_class_bufr_simple_thinning; + + +void grib_accessor_class_bufr_simple_thinning_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_bufr_simple_thinning_t* self = (grib_accessor_bufr_simple_thinning_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + int n = 0; + + a->length = 0; + self->doExtractSubsets = grib_arguments_get_name(h, arg, n++); + self->numberOfSubsets = grib_arguments_get_name(h, arg, n++); + self->extractSubsetList = grib_arguments_get_name(h, arg, n++); + self->simpleThinningStart = grib_arguments_get_name(h, arg, n++); + self->simpleThinningMissingRadius = grib_arguments_get_name(h, arg, n++); + self->simpleThinningSkip = grib_arguments_get_name(h, arg, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; +} + +int grib_accessor_class_bufr_simple_thinning_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} + +int apply_thinning(grib_accessor* a){ + const grib_accessor_bufr_simple_thinning_t* self = (grib_accessor_bufr_simple_thinning_t*)a; + + long skip; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; + long compressed = 0, nsubsets; + grib_iarray* subsets; + long* subsets_ar = 0; + long start = 0, radius = 0; + + int ret = grib_get_long(h, "compressedData", &compressed); + if (ret) + return ret; + if (compressed) { + long numberOfSubsets = 0; + ret = grib_get_long(h, self->numberOfSubsets, &numberOfSubsets); + if (ret) + return ret; + + ret = grib_get_long(h, self->simpleThinningStart, &start); + if (ret) + return ret; + + ret = grib_get_long(h, self->simpleThinningSkip, &skip); + if (ret) + return ret; + if (skip <= 0) + return GRIB_INVALID_KEY_VALUE; + + ret = grib_get_long(h, self->simpleThinningMissingRadius, &radius); + if (ret) + return ret; + + subsets = grib_iarray_new(c, numberOfSubsets / skip + 1, 10); + for (long i = 0; i < numberOfSubsets; i += skip + 1) { + grib_iarray_push(subsets, i + 1); + } + + nsubsets = grib_iarray_used_size(subsets); + + if (nsubsets != 0) { + subsets_ar = grib_iarray_get_array(subsets); + ret = grib_set_long_array(h, self->extractSubsetList, subsets_ar, nsubsets); + grib_context_free(c, subsets_ar); + if (ret) + return ret; + + ret = grib_set_long(h, "unpack", 1); + if (ret) + return ret; + + ret = grib_set_long(h, self->doExtractSubsets, 1); + if (ret) + return ret; + } + grib_iarray_delete(subsets); + } + else { + return GRIB_NOT_IMPLEMENTED; + } + + return ret; +} + +int grib_accessor_class_bufr_simple_thinning_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + const grib_accessor_bufr_simple_thinning_t* self = (grib_accessor_bufr_simple_thinning_t*)a; + + if (*len == 0) + return GRIB_SUCCESS; + int err = apply_thinning(a); + if (err) + return err; + + return grib_set_long(a->parent->h, self->doExtractSubsets, 1); +} diff --git a/src/accessor/grib_accessor_class_bufr_simple_thinning.h b/src/accessor/grib_accessor_class_bufr_simple_thinning.h new file mode 100644 index 000000000..eb786f966 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_simple_thinning.h @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_simple_thinning_h +#define eccodes_accessor_bufr_simple_thinning_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_simple_thinning_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_simple_thinning */ + const char* doExtractSubsets; + const char* numberOfSubsets; + const char* extractSubsetList; + const char* simpleThinningStart; + const char* simpleThinningMissingRadius; + const char* simpleThinningSkip; +}; + +class grib_accessor_class_bufr_simple_thinning_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_simple_thinning_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_simple_thinning_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_simple_thinning_h */ diff --git a/src/accessor/grib_accessor_class_bufr_string_values.cc b/src/accessor/grib_accessor_class_bufr_string_values.cc new file mode 100644 index 000000000..2568021a4 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_string_values.cc @@ -0,0 +1,84 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_bufr_string_values.h" +#include "grib_accessor_class_bufr_data_array.h" + +grib_accessor_class_bufr_string_values_t _grib_accessor_class_bufr_string_values{"bufr_string_values"}; +grib_accessor_class* grib_accessor_class_bufr_string_values = &_grib_accessor_class_bufr_string_values; + + +void grib_accessor_class_bufr_string_values_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_bufr_string_values_t* self = (grib_accessor_bufr_string_values_t*)a; + int n = 0; + self->dataAccessorName = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->dataAccessor = NULL; + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +void grib_accessor_class_bufr_string_values_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_string_array(dumper, a, NULL); +} + +static grib_accessor* get_accessor(grib_accessor* a) +{ + grib_accessor_bufr_string_values_t* self = (grib_accessor_bufr_string_values_t*)a; + if (!self->dataAccessor) { + self->dataAccessor = grib_find_accessor(grib_handle_of_accessor(a), self->dataAccessorName); + } + return self->dataAccessor; +} + +int grib_accessor_class_bufr_string_values_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len){ + grib_accessor* data = 0; + grib_context* c = a->context; + grib_vsarray* stringValues = NULL; + size_t l = 0, tl; + size_t i, j, n = 0; + char** b = buffer; + + data = get_accessor(a); + if (!data) + return GRIB_NOT_FOUND; + + stringValues = accessor_bufr_data_array_get_stringValues(data); + + n = grib_vsarray_used_size(stringValues); + + tl = 0; + for (j = 0; j < n; j++) { + l = grib_sarray_used_size(stringValues->v[j]); + tl += l; + + if (tl > *len) + return GRIB_ARRAY_TOO_SMALL; + + for (i = 0; i < l; i++) { + *(b++) = grib_context_strdup(c, stringValues->v[j]->v[i]); + } + } + *len = tl; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_bufr_string_values_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_bufr_string_values_t::value_count(grib_accessor* a, long* rlen){ + grib_accessor* descriptors = get_accessor(a); + return descriptors->value_count(rlen);} + +void grib_accessor_class_bufr_string_values_t::destroy(grib_context* c, grib_accessor* a){ +} diff --git a/src/accessor/grib_accessor_class_bufr_string_values.h b/src/accessor/grib_accessor_class_bufr_string_values.h new file mode 100644 index 000000000..9038a8d73 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_string_values.h @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_string_values_h +#define eccodes_accessor_bufr_string_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_bufr_string_values_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in bufr_string_values */ + const char* dataAccessorName; + grib_accessor* dataAccessor; +}; + +class grib_accessor_class_bufr_string_values_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_bufr_string_values_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_string_values_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_string_values_h */ diff --git a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc new file mode 100644 index 000000000..2f4073460 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc @@ -0,0 +1,98 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_bufrdc_expanded_descriptors.h" + +grib_accessor_class_bufrdc_expanded_descriptors_t _grib_accessor_class_bufrdc_expanded_descriptors{"bufrdc_expanded_descriptors"}; +grib_accessor_class* grib_accessor_class_bufrdc_expanded_descriptors = &_grib_accessor_class_bufrdc_expanded_descriptors; + + +void grib_accessor_class_bufrdc_expanded_descriptors_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_bufrdc_expanded_descriptors_t* self = (grib_accessor_bufrdc_expanded_descriptors_t*)a; + int n = 0; + self->expandedDescriptors = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->expandedDescriptorsAccessor = 0; + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +static grib_accessor* get_accessor(grib_accessor* a) +{ + grib_accessor_bufrdc_expanded_descriptors_t* self = (grib_accessor_bufrdc_expanded_descriptors_t*)a; + if (!self->expandedDescriptorsAccessor) { + self->expandedDescriptorsAccessor = grib_find_accessor(grib_handle_of_accessor(a), self->expandedDescriptors); + } + return self->expandedDescriptorsAccessor; +} + +int grib_accessor_class_bufrdc_expanded_descriptors_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor* descriptors = 0; + size_t rlen = 0, l; + long lenall = 0; + size_t i = 0; + long* v = 0; + grib_context* c = a->context; + + descriptors = get_accessor(a); + if (!descriptors) return GRIB_NOT_FOUND; + + a->value_count(&lenall); v = (long*)grib_context_malloc_clear(c, sizeof(long) * lenall); + l = lenall; + descriptors->unpack_long(v, &l); + rlen = 0; + for (i = 0; i < l; i++) { + if ((v[i] < 100000 || v[i] > 221999)) + val[rlen++] = v[i]; + } + *len = rlen; + grib_context_free(c,v); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_bufrdc_expanded_descriptors_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len){ + int err = 0; + grib_accessor* descriptors = 0; + size_t l = 0; + long lenall = 0; + size_t i = 0; + long* v = 0; + char buf[25] = {0,}; + grib_context* c = a->context; + + descriptors = get_accessor(a); + if (!descriptors) return GRIB_NOT_FOUND; + + err = a->value_count(&lenall); if (err) return err; + l = lenall; + if (l > *len) return GRIB_ARRAY_TOO_SMALL; + + v = (long*)grib_context_malloc_clear(c, sizeof(long) * l); + err = descriptors->unpack_long(v, &l); if (err) return err; + + for (i = 0; i < l; i++) { + snprintf(buf, sizeof(buf), "%06ld", v[i]); + buffer[i] = grib_context_strdup(c, buf); + } + *len = l; + grib_context_free(c,v); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_bufrdc_expanded_descriptors_t::value_count(grib_accessor* a, long* rlen){ + grib_accessor* descriptors = get_accessor(a); + + return descriptors->value_count(rlen);} + +void grib_accessor_class_bufrdc_expanded_descriptors_t::destroy(grib_context* c, grib_accessor* a){ +} diff --git a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h new file mode 100644 index 000000000..588f9d08b --- /dev/null +++ b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufrdc_expanded_descriptors_h +#define eccodes_accessor_bufrdc_expanded_descriptors_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_bufrdc_expanded_descriptors_t : public grib_accessor_long_t +{ +public: + /* Members defined in bufrdc_expanded_descriptors */ + const char* expandedDescriptors; + grib_accessor* expandedDescriptorsAccessor; +}; + +class grib_accessor_class_bufrdc_expanded_descriptors_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_bufrdc_expanded_descriptors_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufrdc_expanded_descriptors_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufrdc_expanded_descriptors_h */ diff --git a/src/accessor/grib_accessor_class_bytes.cc b/src/accessor/grib_accessor_class_bytes.cc new file mode 100644 index 000000000..e0002429a --- /dev/null +++ b/src/accessor/grib_accessor_class_bytes.cc @@ -0,0 +1,99 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_bytes.h" + +grib_accessor_class_bytes_t _grib_accessor_class_bytes{"bytes"}; +grib_accessor_class* grib_accessor_class_bytes = &_grib_accessor_class_bytes; + + +void grib_accessor_class_bytes_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + /*grib_accessor_signed* self = (grib_accessor_signed*)a; */ + a->length = len; + Assert(a->length >= 0); +} + +int grib_accessor_class_bytes_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_BYTES; +} + +int grib_accessor_class_bytes_t::compare(grib_accessor* a, grib_accessor* b){ + int retval = GRIB_SUCCESS; + + size_t alen = (size_t)a->byte_count(); size_t blen = (size_t)b->byte_count(); + if (alen != blen) + return GRIB_COUNT_MISMATCH; + + return retval; +} + +int grib_accessor_class_bytes_t::unpack_string(grib_accessor* a, char* v, size_t* len){ + unsigned char* p = NULL; + char* s = v; + long i = 0; + const long length = a->byte_count(); const long slength = 2 * length; + + if (*len < (size_t)slength) { + *len = slength; + return GRIB_BUFFER_TOO_SMALL; + } + + p = grib_handle_of_accessor(a)->buffer->data + a->byte_offset(); + for (i = 0; i < length; i++) { + snprintf(s, INT_MAX, "%02x", *(p++)); + s += 2; + } + + *len = slength; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_bytes_t::pack_string(grib_accessor* a, const char* val, size_t* len){ + /* The string representation (val) of the byte array will have two chars + * per byte e.g. 4C5B means the 2 bytes 0114 and 0133 in octal + * so has to be twice the length of the byte array + */ + int err = 0; + grib_context* c = a->context; + size_t nbytes = a->length; + const size_t expected_blen = nbytes; + const size_t expected_slen = 2 * expected_blen; + unsigned char* bytearray = NULL; + size_t i = 0, slen = strlen(val); + + if (slen != expected_slen || *len != expected_slen) { + grib_context_log(c, GRIB_LOG_ERROR, + "%s: Key %s is %lu bytes. Expected a string with %lu characters (actual length=%zu)", + __func__, a->name, expected_blen, expected_slen, *len); + return GRIB_WRONG_ARRAY_SIZE; + } + + bytearray = (unsigned char*)grib_context_malloc(c, nbytes * (sizeof(unsigned char))); + if (!bytearray) return GRIB_OUT_OF_MEMORY; + + for (i = 0; i < (slen/2); i++) { + unsigned int byteVal = 0; + if (sscanf(val + 2*i, "%02x", &byteVal) != 1) { + grib_context_log(c, GRIB_LOG_ERROR,"%s: Invalid hex byte specfication '%.2s'", __func__, val + 2*i); + grib_context_free(c, bytearray); + return GRIB_INVALID_KEY_VALUE; + } + Assert(byteVal < 256); + bytearray[i] = (int)byteVal; + } + + /* Forward to base class to pack the byte array */ + err = grib_accessor_class_gen_t::pack_bytes(a, bytearray, &nbytes); + grib_context_free(c, bytearray); + return err; +} diff --git a/src/accessor/grib_accessor_class_bytes.h b/src/accessor/grib_accessor_class_bytes.h new file mode 100644 index 000000000..8204ceba7 --- /dev/null +++ b/src/accessor/grib_accessor_class_bytes.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bytes_h +#define eccodes_accessor_bytes_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bytes_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bytes */ +}; + +class grib_accessor_class_bytes_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bytes_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bytes_t{}; } + int get_native_type(grib_accessor*) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_bytes_h */ diff --git a/src/accessor/grib_accessor_class_change_alternative_row_scanning.cc b/src/accessor/grib_accessor_class_change_alternative_row_scanning.cc new file mode 100644 index 000000000..8375ee26d --- /dev/null +++ b/src/accessor/grib_accessor_class_change_alternative_row_scanning.cc @@ -0,0 +1,117 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_change_alternative_row_scanning.h" + +grib_accessor_class_change_alternative_row_scanning_t _grib_accessor_class_change_alternative_row_scanning{"change_alternative_row_scanning"}; +grib_accessor_class* grib_accessor_class_change_alternative_row_scanning = &_grib_accessor_class_change_alternative_row_scanning; + + +void grib_accessor_class_change_alternative_row_scanning_t::init(grib_accessor* a, const long len, grib_arguments* args){ + int n = 0; + grib_accessor_change_alternative_row_scanning_t* self = (grib_accessor_change_alternative_row_scanning_t*)a; + + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->Ni = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->Nj = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->alternativeRowScanning = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +int grib_accessor_class_change_alternative_row_scanning_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + int err = 0; + grib_accessor_change_alternative_row_scanning_t* self = (grib_accessor_change_alternative_row_scanning_t*)a; + const grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + long i, j, jr, theEnd, Ni, Nj, k, kp, alternativeRowScanning; + size_t size = 0; + double* values = NULL; + double tmp = 0.0; + + if (*val == 0) + return 0; + + /* Make sure Ni / Nj are not missing */ + if (grib_is_missing(h, self->Ni, &err) && !err) { + grib_context_log(c, GRIB_LOG_ERROR, "change_alternative_row_scanning: Key %s cannot be 'missing'!", self->Ni); + return GRIB_WRONG_GRID; + } + if (grib_is_missing(h, self->Nj, &err) && !err) { + grib_context_log(c, GRIB_LOG_ERROR, "change_alternative_row_scanning: Key %s cannot be 'missing'!", self->Nj); + return GRIB_WRONG_GRID; + } + + if ((err = grib_get_long_internal(h, self->Ni, &Ni)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(h, self->Nj, &Nj)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(h, self->alternativeRowScanning, &alternativeRowScanning)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return err; + + 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; + } + + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; + + if ((err = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return err; + } + + theEnd = Ni / 2; + for (j = 0; j < Nj; j++) { + jr = Ni * j; + for (i = 0; i < theEnd; i++) { + if (j % 2 == 1) { + /* Swap first and last value on every odd row */ + k = jr + i; + kp = jr + Ni - i - 1; + tmp = values[k]; + values[k] = values[kp]; + values[kp] = tmp; + } + } + } + alternativeRowScanning = !alternativeRowScanning; + if ((err = grib_set_long_internal(h, self->alternativeRowScanning, alternativeRowScanning)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return err; + } + + if ((err = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return err; + } + + grib_context_free(c, values); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_change_alternative_row_scanning_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} + +int grib_accessor_class_change_alternative_row_scanning_t::unpack_long(grib_accessor* a, long* v, size_t* len){ + /* Decoding this accessor doesn't make sense so we return a dummy value */ + *v = -1; + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_change_alternative_row_scanning.h b/src/accessor/grib_accessor_class_change_alternative_row_scanning.h new file mode 100644 index 000000000..c893e242f --- /dev/null +++ b/src/accessor/grib_accessor_class_change_alternative_row_scanning.h @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_change_alternative_row_scanning_h +#define eccodes_accessor_change_alternative_row_scanning_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_change_alternative_row_scanning_t : public grib_accessor_gen_t +{ +public: + /* Members defined in change_alternative_row_scanning */ + const char* values; + const char* Ni; + const char* Nj; + const char* alternativeRowScanning; +}; + +class grib_accessor_class_change_alternative_row_scanning_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_change_alternative_row_scanning_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_change_alternative_row_scanning_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_change_alternative_row_scanning_h */ diff --git a/src/accessor/todo/grib_accessor_class_change_scanning_direction.cc b/src/accessor/grib_accessor_class_change_scanning_direction.cc similarity index 57% rename from src/accessor/todo/grib_accessor_class_change_scanning_direction.cc rename to src/accessor/grib_accessor_class_change_scanning_direction.cc index f951c9083..b8f71f14c 100644 --- a/src/accessor/todo/grib_accessor_class_change_scanning_direction.cc +++ b/src/accessor/grib_accessor_class_change_scanning_direction.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,115 +10,14 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = pack_long; - IMPLEMENTS = unpack_long - IMPLEMENTS = init;get_native_type - MEMBERS = const char* values - MEMBERS = const char* Ni - MEMBERS = const char* Nj - MEMBERS = const char* i_scans_negatively - MEMBERS = const char* j_scans_positively - MEMBERS = const char* first - MEMBERS = const char* last - MEMBERS = const char* axis - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_change_scanning_direction -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in change_scanning_direction */ - const char* values; - const char* Ni; - const char* Nj; - const char* i_scans_negatively; - const char* j_scans_positively; - const char* first; - const char* last; - const char* axis; -} grib_accessor_change_scanning_direction; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_change_scanning_direction = { - &grib_accessor_class_gen, /* super */ - "change_scanning_direction", /* name */ - sizeof(grib_accessor_change_scanning_direction), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_change_scanning_direction.h" +grib_accessor_class_change_scanning_direction_t _grib_accessor_class_change_scanning_direction{"change_scanning_direction"}; grib_accessor_class* grib_accessor_class_change_scanning_direction = &_grib_accessor_class_change_scanning_direction; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_change_scanning_direction* self = (grib_accessor_change_scanning_direction*)a; +void grib_accessor_class_change_scanning_direction_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_change_scanning_direction_t* self = (grib_accessor_change_scanning_direction_t*)a; grib_handle* h = grib_handle_of_accessor(a); int n = 0; @@ -134,8 +34,7 @@ static void init(grib_accessor* a, const long len, grib_arguments* args) a->length = 0; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ +int grib_accessor_class_change_scanning_direction_t::pack_long(grib_accessor* a, const long* val, size_t* len){ int err = 0; long i, j, jr, theEnd, Ni, Nj, k, kp; double tmp; @@ -145,7 +44,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) double last = 0; size_t size = 0; double* values = NULL; - grib_accessor_change_scanning_direction* self = (grib_accessor_change_scanning_direction*)a; + grib_accessor_change_scanning_direction_t* self = (grib_accessor_change_scanning_direction_t*)a; const grib_context* c = a->context; grib_handle* h = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; @@ -248,13 +147,11 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_SUCCESS; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_change_scanning_direction_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_LONG; } -static int unpack_long(grib_accessor* a, long* v, size_t* len) -{ +int grib_accessor_class_change_scanning_direction_t::unpack_long(grib_accessor* a, long* v, size_t* len){ /* ECC-976: decoding this accessor doesn't make sense so we return a dummy value */ *v = -1; return GRIB_SUCCESS; diff --git a/src/accessor/grib_accessor_class_change_scanning_direction.h b/src/accessor/grib_accessor_class_change_scanning_direction.h new file mode 100644 index 000000000..08f2ceb55 --- /dev/null +++ b/src/accessor/grib_accessor_class_change_scanning_direction.h @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_change_scanning_direction_h +#define eccodes_accessor_change_scanning_direction_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_change_scanning_direction_t : public grib_accessor_gen_t +{ +public: + /* Members defined in change_scanning_direction */ + const char* values; + const char* Ni; + const char* Nj; + const char* i_scans_negatively; + const char* j_scans_positively; + const char* first; + const char* last; + const char* axis; +}; + +class grib_accessor_class_change_scanning_direction_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_change_scanning_direction_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_change_scanning_direction_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_change_scanning_direction_h */ diff --git a/src/accessor/grib_accessor_class_check_internal_version.cc b/src/accessor/grib_accessor_class_check_internal_version.cc new file mode 100644 index 000000000..65bdbcbf0 --- /dev/null +++ b/src/accessor/grib_accessor_class_check_internal_version.cc @@ -0,0 +1,51 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_check_internal_version.h" + +grib_accessor_class_check_internal_version_t _grib_accessor_class_check_internal_version{"check_internal_version"}; +grib_accessor_class* grib_accessor_class_check_internal_version = &_grib_accessor_class_check_internal_version; + + +/* This is the internal engine version number */ +/* We check this against the version number found in the definitions boot.def file */ +/* See the key "internalVersion" */ +#define LATEST_ENGINE_VERSION 30 + +void grib_accessor_class_check_internal_version_t::init(grib_accessor* a, const long l, grib_arguments* args){ + /* Check version of definition files is compatible with the engine */ + int err = 0; + long defs_file_version = 0; + grib_handle* h = grib_handle_of_accessor(a); + const char* s_defn_version = grib_arguments_get_name(h, args, 0); + Assert(s_defn_version); + + err = grib_get_long_internal(h, s_defn_version, &defs_file_version); + if (!err) { + if (defs_file_version > LATEST_ENGINE_VERSION) { + grib_context_log(h->context, GRIB_LOG_FATAL, + "Definition files version (%d) is greater than engine version (%d)!\n" + " " /* indent for 2nd line */ + "These definition files are for a later version of the ecCodes engine.", + defs_file_version, LATEST_ENGINE_VERSION); + } + } +} + +int grib_accessor_class_check_internal_version_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +size_t grib_accessor_class_check_internal_version_t::string_length(grib_accessor* a){ + return 255; +} diff --git a/src/accessor/grib_accessor_class_check_internal_version.h b/src/accessor/grib_accessor_class_check_internal_version.h new file mode 100644 index 000000000..871f5a56e --- /dev/null +++ b/src/accessor/grib_accessor_class_check_internal_version.h @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_check_internal_version_h +#define eccodes_accessor_check_internal_version_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_check_internal_version_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in check_internal_version */ +}; + +class grib_accessor_class_check_internal_version_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_check_internal_version_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_check_internal_version_t{}; } + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_check_internal_version_h */ diff --git a/src/accessor/todo/grib_accessor_class_closest_date.cc b/src/accessor/grib_accessor_class_closest_date.cc similarity index 57% rename from src/accessor/todo/grib_accessor_class_closest_date.cc rename to src/accessor/grib_accessor_class_closest_date.cc index 08ba9f333..462b90078 100644 --- a/src/accessor/todo/grib_accessor_class_closest_date.cc +++ b/src/accessor/grib_accessor_class_closest_date.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,121 +10,15 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_closest_date.h" #include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_long - IMPLEMENTS = unpack_double - IMPLEMENTS = dump - IMPLEMENTS = init - MEMBERS = const char *dateLocal - MEMBERS = const char *timeLocal - MEMBERS = const char *numForecasts - MEMBERS = const char *year - MEMBERS = const char *month - MEMBERS = const char *day - MEMBERS = const char *hour - MEMBERS = const char *minute - MEMBERS = const char *second - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_closest_date -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in closest_date */ - const char *dateLocal; - const char *timeLocal; - const char *numForecasts; - const char *year; - const char *month; - const char *day; - const char *hour; - const char *minute; - const char *second; -} grib_accessor_closest_date; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_closest_date = { - &grib_accessor_class_double, /* super */ - "closest_date", /* name */ - sizeof(grib_accessor_closest_date), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_closest_date_t _grib_accessor_class_closest_date{"closest_date"}; grib_accessor_class* grib_accessor_class_closest_date = &_grib_accessor_class_closest_date; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_closest_date* self = (grib_accessor_closest_date*)a; +void grib_accessor_class_closest_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_closest_date_t* self = (grib_accessor_closest_date_t*)a; grib_handle* h = grib_handle_of_accessor(a); int n = 0; @@ -140,13 +35,11 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->length = 0; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_closest_date_t::dump(grib_accessor* a, grib_dumper* dumper){ grib_dump_string(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ +int grib_accessor_class_closest_date_t::unpack_long(grib_accessor* a, long* val, size_t* len){ int ret = 0; double v = 0; @@ -157,9 +50,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) } /* Sets val to the 'index' of the closes date */ -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - const grib_accessor_closest_date* self = (grib_accessor_closest_date*)a; +int grib_accessor_class_closest_date_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + const grib_accessor_closest_date_t* self = (grib_accessor_closest_date_t*)a; int err = 0; long num_forecasts = 0; /* numberOfForecastsUsedInLocalTime */ diff --git a/src/accessor/grib_accessor_class_closest_date.h b/src/accessor/grib_accessor_class_closest_date.h new file mode 100644 index 000000000..b4fbace12 --- /dev/null +++ b/src/accessor/grib_accessor_class_closest_date.h @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_closest_date_h +#define eccodes_accessor_closest_date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_closest_date_t : public grib_accessor_double_t +{ +public: + /* Members defined in closest_date */ + const char *dateLocal; + const char *timeLocal; + const char *numForecasts; + const char *year; + const char *month; + const char *day; + const char *hour; + const char *minute; + const char *second; +}; + +class grib_accessor_class_closest_date_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_closest_date_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_closest_date_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_closest_date_h */ diff --git a/src/accessor/grib_accessor_class_codeflag.cc b/src/accessor/grib_accessor_class_codeflag.cc new file mode 100644 index 000000000..3baa24c1b --- /dev/null +++ b/src/accessor/grib_accessor_class_codeflag.cc @@ -0,0 +1,119 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_codeflag.h" + +grib_accessor_class_codeflag_t _grib_accessor_class_codeflag{"codeflag"}; +grib_accessor_class* grib_accessor_class_codeflag = &_grib_accessor_class_codeflag; + + +void grib_accessor_class_codeflag_t::init(grib_accessor* a, const long len, grib_arguments* param){ + grib_accessor_codeflag_t* self = (grib_accessor_codeflag_t*)a; + a->length = len; + self->tablename = grib_arguments_get_string(grib_handle_of_accessor(a), param, 0); + Assert(a->length >= 0); +} + +int test_bit(long a, long b){ + DEBUG_ASSERT(b>=0); + return a & (1 << b); +} + +int grib_get_codeflag(grib_accessor* a, long code, char* codename){ + const grib_accessor_codeflag_t* self = (grib_accessor_codeflag_t*)a; + FILE* f = NULL; + char fname[1024]; + char bval[50]; + char num[50]; + char* filename = 0; + char line[1024]; + size_t i = 0; + int j = 0; + int err = 0; + + err = grib_recompose_name(grib_handle_of_accessor(a), NULL, self->tablename, fname, 1); + 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); + strcpy(codename, "Cannot open flag table"); + return GRIB_FILE_NOT_FOUND; + } + + f = codes_fopen(filename, "r"); + if (!f) { + grib_context_log(a->context, (GRIB_LOG_WARNING) | (GRIB_LOG_PERROR), "Cannot open flag table %s", filename); + strcpy(codename, "Cannot open flag table"); + return GRIB_FILE_NOT_FOUND; + } + + // strcpy(codename, self->tablename); + // strcat(codename,": "); + // j = strlen(codename); + + while (fgets(line, sizeof(line) - 1, f)) { + sscanf(line, "%49s %49s", num, bval); + + if (num[0] != '#') { + if ((test_bit(code, a->length * 8 - atol(num)) > 0) == atol(bval)) { + size_t linelen = strlen(line); + codename[j++] = '('; + codename[j++] = num[0]; + codename[j++] = '='; + codename[j++] = bval[0]; + codename[j++] = ')'; + codename[j++] = ' '; + if (j) + codename[j++] = ' '; + + for (i = (strlen(num) + strlen(bval) + 2); i < linelen - 1; i++) + codename[j++] = line[i]; + if (line[i] != '\n') + codename[j++] = line[i]; + codename[j++] = ';'; + } + } + } + + if (j > 1 && codename[j - 1] == ';') + j--; + codename[j] = 0; + + strcat(codename, ":"); + strcat(codename, fname); + + fclose(f); + return GRIB_SUCCESS; +} + +int grib_accessor_class_codeflag_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +void grib_accessor_class_codeflag_t::dump(grib_accessor* a, grib_dumper* dumper){ + const grib_accessor_codeflag_t* self = (grib_accessor_codeflag_t*)a; + long v = 0; + char flagname[1024] = {0,}; + char fname[1024] = {0,}; + + size_t llen = 1; + + grib_recompose_name(grib_handle_of_accessor(a), NULL, self->tablename, fname, 1); + a->unpack_long(&v, &llen); + grib_get_codeflag(a, v, flagname); + + grib_dump_bits(dumper, a, flagname); +} diff --git a/src/accessor/grib_accessor_class_codeflag.h b/src/accessor/grib_accessor_class_codeflag.h new file mode 100644 index 000000000..734369b74 --- /dev/null +++ b/src/accessor/grib_accessor_class_codeflag.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_codeflag_h +#define eccodes_accessor_codeflag_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_codeflag_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in codeflag */ + const char* tablename; +}; + +class grib_accessor_class_codeflag_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_codeflag_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_codeflag_t{}; } + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_codeflag_h */ diff --git a/src/accessor/grib_accessor_class_codetable_title.cc b/src/accessor/grib_accessor_class_codetable_title.cc new file mode 100644 index 000000000..27d787170 --- /dev/null +++ b/src/accessor/grib_accessor_class_codetable_title.cc @@ -0,0 +1,69 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_codetable_title.h" +#include "grib_accessor_class_codetable.h" + +grib_accessor_class_codetable_title_t _grib_accessor_class_codetable_title{"codetable_title"}; +grib_accessor_class* grib_accessor_class_codetable_title = &_grib_accessor_class_codetable_title; + +void grib_accessor_class_codetable_title_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_codetable_title_t* self = (grib_accessor_codetable_title_t*)a; + int n = 0; + self->codetable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_codetable_title_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_STRING; +} + +int grib_accessor_class_codetable_title_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ + grib_accessor_codetable_title_t* self = (grib_accessor_codetable_title_t*)a; + grib_codetable* table = NULL; + + size_t size = 1; + long value; + int err = GRIB_SUCCESS; + char tmp[1024]; + size_t l = 1024; + grib_accessor_codetable_t* ca = (grib_accessor_codetable_t*)grib_find_accessor(grib_handle_of_accessor(a), self->codetable); + + if ((err = ((grib_accessor*)ca)->unpack_long(&value, &size)) != GRIB_SUCCESS) + return err; + + table = ca->table; + + if (table && (value >= 0) && (value < table->size) && table->entries[value].title) { + strcpy(tmp, table->entries[value].title); + } + else { + snprintf(tmp, sizeof(tmp), "%d", (int)value); + } + + l = strlen(tmp) + 1; + + if (*len < l) { + const char* cclass_name = a->cclass->name; + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + cclass_name, a->name, l, *len); + *len = l; + return GRIB_BUFFER_TOO_SMALL; + } + + strcpy(buffer, tmp); + *len = l; + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_codetable_title.h b/src/accessor/grib_accessor_class_codetable_title.h new file mode 100644 index 000000000..e115a9c28 --- /dev/null +++ b/src/accessor/grib_accessor_class_codetable_title.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_codetable_title_h +#define eccodes_accessor_codetable_title_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_codetable_title_t : public grib_accessor_gen_t +{ +public: + /* Members defined in codetable_title */ + const char* codetable; +}; + +class grib_accessor_class_codetable_title_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_codetable_title_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_codetable_title_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_codetable_title_h */ diff --git a/src/accessor/grib_accessor_class_codetable_units.cc b/src/accessor/grib_accessor_class_codetable_units.cc new file mode 100644 index 000000000..cc2c3815b --- /dev/null +++ b/src/accessor/grib_accessor_class_codetable_units.cc @@ -0,0 +1,70 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_codetable_units.h" +#include "grib_accessor_class_codetable.h" + +grib_accessor_class_codetable_units_t _grib_accessor_class_codetable_units{"codetable_units"}; +grib_accessor_class* grib_accessor_class_codetable_units = &_grib_accessor_class_codetable_units; + +void grib_accessor_class_codetable_units_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_codetable_units_t* self = (grib_accessor_codetable_units_t*)a; + + int n = 0; + self->codetable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_codetable_units_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_STRING; +} + +int grib_accessor_class_codetable_units_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ + grib_accessor_codetable_units_t* self = (grib_accessor_codetable_units_t*)a; + grib_codetable* table = NULL; + + size_t size = 1; + long value; + int err = GRIB_SUCCESS; + char tmp[1024]; + size_t l = sizeof(tmp); + grib_accessor_codetable_t* ca = (grib_accessor_codetable_t*)grib_find_accessor(grib_handle_of_accessor(a), self->codetable); + + if ((err = ((grib_accessor*)ca)->unpack_long(&value, &size)) != GRIB_SUCCESS) + return err; + + table = ca->table; + + if (table && (value >= 0) && (value < table->size) && table->entries[value].units) { + strcpy(tmp, table->entries[value].units); + } + else { + snprintf(tmp, sizeof(tmp), "%d", (int)value); + } + + l = strlen(tmp) + 1; + + if (*len < l) { + const char* cclass_name = a->cclass->name; + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + cclass_name, a->name, l, *len); + *len = l; + return GRIB_BUFFER_TOO_SMALL; + } + + strcpy(buffer, tmp); + *len = l; + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_codetable_units.h b/src/accessor/grib_accessor_class_codetable_units.h new file mode 100644 index 000000000..b5cfb75c8 --- /dev/null +++ b/src/accessor/grib_accessor_class_codetable_units.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_codetable_units_h +#define eccodes_accessor_codetable_units_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_codetable_units_t : public grib_accessor_gen_t +{ +public: + /* Members defined in codetable_units */ + const char* codetable; +}; + +class grib_accessor_class_codetable_units_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_codetable_units_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_codetable_units_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_codetable_units_h */ diff --git a/src/accessor/todo/grib_accessor_class_concept.cc b/src/accessor/grib_accessor_class_concept.cc similarity index 71% rename from src/accessor/todo/grib_accessor_class_concept.cc rename to src/accessor/grib_accessor_class_concept.cc index 6fa4122f8..55f535cb2 100644 --- a/src/accessor/todo/grib_accessor_class_concept.cc +++ b/src/accessor/grib_accessor_class_concept.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,113 +9,12 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ - -/******************************************************* - * Enrico Fucile - ******************************************************/ - #include "grib_api_internal.h" +#include "grib_accessor_class_concept.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = unpack_string;pack_string;string_length - IMPLEMENTS = unpack_long;pack_long;destroy - IMPLEMENTS = init;dump;value_count;get_native_type - IMPLEMENTS = compare - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 pack_long(grib_accessor*, const long* val, size_t* len); -static int pack_string(grib_accessor*, const char*, size_t* len); -static int unpack_double(grib_accessor*, double* 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 size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_concept -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in concept */ -} grib_accessor_concept; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_concept = { - &grib_accessor_class_gen, /* super */ - "concept", /* name */ - sizeof(grib_accessor_concept), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_concept_t _grib_accessor_class_concept{"concept"}; grib_accessor_class* grib_accessor_class_concept = &_grib_accessor_class_concept; -/* END_CLASS_IMP */ #define MAX_CONCEPT_STRING_LENGTH 255 @@ -134,19 +34,16 @@ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) return (*a == 0 && *b == 0) ? 0 : 1; } -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ +void grib_accessor_class_concept_t::init(grib_accessor* a, const long len, grib_arguments* args){ a->length = 0; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_concept_t::dump(grib_accessor* a, grib_dumper* dumper){ grib_dump_string(dumper, a, NULL); } /* Return 1 (=True) or 0 (=False) */ -static int concept_condition_expression_true(grib_handle* h, grib_concept_condition* c) -{ +int concept_condition_expression_true(grib_handle* h, grib_concept_condition* c){ long lval; long lres = 0; int ok = FALSE; /* Boolean */ @@ -190,8 +87,7 @@ static int concept_condition_expression_true(grib_handle* h, grib_concept_condit } /* Return 1 (=True) or 0 (=False) */ -static int concept_condition_iarray_true(grib_handle* h, grib_concept_condition* c) -{ +int concept_condition_iarray_true(grib_handle* h, grib_concept_condition* c){ long* val = NULL; size_t size = 0, i; int ret; /* Boolean */ @@ -221,8 +117,7 @@ static int concept_condition_iarray_true(grib_handle* h, grib_concept_condition* } /* Return 1 (=True) or 0 (=False) */ -static int concept_condition_true(grib_handle* h, grib_concept_condition* c) -{ +int concept_condition_true(grib_handle* h, grib_concept_condition* c){ if (c->expression == NULL) return concept_condition_iarray_true(h, c); else @@ -263,8 +158,7 @@ static const char* concept_evaluate(grib_accessor* a) #define MAX_NUM_CONCEPT_VALUES 40 -static int concept_conditions_expression_apply(grib_handle* h, grib_concept_condition* e, grib_values* values, grib_sarray* sa, int* n) -{ +int concept_conditions_expression_apply(grib_handle* h, grib_concept_condition* e, grib_values* values, grib_sarray* sa, int* n){ long lres = 0; double dres = 0.0; int count = *n; @@ -295,30 +189,26 @@ static int concept_conditions_expression_apply(grib_handle* h, grib_concept_cond return err; } -static int concept_conditions_iarray_apply(grib_handle* h, grib_concept_condition* c) -{ +int concept_conditions_iarray_apply(grib_handle* h, grib_concept_condition* c){ size_t size = grib_iarray_used_size(c->iarray); return grib_set_long_array(h, c->name, c->iarray->v, size); } -static int concept_conditions_apply(grib_handle* h, grib_concept_condition* c, grib_values* values, grib_sarray* sa, int* n) -{ +int concept_conditions_apply(grib_handle* h, grib_concept_condition* c, grib_values* values, grib_sarray* sa, int* n){ if (c->expression == NULL) return concept_conditions_iarray_apply(h, c); else return concept_conditions_expression_apply(h, c, values, sa, n); } -static int cmpstringp(const void* p1, const void* p2) -{ +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 */ return strcmp(*(char* const*)p1, *(char* const*)p2); } -static bool blacklisted(grib_handle* h, long edition, const char* concept_name, const char* concept_value) -{ +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); @@ -345,8 +235,7 @@ static bool blacklisted(grib_handle* h, long edition, const char* concept_name, return false; } -static int grib_concept_apply(grib_accessor* a, const char* name) -{ +int grib_concept_apply(grib_accessor* a, const char* name){ int err = 0; int count = 0; grib_concept_condition* e = NULL; @@ -440,13 +329,11 @@ static int grib_concept_apply(grib_accessor* a, const char* name) return err; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ +int grib_accessor_class_concept_t::pack_double(grib_accessor* a, const double* val, size_t* len){ return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ +int grib_accessor_class_concept_t::pack_long(grib_accessor* a, const long* val, size_t* len){ char buf[80]; size_t s; snprintf(buf, sizeof(buf), "%ld", *val); @@ -458,8 +345,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return pack_string(a, buf, &s); } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_concept_t::unpack_double(grib_accessor* a, double* val, size_t* len){ /* * If we want to have a condition which contains tests for paramId as well * as a floating point key, then need to be able to evaluate paramId as a @@ -491,8 +377,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ +int grib_accessor_class_concept_t::unpack_long(grib_accessor* a, long* val, size_t* len){ const char* p = concept_evaluate(a); if (!p) { @@ -527,8 +412,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_concept_t::get_native_type(grib_accessor* a){ int type = GRIB_TYPE_STRING; if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) type = GRIB_TYPE_LONG; @@ -536,14 +420,12 @@ static int get_native_type(grib_accessor* a) return type; } -static void destroy(grib_context* c, grib_accessor* a) -{ - //grib_accessor_concept *self = (grib_accessor_concept*)a; +void grib_accessor_class_concept_t::destroy(grib_context* c, grib_accessor* a){ + //grib_accessor_concept_t *self = (grib_accessor_concept_t*)a; //grib_context_free(c,self->cval); } -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ +int grib_accessor_class_concept_t::unpack_string(grib_accessor* a, char* val, size_t* len){ size_t slen; const char* p = concept_evaluate(a); @@ -576,24 +458,20 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ +int grib_accessor_class_concept_t::pack_string(grib_accessor* a, const char* val, size_t* len){ return grib_concept_apply(a, val); } -static size_t string_length(grib_accessor* a) -{ +size_t grib_accessor_class_concept_t::string_length(grib_accessor* a){ return MAX_CONCEPT_STRING_LENGTH; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_concept_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } -static int compare(grib_accessor* a, grib_accessor* b) -{ +int grib_accessor_class_concept_t::compare(grib_accessor* a, grib_accessor* b){ int retval = 0; char* aval = 0; char* bval = 0; @@ -603,12 +481,10 @@ static int compare(grib_accessor* a, grib_accessor* b) int err = 0; long count = 0; - err = grib_value_count(a, &count); - if (err) return err; + err = a->value_count(&count); if (err) return err; alen = count; - err = grib_value_count(b, &count); - if (err) return err; + err = b->value_count(&count); if (err) return err; blen = count; if (alen != blen) @@ -619,10 +495,8 @@ static int compare(grib_accessor* a, grib_accessor* b) aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - err = grib_unpack_string(a, aval, &alen); - if (err) return err; - err = grib_unpack_string(b, bval, &blen); - if (err) return err; + err = a->unpack_string(aval, &alen); if (err) return err; + err = b->unpack_string(bval, &blen); if (err) return err; retval = GRIB_SUCCESS; if (!aval || !bval || grib_inline_strcmp(aval, bval)) diff --git a/src/accessor/grib_accessor_class_concept.h b/src/accessor/grib_accessor_class_concept.h new file mode 100644 index 000000000..99405ed48 --- /dev/null +++ b/src/accessor/grib_accessor_class_concept.h @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_concept_h +#define eccodes_accessor_concept_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_concept_t : public grib_accessor_gen_t +{ +public: + /* Members defined in concept */ +}; + +class grib_accessor_class_concept_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_concept_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_concept_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_concept_h */ diff --git a/src/accessor/grib_accessor_class_count_file.cc b/src/accessor/grib_accessor_class_count_file.cc new file mode 100644 index 000000000..9e88700a3 --- /dev/null +++ b/src/accessor/grib_accessor_class_count_file.cc @@ -0,0 +1,28 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_count_file.h" + +grib_accessor_class_count_file_t _grib_accessor_class_count_file{"count_file"}; +grib_accessor_class* grib_accessor_class_count_file = &_grib_accessor_class_count_file; + + +void grib_accessor_class_count_file_t::init(grib_accessor* a, const long l, grib_arguments* c){ + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; +} + +int grib_accessor_class_count_file_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + *val = grib_context_get_handle_file_count(a->context); + *len = 1; + return 0; +} diff --git a/src/accessor/grib_accessor_class_count_file.h b/src/accessor/grib_accessor_class_count_file.h new file mode 100644 index 000000000..4b9a0b4f0 --- /dev/null +++ b/src/accessor/grib_accessor_class_count_file.h @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_count_file_h +#define eccodes_accessor_count_file_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_count_file_t : public grib_accessor_long_t +{ +public: + /* Members defined in count_file */ +}; + +class grib_accessor_class_count_file_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_count_file_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_count_file_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_count_file_h */ diff --git a/src/accessor/todo/grib_accessor_class_count_missing.cc b/src/accessor/grib_accessor_class_count_missing.cc similarity index 55% rename from src/accessor/todo/grib_accessor_class_count_missing.cc rename to src/accessor/grib_accessor_class_count_missing.cc index a4ed76841..f0e74d165 100644 --- a/src/accessor/todo/grib_accessor_class_count_missing.cc +++ b/src/accessor/grib_accessor_class_count_missing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,103 +10,11 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init; - IMPLEMENTS = value_count - MEMBERS = const char* bitmap - MEMBERS = const char* unusedBitsInBitmap - MEMBERS = const char* numberOfDataPoints - MEMBERS = const char* missingValueManagementUsed - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_count_missing -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in count_missing */ - const char* bitmap; - const char* unusedBitsInBitmap; - const char* numberOfDataPoints; - const char* missingValueManagementUsed; -} grib_accessor_count_missing; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_count_missing = { - &grib_accessor_class_long, /* super */ - "count_missing", /* name */ - sizeof(grib_accessor_count_missing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_count_missing.h" +grib_accessor_class_count_missing_t _grib_accessor_class_count_missing{"count_missing"}; grib_accessor_class* grib_accessor_class_count_missing = &_grib_accessor_class_count_missing; -/* END_CLASS_IMP */ static const unsigned char bitsoff[] = { 8, 7, 7, 6, 7, 6, 6, 5, 7, 6, 6, 5, 6, 5, 5, 4, 7, @@ -126,10 +35,9 @@ static const unsigned char bitsoff[] = { 0 }; -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ +void grib_accessor_class_count_missing_t::init(grib_accessor* a, const long len, grib_arguments* arg){ int n = 0; - grib_accessor_count_missing* self = (grib_accessor_count_missing*)a; + grib_accessor_count_missing_t* self = (grib_accessor_count_missing_t*)a; grib_handle* h = grib_handle_of_accessor(a); a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; @@ -141,8 +49,7 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg) static const int used[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 }; -static int get_count_of_missing_values(grib_handle* h, long* p_count_of_missing) -{ +int get_count_of_missing_values(grib_handle* h, long* p_count_of_missing){ int err = 0; long count_of_missing = 0; size_t vsize = 0, ii = 0; @@ -165,9 +72,8 @@ static int get_count_of_missing_values(grib_handle* h, long* p_count_of_missing) return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_count_missing* self = (grib_accessor_count_missing*)a; +int grib_accessor_class_count_missing_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_count_missing_t* self = (grib_accessor_count_missing_t*)a; unsigned char* p; int i; long size = 0; @@ -195,9 +101,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } - size = grib_byte_count(bitmap); - offset = grib_byte_offset(bitmap); - + size = bitmap->byte_count(); offset = bitmap->byte_offset(); if (grib_get_long(h, self->unusedBitsInBitmap, &unusedBitsInBitmap) != GRIB_SUCCESS) { if (grib_get_long(h, self->numberOfDataPoints, &numberOfDataPoints) != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to count missing values"); @@ -224,8 +128,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_count_missing_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } diff --git a/src/accessor/grib_accessor_class_count_missing.h b/src/accessor/grib_accessor_class_count_missing.h new file mode 100644 index 000000000..fbf583109 --- /dev/null +++ b/src/accessor/grib_accessor_class_count_missing.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_count_missing_h +#define eccodes_accessor_count_missing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_count_missing_t : public grib_accessor_long_t +{ +public: + /* Members defined in count_missing */ + const char* bitmap; + const char* unusedBitsInBitmap; + const char* numberOfDataPoints; + const char* missingValueManagementUsed; +}; + +class grib_accessor_class_count_missing_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_count_missing_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_count_missing_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_count_missing_h */ diff --git a/src/accessor/grib_accessor_class_count_total.cc b/src/accessor/grib_accessor_class_count_total.cc new file mode 100644 index 000000000..2c2c69c3c --- /dev/null +++ b/src/accessor/grib_accessor_class_count_total.cc @@ -0,0 +1,28 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_count_total.h" + +grib_accessor_class_count_total_t _grib_accessor_class_count_total{"count_total"}; +grib_accessor_class* grib_accessor_class_count_total = &_grib_accessor_class_count_total; + + +void grib_accessor_class_count_total_t::init(grib_accessor* a, const long l, grib_arguments* c){ + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; +} + +int grib_accessor_class_count_total_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + *val = grib_context_get_handle_total_count(a->context); + *len = 1; + return 0; +} diff --git a/src/accessor/grib_accessor_class_count_total.h b/src/accessor/grib_accessor_class_count_total.h new file mode 100644 index 000000000..ab044e8a9 --- /dev/null +++ b/src/accessor/grib_accessor_class_count_total.h @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_count_total_h +#define eccodes_accessor_count_total_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_count_total_t : public grib_accessor_long_t +{ +public: + /* Members defined in count_total */ +}; + +class grib_accessor_class_count_total_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_count_total_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_count_total_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_count_total_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_apply_bitmap.cc b/src/accessor/grib_accessor_class_data_apply_bitmap.cc similarity index 64% rename from src/accessor/todo/grib_accessor_class_data_apply_bitmap.cc rename to src/accessor/grib_accessor_class_data_apply_bitmap.cc index 675e7b3de..ac7fccc1c 100644 --- a/src/accessor/todo/grib_accessor_class_data_apply_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_apply_bitmap.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,123 +9,16 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_value.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - 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 - IMPLEMENTS = compare - MEMBERS=const char* coded_values - MEMBERS=const char* bitmap - MEMBERS=const char* missing_value - MEMBERS=const char* number_of_data_points - MEMBERS=const char* number_of_values - MEMBERS=const char* binary_scale_factor - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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*); -static int compare(grib_accessor*, grib_accessor*); -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; - -static grib_accessor_class _grib_accessor_class_data_apply_bitmap = { - &grib_accessor_class_gen, /* super */ - "data_apply_bitmap", /* name */ - sizeof(grib_accessor_data_apply_bitmap), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_api_internal.h" +#include "grib_accessor_class_data_apply_bitmap.h" +grib_accessor_class_data_apply_bitmap_t _grib_accessor_class_data_apply_bitmap{"data_apply_bitmap"}; grib_accessor_class* grib_accessor_class_data_apply_bitmap = &_grib_accessor_class_data_apply_bitmap; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ +void grib_accessor_class_data_apply_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ int n = 0; - grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; + grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; self->coded_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); @@ -135,14 +29,12 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->length = 0; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_data_apply_bitmap_t::dump(grib_accessor* a, grib_dumper* dumper){ grib_dump_values(dumper, a); } -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; +int grib_accessor_class_data_apply_bitmap_t::value_count(grib_accessor* a, long* count){ + grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; size_t len = 0; int ret = 0; @@ -156,9 +48,8 @@ static int value_count(grib_accessor* a, long* count) return ret; } -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; +int grib_accessor_class_data_apply_bitmap_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ + grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; grib_handle* gh = grib_handle_of_accessor(a); int err = 0, i = 0; size_t cidx = 0; @@ -167,8 +58,7 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) size_t n_vals = 0; long nn = 0; - err = grib_value_count(a, &nn); - n_vals = nn; + err = a->value_count(&nn); n_vals = nn; if (err) return err; @@ -203,9 +93,8 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) return grib_get_double_element_internal(gh, self->coded_values, cidx, val); } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ - grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; +int grib_accessor_class_data_apply_bitmap_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ + grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; grib_handle* gh = grib_handle_of_accessor(a); int err = 0, all_missing = 1; size_t cidx = 0; /* index into the coded_values array */ @@ -216,8 +105,7 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array size_t n_vals = 0, i = 0, j = 0, idx = 0, count_1s = 0, ci = 0; long nn = 0; - err = grib_value_count(a, &nn); - n_vals = nn; + err = a->value_count(&nn); n_vals = nn; if (err) return err; if (!grib_find_accessor(gh, self->bitmap)) @@ -283,9 +171,8 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array return GRIB_SUCCESS; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; +int grib_accessor_class_data_apply_bitmap_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; int err = 0; size_t bmaplen = *len; long coded_n_vals = 0; @@ -344,10 +231,9 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) } template -static int unpack(grib_accessor* a, T* val, size_t* len) -{ +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; + grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; size_t i = 0; size_t j = 0; @@ -358,8 +244,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) T* coded_vals = NULL; double missing_value = 0; - err = grib_value_count(a, &nn); - n_vals = nn; + err = a->value_count(&nn); n_vals = nn; if (err) return err; @@ -426,26 +311,22 @@ static int unpack(grib_accessor* a, T* val, size_t* len) return err; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_data_apply_bitmap_t::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) -{ +int grib_accessor_class_data_apply_bitmap_t::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; +int grib_accessor_class_data_apply_bitmap_t::get_native_type(grib_accessor* a){ + //grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; //return grib_accessor_get_native_type(grib_find_accessor(grib_handle_of_accessor(a),self->coded_values)); return GRIB_TYPE_DOUBLE; } -static int compare(grib_accessor* a, grib_accessor* b) -{ +int grib_accessor_class_data_apply_bitmap_t::compare(grib_accessor* a, grib_accessor* b){ int retval = GRIB_SUCCESS; double* aval = 0; double* bval = 0; @@ -455,13 +336,11 @@ static int compare(grib_accessor* a, grib_accessor* b) int err = 0; long count = 0; - err = grib_value_count(a, &count); - if (err) + err = a->value_count(&count); if (err) return err; alen = count; - err = grib_value_count(b, &count); - if (err) + err = b->value_count(&count); if (err) return err; blen = count; @@ -471,9 +350,7 @@ static int compare(grib_accessor* a, grib_accessor* b) aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - grib_unpack_double(a, aval, &alen); - grib_unpack_double(b, bval, &blen); - + a->unpack_double(aval, &alen); b->unpack_double(bval, &blen); retval = GRIB_SUCCESS; for (size_t i=0; ivalues = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); self->numberOfRows = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); @@ -130,14 +28,12 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->length = 0; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_data_apply_boustrophedonic_t::dump(grib_accessor* a, grib_dumper* dumper){ grib_dump_values(dumper, a); } -static int value_count(grib_accessor* a, long* numberOfPoints) -{ - grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a; +int grib_accessor_class_data_apply_boustrophedonic_t::value_count(grib_accessor* a, long* numberOfPoints){ + grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; int ret = 0; *numberOfPoints = 0; @@ -147,9 +43,8 @@ static int value_count(grib_accessor* a, long* numberOfPoints) } template -static int unpack(grib_accessor* a, T* val, size_t* len) -{ - grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a; +int unpack(grib_accessor* a, T* val, size_t* len){ + grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; size_t plSize = 0; long* pl = 0; @@ -242,18 +137,15 @@ static int unpack(grib_accessor* a, T* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_data_apply_boustrophedonic_t::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) -{ +int grib_accessor_class_data_apply_boustrophedonic_t::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) -{ +int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ size_t size; double* values; int err = 0; @@ -276,8 +168,7 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) return GRIB_SUCCESS; } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ +int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ size_t size = 0, i = 0; double* values; int err = 0; @@ -304,9 +195,8 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array return GRIB_SUCCESS; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a; +int grib_accessor_class_data_apply_boustrophedonic_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; size_t plSize = 0; long* pl = 0; @@ -388,7 +278,6 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return GRIB_SUCCESS; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_data_apply_boustrophedonic_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_DOUBLE; } diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h new file mode 100644 index 000000000..a0358195f --- /dev/null +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h @@ -0,0 +1,44 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_apply_boustrophedonic_h +#define eccodes_accessor_data_apply_boustrophedonic_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_data_apply_boustrophedonic_t : public grib_accessor_gen_t +{ +public: + /* Members defined in data_apply_boustrophedonic */ + const char* values; + const char* numberOfRows; + const char* numberOfColumns; + const char* numberOfPoints; + const char* pl; +}; + +class grib_accessor_class_data_apply_boustrophedonic_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_data_apply_boustrophedonic_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_apply_boustrophedonic_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_apply_boustrophedonic_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc similarity index 69% rename from src/accessor/todo/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc rename to src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc index b68e362db..217431b43 100644 --- a/src/accessor/todo/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,121 +10,15 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_data_apply_boustrophedonic_bitmap.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init - IMPLEMENTS = unpack_double;unpack_double_element;unpack_double_element_set - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - IMPLEMENTS = dump;get_native_type - MEMBERS=const char* coded_values - MEMBERS=const char* bitmap - MEMBERS=const char* missing_value - MEMBERS=const char* binary_scale_factor - MEMBERS=const char* numberOfRows - MEMBERS=const char* numberOfColumns - MEMBERS=const char* numberOfPoints - - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -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_boustrophedonic_bitmap -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in data_apply_boustrophedonic_bitmap */ - const char* coded_values; - const char* bitmap; - const char* missing_value; - const char* binary_scale_factor; - const char* numberOfRows; - const char* numberOfColumns; - const char* numberOfPoints; -} grib_accessor_data_apply_boustrophedonic_bitmap; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_data_apply_boustrophedonic_bitmap = { - &grib_accessor_class_gen, /* super */ - "data_apply_boustrophedonic_bitmap", /* name */ - sizeof(grib_accessor_data_apply_boustrophedonic_bitmap), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_data_apply_boustrophedonic_bitmap_t _grib_accessor_class_data_apply_boustrophedonic_bitmap{"data_apply_boustrophedonic_bitmap"}; grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic_bitmap = &_grib_accessor_class_data_apply_boustrophedonic_bitmap; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ +void grib_accessor_class_data_apply_boustrophedonic_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ int n = 0; - grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; + grib_accessor_data_apply_boustrophedonic_bitmap_t* self = (grib_accessor_data_apply_boustrophedonic_bitmap_t*)a; grib_handle* gh = grib_handle_of_accessor(a); self->coded_values = grib_arguments_get_name(gh, args, n++); @@ -138,14 +33,12 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->length = 0; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_data_apply_boustrophedonic_bitmap_t::dump(grib_accessor* a, grib_dumper* dumper){ grib_dump_values(dumper, a); } -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; +int grib_accessor_class_data_apply_boustrophedonic_bitmap_t::value_count(grib_accessor* a, long* count){ + grib_accessor_data_apply_boustrophedonic_bitmap_t* self = (grib_accessor_data_apply_boustrophedonic_bitmap_t*)a; grib_handle* gh = grib_handle_of_accessor(a); size_t len = 0; int ret = 0; @@ -158,9 +51,8 @@ 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_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; +int grib_accessor_class_data_apply_boustrophedonic_bitmap_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_apply_boustrophedonic_bitmap_t* self = (grib_accessor_data_apply_boustrophedonic_bitmap_t*)a; grib_handle* gh = grib_handle_of_accessor(a); size_t i = 0, j = 0, n_vals = 0, irow = 0; @@ -171,8 +63,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) double missing_value = 0; long numberOfPoints, numberOfRows, numberOfColumns; - err = grib_value_count(a, &nn); - n_vals = nn; + err = a->value_count(&nn); n_vals = nn; if (err) return err; @@ -268,9 +159,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } -static int unpack_double_element(grib_accessor* a, size_t idx, double* val) -{ - grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; +int grib_accessor_class_data_apply_boustrophedonic_bitmap_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ + grib_accessor_data_apply_boustrophedonic_bitmap_t* self = (grib_accessor_data_apply_boustrophedonic_bitmap_t*)a; grib_handle* gh = grib_handle_of_accessor(a); int err = 0, i = 0; size_t cidx = 0; @@ -279,8 +169,7 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) size_t n_vals = 0; long nn = 0; - err = grib_value_count(a, &nn); - n_vals = nn; + err = a->value_count(&nn); n_vals = nn; if (err) return err; @@ -315,9 +204,8 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) return grib_get_double_element_internal(gh, self->coded_values, cidx, val); } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ - grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; +int grib_accessor_class_data_apply_boustrophedonic_bitmap_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ + grib_accessor_data_apply_boustrophedonic_bitmap_t* self = (grib_accessor_data_apply_boustrophedonic_bitmap_t*)a; grib_handle* gh = grib_handle_of_accessor(a); int err = 0, all_missing = 1; size_t cidx = 0; /* index into the coded_values array */ @@ -328,8 +216,7 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array size_t n_vals = 0, i = 0, j = 0, idx = 0, count_1s = 0, ci = 0; long nn = 0; - err = grib_value_count(a, &nn); - n_vals = nn; + err = a->value_count(&nn); n_vals = nn; if (err) return err; if (!grib_find_accessor(gh, self->bitmap)) @@ -395,9 +282,8 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array return GRIB_SUCCESS; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; +int grib_accessor_class_data_apply_boustrophedonic_bitmap_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_apply_boustrophedonic_bitmap_t* self = (grib_accessor_data_apply_boustrophedonic_bitmap_t*)a; grib_handle* gh = grib_handle_of_accessor(a); int err = 0; size_t bmaplen = *len; @@ -495,9 +381,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return err; } -static int get_native_type(grib_accessor* a) -{ - //grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; +int grib_accessor_class_data_apply_boustrophedonic_bitmap_t::get_native_type(grib_accessor* a){ + //grib_accessor_data_apply_boustrophedonic_bitmap_t* self = (grib_accessor_data_apply_boustrophedonic_bitmap_t*)a; //return grib_accessor_get_native_type(grib_find_accessor(grib_handle_of_accessor(a),self->coded_values)); return GRIB_TYPE_DOUBLE; diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h new file mode 100644 index 000000000..e92299eab --- /dev/null +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h @@ -0,0 +1,45 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_apply_boustrophedonic_bitmap_h +#define eccodes_accessor_data_apply_boustrophedonic_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_data_apply_boustrophedonic_bitmap_t : public grib_accessor_gen_t +{ +public: + /* Members defined in data_apply_boustrophedonic_bitmap */ + const char* coded_values; + const char* bitmap; + const char* missing_value; + const char* binary_scale_factor; + const char* numberOfRows; + const char* numberOfColumns; + const char* numberOfPoints; +}; + +class grib_accessor_class_data_apply_boustrophedonic_bitmap_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_data_apply_boustrophedonic_bitmap_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_apply_boustrophedonic_bitmap_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_apply_boustrophedonic_bitmap_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_ccsds_packing.cc b/src/accessor/grib_accessor_class_data_ccsds_packing.cc similarity index 77% rename from src/accessor/todo/grib_accessor_class_data_ccsds_packing.cc rename to src/accessor/grib_accessor_class_data_ccsds_packing.cc index ccfd48c03..5158ee7fd 100644 --- a/src/accessor/todo/grib_accessor_class_data_ccsds_packing.cc +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,137 +9,16 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_bits_any_endian_simple.h" +#include "grib_api_internal.h" +#include "grib_accessor_class_data_ccsds_packing.h" #include "grib_scaling.h" -#include -#include - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - 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 - MEMBERS=const char* number_of_values - MEMBERS=const char* reference_value - MEMBERS=const char* binary_scale_factor - MEMBERS=const char* decimal_scale_factor - MEMBERS=const char* optimize_scaling_factor - MEMBERS=const char* bits_per_value - MEMBERS=const char* number_of_data_points - MEMBERS=const char* ccsds_flags - MEMBERS=const char* ccsds_block_size - MEMBERS=const char* ccsds_rsi - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 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* optimize_scaling_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 = { - &grib_accessor_class_values, /* super */ - "data_ccsds_packing", /* name */ - sizeof(grib_accessor_data_ccsds_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +grib_accessor_class_data_ccsds_packing_t _grib_accessor_class_data_ccsds_packing{"data_ccsds_packing"}; grib_accessor_class* grib_accessor_class_data_ccsds_packing = &_grib_accessor_class_data_ccsds_packing; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; +void grib_accessor_class_data_ccsds_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; grib_handle* h = grib_handle_of_accessor(a); self->number_of_values = grib_arguments_get_name(h, args, self->carg++); @@ -155,9 +35,8 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; +int grib_accessor_class_data_ccsds_packing_t::value_count(grib_accessor* a, long* count){ + grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; *count = 0; return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, count); } @@ -177,8 +56,7 @@ static bool is_big_endian() return reinterpret_cast(&endianess_test)[0] == is_big_endian; } -static void modify_aec_flags(long* flags) -{ +void modify_aec_flags(long* flags){ // ECC-1602: Performance improvement: enabled the use of native data types *flags &= ~AEC_DATA_3BYTE; // disable support for 3-bytes per value if (is_big_endian()) @@ -197,8 +75,7 @@ static const char* aec_get_error_message(int code) 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); fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.block_size=%u\n", func, strm->block_size); @@ -207,9 +84,8 @@ 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 pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; +int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; @@ -499,10 +375,9 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) } template -static int unpack(grib_accessor* a, T* val, size_t* len) -{ +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_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; @@ -530,7 +405,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) self->dirty = 0; - if ((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) + if ((err = a->value_count(&nn)) != GRIB_SUCCESS) return err; n_vals = nn; @@ -569,10 +444,8 @@ static int unpack(grib_accessor* a, T* val, size_t* len) bscale = codes_power(binary_scale_factor, 2); dscale = codes_power(-decimal_scale_factor, 10); - buflen = grib_byte_count(a); - buf = (unsigned char*)hand->buffer->data; - buf += grib_byte_offset(a); - + buflen = a->byte_count(); buf = (unsigned char*)hand->buffer->data; + buf += a->byte_offset(); strm.flags = ccsds_flags; strm.bits_per_sample = bits_per_value; strm.block_size = ccsds_block_size; @@ -637,20 +510,17 @@ static int unpack(grib_accessor* a, T* val, size_t* len) return err; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_data_ccsds_packing_t::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) -{ +int grib_accessor_class_data_ccsds_packing_t::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) -{ +int grib_accessor_class_data_ccsds_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ // The index idx relates to codedValues NOT values! - const grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; + const grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int err = 0; size_t size = 0; @@ -684,9 +554,8 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) return GRIB_SUCCESS; } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ - const grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; +int grib_accessor_class_data_ccsds_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ + const grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); size_t size = 0, i = 0; double* values = NULL; @@ -732,34 +601,28 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array #else -static void print_error_feature_not_enabled(grib_context* c) -{ +static void print_error_feature_not_enabled(grib_context* c){ grib_context_log(c, GRIB_LOG_ERROR, "CCSDS support not enabled. " "Please rebuild with -DENABLE_AEC=ON (Adaptive Entropy Coding library)"); } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ +int grib_accessor_class_data_ccsds_packing_t::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) -{ +int grib_accessor_class_data_ccsds_packing_t::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) -{ +int grib_accessor_class_data_ccsds_packing_t::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) -{ +int grib_accessor_class_data_ccsds_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ +int grib_accessor_class_data_ccsds_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.h b/src/accessor/grib_accessor_class_data_ccsds_packing.h new file mode 100644 index 000000000..2d06c6f09 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.h @@ -0,0 +1,47 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_ccsds_packing_h +#define eccodes_accessor_data_ccsds_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_values.h" + +class grib_accessor_data_ccsds_packing_t : public grib_accessor_values_t +{ +public: + /* 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* optimize_scaling_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; +}; + +class grib_accessor_class_data_ccsds_packing_t : public grib_accessor_class_values_t +{ +public: + grib_accessor_class_data_ccsds_packing_t(const char* name) : grib_accessor_class_values_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_ccsds_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_ccsds_packing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_complex_packing.cc b/src/accessor/grib_accessor_class_data_complex_packing.cc similarity index 82% rename from src/accessor/todo/grib_accessor_class_data_complex_packing.cc rename to src/accessor/grib_accessor_class_data_complex_packing.cc index 49d312611..e9c36000f 100644 --- a/src/accessor/todo/grib_accessor_class_data_complex_packing.cc +++ b/src/accessor/grib_accessor_class_data_complex_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,147 +9,20 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_ieeefloat.h" +#include "grib_api_internal.h" +#include "grib_accessor_class_data_complex_packing.h" #include "grib_scaling.h" -#include -#include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_simple_packing - IMPLEMENTS = unpack_double - IMPLEMENTS = unpack_float - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - IMPLEMENTS = init - MEMBERS= const char* GRIBEX_sh_bug_present - MEMBERS= const char* ieee_floats - MEMBERS= const char* laplacianOperatorIsSet - MEMBERS= const char* laplacianOperator - MEMBERS= const char* sub_j - MEMBERS= const char* sub_k - MEMBERS= const char* sub_m - MEMBERS= const char* pen_j - MEMBERS= const char* pen_k - MEMBERS= const char* pen_m - END_CLASS_DEF - - */ - - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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*); - -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; - -static grib_accessor_class _grib_accessor_class_data_complex_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_complex_packing", /* name */ - sizeof(grib_accessor_data_complex_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_ieeefloat.h" +grib_accessor_class_data_complex_packing_t _grib_accessor_class_data_complex_packing{"data_complex_packing"}; grib_accessor_class* grib_accessor_class_data_complex_packing = &_grib_accessor_class_data_complex_packing; -/* 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) -{ - grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; +void grib_accessor_class_data_complex_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_complex_packing_t* self = (grib_accessor_data_complex_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); self->GRIBEX_sh_bug_present = grib_arguments_get_name(gh, args, self->carg++); @@ -165,9 +39,8 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; +int grib_accessor_class_data_complex_packing_t::value_count(grib_accessor* a, long* count){ + grib_accessor_data_complex_packing_t* self = (grib_accessor_data_complex_packing_t*)a; int ret = 0; grib_handle* gh = grib_handle_of_accessor(a); long pen_j = 0; @@ -195,8 +68,7 @@ static int value_count(grib_accessor* a, long* count) return ret; } -static double calculate_pfactor(const grib_context* ctx, const double* spectralField, long fieldTruncation, long subsetTruncation) -{ +double calculate_pfactor(const grib_context* ctx, const double* spectralField, long fieldTruncation, long subsetTruncation){ /*long n_vals = ((fieldTruncation+1)*(fieldTruncation+2));*/ long loop, index, m, n = 0; double pFactor, zeps = 1.0e-15; @@ -302,9 +174,8 @@ static double calculate_pfactor(const grib_context* ctx, const double* spectralF return pFactor; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; +int grib_accessor_class_data_complex_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_complex_packing_t* self = (grib_accessor_data_complex_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; @@ -673,10 +544,9 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) template -static int unpack(grib_accessor* a, T* val, size_t* len) -{ +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_accessor_data_complex_packing_t* self = (grib_accessor_data_complex_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; @@ -724,8 +594,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) decode_float_proc decode_float = NULL; - err = grib_value_count(a, &n_vals); - if (err) + err = a->value_count(&n_vals); if (err) return err; if (*len < n_vals) { @@ -798,8 +667,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) maxv = pen_j + 1; - buf += grib_byte_offset(a); - hres = buf; + buf += a->byte_offset(); hres = buf; lres = buf; if (pen_j == sub_j) { @@ -814,8 +682,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) return 0; } - packed_offset = grib_byte_offset(a) + bytes * (sub_k + 1) * (sub_k + 2); - + packed_offset = a->byte_offset() + bytes * (sub_k + 1) * (sub_k + 2); lpos = 8 * (packed_offset - offsetdata); s = codes_power(binary_scale_factor, 2); @@ -895,13 +762,11 @@ static int unpack(grib_accessor* a, T* val, size_t* len) return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_data_complex_packing_t::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) -{ +int grib_accessor_class_data_complex_packing_t::unpack_float(grib_accessor* a, float* val, size_t* len){ // TODO(maee): See ECC-1579 // Investigate why results are not bit-identical diff --git a/src/accessor/grib_accessor_class_data_complex_packing.h b/src/accessor/grib_accessor_class_data_complex_packing.h new file mode 100644 index 000000000..2c4618865 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_complex_packing.h @@ -0,0 +1,45 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_complex_packing_h +#define eccodes_accessor_data_complex_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_complex_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* 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; +}; + +class grib_accessor_class_data_complex_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_complex_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_complex_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_dummy_field.cc b/src/accessor/grib_accessor_class_data_dummy_field.cc new file mode 100644 index 000000000..5216c2a94 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_dummy_field.cc @@ -0,0 +1,102 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_data_dummy_field.h" + +grib_accessor_class_data_dummy_field_t _grib_accessor_class_data_dummy_field{"data_dummy_field"}; +grib_accessor_class* grib_accessor_class_data_dummy_field = &_grib_accessor_class_data_dummy_field; + + +void grib_accessor_class_data_dummy_field_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_dummy_field_t* self = (grib_accessor_data_dummy_field_t*)a; + self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); +} + +int grib_accessor_class_data_dummy_field_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_dummy_field_t* self = (grib_accessor_data_dummy_field_t*)a; + size_t i = 0, n_vals = 0; + long numberOfPoints; + double missing_value = 0; + int err = 0; + + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints)) != GRIB_SUCCESS) + return err; + n_vals = numberOfPoints; + + 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; + } + + for (i = 0; i < n_vals; i++) + val[i] = missing_value; + + if (grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) { + if ((err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->bitmap, val, n_vals)) != GRIB_SUCCESS) + return err; + } + + *len = (long)n_vals; + return err; +} + +int grib_accessor_class_data_dummy_field_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_dummy_field_t* self = (grib_accessor_data_dummy_field_t*)a; + + size_t n_vals = *len; + int err = 0; + long bits_per_value = 0; + long half_byte = 0; + size_t buflen = 0; + unsigned char* buf = NULL; + + if (*len == 0) + return GRIB_NO_VALUES; + + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + + buflen = (1 + ((bits_per_value * n_vals) / 8)) * sizeof(unsigned char); + + buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen); + if (!buf) + return GRIB_OUT_OF_MEMORY; + + half_byte = (buflen * 8) - ((*len) * bits_per_value); + + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->half_byte, half_byte)) != GRIB_SUCCESS) { + grib_context_free(a->context, buf); + return err; + } + grib_buffer_replace(a, buf, buflen, 1, 1); + + grib_context_free(a->context, buf); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_data_dummy_field_t::value_count(grib_accessor* a, long* numberOfPoints){ + grib_accessor_data_dummy_field_t* self = (grib_accessor_data_dummy_field_t*)a; + int err = 0; + *numberOfPoints = 0; + + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints)) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to get count of %s (%s)", a->name, grib_get_error_message(err)); + } + + return err; +} diff --git a/src/accessor/grib_accessor_class_data_dummy_field.h b/src/accessor/grib_accessor_class_data_dummy_field.h new file mode 100644 index 000000000..00de1fe73 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_dummy_field.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_dummy_field_h +#define eccodes_accessor_data_dummy_field_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_g1simple_packing.h" + +class grib_accessor_data_dummy_field_t : public grib_accessor_data_g1simple_packing_t +{ +public: + /* Members defined in data_dummy_field */ + const char* missing_value; + const char* numberOfPoints; + const char* bitmap; +}; + +class grib_accessor_class_data_dummy_field_t : public grib_accessor_class_data_g1simple_packing_t +{ +public: + grib_accessor_class_data_dummy_field_t(const char* name) : grib_accessor_class_data_g1simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_dummy_field_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_dummy_field_h */ diff --git a/src/accessor/grib_accessor_class_data_g1complex_packing.cc b/src/accessor/grib_accessor_class_data_g1complex_packing.cc new file mode 100644 index 000000000..eecf83cfb --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1complex_packing.cc @@ -0,0 +1,112 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_data_g1complex_packing.h" + +grib_accessor_class_data_g1complex_packing_t _grib_accessor_class_data_g1complex_packing{"data_g1complex_packing"}; +grib_accessor_class* grib_accessor_class_data_g1complex_packing = &_grib_accessor_class_data_g1complex_packing; + + +void grib_accessor_class_data_g1complex_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g1complex_packing_t* self = (grib_accessor_data_g1complex_packing_t*)a; + self->half_byte = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->N = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->packingType = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->ieee_packing = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->edition = 1; + a->flags |= GRIB_ACCESSOR_FLAG_DATA; +} + +int grib_accessor_class_data_g1complex_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_g1complex_packing_t* self = (grib_accessor_data_g1complex_packing_t*)a; + int ret = GRIB_SUCCESS; + long seclen = 0; + long sub_j = 0; + long sub_k = 0; + long sub_m = 0; + long n = 0; + long half_byte = 0; + long bits_per_value = 0; + size_t buflen = 0; + + if (*len == 0) + return GRIB_NO_VALUES; + +// /* TODO: spectral_ieee does not work */ +// if (c->ieee_packing && self->ieee_packing) { +// grib_handle* h = grib_handle_of_accessor(a); +// grib_context* c = a->context; +// char* packingType_s = NULL; +// char* ieee_packing_s = NULL; +// long precision = c->ieee_packing == 32 ? 1 : 2; +// size_t lenstr = strlen(self->ieee_packing); + +// packingType_s = grib_context_strdup(c, self->packingType); +// ieee_packing_s = grib_context_strdup(c, self->ieee_packing); +// precision_s = grib_context_strdup(c, self->precision); + +// grib_set_string(h, packingType_s, ieee_packing_s, &lenstr); +// grib_set_long(h, precision_s, precision); + +// grib_context_free(c, packingType_s); +// grib_context_free(c, ieee_packing_s); +// grib_context_free(c, precision_s); +// return grib_set_double_array(h, "values", val, *len); +// } + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_j, &sub_j)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_k, &sub_k)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_m, &sub_m)) != GRIB_SUCCESS) + return ret; + + self->dirty = 1; + + Assert((sub_j == sub_k) && (sub_m == sub_j)); + + ret = grib_accessor_class_data_complex_packing_t::pack_double(a, val, len); + + if (ret == GRIB_SUCCESS) { + n = a->offset + 4 * ((sub_k + 1) * (sub_k + 2)); + + /* Octet number starts from beginning of message but shouldn't */ + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->N, n)) != GRIB_SUCCESS) + return ret; + + // ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetsection, &offsetsection); + // if (ret != GRIB_SUCCESS) + // return ret; + // if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->N, n - offsetsection)) != GRIB_SUCCESS) + // return ret; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value); + if (ret != GRIB_SUCCESS) + return ret; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->seclen, &seclen); + if (ret != GRIB_SUCCESS) + return ret; + + buflen = 32 * (sub_k + 1) * (sub_k + 2) + (*len - (sub_k + 1) * (sub_k + 2)) * bits_per_value + 18 * 8; + half_byte = seclen * 8 - buflen; + if (a->context->debug == -1) { + fprintf(stderr, "ECCODES DEBUG: half_byte=%ld\n", half_byte); + } + + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->half_byte, half_byte); + if (ret != GRIB_SUCCESS) + return ret; + } + return ret; +} diff --git a/src/accessor/grib_accessor_class_data_g1complex_packing.h b/src/accessor/grib_accessor_class_data_g1complex_packing.h new file mode 100644 index 000000000..cc6208c95 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1complex_packing.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1complex_packing_h +#define eccodes_accessor_data_g1complex_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_complex_packing.h" + +class grib_accessor_data_g1complex_packing_t : public grib_accessor_data_complex_packing_t +{ +public: + /* Members defined in data_g1complex_packing */ + const char* N; + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; +}; + +class grib_accessor_class_data_g1complex_packing_t : public grib_accessor_class_data_complex_packing_t +{ +public: + grib_accessor_class_data_g1complex_packing_t(const char* name) : grib_accessor_class_data_complex_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1complex_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g1complex_packing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_g1second_order_constant_width_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc similarity index 58% rename from src/accessor/todo/grib_accessor_class_data_g1second_order_constant_width_packing.cc rename to src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc index 079e91829..b0009cfa9 100644 --- a/src/accessor/todo/grib_accessor_class_data_g1second_order_constant_width_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,157 +9,16 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_scaling.h" #include "grib_api_internal.h" +#include "grib_accessor_class_data_g1second_order_constant_width_packing.h" +#include "grib_scaling.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_simple_packing - IMPLEMENTS = init - IMPLEMENTS = pack_double - IMPLEMENTS = unpack_double;unpack_float - IMPLEMENTS = unpack_double_element;unpack_double_element_set - IMPLEMENTS = value_count - MEMBERS=const char* half_byte - MEMBERS=const char* packingType - MEMBERS=const char* ieee_packing - MEMBERS=const char* precision - MEMBERS=const char* widthOfFirstOrderValues - MEMBERS=const char* N1 - MEMBERS=const char* N2 - MEMBERS=const char* numberOfGroups - MEMBERS=const char* numberOfSecondOrderPackedValues - MEMBERS=const char* extraValues - MEMBERS=const char* pl - MEMBERS=const char* Ni - MEMBERS=const char* Nj - MEMBERS=const char* jPointsAreConsecutive - MEMBERS=const char* bitmap - MEMBERS=const char* groupWidth - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 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_g1second_order_constant_width_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_g1second_order_constant_width_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* pl; - const char* Ni; - const char* Nj; - const char* jPointsAreConsecutive; - const char* bitmap; - const char* groupWidth; -} grib_accessor_data_g1second_order_constant_width_packing; - -extern grib_accessor_class* grib_accessor_class_data_simple_packing; - -static grib_accessor_class _grib_accessor_class_data_g1second_order_constant_width_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g1second_order_constant_width_packing", /* name */ - sizeof(grib_accessor_data_g1second_order_constant_width_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_data_g1second_order_constant_width_packing_t _grib_accessor_class_data_g1second_order_constant_width_packing{"data_g1second_order_constant_width_packing"}; grib_accessor_class* grib_accessor_class_data_g1second_order_constant_width_packing = &_grib_accessor_class_data_g1second_order_constant_width_packing; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g1second_order_constant_width_packing* self = (grib_accessor_data_g1second_order_constant_width_packing*)a; +void grib_accessor_class_data_g1second_order_constant_width_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g1second_order_constant_width_packing_t* self = (grib_accessor_data_g1second_order_constant_width_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); self->half_byte = grib_arguments_get_name(hand, args, self->carg++); @@ -181,10 +41,9 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a, long* numberOfSecondOrderPackedValues) -{ +int grib_accessor_class_data_g1second_order_constant_width_packing_t::value_count(grib_accessor* a, long* numberOfSecondOrderPackedValues){ int err = 0; - grib_accessor_data_g1second_order_constant_width_packing* self = (grib_accessor_data_g1second_order_constant_width_packing*)a; + grib_accessor_data_g1second_order_constant_width_packing_t* self = (grib_accessor_data_g1second_order_constant_width_packing_t*)a; *numberOfSecondOrderPackedValues = 0; err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, numberOfSecondOrderPackedValues); @@ -192,14 +51,12 @@ static int value_count(grib_accessor* a, long* numberOfSecondOrderPackedValues) return err; } -static int unpack_float(grib_accessor*, float* val, size_t* len) -{ +int grib_accessor_class_data_g1second_order_constant_width_packing_t::unpack_float(grib_accessor*, float* val, size_t* len){ return GRIB_NOT_IMPLEMENTED; } -static int unpack_double(grib_accessor* a, double* values, size_t* len) -{ - grib_accessor_data_g1second_order_constant_width_packing* self = (grib_accessor_data_g1second_order_constant_width_packing*)a; +int grib_accessor_class_data_g1second_order_constant_width_packing_t::unpack_double(grib_accessor* a, double* values, size_t* len){ + grib_accessor_data_g1second_order_constant_width_packing_t* self = (grib_accessor_data_g1second_order_constant_width_packing_t*)a; int ret = 0; long numberOfGroups, numberOfSecondOrderPackedValues; long groupWidth = 0; @@ -218,8 +75,7 @@ static int unpack_double(grib_accessor* a, double* values, size_t* len) long* secondaryBitmap; grib_handle* hand = grib_handle_of_accessor(a); - buf += grib_byte_offset(a); - + buf += a->byte_offset(); if ((ret = grib_get_long_internal(hand, self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) return ret; @@ -321,15 +177,13 @@ static int unpack_double(grib_accessor* a, double* values, size_t* len) return ret; } -static int pack_double(grib_accessor* a, const double* cval, size_t* len) -{ +int grib_accessor_class_data_g1second_order_constant_width_packing_t::pack_double(grib_accessor* a, const double* cval, size_t* len){ const char* cclass_name = a->cclass->name; grib_context_log(a->context, GRIB_LOG_ERROR, "%s: %s: Not implemented", cclass_name, __func__); return GRIB_NOT_IMPLEMENTED; } -static int unpack_double_element(grib_accessor* a, size_t idx, double* val) -{ +int grib_accessor_class_data_g1second_order_constant_width_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ grib_handle* hand = grib_handle_of_accessor(a); size_t size = 0; double* values = NULL; @@ -354,8 +208,7 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) return GRIB_SUCCESS; } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ +int grib_accessor_class_data_g1second_order_constant_width_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ grib_handle* hand = grib_handle_of_accessor(a); size_t size = 0, i = 0; double* values = NULL; diff --git a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h new file mode 100644 index 000000000..adfc36716 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h @@ -0,0 +1,53 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1second_order_constant_width_packing_h +#define eccodes_accessor_data_g1second_order_constant_width_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g1second_order_constant_width_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g1second_order_constant_width_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* pl; + const char* Ni; + const char* Nj; + const char* jPointsAreConsecutive; + const char* bitmap; + const char* groupWidth; +}; + +class grib_accessor_class_data_g1second_order_constant_width_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g1second_order_constant_width_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_constant_width_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_g1second_order_constant_width_packing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_g1second_order_general_extended_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc similarity index 85% rename from src/accessor/todo/grib_accessor_class_data_g1second_order_general_extended_packing.cc rename to src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc index d337dba48..5058a2102 100644 --- a/src/accessor/todo/grib_accessor_class_data_g1second_order_general_extended_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,178 +9,13 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_scaling.h" #include "grib_api_internal.h" -#include "grib_optimize_decimal_factor.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_simple_packing - IMPLEMENTS = init - IMPLEMENTS = pack_double - IMPLEMENTS = unpack_double;unpack_float - IMPLEMENTS = unpack_double_element;unpack_double_element_set - IMPLEMENTS = value_count - IMPLEMENTS = destroy - MEMBERS=const char* half_byte - MEMBERS=const char* packingType - MEMBERS=const char* ieee_packing - MEMBERS=const char* precision - MEMBERS=const char* widthOfFirstOrderValues - MEMBERS=const char* firstOrderValues - MEMBERS=const char* N1 - MEMBERS=const char* N2 - MEMBERS=const char* numberOfGroups - MEMBERS=const char* codedNumberOfGroups - MEMBERS=const char* numberOfSecondOrderPackedValues - MEMBERS=const char* extraValues - MEMBERS=const char* groupWidths - MEMBERS=const char* widthOfWidths - MEMBERS=const char* groupLengths - MEMBERS=const char* widthOfLengths - MEMBERS=const char* NL - MEMBERS=const char* SPD - MEMBERS=const char* widthOfSPD - MEMBERS=const char* orderOfSPD - MEMBERS=const char* numberOfPoints - MEMBERS=const char* dataFlag - MEMBERS=double* dvalues - MEMBERS=float* fvalues - MEMBERS=int double_dirty - MEMBERS=int float_dirty - MEMBERS=size_t size - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 destroy(grib_context*, grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); -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_g1second_order_general_extended_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_g1second_order_general_extended_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* firstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* codedNumberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* groupWidths; - const char* widthOfWidths; - const char* groupLengths; - const char* widthOfLengths; - const char* NL; - const char* SPD; - const char* widthOfSPD; - const char* orderOfSPD; - const char* numberOfPoints; - const char* dataFlag; - double* dvalues; - float* fvalues; - int double_dirty; - int float_dirty; - size_t size; -} grib_accessor_data_g1second_order_general_extended_packing; - -extern grib_accessor_class* grib_accessor_class_data_simple_packing; - -static grib_accessor_class _grib_accessor_class_data_g1second_order_general_extended_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g1second_order_general_extended_packing", /* name */ - sizeof(grib_accessor_data_g1second_order_general_extended_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_data_g1second_order_general_extended_packing.h" +#include "grib_scaling.h" +grib_accessor_class_data_g1second_order_general_extended_packing_t _grib_accessor_class_data_g1second_order_general_extended_packing{"data_g1second_order_general_extended_packing"}; grib_accessor_class* grib_accessor_class_data_g1second_order_general_extended_packing = &_grib_accessor_class_data_g1second_order_general_extended_packing; -/* END_CLASS_IMP */ #define MAX_NUMBER_OF_GROUPS 65534 #define EFDEBUG 0 @@ -203,8 +39,7 @@ static const unsigned long nbits[64] = { 0x1000000000000000, 0x2000000000000000, 0x4000000000000000, 0x8000000000000000 }; -static long number_of_bits(grib_handle* h, unsigned long x) -{ +long number_of_bits(grib_handle* h, unsigned long x){ const unsigned long* n = nbits; const int count = sizeof(nbits) / sizeof(nbits[0]); long i = 0; @@ -220,9 +55,8 @@ static long number_of_bits(grib_handle* h, unsigned long x) return i; } -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; +void grib_accessor_class_data_g1second_order_general_extended_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; grib_handle* handle = grib_handle_of_accessor(a); self->half_byte = grib_arguments_get_name(handle, args, self->carg++); @@ -256,9 +90,8 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; +int grib_accessor_class_data_g1second_order_general_extended_packing_t::value_count(grib_accessor* a, long* count){ + grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; long numberOfCodedValues = 0; long numberOfGroups = 0; size_t ngroups; @@ -293,8 +126,7 @@ static int value_count(grib_accessor* a, long* count) return err; } -static int unpack_double_element(grib_accessor* a, size_t idx, double* val) -{ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ size_t size; double* values; int err = 0; @@ -317,8 +149,7 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) return GRIB_SUCCESS; } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ size_t size = 0, i = 0; double* values; int err = 0; @@ -345,9 +176,8 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array return GRIB_SUCCESS; } -static int unpack(grib_accessor* a, double* dvalues, float* fvalues, size_t* len) -{ - grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; +int unpack(grib_accessor* a, double* dvalues, float* fvalues, size_t* len){ + grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; int ret = 0; long numberOfGroups, numberOfSecondOrderPackedValues; long* firstOrderValues = 0; @@ -396,8 +226,9 @@ static int unpack(grib_accessor* a, double* dvalues, float* fvalues, size_t* len self->float_dirty = 0; } - buf += grib_byte_offset(a); - ret = value_count(a, &numberOfValues); + buf += a->byte_offset(); + ret = a->value_count(&numberOfValues); + if (ret) return ret; @@ -565,13 +396,11 @@ static int unpack(grib_accessor* a, double* dvalues, float* fvalues, size_t* len return ret; } -static int unpack_float(grib_accessor* a, float* values, size_t* len) -{ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_float(grib_accessor* a, float* values, size_t* len){ return unpack(a, NULL, values, len); } -static int unpack_double(grib_accessor* a, double* values, size_t* len) -{ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_double(grib_accessor* a, double* values, size_t* len){ return unpack(a, values, NULL, len); } @@ -684,8 +513,7 @@ static void grib_split_long_groups(grib_handle* hand, grib_context* c, long* num grib_context_free(c, localFirstOrderValues); } -static int get_bits_per_value(grib_handle* h, const char* bits_per_value_str, long* bits_per_value) -{ +int get_bits_per_value(grib_handle* h, const char* bits_per_value_str, long* bits_per_value){ int err = 0; if ((err = grib_get_long_internal(h, bits_per_value_str, bits_per_value)) != GRIB_SUCCESS) return err; @@ -708,9 +536,8 @@ static int get_bits_per_value(grib_handle* h, const char* bits_per_value_str, lo // For the old implementation of pack_double, see // src/deprecated/grib_accessor_class_data_g1second_order_general_extended_packing.pack_double.cc // See ECC-441 and ECC-261 -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; +int grib_accessor_class_data_g1second_order_general_extended_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; int ret = 0; int grib2 = 0; long bits_per_value, orderOfSPD, binary_scale_factor; @@ -1365,9 +1192,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return GRIB_SUCCESS; } -static void destroy(grib_context* context, grib_accessor* a) -{ - grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; +void grib_accessor_class_data_g1second_order_general_extended_packing_t::destroy(grib_context* context, grib_accessor* a){ + grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; if (self->dvalues != NULL) { grib_context_free(context, self->dvalues); self->dvalues = NULL; diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h new file mode 100644 index 000000000..a870edcf6 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h @@ -0,0 +1,65 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1second_order_general_extended_packing_h +#define eccodes_accessor_data_g1second_order_general_extended_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g1second_order_general_extended_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g1second_order_general_extended_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* firstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* codedNumberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* groupWidths; + const char* widthOfWidths; + const char* groupLengths; + const char* widthOfLengths; + const char* NL; + const char* SPD; + const char* widthOfSPD; + const char* orderOfSPD; + const char* numberOfPoints; + const char* dataFlag; + double* dvalues; + float* fvalues; + int double_dirty; + int float_dirty; + size_t size; +}; + +class grib_accessor_class_data_g1second_order_general_extended_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g1second_order_general_extended_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_general_extended_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_g1second_order_general_extended_packing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_g1second_order_general_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc similarity index 55% rename from src/accessor/todo/grib_accessor_class_data_g1second_order_general_packing.cc rename to src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc index 3e41fd3e0..e9d620f52 100644 --- a/src/accessor/todo/grib_accessor_class_data_g1second_order_general_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,156 +9,16 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_scaling.h" #include "grib_api_internal.h" -#include - - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_simple_packing - IMPLEMENTS = init - IMPLEMENTS = pack_double - IMPLEMENTS = unpack_double;unpack_float - IMPLEMENTS = value_count - MEMBERS=const char* half_byte - MEMBERS=const char* packingType - MEMBERS=const char* ieee_packing - MEMBERS=const char* precision - MEMBERS=const char* widthOfFirstOrderValues - MEMBERS=const char* N1 - MEMBERS=const char* N2 - MEMBERS=const char* numberOfGroups - MEMBERS=const char* numberOfSecondOrderPackedValues - MEMBERS=const char* extraValues - MEMBERS=const char* pl - MEMBERS=const char* Ni - MEMBERS=const char* Nj - MEMBERS=const char* jPointsAreConsecutive - MEMBERS=const char* bitmap - MEMBERS=const char* groupWidths - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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*); - -typedef struct grib_accessor_data_g1second_order_general_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_g1second_order_general_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* pl; - const char* Ni; - const char* Nj; - const char* jPointsAreConsecutive; - const char* bitmap; - const char* groupWidths; -} grib_accessor_data_g1second_order_general_packing; - -extern grib_accessor_class* grib_accessor_class_data_simple_packing; - -static grib_accessor_class _grib_accessor_class_data_g1second_order_general_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g1second_order_general_packing", /* name */ - sizeof(grib_accessor_data_g1second_order_general_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_data_g1second_order_general_packing.h" +#include "grib_scaling.h" +grib_accessor_class_data_g1second_order_general_packing_t _grib_accessor_class_data_g1second_order_general_packing{"data_g1second_order_general_packing"}; grib_accessor_class* grib_accessor_class_data_g1second_order_general_packing = &_grib_accessor_class_data_g1second_order_general_packing; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g1second_order_general_packing* self = (grib_accessor_data_g1second_order_general_packing*)a; +void grib_accessor_class_data_g1second_order_general_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g1second_order_general_packing_t* self = (grib_accessor_data_g1second_order_general_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); self->half_byte = grib_arguments_get_name(hand, args, self->carg++); @@ -180,10 +41,9 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a, long* numberOfSecondOrderPackedValues) -{ +int grib_accessor_class_data_g1second_order_general_packing_t::value_count(grib_accessor* a, long* numberOfSecondOrderPackedValues){ int err = 0; - grib_accessor_data_g1second_order_general_packing* self = (grib_accessor_data_g1second_order_general_packing*)a; + grib_accessor_data_g1second_order_general_packing_t* self = (grib_accessor_data_g1second_order_general_packing_t*)a; *numberOfSecondOrderPackedValues = 0; err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, numberOfSecondOrderPackedValues); @@ -192,10 +52,9 @@ static int value_count(grib_accessor* a, long* numberOfSecondOrderPackedValues) } template -static int unpack(grib_accessor* a, T* values, size_t* len) -{ +int unpack(grib_accessor* a, T* values, size_t* len){ static_assert(std::is_floating_point::value, "Requires floating point numbers"); - grib_accessor_data_g1second_order_general_packing* self = (grib_accessor_data_g1second_order_general_packing*)a; + grib_accessor_data_g1second_order_general_packing_t* self = (grib_accessor_data_g1second_order_general_packing_t*)a; int ret = 0; long numberOfGroups, numberOfSecondOrderPackedValues; long* groupWidths = 0; @@ -213,8 +72,7 @@ static int unpack(grib_accessor* a, T* values, size_t* len) long groupLength, j; size_t groupWidthsSize; - buf += grib_byte_offset(a); - + buf += a->byte_offset(); if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) return ret; @@ -296,18 +154,15 @@ static int unpack(grib_accessor* a, T* values, size_t* len) return ret; } -static int unpack_float(grib_accessor* a, float* values, size_t* len) -{ +int grib_accessor_class_data_g1second_order_general_packing_t::unpack_float(grib_accessor* a, float* values, size_t* len){ return unpack(a, values, len); } -static int unpack_double(grib_accessor* a, double* values, size_t* len) -{ +int grib_accessor_class_data_g1second_order_general_packing_t::unpack_double(grib_accessor* a, double* values, size_t* len){ return unpack(a, values, len); } -static int pack_double(grib_accessor* a, const double* cval, size_t* len) -{ +int grib_accessor_class_data_g1second_order_general_packing_t::pack_double(grib_accessor* a, const double* cval, size_t* len){ /* return GRIB_NOT_IMPLEMENTED; */ int err = 0; char type[] = "grid_second_order"; diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h new file mode 100644 index 000000000..5161324f0 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h @@ -0,0 +1,51 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1second_order_general_packing_h +#define eccodes_accessor_data_g1second_order_general_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g1second_order_general_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g1second_order_general_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* pl; + const char* Ni; + const char* Nj; + const char* jPointsAreConsecutive; + const char* bitmap; + const char* groupWidths; +}; + +class grib_accessor_class_data_g1second_order_general_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g1second_order_general_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_general_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g1second_order_general_packing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_g1second_order_row_by_row_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc similarity index 64% rename from src/accessor/todo/grib_accessor_class_data_g1second_order_row_by_row_packing.cc rename to src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc index b801b3b1c..10dc06079 100644 --- a/src/accessor/todo/grib_accessor_class_data_g1second_order_row_by_row_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,154 +9,16 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_scaling.h" #include "grib_api_internal.h" +#include "grib_accessor_class_data_g1second_order_row_by_row_packing.h" +#include "grib_scaling.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_simple_packing - IMPLEMENTS = init - IMPLEMENTS = pack_double - IMPLEMENTS = unpack_double;unpack_float - IMPLEMENTS = value_count - MEMBERS=const char* half_byte - MEMBERS=const char* packingType - MEMBERS=const char* ieee_packing - MEMBERS=const char* precision - MEMBERS=const char* widthOfFirstOrderValues - MEMBERS=const char* N1 - MEMBERS=const char* N2 - MEMBERS=const char* numberOfGroups - MEMBERS=const char* numberOfSecondOrderPackedValues - MEMBERS=const char* extraValues - MEMBERS=const char* pl - MEMBERS=const char* Ni - MEMBERS=const char* Nj - MEMBERS=const char* jPointsAreConsecutive - MEMBERS=const char* bitmap - MEMBERS=const char* groupWidths - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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*); - -typedef struct grib_accessor_data_g1second_order_row_by_row_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_g1second_order_row_by_row_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* pl; - const char* Ni; - const char* Nj; - const char* jPointsAreConsecutive; - const char* bitmap; - const char* groupWidths; -} grib_accessor_data_g1second_order_row_by_row_packing; - -extern grib_accessor_class* grib_accessor_class_data_simple_packing; - -static grib_accessor_class _grib_accessor_class_data_g1second_order_row_by_row_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g1second_order_row_by_row_packing", /* name */ - sizeof(grib_accessor_data_g1second_order_row_by_row_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_data_g1second_order_row_by_row_packing_t _grib_accessor_class_data_g1second_order_row_by_row_packing{"data_g1second_order_row_by_row_packing"}; grib_accessor_class* grib_accessor_class_data_g1second_order_row_by_row_packing = &_grib_accessor_class_data_g1second_order_row_by_row_packing; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g1second_order_row_by_row_packing* self = (grib_accessor_data_g1second_order_row_by_row_packing*)a; +void grib_accessor_class_data_g1second_order_row_by_row_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g1second_order_row_by_row_packing_t* self = (grib_accessor_data_g1second_order_row_by_row_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); self->half_byte = grib_arguments_get_name(gh, args, self->carg++); @@ -178,9 +41,8 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_data_g1second_order_row_by_row_packing* self = (grib_accessor_data_g1second_order_row_by_row_packing*)a; +int grib_accessor_class_data_g1second_order_row_by_row_packing_t::value_count(grib_accessor* a, long* count){ + grib_accessor_data_g1second_order_row_by_row_packing_t* self = (grib_accessor_data_g1second_order_row_by_row_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); long n = 0, i = 0; long numberOfRows = 0; @@ -254,9 +116,8 @@ static int value_count(grib_accessor* a, long* count) } template -static int unpack(grib_accessor* a, T* values, size_t* len) -{ - grib_accessor_data_g1second_order_row_by_row_packing* self = (grib_accessor_data_g1second_order_row_by_row_packing*)a; +int unpack(grib_accessor* a, T* values, size_t* len){ + grib_accessor_data_g1second_order_row_by_row_packing_t* self = (grib_accessor_data_g1second_order_row_by_row_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); int ret = 0; long numberOfGroups, numberOfSecondOrderPackedValues; @@ -279,8 +140,7 @@ static int unpack(grib_accessor* a, T* values, size_t* len) size_t plSize = 0; long* pl = 0; - buf += grib_byte_offset(a); - + buf += a->byte_offset(); if ((ret = grib_get_long_internal(gh, self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) return ret; @@ -421,18 +281,15 @@ static int unpack(grib_accessor* a, T* values, size_t* len) return ret; } -static int unpack_float(grib_accessor* a, float* values, size_t* len) -{ +int grib_accessor_class_data_g1second_order_row_by_row_packing_t::unpack_float(grib_accessor* a, float* values, size_t* len){ return unpack(a, values, len); } -static int unpack_double(grib_accessor* a, double* values, size_t* len) -{ +int grib_accessor_class_data_g1second_order_row_by_row_packing_t::unpack_double(grib_accessor* a, double* values, size_t* len){ return unpack(a, values, len); } -static int pack_double(grib_accessor* a, const double* cval, size_t* len) -{ +int grib_accessor_class_data_g1second_order_row_by_row_packing_t::pack_double(grib_accessor* a, const double* cval, size_t* len){ int err = 0; grib_handle* gh = grib_handle_of_accessor(a); char type[] = "grid_second_order"; diff --git a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h new file mode 100644 index 000000000..1e9c27f39 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h @@ -0,0 +1,51 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1second_order_row_by_row_packing_h +#define eccodes_accessor_data_g1second_order_row_by_row_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g1second_order_row_by_row_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g1second_order_row_by_row_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* pl; + const char* Ni; + const char* Nj; + const char* jPointsAreConsecutive; + const char* bitmap; + const char* groupWidths; +}; + +class grib_accessor_class_data_g1second_order_row_by_row_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g1second_order_row_by_row_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_row_by_row_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g1second_order_row_by_row_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc new file mode 100644 index 000000000..cbabc9cf1 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc @@ -0,0 +1,128 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_data_g1secondary_bitmap.h" + +grib_accessor_class_data_g1secondary_bitmap_t _grib_accessor_class_data_g1secondary_bitmap{"data_g1secondary_bitmap"}; +grib_accessor_class* grib_accessor_class_data_g1secondary_bitmap = &_grib_accessor_class_data_g1secondary_bitmap; + + +void grib_accessor_class_data_g1secondary_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g1secondary_bitmap_t* self = (grib_accessor_data_g1secondary_bitmap_t*)a; + self->number_of_ones = grib_arguments_get_name(grib_handle_of_accessor(a), args, 4); +} + +int grib_accessor_class_data_g1secondary_bitmap_t::value_count(grib_accessor* a, long* count){ + grib_accessor_data_g1secondary_bitmap_t* self = (grib_accessor_data_g1secondary_bitmap_t*)a; + size_t len = 0; + int err = 0; + long expand_by; + *count = 0; + + err = grib_get_long_internal(grib_handle_of_accessor(a), self->expand_by, &expand_by); + if (err) + return err; + + err = grib_get_size(grib_handle_of_accessor(a), self->primary_bitmap, &len); + if (err) + return err; + + *count = expand_by * len; + return GRIB_SUCCESS; +} + +int grib_accessor_class_data_g1secondary_bitmap_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_g1secondary_bitmap_t* self = (grib_accessor_data_g1secondary_bitmap_t*)a; + + int err = 0; + + long primary_len = 0; + long secondary_len = 0; + double* primary_bitmap = NULL; + double* secondary_bitmap = NULL; + long i = 0; + long j = 0; + long on = 0; + long k; + long m; + double missing_value = 0; + double present_value = 0; + long expand_by = 0; + + if (*len == 0) + return GRIB_NO_VALUES; + + if ((err = grib_get_long(grib_handle_of_accessor(a), self->expand_by, &expand_by)) != GRIB_SUCCESS) + return err; + if (expand_by <= 0) + return GRIB_ENCODING_ERROR; + + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) + return err; + + if (*len % expand_by) { + /*TODO: issue warning */ + return GRIB_ENCODING_ERROR; + } + + primary_len = *len / expand_by; + primary_bitmap = (double*)grib_context_malloc_clear(a->context, primary_len * sizeof(double)); + if (!primary_bitmap) + return GRIB_OUT_OF_MEMORY; + + secondary_len = *len; + secondary_bitmap = (double*)grib_context_malloc_clear(a->context, secondary_len * sizeof(double)); + if (!secondary_bitmap) { + grib_context_free(a->context, primary_bitmap); + return GRIB_OUT_OF_MEMORY; + } + + if (missing_value == 0) + present_value = 1; + else + present_value = 0; + + k = 0; + m = 0; + for (i = 0; i < *len; i += expand_by) { + int cnt = 0; + for (j = 0; j < expand_by; j++) + if (val[i + j] == missing_value) + cnt++; + + if (cnt == expand_by) /* all expand_by values are missing */ + primary_bitmap[k++] = missing_value; + else { + primary_bitmap[k++] = present_value; + for (j = 0; j < expand_by; j++) + secondary_bitmap[m++] = val[i + j]; + on++; + } + } + + *len = k; + + /*printf("QQQQQQQ %ld %ld second=%ld\n",primary_len,on,m);*/ + Assert(k == primary_len); + + err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->primary_bitmap, primary_bitmap, k); + if (err == GRIB_SUCCESS) + err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->secondary_bitmap, secondary_bitmap, m); + + grib_context_free(a->context, primary_bitmap); + grib_context_free(a->context, secondary_bitmap); + + if (err == GRIB_SUCCESS) + err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_ones, on); + + return err; +} diff --git a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h new file mode 100644 index 000000000..e963d6f44 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1secondary_bitmap_h +#define eccodes_accessor_data_g1secondary_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_secondary_bitmap.h" + +class grib_accessor_data_g1secondary_bitmap_t : public grib_accessor_data_secondary_bitmap_t +{ +public: + /* Members defined in data_g1secondary_bitmap */ + const char* number_of_ones; +}; + +class grib_accessor_class_data_g1secondary_bitmap_t : public grib_accessor_class_data_secondary_bitmap_t +{ +public: + grib_accessor_class_data_g1secondary_bitmap_t(const char* name) : grib_accessor_class_data_secondary_bitmap_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1secondary_bitmap_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g1secondary_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_g1shsimple_packing.cc b/src/accessor/grib_accessor_class_data_g1shsimple_packing.cc new file mode 100644 index 000000000..d6a8a6562 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1shsimple_packing.cc @@ -0,0 +1,64 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_data_g1shsimple_packing.h" + +grib_accessor_class_data_g1shsimple_packing_t _grib_accessor_class_data_g1shsimple_packing{"data_g1shsimple_packing"}; +grib_accessor_class* grib_accessor_class_data_g1shsimple_packing = &_grib_accessor_class_data_g1shsimple_packing; + + + +int grib_accessor_class_data_g1shsimple_packing_t::value_count(grib_accessor* a, long* count){ + grib_accessor_data_g1shsimple_packing_t* self = (grib_accessor_data_g1shsimple_packing_t*)a; + size_t len = 0; + int err = 0; + + err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &len); + len += 1; + + *count = len; + return err; +} + +int grib_accessor_class_data_g1shsimple_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_g1shsimple_packing_t* self = (grib_accessor_data_g1shsimple_packing_t*)a; + int err = GRIB_SUCCESS; + + size_t coded_n_vals = 0; + size_t n_vals = 0; + + if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &coded_n_vals)) != GRIB_SUCCESS) + return err; + + n_vals = coded_n_vals + 1; + + if (*len < n_vals) { + *len = n_vals; + return GRIB_ARRAY_TOO_SMALL; + } + + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->real_part, val)) != GRIB_SUCCESS) + return err; + + val++; + + if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, &coded_n_vals)) != GRIB_SUCCESS) + return err; + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "grib_accessor_data_g1shsimple_packing_t_bitmap : unpack_double : creating %s, %d values", + a->name, n_vals); + + *len = n_vals; + + return err; +} diff --git a/src/accessor/grib_accessor_class_data_g1shsimple_packing.h b/src/accessor/grib_accessor_class_data_g1shsimple_packing.h new file mode 100644 index 000000000..0c8efffa1 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1shsimple_packing.h @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1shsimple_packing_h +#define eccodes_accessor_data_g1shsimple_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_shsimple_packing.h" + +class grib_accessor_data_g1shsimple_packing_t : public grib_accessor_data_shsimple_packing_t +{ +public: + /* Members defined in data_g1shsimple_packing */ +}; + +class grib_accessor_class_data_g1shsimple_packing_t : public grib_accessor_class_data_shsimple_packing_t +{ +public: + grib_accessor_class_data_g1shsimple_packing_t(const char* name) : grib_accessor_class_data_shsimple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1shsimple_packing_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; +}; +#endif /* eccodes_accessor_data_g1shsimple_packing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_g1simple_packing.cc b/src/accessor/grib_accessor_class_data_g1simple_packing.cc similarity index 64% rename from src/accessor/todo/grib_accessor_class_data_g1simple_packing.cc rename to src/accessor/grib_accessor_class_data_g1simple_packing.cc index cc810e4ae..a3320a810 100644 --- a/src/accessor/todo/grib_accessor_class_data_g1simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1simple_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,126 +9,16 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_scaling.h" #include "grib_api_internal.h" +#include "grib_accessor_class_data_g1simple_packing.h" +#include "grib_scaling.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_simple_packing - IMPLEMENTS = init - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - MEMBERS=const char* half_byte - MEMBERS=const char* packingType - MEMBERS=const char* ieee_packing - MEMBERS=const char* precision - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_data_g1simple_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_g1simple_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; -} grib_accessor_data_g1simple_packing; - -extern grib_accessor_class* grib_accessor_class_data_simple_packing; - -static grib_accessor_class _grib_accessor_class_data_g1simple_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g1simple_packing", /* name */ - sizeof(grib_accessor_data_g1simple_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_data_g1simple_packing_t _grib_accessor_class_data_g1simple_packing{"data_g1simple_packing"}; grib_accessor_class* grib_accessor_class_data_g1simple_packing = &_grib_accessor_class_data_g1simple_packing; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g1simple_packing* self = (grib_accessor_data_g1simple_packing*)a; +void grib_accessor_class_data_g1simple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g1simple_packing_t* self = (grib_accessor_data_g1simple_packing_t*)a; self->half_byte = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); self->packingType = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); @@ -137,9 +28,8 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a, long* number_of_values) -{ - grib_accessor_data_g1simple_packing* self = (grib_accessor_data_g1simple_packing*)a; +int grib_accessor_class_data_g1simple_packing_t::value_count(grib_accessor* a, long* number_of_values){ + grib_accessor_data_g1simple_packing_t* self = (grib_accessor_data_g1simple_packing_t*)a; *number_of_values = 0; /* Special case for when values are cleared */ @@ -149,10 +39,8 @@ static int value_count(grib_accessor* a, long* number_of_values) return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, number_of_values); } -static int pack_double(grib_accessor* a, const double* cval, size_t* len) -{ - grib_accessor_data_g1simple_packing* self = (grib_accessor_data_g1simple_packing*)a; - grib_accessor_class* super = *(a->cclass->super); +int grib_accessor_class_data_g1simple_packing_t::pack_double(grib_accessor* a, const double* cval, size_t* len){ + grib_accessor_data_g1simple_packing_t* self = (grib_accessor_data_g1simple_packing_t*)a; size_t n_vals = *len; long half_byte = 0; @@ -234,7 +122,7 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) } } - ret = super->pack_double(a, val, len); + ret = grib_accessor_class_data_simple_packing_t::pack_double(a, val, len); switch (ret) { case GRIB_CONSTANT_FIELD: ret = grib_get_long(grib_handle_of_accessor(a), "constantFieldHalfByte", &constantFieldHalfByte); @@ -319,7 +207,7 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) grib_encode_double_array(n_vals, val, bits_per_value, reference_value, decimal, divisor, encoded, &off); grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_data_g1simple_packing : pack_double : packing %s, %d values", a->name, n_vals); + "grib_accessor_data_g1simple_packing_t : pack_double : packing %s, %d values", a->name, n_vals); ret = grib_buffer_replace(a, buf, buflen, 1, 1); if (ret != GRIB_SUCCESS) return ret; diff --git a/src/accessor/grib_accessor_class_data_g1simple_packing.h b/src/accessor/grib_accessor_class_data_g1simple_packing.h new file mode 100644 index 000000000..3a351d17f --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1simple_packing.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1simple_packing_h +#define eccodes_accessor_data_g1simple_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g1simple_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g1simple_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; +}; + +class grib_accessor_class_data_g1simple_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g1simple_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1simple_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g1simple_packing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_g22order_packing.cc b/src/accessor/grib_accessor_class_data_g22order_packing.cc similarity index 88% rename from src/accessor/todo/grib_accessor_class_data_g22order_packing.cc rename to src/accessor/grib_accessor_class_data_g22order_packing.cc index 4ed535d29..e8e9aed36 100644 --- a/src/accessor/todo/grib_accessor_class_data_g22order_packing.cc +++ b/src/accessor/grib_accessor_class_data_g22order_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,157 +9,16 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ - -#include "grib_scaling.h" #include "grib_api_internal.h" -#include - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - 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 - MEMBERS=const char* numberOfValues - MEMBERS=const char* bits_per_value - MEMBERS=const char* reference_value - MEMBERS=const char* binary_scale_factor - MEMBERS=const char* decimal_scale_factor - MEMBERS=const char* optimize_scale_factor - MEMBERS=const char* typeOfOriginalFieldValues - MEMBERS=const char* groupSplittingMethodUsed - MEMBERS=const char* missingValueManagementUsed - MEMBERS=const char* primaryMissingValueSubstitute - MEMBERS=const char* secondaryMissingValueSubstitute - MEMBERS=const char* numberOfGroupsOfDataValues - MEMBERS=const char* referenceForGroupWidths - MEMBERS=const char* numberOfBitsUsedForTheGroupWidths - MEMBERS=const char* referenceForGroupLengths - MEMBERS=const char* lengthIncrementForTheGroupLengths - MEMBERS=const char* trueLengthOfLastGroup - MEMBERS=const char* numberOfBitsUsedForTheScaledGroupLengths - MEMBERS=const char* orderOfSpatialDifferencing - MEMBERS=const char* numberOfOctetsExtraDescriptors - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 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* optimize_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; - -static grib_accessor_class _grib_accessor_class_data_g22order_packing = { - &grib_accessor_class_values, /* super */ - "data_g22order_packing", /* name */ - sizeof(grib_accessor_data_g22order_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_data_g22order_packing.h" +#include "../grib_scaling.h" +grib_accessor_class_data_g22order_packing_t _grib_accessor_class_data_g22order_packing{"data_g22order_packing"}; grib_accessor_class* grib_accessor_class_data_g22order_packing = &_grib_accessor_class_data_g22order_packing; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g22order_packing* self = reinterpret_cast(a); +void grib_accessor_class_data_g22order_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); grib_handle* gh = grib_handle_of_accessor(a); self->numberOfValues = grib_arguments_get_name(gh, args, self->carg++); @@ -206,14 +66,12 @@ struct bitstream_context { int n_bitstream; }; -static void init_bitstream(bitstream_context *ctx, unsigned char* new_bitstream) -{ +void init_bitstream(bitstream_context *ctx, unsigned char* new_bitstream){ ctx->bitstream = new_bitstream; ctx->n_bitstream = ctx->reg = ctx->rbits = 0; } -static void finish_bitstream(bitstream_context *ctx) -{ +void finish_bitstream(bitstream_context *ctx){ if (ctx->rbits) { ctx->n_bitstream++; *ctx->bitstream++ = (ctx->reg << (8 - ctx->rbits)) & 255; @@ -221,8 +79,7 @@ static void finish_bitstream(bitstream_context *ctx) } } -static void add_many_bitstream(bitstream_context *ctx, grib_accessor* a, int* t, int n, int n_bits) -{ +void add_many_bitstream(bitstream_context *ctx, grib_accessor* a, int* t, int n, int n_bits){ unsigned int jmask; int i; const int max_numbits = 25; @@ -245,8 +102,7 @@ static void add_many_bitstream(bitstream_context *ctx, grib_accessor* a, int* t, } } -static void add_bitstream(bitstream_context *ctx, grib_accessor* a, int t, int n_bits) -{ +void add_bitstream(bitstream_context *ctx, grib_accessor* a, int t, int n_bits){ unsigned int jmask; const int max_numbits = 25; @@ -270,8 +126,7 @@ static void add_bitstream(bitstream_context *ctx, grib_accessor* a, int t, int n // find min/max of an integer array // return 0: if min max found // return 1: if min max not found, min = max = 0 -static int int_min_max_array(int* data, unsigned int n, int* min, int* max) -{ +int int_min_max_array(int* data, unsigned int n, int* min, int* max){ unsigned int first; int mn, mx; @@ -312,8 +167,7 @@ static int int_min_max_array(int* data, unsigned int n, int* min, int* max) return 0; } -static double Int_Power(double x, int y) -{ +double Int_Power(double x, int y){ double value; if (y < 0) { @@ -332,8 +186,7 @@ static double Int_Power(double x, int y) return value; } -static int min_max_array(double* data, unsigned int n, double* min, double* max) -{ +int min_max_array(double* data, unsigned int n, double* min, double* max){ unsigned int first; double mn, mx; @@ -445,8 +298,7 @@ static int min_max_array(double* data, unsigned int n, double* min, double* max) // return bms; // } -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 = 0, j = 0; Assert(order > 0); Assert(order <= 3); @@ -507,10 +359,9 @@ static int post_process(grib_context* c, long* vals, long len, long order, long } template -static int unpack(grib_accessor* a, T* val, const size_t* len) -{ +int unpack(grib_accessor* a, T* val, const size_t* len){ static_assert(std::is_floating_point::value, "Requires floating points numbers"); - grib_accessor_data_g22order_packing* self = reinterpret_cast(a); + grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); const char* cclass_name = a->cclass->name; grib_handle* gh = grib_handle_of_accessor(a); @@ -557,8 +408,7 @@ static int unpack(grib_accessor* a, T* val, const size_t* len) long numberOfOctetsExtraDescriptors = 0; double missingValue = 0; - err = grib_value_count(a, &n_vals); - if (err) + err = a->value_count(&n_vals); if (err) return err; if (*len < static_cast(n_vals)) @@ -755,8 +605,7 @@ static int unpack(grib_accessor* a, T* val, const size_t* len) return err; } -static int find_nbits(unsigned int i) -{ +int find_nbits(unsigned int i){ #if !defined __GNUC__ || __GNUC__ < 4 int j; j = 0; @@ -794,8 +643,7 @@ struct section struct section *head, *tail; }; -static int sizeofsection(struct section* s, int ref_bits, int width_bits, int has_undef) -{ +int sizeofsection(struct section* s, int ref_bits, int width_bits, int has_undef){ if (s->mn == INT_MAX) { // all undef return ref_bits + width_bits; } @@ -823,8 +671,7 @@ static int sizeofsection2(int mn, int mx, int n, int ref_bits, int width_bits, return find_nbits(mx - mn + has_undef) * n + ref_bits + width_bits; } -static int size_all(struct section* s, int ref_bits, int width_bits, int has_undef) -{ +int size_all(struct section* s, int ref_bits, int width_bits, int has_undef){ int bits; bits = 0; @@ -835,8 +682,7 @@ static int size_all(struct section* s, int ref_bits, int width_bits, int has_und return (bits + 7) / 8; } -static void move_one_left(struct section* s, int* v) -{ +void move_one_left(struct section* s, int* v){ struct section* t; int val, i, j, k; @@ -901,8 +747,7 @@ static void move_one_left(struct section* s, int* v) } } -static void move_one_right(struct section* s, int* v) -{ +void move_one_right(struct section* s, int* v){ struct section* t; int val, i, j, k; @@ -983,8 +828,7 @@ static void move_one_right(struct section* s, int* v) return; } -static void exchange(struct section* s, int* v, int has_undef, int LEN_SEC_MAX) -{ +void exchange(struct section* s, int* v, int has_undef, int LEN_SEC_MAX){ struct section* t; int val0, val1, nbit_s, nbit_t; @@ -1059,8 +903,7 @@ static void exchange(struct section* s, int* v, int has_undef, int LEN_SEC_MAX) } } -static void merge_j(struct section* h, int ref_bits, int width_bits, int has_undef, int param, int LEN_SEC_MAX) -{ +void merge_j(struct section* h, int ref_bits, int width_bits, int has_undef, int param, int LEN_SEC_MAX){ struct section *t, *m; int size_head, size_mid, size_tail, saving_mt, saving_hm; int min0, max0, min1, max1; @@ -1164,9 +1007,8 @@ static void merge_j(struct section* h, int ref_bits, int width_bits, int has_und } } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_g22order_packing* self = reinterpret_cast(a); +int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); grib_handle* gh = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; @@ -1850,18 +1692,15 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_data_g22order_packing_t::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) -{ +int grib_accessor_class_data_g22order_packing_t::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) -{ +int grib_accessor_class_data_g22order_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ size_t size = 0; double* values = NULL; int err = grib_get_size(grib_handle_of_accessor(a), "codedValues", &size); @@ -1881,8 +1720,7 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) return GRIB_SUCCESS; } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ +int grib_accessor_class_data_g22order_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ size_t size = 0, i = 0; double* values; int err = 0; @@ -1909,9 +1747,8 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array return GRIB_SUCCESS; } -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_data_g22order_packing* self = reinterpret_cast(a); +int grib_accessor_class_data_g22order_packing_t::value_count(grib_accessor* a, long* count){ + grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); *count = 0; return grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, count); } diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.h b/src/accessor/grib_accessor_class_data_g22order_packing.h new file mode 100644 index 000000000..87d7e3a8d --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g22order_packing.h @@ -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. + */ + +#ifndef eccodes_accessor_data_g22order_packing_h +#define eccodes_accessor_data_g22order_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_values.h" + +class grib_accessor_data_g22order_packing_t : public grib_accessor_values_t +{ +public: + /* 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* optimize_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; +}; + +class grib_accessor_class_data_g22order_packing_t : public grib_accessor_class_values_t +{ +public: + grib_accessor_class_data_g22order_packing_t(const char* name) : grib_accessor_class_values_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g22order_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_g22order_packing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_g2bifourier_packing.cc b/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc similarity index 77% rename from src/accessor/todo/grib_accessor_class_data_g2bifourier_packing.cc rename to src/accessor/grib_accessor_class_data_g2bifourier_packing.cc index 86275d470..f4196a36c 100644 --- a/src/accessor/todo/grib_accessor_class_data_g2bifourier_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,156 +9,19 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/******************************** - * philippe.marguinaud@meteo.fr - *******************************/ - -#include "grib_scaling.h" #include "grib_api_internal.h" -#include "grib_optimize_decimal_factor.h" -#include -#include - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_simple_packing - IMPLEMENTS = init - IMPLEMENTS = unpack_double - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - MEMBERS= const char* ieee_floats - MEMBERS= const char* laplacianOperatorIsSet - MEMBERS= const char* laplacianOperator - MEMBERS= const char* biFourierTruncationType - MEMBERS= const char* sub_i - MEMBERS= const char* sub_j - MEMBERS= const char* bif_i - MEMBERS= const char* bif_j - MEMBERS= const char* biFourierSubTruncationType - MEMBERS= const char* biFourierDoNotPackAxes - MEMBERS= const char* biFourierMakeTemplate - MEMBERS= const char* totalNumberOfValuesInUnpackedSubset - MEMBERS=const char* numberOfValues - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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*); - -typedef struct grib_accessor_data_g2bifourier_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_g2bifourier_packing */ - const char* ieee_floats; - const char* laplacianOperatorIsSet; - const char* laplacianOperator; - const char* biFourierTruncationType; - const char* sub_i; - const char* sub_j; - const char* bif_i; - const char* bif_j; - const char* biFourierSubTruncationType; - const char* biFourierDoNotPackAxes; - const char* biFourierMakeTemplate; - const char* totalNumberOfValuesInUnpackedSubset; - const char* numberOfValues; -} grib_accessor_data_g2bifourier_packing; - -extern grib_accessor_class* grib_accessor_class_data_simple_packing; - -static grib_accessor_class _grib_accessor_class_data_g2bifourier_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g2bifourier_packing", /* name */ - sizeof(grib_accessor_data_g2bifourier_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_data_g2bifourier_packing.h" +#include "grib_scaling.h" +grib_accessor_class_data_g2bifourier_packing_t _grib_accessor_class_data_g2bifourier_packing{"data_g2bifourier_packing"}; grib_accessor_class* grib_accessor_class_data_g2bifourier_packing = &_grib_accessor_class_data_g2bifourier_packing; -/* 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) -{ - grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; +void grib_accessor_class_data_g2bifourier_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g2bifourier_packing_t* self = (grib_accessor_data_g2bifourier_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); self->ieee_floats = grib_arguments_get_name(gh, args, self->carg++); @@ -178,17 +42,15 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) self->dirty = 1; } -static int value_count(grib_accessor* a, long* numberOfValues) -{ - grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; +int grib_accessor_class_data_g2bifourier_packing_t::value_count(grib_accessor* a, long* numberOfValues){ + grib_accessor_data_g2bifourier_packing_t* self = (grib_accessor_data_g2bifourier_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); *numberOfValues = 0; return grib_get_long_internal(gh, self->number_of_values, numberOfValues); } -static void ellipse(long ni, long nj, long itrunc[], long jtrunc[]) -{ +void ellipse(long ni, long nj, long itrunc[], long jtrunc[]){ const double zeps = 1.E-10; const double zauxil = 0.; int i, j; @@ -229,8 +91,7 @@ static void ellipse(long ni, long nj, long itrunc[], long jtrunc[]) } } -static void rectangle(long ni, long nj, long itrunc[], long jtrunc[]) -{ +void rectangle(long ni, long nj, long itrunc[], long jtrunc[]){ int i, j; /* @@ -248,8 +109,7 @@ static void rectangle(long ni, long nj, long itrunc[], long jtrunc[]) jtrunc[i] = nj; } -static void diamond(long ni, long nj, long itrunc[], long jtrunc[]) -{ +void diamond(long ni, long nj, long itrunc[], long jtrunc[]){ int i, j; if (nj == 0) @@ -311,8 +171,7 @@ typedef struct bif_trunc_t /* * Total number of coefficients */ -static size_t size_bif(bif_trunc_t* bt) -{ +size_t size_bif(bif_trunc_t* bt){ size_t n_vals = 0; int j; for (j = 0; j <= bt->bif_j; j++) @@ -323,8 +182,7 @@ static size_t size_bif(bif_trunc_t* bt) /* * Number of unpacked coefficients */ -static size_t size_sub(bif_trunc_t* bt) -{ +size_t size_sub(bif_trunc_t* bt){ size_t n_vals = 0; int i, j; for_ij() @@ -339,8 +197,7 @@ static size_t size_sub(bif_trunc_t* bt) return n_vals; } -static double laplam(bif_trunc_t* bt, const double val[]) -{ +double laplam(bif_trunc_t* bt, const double val[]){ /* * For bi-Fourier spectral fields, the Laplacian operator is a multiplication by (i*i+j*j) */ @@ -476,8 +333,7 @@ static double laplam(bif_trunc_t* bt, const double val[]) return zp; } -static void free_bif_trunc(bif_trunc_t* bt, grib_accessor* a) -{ +void free_bif_trunc(bif_trunc_t* bt, grib_accessor* a){ grib_handle* gh = grib_handle_of_accessor(a); if (bt == NULL) return; @@ -496,7 +352,7 @@ static void free_bif_trunc(bif_trunc_t* bt, grib_accessor* a) static bif_trunc_t* new_bif_trunc(grib_accessor* a) { int ret; - grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; + grib_accessor_data_g2bifourier_packing_t* self = (grib_accessor_data_g2bifourier_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); bif_trunc_t* bt = (bif_trunc_t*)grib_context_malloc(gh->context, sizeof(bif_trunc_t)); @@ -607,9 +463,8 @@ static bif_trunc_t* new_bif_trunc(grib_accessor* a) return NULL; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; +int grib_accessor_class_data_g2bifourier_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_g2bifourier_packing_t* self = (grib_accessor_data_g2bifourier_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); unsigned char* buf = NULL; @@ -633,7 +488,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) int ret = GRIB_SUCCESS; int i, j, k; - if ((ret = grib_value_count(a, &count)) != GRIB_SUCCESS) + if ((ret = a->value_count(&count)) != GRIB_SUCCESS) goto cleanup; bt = new_bif_trunc(a); @@ -659,8 +514,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) self->dirty = 0; buf = (unsigned char*)gh->buffer->data; - buf += grib_byte_offset(a); - + buf += a->byte_offset(); s = codes_power(bt->binary_scale_factor, 2); d = codes_power(-bt->decimal_scale_factor, 10); @@ -670,7 +524,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) hres = buf; lres = buf; - packed_offset = grib_byte_offset(a) + bt->bytes * bt->n_vals_sub; + packed_offset = a->byte_offset() + bt->bytes * bt->n_vals_sub; lpos = 8 * (packed_offset - offsetdata); hpos = 0; @@ -706,9 +560,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; +int grib_accessor_class_data_g2bifourier_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_g2bifourier_packing_t* self = (grib_accessor_data_g2bifourier_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; diff --git a/src/accessor/grib_accessor_class_data_g2bifourier_packing.h b/src/accessor/grib_accessor_class_data_g2bifourier_packing.h new file mode 100644 index 000000000..f4033a1ba --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2bifourier_packing.h @@ -0,0 +1,47 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2bifourier_packing_h +#define eccodes_accessor_data_g2bifourier_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g2bifourier_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g2bifourier_packing */ + const char* ieee_floats; + const char* laplacianOperatorIsSet; + const char* laplacianOperator; + const char* biFourierTruncationType; + const char* sub_i; + const char* sub_j; + const char* bif_i; + const char* bif_j; + const char* biFourierSubTruncationType; + const char* biFourierDoNotPackAxes; + const char* biFourierMakeTemplate; + const char* totalNumberOfValuesInUnpackedSubset; + const char* numberOfValues; +}; + +class grib_accessor_class_data_g2bifourier_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g2bifourier_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2bifourier_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2bifourier_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2complex_packing.cc b/src/accessor/grib_accessor_class_data_g2complex_packing.cc new file mode 100644 index 000000000..28958de56 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2complex_packing.cc @@ -0,0 +1,47 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_data_g2complex_packing.h" + +grib_accessor_class_data_g2complex_packing_t _grib_accessor_class_data_g2complex_packing{"data_g2complex_packing"}; +grib_accessor_class* grib_accessor_class_data_g2complex_packing = &_grib_accessor_class_data_g2complex_packing; + + +void grib_accessor_class_data_g2complex_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g2complex_packing_t* self = (grib_accessor_data_g2complex_packing_t*)a; + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->edition = 2; + + a->flags |= GRIB_ACCESSOR_FLAG_DATA; +} + +int grib_accessor_class_data_g2complex_packing_t::value_count(grib_accessor* a, long* numberOfValues){ + grib_accessor_data_g2complex_packing_t* self = (grib_accessor_data_g2complex_packing_t*)a; + *numberOfValues = 0; + + return grib_get_long(grib_handle_of_accessor(a), self->numberOfValues, numberOfValues); +} + +int grib_accessor_class_data_g2complex_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_g2complex_packing_t* self = (grib_accessor_data_g2complex_packing_t*)a; + int ret = GRIB_SUCCESS; + + if (*len == 0) + return GRIB_NO_VALUES; + + ret = grib_accessor_class_data_complex_packing_t::pack_double(a, val, len); + + if (ret == GRIB_SUCCESS) + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfValues, *len); + + return ret; +} diff --git a/src/accessor/grib_accessor_class_data_g2complex_packing.h b/src/accessor/grib_accessor_class_data_g2complex_packing.h new file mode 100644 index 000000000..e77b89276 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2complex_packing.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2complex_packing_h +#define eccodes_accessor_data_g2complex_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_complex_packing.h" + +class grib_accessor_data_g2complex_packing_t : public grib_accessor_data_complex_packing_t +{ +public: + /* Members defined in data_g2complex_packing */ + const char* numberOfValues; +}; + +class grib_accessor_class_data_g2complex_packing_t : public grib_accessor_class_data_complex_packing_t +{ +public: + grib_accessor_class_data_g2complex_packing_t(const char* name) : grib_accessor_class_data_complex_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2complex_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc new file mode 100644 index 000000000..bce04078b --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc @@ -0,0 +1,107 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_data_g2secondary_bitmap.h" + +grib_accessor_class_data_g2secondary_bitmap_t _grib_accessor_class_data_g2secondary_bitmap{"data_g2secondary_bitmap"}; +grib_accessor_class* grib_accessor_class_data_g2secondary_bitmap = &_grib_accessor_class_data_g2secondary_bitmap; + + +void grib_accessor_class_data_g2secondary_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g2secondary_bitmap_t* self = (grib_accessor_data_g2secondary_bitmap_t*)a; + self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, 4); +} + +int grib_accessor_class_data_g2secondary_bitmap_t::value_count(grib_accessor* a, long* len){ + grib_accessor_data_g2secondary_bitmap_t* self = (grib_accessor_data_g2secondary_bitmap_t*)a; + *len = 0; + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, len); +} + +int grib_accessor_class_data_g2secondary_bitmap_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_g2secondary_bitmap_t* self = (grib_accessor_data_g2secondary_bitmap_t*)a; + int err = 0; + + long primary_len = 0, secondary_len = 0; + double* primary_bitmap = NULL; + double* secondary_bitmap = NULL; + long i = 0, j = 0, k = 0, m = 0; + double missing_value = 0, present_value = 0; + long expand_by = 0; + + if (*len == 0) + return GRIB_NO_VALUES; + + if ((err = grib_get_long(grib_handle_of_accessor(a), self->expand_by, &expand_by)) != GRIB_SUCCESS) + return err; + if (expand_by <= 0) + return GRIB_ENCODING_ERROR; + + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) + return err; + + if (*len % expand_by) { + /*TODO: issue warning */ + return GRIB_ENCODING_ERROR; + } + + primary_len = *len / expand_by; + primary_bitmap = (double*)grib_context_malloc_clear(a->context, primary_len * sizeof(double)); + if (!primary_bitmap) + return GRIB_OUT_OF_MEMORY; + + secondary_len = *len; + secondary_bitmap = (double*)grib_context_malloc_clear(a->context, secondary_len * sizeof(double)); + if (!secondary_bitmap) { + grib_context_free(a->context, primary_bitmap); + return GRIB_OUT_OF_MEMORY; + } + + if (missing_value == 0) + present_value = 1; + else + present_value = 0; + + k = 0; + m = 0; + for (i = 0; i < *len; i += expand_by) { + int cnt = 0; + for (j = 0; j < expand_by; j++) + if (val[i + j] == missing_value) + cnt++; + + if (cnt == expand_by) /* all expand_by values are missing */ + primary_bitmap[k++] = missing_value; + else { + primary_bitmap[k++] = present_value; + for (j = 0; j < expand_by; j++) + secondary_bitmap[m++] = val[i + j]; + //on++; + } + } + + *len = k; + + Assert(k == primary_len); + + err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->primary_bitmap, primary_bitmap, k); + if (err == GRIB_SUCCESS) + err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->secondary_bitmap, secondary_bitmap, m); + + grib_context_free(a->context, primary_bitmap); + grib_context_free(a->context, secondary_bitmap); + + if (err == GRIB_SUCCESS) + err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, *len * expand_by); + + return err; +} diff --git a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h new file mode 100644 index 000000000..394c79bfa --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2secondary_bitmap_h +#define eccodes_accessor_data_g2secondary_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_secondary_bitmap.h" + +class grib_accessor_data_g2secondary_bitmap_t : public grib_accessor_data_secondary_bitmap_t +{ +public: + /* Members defined in data_g2secondary_bitmap */ + const char* number_of_values; +}; + +class grib_accessor_class_data_g2secondary_bitmap_t : public grib_accessor_class_data_secondary_bitmap_t +{ +public: + grib_accessor_class_data_g2secondary_bitmap_t(const char* name) : grib_accessor_class_data_secondary_bitmap_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2secondary_bitmap_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2secondary_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_g2shsimple_packing.cc b/src/accessor/grib_accessor_class_data_g2shsimple_packing.cc new file mode 100644 index 000000000..e765539ee --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2shsimple_packing.cc @@ -0,0 +1,92 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_data_g2shsimple_packing.h" + +grib_accessor_class_data_g2shsimple_packing_t _grib_accessor_class_data_g2shsimple_packing{"data_g2shsimple_packing"}; +grib_accessor_class* grib_accessor_class_data_g2shsimple_packing = &_grib_accessor_class_data_g2shsimple_packing; + + +void grib_accessor_class_data_g2shsimple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g2shsimple_packing_t* self = (grib_accessor_data_g2shsimple_packing_t*)a; + + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), args, 2); + self->numberOfDataPoints = grib_arguments_get_name(grib_handle_of_accessor(a), args, 3); + a->flags |= GRIB_ACCESSOR_FLAG_DATA; +} + +int grib_accessor_class_data_g2shsimple_packing_t::value_count(grib_accessor* a, long* len){ + grib_accessor_data_g2shsimple_packing_t* self = (grib_accessor_data_g2shsimple_packing_t*)a; + *len = 0; + return grib_get_long(grib_handle_of_accessor(a), self->numberOfValues, len); +} + +int grib_accessor_class_data_g2shsimple_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_g2shsimple_packing_t* self = (grib_accessor_data_g2shsimple_packing_t*)a; + int err = GRIB_SUCCESS; + + size_t n_vals = 0; + + if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &n_vals)) != GRIB_SUCCESS) + return err; + + self->dirty = 0; + + /* n_vals = coded_n_vals+1; */ + + if (*len < n_vals) { + *len = n_vals; + return GRIB_ARRAY_TOO_SMALL; + } + + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->real_part, val)) != GRIB_SUCCESS) + return err; + + val++; + + if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, &n_vals)) != GRIB_SUCCESS) + return err; + + *len = n_vals; + + return err; +} + +int grib_accessor_class_data_g2shsimple_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_g2shsimple_packing_t* self = (grib_accessor_data_g2shsimple_packing_t*)a; + int err = GRIB_SUCCESS; + + size_t coded_n_vals = *len - 1; + size_t n_vals = *len; + + if (*len == 0) + return GRIB_NO_VALUES; + + self->dirty = 1; + + if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->real_part, *val)) != GRIB_SUCCESS) + return err; + + val++; + + if ((err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, coded_n_vals)) != GRIB_SUCCESS) + return err; + + *len = n_vals; + + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfValues, (long)n_vals)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfDataPoints, (long)n_vals)) != GRIB_SUCCESS) + return err; + + return err; +} diff --git a/src/accessor/grib_accessor_class_data_g2shsimple_packing.h b/src/accessor/grib_accessor_class_data_g2shsimple_packing.h new file mode 100644 index 000000000..28e7a7c06 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2shsimple_packing.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2shsimple_packing_h +#define eccodes_accessor_data_g2shsimple_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_shsimple_packing.h" + +class grib_accessor_data_g2shsimple_packing_t : public grib_accessor_data_shsimple_packing_t +{ +public: + /* Members defined in data_g2shsimple_packing */ + const char* numberOfValues; + const char* numberOfDataPoints; +}; + +class grib_accessor_class_data_g2shsimple_packing_t : public grib_accessor_class_data_shsimple_packing_t +{ +public: + grib_accessor_class_data_g2shsimple_packing_t(const char* name) : grib_accessor_class_data_shsimple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2shsimple_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2shsimple_packing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_g2simple_packing.cc b/src/accessor/grib_accessor_class_data_g2simple_packing.cc similarity index 51% rename from src/accessor/todo/grib_accessor_class_data_g2simple_packing.cc rename to src/accessor/grib_accessor_class_data_g2simple_packing.cc index 56441fc96..051239cbc 100644 --- a/src/accessor/todo/grib_accessor_class_data_g2simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2simple_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,135 +9,29 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_scaling.h" #include "grib_api_internal.h" +#include "grib_accessor_class_data_g2simple_packing.h" +#include "grib_scaling.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_simple_packing - IMPLEMENTS = init - IMPLEMENTS = pack_double - IMPLEMENTS = pack_bytes - IMPLEMENTS = value_count - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -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 value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_data_g2simple_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_g2simple_packing */ -} grib_accessor_data_g2simple_packing; - -extern grib_accessor_class* grib_accessor_class_data_simple_packing; - -static grib_accessor_class _grib_accessor_class_data_g2simple_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g2simple_packing", /* name */ - sizeof(grib_accessor_data_g2simple_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - &pack_bytes, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_data_g2simple_packing_t _grib_accessor_class_data_g2simple_packing{"data_g2simple_packing"}; grib_accessor_class* grib_accessor_class_data_g2simple_packing = &_grib_accessor_class_data_g2simple_packing; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g2simple_packing* self = (grib_accessor_data_g2simple_packing*)a; +void grib_accessor_class_data_g2simple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g2simple_packing_t* self = (grib_accessor_data_g2simple_packing_t*)a; a->flags |= GRIB_ACCESSOR_FLAG_DATA; self->edition = 2; } -static int value_count(grib_accessor* a, long* n_vals) -{ - grib_accessor_data_g2simple_packing* self = (grib_accessor_data_g2simple_packing*)a; +int grib_accessor_class_data_g2simple_packing_t::value_count(grib_accessor* a, long* n_vals){ + grib_accessor_data_g2simple_packing_t* self = (grib_accessor_data_g2simple_packing_t*)a; *n_vals = 0; return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); } -static int pack_double(grib_accessor* a, const double* cval, size_t* len) -{ - grib_accessor_data_g2simple_packing* self = (grib_accessor_data_g2simple_packing*)a; - grib_accessor_class* super = *(a->cclass->super); +int grib_accessor_class_data_g2simple_packing_t::pack_double(grib_accessor* a, const double* cval, size_t* len){ + grib_accessor_data_g2simple_packing_t* self = (grib_accessor_data_g2simple_packing_t*)a; + //grib_accessor_class* super = *(a->cclass->super); size_t n_vals = *len; double reference_value = 0; long binary_scale_factor = 0; @@ -209,17 +104,20 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) return grib_set_double_array(h, "values", val, *len); } - if (super != grib_accessor_class_data_g2simple_packing) { - /* Normal case: parent not same as me! */ - ret = super->pack_double(a, val, len); - } - else { - /* GRIB-364: simple packing with logarithm pre-processing */ - grib_accessor_class* super2 = NULL; - Assert(super->super); - super2 = *(super->super); - ret = super2->pack_double(a, val, len); - } + // ==== TODO(maee): Fix this ==== + ret = grib_accessor_class_data_simple_packing_t::pack_double(a, cval, len); + //if (super != grib_accessor_class_data_g2simple_packing) { + // [> Normal case: parent not same as me! <] + // ret = super->pack_double(a, val, len); + //} + //else { + // [> GRIB-364: simple packing with logarithm pre-processing <] + // grib_accessor_class* super2 = NULL; + // Assert(super->super); + // super2 = *(super->super); + // ret = super2->pack_double(a, val, len); + //} + // ============================= switch (ret) { case GRIB_CONSTANT_FIELD: grib_buffer_replace(a, NULL, 0, 1, 1); @@ -253,7 +151,7 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) grib_encode_double_array(n_vals, val, bits_per_value, reference_value, decimal, divisor, encoded, &off); grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_data_g2simple_packing : pack_double : packing %s, %d values", a->name, n_vals); + "grib_accessor_data_g2simple_packing_t : pack_double : packing %s, %d values", a->name, n_vals); grib_buffer_replace(a, buf, buflen, 1, 1); @@ -262,8 +160,7 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) return ret; } -static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len) -{ +int grib_accessor_class_data_g2simple_packing_t::pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len){ size_t length = *len; grib_buffer_replace(a, val, length, 1, 1); return GRIB_SUCCESS; diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing.h b/src/accessor/grib_accessor_class_data_g2simple_packing.h new file mode 100644 index 000000000..b3982c40d --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2simple_packing.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2simple_packing_h +#define eccodes_accessor_data_g2simple_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g2simple_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g2simple_packing */ +}; + +class grib_accessor_class_data_g2simple_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g2simple_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2simple_packing_t{}; } + int pack_bytes(grib_accessor*, const unsigned char*, size_t* len) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2simple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc new file mode 100644 index 000000000..21493c113 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc @@ -0,0 +1,179 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_data_g2simple_packing_with_preprocessing.h" +#define DIRECT 0 +#define INVERSE 1 + +grib_accessor_class_data_g2simple_packing_with_preprocessing_t _grib_accessor_class_data_g2simple_packing_with_preprocessing{"data_g2simple_packing_with_preprocessing"}; +grib_accessor_class* grib_accessor_class_data_g2simple_packing_with_preprocessing = &_grib_accessor_class_data_g2simple_packing_with_preprocessing; + + +void grib_accessor_class_data_g2simple_packing_with_preprocessing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_g2simple_packing_with_preprocessing_t* self = (grib_accessor_data_g2simple_packing_with_preprocessing_t*)a; + self->pre_processing = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->pre_processing_parameter = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + a->flags |= GRIB_ACCESSOR_FLAG_DATA; +} + +int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::value_count(grib_accessor* a, long* n_vals){ + grib_accessor_data_g2simple_packing_with_preprocessing_t* self = (grib_accessor_data_g2simple_packing_with_preprocessing_t*)a; + *n_vals = 0; + + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); +} + +static int pre_processing_func(double* values, long length, long pre_processing, + double* pre_processing_parameter, int mode) +{ + int i = 0, ret = 0; + double min = values[0]; + double next_min = values[0]; + Assert(length > 0); + + switch (pre_processing) { + /* NONE */ + case 0: + break; + /* LOGARITHM */ + case 1: + if (mode == DIRECT) { + for (i = 0; i < length; i++) { + if (values[i] < min) + min = values[i]; + if (values[i] > next_min) + next_min = values[i]; + } + for (i = 0; i < length; i++) { + if (values[i] > min && values[i] < next_min) + next_min = values[i]; + } + if (min > 0) { + *pre_processing_parameter = 0; + for (i = 0; i < length; i++) { + DEBUG_ASSERT(values[i] > 0); + values[i] = log(values[i]); + } + } + else { + double ppp = 0; + *pre_processing_parameter = next_min - 2 * min; + if (next_min == min) + return ret; + ppp = *pre_processing_parameter; + for (i = 0; i < length; i++) { + DEBUG_ASSERT((values[i] + ppp) > 0); + values[i] = log(values[i] + ppp); + } + } + } + else { + Assert(mode == INVERSE); + if (*pre_processing_parameter == 0) { + for (i = 0; i < length; i++) + values[i] = exp(values[i]); + } + else { + for (i = 0; i < length; i++) + values[i] = exp(values[i]) - *pre_processing_parameter; + } + } + break; + default: + ret = GRIB_NOT_IMPLEMENTED; + break; + } + + return ret; +} + +int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_g2simple_packing_with_preprocessing_t* self = (grib_accessor_data_g2simple_packing_with_preprocessing_t*)a; + //grib_accessor_class* super = *(a->cclass->super); + //grib_accessor_class* super2 = NULL; + + size_t n_vals = 0; + long nn = 0; + int err = 0; + + long pre_processing; + double pre_processing_parameter; + + err = a->value_count(&nn); n_vals = nn; + if (err) + return err; + + if (n_vals == 0) { + *len = 0; + return GRIB_SUCCESS; + } + + self->dirty = 0; + + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->pre_processing, &pre_processing)) != GRIB_SUCCESS) { + return err; + } + + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->pre_processing_parameter, &pre_processing_parameter)) != GRIB_SUCCESS) { + return err; + } + + // TODO(maee): fix this + //Assert(super->super); + //super2 = *(super->super); + //err = super2->unpack_double(a, val, &n_vals); [> GRIB-364 <] + err = grib_accessor_class_data_simple_packing_t::unpack_double(a, val, &n_vals); + if (err != GRIB_SUCCESS) + return err; + + err = pre_processing_func(val, n_vals, pre_processing, &pre_processing_parameter, INVERSE); + if (err != GRIB_SUCCESS) + return err; + + *len = (long)n_vals; + + return err; +} + +int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_g2simple_packing_with_preprocessing_t* self = (grib_accessor_data_g2simple_packing_with_preprocessing_t*)a; + //grib_accessor_class* super = *(a->cclass->super); + + size_t n_vals = *len; + int err = 0; + + long pre_processing = 0; + double pre_processing_parameter = 0; + + self->dirty = 1; + + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->pre_processing, &pre_processing)) != GRIB_SUCCESS) + return err; + + err = pre_processing_func((double*)val, n_vals, pre_processing, &pre_processing_parameter, DIRECT); + if (err != GRIB_SUCCESS) + return err; + + // TOOD(maee): fix this + //err = super->pack_double(a, val, len); + err = grib_accessor_class_data_g2simple_packing_t::pack_double(a, val, len); + if (err != GRIB_SUCCESS) + return err; + + if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->pre_processing_parameter, pre_processing_parameter)) != GRIB_SUCCESS) + return err; + + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals)) != GRIB_SUCCESS) + return err; + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h new file mode 100644 index 000000000..ac2bc2d27 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2simple_packing_with_preprocessing_h +#define eccodes_accessor_data_g2simple_packing_with_preprocessing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_g2simple_packing.h" + +class grib_accessor_data_g2simple_packing_with_preprocessing_t : public grib_accessor_data_g2simple_packing_t +{ +public: + /* Members defined in data_g2simple_packing_with_preprocessing */ + const char* pre_processing; + const char* pre_processing_parameter; +}; + +class grib_accessor_class_data_g2simple_packing_with_preprocessing_t : public grib_accessor_class_data_g2simple_packing_t +{ +public: + grib_accessor_class_data_g2simple_packing_with_preprocessing_t(const char* name) : grib_accessor_class_data_g2simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2simple_packing_with_preprocessing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2simple_packing_with_preprocessing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_jpeg2000_packing.cc b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc similarity index 73% rename from src/accessor/todo/grib_accessor_class_data_jpeg2000_packing.cc rename to src/accessor/grib_accessor_class_data_jpeg2000_packing.cc index a1a43b6f7..d5f3eaaf4 100644 --- a/src/accessor/todo/grib_accessor_class_data_jpeg2000_packing.cc +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,148 +9,21 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_scaling.h" #include "grib_api_internal.h" +#include "grib_accessor_class_data_jpeg2000_packing.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_simple_packing - IMPLEMENTS = init - IMPLEMENTS = unpack_double - IMPLEMENTS = pack_double;unpack_float - IMPLEMENTS = unpack_double_element;unpack_double_element_set - IMPLEMENTS = value_count - MEMBERS=const char* type_of_compression_used - MEMBERS=const char* target_compression_ratio - MEMBERS=const char* ni - MEMBERS=const char* nj - MEMBERS=const char* list_defining_points - MEMBERS=const char* number_of_data_points - MEMBERS=const char* scanning_mode - MEMBERS=int jpeg_lib - MEMBERS=const char* dump_jpg - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 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_jpeg2000_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_jpeg2000_packing */ - const char* type_of_compression_used; - const char* target_compression_ratio; - const char* ni; - const char* nj; - const char* list_defining_points; - const char* number_of_data_points; - const char* scanning_mode; - int jpeg_lib; - const char* dump_jpg; -} grib_accessor_data_jpeg2000_packing; - -extern grib_accessor_class* grib_accessor_class_data_simple_packing; - -static grib_accessor_class _grib_accessor_class_data_jpeg2000_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_jpeg2000_packing", /* name */ - sizeof(grib_accessor_data_jpeg2000_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_data_jpeg2000_packing_t _grib_accessor_class_data_jpeg2000_packing{"data_jpeg2000_packing"}; grib_accessor_class* grib_accessor_class_data_jpeg2000_packing = &_grib_accessor_class_data_jpeg2000_packing; -/* END_CLASS_IMP */ static int first = 1; #define JASPER_LIB 1 #define OPENJPEG_LIB 2 -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ +void grib_accessor_class_data_jpeg2000_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ const char* user_lib = NULL; - grib_accessor_data_jpeg2000_packing* self = (grib_accessor_data_jpeg2000_packing*)a; + grib_accessor_data_jpeg2000_packing_t* self = (grib_accessor_data_jpeg2000_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); self->jpeg_lib = 0; @@ -204,9 +78,8 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) } } -static int value_count(grib_accessor* a, long* n_vals) -{ - grib_accessor_data_jpeg2000_packing* self = (grib_accessor_data_jpeg2000_packing*)a; +int grib_accessor_class_data_jpeg2000_packing_t::value_count(grib_accessor* a, long* n_vals){ + grib_accessor_data_jpeg2000_packing_t* self = (grib_accessor_data_jpeg2000_packing_t*)a; *n_vals = 0; return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); @@ -215,19 +88,16 @@ static int value_count(grib_accessor* a, long* n_vals) #define EXTRA_BUFFER_SIZE 10240 #if HAVE_JPEG -static int unpack_float(grib_accessor*, float* val, size_t* len) -{ +int grib_accessor_class_data_jpeg2000_packing_t::unpack_float(grib_accessor*, float* val, size_t* len){ return GRIB_NOT_IMPLEMENTED; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_jpeg2000_packing* self = (grib_accessor_data_jpeg2000_packing*)a; +int grib_accessor_class_data_jpeg2000_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_jpeg2000_packing_t* self = (grib_accessor_data_jpeg2000_packing_t*)a; int err = GRIB_SUCCESS; size_t i = 0; - size_t buflen = grib_byte_count(a); - + size_t buflen = a->byte_count(); double bscale = 0; double dscale = 0; unsigned char* buf = NULL; @@ -242,8 +112,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) double units_bias = 0.0; n_vals = 0; - err = grib_value_count(a, &nn); - n_vals = nn; + err = a->value_count(&nn); n_vals = nn; if (err) return err; @@ -282,8 +151,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - buf += grib_byte_offset(a); - + buf += a->byte_offset(); switch (self->jpeg_lib) { case OPENJPEG_LIB: if ((err = grib_openjpeg_decode(a->context, buf, &buflen, val, &n_vals)) != GRIB_SUCCESS) @@ -323,9 +191,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } -static int pack_double(grib_accessor* a, const double* cval, size_t* len) -{ - grib_accessor_data_jpeg2000_packing* self = (grib_accessor_data_jpeg2000_packing*)a; +int grib_accessor_class_data_jpeg2000_packing_t::pack_double(grib_accessor* a, const double* cval, size_t* len){ + grib_accessor_data_jpeg2000_packing_t* self = (grib_accessor_data_jpeg2000_packing_t*)a; grib_accessor_class* super = *(a->cclass->super); size_t n_vals = *len; int err = 0; @@ -561,33 +428,28 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) } #else -static void print_error_feature_not_enabled(grib_context* c) -{ +void print_error_feature_not_enabled(grib_context* c){ grib_context_log(c, GRIB_LOG_ERROR, "JPEG support not enabled. Please rebuild with -DENABLE_JPG=ON"); } -static int unpack_float(grib_accessor* a, float* val, size_t* len) -{ +int grib_accessor_class_data_jpeg2000_packing_t::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(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_data_jpeg2000_packing_t::unpack_double(grib_accessor* a, double* 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) -{ +int grib_accessor_class_data_jpeg2000_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } #endif -static int unpack_double_element(grib_accessor* a, size_t idx, double* val) -{ - grib_accessor_data_jpeg2000_packing* self = (grib_accessor_data_jpeg2000_packing*)a; +int grib_accessor_class_data_jpeg2000_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ + grib_accessor_data_jpeg2000_packing_t* self = (grib_accessor_data_jpeg2000_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); size_t size = 0; double* values = NULL; @@ -624,9 +486,8 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) return GRIB_SUCCESS; } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ - grib_accessor_data_jpeg2000_packing* self = (grib_accessor_data_jpeg2000_packing*)a; +int grib_accessor_class_data_jpeg2000_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ + grib_accessor_data_jpeg2000_packing_t* self = (grib_accessor_data_jpeg2000_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); size_t size = 0, i = 0; double* values = NULL; diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.h b/src/accessor/grib_accessor_class_data_jpeg2000_packing.h new file mode 100644 index 000000000..a04ee58d5 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.h @@ -0,0 +1,46 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_jpeg2000_packing_h +#define eccodes_accessor_data_jpeg2000_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_jpeg2000_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_jpeg2000_packing */ + const char* type_of_compression_used; + const char* target_compression_ratio; + const char* ni; + const char* nj; + const char* list_defining_points; + const char* number_of_data_points; + const char* scanning_mode; + int jpeg_lib; + const char* dump_jpg; +}; + +class grib_accessor_class_data_jpeg2000_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_jpeg2000_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_jpeg2000_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_jpeg2000_packing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_png_packing.cc b/src/accessor/grib_accessor_class_data_png_packing.cc similarity index 75% rename from src/accessor/todo/grib_accessor_class_data_png_packing.cc rename to src/accessor/grib_accessor_class_data_png_packing.cc index e9747b19d..8c1c62bb3 100644 --- a/src/accessor/todo/grib_accessor_class_data_png_packing.cc +++ b/src/accessor/grib_accessor_class_data_png_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,134 +9,15 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_scaling.h" #include "grib_api_internal.h" -#define PNG_ANYBITS - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_values - IMPLEMENTS = init - IMPLEMENTS = unpack_double - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - IMPLEMENTS = unpack_double_element;unpack_double_element_set - MEMBERS=const char* number_of_values - MEMBERS=const char* reference_value - MEMBERS=const char* binary_scale_factor - MEMBERS=const char* decimal_scale_factor - MEMBERS=const char* bits_per_value - MEMBERS=const char* ni - MEMBERS=const char* nj - MEMBERS=const char* list_defining_points - MEMBERS=const char* number_of_data_points - MEMBERS=const char* scanning_mode - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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*); -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_png_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_png_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* ni; - const char* nj; - const char* list_defining_points; - const char* number_of_data_points; - const char* scanning_mode; -} grib_accessor_data_png_packing; - -extern grib_accessor_class* grib_accessor_class_values; - -static grib_accessor_class _grib_accessor_class_data_png_packing = { - &grib_accessor_class_values, /* super */ - "data_png_packing", /* name */ - sizeof(grib_accessor_data_png_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_data_png_packing.h" +grib_accessor_class_data_png_packing_t _grib_accessor_class_data_png_packing{"data_png_packing"}; grib_accessor_class* grib_accessor_class_data_png_packing = &_grib_accessor_class_data_png_packing; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_png_packing* self = (grib_accessor_data_png_packing*)a; +void grib_accessor_class_data_png_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_png_packing_t* self = (grib_accessor_data_png_packing_t*)a; grib_handle* h = grib_handle_of_accessor(a); self->number_of_values = grib_arguments_get_name(h, args, self->carg++); @@ -151,9 +33,8 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a, long* n_vals) -{ - grib_accessor_data_png_packing* self = (grib_accessor_data_png_packing*)a; +int grib_accessor_class_data_png_packing_t::value_count(grib_accessor* a, long* n_vals){ + grib_accessor_data_png_packing_t* self = (grib_accessor_data_png_packing_t*)a; *n_vals = 0; return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); } @@ -169,16 +50,14 @@ typedef struct png_read_callback_data size_t offset; } png_read_callback_data; -static void png_read_callback(png_structp png, png_bytep data, png_size_t length) -{ +void png_read_callback(png_structp png, png_bytep data, png_size_t length){ png_read_callback_data* p = (png_read_callback_data*)png_get_io_ptr(png); Assert(p->offset + length <= p->length); memcpy(data, p->buffer + p->offset, length); p->offset += length; } -static void png_write_callback(png_structp png, png_bytep data, png_size_t length) -{ +void png_write_callback(png_structp png, png_bytep data, png_size_t length){ png_read_callback_data* p = (png_read_callback_data*)png_get_io_ptr(png); /* printf("p.offset=%zu len=%zu p.len=%zu\n", p->offset, length, p->length); */ /* Assert(p->offset + length <= p->length); */ @@ -191,19 +70,16 @@ static void png_write_callback(png_structp png, png_bytep data, png_size_t lengt p->offset += length; } -static void png_flush_callback(png_structp png) -{ +void png_flush_callback(png_structp png){ /* Empty */ } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_png_packing* self = (grib_accessor_data_png_packing*)a; +int grib_accessor_class_data_png_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_png_packing_t* self = (grib_accessor_data_png_packing_t*)a; int err = GRIB_SUCCESS; int i, j; - size_t buflen = grib_byte_count(a); - + size_t buflen = a->byte_count(); double bscale = 0; double dscale = 0; unsigned char* buf = NULL; @@ -227,8 +103,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) self->dirty = 0; - err = grib_value_count(a, &nn); - n_vals = nn; + err = a->value_count(&nn); n_vals = nn; if (err) return err; if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) @@ -257,8 +132,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - buf += grib_byte_offset(a); - + buf += a->byte_offset(); if (png_sig_cmp(buf, 0, 8) != 0) return GRIB_INVALID_MESSAGE; @@ -341,8 +215,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } -static bool is_constant(const double* values, size_t n_vals) -{ +bool is_constant(const double* values, size_t n_vals){ bool isConstant = true; double v = 0; size_t i; @@ -356,9 +229,8 @@ static bool is_constant(const double* values, size_t n_vals) return isConstant; } -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 grib_accessor_class_data_png_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_png_packing_t* self = (grib_accessor_data_png_packing_t*)a; const char* cclass_name = a->cclass->name; int err = GRIB_SUCCESS; @@ -545,7 +417,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) } /* buflen = n_vals*(bits_per_value/8); */ grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_data_png_packing : pack_double : packing %s, %d values", a->name, n_vals); + "grib_accessor_data_png_packing_t : pack_double : packing %s, %d values", a->name, n_vals); buf = (unsigned char*)grib_context_buffer_malloc_clear(a->context, buflen); if (!buf) { @@ -652,10 +524,9 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return err; } -static int unpack_double_element(grib_accessor* a, size_t idx, double* val) -{ +int grib_accessor_class_data_png_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ /* The index idx relates to codedValues NOT values! */ - grib_accessor_data_png_packing* self = (grib_accessor_data_png_packing*)a; + grib_accessor_data_png_packing_t* self = (grib_accessor_data_png_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int err = 0; size_t size = 0; @@ -688,10 +559,9 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) return GRIB_SUCCESS; } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ +int grib_accessor_class_data_png_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ /* The index idx relates to codedValues NOT values! */ - grib_accessor_data_png_packing* self = (grib_accessor_data_png_packing*)a; + grib_accessor_data_png_packing_t* self = (grib_accessor_data_png_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int err = 0; size_t size = 0, i = 0; @@ -735,29 +605,24 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array #else -static void print_error_feature_not_enabled(grib_context* c) -{ +static void print_error_feature_not_enabled(grib_context* c){ grib_context_log(c, GRIB_LOG_ERROR, "PNG support not enabled. Please rebuild with -DENABLE_PNG=ON"); } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_data_png_packing_t::unpack_double(grib_accessor* a, double* 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) -{ +int grib_accessor_class_data_png_packing_t::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_element(grib_accessor* a, size_t idx, double* val) -{ +int grib_accessor_class_data_png_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ +int grib_accessor_class_data_png_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } diff --git a/src/accessor/grib_accessor_class_data_png_packing.h b/src/accessor/grib_accessor_class_data_png_packing.h new file mode 100644 index 000000000..d8c9211a3 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_png_packing.h @@ -0,0 +1,46 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_png_packing_h +#define eccodes_accessor_data_png_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_values.h" + +class grib_accessor_data_png_packing_t : public grib_accessor_values_t +{ +public: + /* Members defined in data_png_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* ni; + const char* nj; + const char* list_defining_points; + const char* number_of_data_points; + const char* scanning_mode; +}; + +class grib_accessor_class_data_png_packing_t : public grib_accessor_class_values_t +{ +public: + grib_accessor_class_data_png_packing_t(const char* name) : grib_accessor_class_values_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_png_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_png_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_raw_packing.cc b/src/accessor/grib_accessor_class_data_raw_packing.cc new file mode 100644 index 000000000..943359f47 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_raw_packing.cc @@ -0,0 +1,194 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_data_raw_packing.h" +#include "grib_ieeefloat.h" + +grib_accessor_class_data_raw_packing_t _grib_accessor_class_data_raw_packing{"data_raw_packing"}; +grib_accessor_class* grib_accessor_class_data_raw_packing = &_grib_accessor_class_data_raw_packing; + + +void grib_accessor_class_data_raw_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_raw_packing_t* self = (grib_accessor_data_raw_packing_t*)a; + + self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + a->flags |= GRIB_ACCESSOR_FLAG_DATA; +} + +int grib_accessor_class_data_raw_packing_t::value_count(grib_accessor* a, long* n_vals){ + grib_accessor_data_raw_packing_t* self = (grib_accessor_data_raw_packing_t*)a; + *n_vals = 0; + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); +} + +int grib_accessor_class_data_raw_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_raw_packing_t* self = (grib_accessor_data_raw_packing_t*)a; + unsigned char* buf = NULL; + int bytes = 0; + size_t nvals = 0; + long inlen = a->byte_count(); + long precision = 0; + + int code = GRIB_SUCCESS; + + if ((code = grib_get_long(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) + return code; + + self->dirty = 0; + + buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; + buf += a->byte_offset(); + switch (precision) { + case 1: + bytes = 4; + break; + case 2: + bytes = 8; + break; + default: + return GRIB_NOT_IMPLEMENTED; + } + + nvals = inlen / bytes; + + if (*len < nvals) + return GRIB_ARRAY_TOO_SMALL; + + code = grib_ieee_decode_array(a->context, buf, nvals, bytes, val); + + *len = nvals; + + return code; +} + +int grib_accessor_class_data_raw_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_raw_packing_t* self = (grib_accessor_data_raw_packing_t*)a; + + int bytes = 0; + unsigned char* buffer = NULL; + + long precision = 0; + + double* values = (double*)val; + size_t inlen = *len; + + /*int free_buffer = 0; + *int free_values = 0;*/ + + int code = GRIB_SUCCESS; + + size_t bufsize = 0; + + if (*len == 0) + return GRIB_NO_VALUES; + + if ((code = grib_get_long_internal(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) + return code; + + self->dirty = 1; + + switch (precision) { + case 1: + bytes = 4; + break; + + case 2: + bytes = 8; + break; + + default: + code = GRIB_NOT_IMPLEMENTED; + goto clean_up; + } + + bufsize = bytes * inlen; + + buffer = (unsigned char*)grib_context_malloc(a->context, bufsize); + + if (!buffer) { + code = GRIB_OUT_OF_MEMORY; + goto clean_up; + } + + code = grib_ieee_encode_array(a->context, values, inlen, bytes, buffer); + +clean_up: + /*if (free_buffer) + * free(buffer); + * if (free_values) + * free(values); + */ + + grib_buffer_replace(a, buffer, bufsize, 1, 1); + + grib_context_buffer_free(a->context, buffer); + + if (code == GRIB_SUCCESS) { + code = grib_set_long(grib_handle_of_accessor(a), self->number_of_values, inlen); + if (code == GRIB_READ_ONLY) + code = 0; + } + + return code; +} + +int grib_accessor_class_data_raw_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ + int ret = 0; + grib_accessor_data_raw_packing_t* self = (grib_accessor_data_raw_packing_t*)a; + unsigned char* buf = NULL; + int bytes = 0; + size_t nvals = 0; + long inlen = a->byte_count(); long pos = 0; + long precision = 0; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) + return ret; + + self->dirty = 0; + + buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; + buf += a->byte_offset(); + switch (precision) { + case 1: + bytes = 4; + break; + + case 2: + bytes = 8; + break; + + default: + return GRIB_NOT_IMPLEMENTED; + } + + pos = bytes * idx; + + Assert(pos <= inlen); + + nvals = 1; + buf += pos; + + ret = grib_ieee_decode_array(a->context, buf, nvals, bytes, val); + + return ret; +} + +int grib_accessor_class_data_raw_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ + int err = 0; + size_t i = 0; + for (i=0; inumber_of_values = grib_arguments_get_name(gh, args, self->carg++); self->bits_per_value = grib_arguments_get_name(gh, args, self->carg++); @@ -133,16 +29,14 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a, long* number_of_values) -{ - grib_accessor_data_run_length_packing* self = (grib_accessor_data_run_length_packing*)a; +int grib_accessor_class_data_run_length_packing_t::value_count(grib_accessor* a, long* number_of_values){ + grib_accessor_data_run_length_packing_t* self = (grib_accessor_data_run_length_packing_t*)a; *number_of_values = 0; return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, number_of_values); } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_run_length_packing* self = (grib_accessor_data_run_length_packing*)a; +int grib_accessor_class_data_run_length_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_run_length_packing_t* self = (grib_accessor_data_run_length_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; int err = GRIB_SUCCESS; @@ -204,8 +98,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } compressed_values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * number_of_compressed_values); buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - offsetBeforeData = grib_byte_offset(a); - buf += offsetBeforeData; + offsetBeforeData = a->byte_offset(); buf += offsetBeforeData; pos = 0; grib_decode_long_array(buf, &pos, bits_per_value, number_of_compressed_values, compressed_values); j = 0; @@ -246,9 +139,8 @@ 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_accessor_data_run_length_packing* self = (grib_accessor_data_run_length_packing*)a; +int grib_accessor_class_data_run_length_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_run_length_packing_t* self = (grib_accessor_data_run_length_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; int err = GRIB_SUCCESS; diff --git a/src/accessor/grib_accessor_class_data_run_length_packing.h b/src/accessor/grib_accessor_class_data_run_length_packing.h new file mode 100644 index 000000000..3125fdcf4 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_run_length_packing.h @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_run_length_packing_h +#define eccodes_accessor_data_run_length_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_values.h" + +class grib_accessor_data_run_length_packing_t : public grib_accessor_values_t +{ +public: + /* 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; +}; + +class grib_accessor_class_data_run_length_packing_t : public grib_accessor_class_values_t +{ +public: + grib_accessor_class_data_run_length_packing_t(const char* name) : grib_accessor_class_values_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_run_length_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_run_length_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_secondary_bitmap.cc b/src/accessor/grib_accessor_class_data_secondary_bitmap.cc new file mode 100644 index 000000000..51bfb4afc --- /dev/null +++ b/src/accessor/grib_accessor_class_data_secondary_bitmap.cc @@ -0,0 +1,118 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_data_secondary_bitmap.h" + +grib_accessor_class_data_secondary_bitmap_t _grib_accessor_class_data_secondary_bitmap{"data_secondary_bitmap"}; +grib_accessor_class* grib_accessor_class_data_secondary_bitmap = &_grib_accessor_class_data_secondary_bitmap; + + +void grib_accessor_class_data_secondary_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_secondary_bitmap_t* self = (grib_accessor_data_secondary_bitmap_t*)a; + self->primary_bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); + self->secondary_bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, 1); + self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, 2); + self->expand_by = grib_arguments_get_name(grib_handle_of_accessor(a), args, 3); + + a->length = 0; +} + +void grib_accessor_class_data_secondary_bitmap_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_values(dumper, a); +} + +int grib_accessor_class_data_secondary_bitmap_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_secondary_bitmap_t* self = (grib_accessor_data_secondary_bitmap_t*)a; + + size_t i = 0; + size_t j = 0; + size_t k = 0; + size_t m = 0; + size_t n_vals = 0; + long nn = 0; + long expand_by = 0; + int err = 0; + size_t primary_len; + size_t secondary_len; + double* primary_vals; + double* secondary_vals; + err = a->value_count(&nn); n_vals = nn; + if (err) + return err; + + if (*len < n_vals) { + *len = n_vals; + return GRIB_ARRAY_TOO_SMALL; + } + + if ((err = grib_get_long(grib_handle_of_accessor(a), self->expand_by, &expand_by)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_size(grib_handle_of_accessor(a), self->primary_bitmap, &primary_len)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_size(grib_handle_of_accessor(a), self->secondary_bitmap, &secondary_len)) != GRIB_SUCCESS) + return err; + + primary_vals = (double*)grib_context_malloc(a->context, primary_len * sizeof(double)); + if (!primary_vals) + return GRIB_OUT_OF_MEMORY; + + secondary_vals = (double*)grib_context_malloc(a->context, secondary_len * sizeof(double)); + if (!secondary_vals) { + grib_context_free(a->context, primary_vals); + return GRIB_OUT_OF_MEMORY; + } + + if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->primary_bitmap, primary_vals, &primary_len)) != GRIB_SUCCESS) { + grib_context_free(a->context, secondary_vals); + grib_context_free(a->context, primary_vals); + return err; + } + + if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->secondary_bitmap, secondary_vals, &secondary_len)) != GRIB_SUCCESS) { + grib_context_free(a->context, secondary_vals); + grib_context_free(a->context, primary_vals); + return err; + } + + k = 0; + m = 0; + for (i = 0; i < primary_len; i++) { + /* if(primary_vals[i]) f++; */ + if (primary_vals[i]) { + for (j = 0; j < expand_by; j++) + val[k++] = secondary_vals[m++]; + } + else { + for (j = 0; j < expand_by; j++) + val[k++] = 0; + } + } + + Assert(k <= *len); + Assert(m <= secondary_len); + + /*printf("FOOBAR %d %d %ld %d\n",f,primary_len,expand_by,n_vals);*/ + + *len = n_vals; + + grib_context_free(a->context, primary_vals); + grib_context_free(a->context, secondary_vals); + return err; +} + +int grib_accessor_class_data_secondary_bitmap_t::get_native_type(grib_accessor* a){ + // grib_accessor_data_secondary_bitmap_t* self = (grib_accessor_data_secondary_bitmap_t*)a; + //return grib_accessor_get_native_type(grib_find_accessor(grib_handle_of_accessor(a),self->coded_values)); + return GRIB_TYPE_DOUBLE; +} diff --git a/src/accessor/grib_accessor_class_data_secondary_bitmap.h b/src/accessor/grib_accessor_class_data_secondary_bitmap.h new file mode 100644 index 000000000..3ac86e324 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_secondary_bitmap.h @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_secondary_bitmap_h +#define eccodes_accessor_data_secondary_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_data_secondary_bitmap_t : public grib_accessor_gen_t +{ +public: + /* Members defined in data_secondary_bitmap */ + const char* primary_bitmap; + const char* secondary_bitmap; + const char* missing_value; + const char* expand_by; +}; + +class grib_accessor_class_data_secondary_bitmap_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_data_secondary_bitmap_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_secondary_bitmap_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_secondary_bitmap_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_sh_packed.cc b/src/accessor/grib_accessor_class_data_sh_packed.cc similarity index 63% rename from src/accessor/todo/grib_accessor_class_data_sh_packed.cc rename to src/accessor/grib_accessor_class_data_sh_packed.cc index 25687d262..a1cb7a7ba 100644 --- a/src/accessor/todo/grib_accessor_class_data_sh_packed.cc +++ b/src/accessor/grib_accessor_class_data_sh_packed.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,142 +9,19 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_scaling.h" #include "grib_api_internal.h" -#include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_simple_packing - IMPLEMENTS = unpack_double - IMPLEMENTS = value_count - IMPLEMENTS = init - MEMBERS= const char* GRIBEX_sh_bug_present - MEMBERS= const char* ieee_floats - MEMBERS= const char* laplacianOperatorIsSet - MEMBERS= const char* laplacianOperator - MEMBERS= const char* sub_j - MEMBERS= const char* sub_k - MEMBERS= const char* sub_m - MEMBERS= const char* pen_j - MEMBERS= const char* pen_k - MEMBERS= const char* pen_m - END_CLASS_DEF - - */ - - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -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*); - -typedef struct grib_accessor_data_sh_packed -{ - 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_sh_packed */ - 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_sh_packed; - -extern grib_accessor_class* grib_accessor_class_data_simple_packing; - -static grib_accessor_class _grib_accessor_class_data_sh_packed = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_sh_packed", /* name */ - sizeof(grib_accessor_data_sh_packed), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_data_sh_packed.h" +#include "grib_scaling.h" +grib_accessor_class_data_sh_packed_t _grib_accessor_class_data_sh_packed{"data_sh_packed"}; grib_accessor_class* grib_accessor_class_data_sh_packed = &_grib_accessor_class_data_sh_packed; -/* 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) -{ - grib_accessor_data_sh_packed* self = (grib_accessor_data_sh_packed*)a; +void grib_accessor_class_data_sh_packed_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_sh_packed_t* self = (grib_accessor_data_sh_packed_t*)a; grib_handle* hand = grib_handle_of_accessor(a); self->GRIBEX_sh_bug_present = grib_arguments_get_name(hand, args, self->carg++); @@ -161,9 +39,8 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->length = 0; } -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_data_sh_packed* self = (grib_accessor_data_sh_packed*)a; +int grib_accessor_class_data_sh_packed_t::value_count(grib_accessor* a, long* count){ + grib_accessor_data_sh_packed_t* self = (grib_accessor_data_sh_packed_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int ret = 0; const char* cclass_name = a->cclass->name; @@ -198,9 +75,8 @@ 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_sh_packed* self = (grib_accessor_data_sh_packed*)a; +int grib_accessor_class_data_sh_packed_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_sh_packed_t* self = (grib_accessor_data_sh_packed_t*)a; size_t i = 0; int ret = GRIB_SUCCESS; @@ -234,8 +110,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) decode_float_proc decode_float = NULL; n_vals = 0; - err = grib_value_count(a, &n_vals); - if (err) + err = a->value_count(&n_vals); if (err) return err; if (*len < n_vals) { diff --git a/src/accessor/grib_accessor_class_data_sh_packed.h b/src/accessor/grib_accessor_class_data_sh_packed.h new file mode 100644 index 000000000..2d7cbdf47 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_sh_packed.h @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_sh_packed_h +#define eccodes_accessor_data_sh_packed_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_sh_packed_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_sh_packed */ + 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; +}; + +class grib_accessor_class_data_sh_packed_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_sh_packed_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_sh_packed_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_sh_packed_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_sh_unpacked.cc b/src/accessor/grib_accessor_class_data_sh_unpacked.cc similarity index 61% rename from src/accessor/todo/grib_accessor_class_data_sh_unpacked.cc rename to src/accessor/grib_accessor_class_data_sh_unpacked.cc index 394793612..842411f26 100644 --- a/src/accessor/todo/grib_accessor_class_data_sh_unpacked.cc +++ b/src/accessor/grib_accessor_class_data_sh_unpacked.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,142 +9,19 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_scaling.h" #include "grib_api_internal.h" -#include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_simple_packing - IMPLEMENTS = unpack_double - IMPLEMENTS = value_count - IMPLEMENTS = init - MEMBERS= const char* GRIBEX_sh_bug_present - MEMBERS= const char* ieee_floats - MEMBERS= const char* laplacianOperatorIsSet - MEMBERS= const char* laplacianOperator - MEMBERS= const char* sub_j - MEMBERS= const char* sub_k - MEMBERS= const char* sub_m - MEMBERS= const char* pen_j - MEMBERS= const char* pen_k - MEMBERS= const char* pen_m - END_CLASS_DEF - - */ - - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -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*); - -typedef struct grib_accessor_data_sh_unpacked -{ - 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_sh_unpacked */ - 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_sh_unpacked; - -extern grib_accessor_class* grib_accessor_class_data_simple_packing; - -static grib_accessor_class _grib_accessor_class_data_sh_unpacked = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_sh_unpacked", /* name */ - sizeof(grib_accessor_data_sh_unpacked), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_data_sh_unpacked.h" +#include "grib_scaling.h" +grib_accessor_class_data_sh_unpacked_t _grib_accessor_class_data_sh_unpacked{"data_sh_unpacked"}; grib_accessor_class* grib_accessor_class_data_sh_unpacked = &_grib_accessor_class_data_sh_unpacked; -/* 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) -{ - grib_accessor_data_sh_unpacked* self = (grib_accessor_data_sh_unpacked*)a; +void grib_accessor_class_data_sh_unpacked_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_sh_unpacked_t* self = (grib_accessor_data_sh_unpacked_t*)a; grib_handle* hand = grib_handle_of_accessor(a); self->GRIBEX_sh_bug_present = grib_arguments_get_name(hand, args, self->carg++); @@ -161,9 +39,8 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) a->length = 0; } -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_data_sh_unpacked* self = (grib_accessor_data_sh_unpacked*)a; +int grib_accessor_class_data_sh_unpacked_t::value_count(grib_accessor* a, long* count){ + grib_accessor_data_sh_unpacked_t* self = (grib_accessor_data_sh_unpacked_t*)a; int ret = 0; long sub_j = 0; @@ -185,9 +62,8 @@ 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_sh_unpacked* self = (grib_accessor_data_sh_unpacked*)a; +int grib_accessor_class_data_sh_unpacked_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_data_sh_unpacked_t* self = (grib_accessor_data_sh_unpacked_t*)a; size_t i = 0; int ret = GRIB_SUCCESS; @@ -234,8 +110,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) decode_float_proc decode_float = NULL; n_vals = 0; - err = grib_value_count(a, &n_vals); - if (err) + err = a->value_count(&n_vals); if (err) return err; if (*len < n_vals) { diff --git a/src/accessor/grib_accessor_class_data_sh_unpacked.h b/src/accessor/grib_accessor_class_data_sh_unpacked.h new file mode 100644 index 000000000..4b1e893c0 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_sh_unpacked.h @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_sh_unpacked_h +#define eccodes_accessor_data_sh_unpacked_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_sh_unpacked_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_sh_unpacked */ + 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; +}; + +class grib_accessor_class_data_sh_unpacked_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_sh_unpacked_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_sh_unpacked_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_sh_unpacked_h */ diff --git a/src/accessor/grib_accessor_class_data_shsimple_packing.cc b/src/accessor/grib_accessor_class_data_shsimple_packing.cc new file mode 100644 index 000000000..68fc83a7b --- /dev/null +++ b/src/accessor/grib_accessor_class_data_shsimple_packing.cc @@ -0,0 +1,60 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_data_shsimple_packing.h" + +grib_accessor_class_data_shsimple_packing_t _grib_accessor_class_data_shsimple_packing{"data_shsimple_packing"}; +grib_accessor_class* grib_accessor_class_data_shsimple_packing = &_grib_accessor_class_data_shsimple_packing; + + +void grib_accessor_class_data_shsimple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_shsimple_packing_t* self = (grib_accessor_data_shsimple_packing_t*)a; + + self->coded_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); + self->real_part = grib_arguments_get_name(grib_handle_of_accessor(a), args, 1); + a->flags |= GRIB_ACCESSOR_FLAG_DATA; + + a->length = 0; +} + +void grib_accessor_class_data_shsimple_packing_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_values(dumper, a); +} + +int grib_accessor_class_data_shsimple_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_shsimple_packing_t* self = (grib_accessor_data_shsimple_packing_t*)a; + int err = GRIB_SUCCESS; + + size_t coded_n_vals = *len - 1; + size_t n_vals = *len; + + self->dirty = 1; + + if (*len == 0) + return GRIB_NO_VALUES; + + if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->real_part, *val)) != GRIB_SUCCESS) + return err; + + val++; + + if ((err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, coded_n_vals)) != GRIB_SUCCESS) + return err; + + *len = n_vals; + + return err; +} + +int grib_accessor_class_data_shsimple_packing_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_DOUBLE; +} diff --git a/src/accessor/grib_accessor_class_data_shsimple_packing.h b/src/accessor/grib_accessor_class_data_shsimple_packing.h new file mode 100644 index 000000000..851907eb9 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_shsimple_packing.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_shsimple_packing_h +#define eccodes_accessor_data_shsimple_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_data_shsimple_packing_t : public grib_accessor_gen_t +{ +public: + /* Members defined in data_shsimple_packing */ + const char* coded_values; + const char* real_part; + int dirty; +}; + +class grib_accessor_class_data_shsimple_packing_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_data_shsimple_packing_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_shsimple_packing_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_shsimple_packing_h */ diff --git a/src/accessor/todo/grib_accessor_class_data_simple_packing.cc b/src/accessor/grib_accessor_class_data_simple_packing.cc similarity index 79% rename from src/accessor/todo/grib_accessor_class_data_simple_packing.cc rename to src/accessor/grib_accessor_class_data_simple_packing.cc index e78bda53c..f01a2c612 100644 --- a/src/accessor/todo/grib_accessor_class_data_simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_simple_packing.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,138 +9,20 @@ * 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_simple_packing.h" #include "grib_scaling.h" #include "grib_bits_any_endian_simple.h" #include "grib_optimize_decimal_factor.h" #include #include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_values - IMPLEMENTS = init - IMPLEMENTS = unpack_double;unpack_float - IMPLEMENTS = unpack_double_element;unpack_double_element_set - IMPLEMENTS = unpack_double_subarray - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - MEMBERS=int edition - MEMBERS=const char* units_factor - MEMBERS=const char* units_bias - MEMBERS=const char* changing_precision - MEMBERS=const char* number_of_values - MEMBERS=const char* bits_per_value - MEMBERS=const char* reference_value - MEMBERS=const char* binary_scale_factor - MEMBERS=const char* decimal_scale_factor - MEMBERS=const char* optimize_scaling_factor - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 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); -static int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len); - -typedef struct grib_accessor_data_simple_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; -} grib_accessor_data_simple_packing; - -extern grib_accessor_class* grib_accessor_class_values; - -static grib_accessor_class _grib_accessor_class_data_simple_packing = { - &grib_accessor_class_values, /* super */ - "data_simple_packing", /* name */ - sizeof(grib_accessor_data_simple_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - &unpack_double_subarray, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_data_simple_packing_t _grib_accessor_class_data_simple_packing{"data_simple_packing"}; grib_accessor_class* grib_accessor_class_data_simple_packing = &_grib_accessor_class_data_simple_packing; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; +void grib_accessor_class_data_simple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); self->units_factor = grib_arguments_get_name(gh, args, self->carg++); self->units_bias = grib_arguments_get_name(gh, args, self->carg++); @@ -163,8 +46,7 @@ static const unsigned long nbits[32] = { 0x40000000, 0x80000000 }; -static int number_of_bits(unsigned long x, long* result) -{ +static int number_of_bits(unsigned long x, long* result){ const int count = sizeof(nbits) / sizeof(nbits[0]); const unsigned long* n = nbits; *result = 0; @@ -178,17 +60,15 @@ static int number_of_bits(unsigned long x, long* result) return GRIB_SUCCESS; } -static int value_count(grib_accessor* a, long* number_of_values) -{ - grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; +int grib_accessor_class_data_simple_packing_t::value_count(grib_accessor* a, long* number_of_values){ + grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; *number_of_values = 0; return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, number_of_values); } -static int unpack_double_element(grib_accessor* a, size_t idx, double* val) -{ - grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; +int grib_accessor_class_data_simple_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ + grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; const char* cclass_name = a->cclass->name; long n_vals; @@ -205,8 +85,7 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) long pos = 0; n_vals = 0; - err = grib_value_count(a, &n_vals); - if (err) + err = a->value_count(&n_vals); if (err) return err; if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) @@ -237,8 +116,7 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) "%s: %s: creating %s, %ld values (idx=%zu)", cclass_name, __func__, a->name, n_vals, idx); - buf += grib_byte_offset(a); - + buf += a->byte_offset(); /*Assert(((bits_per_value*n_vals)/8) < (1<<29));*/ /* See GRIB-787 */ if (bits_per_value % 8) { @@ -270,8 +148,7 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) return err; } -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ +int grib_accessor_class_data_simple_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ int err = 0; size_t i = 0; for (i=0; i -static int unpack(grib_accessor* a, T* val, size_t* len) -{ +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_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; const char* cclass_name = a->cclass->name; grib_handle* gh = grib_handle_of_accessor(a); unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; @@ -307,8 +183,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) double units_factor = 1.0; double units_bias = 0.0; - err = grib_value_count(a, &count); - if (err) + err = a->value_count(&count); if (err) return err; n_vals = count; @@ -369,8 +244,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) grib_context_log(a->context, GRIB_LOG_DEBUG, "%s %s: Creating %s, %zu values", cclass_name, __func__, a->name, n_vals); - offsetBeforeData = grib_byte_offset(a); - buf += offsetBeforeData; + offsetBeforeData = a->byte_offset(); buf += offsetBeforeData; /*Assert(((bits_per_value*n_vals)/8) < (1<<29));*/ /* See GRIB-787 */ @@ -424,19 +298,16 @@ static int unpack(grib_accessor* a, T* val, size_t* len) return err; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_data_simple_packing_t::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) -{ +int grib_accessor_class_data_simple_packing_t::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; +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_t* self = (grib_accessor_data_simple_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; @@ -510,8 +381,7 @@ static int _unpack_double(grib_accessor* a, double* val, size_t* len, unsigned c grib_context_log(a->context, GRIB_LOG_DEBUG, "%s %s: Creating %s, %zu values", cclass_name, __func__, a->name, n_vals); - offsetBeforeData = grib_byte_offset(a); - buf += offsetBeforeData; + offsetBeforeData = a->byte_offset(); buf += offsetBeforeData; /*Assert(((bits_per_value*n_vals)/8) < (1<<29));*/ /* See GRIB-787 */ @@ -561,9 +431,8 @@ static int _unpack_double(grib_accessor* a, double* val, size_t* len, unsigned c return err; } -static int unpack_double_subarray(grib_accessor* a, double* val, size_t start, size_t len) -{ - grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; +int grib_accessor_class_data_simple_packing_t::unpack_double_subarray(grib_accessor* a, double* val, size_t start, size_t len){ + grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; size_t nvals = len; size_t* plen = &len; @@ -580,9 +449,8 @@ 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 pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; +int grib_accessor_class_data_simple_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; diff --git a/src/accessor/grib_accessor_class_data_simple_packing.h b/src/accessor/grib_accessor_class_data_simple_packing.h new file mode 100644 index 000000000..9187f37eb --- /dev/null +++ b/src/accessor/grib_accessor_class_data_simple_packing.h @@ -0,0 +1,48 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_simple_packing_h +#define eccodes_accessor_data_simple_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_values.h" + +class grib_accessor_data_simple_packing_t : public grib_accessor_values_t +{ +public: + /* 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; +}; + +class grib_accessor_class_data_simple_packing_t : public grib_accessor_class_values_t +{ +public: + grib_accessor_class_data_simple_packing_t(const char* name) : grib_accessor_class_values_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_simple_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; + int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len) override; +}; +#endif /* eccodes_accessor_data_simple_packing_h */ diff --git a/src/accessor/grib_accessor_class_decimal_precision.cc b/src/accessor/grib_accessor_class_decimal_precision.cc new file mode 100644 index 000000000..0ffe7b0c1 --- /dev/null +++ b/src/accessor/grib_accessor_class_decimal_precision.cc @@ -0,0 +1,103 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_decimal_precision.h" + +grib_accessor_class_decimal_precision_t _grib_accessor_class_decimal_precision{"decimal_precision"}; +grib_accessor_class* grib_accessor_class_decimal_precision = &_grib_accessor_class_decimal_precision; + + +void grib_accessor_class_decimal_precision_t::init(grib_accessor* a, const long l, grib_arguments* args){ + int n = 0; + grib_accessor_decimal_precision_t* self = (grib_accessor_decimal_precision_t*)a; + + self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->decimal_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->changing_precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +int grib_accessor_class_decimal_precision_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + int ret = 0; + grib_accessor_decimal_precision_t* self = (grib_accessor_decimal_precision_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + + if ((ret = grib_get_long_internal(h, self->decimal_scale_factor, val)) != GRIB_SUCCESS) + return ret; + + *len = 1; + return ret; +} + +int grib_accessor_class_decimal_precision_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + long bitsPerValue = 0; + double* values = NULL; + size_t size = 0; + int ret = 0; + grib_accessor_decimal_precision_t* self = (grib_accessor_decimal_precision_t*)a; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if (!self->values) { + if ((ret = grib_set_long_internal(h, self->bits_per_value, 0)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_set_long_internal(h, self->decimal_scale_factor, *val)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_set_long_internal(h, self->changing_precision, 1)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return ret; + } + + return GRIB_SUCCESS; + } + + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; + + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; + + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_buffer_free(c, values); + return ret; + } + + if ((ret = grib_set_long_internal(h, self->decimal_scale_factor, *val)) != GRIB_SUCCESS) { + grib_context_buffer_free(c, values); + return ret; + } + + if ((ret = grib_set_long_internal(h, self->bits_per_value, bitsPerValue)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return ret; + } + + if ((ret = grib_set_long_internal(h, self->changing_precision, 1)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return ret; + } + + if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { + grib_context_buffer_free(c, values); + return ret; + } + + grib_context_free(c, values); + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_decimal_precision.h b/src/accessor/grib_accessor_class_decimal_precision.h new file mode 100644 index 000000000..455d77946 --- /dev/null +++ b/src/accessor/grib_accessor_class_decimal_precision.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_decimal_precision_h +#define eccodes_accessor_decimal_precision_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_decimal_precision_t : public grib_accessor_long_t +{ +public: + /* Members defined in decimal_precision */ + const char* values; + const char* bits_per_value; + const char* changing_precision; + const char* decimal_scale_factor; +}; + +class grib_accessor_class_decimal_precision_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_decimal_precision_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_decimal_precision_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_decimal_precision_h */ diff --git a/src/accessor/todo/grib_accessor_class_dictionary.cc b/src/accessor/grib_accessor_class_dictionary.cc similarity index 62% rename from src/accessor/todo/grib_accessor_class_dictionary.cc rename to src/accessor/grib_accessor_class_dictionary.cc index dde22abdc..e078cde45 100644 --- a/src/accessor/todo/grib_accessor_class_dictionary.cc +++ b/src/accessor/grib_accessor_class_dictionary.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,113 +10,15 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_dictionary.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;dump;unpack_string;unpack_long;unpack_double - IMPLEMENTS = value_count; get_native_type; - MEMBERS = const char* dictionary - MEMBERS = const char* key - MEMBERS = long column - MEMBERS = const char* masterDir - MEMBERS = const char* localDir - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_double(grib_accessor*, double* 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 value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_dictionary -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in dictionary */ - const char* dictionary; - const char* key; - long column; - const char* masterDir; - const char* localDir; -} grib_accessor_dictionary; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_dictionary = { - &grib_accessor_class_gen, /* super */ - "dictionary", /* name */ - sizeof(grib_accessor_dictionary), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_dictionary_t _grib_accessor_class_dictionary{"dictionary"}; grib_accessor_class* grib_accessor_class_dictionary = &_grib_accessor_class_dictionary; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* params) -{ +void grib_accessor_class_dictionary_t::init(grib_accessor* a, const long len, grib_arguments* params){ int n = 0; - grib_accessor_dictionary* self = (grib_accessor_dictionary*)a; + grib_accessor_dictionary_t* self = (grib_accessor_dictionary_t*)a; self->dictionary = grib_arguments_get_string(grib_handle_of_accessor(a), params, n++); self->key = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); @@ -129,7 +32,7 @@ static void init(grib_accessor* a, const long len, grib_arguments* params) static grib_trie* load_dictionary(grib_accessor* a, int* err) { - grib_accessor_dictionary* self = (grib_accessor_dictionary*)a; + grib_accessor_dictionary_t* self = (grib_accessor_dictionary_t*)a; char* filename = NULL; char line[1024] = {0,}; @@ -243,8 +146,7 @@ static grib_trie* load_dictionary(grib_accessor* a, int* err) return dictionary; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_dictionary_t::dump(grib_accessor* a, grib_dumper* dumper){ switch (get_native_type(a)) { case GRIB_TYPE_STRING: grib_dump_string(dumper, a, NULL); @@ -258,9 +160,8 @@ static void dump(grib_accessor* a, grib_dumper* dumper) } } -static int unpack_string(grib_accessor* a, char* buffer, size_t* len) -{ - grib_accessor_dictionary* self = (grib_accessor_dictionary*)a; +int grib_accessor_class_dictionary_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ + grib_accessor_dictionary_t* self = (grib_accessor_dictionary_t*)a; int err = GRIB_SUCCESS; char key[1024] = {0,}; size_t size = 1024; @@ -313,14 +214,12 @@ static int unpack_string(grib_accessor* a, char* buffer, size_t* len) return err; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_dictionary_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_dictionary_t::get_native_type(grib_accessor* a){ int type = GRIB_TYPE_DOUBLE; if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) type = GRIB_TYPE_LONG; @@ -329,8 +228,7 @@ static int get_native_type(grib_accessor* a) return type; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ +int grib_accessor_class_dictionary_t::unpack_long(grib_accessor* a, long* val, size_t* len){ int err = 0; char buffer[1024] = {0,}; size_t size = 1024; @@ -345,8 +243,7 @@ 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) -{ +int grib_accessor_class_dictionary_t::unpack_double(grib_accessor* a, double* val, size_t* len){ int err = 0; char buffer[1024] = {0,}; size_t size = 1024; diff --git a/src/accessor/grib_accessor_class_dictionary.h b/src/accessor/grib_accessor_class_dictionary.h new file mode 100644 index 000000000..7f86a44ae --- /dev/null +++ b/src/accessor/grib_accessor_class_dictionary.h @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_dictionary_h +#define eccodes_accessor_dictionary_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_dictionary_t : public grib_accessor_gen_t +{ +public: + /* Members defined in dictionary */ + const char* dictionary; + const char* key; + long column; + const char* masterDir; + const char* localDir; +}; + +class grib_accessor_class_dictionary_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_dictionary_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_dictionary_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_dictionary_h */ diff --git a/src/accessor/grib_accessor_class_dirty.cc b/src/accessor/grib_accessor_class_dirty.cc new file mode 100644 index 000000000..633c3dee2 --- /dev/null +++ b/src/accessor/grib_accessor_class_dirty.cc @@ -0,0 +1,47 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_dirty.h" + +grib_accessor_class_dirty_t _grib_accessor_class_dirty{"dirty"}; +grib_accessor_class* grib_accessor_class_dirty = &_grib_accessor_class_dirty; + + +void grib_accessor_class_dirty_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_dirty_t* self = (grib_accessor_dirty_t*)a; + self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; + a->length = 0; +} + +int grib_accessor_class_dirty_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_dirty_t* self = (grib_accessor_dirty_t*)a; + grib_accessor* x = grib_find_accessor(grib_handle_of_accessor(a), self->accessor); + + if (x) + x->dirty = *val; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_dirty_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_dirty_t* self = (grib_accessor_dirty_t*)a; + grib_accessor* x = grib_find_accessor(grib_handle_of_accessor(a), self->accessor); + + if (x) + x->dirty = 1; + + *val = 1; + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_dirty.h b/src/accessor/grib_accessor_class_dirty.h new file mode 100644 index 000000000..7a008ce29 --- /dev/null +++ b/src/accessor/grib_accessor_class_dirty.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_dirty_h +#define eccodes_accessor_dirty_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_dirty_t : public grib_accessor_long_t +{ +public: + /* Members defined in dirty */ + const char* accessor; +}; + +class grib_accessor_class_dirty_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_dirty_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_dirty_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_dirty_h */ diff --git a/src/accessor/grib_accessor_class_divdouble.cc b/src/accessor/grib_accessor_class_divdouble.cc new file mode 100644 index 000000000..03a1b63b5 --- /dev/null +++ b/src/accessor/grib_accessor_class_divdouble.cc @@ -0,0 +1,43 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_divdouble.h" + +grib_accessor_class_divdouble_t _grib_accessor_class_divdouble{"divdouble"}; +grib_accessor_class* grib_accessor_class_divdouble = &_grib_accessor_class_divdouble; + + +void grib_accessor_class_divdouble_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_divdouble_t* self = (grib_accessor_divdouble_t*)a; + int n = 0; + + self->val = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->divisor = grib_arguments_get_double(grib_handle_of_accessor(a), c, n++); +} + +int grib_accessor_class_divdouble_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + const grib_accessor_divdouble_t* self = (grib_accessor_divdouble_t*)a; + int ret = GRIB_SUCCESS; + double value = 0; + + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->val, &value); + if (ret != GRIB_SUCCESS) + return ret; + + if (self->divisor == 0) { + return GRIB_INVALID_ARGUMENT; + } + *val = value / self->divisor; + + *len = 1; + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_divdouble.h b/src/accessor/grib_accessor_class_divdouble.h new file mode 100644 index 000000000..e10239676 --- /dev/null +++ b/src/accessor/grib_accessor_class_divdouble.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_divdouble_h +#define eccodes_accessor_divdouble_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_divdouble_t : public grib_accessor_double_t +{ +public: + /* Members defined in divdouble */ + const char* val; + double divisor; +}; + +class grib_accessor_class_divdouble_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_divdouble_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_divdouble_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_divdouble_h */ diff --git a/src/accessor/grib_accessor_class_double.cc b/src/accessor/grib_accessor_class_double.cc new file mode 100644 index 000000000..2d8e019a7 --- /dev/null +++ b/src/accessor/grib_accessor_class_double.cc @@ -0,0 +1,105 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_double.h" + +grib_accessor_class_double_t _grib_accessor_class_double{"double"}; +grib_accessor_class* grib_accessor_class_double = &_grib_accessor_class_double; + + +int grib_accessor_class_double_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_DOUBLE; +} + +int grib_accessor_class_double_t::unpack_string(grib_accessor* a, char* v, size_t* len){ + double val = 0; + size_t l = 1; + char repres[1024]; + char format[32] = "%g"; + grib_handle* h = grib_handle_of_accessor(a); + const char* cclass_name = a->cclass->name; + + a->unpack_double(&val, &l); + if ((val == GRIB_MISSING_DOUBLE) && ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0)) { + snprintf(repres, sizeof(repres), "MISSING"); + } else { + size_t size = sizeof(format); + grib_get_string(h, "formatForDoubles", format, &size); + snprintf(repres, sizeof(repres), format, val); + } + + l = strlen(repres) + 1; + + if (l > *len) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + cclass_name, a->name, l, *len); + *len = l; + return GRIB_BUFFER_TOO_SMALL; + } + grib_context_log(a->context, GRIB_LOG_DEBUG, "grib_accessor_long: Casting double %s to string ", a->name); + + *len = l; + + strcpy(v, repres); + return GRIB_SUCCESS; +} + +void grib_accessor_class_double_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_values(dumper, a); +} + +int grib_accessor_class_double_t::compare(grib_accessor* a, grib_accessor* b){ + int retval = 0; + double* aval = 0; + double* bval = 0; + + size_t alen = 0; + size_t blen = 0; + long count = 0; + int err = 0; + + err = a->value_count(&count); if (err) + return err; + alen = count; + + err = b->value_count(&count); if (err) + return err; + blen = count; + + if (alen != blen) + return GRIB_COUNT_MISMATCH; + + aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); + bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); + + a->unpack_double(aval, &alen); b->unpack_double(bval, &blen); + retval = GRIB_SUCCESS; + while (alen != 0) { + if (*bval != *aval) + retval = GRIB_DOUBLE_VALUE_MISMATCH; + alen--; + } + + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); + + return retval; +} + +int grib_accessor_class_double_t::pack_missing(grib_accessor* a){ + size_t len = 1; + double value = GRIB_MISSING_DOUBLE; + + if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) + return a->pack_double(&value, &len); return GRIB_VALUE_CANNOT_BE_MISSING; +} diff --git a/src/accessor/grib_accessor_class_double.h b/src/accessor/grib_accessor_class_double.h new file mode 100644 index 000000000..865bab9bc --- /dev/null +++ b/src/accessor/grib_accessor_class_double.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_double_h +#define eccodes_accessor_double_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_double_t : public grib_accessor_gen_t +{ +public: + /* Members defined in double */ +}; + +class grib_accessor_class_double_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_double_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_double_t{}; } + int get_native_type(grib_accessor*) override; + int pack_missing(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_double_h */ diff --git a/src/accessor/todo/grib_accessor_class_element.cc b/src/accessor/grib_accessor_class_element.cc similarity index 55% rename from src/accessor/todo/grib_accessor_class_element.cc rename to src/accessor/grib_accessor_class_element.cc index 2041cd62d..a393a57aa 100644 --- a/src/accessor/todo/grib_accessor_class_element.cc +++ b/src/accessor/grib_accessor_class_element.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,104 +10,14 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long; - IMPLEMENTS = unpack_double - IMPLEMENTS = init - MEMBERS=const char* array - MEMBERS=long element - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_element -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in element */ - const char* array; - long element; -} grib_accessor_element; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_element = { - &grib_accessor_class_long, /* super */ - "element", /* name */ - sizeof(grib_accessor_element), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_element.h" +grib_accessor_class_element_t _grib_accessor_class_element{"element"}; grib_accessor_class* grib_accessor_class_element = &_grib_accessor_class_element; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_element* self = (grib_accessor_element*)a; +void grib_accessor_class_element_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_element_t* self = (grib_accessor_element_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; @@ -114,8 +25,7 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->element = grib_arguments_get_long(hand, c, n++); } -static int check_element_index(const char* func, const char* array_name, long index, size_t size) -{ +int check_element_index(const char* func, const char* array_name, long index, size_t size){ const grib_context* c = grib_context_get_default(); if (index < 0 || index >= size) { grib_context_log(c, GRIB_LOG_ERROR, "%s: Invalid element index %ld for array '%s'. Value must be between 0 and %zu", @@ -125,9 +35,8 @@ static int check_element_index(const char* func, const char* array_name, long in return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_element* self = (grib_accessor_element*)a; +int grib_accessor_class_element_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_element_t* self = (grib_accessor_element_t*)a; int ret = 0; size_t size = 0; long* ar = NULL; @@ -168,9 +77,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_element* self = (grib_accessor_element*)a; +int grib_accessor_class_element_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_element_t* self = (grib_accessor_element_t*)a; int ret = 0; size_t size = 0; long* ar = NULL; @@ -216,9 +124,8 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_element* self = (grib_accessor_element*)a; +int grib_accessor_class_element_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_element_t* self = (grib_accessor_element_t*)a; int ret = 0; size_t size = 0; double* ar = NULL; diff --git a/src/accessor/grib_accessor_class_element.h b/src/accessor/grib_accessor_class_element.h new file mode 100644 index 000000000..f22109be2 --- /dev/null +++ b/src/accessor/grib_accessor_class_element.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_element_h +#define eccodes_accessor_element_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_element_t : public grib_accessor_long_t +{ +public: + /* Members defined in element */ + const char* array; + long element; +}; + +class grib_accessor_class_element_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_element_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_element_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_element_h */ diff --git a/src/accessor/grib_accessor_class_evaluate.cc b/src/accessor/grib_accessor_class_evaluate.cc new file mode 100644 index 000000000..62228b065 --- /dev/null +++ b/src/accessor/grib_accessor_class_evaluate.cc @@ -0,0 +1,33 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_evaluate.h" + +grib_accessor_class_evaluate_t _grib_accessor_class_evaluate{"evaluate"}; +grib_accessor_class* grib_accessor_class_evaluate = &_grib_accessor_class_evaluate; + + +void grib_accessor_class_evaluate_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_evaluate_t* self = (grib_accessor_evaluate_t*)a; + self->arg = c; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_evaluate_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_evaluate_t* self = (grib_accessor_evaluate_t*)a; + grib_expression* e = grib_arguments_get_expression(grib_handle_of_accessor(a), self->arg, 0); + + int ret = grib_expression_evaluate_long(grib_handle_of_accessor(a), e, val); + *len = 1; + + return ret; +} diff --git a/src/accessor/grib_accessor_class_evaluate.h b/src/accessor/grib_accessor_class_evaluate.h new file mode 100644 index 000000000..e65c6473b --- /dev/null +++ b/src/accessor/grib_accessor_class_evaluate.h @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_evaluate_h +#define eccodes_accessor_evaluate_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_evaluate_t : public grib_accessor_long_t +{ +public: + /* Members defined in evaluate */ + grib_arguments* arg; +}; + +class grib_accessor_class_evaluate_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_evaluate_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_evaluate_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_evaluate_h */ diff --git a/src/accessor/todo/grib_accessor_class_expanded_descriptors.cc b/src/accessor/grib_accessor_class_expanded_descriptors.cc similarity index 80% rename from src/accessor/todo/grib_accessor_class_expanded_descriptors.cc rename to src/accessor/grib_accessor_class_expanded_descriptors.cc index 11f4ba73b..8a12d93ff 100644 --- a/src/accessor/todo/grib_accessor_class_expanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_expanded_descriptors.cc @@ -1,137 +1,21 @@ -/* -* (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. -*/ - -/* Sequences and replication (not delayed) are resolved in this class. - Number of elements to which a delayed replication applies are recomputed to - take account of the expansion. - Expanded descriptors cannot contain sequences and only delayed replication - can appear -*/ - -#include "grib_scaling.h" -#include "grib_api_internal.h" -/* -This is used by make_class.pl - -START_CLASS_DEF -CLASS = accessor -SUPER = grib_accessor_class_long -IMPLEMENTS = unpack_long;pack_long -IMPLEMENTS = unpack_double -IMPLEMENTS = unpack_string_array -IMPLEMENTS = init;destroy -IMPLEMENTS = value_count; get_native_type -MEMBERS = const char* unexpandedDescriptors -MEMBERS = const char* sequence -MEMBERS = const char* expandedName -MEMBERS = const char* tablesAccessorName -MEMBERS = bufr_descriptors_array* expanded -MEMBERS = int rank -MEMBERS = grib_accessor* expandedAccessor -MEMBERS = int do_expand -MEMBERS = grib_accessor* tablesAccessor - -END_CLASS_DEF - -*/ - -/* START_CLASS_IMP */ /* + * (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. + */ -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int unpack_string_array(grib_accessor*, char**, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_expanded_descriptors -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in expanded_descriptors */ - const char* unexpandedDescriptors; - const char* sequence; - const char* expandedName; - const char* tablesAccessorName; - bufr_descriptors_array* expanded; - int rank; - grib_accessor* expandedAccessor; - int do_expand; - grib_accessor* tablesAccessor; -} grib_accessor_expanded_descriptors; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_expanded_descriptors = { - &grib_accessor_class_long, /* super */ - "expanded_descriptors", /* name */ - sizeof(grib_accessor_expanded_descriptors), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - &unpack_string_array, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_api_internal.h" +#include "grib_accessor_class_expanded_descriptors.h" +#include "grib_scaling.h" +grib_accessor_class_expanded_descriptors_t _grib_accessor_class_expanded_descriptors{"expanded_descriptors"}; grib_accessor_class* grib_accessor_class_expanded_descriptors = &_grib_accessor_class_expanded_descriptors; -/* END_CLASS_IMP */ #define MYDEBUG 0 #define DESC_SIZE_INIT 400 /* Initial size for grib_bufr_descriptors_array_new */ @@ -158,9 +42,8 @@ typedef struct change_coding_params result = grib_bufr_descriptors_array_pop_front(array); \ } -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; +void grib_accessor_class_expanded_descriptors_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; int n = 0; grib_handle* hand = grib_handle_of_accessor(a); self->tablesAccessorName = grib_arguments_get_name(hand, args, n++); @@ -205,10 +88,9 @@ static char* descriptor_type_name(int dtype) } #endif -static void __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_descriptors_array* expanded, change_coding_params* ccp, int* err) -{ +void __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_descriptors_array* expanded, change_coding_params* ccp, int* err){ int k, j, i; - grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; + grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; size_t size = 0; long* v_array = NULL; bufr_descriptor* u = NULL; @@ -581,9 +463,8 @@ static bufr_descriptors_array* do_expand(grib_accessor* a, bufr_descriptors_arra return expanded; } -static int expand(grib_accessor* a) -{ - grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; +int expand(grib_accessor* a){ + grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; int err = 0; size_t unexpandedSize = 0; /* grib_iarray* unexp=0; */ @@ -605,7 +486,7 @@ static int expand(grib_accessor* a) self->do_expand = 0; if (self->rank != 0) { err = expand(self->expandedAccessor); - self->expanded = ((grib_accessor_expanded_descriptors*)self->expandedAccessor)->expanded; + self->expanded = ((grib_accessor_expanded_descriptors_t*)self->expandedAccessor)->expanded; return err; } @@ -706,21 +587,20 @@ static int expand(grib_accessor* a) int grib_accessor_class_expanded_descriptors_set_do_expand(grib_accessor* a, long do_expand) { - grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; + grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; self->do_expand = do_expand; return 0; } bufr_descriptors_array* grib_accessor_class_expanded_descriptors_get_expanded(grib_accessor* a, int* err) { - const grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; + const grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; *err = expand(a); return self->expanded; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; +int grib_accessor_class_expanded_descriptors_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; int ret = 0; size_t i = 0; size_t expandedSize; @@ -753,9 +633,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; +int grib_accessor_class_expanded_descriptors_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; int ret = 0; size_t rlen = 0; size_t i = 0; @@ -799,8 +678,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) -{ +int grib_accessor_class_expanded_descriptors_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len){ int err = 0; long* v = NULL; char buf[25] = {0,}; @@ -808,13 +686,11 @@ static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) size_t i = 0, size = 0; const grib_context* c = a->context; - err = grib_value_count(a, &llen); - if (err) return err; + err = a->value_count(&llen); if (err) return err; size = llen; v = (long*)grib_context_malloc_clear(c, sizeof(long) * size); - err = grib_unpack_long(a, v, &size); - if (err) return err; + err = a->unpack_long(v, &size); if (err) return err; for (i = 0; i < size; i++) { snprintf(buf, sizeof(buf), "%06ld", v[i]); @@ -826,16 +702,14 @@ static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; +int grib_accessor_class_expanded_descriptors_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; self->do_expand = 1; return GRIB_NOT_IMPLEMENTED; } -static int value_count(grib_accessor* a, long* rlen) -{ - grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; +int grib_accessor_class_expanded_descriptors_t::value_count(grib_accessor* a, long* rlen){ + grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; int err = 0; *rlen = 0; @@ -849,16 +723,14 @@ static int value_count(grib_accessor* a, long* rlen) return err; } -static void destroy(grib_context* c, grib_accessor* a) -{ - // grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; +void grib_accessor_class_expanded_descriptors_t::destroy(grib_context* c, grib_accessor* a){ + // grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; // if (self->rank==0 && self->expanded) // grib_bufr_descriptors_array_delete(self->expanded); } -static int get_native_type(grib_accessor* a) -{ - grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; +int grib_accessor_class_expanded_descriptors_t::get_native_type(grib_accessor* a){ + grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; if (self->rank == 2) return GRIB_TYPE_DOUBLE; else diff --git a/src/accessor/grib_accessor_class_expanded_descriptors.h b/src/accessor/grib_accessor_class_expanded_descriptors.h new file mode 100644 index 000000000..be2094d4f --- /dev/null +++ b/src/accessor/grib_accessor_class_expanded_descriptors.h @@ -0,0 +1,47 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_expanded_descriptors_h +#define eccodes_accessor_expanded_descriptors_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_expanded_descriptors_t : public grib_accessor_long_t +{ +public: + /* Members defined in expanded_descriptors */ + const char* unexpandedDescriptors; + const char* sequence; + const char* expandedName; + const char* tablesAccessorName; + bufr_descriptors_array* expanded; + int rank; + grib_accessor* expandedAccessor; + int do_expand; + grib_accessor* tablesAccessor; +}; + +class grib_accessor_class_expanded_descriptors_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_expanded_descriptors_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_expanded_descriptors_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_expanded_descriptors_h */ diff --git a/src/accessor/todo/grib_accessor_class_from_scale_factor_scaled_value.cc b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc similarity index 59% rename from src/accessor/todo/grib_accessor_class_from_scale_factor_scaled_value.cc rename to src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc index 53784e172..3ba6e198e 100644 --- a/src/accessor/todo/grib_accessor_class_from_scale_factor_scaled_value.cc +++ b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,110 +10,14 @@ */ #include "grib_api_internal.h" -#include -#ifdef ECCODES_ON_WINDOWS - #include -#endif - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double;pack_double;is_missing - IMPLEMENTS = value_count - IMPLEMENTS = init - MEMBERS=const char* scaleFactor - MEMBERS=const char* scaledValue - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int is_missing(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 value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_from_scale_factor_scaled_value -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in from_scale_factor_scaled_value */ - const char* scaleFactor; - const char* scaledValue; -} grib_accessor_from_scale_factor_scaled_value; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_from_scale_factor_scaled_value = { - &grib_accessor_class_double, /* super */ - "from_scale_factor_scaled_value", /* name */ - sizeof(grib_accessor_from_scale_factor_scaled_value), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - &is_missing, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_from_scale_factor_scaled_value.h" +grib_accessor_class_from_scale_factor_scaled_value_t _grib_accessor_class_from_scale_factor_scaled_value{"from_scale_factor_scaled_value"}; grib_accessor_class* grib_accessor_class_from_scale_factor_scaled_value = &_grib_accessor_class_from_scale_factor_scaled_value; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_from_scale_factor_scaled_value* self = (grib_accessor_from_scale_factor_scaled_value*)a; +void grib_accessor_class_from_scale_factor_scaled_value_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_from_scale_factor_scaled_value_t* self = (grib_accessor_from_scale_factor_scaled_value_t*)a; int n = 0; grib_handle* hand = grib_handle_of_accessor(a); @@ -123,11 +28,10 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) // a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ +int grib_accessor_class_from_scale_factor_scaled_value_t::pack_double(grib_accessor* a, const double* val, size_t* len){ // See ECC-979 and ECC-1416 // Evaluate self->scaleFactor and self->scaledValue from input double '*val' - grib_accessor_from_scale_factor_scaled_value* self = (grib_accessor_from_scale_factor_scaled_value*)a; + grib_accessor_from_scale_factor_scaled_value_t* self = (grib_accessor_from_scale_factor_scaled_value_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int err = 0; int64_t factor = 0; @@ -181,9 +85,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_from_scale_factor_scaled_value* self = (grib_accessor_from_scale_factor_scaled_value*)a; +int grib_accessor_class_from_scale_factor_scaled_value_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_from_scale_factor_scaled_value_t* self = (grib_accessor_from_scale_factor_scaled_value_t*)a; int err = 0; long scaleFactor = 0, scaledValue = 0; grib_handle* hand = grib_handle_of_accessor(a); @@ -257,9 +160,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } -static int is_missing(grib_accessor* a) -{ - grib_accessor_from_scale_factor_scaled_value* self = (grib_accessor_from_scale_factor_scaled_value*)a; +int grib_accessor_class_from_scale_factor_scaled_value_t::is_missing(grib_accessor* a){ + grib_accessor_from_scale_factor_scaled_value_t* self = (grib_accessor_from_scale_factor_scaled_value_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int err = 0; long scaleFactor = 0, scaledValue = 0; @@ -273,9 +175,8 @@ static int is_missing(grib_accessor* a) return ((scaleFactor == GRIB_MISSING_LONG) || (scaledValue == GRIB_MISSING_LONG)); } -static int value_count(grib_accessor* a, long* len) -{ - grib_accessor_from_scale_factor_scaled_value* self = (grib_accessor_from_scale_factor_scaled_value*)a; +int grib_accessor_class_from_scale_factor_scaled_value_t::value_count(grib_accessor* a, long* len){ + grib_accessor_from_scale_factor_scaled_value_t* self = (grib_accessor_from_scale_factor_scaled_value_t*)a; int err = 0; grib_handle* hand = grib_handle_of_accessor(a); size_t vsize; diff --git a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h new file mode 100644 index 000000000..1874c559f --- /dev/null +++ b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_from_scale_factor_scaled_value_h +#define eccodes_accessor_from_scale_factor_scaled_value_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_from_scale_factor_scaled_value_t : public grib_accessor_double_t +{ +public: + /* Members defined in from_scale_factor_scaled_value */ + const char* scaleFactor; + const char* scaledValue; +}; + +class grib_accessor_class_from_scale_factor_scaled_value_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_from_scale_factor_scaled_value_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_from_scale_factor_scaled_value_t{}; } + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_from_scale_factor_scaled_value_h */ diff --git a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc new file mode 100644 index 000000000..cf115535f --- /dev/null +++ b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc @@ -0,0 +1,60 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g1_half_byte_codeflag.h" + +grib_accessor_class_g1_half_byte_codeflag_t _grib_accessor_class_g1_half_byte_codeflag{"g1_half_byte_codeflag"}; +grib_accessor_class* grib_accessor_class_g1_half_byte_codeflag = &_grib_accessor_class_g1_half_byte_codeflag; + + +void grib_accessor_class_g1_half_byte_codeflag_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; +} + +void grib_accessor_class_g1_half_byte_codeflag_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_long(dumper, a, NULL); +} + +int grib_accessor_class_g1_half_byte_codeflag_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + unsigned char dat = 0; + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + dat = grib_handle_of_accessor(a)->buffer->data[a->offset] & 0x0f; + + *val = dat; + *len = 1; + return GRIB_SUCCESS; +} + +int grib_accessor_class_g1_half_byte_codeflag_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + int ret = 0; + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + /* printf("HALF BYTE pack long %ld %02x\n",*val,grib_handle_of_accessor(a)->buffer->data[a->offset]);*/ + grib_handle_of_accessor(a)->buffer->data[a->offset] = (a->parent->h->buffer->data[a->offset] & 0xf0) | (*val & 0x0f); + /* printf("HALF BYTE pack long %ld %02x\n",*val,grib_handle_of_accessor(a)->buffer->data[a->offset]);*/ + + *len = 1; + return ret; +} + +int grib_accessor_class_g1_half_byte_codeflag_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h new file mode 100644 index 000000000..9c5890aa3 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1_half_byte_codeflag_h +#define eccodes_accessor_g1_half_byte_codeflag_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_g1_half_byte_codeflag_t : public grib_accessor_gen_t +{ +public: + /* Members defined in g1_half_byte_codeflag */ +}; + +class grib_accessor_class_g1_half_byte_codeflag_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_g1_half_byte_codeflag_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1_half_byte_codeflag_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1_half_byte_codeflag_h */ diff --git a/src/accessor/todo/grib_accessor_class_g1_message_length.cc b/src/accessor/grib_accessor_class_g1_message_length.cc similarity index 53% rename from src/accessor/todo/grib_accessor_class_g1_message_length.cc rename to src/accessor/grib_accessor_class_g1_message_length.cc index 1d38e7ea4..9b318b6a0 100644 --- a/src/accessor/todo/grib_accessor_class_g1_message_length.cc +++ b/src/accessor/grib_accessor_class_g1_message_length.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,103 +10,14 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_section_length - IMPLEMENTS = init;unpack_long;pack_long - MEMBERS = const char *sec4_length - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1_message_length -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in section_length */ - /* Members defined in g1_message_length */ - const char *sec4_length; -} grib_accessor_g1_message_length; - -extern grib_accessor_class* grib_accessor_class_section_length; - -static grib_accessor_class _grib_accessor_class_g1_message_length = { - &grib_accessor_class_section_length, /* super */ - "g1_message_length", /* name */ - sizeof(grib_accessor_g1_message_length), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_g1_message_length.h" +grib_accessor_class_g1_message_length_t _grib_accessor_class_g1_message_length{"g1_message_length"}; grib_accessor_class* grib_accessor_class_g1_message_length = &_grib_accessor_class_g1_message_length; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_g1_message_length* self = (grib_accessor_g1_message_length*)a; +void grib_accessor_class_g1_message_length_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_g1_message_length_t* self = (grib_accessor_g1_message_length_t*)a; self->sec4_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); } @@ -148,9 +60,8 @@ int grib_get_g1_message_size(grib_handle* h, grib_accessor* tl, grib_accessor* s return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_g1_message_length* self = (grib_accessor_g1_message_length*)a; +int grib_accessor_class_g1_message_length_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_g1_message_length_t* self = (grib_accessor_g1_message_length_t*)a; /*grib_accessor_class* super = *(a->cclass->super);*/ /* Here we assume that the totalLength will be coded AFTER the section4 length, and @@ -182,7 +93,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) tlen = 0x800000 | t120; *len = 1; - if ((ret = grib_pack_long(s4, &slen, len)) != GRIB_SUCCESS) + if ((ret = s4->pack_long(&slen, len)) != GRIB_SUCCESS) return ret; *len = 1; @@ -211,9 +122,8 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g1_message_length* self = (grib_accessor_g1_message_length*)a; +int grib_accessor_class_g1_message_length_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g1_message_length_t* self = (grib_accessor_g1_message_length_t*)a; int ret; long total_length, sec4_length; diff --git a/src/accessor/grib_accessor_class_g1_message_length.h b/src/accessor/grib_accessor_class_g1_message_length.h new file mode 100644 index 000000000..c3b865ec0 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1_message_length.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1_message_length_h +#define eccodes_accessor_g1_message_length_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_section_length.h" + +class grib_accessor_g1_message_length_t : public grib_accessor_section_length_t +{ +public: + /* Members defined in g1_message_length */ + const char *sec4_length; +}; + +class grib_accessor_class_g1_message_length_t : public grib_accessor_class_section_length_t +{ +public: + grib_accessor_class_g1_message_length_t(const char* name) : grib_accessor_class_section_length_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1_message_length_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1_message_length_h */ diff --git a/src/accessor/grib_accessor_class_g1_section4_length.cc b/src/accessor/grib_accessor_class_g1_section4_length.cc new file mode 100644 index 000000000..858ef0d69 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1_section4_length.cc @@ -0,0 +1,53 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g1_section4_length.h" + +grib_accessor_class_g1_section4_length_t _grib_accessor_class_g1_section4_length{"g1_section4_length"}; +grib_accessor_class* grib_accessor_class_g1_section4_length = &_grib_accessor_class_g1_section4_length; + + +void grib_accessor_class_g1_section4_length_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_g1_section4_length_t* self = (grib_accessor_g1_section4_length_t*)a; + self->total_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); +} + +int grib_accessor_class_g1_section4_length_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + // Old implementation: + // Here we assume that the totalLength will be coded AFTER the section4 length, and + // the section4 length will be overwritten by the totalLength accessor for large GRIBs + // grib_accessor_class* super = *(a->cclass->super); + // return super->pack_long(a,val,len); + + // Note: Do not directly call pack_long on base class + // because in this special case we want to skip the checks. + // So we call the helper function which has an extra argument + return pack_long_unsigned_helper(a, val, len, /*check=*/0); +} + +int grib_accessor_class_g1_section4_length_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g1_section4_length_t* self = (grib_accessor_g1_section4_length_t*)a; + int ret = 0; + long total_length = 0, sec4_length = 0; + + if ((ret = grib_get_g1_message_size(grib_handle_of_accessor(a), + grib_find_accessor(grib_handle_of_accessor(a), self->total_length), + a, + &total_length, + &sec4_length)) != GRIB_SUCCESS) { + return ret; + } + + *val = sec4_length; + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_g1_section4_length.h b/src/accessor/grib_accessor_class_g1_section4_length.h new file mode 100644 index 000000000..0a1b0c768 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1_section4_length.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1_section4_length_h +#define eccodes_accessor_g1_section4_length_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_section_length.h" + +class grib_accessor_g1_section4_length_t : public grib_accessor_section_length_t +{ +public: + /* Members defined in g1_section4_length */ + const char* total_length; +}; + +class grib_accessor_class_g1_section4_length_t : public grib_accessor_class_section_length_t +{ +public: + grib_accessor_class_g1_section4_length_t(const char* name) : grib_accessor_class_section_length_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1_section4_length_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1_section4_length_h */ diff --git a/src/accessor/grib_accessor_class_g1bitmap.cc b/src/accessor/grib_accessor_class_g1bitmap.cc new file mode 100644 index 000000000..ad186dff0 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1bitmap.cc @@ -0,0 +1,98 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g1bitmap.h" +#include "shared_functions.h" + +grib_accessor_class_g1bitmap_t _grib_accessor_class_g1bitmap{"g1bitmap"}; +grib_accessor_class* grib_accessor_class_g1bitmap = &_grib_accessor_class_g1bitmap; + + +void grib_accessor_class_g1bitmap_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_g1bitmap_t* self = (grib_accessor_g1bitmap_t*)a; + self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 4); +} + +int grib_accessor_class_g1bitmap_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_g1bitmap_t* self = (grib_accessor_g1bitmap_t*)a; + size_t tlen; + + unsigned char* buf = NULL; + size_t i; + int err = 0; + long pos = 0; + //long bmaplen = 0; + const int bit_padding = 16; + double miss_values = 0; + tlen = ((*len + bit_padding - 1) / bit_padding * bit_padding) / 8; + + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &miss_values)) != GRIB_SUCCESS) + return err; + + buf = (unsigned char*)grib_context_malloc_clear(a->context, tlen); + if (!buf) + return GRIB_OUT_OF_MEMORY; + pos = 0; + for (i = 0; i < *len; i++) { + if (val[i] == miss_values) + pos++; + else { + //bmaplen++; + grib_set_bit_on(buf, &pos); + } + } + + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->unusedBits, tlen * 8 - *len)) != GRIB_SUCCESS) + return err; + + err = grib_buffer_replace(a, buf, tlen, 1, 1); + if (err) return err; + + grib_context_free(a->context, buf); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_g1bitmap_t::value_count(grib_accessor* a, long* count){ + grib_accessor_g1bitmap_t* self = (grib_accessor_g1bitmap_t*)a; + long tlen; + int err; + + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &tlen)) != GRIB_SUCCESS) + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_class_bitmap.value_count : cannot get %s err=%d", self->unusedBits, err); + + *count = (a->length * 8) - tlen; + return err; +} + +int grib_accessor_class_g1bitmap_t::unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len){ + unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; + grib_accessor_g1bitmap_t* self = (grib_accessor_g1bitmap_t*)a; + long tlen; + int err; + long length = a->byte_count(); long offset = a->byte_offset(); + if (*len < (size_t)length) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it is %ld bytes long\n", a->name, length); + *len = length; + return GRIB_ARRAY_TOO_SMALL; + } + + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &tlen)) != GRIB_SUCCESS) + grib_context_log(a->context, GRIB_LOG_ERROR, + "grib_accessor_class_bitmap.unpack_bytes : cannot get %s err=%d", self->unusedBits, err); + + length -= tlen / 8; + memcpy(val, buf + offset, length); + *len = length; + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_g1bitmap.h b/src/accessor/grib_accessor_class_g1bitmap.h new file mode 100644 index 000000000..b34344d1f --- /dev/null +++ b/src/accessor/grib_accessor_class_g1bitmap.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1bitmap_h +#define eccodes_accessor_g1bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_bitmap.h" + +class grib_accessor_g1bitmap_t : public grib_accessor_bitmap_t +{ +public: + /* Members defined in g1bitmap */ + const char* unusedBits; +}; + +class grib_accessor_class_g1bitmap_t : public grib_accessor_class_bitmap_t +{ +public: + grib_accessor_class_g1bitmap_t(const char* name) : grib_accessor_class_bitmap_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1bitmap_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1bitmap_h */ diff --git a/src/accessor/todo/grib_accessor_class_g1date.cc b/src/accessor/grib_accessor_class_g1date.cc similarity index 51% rename from src/accessor/todo/grib_accessor_class_g1date.cc rename to src/accessor/grib_accessor_class_g1date.cc index c53b3768a..de787abba 100644 --- a/src/accessor/todo/grib_accessor_class_g1date.cc +++ b/src/accessor/grib_accessor_class_g1date.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,109 +10,14 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_g1date.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long;unpack_string - IMPLEMENTS = init;value_count - MEMBERS=const char* century - MEMBERS=const char* year - MEMBERS=const char* month - MEMBERS=const char* day - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* 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 value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1date -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in g1date */ - const char* century; - const char* year; - const char* month; - const char* day; -} grib_accessor_g1date; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_g1date = { - &grib_accessor_class_long, /* super */ - "g1date", /* name */ - sizeof(grib_accessor_g1date), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_g1date_t _grib_accessor_class_g1date{"g1date"}; grib_accessor_class* grib_accessor_class_g1date = &_grib_accessor_class_g1date; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g1date* self = (grib_accessor_g1date*)a; +void grib_accessor_class_g1date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g1date_t* self = (grib_accessor_g1date_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; @@ -121,9 +27,8 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->day = grib_arguments_get_name(hand, c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g1date* self = (grib_accessor_g1date*)a; +int grib_accessor_class_g1date_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g1date_t* self = (grib_accessor_g1date_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int ret = 0; @@ -154,9 +59,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_g1date* self = (grib_accessor_g1date*)a; +int grib_accessor_class_g1date_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_g1date_t* self = (grib_accessor_g1date_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int ret = 0; @@ -168,7 +72,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) long d = grib_julian_to_date(grib_date_to_julian(v)); if (v != d) { - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_g1date: pack_long invalid date %ld, changed to %ld", v, d); + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_g1date_t: pack_long invalid date %ld, changed to %ld", v, d); return GRIB_ENCODING_ERROR; } @@ -212,9 +116,8 @@ static const char* months[] = { "dec", }; -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_g1date* self = (grib_accessor_g1date*)a; +int grib_accessor_class_g1date_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_g1date_t* self = (grib_accessor_g1date_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int ret = 0; @@ -256,8 +159,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) return GRIB_SUCCESS; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_g1date_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } diff --git a/src/accessor/grib_accessor_class_g1date.h b/src/accessor/grib_accessor_class_g1date.h new file mode 100644 index 000000000..27e71189f --- /dev/null +++ b/src/accessor/grib_accessor_class_g1date.h @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1date_h +#define eccodes_accessor_g1date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1date_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1date */ + const char* century; + const char* year; + const char* month; + const char* day; +}; + +class grib_accessor_class_g1date_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1date_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1date_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1date_h */ diff --git a/src/accessor/grib_accessor_class_g1day_of_the_year_date.cc b/src/accessor/grib_accessor_class_g1day_of_the_year_date.cc new file mode 100644 index 000000000..9bf107e94 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1day_of_the_year_date.cc @@ -0,0 +1,60 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g1day_of_the_year_date.h" + +grib_accessor_class_g1day_of_the_year_date_t _grib_accessor_class_g1day_of_the_year_date{"g1day_of_the_year_date"}; +grib_accessor_class* grib_accessor_class_g1day_of_the_year_date = &_grib_accessor_class_g1day_of_the_year_date; + + + +void grib_accessor_class_g1day_of_the_year_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +void grib_accessor_class_g1day_of_the_year_date_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_string(dumper, a, NULL); +} + +int grib_accessor_class_g1day_of_the_year_date_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + /* special clim case where each mont have 30 days.. to comply with mars*/ + grib_accessor_g1day_of_the_year_date_t* self = (grib_accessor_g1day_of_the_year_date_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + char tmp[1024]; + + long year = 0; + long century = 0; + long month = 0; + long day = 0; + long fullyear = 0; + long fake_day_of_year = 0; + + grib_get_long_internal(hand, self->century, ¢ury); + grib_get_long_internal(hand, self->day, &day); + grib_get_long_internal(hand, self->month, &month); + grib_get_long_internal(hand, self->year, &year); + + fullyear = ((century - 1) * 100 + year); + fake_day_of_year = ((month - 1) * 30) + day; + snprintf(tmp, sizeof(tmp), "%04ld-%03ld", fullyear, fake_day_of_year); + + size_t l = strlen(tmp) + 1; + if (*len < l) { + *len = l; + return GRIB_BUFFER_TOO_SMALL; + } + + *len = l; + strcpy(val, tmp); + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_g1day_of_the_year_date.h b/src/accessor/grib_accessor_class_g1day_of_the_year_date.h new file mode 100644 index 000000000..1563cdb9d --- /dev/null +++ b/src/accessor/grib_accessor_class_g1day_of_the_year_date.h @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1day_of_the_year_date_h +#define eccodes_accessor_g1day_of_the_year_date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_g1date.h" + +class grib_accessor_g1day_of_the_year_date_t : public grib_accessor_g1date_t +{ +public: + /* Members defined in g1day_of_the_year_date */ +}; + +class grib_accessor_class_g1day_of_the_year_date_t : public grib_accessor_class_g1date_t +{ +public: + grib_accessor_class_g1day_of_the_year_date_t(const char* name) : grib_accessor_class_g1date_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1day_of_the_year_date_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1day_of_the_year_date_h */ diff --git a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc new file mode 100644 index 000000000..c362016b1 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc @@ -0,0 +1,135 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g1end_of_interval_monthly.h" + +grib_accessor_class_g1end_of_interval_monthly_t _grib_accessor_class_g1end_of_interval_monthly{"g1end_of_interval_monthly"}; +grib_accessor_class* grib_accessor_class_g1end_of_interval_monthly = &_grib_accessor_class_g1end_of_interval_monthly; + + +void grib_accessor_class_g1end_of_interval_monthly_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g1end_of_interval_monthly_t* self = (grib_accessor_g1end_of_interval_monthly_t*)a; + int n = 0; + + self->verifyingMonth = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; + + self->number_of_elements = 6; + self->v = (double*)grib_context_malloc(a->context, sizeof(double) * self->number_of_elements); + + a->length = 0; + a->dirty = 1; +} + +int grib_accessor_class_g1end_of_interval_monthly_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_g1end_of_interval_monthly_t* self = (grib_accessor_g1end_of_interval_monthly_t*)a; + int ret = 0; + char verifyingMonth[7] = {0,}; + size_t slen = 7; + long year = 0, month = 0, date = 0; + const long mdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + long days = 0; + + if (!a->dirty) + return GRIB_SUCCESS; + + if (*len != (size_t)self->number_of_elements) + return GRIB_ARRAY_TOO_SMALL; + + if ((ret = grib_get_string(grib_handle_of_accessor(a), self->verifyingMonth, verifyingMonth, &slen)) != GRIB_SUCCESS) + return ret; + + date = atoi(verifyingMonth); + if (date < 0) { + return GRIB_INVALID_ARGUMENT; + } + year = date / 100; + month = date - year * 100; + if (month == 2) { + days = 28; + if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) + days = 29; + } + else { + if (month < 1 || month > 12) return GRIB_INVALID_ARGUMENT; + days = mdays[month - 1]; + } + self->v[0] = year; + self->v[1] = month; + + self->v[2] = days; + self->v[3] = 24; + self->v[4] = 00; + self->v[5] = 00; + + a->dirty = 0; + + val[0] = self->v[0]; + val[1] = self->v[1]; + val[2] = self->v[2]; + val[3] = self->v[3]; + val[4] = self->v[4]; + val[5] = self->v[5]; + + return ret; +} + +int grib_accessor_class_g1end_of_interval_monthly_t::value_count(grib_accessor* a, long* count){ + grib_accessor_g1end_of_interval_monthly_t* self = (grib_accessor_g1end_of_interval_monthly_t*)a; + *count = self->number_of_elements; + return 0; +} + +void grib_accessor_class_g1end_of_interval_monthly_t::destroy(grib_context* c, grib_accessor* a){ + grib_accessor_g1end_of_interval_monthly_t* self = (grib_accessor_g1end_of_interval_monthly_t*)a; + grib_context_free(c, self->v); +} + +int grib_accessor_class_g1end_of_interval_monthly_t::compare(grib_accessor* a, grib_accessor* b){ + int retval = GRIB_SUCCESS; + double* aval = 0; + double* bval = 0; + + long count = 0; + size_t alen = 0; + size_t blen = 0; + int err = 0; + + err = a->value_count(&count); if (err) + return err; + alen = count; + + err = b->value_count(&count); if (err) + return err; + blen = count; + + if (alen != blen) + return GRIB_COUNT_MISMATCH; + + aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); + bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); + + b->dirty = 1; + a->dirty = 1; + + err = a->unpack_double(aval, &alen); err = b->unpack_double(bval, &blen); + for(size_t i=0; icontext, aval); + grib_context_free(b->context, bval); + + return retval; +} diff --git a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h new file mode 100644 index 000000000..a1e29a76c --- /dev/null +++ b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1end_of_interval_monthly_h +#define eccodes_accessor_g1end_of_interval_monthly_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_abstract_vector.h" + +class grib_accessor_g1end_of_interval_monthly_t : public grib_accessor_abstract_vector_t +{ +public: + /* Members defined in g1end_of_interval_monthly */ + const char* verifyingMonth; +}; + +class grib_accessor_class_g1end_of_interval_monthly_t : public grib_accessor_class_abstract_vector_t +{ +public: + grib_accessor_class_g1end_of_interval_monthly_t(const char* name) : grib_accessor_class_abstract_vector_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1end_of_interval_monthly_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_g1end_of_interval_monthly_h */ diff --git a/src/accessor/grib_accessor_class_g1fcperiod.cc b/src/accessor/grib_accessor_class_g1fcperiod.cc new file mode 100644 index 000000000..143a381e7 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1fcperiod.cc @@ -0,0 +1,42 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g1fcperiod.h" + +grib_accessor_class_g1fcperiod_t _grib_accessor_class_g1fcperiod{"g1fcperiod"}; +grib_accessor_class* grib_accessor_class_g1fcperiod = &_grib_accessor_class_g1fcperiod; + + +int grib_accessor_class_g1fcperiod_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + long start = 0, theEnd = 0; + char tmp[1024]; + const size_t tmpLen = sizeof(tmp); + int err = grib_g1_step_get_steps(a, &start, &theEnd); + size_t l = 0; + + if (err) + return err; + + snprintf(tmp, tmpLen, "%ld-%ld", start / 24, theEnd / 24); + /*printf("---- FCPERIOD %s [start:%g, end:%g]",tmp,start,end);*/ + + l = strlen(tmp) + 1; + if (*len < l) { + *len = l; + return GRIB_BUFFER_TOO_SMALL; + } + + *len = l; + strcpy(val, tmp); /* NOLINT: CWE-119 clang-analyzer-security.insecureAPI.strcpy */ + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_g1fcperiod.h b/src/accessor/grib_accessor_class_g1fcperiod.h new file mode 100644 index 000000000..3c0ff2c49 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1fcperiod.h @@ -0,0 +1,31 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1fcperiod_h +#define eccodes_accessor_g1fcperiod_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_g1step_range.h" + +class grib_accessor_g1fcperiod_t : public grib_accessor_g1step_range_t +{ +public: + /* Members defined in g1fcperiod */ +}; + +class grib_accessor_class_g1fcperiod_t : public grib_accessor_class_g1step_range_t +{ +public: + grib_accessor_class_g1fcperiod_t(const char* name) : grib_accessor_class_g1step_range_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1fcperiod_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; +}; +#endif /* eccodes_accessor_g1fcperiod_h */ diff --git a/src/accessor/todo/grib_accessor_class_g1forecastmonth.cc b/src/accessor/grib_accessor_class_g1forecastmonth.cc similarity index 58% rename from src/accessor/todo/grib_accessor_class_g1forecastmonth.cc rename to src/accessor/grib_accessor_class_g1forecastmonth.cc index e25db6930..f0a0e86db 100644 --- a/src/accessor/todo/grib_accessor_class_g1forecastmonth.cc +++ b/src/accessor/grib_accessor_class_g1forecastmonth.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,112 +10,14 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_g1forecastmonth.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init;dump - MEMBERS=const char* verification_yearmonth - MEMBERS=const char* base_date - MEMBERS=const char* day - MEMBERS=const char* hour - MEMBERS=const char* fcmonth - MEMBERS=const char* check - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1forecastmonth -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in g1forecastmonth */ - const char* verification_yearmonth; - const char* base_date; - const char* day; - const char* hour; - const char* fcmonth; - const char* check; -} grib_accessor_g1forecastmonth; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_g1forecastmonth = { - &grib_accessor_class_long, /* super */ - "g1forecastmonth", /* name */ - sizeof(grib_accessor_g1forecastmonth), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_g1forecastmonth_t _grib_accessor_class_g1forecastmonth{"g1forecastmonth"}; grib_accessor_class* grib_accessor_class_g1forecastmonth = &_grib_accessor_class_g1forecastmonth; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g1forecastmonth* self = (grib_accessor_g1forecastmonth*)a; +void grib_accessor_class_g1forecastmonth_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g1forecastmonth_t* self = (grib_accessor_g1forecastmonth_t*)a; grib_handle* h = grib_handle_of_accessor(a); int n = 0; const int count = grib_arguments_get_count(c); @@ -128,13 +31,11 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) } } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_g1forecastmonth_t::dump(grib_accessor* a, grib_dumper* dumper){ grib_dump_long(dumper, a, NULL); } -static int calculate_fcmonth(grib_accessor* a, long verification_yearmonth, long base_date, long day, long hour, long* result) -{ +int calculate_fcmonth(grib_accessor* a, long verification_yearmonth, long base_date, long day, long hour, long* result){ long base_yearmonth = 0; long vyear = 0; long vmonth = 0; @@ -157,8 +58,7 @@ static int calculate_fcmonth(grib_accessor* a, long verification_yearmonth, long return GRIB_SUCCESS; } -static int unpack_long_edition2(grib_accessor* a, long* val, size_t* len) -{ +int unpack_long_edition2(grib_accessor* a, long* val, size_t* len){ int err = 0; grib_handle* h = grib_handle_of_accessor(a); long dataDate, verification_yearmonth; @@ -202,10 +102,9 @@ static int unpack_long_edition2(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_long_edition1(grib_accessor* a, long* val, size_t* len) -{ +int unpack_long_edition1(grib_accessor* a, long* val, size_t* len){ int err = 0; - grib_accessor_g1forecastmonth* self = (grib_accessor_g1forecastmonth*)a; + grib_accessor_g1forecastmonth_t* self = (grib_accessor_g1forecastmonth_t*)a; long verification_yearmonth = 0; long base_date = 0; @@ -249,8 +148,7 @@ static int unpack_long_edition1(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ +int grib_accessor_class_g1forecastmonth_t::unpack_long(grib_accessor* a, long* val, size_t* len){ int err = 0; grib_handle* hand = grib_handle_of_accessor(a); long edition = 0; @@ -267,8 +165,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) } /* TODO: Check for a valid date */ -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_g1forecastmonth* self = (grib_accessor_g1forecastmonth*)a; +int grib_accessor_class_g1forecastmonth_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_g1forecastmonth_t* self = (grib_accessor_g1forecastmonth_t*)a; return grib_set_long_internal(grib_handle_of_accessor(a), self->fcmonth, *val); } diff --git a/src/accessor/grib_accessor_class_g1forecastmonth.h b/src/accessor/grib_accessor_class_g1forecastmonth.h new file mode 100644 index 000000000..6d2b9ee63 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1forecastmonth.h @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1forecastmonth_h +#define eccodes_accessor_g1forecastmonth_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1forecastmonth_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1forecastmonth */ + const char* verification_yearmonth; + const char* base_date; + const char* day; + const char* hour; + const char* fcmonth; + const char* check; +}; + +class grib_accessor_class_g1forecastmonth_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1forecastmonth_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1forecastmonth_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1forecastmonth_h */ diff --git a/src/accessor/grib_accessor_class_g1monthlydate.cc b/src/accessor/grib_accessor_class_g1monthlydate.cc new file mode 100644 index 000000000..3a184669b --- /dev/null +++ b/src/accessor/grib_accessor_class_g1monthlydate.cc @@ -0,0 +1,41 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g1monthlydate.h" + +grib_accessor_class_g1monthlydate_t _grib_accessor_class_g1monthlydate{"g1monthlydate"}; +grib_accessor_class* grib_accessor_class_g1monthlydate = &_grib_accessor_class_g1monthlydate; + + +void grib_accessor_class_g1monthlydate_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g1monthlydate_t* self = (grib_accessor_g1monthlydate_t*)a; + int n = 0; + + self->date = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_g1monthlydate_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g1monthlydate_t* self = (grib_accessor_g1monthlydate_t*)a; + + long date = 0; + + grib_get_long_internal(grib_handle_of_accessor(a), self->date, &date); + + date /= 100; + date *= 100; + date += 1; + + *val = date; + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_g1monthlydate.h b/src/accessor/grib_accessor_class_g1monthlydate.h new file mode 100644 index 000000000..8efa9cf16 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1monthlydate.h @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1monthlydate_h +#define eccodes_accessor_g1monthlydate_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1monthlydate_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1monthlydate */ + const char* date; +}; + +class grib_accessor_class_g1monthlydate_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1monthlydate_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1monthlydate_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1monthlydate_h */ diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc new file mode 100644 index 000000000..17d36f908 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc @@ -0,0 +1,81 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g1number_of_coded_values_sh_complex.h" + +grib_accessor_class_g1number_of_coded_values_sh_complex_t _grib_accessor_class_g1number_of_coded_values_sh_complex{"g1number_of_coded_values_sh_complex"}; +grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_complex = &_grib_accessor_class_g1number_of_coded_values_sh_complex; + + +void grib_accessor_class_g1number_of_coded_values_sh_complex_t::init(grib_accessor* a, const long l, grib_arguments* c){ + int n = 0; + grib_accessor_g1number_of_coded_values_sh_complex_t* self = (grib_accessor_g1number_of_coded_values_sh_complex_t*)a; + self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->JS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->KS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->MS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +int grib_accessor_class_g1number_of_coded_values_sh_complex_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + int ret = GRIB_SUCCESS; + long bpv = 0; + long offsetBeforeData = 0, offsetAfterData = 0, unusedBits = 0, numberOfValues; + long JS = 0, KS = 0, MS = 0, NS = 0; + + grib_accessor_g1number_of_coded_values_sh_complex_t* self = (grib_accessor_g1number_of_coded_values_sh_complex_t*)a; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue, &bpv)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData, &offsetBeforeData)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData, &offsetAfterData)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &unusedBits)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->JS, &JS)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->KS, &KS)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->MS, &MS)) != GRIB_SUCCESS) + return ret; + + if (JS != KS || KS != MS) + return GRIB_NOT_IMPLEMENTED; + + NS = (MS + 1) * (MS + 2); + + if (bpv != 0) { + DEBUG_ASSERT(offsetAfterData > offsetBeforeData); + *val = ((offsetAfterData - offsetBeforeData) * 8 - unusedBits + NS * (bpv - 32)) / bpv; + } + else { + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, &numberOfValues)) != GRIB_SUCCESS) + return ret; + + *val = numberOfValues; + } + + return ret; +} diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h new file mode 100644 index 000000000..764bfa04d --- /dev/null +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1number_of_coded_values_sh_complex_h +#define eccodes_accessor_g1number_of_coded_values_sh_complex_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1number_of_coded_values_sh_complex_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1number_of_coded_values_sh_complex */ + const char* numberOfValues; + const char* bitsPerValue; + const char* offsetBeforeData; + const char* offsetAfterData; + const char* unusedBits; + const char* JS; + const char* KS; + const char* MS; +}; + +class grib_accessor_class_g1number_of_coded_values_sh_complex_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1number_of_coded_values_sh_complex_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1number_of_coded_values_sh_complex_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1number_of_coded_values_sh_complex_h */ diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc new file mode 100644 index 000000000..c2d9801f8 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc @@ -0,0 +1,62 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g1number_of_coded_values_sh_simple.h" + +grib_accessor_class_g1number_of_coded_values_sh_simple_t _grib_accessor_class_g1number_of_coded_values_sh_simple{"g1number_of_coded_values_sh_simple"}; +grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_simple = &_grib_accessor_class_g1number_of_coded_values_sh_simple; + + +void grib_accessor_class_g1number_of_coded_values_sh_simple_t::init(grib_accessor* a, const long l, grib_arguments* c){ + int n = 0; + grib_accessor_g1number_of_coded_values_sh_simple_t* self = (grib_accessor_g1number_of_coded_values_sh_simple_t*)a; + self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +int grib_accessor_class_g1number_of_coded_values_sh_simple_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + int ret = GRIB_SUCCESS; + long bpv = 0; + long offsetBeforeData = 0, offsetAfterData = 0, unusedBits = 0, numberOfValues; + + grib_accessor_g1number_of_coded_values_sh_simple_t* self = (grib_accessor_g1number_of_coded_values_sh_simple_t*)a; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue, &bpv)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData, &offsetBeforeData)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData, &offsetAfterData)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &unusedBits)) != GRIB_SUCCESS) + return ret; + + if (bpv != 0) { + DEBUG_ASSERT(offsetAfterData > offsetBeforeData); + *val = ((offsetAfterData - offsetBeforeData) * 8 - unusedBits) / bpv; + } + else { + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, &numberOfValues)) != GRIB_SUCCESS) + return ret; + + *val = numberOfValues; + } + return ret; +} diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h new file mode 100644 index 000000000..fb5ab298d --- /dev/null +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1number_of_coded_values_sh_simple_h +#define eccodes_accessor_g1number_of_coded_values_sh_simple_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1number_of_coded_values_sh_simple_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1number_of_coded_values_sh_simple */ + const char* numberOfValues; + const char* bitsPerValue; + const char* offsetBeforeData; + const char* offsetAfterData; + const char* unusedBits; +}; + +class grib_accessor_class_g1number_of_coded_values_sh_simple_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1number_of_coded_values_sh_simple_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1number_of_coded_values_sh_simple_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1number_of_coded_values_sh_simple_h */ diff --git a/src/accessor/todo/grib_accessor_class_g1step_range.cc b/src/accessor/grib_accessor_class_g1step_range.cc similarity index 79% rename from src/accessor/todo/grib_accessor_class_g1step_range.cc rename to src/accessor/grib_accessor_class_g1step_range.cc index 46c7a3cc8..f2444486a 100644 --- a/src/accessor/todo/grib_accessor_class_g1step_range.cc +++ b/src/accessor/grib_accessor_class_g1step_range.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,131 +9,15 @@ * 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 - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_abstract_long_vector - IMPLEMENTS = pack_string;unpack_string;value_count - IMPLEMENTS = pack_long;unpack_long;dump - IMPLEMENTS = get_native_type;string_length - IMPLEMENTS = init; destroy - MEMBERS = const char* p1 - MEMBERS = const char* p2 - MEMBERS = const char* timeRangeIndicator - MEMBERS = const char *unit - MEMBERS = const char *step_unit - MEMBERS = const char *stepType - MEMBERS = const char *patch_fp_precip - MEMBERS = int error_on_units - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -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 unpack_long(grib_accessor*, long* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1step_range -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in abstract_long_vector */ - long* v; - long pack_index; - int number_of_elements; - /* Members defined in g1step_range */ - const char* p1; - const char* p2; - const char* timeRangeIndicator; - const char *unit; - const char *step_unit; - const char *stepType; - const char *patch_fp_precip; - int error_on_units; -} grib_accessor_g1step_range; - -extern grib_accessor_class* grib_accessor_class_abstract_long_vector; - -static grib_accessor_class _grib_accessor_class_g1step_range = { - &grib_accessor_class_abstract_long_vector, /* super */ - "g1step_range", /* name */ - sizeof(grib_accessor_g1step_range), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_g1step_range.h" +grib_accessor_class_g1step_range_t _grib_accessor_class_g1step_range{"g1step_range"}; grib_accessor_class* grib_accessor_class_g1step_range = &_grib_accessor_class_g1step_range; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; +void grib_accessor_class_g1step_range_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g1step_range_t* self = (grib_accessor_g1step_range_t*)a; grib_handle* h = grib_handle_of_accessor(a); int n = 0; self->p1 = grib_arguments_get_name(h, c, n++); @@ -153,8 +38,7 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->length = 0; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_g1step_range_t::dump(grib_accessor* a, grib_dumper* dumper){ grib_dump_string(dumper, a, NULL); } @@ -203,7 +87,7 @@ static const int u2s[] = { int grib_g1_step_get_steps(grib_accessor* a, long* start, long* theEnd) { - grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; + grib_accessor_g1step_range_t* self = (grib_accessor_g1step_range_t*)a; int err = 0; long p1 = 0, p2 = 0, unit = 0, timeRangeIndicator = 0, timeRangeIndicatorFromStepRange = 0; long step_unit = 1; @@ -298,9 +182,8 @@ int grib_g1_step_get_steps(grib_accessor* a, long* start, long* theEnd) return 0; } -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; +int grib_accessor_class_g1step_range_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_g1step_range_t* self = (grib_accessor_g1step_range_t*)a; char buf[100]; size_t size = 0; long start = 0, theEnd = 0; @@ -450,9 +333,8 @@ static int grib_g1_step_apply_units( return GRIB_WRONG_STEP; } -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; +int grib_accessor_class_g1step_range_t::pack_string(grib_accessor* a, const char* val, size_t* len){ + grib_accessor_g1step_range_t* self = (grib_accessor_g1step_range_t*)a; grib_handle* h = grib_handle_of_accessor(a); long timeRangeIndicator = 0, P1 = 0, P2 = 0; long start = 0, theEnd = -1, unit = 0, ounit = 0, step_unit = 1; @@ -631,25 +513,22 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return 0; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_g1step_range_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } -static size_t string_length(grib_accessor* a) -{ +size_t grib_accessor_class_g1step_range_t::string_length(grib_accessor* a){ return 255; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ +int grib_accessor_class_g1step_range_t::pack_long(grib_accessor* a, const long* val, size_t* len){ char buff[256]; size_t bufflen = 100; char sval[100] = { 0 }; char* p = sval; size_t svallen = 100; - grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; + grib_accessor_g1step_range_t* self = (grib_accessor_g1step_range_t*)a; char stepType[20] = {0,}; size_t stepTypeLen = 20; long step_unit = 0; @@ -718,9 +597,8 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_INTERNAL_ERROR; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; +int grib_accessor_class_g1step_range_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g1step_range_t* self = (grib_accessor_g1step_range_t*)a; char buff[100]; size_t bufflen = 100; long start, theEnd; @@ -749,13 +627,11 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return 0; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_g1step_range_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_STRING; } -static void destroy(grib_context* c, grib_accessor* a) -{ - grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; +void grib_accessor_class_g1step_range_t::destroy(grib_context* c, grib_accessor* a){ + grib_accessor_g1step_range_t* self = (grib_accessor_g1step_range_t*)a; grib_context_free(c, self->v); } diff --git a/src/accessor/grib_accessor_class_g1step_range.h b/src/accessor/grib_accessor_class_g1step_range.h new file mode 100644 index 000000000..c9c3dd911 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1step_range.h @@ -0,0 +1,48 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1step_range_h +#define eccodes_accessor_g1step_range_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_abstract_long_vector.h" + +class grib_accessor_g1step_range_t : public grib_accessor_abstract_long_vector_t +{ +public: + /* Members defined in g1step_range */ + const char* p1; + const char* p2; + const char* timeRangeIndicator; + const char *unit; + const char *step_unit; + const char *stepType; + const char *patch_fp_precip; + int error_on_units; +}; + +class grib_accessor_class_g1step_range_t : public grib_accessor_class_abstract_long_vector_t +{ +public: + grib_accessor_class_g1step_range_t(const char* name) : grib_accessor_class_abstract_long_vector_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1step_range_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1step_range_h */ diff --git a/src/accessor/grib_accessor_class_g1verificationdate.cc b/src/accessor/grib_accessor_class_g1verificationdate.cc new file mode 100644 index 000000000..7f91c5b99 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1verificationdate.cc @@ -0,0 +1,64 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g1verificationdate.h" + +grib_accessor_class_g1verificationdate_t _grib_accessor_class_g1verificationdate{"g1verificationdate"}; +grib_accessor_class* grib_accessor_class_g1verificationdate = &_grib_accessor_class_g1verificationdate; + + +void grib_accessor_class_g1verificationdate_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g1verificationdate_t* self = (grib_accessor_g1verificationdate_t*)a; + int n = 0; + + self->date = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->time = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->step = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_g1verificationdate_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g1verificationdate_t* self = (grib_accessor_g1verificationdate_t*)a; + int ret = 0; + long date = 0; + long time = 0; + long cdate = 0; + long step = 0; + long vtime = 0; + long vdate = 0; + long vd = 0; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->date, &date)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->time, &time)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->step, &step)) != GRIB_SUCCESS) + return ret; + + time /= 100; + + cdate = (long)grib_date_to_julian(date); + vtime = cdate * 24 + time + step; + vd = vtime / 24; + vdate = grib_julian_to_date(vd); + + /* printf("\n********\n date %d, time %d, step %d, vdate: %d, cdate %d, vd %d\n********\n", date, time, step, vdate, cdate, vd); */ + + if (*len < 1) + return GRIB_ARRAY_TOO_SMALL; + + *val = vdate; + + /* fprintf(stdout,"\n********\n %d cdate %d vd %d\n********\n", vdate, cdate, step); */ + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_g1verificationdate.h b/src/accessor/grib_accessor_class_g1verificationdate.h new file mode 100644 index 000000000..198801aba --- /dev/null +++ b/src/accessor/grib_accessor_class_g1verificationdate.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1verificationdate_h +#define eccodes_accessor_g1verificationdate_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1verificationdate_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1verificationdate */ + const char* date; + const char* time; + const char* step; +}; + +class grib_accessor_class_g1verificationdate_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1verificationdate_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1verificationdate_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1verificationdate_h */ diff --git a/src/accessor/grib_accessor_class_g2_aerosol.cc b/src/accessor/grib_accessor_class_g2_aerosol.cc new file mode 100644 index 000000000..654c0e97a --- /dev/null +++ b/src/accessor/grib_accessor_class_g2_aerosol.cc @@ -0,0 +1,114 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g2_aerosol.h" + +grib_accessor_class_g2_aerosol_t _grib_accessor_class_g2_aerosol{"g2_aerosol"}; +grib_accessor_class* grib_accessor_class_g2_aerosol = &_grib_accessor_class_g2_aerosol; + + +void grib_accessor_class_g2_aerosol_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g2_aerosol_t* self = (grib_accessor_g2_aerosol_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; + + self->productDefinitionTemplateNumber = grib_arguments_get_name(hand, c, n++); + self->stepType = grib_arguments_get_name(hand, c, n++); + self->optical = grib_arguments_get_long(hand, c, n++); +} + +int grib_accessor_class_g2_aerosol_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g2_aerosol_t* self = (grib_accessor_g2_aerosol_t*)a; + long productDefinitionTemplateNumber = 0; + grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); + + if (self->optical) + *val = grib2_is_PDTN_AerosolOptical(productDefinitionTemplateNumber); + else + *val = grib2_is_PDTN_Aerosol(productDefinitionTemplateNumber); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_g2_aerosol_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_g2_aerosol_t* self = (grib_accessor_g2_aerosol_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + long productDefinitionTemplateNumber = -1; + long productDefinitionTemplateNumberNew = -1; + /*long type=-1; + long stream=-1;*/ + long eps = -1; + char stepType[15] = {0,}; + size_t slen = 15; + /*int aerosol = *val;*/ + int isInstant = 0; + /*long derivedForecast=-1;*/ + int ret = 0; + + if (grib_get_long(hand, self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber) != GRIB_SUCCESS) + return GRIB_SUCCESS; + + /* + grib_get_long(hand, self->type,&type); + grib_get_long(hand, self->stream,&stream); + */ + 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"); + + if (!strcmp(stepType, "instant")) + isInstant = 1; + + if (eps == 1) { + if (isInstant) { + productDefinitionTemplateNumberNew = 45; + } + else { + /*productDefinitionTemplateNumberNew = 47; PDT deprecated*/ + productDefinitionTemplateNumberNew = 85; + } + } + else { + if (isInstant) { + productDefinitionTemplateNumberNew = 48; /*44 is deprecated*/ + } + else { + productDefinitionTemplateNumberNew = 46; + } + } + + if (self->optical) { + /* Note: There is no interval based template for optical properties of aerosol! */ + if (eps) + productDefinitionTemplateNumberNew = 49; + else + productDefinitionTemplateNumberNew = 48; + if (!isInstant) { + grib_context_log(hand->context, GRIB_LOG_ERROR, + "The product definition templates for optical properties of aerosol are for a point-in-time only"); + } + } + + if (productDefinitionTemplateNumber != productDefinitionTemplateNumberNew) { + grib_set_long(hand, self->productDefinitionTemplateNumber, productDefinitionTemplateNumberNew); + /*if (derivedForecast>=0) grib_set_long(hand, self->derivedForecast,derivedForecast);*/ + } + + return 0; +} + +int grib_accessor_class_g2_aerosol_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} diff --git a/src/accessor/grib_accessor_class_g2_aerosol.h b/src/accessor/grib_accessor_class_g2_aerosol.h new file mode 100644 index 000000000..fb29a9561 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2_aerosol.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2_aerosol_h +#define eccodes_accessor_g2_aerosol_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_g2_aerosol_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in g2_aerosol */ + const char* productDefinitionTemplateNumber; + const char* stepType; + int optical; +}; + +class grib_accessor_class_g2_aerosol_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_g2_aerosol_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_aerosol_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2_aerosol_h */ diff --git a/src/accessor/todo/grib_accessor_class_g2_chemical.cc b/src/accessor/grib_accessor_class_g2_chemical.cc similarity index 54% rename from src/accessor/todo/grib_accessor_class_g2_chemical.cc rename to src/accessor/grib_accessor_class_g2_chemical.cc index 16d8e6f33..72d7581e1 100644 --- a/src/accessor/todo/grib_accessor_class_g2_chemical.cc +++ b/src/accessor/grib_accessor_class_g2_chemical.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,108 +10,14 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_unsigned - IMPLEMENTS = unpack_long;pack_long; value_count - IMPLEMENTS = init - MEMBERS=const char* productDefinitionTemplateNumber - MEMBERS=const char* stepType - MEMBERS=int chemical_type - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2_chemical -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in g2_chemical */ - const char* productDefinitionTemplateNumber; - const char* stepType; - int chemical_type; -} grib_accessor_g2_chemical; - -extern grib_accessor_class* grib_accessor_class_unsigned; - -static grib_accessor_class _grib_accessor_class_g2_chemical = { - &grib_accessor_class_unsigned, /* super */ - "g2_chemical", /* name */ - sizeof(grib_accessor_g2_chemical), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_g2_chemical.h" +grib_accessor_class_g2_chemical_t _grib_accessor_class_g2_chemical{"g2_chemical"}; grib_accessor_class* grib_accessor_class_g2_chemical = &_grib_accessor_class_g2_chemical; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2_chemical* self = (grib_accessor_g2_chemical*)a; +void grib_accessor_class_g2_chemical_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g2_chemical_t* self = (grib_accessor_g2_chemical_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; @@ -119,9 +26,8 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->chemical_type = grib_arguments_get_long(hand, c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g2_chemical* self = (grib_accessor_g2_chemical*)a; +int grib_accessor_class_g2_chemical_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g2_chemical_t* self = (grib_accessor_g2_chemical_t*)a; long productDefinitionTemplateNumber = 0; grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); @@ -141,9 +47,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_g2_chemical* self = (grib_accessor_g2_chemical*)a; +int grib_accessor_class_g2_chemical_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_g2_chemical_t* self = (grib_accessor_g2_chemical_t*)a; grib_handle* hand = grib_handle_of_accessor(a); long productDefinitionTemplateNumber = -1; long productDefinitionTemplateNumberNew = -1; @@ -214,8 +119,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return 0; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_g2_chemical_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } diff --git a/src/accessor/grib_accessor_class_g2_chemical.h b/src/accessor/grib_accessor_class_g2_chemical.h new file mode 100644 index 000000000..9cfe4f8bc --- /dev/null +++ b/src/accessor/grib_accessor_class_g2_chemical.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2_chemical_h +#define eccodes_accessor_g2_chemical_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_g2_chemical_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in g2_chemical */ + const char* productDefinitionTemplateNumber; + const char* stepType; + int chemical_type; +}; + +class grib_accessor_class_g2_chemical_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_g2_chemical_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_chemical_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2_chemical_h */ diff --git a/src/accessor/todo/grib_accessor_class_g2_eps.cc b/src/accessor/grib_accessor_class_g2_eps.cc similarity index 58% rename from src/accessor/todo/grib_accessor_class_g2_eps.cc rename to src/accessor/grib_accessor_class_g2_eps.cc index fc202a572..336245721 100644 --- a/src/accessor/todo/grib_accessor_class_g2_eps.cc +++ b/src/accessor/grib_accessor_class_g2_eps.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,113 +10,14 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_g2_eps.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_unsigned - IMPLEMENTS = unpack_long;pack_long; value_count - IMPLEMENTS = init - MEMBERS=const char* productDefinitionTemplateNumber - MEMBERS=const char* stream - MEMBERS=const char* type - MEMBERS=const char* stepType - MEMBERS=const char* derivedForecast - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2_eps -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in g2_eps */ - const char* productDefinitionTemplateNumber; - const char* stream; - const char* type; - const char* stepType; - const char* derivedForecast; -} grib_accessor_g2_eps; - -extern grib_accessor_class* grib_accessor_class_unsigned; - -static grib_accessor_class _grib_accessor_class_g2_eps = { - &grib_accessor_class_unsigned, /* super */ - "g2_eps", /* name */ - sizeof(grib_accessor_g2_eps), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_g2_eps_t _grib_accessor_class_g2_eps{"g2_eps"}; grib_accessor_class* grib_accessor_class_g2_eps = &_grib_accessor_class_g2_eps; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2_eps* self = (grib_accessor_g2_eps*)a; +void grib_accessor_class_g2_eps_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g2_eps_t* self = (grib_accessor_g2_eps_t*)a; int n = 0; self->productDefinitionTemplateNumber = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); @@ -125,9 +27,8 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->derivedForecast = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g2_eps* self = (grib_accessor_g2_eps*)a; +int grib_accessor_class_g2_eps_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g2_eps_t* self = (grib_accessor_g2_eps_t*)a; long productDefinitionTemplateNumber = 0; int err = 0; grib_handle* hand = grib_handle_of_accessor(a); @@ -145,9 +46,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_g2_eps* self = (grib_accessor_g2_eps*)a; +int grib_accessor_class_g2_eps_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_g2_eps_t* self = (grib_accessor_g2_eps_t*)a; grib_handle* hand = grib_handle_of_accessor(a); long productDefinitionTemplateNumber = -1; long productDefinitionTemplateNumberNew = -1; @@ -266,8 +166,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return 0; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_g2_eps_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } diff --git a/src/accessor/grib_accessor_class_g2_eps.h b/src/accessor/grib_accessor_class_g2_eps.h new file mode 100644 index 000000000..7c39dd580 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2_eps.h @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2_eps_h +#define eccodes_accessor_g2_eps_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_g2_eps_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in g2_eps */ + const char* productDefinitionTemplateNumber; + const char* stream; + const char* type; + const char* stepType; + const char* derivedForecast; +}; + +class grib_accessor_class_g2_eps_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_g2_eps_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_eps_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2_eps_h */ diff --git a/src/accessor/todo/grib_accessor_class_g2_mars_labeling.cc b/src/accessor/grib_accessor_class_g2_mars_labeling.cc similarity index 75% rename from src/accessor/todo/grib_accessor_class_g2_mars_labeling.cc rename to src/accessor/grib_accessor_class_g2_mars_labeling.cc index ad0647e30..4de889cfa 100644 --- a/src/accessor/todo/grib_accessor_class_g2_mars_labeling.cc +++ b/src/accessor/grib_accessor_class_g2_mars_labeling.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,129 +9,15 @@ * 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 - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long;pack_long; value_count - IMPLEMENTS = unpack_string;pack_string - IMPLEMENTS = init; get_native_type - MEMBERS=int index - MEMBERS=const char* the_class - MEMBERS=const char* stream - MEMBERS=const char* type - MEMBERS=const char* expver - MEMBERS=const char* typeOfProcessedData - MEMBERS=const char* productDefinitionTemplateNumber - MEMBERS=const char* stepType - MEMBERS=const char* derivedForecast - MEMBERS=const char* typeOfGeneratingProcess - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -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 unpack_long(grib_accessor*, long* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2_mars_labeling -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in g2_mars_labeling */ - int index; - const char* the_class; - const char* stream; - const char* type; - const char* expver; - const char* typeOfProcessedData; - const char* productDefinitionTemplateNumber; - const char* stepType; - const char* derivedForecast; - const char* typeOfGeneratingProcess; -} grib_accessor_g2_mars_labeling; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_g2_mars_labeling = { - &grib_accessor_class_gen, /* super */ - "g2_mars_labeling", /* name */ - sizeof(grib_accessor_g2_mars_labeling), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_g2_mars_labeling.h" +grib_accessor_class_g2_mars_labeling_t _grib_accessor_class_g2_mars_labeling{"g2_mars_labeling"}; grib_accessor_class* grib_accessor_class_g2_mars_labeling = &_grib_accessor_class_g2_mars_labeling; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; +void grib_accessor_class_g2_mars_labeling_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; int n = 0; grib_handle* hand = grib_handle_of_accessor(a); @@ -146,9 +33,8 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->typeOfGeneratingProcess = grib_arguments_get_name(hand, c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; +int grib_accessor_class_g2_mars_labeling_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; char* key = NULL; switch (self->index) { @@ -170,9 +56,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return grib_get_long(grib_handle_of_accessor(a), key, val); } -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; +int grib_accessor_class_g2_mars_labeling_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; char* key = NULL; switch (self->index) { @@ -194,10 +79,9 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) return grib_get_string(grib_handle_of_accessor(a), key, val, len); } -static int extra_set(grib_accessor* a, long val) -{ +int extra_set(grib_accessor* a, long val){ int ret = 0; - grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; + grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; grib_handle* hand = grib_handle_of_accessor(a); char stepType[30] = {0,}; size_t stepTypelen = 30; @@ -417,9 +301,8 @@ static int extra_set(grib_accessor* a, long val) return ret; } -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; +int grib_accessor_class_g2_mars_labeling_t::pack_string(grib_accessor* a, const char* val, size_t* len){ + grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; char* key = NULL; int ret = 0; long lval = 0; @@ -451,9 +334,8 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return extra_set(a, lval); } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; +int grib_accessor_class_g2_mars_labeling_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; char* key = NULL; int ret = 0; @@ -480,15 +362,13 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return extra_set(a, *val); } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_g2_mars_labeling_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } -static int get_native_type(grib_accessor* a) -{ - grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; +int grib_accessor_class_g2_mars_labeling_t::get_native_type(grib_accessor* a){ + grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; char* key = NULL; int ret = 0; int type = 0; @@ -509,8 +389,7 @@ static int get_native_type(grib_accessor* a) return GRIB_INTERNAL_ERROR; } - ret = grib_get_native_type(grib_handle_of_accessor(a), key, &type); - if (ret) + ret = grib_get_native_type(grib_handle_of_accessor(a), key, &type); if (ret) grib_context_log(a->context, GRIB_LOG_ERROR, "unable to get native type for %s", key); return type; diff --git a/src/accessor/grib_accessor_class_g2_mars_labeling.h b/src/accessor/grib_accessor_class_g2_mars_labeling.h new file mode 100644 index 000000000..0a678174f --- /dev/null +++ b/src/accessor/grib_accessor_class_g2_mars_labeling.h @@ -0,0 +1,47 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2_mars_labeling_h +#define eccodes_accessor_g2_mars_labeling_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_g2_mars_labeling_t : public grib_accessor_gen_t +{ +public: + /* Members defined in g2_mars_labeling */ + int index; + const char* the_class; + const char* stream; + const char* type; + const char* expver; + const char* typeOfProcessedData; + const char* productDefinitionTemplateNumber; + const char* stepType; + const char* derivedForecast; + const char* typeOfGeneratingProcess; +}; + +class grib_accessor_class_g2_mars_labeling_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_g2_mars_labeling_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_mars_labeling_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2_mars_labeling_h */ diff --git a/src/accessor/grib_accessor_class_g2bitmap.cc b/src/accessor/grib_accessor_class_g2bitmap.cc new file mode 100644 index 000000000..f6ed3f1c8 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2bitmap.cc @@ -0,0 +1,75 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g2bitmap.h" +#include "shared_functions.h" + +grib_accessor_class_g2bitmap_t _grib_accessor_class_g2bitmap{"g2bitmap"}; +grib_accessor_class* grib_accessor_class_g2bitmap = &_grib_accessor_class_g2bitmap; + + +void grib_accessor_class_g2bitmap_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_g2bitmap_t* self = (grib_accessor_g2bitmap_t*)a; + + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 4); +} + +int grib_accessor_class_g2bitmap_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_g2bitmap_t* self = (grib_accessor_g2bitmap_t*)a; + + size_t tlen; + + unsigned char* buf = NULL; + size_t i; + int err = 0; + long pos = 0; + // long bmaplen = 0; + double miss_values = 0; + tlen = (*len + 7) / 8; + + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &miss_values)) != GRIB_SUCCESS) + return err; + + buf = (unsigned char*)grib_context_malloc_clear(a->context, tlen); + if (!buf) + return GRIB_OUT_OF_MEMORY; + pos = 0; + for (i = 0; i < *len; i++) { + if (val[i] == miss_values) + pos++; + else { + // bmaplen++; + grib_set_bit_on(buf, &pos); + } + } + + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfValues, *len)) != GRIB_SUCCESS) { + grib_context_free(a->context, buf); + return err; + } + + grib_buffer_replace(a, buf, tlen, 1, 1); + + grib_context_free(a->context, buf); + + return GRIB_SUCCESS; +} + + +int grib_accessor_class_g2bitmap_t::value_count(grib_accessor* a, long* tlen){ + grib_accessor_g2bitmap_t* self = (grib_accessor_g2bitmap_t*)a; + int err; + *tlen = 0; + + err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, tlen); + return err; +} diff --git a/src/accessor/grib_accessor_class_g2bitmap.h b/src/accessor/grib_accessor_class_g2bitmap.h new file mode 100644 index 000000000..9af7a3b27 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2bitmap.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2bitmap_h +#define eccodes_accessor_g2bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_bitmap.h" + +class grib_accessor_g2bitmap_t : public grib_accessor_bitmap_t +{ +public: + /* Members defined in g2bitmap */ + const char* numberOfValues; +}; + +class grib_accessor_class_g2bitmap_t : public grib_accessor_class_bitmap_t +{ +public: + grib_accessor_class_g2bitmap_t(const char* name) : grib_accessor_class_bitmap_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2bitmap_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2bitmap_h */ diff --git a/src/accessor/grib_accessor_class_g2bitmap_present.cc b/src/accessor/grib_accessor_class_g2bitmap_present.cc new file mode 100644 index 000000000..b4dfb5cf5 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2bitmap_present.cc @@ -0,0 +1,59 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g2bitmap_present.h" + +grib_accessor_class_g2bitmap_present_t _grib_accessor_class_g2bitmap_present{"g2bitmap_present"}; +grib_accessor_class* grib_accessor_class_g2bitmap_present = &_grib_accessor_class_g2bitmap_present; + + +void grib_accessor_class_g2bitmap_present_t::init(grib_accessor* a, const long l, grib_arguments* c){ + int n = 0; + grib_accessor_g2bitmap_present_t* self = (grib_accessor_g2bitmap_present_t*)a; + self->bitmapIndicator = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + + a->length = 0; +} + +int grib_accessor_class_g2bitmap_present_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + int ret = GRIB_SUCCESS; + long bitmapIndicator = 0; + + grib_accessor_g2bitmap_present_t* self = (grib_accessor_g2bitmap_present_t*)a; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitmapIndicator, &bitmapIndicator); + if (ret) { + if (ret == GRIB_NOT_FOUND) { + *val = 0; + return 0; + } + else + return ret; + } + + *val = 1; + if (bitmapIndicator == 255) + *val = 0; + + *len = 1; + return ret; +} + +int grib_accessor_class_g2bitmap_present_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_g2bitmap_present_t* self = (grib_accessor_g2bitmap_present_t*)a; + long bitmapIndicator = 0; + + if (*val == 0) + bitmapIndicator = 255; + + return grib_set_long(grib_handle_of_accessor(a), self->bitmapIndicator, bitmapIndicator); +} diff --git a/src/accessor/grib_accessor_class_g2bitmap_present.h b/src/accessor/grib_accessor_class_g2bitmap_present.h new file mode 100644 index 000000000..7b5cd3f66 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2bitmap_present.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2bitmap_present_h +#define eccodes_accessor_g2bitmap_present_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g2bitmap_present_t : public grib_accessor_long_t +{ +public: + /* Members defined in g2bitmap_present */ + const char* bitmapIndicator; +}; + +class grib_accessor_class_g2bitmap_present_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g2bitmap_present_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2bitmap_present_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2bitmap_present_h */ diff --git a/src/accessor/grib_accessor_class_g2date.cc b/src/accessor/grib_accessor_class_g2date.cc new file mode 100644 index 000000000..5b54ccc83 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2date.cc @@ -0,0 +1,82 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g2date.h" + +grib_accessor_class_g2date_t _grib_accessor_class_g2date{"g2date"}; +grib_accessor_class* grib_accessor_class_g2date = &_grib_accessor_class_g2date; + +void grib_accessor_class_g2date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g2date_t* self = (grib_accessor_g2date_t*)a; + int n = 0; + + self->year = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->month = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->day = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); +} + +int grib_accessor_class_g2date_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + const grib_accessor_g2date_t* self = (grib_accessor_g2date_t*)a; + + int ret = 0; + long year = 0; + long month = 0; + long day = 0; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->day, &day)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->month, &month)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->year, &year)) != GRIB_SUCCESS) + return ret; + + if (*len < 1) + return GRIB_WRONG_ARRAY_SIZE; + + val[0] = year * 10000 + month * 100 + day; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_g2date_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + const grib_accessor_g2date_t* self = (grib_accessor_g2date_t*)a; + + int ret = GRIB_SUCCESS; + long v = val[0]; + long year = 0; + long month = 0; + long day = 0; + + if (*len != 1) + return GRIB_WRONG_ARRAY_SIZE; + + year = v / 10000; + v %= 10000; + month = v / 100; + v %= 100; + day = v; + + if (!is_date_valid(year, month, day, 0, 0, 0)) { + // ECC-1777: For now just a warning. Will later change to an error + fprintf(stderr, "ECCODES WARNING : %s:%s: Date is not valid! year=%ld month=%ld day=%ld\n", + a->cclass->name, __func__, year, month, day); + } + + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->day, day)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->month, month)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->year, year)) != GRIB_SUCCESS) + return ret; + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_g2date.h b/src/accessor/grib_accessor_class_g2date.h new file mode 100644 index 000000000..20276c6fe --- /dev/null +++ b/src/accessor/grib_accessor_class_g2date.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2date_h +#define eccodes_accessor_g2date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g2date_t : public grib_accessor_long_t +{ +public: + /* Members defined in g2date */ + const char* century; + const char* year; + const char* month; + const char* day; +}; + +class grib_accessor_class_g2date_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g2date_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2date_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2date_h */ diff --git a/src/accessor/todo/grib_accessor_class_g2end_step.cc b/src/accessor/grib_accessor_class_g2end_step.cc similarity index 76% rename from src/accessor/todo/grib_accessor_class_g2end_step.cc rename to src/accessor/grib_accessor_class_g2end_step.cc index a86733eb3..947b867fd 100644 --- a/src/accessor/todo/grib_accessor_class_g2end_step.cc +++ b/src/accessor/grib_accessor_class_g2end_step.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,150 +10,17 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_g2end_step.h" #include "step.h" #include "step_utilities.h" #include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = unpack_double - IMPLEMENTS = unpack_string;pack_string - IMPLEMENTS = init;dump - IMPLEMENTS = get_native_type - MEMBERS = const char* start_step_value - MEMBERS = const char* step_units - - MEMBERS = const char* year - MEMBERS = const char* month - MEMBERS = const char* day - MEMBERS = const char* hour - MEMBERS = const char* minute - MEMBERS = const char* second - - MEMBERS = const char* year_of_end_of_interval - MEMBERS = const char* month_of_end_of_interval - MEMBERS = const char* day_of_end_of_interval - MEMBERS = const char* hour_of_end_of_interval - MEMBERS = const char* minute_of_end_of_interval - MEMBERS = const char* second_of_end_of_interval - - MEMBERS = const char* time_range_unit - MEMBERS = const char* time_range_value - MEMBERS = const char* typeOfTimeIncrement - MEMBERS = const char* numberOfTimeRange - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -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 unpack_double(grib_accessor*, double* 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 void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2end_step -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in g2end_step */ - const char* start_step_value; - const char* step_units; - const char* year; - const char* month; - const char* day; - const char* hour; - const char* minute; - const char* second; - const char* year_of_end_of_interval; - const char* month_of_end_of_interval; - const char* day_of_end_of_interval; - const char* hour_of_end_of_interval; - const char* minute_of_end_of_interval; - const char* second_of_end_of_interval; - const char* time_range_unit; - const char* time_range_value; - const char* typeOfTimeIncrement; - const char* numberOfTimeRange; -} grib_accessor_g2end_step; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_g2end_step = { - &grib_accessor_class_long, /* super */ - "g2end_step", /* name */ - sizeof(grib_accessor_g2end_step), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_g2end_step_t _grib_accessor_class_g2end_step{"g2end_step"}; grib_accessor_class* grib_accessor_class_g2end_step = &_grib_accessor_class_g2end_step; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; +void grib_accessor_class_g2end_step_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; int n = 0; grib_handle* h = grib_handle_of_accessor(a); @@ -179,14 +47,12 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->numberOfTimeRange = grib_arguments_get_name(h, c, n++); } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_g2end_step_t::dump(grib_accessor* a, grib_dumper* dumper){ grib_dump_double(dumper, a, NULL); } // See GRIB-488 -static bool is_special_expver(const grib_handle* h) -{ +bool is_special_expver(const grib_handle* h){ int ret = 0; char strMarsExpVer[50] = {0,}; char strMarsClass[50] = {0,}; @@ -225,9 +91,8 @@ static int convert_time_range_long_( return GRIB_SUCCESS; } -static int unpack_one_time_range_long_(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; +int unpack_one_time_range_long_(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; int err = 0; long start_step_value; long step_units; @@ -270,9 +135,8 @@ static int unpack_one_time_range_long_(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_one_time_range_double_(grib_accessor* a, double *val , size_t* len) -{ - grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; +int unpack_one_time_range_double_(grib_accessor* a, double *val , size_t* len){ + grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; int err = 0; double start_step_value; long start_step_unit; @@ -319,9 +183,8 @@ static int unpack_one_time_range_double_(grib_accessor* a, double *val , size_t* } #define MAX_NUM_TIME_RANGES 16 /* maximum number of time range specifications */ -static int unpack_multiple_time_ranges_long_(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; +int unpack_multiple_time_ranges_long_(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; int i = 0, err = 0; grib_handle* h = grib_handle_of_accessor(a); long numberOfTimeRange = 0, step_units = 0, start_step_value = 0; @@ -372,9 +235,8 @@ static int unpack_multiple_time_ranges_long_(grib_accessor* a, long* val, size_t return GRIB_DECODING_ERROR; } -static int unpack_multiple_time_ranges_double_(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; +int unpack_multiple_time_ranges_double_(grib_accessor* a, double* val, size_t* len){ + grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; int i = 0, err = 0; grib_handle* h = grib_handle_of_accessor(a); long numberOfTimeRange = 0; @@ -435,9 +297,8 @@ static int unpack_multiple_time_ranges_double_(grib_accessor* a, double* val, si // For the old implementation of unpack_long, see // src/deprecated/grib_accessor_class_g2end_step.unpack_long.cc // -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; +int grib_accessor_class_g2end_step_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; grib_handle* h = grib_handle_of_accessor(a); int ret = 0; long start_step_value; @@ -466,16 +327,15 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) } } catch (std::exception& e) { - grib_context_log(h->context, GRIB_LOG_ERROR, "grib_accessor_g2end_step::unpack_long: %s", e.what()); + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_accessor_g2end_step_t::unpack_long: %s", e.what()); ret = GRIB_DECODING_ERROR; } return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; +int grib_accessor_class_g2end_step_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; grib_handle* h = grib_handle_of_accessor(a); int ret = 0; long start_step_value; @@ -504,16 +364,15 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } } catch (std::exception& e) { - grib_context_log(h->context, GRIB_LOG_ERROR, "grib_accessor_g2end_step::unpack_double: %s", e.what()); + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_accessor_g2end_step_t::unpack_double: %s", e.what()); ret = GRIB_DECODING_ERROR; } return ret; } -static int pack_long_(grib_accessor* a, const long end_step_value, const long end_step_unit) -{ - grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; +int pack_long_(grib_accessor* a, const long end_step_value, const long end_step_unit){ + grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; grib_handle* h = grib_handle_of_accessor(a); int err = 0; @@ -641,9 +500,8 @@ static int pack_long_(grib_accessor* a, const long end_step_value, const long en return GRIB_SUCCESS; } -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; +int grib_accessor_class_g2end_step_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; grib_handle* h = grib_handle_of_accessor(a); int ret = 0; char fp_format[128] = "%g"; @@ -678,15 +536,14 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) memcpy(val, ss.str().c_str(), size); } catch (std::exception& e) { - grib_context_log(h->context, GRIB_LOG_ERROR, "grib_accessor_g2end_step::unpack_string: %s", e.what()); + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_accessor_g2end_step_t::unpack_string: %s", e.what()); return GRIB_DECODING_ERROR; } return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ +int grib_accessor_class_g2end_step_t::pack_long(grib_accessor* a, const long* val, size_t* len){ grib_handle* h = grib_handle_of_accessor(a); int ret; @@ -709,14 +566,13 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) ret = pack_long_(a, *val, end_step_unit); } catch (std::exception& e) { - grib_context_log(h->context, GRIB_LOG_ERROR, "grib_accessor_g2end_step::pack_long: %s", e.what()); + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_accessor_g2end_step_t::pack_long: %s", e.what()); return GRIB_DECODING_ERROR; } return ret; } -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ +int grib_accessor_class_g2end_step_t::pack_string(grib_accessor* a, const char* val, size_t* len){ grib_handle* h = grib_handle_of_accessor(a); int ret = 0; long force_step_units; @@ -734,14 +590,13 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return ret; } catch (std::exception& e) { - grib_context_log(h->context, GRIB_LOG_ERROR, "grib_accessor_g2end_step::pack_string: %s", e.what()); + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_accessor_g2end_step_t::pack_string: %s", e.what()); return GRIB_DECODING_ERROR; } return GRIB_SUCCESS; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_g2end_step_t::get_native_type(grib_accessor* a){ grib_handle* h = grib_handle_of_accessor(a); const int show_units_for_hours = a->context->grib_hourly_steps_with_units; diff --git a/src/accessor/grib_accessor_class_g2end_step.h b/src/accessor/grib_accessor_class_g2end_step.h new file mode 100644 index 000000000..7a2d8ab21 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2end_step.h @@ -0,0 +1,56 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2end_step_h +#define eccodes_accessor_g2end_step_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g2end_step_t : public grib_accessor_long_t +{ +public: + /* Members defined in g2end_step */ + const char* start_step_value; + const char* step_units; + const char* year; + const char* month; + const char* day; + const char* hour; + const char* minute; + const char* second; + const char* year_of_end_of_interval; + const char* month_of_end_of_interval; + const char* day_of_end_of_interval; + const char* hour_of_end_of_interval; + const char* minute_of_end_of_interval; + const char* second_of_end_of_interval; + const char* time_range_unit; + const char* time_range_value; + const char* typeOfTimeIncrement; + const char* numberOfTimeRange; +}; + +class grib_accessor_class_g2end_step_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g2end_step_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2end_step_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2end_step_h */ diff --git a/src/accessor/todo/grib_accessor_class_g2grid.cc b/src/accessor/grib_accessor_class_g2grid.cc similarity index 58% rename from src/accessor/todo/grib_accessor_class_g2grid.cc rename to src/accessor/grib_accessor_class_g2grid.cc index 40aaca628..74f276c62 100644 --- a/src/accessor/todo/grib_accessor_class_g2grid.cc +++ b/src/accessor/grib_accessor_class_g2grid.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,116 +10,14 @@ */ #include "grib_api_internal.h" -#include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double;pack_double;value_count - IMPLEMENTS = init - MEMBERS=const char* latitude_first - MEMBERS=const char* longitude_first - MEMBERS=const char* latitude_last - MEMBERS=const char* longitude_last - MEMBERS=const char* i_increment - MEMBERS=const char* j_increment - MEMBERS=const char* basic_angle - MEMBERS=const char* sub_division - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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*); - -typedef struct grib_accessor_g2grid -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in g2grid */ - const char* latitude_first; - const char* longitude_first; - const char* latitude_last; - const char* longitude_last; - const char* i_increment; - const char* j_increment; - const char* basic_angle; - const char* sub_division; -} grib_accessor_g2grid; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_g2grid = { - &grib_accessor_class_double, /* super */ - "g2grid", /* name */ - sizeof(grib_accessor_g2grid), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_g2grid.h" +grib_accessor_class_g2grid_t _grib_accessor_class_g2grid{"g2grid"}; grib_accessor_class* grib_accessor_class_g2grid = &_grib_accessor_class_g2grid; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2grid* self = (grib_accessor_g2grid*)a; +void grib_accessor_class_g2grid_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g2grid_t* self = (grib_accessor_g2grid_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; @@ -136,8 +35,7 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_g2grid_t::value_count(grib_accessor* a, long* count){ *count = 6; return 0; } @@ -145,9 +43,8 @@ static int value_count(grib_accessor* a, long* count) // GRIB edition 2 uses microdegrees #define ANGLE_SUBDIVISIONS (1000 * 1000) -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_g2grid* self = (grib_accessor_g2grid*)a; +int grib_accessor_class_g2grid_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_g2grid_t* self = (grib_accessor_g2grid_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int ret = 0; @@ -208,8 +105,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } -static long gcd(long a, long b) -{ +long gcd(long a, long b){ if (b > a) return gcd(b, a); if (b == 0) @@ -217,13 +113,11 @@ static long gcd(long a, long b) return gcd(b, a % b); } -static long lcm(long a, long b) -{ +long lcm(long a, long b){ return a * b / gcd(a, b); } -static int is_ok(const double* val, long v[6], double basic_angle, double sub_division) -{ +int is_ok(const double* val, long v[6], double basic_angle, double sub_division){ int i; int ok = 1; @@ -247,8 +141,7 @@ static int is_ok(const double* val, long v[6], double basic_angle, double sub_di return ok; } -static int trial(const double* val, long v[6], long* basic_angle, long* sub_division) -{ +int trial(const double* val, long v[6], long* basic_angle, long* sub_division){ int i = 0; long ni, nj; @@ -278,9 +171,8 @@ static int trial(const double* val, long v[6], long* basic_angle, long* sub_divi return is_ok(val, v, *basic_angle, *sub_division); } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_g2grid* self = (grib_accessor_g2grid*)a; +int grib_accessor_class_g2grid_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_g2grid_t* self = (grib_accessor_g2grid_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int ret; long v[6]; diff --git a/src/accessor/grib_accessor_class_g2grid.h b/src/accessor/grib_accessor_class_g2grid.h new file mode 100644 index 000000000..0cd177ce5 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2grid.h @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2grid_h +#define eccodes_accessor_g2grid_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_g2grid_t : public grib_accessor_double_t +{ +public: + /* Members defined in g2grid */ + const char* latitude_first; + const char* longitude_first; + const char* latitude_last; + const char* longitude_last; + const char* i_increment; + const char* j_increment; + const char* basic_angle; + const char* sub_division; +}; + +class grib_accessor_class_g2grid_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_g2grid_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2grid_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2grid_h */ diff --git a/src/accessor/grib_accessor_class_g2latlon.cc b/src/accessor/grib_accessor_class_g2latlon.cc new file mode 100644 index 000000000..f3d64f1e6 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2latlon.cc @@ -0,0 +1,115 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g2latlon.h" + +grib_accessor_class_g2latlon_t _grib_accessor_class_g2latlon{"g2latlon"}; +grib_accessor_class* grib_accessor_class_g2latlon = &_grib_accessor_class_g2latlon; + + +void grib_accessor_class_g2latlon_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g2latlon_t* self = (grib_accessor_g2latlon_t*)a; + int n = 0; + + self->grid = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->index = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); + self->given = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); +} + +int grib_accessor_class_g2latlon_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_g2latlon_t* self = (grib_accessor_g2latlon_t*)a; + int ret = 0; + + long given = 1; + double grid[6]; + size_t size = 6; + + if (*len < 1) { + ret = GRIB_ARRAY_TOO_SMALL; + return ret; + } + + if (self->given) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->given, &given)) != GRIB_SUCCESS) + return ret; + + if (!given) { + *val = GRIB_MISSING_DOUBLE; + return GRIB_SUCCESS; + } + + if ((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->grid, grid, &size)) != GRIB_SUCCESS) + return ret; + + *val = grid[self->index]; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_g2latlon_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_g2latlon_t* self = (grib_accessor_g2latlon_t*)a; + int ret = 0; + double grid[6]; + size_t size = 6; + double new_val = *val; + grib_handle* hand = grib_handle_of_accessor(a); + + if (*len < 1) { + ret = GRIB_ARRAY_TOO_SMALL; + return ret; + } + + if (self->given) { + long given = *val != GRIB_MISSING_DOUBLE; + if ((ret = grib_set_long_internal(hand, self->given, given)) != GRIB_SUCCESS) + return ret; + } + + if ((ret = grib_get_double_array_internal(hand, self->grid, grid, &size)) != GRIB_SUCCESS) + return ret; + + /* index 1 is longitudeOfFirstGridPointInDegrees + * index 3 is longitudeOfLastGridPointInDegrees + */ + if ((self->index == 1 || self->index == 3)) { + /* WMO regulation for GRIB edition 2: + * The longitude values shall be limited to the range 0 to 360 degrees inclusive */ + new_val = normalise_longitude_in_degrees(*val); + if (hand->context->debug && new_val != *val) { + fprintf(stderr, "ECCODES DEBUG pack_double g2latlon: normalise longitude %g -> %g\n", *val, new_val); + } + } + grid[self->index] = new_val; + + return grib_set_double_array_internal(hand, self->grid, grid, size); +} + +int grib_accessor_class_g2latlon_t::pack_missing(grib_accessor* a){ + grib_accessor_g2latlon_t* self = (grib_accessor_g2latlon_t*)a; + double missing = GRIB_MISSING_DOUBLE; + size_t size = 1; + + if (!self->given) + return GRIB_NOT_IMPLEMENTED; + + return pack_double(a, &missing, &size); +} + +int grib_accessor_class_g2latlon_t::is_missing(grib_accessor* a){ + grib_accessor_g2latlon_t* self = (grib_accessor_g2latlon_t*)a; + long given = 1; + + if (self->given) + grib_get_long_internal(grib_handle_of_accessor(a), self->given, &given); + + return !given; +} diff --git a/src/accessor/grib_accessor_class_g2latlon.h b/src/accessor/grib_accessor_class_g2latlon.h new file mode 100644 index 000000000..f16e2623e --- /dev/null +++ b/src/accessor/grib_accessor_class_g2latlon.h @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2latlon_h +#define eccodes_accessor_g2latlon_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_g2latlon_t : public grib_accessor_double_t +{ +public: + /* Members defined in g2latlon */ + const char* grid; + int index; + const char* given; +}; + +class grib_accessor_class_g2latlon_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_g2latlon_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2latlon_t{}; } + int pack_missing(grib_accessor*) override; + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2latlon_h */ diff --git a/src/accessor/todo/grib_accessor_class_g2level.cc b/src/accessor/grib_accessor_class_g2level.cc similarity index 66% rename from src/accessor/todo/grib_accessor_class_g2level.cc rename to src/accessor/grib_accessor_class_g2level.cc index 39bd79033..084b6eba9 100644 --- a/src/accessor/todo/grib_accessor_class_g2level.cc +++ b/src/accessor/grib_accessor_class_g2level.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,110 +10,14 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_g2level.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = unpack_long;pack_long;init;is_missing - MEMBERS=const char* type_first - MEMBERS=const char* scale_first - MEMBERS=const char* value_first - MEMBERS=const char* pressure_units - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int is_missing(grib_accessor*); -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2level -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in g2level */ - const char* type_first; - const char* scale_first; - const char* value_first; - const char* pressure_units; -} grib_accessor_g2level; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_g2level = { - &grib_accessor_class_long, /* super */ - "g2level", /* name */ - sizeof(grib_accessor_g2level), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - &is_missing, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_g2level_t _grib_accessor_class_g2level{"g2level"}; grib_accessor_class* grib_accessor_class_g2level = &_grib_accessor_class_g2level; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2level* self = (grib_accessor_g2level*)a; +void grib_accessor_class_g2level_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g2level_t* self = (grib_accessor_g2level_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; @@ -125,18 +30,16 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->flags |= GRIB_ACCESSOR_FLAG_COPY_IF_CHANGING_EDITION; } -static bool is_tigge(grib_handle* h) -{ +bool is_tigge(grib_handle* h){ long productionStatus = 0; int err = grib_get_long(h, "productionStatusOfProcessedData", &productionStatus); if (err) return false; return (productionStatus == 4 || productionStatus == 5); } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_g2level_t::unpack_double(grib_accessor* a, double* val, size_t* len){ int ret = 0; - grib_accessor_g2level* self = (grib_accessor_g2level*)a; + grib_accessor_g2level_t* self = (grib_accessor_g2level_t*)a; grib_handle* hand = grib_handle_of_accessor(a); long type_first = 0; @@ -211,8 +114,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ +int grib_accessor_class_g2level_t::unpack_long(grib_accessor* a, long* val, size_t* len){ double dval = 0; int ret = unpack_double(a, &dval, len); if (ret == GRIB_SUCCESS) { @@ -221,9 +123,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_g2level* self = (grib_accessor_g2level*)a; +int grib_accessor_class_g2level_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_g2level_t* self = (grib_accessor_g2level_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int ret = 0; double value_first = *val; @@ -284,8 +185,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ +int grib_accessor_class_g2level_t::pack_long(grib_accessor* a, const long* val, size_t* len){ int ret = 0; long value_first = *val; long scale_first = 0; @@ -293,7 +193,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) char pressure_units[10] = {0,}; size_t pressure_units_len = 10; - grib_accessor_g2level* self = (grib_accessor_g2level*)a; + grib_accessor_g2level_t* self = (grib_accessor_g2level_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int change_scale_and_value = 1; bool tigge = is_tigge(hand); @@ -359,14 +259,12 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_SUCCESS; } -static int is_missing(grib_accessor* a) -{ - grib_accessor_g2level* self = (grib_accessor_g2level*)a; +int grib_accessor_class_g2level_t::is_missing(grib_accessor* a){ + grib_accessor_g2level_t* self = (grib_accessor_g2level_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int err = 0; int ret = 0; ret = grib_is_missing(hand, self->scale_first, &err) + - grib_is_missing(hand, self->value_first, &err); - return ret; + grib_is_missing(hand, self->value_first, &err); return ret; } diff --git a/src/accessor/grib_accessor_class_g2level.h b/src/accessor/grib_accessor_class_g2level.h new file mode 100644 index 000000000..567b8c1b4 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2level.h @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2level_h +#define eccodes_accessor_g2level_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g2level_t : public grib_accessor_long_t +{ +public: + /* Members defined in g2level */ + const char* type_first; + const char* scale_first; + const char* value_first; + const char* pressure_units; +}; + +class grib_accessor_class_g2level_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g2level_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2level_t{}; } + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2level_h */ diff --git a/src/accessor/grib_accessor_class_g2lon.cc b/src/accessor/grib_accessor_class_g2lon.cc new file mode 100644 index 000000000..1ef641a89 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2lon.cc @@ -0,0 +1,58 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_g2lon.h" + +grib_accessor_class_g2lon_t _grib_accessor_class_g2lon{"g2lon"}; +grib_accessor_class* grib_accessor_class_g2lon = &_grib_accessor_class_g2lon; + + +void grib_accessor_class_g2lon_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g2lon_t* self = (grib_accessor_g2lon_t*)a; + int n = 0; + + self->longitude = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); +} + +int grib_accessor_class_g2lon_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_g2lon_t* self = (grib_accessor_g2lon_t*)a; + int ret = 0; + long longitude; + + if ((ret = grib_get_long(grib_handle_of_accessor(a), self->longitude, &longitude)) != GRIB_SUCCESS) + return ret; + + if (longitude == GRIB_MISSING_LONG) { + *val = GRIB_MISSING_DOUBLE; + return GRIB_SUCCESS; + } + + *val = ((double)longitude) / 1000000.0; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_g2lon_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_g2lon_t* self = (grib_accessor_g2lon_t*)a; + long longitude; + double value = *val; + + if (value == GRIB_MISSING_DOUBLE) { + longitude = GRIB_MISSING_LONG; + } + else { + if (value < 0) + value += 360; + longitude = (long)(value * 1000000); + } + return grib_set_long(grib_handle_of_accessor(a), self->longitude, longitude); +} diff --git a/src/accessor/grib_accessor_class_g2lon.h b/src/accessor/grib_accessor_class_g2lon.h new file mode 100644 index 000000000..d17a68c14 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2lon.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2lon_h +#define eccodes_accessor_g2lon_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_g2lon_t : public grib_accessor_double_t +{ +public: + /* Members defined in g2lon */ + const char* longitude; +}; + +class grib_accessor_class_g2lon_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_g2lon_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2lon_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2lon_h */ diff --git a/src/accessor/todo/grib_accessor_class_g2step_range.cc b/src/accessor/grib_accessor_class_g2step_range.cc similarity index 64% rename from src/accessor/todo/grib_accessor_class_g2step_range.cc rename to src/accessor/grib_accessor_class_g2step_range.cc index c39601a40..ca7595ace 100644 --- a/src/accessor/todo/grib_accessor_class_g2step_range.cc +++ b/src/accessor/grib_accessor_class_g2step_range.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,116 +10,20 @@ */ #include "grib_api_internal.h" -#include "step.h" -#include "step_utilities.h" +#include "grib_accessor_class_g2step_range.h" +#include "../step.h" +#include "../step_utilities.h" #include #include #include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = pack_string;unpack_string;value_count - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = unpack_double - IMPLEMENTS = unpack_string;pack_string - IMPLEMENTS = get_native_type;string_length - IMPLEMENTS = init - MEMBERS = const char* start_step - MEMBERS = const char* end_step - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -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 unpack_double(grib_accessor*, double* 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 size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2step_range -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in g2step_range */ - const char* start_step; - const char* end_step; -} grib_accessor_g2step_range; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_g2step_range = { - &grib_accessor_class_gen, /* super */ - "g2step_range", /* name */ - sizeof(grib_accessor_g2step_range), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; +grib_accessor_class_g2step_range_t _grib_accessor_class_g2step_range{"g2step_range"}; grib_accessor_class* grib_accessor_class_g2step_range = &_grib_accessor_class_g2step_range; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; +void grib_accessor_class_g2step_range_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_g2step_range_t* self = (grib_accessor_g2step_range_t*)a; int n = 0; @@ -133,9 +38,8 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) //grib_dump_string(dumper, a, NULL); //} -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; +int grib_accessor_class_g2step_range_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_g2step_range_t* self = (grib_accessor_g2step_range_t*)a; grib_handle* h = grib_handle_of_accessor(a); int ret = 0; size_t size = 0; @@ -189,7 +93,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) memcpy(val, ss.str().c_str(), size); } catch (std::exception& e) { - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_g2step_range::unpack_string: %s", e.what()); + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_g2step_range_t::unpack_string: %s", e.what()); return GRIB_DECODING_ERROR; } @@ -201,9 +105,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) // and can be in different units // stepRange="X" in instantaneous field is equivalent to set step=X // stepRange="X" in accumulated field is equivalent to startStep=X, endStep=startStep -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; +int grib_accessor_class_g2step_range_t::pack_string(grib_accessor* a, const char* val, size_t* len){ + grib_accessor_g2step_range_t* self = (grib_accessor_g2step_range_t*)a; grib_handle* h = grib_handle_of_accessor(a); int ret = 0; @@ -259,19 +162,16 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return GRIB_SUCCESS; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_g2step_range_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } -static size_t string_length(grib_accessor* a) -{ +size_t grib_accessor_class_g2step_range_t::string_length(grib_accessor* a){ return 255; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ +int grib_accessor_class_g2step_range_t::pack_long(grib_accessor* a, const long* val, size_t* len){ char buff[100]; size_t bufflen = 100; @@ -280,9 +180,8 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; +int grib_accessor_class_g2step_range_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_g2step_range_t* self = (grib_accessor_g2step_range_t*)a; grib_handle* h = grib_handle_of_accessor(a); int ret = 0; long end_start_value = 0; @@ -319,9 +218,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; +int grib_accessor_class_g2step_range_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_g2step_range_t* self = (grib_accessor_g2step_range_t*)a; grib_handle* h = grib_handle_of_accessor(a); int ret = 0; double end_start_value = 0; @@ -359,7 +257,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_g2step_range_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_STRING; } diff --git a/src/accessor/grib_accessor_class_g2step_range.h b/src/accessor/grib_accessor_class_g2step_range.h new file mode 100644 index 000000000..c5a007806 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2step_range.h @@ -0,0 +1,41 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2step_range_h +#define eccodes_accessor_g2step_range_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_g2step_range_t : public grib_accessor_gen_t +{ +public: + /* Members defined in g2step_range */ + const char* start_step; + const char* end_step; +}; + +class grib_accessor_class_g2step_range_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_g2step_range_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2step_range_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2step_range_h */ diff --git a/src/accessor/grib_accessor_class_gaussian_grid_name.cc b/src/accessor/grib_accessor_class_gaussian_grid_name.cc new file mode 100644 index 000000000..7b27f2c05 --- /dev/null +++ b/src/accessor/grib_accessor_class_gaussian_grid_name.cc @@ -0,0 +1,84 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_gaussian_grid_name.h" + +grib_accessor_class_gaussian_grid_name_t _grib_accessor_class_gaussian_grid_name{"gaussian_grid_name"}; +grib_accessor_class* grib_accessor_class_gaussian_grid_name = &_grib_accessor_class_gaussian_grid_name; + + +void grib_accessor_class_gaussian_grid_name_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_gaussian_grid_name_t* self = (grib_accessor_gaussian_grid_name_t*)a; + int n = 0; + + self->N = grib_arguments_get_name(a->parent->h, arg, n++); + self->Ni = grib_arguments_get_name(a->parent->h, arg, n++); + self->isOctahedral = grib_arguments_get_name(a->parent->h, arg, n++); + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; +} + +int grib_accessor_class_gaussian_grid_name_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_STRING; +} + +#define MAX_GRIDNAME_LEN 16 + +int grib_accessor_class_gaussian_grid_name_t::unpack_string(grib_accessor* a, char* v, size_t* len){ + grib_accessor_gaussian_grid_name_t* self = (grib_accessor_gaussian_grid_name_t*)a; + + long N = 0, Ni = 0; + char tmp[MAX_GRIDNAME_LEN] = {0,}; + size_t length = 0; + int ret = GRIB_SUCCESS; + + if ((ret = grib_get_long_internal(a->parent->h, self->N, &N)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(a->parent->h, self->Ni, &Ni)) != GRIB_SUCCESS) + return ret; + + if (Ni == GRIB_MISSING_LONG) { + /* Reduced gaussian grid */ + long isOctahedral = 0; + if ((ret = grib_get_long_internal(a->parent->h, self->isOctahedral, &isOctahedral)) != GRIB_SUCCESS) + return ret; + if (isOctahedral == 1) { + snprintf(tmp, sizeof(tmp), "O%ld", N); + } + else { + snprintf(tmp, sizeof(tmp), "N%ld", N); /* Classic */ + } + } + else { + /* Regular gaussian grid */ + snprintf(tmp, sizeof(tmp), "F%ld", N); + } + length = strlen(tmp) + 1; + + if (*len < length) { + const char* cclass_name = a->cclass->name; + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + cclass_name, a->name, length, *len); + *len = length; + return GRIB_BUFFER_TOO_SMALL; + } + + strcpy(v, tmp); + *len = length; + return GRIB_SUCCESS; +} + +size_t grib_accessor_class_gaussian_grid_name_t::string_length(grib_accessor* a){ + return MAX_GRIDNAME_LEN; +} diff --git a/src/accessor/grib_accessor_class_gaussian_grid_name.h b/src/accessor/grib_accessor_class_gaussian_grid_name.h new file mode 100644 index 000000000..1c12bfacd --- /dev/null +++ b/src/accessor/grib_accessor_class_gaussian_grid_name.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_gaussian_grid_name_h +#define eccodes_accessor_gaussian_grid_name_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_gaussian_grid_name_t : public grib_accessor_gen_t +{ +public: + /* Members defined in gaussian_grid_name */ + const char* N; + const char* Ni; + const char* isOctahedral; +}; + +class grib_accessor_class_gaussian_grid_name_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_gaussian_grid_name_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_gaussian_grid_name_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_gaussian_grid_name_h */ diff --git a/src/accessor/grib_accessor_class_gds_is_present.cc b/src/accessor/grib_accessor_class_gds_is_present.cc new file mode 100644 index 000000000..4939d0949 --- /dev/null +++ b/src/accessor/grib_accessor_class_gds_is_present.cc @@ -0,0 +1,86 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_gds_is_present.h" + +grib_accessor_class_gds_is_present_t _grib_accessor_class_gds_is_present{"gds_is_present"}; +grib_accessor_class* grib_accessor_class_gds_is_present = &_grib_accessor_class_gds_is_present; + + +void grib_accessor_class_gds_is_present_t::init(grib_accessor* a, const long l, grib_arguments* c){ + int n = 0; + grib_accessor_gds_is_present_t* self = (grib_accessor_gds_is_present_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + self->gds_present = grib_arguments_get_name(h, c, n++); + self->grid_definition = grib_arguments_get_name(h, c, n++); + self->bitmap_present = grib_arguments_get_name(h, c, n++); + self->values = grib_arguments_get_name(h, c, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; + a->length = 0; +} + +int grib_accessor_class_gds_is_present_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_gds_is_present_t* self = (grib_accessor_gds_is_present_t*)a; + long missing = 255; + int ret = 0; + size_t size = 0; + double* values = NULL; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if (*val != 1) + return GRIB_NOT_IMPLEMENTED; + + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; + + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; + + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return ret; + } + + if ((ret = grib_set_long_internal(h, self->gds_present, *val)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_set_long_internal(h, self->bitmap_present, *val)) != GRIB_SUCCESS) + return ret; + + + if ((ret = grib_set_long_internal(h, self->grid_definition, missing)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) + return ret; + + grib_context_free(c, values); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_gds_is_present_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + int ret = 0; + grib_handle* h = grib_handle_of_accessor(a); + grib_accessor_gds_is_present_t* self = (grib_accessor_gds_is_present_t*)a; + + if ((ret = grib_get_long_internal(h, self->gds_present, val)) != GRIB_SUCCESS) + return ret; + + *len = 1; + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_gds_is_present.h b/src/accessor/grib_accessor_class_gds_is_present.h new file mode 100644 index 000000000..fa1c5ca55 --- /dev/null +++ b/src/accessor/grib_accessor_class_gds_is_present.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_gds_is_present_h +#define eccodes_accessor_gds_is_present_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_gds_is_present_t : public grib_accessor_long_t +{ +public: + /* Members defined in gds_is_present */ + const char* gds_present; + const char* grid_definition; + const char* bitmap_present; + const char* values; +}; + +class grib_accessor_class_gds_is_present_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_gds_is_present_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_gds_is_present_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_gds_is_present_h */ diff --git a/src/accessor/grib_accessor_class_gds_not_present_bitmap.cc b/src/accessor/grib_accessor_class_gds_not_present_bitmap.cc new file mode 100644 index 000000000..368f112d4 --- /dev/null +++ b/src/accessor/grib_accessor_class_gds_not_present_bitmap.cc @@ -0,0 +1,109 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_gds_not_present_bitmap.h" + +grib_accessor_class_gds_not_present_bitmap_t _grib_accessor_class_gds_not_present_bitmap{"gds_not_present_bitmap"}; +grib_accessor_class* grib_accessor_class_gds_not_present_bitmap = &_grib_accessor_class_gds_not_present_bitmap; + + +void grib_accessor_class_gds_not_present_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ + int n = 0; + grib_accessor_gds_not_present_bitmap_t* self = (grib_accessor_gds_not_present_bitmap_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + + self->missing_value = grib_arguments_get_name(hand, args, n++); + self->number_of_values = grib_arguments_get_name(hand, args, n++); + self->number_of_points = grib_arguments_get_name(hand, args, n++); + self->latitude_of_first_point = grib_arguments_get_name(hand, args, n++); + self->ni = grib_arguments_get_name(hand, args, n++); + a->length = 0; +} + +int grib_accessor_class_gds_not_present_bitmap_t::value_count(grib_accessor* a, long* number_of_points){ + grib_accessor_gds_not_present_bitmap_t* self = (grib_accessor_gds_not_present_bitmap_t*)a; + *number_of_points = 0; + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_points, number_of_points); +} + +int grib_accessor_class_gds_not_present_bitmap_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_gds_not_present_bitmap_t* self = (grib_accessor_gds_not_present_bitmap_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + + long number_of_points = 0, number_of_values = 0, ni = 0; + long latitude_of_first_point = 0; + size_t i = 0; + size_t n_vals = 0; + long nn = 0; + long missing_value; + + int err = 0; + double* coded_vals = NULL; + err = a->value_count(&nn); n_vals = nn; + if (err) + return err; + + if ((err = grib_get_long(hand, self->number_of_points, &number_of_points)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long(hand, self->number_of_values, &number_of_values)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long(hand, self->latitude_of_first_point, &latitude_of_first_point)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long(hand, self->missing_value, &missing_value)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long(hand, self->ni, &ni)) != GRIB_SUCCESS) + return err; + + if (*len < number_of_points) { + *len = n_vals; + return GRIB_ARRAY_TOO_SMALL; + } + + if (number_of_values > 0) { + coded_vals = (double*)grib_context_malloc(a->context, number_of_values * sizeof(double)); + + if (coded_vals == NULL) + return GRIB_OUT_OF_MEMORY; + } + + if (latitude_of_first_point == 0) { + for (i = 0; i < number_of_values; i++) + val[i] = 1; + for (i = number_of_values; i < number_of_points; i++) + val[i] = 0; + } + else { + for (i = 0; i < ni - 1; i++) + val[i] = 0; + for (i = ni - 1; i < number_of_points; i++) + val[i] = 1; + } + + *len = number_of_points; + + grib_context_free(a->context, coded_vals); + return err; +} + +int grib_accessor_class_gds_not_present_bitmap_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + // See deprecated/grib_accessor_class_gds_not_present_bitmap.cc for + // a possible implementation + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_gds_not_present_bitmap_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_DOUBLE; +} diff --git a/src/accessor/grib_accessor_class_gds_not_present_bitmap.h b/src/accessor/grib_accessor_class_gds_not_present_bitmap.h new file mode 100644 index 000000000..68641a8e2 --- /dev/null +++ b/src/accessor/grib_accessor_class_gds_not_present_bitmap.h @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_gds_not_present_bitmap_h +#define eccodes_accessor_gds_not_present_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_gds_not_present_bitmap_t : public grib_accessor_gen_t +{ +public: + /* Members defined in gds_not_present_bitmap */ + const char* missing_value; + const char* number_of_values; + const char* number_of_points; + const char* latitude_of_first_point; + const char* ni; +}; + +class grib_accessor_class_gds_not_present_bitmap_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_gds_not_present_bitmap_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_gds_not_present_bitmap_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_gds_not_present_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_getenv.cc b/src/accessor/grib_accessor_class_getenv.cc new file mode 100644 index 000000000..2c714767d --- /dev/null +++ b/src/accessor/grib_accessor_class_getenv.cc @@ -0,0 +1,62 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_getenv.h" + +grib_accessor_class_getenv_t _grib_accessor_class_getenv{"getenv"}; +grib_accessor_class* grib_accessor_class_getenv = &_grib_accessor_class_getenv; + + +void grib_accessor_class_getenv_t::init(grib_accessor* a, const long l, grib_arguments* args){ + grib_accessor_getenv_t* self = (grib_accessor_getenv_t*)a; + static char undefined[] = "undefined"; + + self->name = grib_arguments_get_string(grib_handle_of_accessor(a), args, 0); + self->default_value = grib_arguments_get_string(grib_handle_of_accessor(a), args, 1); + if (!self->default_value) + self->default_value = undefined; + self->value = 0; +} + +int grib_accessor_class_getenv_t::pack_string(grib_accessor* a, const char* val, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_getenv_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_getenv_t* self = (grib_accessor_getenv_t*)a; + char* v = 0; + size_t l = 0; + + if (!self->value) { + v = getenv(self->name); + if (!v) + v = (char*)self->default_value; + self->value = v; + } + + l = strlen(self->value); + if (*len < l) + return GRIB_BUFFER_TOO_SMALL; + snprintf(val, 1024, "%s", self->value); + *len = strlen(self->value); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_getenv_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +size_t grib_accessor_class_getenv_t::string_length(grib_accessor* a){ + return 1024; +} diff --git a/src/accessor/grib_accessor_class_getenv.h b/src/accessor/grib_accessor_class_getenv.h new file mode 100644 index 000000000..8ddf7db14 --- /dev/null +++ b/src/accessor/grib_accessor_class_getenv.h @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_getenv_h +#define eccodes_accessor_getenv_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_getenv_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in getenv */ + const char* name; + char* value; + const char* default_value; +}; + +class grib_accessor_class_getenv_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_getenv_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_getenv_t{}; } + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_getenv_h */ diff --git a/src/accessor/todo/grib_accessor_class_global_gaussian.cc b/src/accessor/grib_accessor_class_global_gaussian.cc similarity index 64% rename from src/accessor/todo/grib_accessor_class_global_gaussian.cc rename to src/accessor/grib_accessor_class_global_gaussian.cc index b39677da2..a26b77252 100644 --- a/src/accessor/todo/grib_accessor_class_global_gaussian.cc +++ b/src/accessor/grib_accessor_class_global_gaussian.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,121 +10,14 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_global_gaussian.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init - MEMBERS=const char* N - MEMBERS=const char* Ni - MEMBERS=const char* di - MEMBERS=const char* latfirst - MEMBERS=const char* lonfirst - MEMBERS=const char* latlast - MEMBERS=const char* lonlast - MEMBERS=const char* plpresent - MEMBERS=const char* pl - MEMBERS=const char* basic_angle - MEMBERS=const char* subdivision - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_global_gaussian -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in global_gaussian */ - const char* N; - const char* Ni; - const char* di; - const char* latfirst; - const char* lonfirst; - const char* latlast; - const char* lonlast; - const char* plpresent; - const char* pl; - const char* basic_angle; - const char* subdivision; -} grib_accessor_global_gaussian; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_global_gaussian = { - &grib_accessor_class_long, /* super */ - "global_gaussian", /* name */ - sizeof(grib_accessor_global_gaussian), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_global_gaussian_t _grib_accessor_class_global_gaussian{"global_gaussian"}; grib_accessor_class* grib_accessor_class_global_gaussian = &_grib_accessor_class_global_gaussian; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_global_gaussian* self = (grib_accessor_global_gaussian*)a; +void grib_accessor_class_global_gaussian_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_global_gaussian_t* self = (grib_accessor_global_gaussian_t*)a; int n = 0; grib_handle* h = grib_handle_of_accessor(a); @@ -140,9 +34,8 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->subdivision = grib_arguments_get_name(h, c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_global_gaussian* self = (grib_accessor_global_gaussian*)a; +int grib_accessor_class_global_gaussian_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_global_gaussian_t* self = (grib_accessor_global_gaussian_t*)a; int ret = GRIB_SUCCESS; long latfirst, latlast, lonfirst, lonlast, basic_angle, subdivision, N, Ni; double dlatfirst, dlatlast, dlonfirst, dlonlast; @@ -247,9 +140,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_global_gaussian* self = (grib_accessor_global_gaussian*)a; +int grib_accessor_class_global_gaussian_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_global_gaussian_t* self = (grib_accessor_global_gaussian_t*)a; int ret = GRIB_SUCCESS; long latfirst, latlast, lonfirst, lonlast, di, diold, basic_angle = 0, N, Ni; long factor; diff --git a/src/accessor/grib_accessor_class_global_gaussian.h b/src/accessor/grib_accessor_class_global_gaussian.h new file mode 100644 index 000000000..f1e8bf53b --- /dev/null +++ b/src/accessor/grib_accessor_class_global_gaussian.h @@ -0,0 +1,44 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_global_gaussian_h +#define eccodes_accessor_global_gaussian_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_global_gaussian_t : public grib_accessor_long_t +{ +public: + /* Members defined in global_gaussian */ + const char* N; + const char* Ni; + const char* di; + const char* latfirst; + const char* lonfirst; + const char* latlast; + const char* lonlast; + const char* plpresent; + const char* pl; + const char* basic_angle; + const char* subdivision; +}; + +class grib_accessor_class_global_gaussian_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_global_gaussian_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_global_gaussian_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_global_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_group.cc b/src/accessor/grib_accessor_class_group.cc new file mode 100644 index 000000000..20ca66ae2 --- /dev/null +++ b/src/accessor/grib_accessor_class_group.cc @@ -0,0 +1,160 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_group.h" + +grib_accessor_class_group_t _grib_accessor_class_group{"group"}; +grib_accessor_class* grib_accessor_class_group = &_grib_accessor_class_group; + + +void grib_accessor_class_group_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; + grib_accessor_group_t* self = (grib_accessor_group_t*)a; + + size_t i = 0; + unsigned char* v; + const char* s = grib_arguments_get_string(grib_handle_of_accessor(a), arg, 0); + + if (s && strlen(s) > 1) { + grib_context_log(a->context, GRIB_LOG_WARNING, + "Using only first character as group end of %s not the string %s", a->name, s); + } + + self->endCharacter = s ? s[0] : 0; + + v = buffer->data + a->offset; + i = 0; + if (s) { + while (*v != self->endCharacter && i <= buffer->ulength) { + if (*v > 126) + *v = 32; + v++; + i++; + } + } + else { + while (*v > 32 && *v != 61 && *v < 127 && i <= buffer->ulength) { + v++; + i++; + } + } + a->length = i; + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_group_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +size_t grib_accessor_class_group_t::string_length(grib_accessor* a){ + return a->length; +} + +void grib_accessor_class_group_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_string(dumper, a, NULL); +} + +int grib_accessor_class_group_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_STRING; +} + +int grib_accessor_class_group_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + long i = 0; + size_t l = a->length + 1; + grib_handle* h = grib_handle_of_accessor(a); + + if (*len < l) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + a->cclass->name, a->name, l, *len); + *len = l; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < a->length; i++) + val[i] = h->buffer->data[a->offset + i]; + val[i] = 0; + *len = i; + return GRIB_SUCCESS; +} + +int grib_accessor_class_group_t::unpack_long(grib_accessor* a, long* v, size_t* len){ + char val[1024] = {0,}; + size_t l = sizeof(val); + size_t i = 0; + char* last = NULL; + int err = a->unpack_string(val, &l); + if (err) + return err; + + i = 0; + while (i < l - 1 && val[i] == ' ') + i++; + + if (val[i] == 0) { + *v = 0; + return 0; + } + if (val[i + 1] == ' ' && i < l - 2) + val[i + 1] = 0; + + *v = strtol(val, &last, 10); + + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); + return GRIB_SUCCESS; +} + +int grib_accessor_class_group_t::unpack_double(grib_accessor* a, double* v, size_t* len){ + char val[1024]; + size_t l = sizeof(val); + char* last = NULL; + a->unpack_string(val, &l); + *v = strtod(val, &last); + + if (*last == 0) { + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); + return GRIB_SUCCESS; + } + + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_group_t::compare(grib_accessor* a, grib_accessor* b){ + grib_context_log(a->context, GRIB_LOG_ERROR, "%s:%s not implemented", __func__, a->name); + return GRIB_NOT_IMPLEMENTED; + + // int retval = 0; + // char* aval = 0; + // char* bval = 0; + // int err = 0; + // size_t alen = 0; + // size_t blen = 0; + // long count = 0; + // err = a->value_count(&count); // if (err) return err; + // alen = count; + // err = b->value_count(&count); // if (err) return err; + // blen = count; + // if (alen != blen) return GRIB_COUNT_MISMATCH; + // aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); + // bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); + // a->unpack_string(aval, &alen); // b->unpack_string(bval, &blen); // retval = GRIB_SUCCESS; + // if (strcmp(aval, bval)) retval = GRIB_STRING_VALUE_MISMATCH; + // grib_context_free(a->context, aval); + // grib_context_free(b->context, bval); + // return retval; +} + +long grib_accessor_class_group_t::next_offset(grib_accessor* a){ + return a->offset + a->length; +} diff --git a/src/accessor/grib_accessor_class_group.h b/src/accessor/grib_accessor_class_group.h new file mode 100644 index 000000000..085b91a8a --- /dev/null +++ b/src/accessor/grib_accessor_class_group.h @@ -0,0 +1,41 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_group_h +#define eccodes_accessor_group_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_group_t : public grib_accessor_gen_t +{ +public: + /* Members defined in group */ + char endCharacter; +}; + +class grib_accessor_class_group_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_group_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_group_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_group_h */ diff --git a/src/accessor/grib_accessor_class_gts_header.cc b/src/accessor/grib_accessor_class_gts_header.cc new file mode 100644 index 000000000..4d24c8835 --- /dev/null +++ b/src/accessor/grib_accessor_class_gts_header.cc @@ -0,0 +1,61 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_gts_header.h" + +grib_accessor_class_gts_header_t _grib_accessor_class_gts_header{"gts_header"}; +grib_accessor_class* grib_accessor_class_gts_header = &_grib_accessor_class_gts_header; + + +void grib_accessor_class_gts_header_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_gts_header_t* self = (grib_accessor_gts_header_t*)a; + self->gts_offset = -1; + self->gts_length = -1; + self->gts_offset = grib_arguments_get_long(grib_handle_of_accessor(a), c, 0); + self->gts_length = grib_arguments_get_long(grib_handle_of_accessor(a), c, 1); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_gts_header_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_gts_header_t* self = (grib_accessor_gts_header_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + int offset = 0; + size_t length = 0; + + if (h->gts_header == NULL || h->gts_header_len < 8) { + if (*len < 8) + return GRIB_BUFFER_TOO_SMALL; + snprintf(val, 1024, "missing"); + return GRIB_SUCCESS; + } + if (*len < h->gts_header_len) + return GRIB_BUFFER_TOO_SMALL; + + offset = self->gts_offset > 0 ? self->gts_offset : 0; + length = self->gts_length > 0 ? self->gts_length : h->gts_header_len; + + memcpy(val, h->gts_header + offset, length); + + *len = length; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_gts_header_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +size_t grib_accessor_class_gts_header_t::string_length(grib_accessor* a){ + grib_handle* h = grib_handle_of_accessor(a); + return h->gts_header_len; +} diff --git a/src/accessor/grib_accessor_class_gts_header.h b/src/accessor/grib_accessor_class_gts_header.h new file mode 100644 index 000000000..c164a9df9 --- /dev/null +++ b/src/accessor/grib_accessor_class_gts_header.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_gts_header_h +#define eccodes_accessor_gts_header_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_gts_header_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in gts_header */ + int gts_offset; + int gts_length; +}; + +class grib_accessor_class_gts_header_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_gts_header_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_gts_header_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_gts_header_h */ diff --git a/src/accessor/grib_accessor_class_hash_array.cc b/src/accessor/grib_accessor_class_hash_array.cc new file mode 100644 index 000000000..d2fd1a8ef --- /dev/null +++ b/src/accessor/grib_accessor_class_hash_array.cc @@ -0,0 +1,176 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_hash_array.h" + +grib_accessor_class_hash_array_t _grib_accessor_class_hash_array{"hash_array"}; +grib_accessor_class* grib_accessor_class_hash_array = &_grib_accessor_class_hash_array; + + +#define MAX_HASH_ARRAY_STRING_LENGTH 255 + +void grib_accessor_class_hash_array_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_hash_array_t* self = (grib_accessor_hash_array_t*)a; + a->length = 0; + self->key = 0; + self->ha = NULL; +} + +void grib_accessor_class_hash_array_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_string(dumper, a, NULL); +} + +int grib_accessor_class_hash_array_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_hash_array_t* self = (grib_accessor_hash_array_t*)a; + char s[200] = {0,}; + snprintf(s, sizeof(s), "%g", *val); + self->key = grib_context_strdup(a->context, s); + self->ha = 0; + return GRIB_SUCCESS; +} + +int grib_accessor_class_hash_array_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_hash_array_t* self = (grib_accessor_hash_array_t*)a; + char s[200] = {0,}; + snprintf(s, sizeof(s), "%ld", *val); + if (self->key) + grib_context_free(a->context, self->key); + self->key = grib_context_strdup(a->context, s); + self->ha = 0; + return GRIB_SUCCESS; +} + +int grib_accessor_class_hash_array_t::pack_string(grib_accessor* a, const char* v, size_t* len){ + grib_accessor_hash_array_t* self = (grib_accessor_hash_array_t*)a; + self->key = grib_context_strdup(a->context, v); + self->ha = 0; + return GRIB_SUCCESS; +} + +int grib_accessor_class_hash_array_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +} + +static grib_hash_array_value* find_hash_value(grib_accessor* a, int* err) +{ + grib_accessor_hash_array_t* self = (grib_accessor_hash_array_t*)a; + grib_hash_array_value* ha_ret = 0; + grib_hash_array_value* ha = NULL; + + ha = get_hash_array(grib_handle_of_accessor(a), a->creator); + if (!ha) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to get hash value for %s", a->creator->name); + *err = GRIB_HASH_ARRAY_NO_MATCH; + return NULL; + } + + *err = GRIB_SUCCESS; + + Assert(ha != NULL); + if (!self->key) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to get hash value for %s, set before getting", a->creator->name); + *err = GRIB_HASH_ARRAY_NO_MATCH; + return NULL; + } + + ha_ret = (grib_hash_array_value*)grib_trie_get(ha->index, self->key); + if (!ha_ret) + ha_ret = (grib_hash_array_value*)grib_trie_get(ha->index, "default"); + + if (!ha_ret) { + *err = GRIB_HASH_ARRAY_NO_MATCH; + grib_context_log(a->context, GRIB_LOG_ERROR, + "hash_array: no match for %s=%s", + a->creator->name, self->key); + const char* full_path = get_hash_array_full_path(a->creator); + if (full_path) { + grib_context_log(a->context, GRIB_LOG_ERROR, "hash_array: file path = %s", full_path); + } + grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Check the key 'masterTablesVersionNumber'"); + return NULL; + } + return ha_ret; +} + +int grib_accessor_class_hash_array_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_hash_array_value* ha = 0; + grib_accessor_hash_array_t* self = (grib_accessor_hash_array_t*)a; + int err = 0; + size_t i = 0; + + if (!self->ha) { + ha = find_hash_value(a, &err); + if (err) + return err; + self->ha = ha; + } + + switch (self->ha->type) { + case GRIB_HASH_ARRAY_TYPE_INTEGER: + if (*len < self->ha->iarray->n) { + return GRIB_ARRAY_TOO_SMALL; + } + *len = self->ha->iarray->n; + for (i = 0; i < *len; i++) + val[i] = self->ha->iarray->v[i]; + break; + + default: + return GRIB_NOT_IMPLEMENTED; + } + + return GRIB_SUCCESS; +} + +int grib_accessor_class_hash_array_t::get_native_type(grib_accessor* a){ + int type = GRIB_TYPE_STRING; + if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) + type = GRIB_TYPE_LONG; + + return type; +} + +void grib_accessor_class_hash_array_t::destroy(grib_context* c, grib_accessor* a){ + grib_accessor_hash_array_t* self = (grib_accessor_hash_array_t*)a; + if (self->key) + grib_context_free(c, self->key); +} + +int grib_accessor_class_hash_array_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +} + +size_t grib_accessor_class_hash_array_t::string_length(grib_accessor* a){ + return MAX_HASH_ARRAY_STRING_LENGTH; +} + +int grib_accessor_class_hash_array_t::value_count(grib_accessor* a, long* count){ + int err = 0; + grib_accessor_hash_array_t* self = (grib_accessor_hash_array_t*)a; + grib_hash_array_value* ha = 0; + + if (!self->ha) { + ha = find_hash_value(a, &err); + if (err) + return err; + self->ha = ha; + } + + *count = self->ha->iarray->n; + return err; +} + +int grib_accessor_class_hash_array_t::compare(grib_accessor* a, grib_accessor* b){ + return GRIB_NOT_IMPLEMENTED; +} diff --git a/src/accessor/grib_accessor_class_hash_array.h b/src/accessor/grib_accessor_class_hash_array.h new file mode 100644 index 000000000..78856c7e7 --- /dev/null +++ b/src/accessor/grib_accessor_class_hash_array.h @@ -0,0 +1,45 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_hash_array_h +#define eccodes_accessor_hash_array_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_hash_array_t : public grib_accessor_gen_t +{ +public: + /* Members defined in hash_array */ + char* key; + grib_hash_array_value* ha; +}; + +class grib_accessor_class_hash_array_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_hash_array_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_hash_array_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_hash_array_h */ diff --git a/src/accessor/grib_accessor_class_headers_only.cc b/src/accessor/grib_accessor_class_headers_only.cc new file mode 100644 index 000000000..b1c00a529 --- /dev/null +++ b/src/accessor/grib_accessor_class_headers_only.cc @@ -0,0 +1,33 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_headers_only.h" + +grib_accessor_class_headers_only_t _grib_accessor_class_headers_only{"headers_only"}; +grib_accessor_class* grib_accessor_class_headers_only = &_grib_accessor_class_headers_only; + + +void grib_accessor_class_headers_only_t::init(grib_accessor* a, const long l, grib_arguments* c){ + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; + a->length = 0; +} + +int grib_accessor_class_headers_only_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + *val = grib_handle_of_accessor(a)->partial; + *len = 1; + return 0; +} + +int grib_accessor_class_headers_only_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_headers_only.h b/src/accessor/grib_accessor_class_headers_only.h new file mode 100644 index 000000000..29d7e8bf5 --- /dev/null +++ b/src/accessor/grib_accessor_class_headers_only.h @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_headers_only_h +#define eccodes_accessor_headers_only_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_headers_only_t : public grib_accessor_gen_t +{ +public: + /* Members defined in headers_only */ +}; + +class grib_accessor_class_headers_only_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_headers_only_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_headers_only_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_headers_only_h */ diff --git a/src/accessor/grib_accessor_class_ibmfloat.cc b/src/accessor/grib_accessor_class_ibmfloat.cc new file mode 100644 index 000000000..4528c0807 --- /dev/null +++ b/src/accessor/grib_accessor_class_ibmfloat.cc @@ -0,0 +1,150 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_ibmfloat.h" + +grib_accessor_class_ibmfloat_t _grib_accessor_class_ibmfloat{"ibmfloat"}; +grib_accessor_class* grib_accessor_class_ibmfloat = &_grib_accessor_class_ibmfloat; + + +void grib_accessor_class_ibmfloat_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_ibmfloat_t* self = (grib_accessor_ibmfloat_t*)a; + long count = 0; + + self->arg = arg; + a->value_count(&count); a->length = 4 * count; + Assert(a->length >= 0); +} + +template +int unpack(grib_accessor* a, T* val, size_t* len){ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + unsigned long rlen = 0; + long count = 0; + int err = 0; + unsigned long i = 0; + long bitp = a->offset * 8; + grib_handle* hand = grib_handle_of_accessor(a); + + err = a->value_count(&count); if (err) + return err; + rlen = count; + + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %lu values", *len, a->name, rlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < rlen; i++) + val[i] = (T)grib_long_to_ibm(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); + + *len = rlen; + return GRIB_SUCCESS; +} + +int grib_accessor_class_ibmfloat_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + return unpack(a, val, len); +} + +int grib_accessor_class_ibmfloat_t::unpack_float(grib_accessor* a, float* val, size_t* len){ + return unpack(a, val, len); +} + +int grib_accessor_class_ibmfloat_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_ibmfloat_t* self = (grib_accessor_ibmfloat_t*)a; + int ret = 0; + unsigned long i = 0; + unsigned long rlen = *len; + size_t buflen = 0; + unsigned char* buf = NULL; + long off = 0; + + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it packs at least 1 value", a->name); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + if (rlen == 1) { + + //double x = 0; + //grib_nearest_smaller_ibm_float(val[0],&x); + //double y = grib_long_to_ibm(grib_ibm_to_long(val[0])); + //printf("IBMFLOAT val=%.20f nearest_smaller_ibm_float=%.20f long_to_ibm=%.20f\n",val[0],x ,y); + + off = byte_offset(a) * 8; + ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, grib_ibm_to_long(val[0]), &off, 32); + if (*len > 1) + grib_context_log(a->context, GRIB_LOG_WARNING, "ibmfloat: Trying to pack %zu values in a scalar %s, packing first value", + *len, a->name); + if (ret == GRIB_SUCCESS) + len[0] = 1; + return ret; + } + + buflen = rlen * 4; + + buf = (unsigned char*)grib_context_malloc(a->context, buflen); + + for (i = 0; i < rlen; i++) { + grib_encode_unsigned_longb(buf, grib_ibm_to_long(val[i]), &off, 32); + } + ret = grib_set_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), rlen); + + if (ret == GRIB_SUCCESS) + grib_buffer_replace(a, buf, buflen, 1, 1); + else + *len = 0; + + grib_context_free(a->context, buf); + + a->length = byte_count(a); + + return ret; +} + +long grib_accessor_class_ibmfloat_t::byte_count(grib_accessor* a){ + return a->length; +} + +int grib_accessor_class_ibmfloat_t::value_count(grib_accessor* a, long* len){ + grib_accessor_ibmfloat_t* self = (grib_accessor_ibmfloat_t*)a; + *len = 0; + if (!self->arg) { + *len = 1; + return 0; + } + return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); +} + +long grib_accessor_class_ibmfloat_t::byte_offset(grib_accessor* a){ + return a->offset; +} + +void grib_accessor_class_ibmfloat_t::update_size(grib_accessor* a, size_t s){ + a->length = (long)s; + Assert(a->length >= 0); +} + +long grib_accessor_class_ibmfloat_t::next_offset(grib_accessor* a){ + return a->byte_offset() + a->byte_count();} + +int grib_accessor_class_ibmfloat_t::nearest_smaller_value(grib_accessor* a, double val, double* nearest){ + int ret = 0; + if (grib_nearest_smaller_ibm_float(val, nearest) == GRIB_INTERNAL_ERROR) { + grib_context_log(a->context, GRIB_LOG_ERROR, "ibm_float:nearest_smaller_value overflow value=%g", val); + grib_dump_content(grib_handle_of_accessor(a), stderr, "wmo", GRIB_DUMP_FLAG_HEXADECIMAL, 0); + ret = GRIB_INTERNAL_ERROR; + } + return ret; +} diff --git a/src/accessor/grib_accessor_class_ibmfloat.h b/src/accessor/grib_accessor_class_ibmfloat.h new file mode 100644 index 000000000..4a82dda63 --- /dev/null +++ b/src/accessor/grib_accessor_class_ibmfloat.h @@ -0,0 +1,40 @@ +/* + * (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. + */ + +#ifndef eccodes_accessor_ibmfloat_h +#define eccodes_accessor_ibmfloat_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_ibmfloat_t : public grib_accessor_double_t +{ +public: + /* Members defined in ibmfloat */ + grib_arguments* arg; +}; + +class grib_accessor_class_ibmfloat_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_ibmfloat_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_ibmfloat_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + int nearest_smaller_value(grib_accessor*, double, double*) override; +}; +#endif /* eccodes_accessor_ibmfloat_h */ diff --git a/src/accessor/grib_accessor_class_ieeefloat.cc b/src/accessor/grib_accessor_class_ieeefloat.cc new file mode 100644 index 000000000..1433bd8d5 --- /dev/null +++ b/src/accessor/grib_accessor_class_ieeefloat.cc @@ -0,0 +1,123 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_ieeefloat.h" + +grib_accessor_class_ieeefloat_t _grib_accessor_class_ieeefloat{"ieeefloat"}; +grib_accessor_class* grib_accessor_class_ieeefloat = &_grib_accessor_class_ieeefloat; + + +void grib_accessor_class_ieeefloat_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_ieeefloat_t* self = (grib_accessor_ieeefloat_t*)a; + long count = 0; + self->arg = arg; + a->value_count(&count); a->length = 4 * count; + Assert(a->length >= 0); +} + +int grib_accessor_class_ieeefloat_t::value_count(grib_accessor* a, long* len){ + grib_accessor_ieeefloat_t* self = (grib_accessor_ieeefloat_t*)a; + *len = 0; + + if (!self->arg) { + *len = 1; + return 0; + } + return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); +} + +int grib_accessor_class_ieeefloat_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_ieeefloat_t* self = (grib_accessor_ieeefloat_t*)a; + int ret = 0; + unsigned long i = 0; + unsigned long rlen = (unsigned long)*len; + size_t buflen = 0; + unsigned char* buf = NULL; + long off = 0; + + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it packs at least 1 value", a->name); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + if (rlen == 1) { + off = a->offset * 8; + ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, grib_ieee_to_long(val[0]), &off, 32); + if (*len > 1) + grib_context_log(a->context, GRIB_LOG_WARNING, "ieeefloat: Trying to pack %zu values in a scalar %s, packing first value", + *len, a->name); + if (ret == GRIB_SUCCESS) + len[0] = 1; + return ret; + } + + buflen = rlen * 4; + + buf = (unsigned char*)grib_context_malloc(a->context, buflen); + + for (i = 0; i < rlen; i++) { + grib_encode_unsigned_longb(buf, grib_ieee_to_long(val[i]), &off, 32); + } + ret = grib_set_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), rlen); + + if (ret == GRIB_SUCCESS) + grib_buffer_replace(a, buf, buflen, 1, 1); + else + *len = 0; + + grib_context_free(a->context, buf); + + return ret; +} + +template +int unpack(grib_accessor* a, T* val, size_t* len){ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + long rlen = 0; + int err = 0; + long i = 0; + long bitp = a->offset * 8; + grib_handle* hand = grib_handle_of_accessor(a); + + err = a->value_count(&rlen); if (err) + return err; + + if (*len < (size_t)rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %ld values", *len, a->name, rlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < rlen; i++) + val[i] = (T)grib_long_to_ieee(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); + + *len = rlen; + return GRIB_SUCCESS; +} + +int grib_accessor_class_ieeefloat_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + return unpack(a, val, len); +} + +int grib_accessor_class_ieeefloat_t::unpack_float(grib_accessor* a, float* val, size_t* len){ + return unpack(a, val, len); +} + +void grib_accessor_class_ieeefloat_t::update_size(grib_accessor* a, size_t s){ + a->length = (long)s; + Assert(a->length >= 0); +} + +int grib_accessor_class_ieeefloat_t::nearest_smaller_value(grib_accessor* a, double val, double* nearest){ + return grib_nearest_smaller_ieee_float(val, nearest); +} diff --git a/src/accessor/grib_accessor_class_ieeefloat.h b/src/accessor/grib_accessor_class_ieeefloat.h new file mode 100644 index 000000000..b59357d72 --- /dev/null +++ b/src/accessor/grib_accessor_class_ieeefloat.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_ieeefloat_h +#define eccodes_accessor_ieeefloat_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_ieeefloat_t : public grib_accessor_double_t +{ +public: + grib_arguments* arg; +}; + +class grib_accessor_class_ieeefloat_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_ieeefloat_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_ieeefloat_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + int nearest_smaller_value(grib_accessor* a, double val, double* nearest) override; +}; +#endif /* eccodes_accessor_ieeefloat_h */ diff --git a/src/accessor/grib_accessor_class_ifs_param.cc b/src/accessor/grib_accessor_class_ifs_param.cc new file mode 100644 index 000000000..291849046 --- /dev/null +++ b/src/accessor/grib_accessor_class_ifs_param.cc @@ -0,0 +1,93 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_ifs_param.h" + +grib_accessor_class_ifs_param_t _grib_accessor_class_ifs_param{"ifs_param"}; +grib_accessor_class* grib_accessor_class_ifs_param = &_grib_accessor_class_ifs_param; + + +void grib_accessor_class_ifs_param_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_ifs_param_t* self = (grib_accessor_ifs_param_t*)a; + int n = 0; + + self->paramId = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->type = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); +} + +int grib_accessor_class_ifs_param_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_ifs_param_t* self = (grib_accessor_ifs_param_t*)a; + int ret = 0; + long paramId = 0; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->paramId, ¶mId)) != GRIB_SUCCESS) + return ret; + + if (paramId > 129000 && paramId < 129999) + *val = paramId - 129000; + else if (paramId > 200000 && paramId < 200999) + *val = paramId - 200000; + else if (paramId > 211000 && paramId < 211999) + *val = paramId - 1000; + else + *val = paramId; + + return ret; +} + +int grib_accessor_class_ifs_param_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_ifs_param_t* self = (grib_accessor_ifs_param_t*)a; + long type = 0; + long table = 128; + long paramId = *val; + long param; + + grib_get_long(grib_handle_of_accessor(a), self->type, &type); + + if (type == 33 || type == 35) { + if (paramId > 1000) { + table = paramId / 1000; + param = paramId - table * 1000; + paramId = param; + } + switch (table) { + case 210: + paramId += 211000; + break; + case 128: + paramId += 200000; + break; + default: + break; + } + } + if (type == 50 || type == 52) { + if (paramId > 1000) { + table = paramId / 1000; + param = paramId - table * 1000; + paramId = param; + } + switch (table) { + case 128: + paramId += 129000; + break; + default: + break; + } + } + + return grib_set_long_internal(grib_handle_of_accessor(a), self->paramId, paramId); +} + +int grib_accessor_class_ifs_param_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_ifs_param.h b/src/accessor/grib_accessor_class_ifs_param.h new file mode 100644 index 000000000..d41da1723 --- /dev/null +++ b/src/accessor/grib_accessor_class_ifs_param.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_ifs_param_h +#define eccodes_accessor_ifs_param_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_ifs_param_t : public grib_accessor_gen_t +{ +public: + /* Members defined in ifs_param */ + const char* paramId; + const char* type; +}; + +class grib_accessor_class_ifs_param_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_ifs_param_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_ifs_param_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_ifs_param_h */ diff --git a/src/accessor/todo/grib_accessor_class_julian_date.cc b/src/accessor/grib_accessor_class_julian_date.cc similarity index 66% rename from src/accessor/todo/grib_accessor_class_julian_date.cc rename to src/accessor/grib_accessor_class_julian_date.cc index 61fd6959c..966dc2d66 100644 --- a/src/accessor/todo/grib_accessor_class_julian_date.cc +++ b/src/accessor/grib_accessor_class_julian_date.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,128 +10,15 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_julian_date.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double; pack_double - IMPLEMENTS = unpack_long; pack_long - IMPLEMENTS = unpack_string; pack_string - IMPLEMENTS = dump - IMPLEMENTS = init - IMPLEMENTS = pack_expression - MEMBERS = const char *year - MEMBERS = const char *month - MEMBERS = const char *day - MEMBERS = const char *hour - MEMBERS = const char *minute - MEMBERS = const char *second - MEMBERS = const char *ymd - MEMBERS = const char *hms - MEMBERS = char sep[5] - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_double(grib_accessor*, const double* 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_expression(grib_accessor*, grib_expression*); -static int unpack_double(grib_accessor*, double* 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 void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_julian_date -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in julian_date */ - const char *year; - const char *month; - const char *day; - const char *hour; - const char *minute; - const char *second; - const char *ymd; - const char *hms; - char sep[5]; -} grib_accessor_julian_date; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_julian_date = { - &grib_accessor_class_double, /* super */ - "julian_date", /* name */ - sizeof(grib_accessor_julian_date), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - &pack_expression, /* 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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_julian_date_t _grib_accessor_class_julian_date{"julian_date"}; grib_accessor_class* grib_accessor_class_julian_date = &_grib_accessor_class_julian_date; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_julian_date* self = (grib_accessor_julian_date*)a; +void grib_accessor_class_julian_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_julian_date_t* self = (grib_accessor_julian_date_t*)a; int n = 0; grib_handle* h = grib_handle_of_accessor(a); @@ -163,18 +51,16 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->length = 0; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_julian_date_t::dump(grib_accessor* a, grib_dumper* dumper){ grib_dump_string(dumper, a, NULL); } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_julian_date_t::unpack_double(grib_accessor* a, double* val, size_t* len){ int ret = 0; long hour, minute, second; long year, month, day, ymd, hms; grib_handle* h = grib_handle_of_accessor(a); - grib_accessor_julian_date* self = (grib_accessor_julian_date*)a; + grib_accessor_julian_date_t* self = (grib_accessor_julian_date_t*)a; if (self->ymd == NULL) { ret = grib_get_long(h, self->year, &year); @@ -222,9 +108,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_julian_date* self = (grib_accessor_julian_date*)a; +int grib_accessor_class_julian_date_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_julian_date_t* self = (grib_accessor_julian_date_t*)a; int ret = 0; long hour = 0; long minute = 0; @@ -272,12 +157,11 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return ret; } -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ +int grib_accessor_class_julian_date_t::unpack_string(grib_accessor* a, char* val, size_t* len){ int ret = 0; long hour, minute, second; long year, month, day, ymd, hms; - grib_accessor_julian_date* self = (grib_accessor_julian_date*)a; + grib_accessor_julian_date_t* self = (grib_accessor_julian_date_t*)a; char* sep = self->sep; grib_handle* h = grib_handle_of_accessor(a); @@ -338,12 +222,11 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) return ret; } -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ +int grib_accessor_class_julian_date_t::pack_string(grib_accessor* a, const char* val, size_t* len){ int ret = 0; long hour, minute, second; long year, month, day, ymd, hms; - grib_accessor_julian_date* self = (grib_accessor_julian_date*)a; + grib_accessor_julian_date_t* self = (grib_accessor_julian_date_t*)a; char* sep = self->sep; grib_handle* h = grib_handle_of_accessor(a); @@ -409,19 +292,16 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return ret; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ +int grib_accessor_class_julian_date_t::unpack_long(grib_accessor* a, long* val, size_t* len){ grib_context_log(a->context, GRIB_LOG_ERROR, " Cannot unpack %s as long", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* v, size_t* len) -{ +int grib_accessor_class_julian_date_t::pack_long(grib_accessor* a, const long* v, size_t* len){ grib_context_log(a->context, GRIB_LOG_ERROR, " Cannot pack %s as long", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_expression(grib_accessor* a, grib_expression* e) -{ +int grib_accessor_class_julian_date_t::pack_expression(grib_accessor* a, grib_expression* e){ size_t len = 1; long lval = 0; double dval = 0; @@ -439,16 +319,14 @@ static int pack_expression(grib_accessor* a, grib_expression* e) } /*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %ld\n", a->name,lval);*/ - return grib_pack_long(a, &lval, &len); - } + return a->pack_long(&lval, &len); } case GRIB_TYPE_DOUBLE: { len = 1; ret = grib_expression_evaluate_double(hand, e, &dval); /*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %g\n", a->name, dval);*/ - return grib_pack_double(a, &dval, &len); - } + return a->pack_double(&dval, &len); } case GRIB_TYPE_STRING: { char tmp[1024]; @@ -461,8 +339,7 @@ static int pack_expression(grib_accessor* a, grib_expression* e) len = strlen(cval); /*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %s\n", a->name, cval);*/ - return grib_pack_string(a, cval, &len); - } + return a->pack_string(cval, &len); } } return GRIB_NOT_IMPLEMENTED; diff --git a/src/accessor/grib_accessor_class_julian_date.h b/src/accessor/grib_accessor_class_julian_date.h new file mode 100644 index 000000000..68008fec6 --- /dev/null +++ b/src/accessor/grib_accessor_class_julian_date.h @@ -0,0 +1,48 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_julian_date_h +#define eccodes_accessor_julian_date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_julian_date_t : public grib_accessor_double_t +{ +public: + /* Members defined in julian_date */ + const char *year; + const char *month; + const char *day; + const char *hour; + const char *minute; + const char *second; + const char *ymd; + const char *hms; + char sep[5]; +}; + +class grib_accessor_class_julian_date_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_julian_date_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_julian_date_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int pack_expression(grib_accessor*, grib_expression*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_julian_date_h */ diff --git a/src/accessor/grib_accessor_class_julian_day.cc b/src/accessor/grib_accessor_class_julian_day.cc new file mode 100644 index 000000000..4e978c20e --- /dev/null +++ b/src/accessor/grib_accessor_class_julian_day.cc @@ -0,0 +1,107 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_julian_day.h" + +grib_accessor_class_julian_day_t _grib_accessor_class_julian_day{"julian_day"}; +grib_accessor_class* grib_accessor_class_julian_day = &_grib_accessor_class_julian_day; + + +void grib_accessor_class_julian_day_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_julian_day_t* self = (grib_accessor_julian_day_t*)a; + int n = 0; + + self->date = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->hour = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->minute = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->second = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + + a->length = 0; +} + +void grib_accessor_class_julian_day_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_string(dumper, a, NULL); +} + +int grib_accessor_class_julian_day_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + const double v = *val; + return pack_double(a, &v, len); +} + +int grib_accessor_class_julian_day_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_julian_day_t* self = (grib_accessor_julian_day_t*)a; + int ret = 0; + long hour = 0; + long minute = 0; + long second = 0; + long date = 0; + long year, month, day; + + ret = grib_julian_to_datetime(*val, &year, &month, &day, &hour, &minute, &second); + if (ret != 0) + return ret; + + date = year * 10000 + month * 100 + day; + + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->date, date); + if (ret != 0) + return ret; + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->hour, hour); + if (ret != 0) + return ret; + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->minute, minute); + if (ret != 0) + return ret; + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->second, second); + + return ret; +} + +int grib_accessor_class_julian_day_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + int ret = 0; + double v = 0; + + ret = unpack_double(a, &v, len); + *val = (long)v; + + return ret; +} + +int grib_accessor_class_julian_day_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + int ret = 0; + long date, hour, minute, second; + long year, month, day; + grib_accessor_julian_day_t* self = (grib_accessor_julian_day_t*)a; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->date, &date); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->hour, &hour); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->minute, &minute); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->second, &second); + if (ret != GRIB_SUCCESS) + return ret; + + year = date / 10000; + date %= 10000; + month = date / 100; + date %= 100; + day = date; + + ret = grib_datetime_to_julian(year, month, day, hour, minute, second, val); + + return ret; +} diff --git a/src/accessor/grib_accessor_class_julian_day.h b/src/accessor/grib_accessor_class_julian_day.h new file mode 100644 index 000000000..1d21fb920 --- /dev/null +++ b/src/accessor/grib_accessor_class_julian_day.h @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_julian_day_h +#define eccodes_accessor_julian_day_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_julian_day_t : public grib_accessor_double_t +{ +public: + /* Members defined in julian_day */ + const char *date; + const char *hour; + const char *minute; + const char *second; +}; + +class grib_accessor_class_julian_day_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_julian_day_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_julian_day_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_julian_day_h */ diff --git a/src/accessor/grib_accessor_class_ksec1expver.cc b/src/accessor/grib_accessor_class_ksec1expver.cc new file mode 100644 index 000000000..dcd3c336e --- /dev/null +++ b/src/accessor/grib_accessor_class_ksec1expver.cc @@ -0,0 +1,95 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_ksec1expver.h" + +grib_accessor_class_ksec1expver_t _grib_accessor_class_ksec1expver{"ksec1expver"}; +grib_accessor_class* grib_accessor_class_ksec1expver = &_grib_accessor_class_ksec1expver; + + +void grib_accessor_class_ksec1expver_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + a->length = len; + Assert(a->length >= 0); +} + +int grib_accessor_class_ksec1expver_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + long value = 0; + long pos = a->offset * 8; + char* intc = NULL; + char* pTemp = NULL; + char expver[5]; + char refexpver[5]; + size_t llen = a->length + 1; + Assert(a->length == 4); + + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + value = grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, a->length * 8); + + a->unpack_string(refexpver, &llen); + /* test for endian */ + intc = (char*)&value; + pTemp = intc; + + expver[0] = *pTemp++; + expver[1] = *pTemp++; + expver[2] = *pTemp++; + expver[3] = *pTemp++; + expver[4] = 0; + +// expver[0] = intc[0]; +// expver[1] = intc[1]; +// expver[2] = intc[2]; +// expver[3] = intc[3]; +// expver[4] = 0; + + /* if there is a difference, have to reverse*/ + if (strcmp(refexpver, expver)) { + intc[0] = expver[3]; + intc[1] = expver[2]; + intc[2] = expver[1]; + intc[3] = expver[0]; + } + + *val = value; + *len = 1; + return GRIB_SUCCESS; +} + +int grib_accessor_class_ksec1expver_t::pack_string(grib_accessor* a, const char* val, size_t* len){ + int i = 0; + if (len[0] != 4) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong length for %s. It has to be 4", a->name); + return GRIB_INVALID_KEY_VALUE; + } + if (len[0] > (a->length) + 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); + len[0] = 0; + return GRIB_BUFFER_TOO_SMALL; + } + + for (i = 0; i < a->length; i++) + grib_handle_of_accessor(a)->buffer->data[a->offset + i] = val[i]; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_ksec1expver_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + char sval[5] = {0,}; + size_t slen = 4; + snprintf(sval, sizeof(sval), "%04d", (int)(*val)); + return pack_string(a, sval, &slen); +} diff --git a/src/accessor/grib_accessor_class_ksec1expver.h b/src/accessor/grib_accessor_class_ksec1expver.h new file mode 100644 index 000000000..3884a7709 --- /dev/null +++ b/src/accessor/grib_accessor_class_ksec1expver.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_ksec1expver_h +#define eccodes_accessor_ksec1expver_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_ksec1expver_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in ksec1expver */ +}; + +class grib_accessor_class_ksec1expver_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_ksec1expver_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_ksec1expver_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_ksec1expver_h */ diff --git a/src/accessor/grib_accessor_class_label.cc b/src/accessor/grib_accessor_class_label.cc new file mode 100644 index 000000000..547bdb11a --- /dev/null +++ b/src/accessor/grib_accessor_class_label.cc @@ -0,0 +1,40 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_label.h" + +grib_accessor_class_label_t _grib_accessor_class_label{"label"}; +grib_accessor_class* grib_accessor_class_label = &_grib_accessor_class_label; + + +void grib_accessor_class_label_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + a->length = 0; +} + +void grib_accessor_class_label_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_label(dumper, a, NULL); +} + +int grib_accessor_class_label_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LABEL; +} + +int grib_accessor_class_label_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + size_t vlen = strlen(a->name); + if (vlen > *len) + return GRIB_BUFFER_TOO_SMALL; + *len = vlen; + strcpy(val, a->name); + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_label.h b/src/accessor/grib_accessor_class_label.h new file mode 100644 index 000000000..c4e64b322 --- /dev/null +++ b/src/accessor/grib_accessor_class_label.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_label_h +#define eccodes_accessor_label_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_label_t : public grib_accessor_gen_t +{ +public: + /* Members defined in label */ +}; + +class grib_accessor_class_label_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_label_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_label_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_label_h */ diff --git a/src/accessor/todo/grib_accessor_class_latitudes.cc b/src/accessor/grib_accessor_class_latitudes.cc similarity index 59% rename from src/accessor/todo/grib_accessor_class_latitudes.cc rename to src/accessor/grib_accessor_class_latitudes.cc index 4131ff066..65fcf65a8 100644 --- a/src/accessor/todo/grib_accessor_class_latitudes.cc +++ b/src/accessor/grib_accessor_class_latitudes.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,111 +10,15 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double; - IMPLEMENTS = value_count - IMPLEMENTS = init - MEMBERS =const char* values - MEMBERS =long distinct - MEMBERS =double* lats - MEMBERS =long size - MEMBERS =int save - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -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*); - -typedef struct grib_accessor_latitudes -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in latitudes */ - const char* values; - long distinct; - double* lats; - long size; - int save; -} grib_accessor_latitudes; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_latitudes = { - &grib_accessor_class_double, /* super */ - "latitudes", /* name */ - sizeof(grib_accessor_latitudes), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_latitudes.h" +grib_accessor_class_latitudes_t _grib_accessor_class_latitudes{"latitudes"}; grib_accessor_class* grib_accessor_class_latitudes = &_grib_accessor_class_latitudes; -/* END_CLASS_IMP */ static int get_distinct(grib_accessor* a, double** val, long* len); - -static int compare_doubles(const void* a, const void* b, int ascending) -{ +int compare_doubles(const void* a, const void* b, int ascending){ /* ascending is a boolean: 0 or 1 */ double* arg1 = (double*)a; double* arg2 = (double*)b; @@ -130,18 +35,15 @@ static int compare_doubles(const void* a, const void* b, int ascending) else return 1; } -static int compare_doubles_ascending(const void* a, const void* b) -{ +int compare_doubles_ascending(const void* a, const void* b){ return compare_doubles(a, b, 1); } -static int compare_doubles_descending(const void* a, const void* b) -{ +int compare_doubles_descending(const void* a, const void* b){ return compare_doubles(a, b, 0); } -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_latitudes* self = (grib_accessor_latitudes*)a; +void grib_accessor_class_latitudes_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_latitudes_t* self = (grib_accessor_latitudes_t*)a; int n = 0; self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); @@ -151,10 +53,9 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_latitudes_t::unpack_double(grib_accessor* a, double* val, size_t* len){ grib_context* c = a->context; - grib_accessor_latitudes* self = (grib_accessor_latitudes*)a; + grib_accessor_latitudes_t* self = (grib_accessor_latitudes_t*)a; int ret = 0; double* v = val; double dummyLon = 0; @@ -205,9 +106,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } -static int value_count(grib_accessor* a, long* len) -{ - grib_accessor_latitudes* self = (grib_accessor_latitudes*)a; +int grib_accessor_class_latitudes_t::value_count(grib_accessor* a, long* len){ + grib_accessor_latitudes_t* self = (grib_accessor_latitudes_t*)a; grib_handle* h = grib_handle_of_accessor(a); grib_context* c = a->context; double* val = NULL; @@ -237,8 +137,7 @@ static int value_count(grib_accessor* a, long* len) return ret; } -static int get_distinct(grib_accessor* a, double** val, long* len) -{ +static int get_distinct(grib_accessor* a, double** val, long* len){ long count = 0; double prev; double* v = NULL; diff --git a/src/accessor/grib_accessor_class_latitudes.h b/src/accessor/grib_accessor_class_latitudes.h new file mode 100644 index 000000000..10344c7cb --- /dev/null +++ b/src/accessor/grib_accessor_class_latitudes.h @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_latitudes_h +#define eccodes_accessor_latitudes_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_latitudes_t : public grib_accessor_double_t +{ +public: + /* Members defined in latitudes */ + const char* values; + long distinct; + double* lats; + long size; + int save; +}; + +class grib_accessor_class_latitudes_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_latitudes_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_latitudes_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_latitudes_h */ diff --git a/src/accessor/todo/grib_accessor_class_latlon_increment.cc b/src/accessor/grib_accessor_class_latlon_increment.cc similarity index 61% rename from src/accessor/todo/grib_accessor_class_latlon_increment.cc rename to src/accessor/grib_accessor_class_latlon_increment.cc index de43e60c9..3ecff170a 100644 --- a/src/accessor/todo/grib_accessor_class_latlon_increment.cc +++ b/src/accessor/grib_accessor_class_latlon_increment.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,117 +10,14 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double;pack_double;is_missing - IMPLEMENTS = init - MEMBERS=const char* directionIncrementGiven - MEMBERS=const char* directionIncrement - MEMBERS=const char* scansPositively - MEMBERS=const char* first - MEMBERS=const char* last - MEMBERS=const char* numberOfPoints - MEMBERS=const char* angleMultiplier - MEMBERS=const char* angleDivisor - MEMBERS=long isLongitude - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int is_missing(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 void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_latlon_increment -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in latlon_increment */ - const char* directionIncrementGiven; - const char* directionIncrement; - const char* scansPositively; - const char* first; - const char* last; - const char* numberOfPoints; - const char* angleMultiplier; - const char* angleDivisor; - long isLongitude; -} grib_accessor_latlon_increment; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_latlon_increment = { - &grib_accessor_class_double, /* super */ - "latlon_increment", /* name */ - sizeof(grib_accessor_latlon_increment), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - &is_missing, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_latlon_increment.h" +grib_accessor_class_latlon_increment_t _grib_accessor_class_latlon_increment{"latlon_increment"}; grib_accessor_class* grib_accessor_class_latlon_increment = &_grib_accessor_class_latlon_increment; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_latlon_increment* self = (grib_accessor_latlon_increment*)a; +void grib_accessor_class_latlon_increment_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_latlon_increment_t* self = (grib_accessor_latlon_increment_t*)a; int n = 0; grib_handle* hand = grib_handle_of_accessor(a); @@ -134,9 +32,8 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->isLongitude = grib_arguments_get_long(hand, c, n++); } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_latlon_increment* self = (grib_accessor_latlon_increment*)a; +int grib_accessor_class_latlon_increment_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_latlon_increment_t* self = (grib_accessor_latlon_increment_t*)a; int ret = 0; grib_handle* hand = grib_handle_of_accessor(a); @@ -221,9 +118,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_latlon_increment* self = (grib_accessor_latlon_increment*)a; +int grib_accessor_class_latlon_increment_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_latlon_increment_t* self = (grib_accessor_latlon_increment_t*)a; int ret = 0; long codedNumberOfPoints = 0; grib_handle* hand = grib_handle_of_accessor(a); @@ -305,8 +201,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return GRIB_SUCCESS; } -static int is_missing(grib_accessor* a) -{ +int grib_accessor_class_latlon_increment_t::is_missing(grib_accessor* a){ size_t len = 1; double val = 0; diff --git a/src/accessor/grib_accessor_class_latlon_increment.h b/src/accessor/grib_accessor_class_latlon_increment.h new file mode 100644 index 000000000..4f5402e6a --- /dev/null +++ b/src/accessor/grib_accessor_class_latlon_increment.h @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_latlon_increment_h +#define eccodes_accessor_latlon_increment_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_latlon_increment_t : public grib_accessor_double_t +{ +public: + /* Members defined in latlon_increment */ + const char* directionIncrementGiven; + const char* directionIncrement; + const char* scansPositively; + const char* first; + const char* last; + const char* numberOfPoints; + const char* angleMultiplier; + const char* angleDivisor; + long isLongitude; +}; + +class grib_accessor_class_latlon_increment_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_latlon_increment_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_latlon_increment_t{}; } + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_latlon_increment_h */ diff --git a/src/accessor/grib_accessor_class_latlonvalues.cc b/src/accessor/grib_accessor_class_latlonvalues.cc new file mode 100644 index 000000000..ca52ffb6d --- /dev/null +++ b/src/accessor/grib_accessor_class_latlonvalues.cc @@ -0,0 +1,76 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_latlonvalues.h" + +grib_accessor_class_latlonvalues_t _grib_accessor_class_latlonvalues{"latlonvalues"}; +grib_accessor_class* grib_accessor_class_latlonvalues = &_grib_accessor_class_latlonvalues; + + +void grib_accessor_class_latlonvalues_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_latlonvalues_t* self = (grib_accessor_latlonvalues_t*)a; + int n = 0; + + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_latlonvalues_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_context* c = a->context; + int err = 0; + double* v = val; + double lat, lon, value; + size_t size = 0; + long count = 0; + grib_iterator* iter = grib_iterator_new(grib_handle_of_accessor(a), 0, &err); + if (err) { + if (iter) grib_iterator_delete(iter); + grib_context_log(c, GRIB_LOG_ERROR, "latlonvalues: Unable to create iterator"); + return err; + } + + err = value_count(a, &count); + if (err) return err; + size = count; + + if (*len < size) { + if (iter) grib_iterator_delete(iter); + return GRIB_ARRAY_TOO_SMALL; + } + + while (grib_iterator_next(iter, &lat, &lon, &value)) { + *(v++) = lat; + *(v++) = lon; + *(v++) = value; + } + + grib_iterator_delete(iter); + + *len = size; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_latlonvalues_t::value_count(grib_accessor* a, long* count){ + grib_accessor_latlonvalues_t* self = (grib_accessor_latlonvalues_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + int ret = GRIB_SUCCESS; + size_t size; + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, "latlonvalues: Unable to get size of %s", self->values); + return ret; + } + + *count = 3 * size; + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_latlonvalues.h b/src/accessor/grib_accessor_class_latlonvalues.h new file mode 100644 index 000000000..ed040f543 --- /dev/null +++ b/src/accessor/grib_accessor_class_latlonvalues.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_latlonvalues_h +#define eccodes_accessor_latlonvalues_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_latlonvalues_t : public grib_accessor_double_t +{ +public: + /* Members defined in latlonvalues */ + const char* values; +}; + +class grib_accessor_class_latlonvalues_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_latlonvalues_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_latlonvalues_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_latlonvalues_h */ diff --git a/src/accessor/grib_accessor_class_library_version.cc b/src/accessor/grib_accessor_class_library_version.cc new file mode 100644 index 000000000..61fafe279 --- /dev/null +++ b/src/accessor/grib_accessor_class_library_version.cc @@ -0,0 +1,46 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_library_version.h" + +grib_accessor_class_library_version_t _grib_accessor_class_library_version{"library_version"}; +grib_accessor_class* grib_accessor_class_library_version = &_grib_accessor_class_library_version; + + +int grib_accessor_class_library_version_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + char result[30] = {0,}; + size_t size; + + int major = ECCODES_MAJOR_VERSION; + int minor = ECCODES_MINOR_VERSION; + int revision = ECCODES_REVISION_VERSION; + + snprintf(result, sizeof(result), "%d.%d.%d", major, minor, revision); + size = sizeof(result); + + if (*len < size) + return GRIB_ARRAY_TOO_SMALL; + strcpy(val, result); + + *len = size; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_library_version_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +size_t grib_accessor_class_library_version_t::string_length(grib_accessor* a){ + return 255; +} diff --git a/src/accessor/grib_accessor_class_library_version.h b/src/accessor/grib_accessor_class_library_version.h new file mode 100644 index 000000000..28de10364 --- /dev/null +++ b/src/accessor/grib_accessor_class_library_version.h @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_library_version_h +#define eccodes_accessor_library_version_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_library_version_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in library_version */ +}; + +class grib_accessor_class_library_version_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_library_version_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_library_version_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; +}; +#endif /* eccodes_accessor_library_version_h */ diff --git a/src/accessor/todo/grib_accessor_class_local_definition.cc b/src/accessor/grib_accessor_class_local_definition.cc similarity index 72% rename from src/accessor/todo/grib_accessor_class_local_definition.cc rename to src/accessor/grib_accessor_class_local_definition.cc index 782ce5fde..c216ddb2a 100644 --- a/src/accessor/todo/grib_accessor_class_local_definition.cc +++ b/src/accessor/grib_accessor_class_local_definition.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,125 +9,15 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************** - * This pertains to GRIB edition 2 - **************************************/ - #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_unsigned - IMPLEMENTS = unpack_long;pack_long; value_count - IMPLEMENTS = init - MEMBERS=const char* productDefinitionTemplateNumber - MEMBERS=const char* productDefinitionTemplateNumberInternal - MEMBERS=const char* grib2LocalSectionNumber - MEMBERS=const char* type - MEMBERS=const char* stream - MEMBERS=const char* the_class - MEMBERS=const char* eps - MEMBERS=const char* stepType - MEMBERS=const char* derivedForecast - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_local_definition -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in local_definition */ - const char* productDefinitionTemplateNumber; - const char* productDefinitionTemplateNumberInternal; - const char* grib2LocalSectionNumber; - const char* type; - const char* stream; - const char* the_class; - const char* eps; - const char* stepType; - const char* derivedForecast; -} grib_accessor_local_definition; - -extern grib_accessor_class* grib_accessor_class_unsigned; - -static grib_accessor_class _grib_accessor_class_local_definition = { - &grib_accessor_class_unsigned, /* super */ - "local_definition", /* name */ - sizeof(grib_accessor_local_definition), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_local_definition.h" +grib_accessor_class_local_definition_t _grib_accessor_class_local_definition{"local_definition"}; grib_accessor_class* grib_accessor_class_local_definition = &_grib_accessor_class_local_definition; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_local_definition* self = (grib_accessor_local_definition*)a; +void grib_accessor_class_local_definition_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_local_definition_t* self = (grib_accessor_local_definition_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; @@ -141,16 +32,14 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->derivedForecast = grib_arguments_get_name(hand, c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_local_definition* self = (grib_accessor_local_definition*)a; +int grib_accessor_class_local_definition_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_local_definition_t* self = (grib_accessor_local_definition_t*)a; return grib_get_long(grib_handle_of_accessor(a), self->grib2LocalSectionNumber, val); } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_local_definition* self = (grib_accessor_local_definition*)a; +int grib_accessor_class_local_definition_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_local_definition_t* self = (grib_accessor_local_definition_t*)a; grib_handle* hand = grib_handle_of_accessor(a); long productDefinitionTemplateNumber = -1; long productDefinitionTemplateNumberInternal = -1; @@ -316,7 +205,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) #ifdef DEBUG // 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); + "grib_accessor_local_definition_t: Invalid localDefinitionNumber %d", localDefinitionNumber); return GRIB_ENCODING_ERROR; #endif // ECC-1253: Do not fail in operations. Leave PDTN as is @@ -419,7 +308,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) if (productDefinitionTemplateNumber != productDefinitionTemplateNumberNew) { if (a->context->debug) { - fprintf(stderr, "ECCODES DEBUG grib_accessor_local_definition: ldNumber=%d, newPDTN=%ld\n", + fprintf(stderr, "ECCODES DEBUG grib_accessor_local_definition_t: ldNumber=%d, newPDTN=%ld\n", localDefinitionNumber, productDefinitionTemplateNumberNew); } if (tooEarly) @@ -435,8 +324,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return 0; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_local_definition_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } diff --git a/src/accessor/grib_accessor_class_local_definition.h b/src/accessor/grib_accessor_class_local_definition.h new file mode 100644 index 000000000..296bab69d --- /dev/null +++ b/src/accessor/grib_accessor_class_local_definition.h @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_local_definition_h +#define eccodes_accessor_local_definition_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_local_definition_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in local_definition */ + const char* productDefinitionTemplateNumber; + const char* productDefinitionTemplateNumberInternal; + const char* grib2LocalSectionNumber; + const char* type; + const char* stream; + const char* the_class; + const char* eps; + const char* stepType; + const char* derivedForecast; +}; + +class grib_accessor_class_local_definition_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_local_definition_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_local_definition_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_local_definition_h */ diff --git a/src/accessor/grib_accessor_class_long_vector.cc b/src/accessor/grib_accessor_class_long_vector.cc new file mode 100644 index 000000000..d99b6e860 --- /dev/null +++ b/src/accessor/grib_accessor_class_long_vector.cc @@ -0,0 +1,95 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_long_vector.h" +#include "grib_accessor_class_abstract_long_vector.h" + +grib_accessor_class_long_vector_t _grib_accessor_class_long_vector{"long_vector"}; +grib_accessor_class* grib_accessor_class_long_vector = &_grib_accessor_class_long_vector; + + +void grib_accessor_class_long_vector_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_long_vector_t* self = (grib_accessor_long_vector_t*)a; + grib_accessor* va = NULL; + grib_accessor_abstract_long_vector_t* v = NULL; + int n = 0; + + self->vector = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); + v = (grib_accessor_abstract_long_vector_t*)va; + + self->index = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); + + /* check self->index on init and never change it */ + Assert(self->index < v->number_of_elements && self->index >= 0); + + a->length = 0; +} + +int grib_accessor_class_long_vector_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + size_t size = 0; + int err = 0; + long* vector; + grib_accessor_long_vector_t* self = (grib_accessor_long_vector_t*)a; + grib_accessor* va = NULL; + grib_accessor_abstract_long_vector_t* v = NULL; + + va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); + v = (grib_accessor_abstract_long_vector_t*)va; + + /*TODO implement the dirty mechanism to avoid to unpack every time */ + err = grib_get_size(grib_handle_of_accessor(a), self->vector, &size); + if (err) return err; + DEBUG_ASSERT(size > 0); + vector = (long*)grib_context_malloc(a->context, sizeof(long) * size); + err = va->unpack_long(vector, &size); grib_context_free(a->context, vector); + if (err) return err; + + *val = v->v[self->index]; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_long_vector_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + long lval = 0; + int err = 0; + grib_accessor_long_vector_t* self = (grib_accessor_long_vector_t*)a; + grib_accessor* va = NULL; + grib_accessor_abstract_long_vector_t* v = NULL; + va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); + v = (grib_accessor_abstract_long_vector_t*)va; + + err = unpack_long(a, &lval, len); + + *val = (double)v->v[self->index]; + + return err; +} + +int grib_accessor_class_long_vector_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + int err = 0; + grib_accessor_long_vector_t* self = (grib_accessor_long_vector_t*)a; + grib_accessor* va = NULL; + grib_accessor_abstract_long_vector_t* v = NULL; + + va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); + v = (grib_accessor_abstract_long_vector_t*)va; + + v->pack_index = self->index; + + err = va->pack_long(val, len); + return err; +} + +int grib_accessor_class_long_vector_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_long_vector.h b/src/accessor/grib_accessor_class_long_vector.h new file mode 100644 index 000000000..66fab29e6 --- /dev/null +++ b/src/accessor/grib_accessor_class_long_vector.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_long_vector_h +#define eccodes_accessor_long_vector_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_abstract_long_vector.h" + +class grib_accessor_long_vector_t : public grib_accessor_abstract_long_vector_t +{ +public: + /* Members defined in long_vector */ + const char* vector; + int index; +}; + +class grib_accessor_class_long_vector_t : public grib_accessor_class_abstract_long_vector_t +{ +public: + grib_accessor_class_long_vector_t(const char* name) : grib_accessor_class_abstract_long_vector_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_long_vector_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_long_vector_h */ diff --git a/src/accessor/todo/grib_accessor_class_longitudes.cc b/src/accessor/grib_accessor_class_longitudes.cc similarity index 56% rename from src/accessor/todo/grib_accessor_class_longitudes.cc rename to src/accessor/grib_accessor_class_longitudes.cc index 083d40138..09fd4a4e6 100644 --- a/src/accessor/todo/grib_accessor_class_longitudes.cc +++ b/src/accessor/grib_accessor_class_longitudes.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,113 +10,17 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double; - IMPLEMENTS = value_count - IMPLEMENTS = init - MEMBERS =const char* values - MEMBERS =long distinct - MEMBERS =double* lons - MEMBERS =long size - MEMBERS =int save - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -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*); - -typedef struct grib_accessor_longitudes -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in longitudes */ - const char* values; - long distinct; - double* lons; - long size; - int save; -} grib_accessor_longitudes; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_longitudes = { - &grib_accessor_class_double, /* super */ - "longitudes", /* name */ - sizeof(grib_accessor_longitudes), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_longitudes.h" +grib_accessor_class_longitudes_t _grib_accessor_class_longitudes{"longitudes"}; grib_accessor_class* grib_accessor_class_longitudes = &_grib_accessor_class_longitudes; -/* END_CLASS_IMP */ static int get_distinct(grib_accessor* a, double** val, long* len); -static int compare_doubles(const void* a, const void* b); - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_longitudes* self = (grib_accessor_longitudes*)a; +int compare_doubles(const void* a, const void* b); +void grib_accessor_class_longitudes_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_longitudes_t* self = (grib_accessor_longitudes_t*)a; int n = 0; self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); @@ -126,10 +31,9 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ +int grib_accessor_class_longitudes_t::unpack_double(grib_accessor* a, double* val, size_t* len){ grib_context* c = a->context; - grib_accessor_longitudes* self = (grib_accessor_longitudes*)a; + grib_accessor_longitudes_t* self = (grib_accessor_longitudes_t*)a; int ret = 0; double* v = val; double dummyLat = 0; @@ -181,9 +85,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } -static int value_count(grib_accessor* a, long* len) -{ - grib_accessor_longitudes* self = (grib_accessor_longitudes*)a; +int grib_accessor_class_longitudes_t::value_count(grib_accessor* a, long* len){ + grib_accessor_longitudes_t* self = (grib_accessor_longitudes_t*)a; grib_handle* h = grib_handle_of_accessor(a); grib_context* c = a->context; double* val = NULL; @@ -212,8 +115,7 @@ static int value_count(grib_accessor* a, long* len) return ret; } -static int get_distinct(grib_accessor* a, double** val, long* len) -{ +static int get_distinct(grib_accessor* a, double** val, long* len){ long count = 0; double prev; double* v = NULL; @@ -270,8 +172,7 @@ static int get_distinct(grib_accessor* a, double** val, long* len) return GRIB_SUCCESS; } -static int compare_doubles(const void* a, const void* b) -{ +int compare_doubles(const void* a, const void* b){ double* arg1 = (double*)a; double* arg2 = (double*)b; if (*arg1 < *arg2) diff --git a/src/accessor/grib_accessor_class_longitudes.h b/src/accessor/grib_accessor_class_longitudes.h new file mode 100644 index 000000000..782b4d764 --- /dev/null +++ b/src/accessor/grib_accessor_class_longitudes.h @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_longitudes_h +#define eccodes_accessor_longitudes_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_longitudes_t : public grib_accessor_double_t +{ +public: + /* Members defined in longitudes */ + const char* values; + long distinct; + double* lons; + long size; + int save; +}; + +class grib_accessor_class_longitudes_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_longitudes_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_longitudes_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_longitudes_h */ diff --git a/src/accessor/grib_accessor_class_lookup.cc b/src/accessor/grib_accessor_class_lookup.cc new file mode 100644 index 000000000..d480866c5 --- /dev/null +++ b/src/accessor/grib_accessor_class_lookup.cc @@ -0,0 +1,133 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_lookup.h" + +grib_accessor_class_lookup_t _grib_accessor_class_lookup{"lookup"}; +grib_accessor_class* grib_accessor_class_lookup = &_grib_accessor_class_lookup; + + +void grib_accessor_class_lookup_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_lookup_t* self = (grib_accessor_lookup_t*)a; + a->length = 0; + self->llength = len; + self->loffset = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 0); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->real_name = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 1); +} + +void grib_accessor_class_lookup_t::post_init(grib_accessor* a){ + grib_accessor_lookup_t* self = (grib_accessor_lookup_t*)a; + if (self->real_name) { + grib_dependency_observe_expression(a, self->real_name); + } +} + +void grib_accessor_class_lookup_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_accessor_lookup_t* self = (grib_accessor_lookup_t*)a; + unsigned char bytes[1024] = {0,}; + char msg[1024] = {0,}; + char buf[2048]; + int i; + unsigned long v = 0; + + size_t llen = self->llength; + a->unpack_bytes(bytes, &llen); + bytes[llen] = 0; + for (i = 0; i < llen; i++) { + msg[i] = isprint(bytes[i]) ? bytes[i] : '?'; + v <<= 8; + v |= bytes[i]; + } + + msg[llen] = 0; + + snprintf(buf, sizeof(buf), "%s %lu %ld-%ld", msg, v, (long)a->offset + self->loffset, (long)self->llength); + + grib_dump_long(dumper, a, buf); +} + +int grib_accessor_class_lookup_t::unpack_string(grib_accessor* a, char* v, size_t* len){ + grib_accessor_lookup_t* self = (grib_accessor_lookup_t*)a; + unsigned char bytes[1024] = {0,}; + int i; + + size_t llen = self->llength; + a->unpack_bytes(bytes, &llen); + bytes[llen] = 0; + + for (i = 0; i < llen; i++) { + v[i] = isprint(bytes[i]) ? bytes[i] : '?'; + } + + v[llen] = 0; + if (llen == 1 && v[0] == '?') { + /* Try unpack as long */ + size_t length = 10; + long lval = 0; + int err = unpack_long(a, &lval, &length); + if (!err) { + char str[5]; + int conv = snprintf(str, sizeof(str), "%ld", lval); + if (conv == 1) { + v[0] = str[0]; + } + } + } + + return GRIB_SUCCESS; +} + +int grib_accessor_class_lookup_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_lookup_t* self = (grib_accessor_lookup_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + + long pos = (a->offset + self->loffset) * 8; + + if (len[0] < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); + len[0] = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + /* This is used when reparsing or rebuilding */ + if (h->loader) { + Assert(*len == 1); + return h->loader->lookup_long(h->context, h->loader, a->name, val); + } + + val[0] = grib_decode_unsigned_long(h->buffer->data, &pos, self->llength * 8); + len[0] = 1; + + /*printf("###########lookup unpack_long: %s %ld %ld\n",a->name, pos/8, val[0]);*/ + + return GRIB_SUCCESS; +} + +int grib_accessor_class_lookup_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +} + +long grib_accessor_class_lookup_t::byte_count(grib_accessor* a){ + grib_accessor_lookup_t* self = (grib_accessor_lookup_t*)a; + return self->llength; +} + +long grib_accessor_class_lookup_t::byte_offset(grib_accessor* a){ + grib_accessor_lookup_t* self = (grib_accessor_lookup_t*)a; + return self->loffset; +} + +int grib_accessor_class_lookup_t::notify_change(grib_accessor* self, grib_accessor* changed){ + /* Forward changes */ + return grib_dependency_notify_change(self); +} diff --git a/src/accessor/grib_accessor_class_lookup.h b/src/accessor/grib_accessor_class_lookup.h new file mode 100644 index 000000000..4237d4517 --- /dev/null +++ b/src/accessor/grib_accessor_class_lookup.h @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_lookup_h +#define eccodes_accessor_lookup_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_lookup_t : public grib_accessor_long_t +{ +public: + /* Members defined in lookup */ + long llength; + long loffset; + grib_expression* real_name; +}; + +class grib_accessor_class_lookup_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_lookup_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_lookup_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void post_init(grib_accessor*) override; + int notify_change(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_lookup_h */ diff --git a/src/accessor/grib_accessor_class_mars_param.cc b/src/accessor/grib_accessor_class_mars_param.cc new file mode 100644 index 000000000..76b55a1fe --- /dev/null +++ b/src/accessor/grib_accessor_class_mars_param.cc @@ -0,0 +1,53 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_mars_param.h" + +grib_accessor_class_mars_param_t _grib_accessor_class_mars_param{"mars_param"}; +grib_accessor_class* grib_accessor_class_mars_param = &_grib_accessor_class_mars_param; + + +void grib_accessor_class_mars_param_t::init(grib_accessor* a, const long l, grib_arguments* c){ + int n = 0; + grib_accessor_mars_param_t* self = (grib_accessor_mars_param_t*)a; + self->paramId = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->table = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->param = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); +} + +// For an implementation of pack_string, see +// src/deprecated/grib_accessor_class_mars_param.cc + +// For an alternative implementation of unpack_string, see +// src/deprecated/grib_accessor_class_mars_param.cc +// +int grib_accessor_class_mars_param_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_mars_param_t* self = (grib_accessor_mars_param_t*)a; + long param = 0; + long table = 0; + int ret = 0; + + if (self->table != NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a), self->table, &table)) != GRIB_SUCCESS) + return ret; + if (self->param != NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a), self->param, ¶m)) != GRIB_SUCCESS) + return ret; + + /*if (table==200) table=128;*/ + snprintf(val, 32, "%ld.%ld", param, table); + *len = strlen(val) + 1; + + return GRIB_SUCCESS; +} + +size_t grib_accessor_class_mars_param_t::string_length(grib_accessor* a){ + return 7; +} diff --git a/src/accessor/grib_accessor_class_mars_param.h b/src/accessor/grib_accessor_class_mars_param.h new file mode 100644 index 000000000..87bcaad41 --- /dev/null +++ b/src/accessor/grib_accessor_class_mars_param.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_mars_param_h +#define eccodes_accessor_mars_param_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_mars_param_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in mars_param */ + const char* paramId; + const char* table; + const char* param; +}; + +class grib_accessor_class_mars_param_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_mars_param_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_mars_param_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_mars_param_h */ diff --git a/src/accessor/grib_accessor_class_mars_step.cc b/src/accessor/grib_accessor_class_mars_step.cc new file mode 100644 index 000000000..05a5120c2 --- /dev/null +++ b/src/accessor/grib_accessor_class_mars_step.cc @@ -0,0 +1,115 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_mars_step.h" + +grib_accessor_class_mars_step_t _grib_accessor_class_mars_step{"mars_step"}; +grib_accessor_class* grib_accessor_class_mars_step = &_grib_accessor_class_mars_step; + + +void grib_accessor_class_mars_step_t::init(grib_accessor* a, const long l, grib_arguments* c){ + int n = 0; + grib_accessor_mars_step_t* self = (grib_accessor_mars_step_t*)a; + self->stepRange = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->stepType = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); +} + +int grib_accessor_class_mars_step_t::pack_string(grib_accessor* a, const char* val, size_t* len){ + char stepType[100]; + size_t stepTypeLen = 100; + char buf[100] = {0,}; + int ret; + grib_accessor_mars_step_t* self = (grib_accessor_mars_step_t*)a; + grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); + + if (!stepRangeAcc) { + grib_context_log(a->context, GRIB_LOG_ERROR, "%s not found", self->stepRange); + return GRIB_NOT_FOUND; + } + + if ((ret = grib_get_string(grib_handle_of_accessor(a), self->stepType, stepType, &stepTypeLen)) != GRIB_SUCCESS) + return ret; + + if (!strcmp(stepType, "instant")) + snprintf(buf, sizeof(buf), "%s", val); + else + snprintf(buf, sizeof(buf), "0-%s", val); + + return stepRangeAcc->pack_string(buf, len);} + +int grib_accessor_class_mars_step_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + int ret = 0; + grib_accessor_mars_step_t* self = (grib_accessor_mars_step_t*)a; + char buf[100] = {0,}; + char* p = NULL; + size_t buflen = 100; + long step; + grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); + const char* cclass_name = a->cclass->name; + + if (!stepRangeAcc) { + grib_context_log(a->context, GRIB_LOG_ERROR, "%s: %s not found", cclass_name, self->stepRange); + return GRIB_NOT_FOUND; + } + + if ((ret = stepRangeAcc->unpack_string(buf, &buflen)) != GRIB_SUCCESS) + return ret; + + if (*len < buflen) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + cclass_name, a->name, buflen, *len); + *len = buflen; + return GRIB_BUFFER_TOO_SMALL; + } + + strcpy(val, buf); + step = strtol(buf, &p, 10); + + if (p != NULL && *p == '-' && step == 0) + strcpy(val, ++p); + + *len = strlen(val); + + return ret; +} + +int grib_accessor_class_mars_step_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + char buff[100] = {0,}; + size_t bufflen = 100; + + snprintf(buff, sizeof(buff), "%ld", *val); + + return pack_string(a, buff, &bufflen); +} + +int grib_accessor_class_mars_step_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_mars_step_t* self = (grib_accessor_mars_step_t*)a; + grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); + + if (!stepRangeAcc) + return GRIB_NOT_FOUND; + + return stepRangeAcc->unpack_long(val, len);} + +int grib_accessor_class_mars_step_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +size_t grib_accessor_class_mars_step_t::string_length(grib_accessor* a){ + return 16; +} + +int grib_accessor_class_mars_step_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_mars_step.h b/src/accessor/grib_accessor_class_mars_step.h new file mode 100644 index 000000000..db3042648 --- /dev/null +++ b/src/accessor/grib_accessor_class_mars_step.h @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_mars_step_h +#define eccodes_accessor_mars_step_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_mars_step_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in mars_step */ + const char* stepRange; + const char* stepType; +}; + +class grib_accessor_class_mars_step_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_mars_step_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_mars_step_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_mars_step_h */ diff --git a/src/accessor/todo/grib_accessor_class_md5.cc b/src/accessor/grib_accessor_class_md5.cc similarity index 51% rename from src/accessor/todo/grib_accessor_class_md5.cc rename to src/accessor/grib_accessor_class_md5.cc index 6a57c1329..f19836aea 100644 --- a/src/accessor/todo/grib_accessor_class_md5.cc +++ b/src/accessor/grib_accessor_class_md5.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,107 +10,15 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_md5.h" #include "md5.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = get_native_type;init - IMPLEMENTS = compare;unpack_string;value_count;destroy - MEMBERS = const char* offset - MEMBERS = grib_expression* length - MEMBERS = grib_string_list* blocklist - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_string(grib_accessor*, char*, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_md5 -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in md5 */ - const char* offset; - grib_expression* length; - grib_string_list* blocklist; -} grib_accessor_md5; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_md5 = { - &grib_accessor_class_gen, /* super */ - "md5", /* name */ - sizeof(grib_accessor_md5), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +grib_accessor_class_md5_t _grib_accessor_class_md5{"md5"}; grib_accessor_class* grib_accessor_class_md5 = &_grib_accessor_class_md5; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_md5* self = (grib_accessor_md5*)a; +void grib_accessor_class_md5_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_md5_t* self = (grib_accessor_md5_t*)a; char* b = 0; int n = 0; grib_string_list* current = 0; @@ -138,13 +47,11 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg) a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_md5_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_STRING; } -static int compare(grib_accessor* a, grib_accessor* b) -{ +int grib_accessor_class_md5_t::compare(grib_accessor* a, grib_accessor* b){ int retval = GRIB_SUCCESS; size_t alen = 0; @@ -152,13 +59,11 @@ static int compare(grib_accessor* a, grib_accessor* b) int err = 0; long count = 0; - err = grib_value_count(a, &count); - if (err) + err = a->value_count(&count); if (err) return err; alen = count; - err = grib_value_count(b, &count); - if (err) + err = b->value_count(&count); if (err) return err; blen = count; @@ -168,9 +73,8 @@ static int compare(grib_accessor* a, grib_accessor* b) return retval; } -static int unpack_string(grib_accessor* a, char* v, size_t* len) -{ - grib_accessor_md5* self = (grib_accessor_md5*)a; +int grib_accessor_class_md5_t::unpack_string(grib_accessor* a, char* v, size_t* len){ + grib_accessor_md5_t* self = (grib_accessor_md5_t*)a; unsigned mess_len; unsigned char* mess; unsigned char* p; @@ -226,9 +130,8 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) return ret; } -static void destroy(grib_context* c, grib_accessor* a) -{ - grib_accessor_md5* self = (grib_accessor_md5*)a; +void grib_accessor_class_md5_t::destroy(grib_context* c, grib_accessor* a){ + grib_accessor_md5_t* self = (grib_accessor_md5_t*)a; if (self->blocklist) { grib_string_list* next = self->blocklist; grib_string_list* cur = NULL; @@ -241,8 +144,7 @@ static void destroy(grib_context* c, grib_accessor* a) } } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_md5_t::value_count(grib_accessor* a, long* count){ *count = 1; /* ECC-1475 */ return 0; } diff --git a/src/accessor/grib_accessor_class_md5.h b/src/accessor/grib_accessor_class_md5.h new file mode 100644 index 000000000..8d819cc9d --- /dev/null +++ b/src/accessor/grib_accessor_class_md5.h @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_md5_h +#define eccodes_accessor_md5_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_md5_t : public grib_accessor_gen_t +{ +public: + /* Members defined in md5 */ + const char* offset; + grib_expression* length; + grib_string_list* blocklist; +}; + +class grib_accessor_class_md5_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_md5_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_md5_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_md5_h */ diff --git a/src/accessor/grib_accessor_class_message.cc b/src/accessor/grib_accessor_class_message.cc new file mode 100644 index 000000000..76fcb7be7 --- /dev/null +++ b/src/accessor/grib_accessor_class_message.cc @@ -0,0 +1,75 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_message.h" + +grib_accessor_class_message_t _grib_accessor_class_message{"message"}; +grib_accessor_class* grib_accessor_class_message = &_grib_accessor_class_message; + + + +void grib_accessor_class_message_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = grib_handle_of_accessor(a)->buffer->ulength - len - a->offset; +} + +// static int compare(grib_accessor* a, grib_accessor* b) +// { +// if (a->length != b->length) +// return GRIB_COUNT_MISMATCH; +// return GRIB_SUCCESS; +// } + +void grib_accessor_class_message_t::update_size(grib_accessor* a, size_t new_size){ + a->length = new_size; +} + +void grib_accessor_class_message_t::resize(grib_accessor* a, size_t new_size){ + grib_context_log(a->context, GRIB_LOG_FATAL, "%s %s: Not supported", a->cclass->name, __func__); + + // void* zero = grib_context_malloc_clear(a->context, new_size); + // grib_buffer_replace(a, (const unsigned char*)zero, new_size, 1, 0); + // grib_context_free(a->context, zero); + // grib_context_log(a->context, GRIB_LOG_DEBUG, "resize: grib_accessor_class_message %ld %ld %s %s", + // (long)new_size, (long)a->length, a->cclass->name, a->name); + // Assert(new_size == a->length); +} + +int grib_accessor_class_message_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +int grib_accessor_class_message_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + long i = 0; + size_t l = string_length(a) + 1; + grib_handle* h = grib_handle_of_accessor(a); + + if (*len < l) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + a->cclass->name, a->name, l, *len); + *len = l; + return GRIB_BUFFER_TOO_SMALL; + } + + for (i = 0; i < a->length; i++) + val[i] = h->buffer->data[a->offset + i]; + val[i] = 0; + *len = i; + return GRIB_SUCCESS; +} + +size_t grib_accessor_class_message_t::string_length(grib_accessor* a){ + return a->length; +} diff --git a/src/accessor/grib_accessor_class_message.h b/src/accessor/grib_accessor_class_message.h new file mode 100644 index 000000000..912e8be4b --- /dev/null +++ b/src/accessor/grib_accessor_class_message.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_message_h +#define eccodes_accessor_message_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_bytes.h" + +class grib_accessor_message_t : public grib_accessor_bytes_t +{ +public: + /* Members defined in message */ +}; + +class grib_accessor_class_message_t : public grib_accessor_class_bytes_t +{ +public: + grib_accessor_class_message_t(const char* name) : grib_accessor_class_bytes_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_message_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + void resize(grib_accessor*,size_t) override; +}; +#endif /* eccodes_accessor_message_h */ diff --git a/src/accessor/grib_accessor_class_message_copy.cc b/src/accessor/grib_accessor_class_message_copy.cc new file mode 100644 index 000000000..e32d39355 --- /dev/null +++ b/src/accessor/grib_accessor_class_message_copy.cc @@ -0,0 +1,59 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_message_copy.h" + +grib_accessor_class_message_copy_t _grib_accessor_class_message_copy{"message_copy"}; +grib_accessor_class* grib_accessor_class_message_copy = &_grib_accessor_class_message_copy; + + +void grib_accessor_class_message_copy_t::init(grib_accessor* a, const long length, grib_arguments* args){ + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; +} + +void grib_accessor_class_message_copy_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_string(dumper, a, NULL); +} + +int grib_accessor_class_message_copy_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_STRING; +} + +int grib_accessor_class_message_copy_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + size_t slen = grib_handle_of_accessor(a)->buffer->ulength; + size_t i; + unsigned char* v = 0; + + if (*len < slen) { + return GRIB_ARRAY_TOO_SMALL; + } + v = grib_handle_of_accessor(a)->buffer->data; + /* replace unprintable characters with space */ + for (i = 0; i < slen; i++) + if (v[i] > 126) + v[i] = 32; + memcpy(val, grib_handle_of_accessor(a)->buffer->data, slen); + val[i] = 0; + + *len = slen; + + return GRIB_SUCCESS; +} + +size_t grib_accessor_class_message_copy_t::string_length(grib_accessor* a){ + return grib_handle_of_accessor(a)->buffer->ulength; +} + +long grib_accessor_class_message_copy_t::byte_count(grib_accessor* a){ + return a->length; +} diff --git a/src/accessor/grib_accessor_class_message_copy.h b/src/accessor/grib_accessor_class_message_copy.h new file mode 100644 index 000000000..37072c685 --- /dev/null +++ b/src/accessor/grib_accessor_class_message_copy.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_message_copy_h +#define eccodes_accessor_message_copy_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_message_copy_t : public grib_accessor_gen_t +{ +public: + /* Members defined in message_copy */ +}; + +class grib_accessor_class_message_copy_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_message_copy_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_message_copy_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long byte_count(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_message_copy_h */ diff --git a/src/accessor/grib_accessor_class_multdouble.cc b/src/accessor/grib_accessor_class_multdouble.cc new file mode 100644 index 000000000..3b8b42bd5 --- /dev/null +++ b/src/accessor/grib_accessor_class_multdouble.cc @@ -0,0 +1,40 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_multdouble.h" + +grib_accessor_class_multdouble_t _grib_accessor_class_multdouble{"multdouble"}; +grib_accessor_class* grib_accessor_class_multdouble = &_grib_accessor_class_multdouble; + + +void grib_accessor_class_multdouble_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_multdouble_t* self = (grib_accessor_multdouble_t*)a; + int n = 0; + + self->val = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->multiplier = grib_arguments_get_double(grib_handle_of_accessor(a), c, n++); +} + +int grib_accessor_class_multdouble_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + const grib_accessor_multdouble_t* self = (grib_accessor_multdouble_t*)a; + int ret = GRIB_SUCCESS; + double value = 0; + + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->val, &value); + if (ret != GRIB_SUCCESS) + return ret; + + *val = value * self->multiplier; + + *len = 1; + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_multdouble.h b/src/accessor/grib_accessor_class_multdouble.h new file mode 100644 index 000000000..9d6d76285 --- /dev/null +++ b/src/accessor/grib_accessor_class_multdouble.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_multdouble_h +#define eccodes_accessor_multdouble_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_multdouble_t : public grib_accessor_double_t +{ +public: + /* Members defined in multdouble */ + const char* val; + double multiplier; +}; + +class grib_accessor_class_multdouble_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_multdouble_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_multdouble_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_multdouble_h */ diff --git a/src/accessor/grib_accessor_class_non_alpha.cc b/src/accessor/grib_accessor_class_non_alpha.cc new file mode 100644 index 000000000..05f8ca01c --- /dev/null +++ b/src/accessor/grib_accessor_class_non_alpha.cc @@ -0,0 +1,112 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_non_alpha.h" + +grib_accessor_class_non_alpha_t _grib_accessor_class_non_alpha{"non_alpha"}; +grib_accessor_class* grib_accessor_class_non_alpha = &_grib_accessor_class_non_alpha; + + +void grib_accessor_class_non_alpha_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; + size_t i = 0; + unsigned char* v; + + v = buffer->data + a->offset; + i = 0; + while ((*v < 33 || *v > 126) && i <= buffer->ulength) { + v++; + i++; + } + a->length = i; + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_non_alpha_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +size_t grib_accessor_class_non_alpha_t::string_length(grib_accessor* a){ + return a->length; +} + +void grib_accessor_class_non_alpha_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_string(dumper, a, NULL); +} + +int grib_accessor_class_non_alpha_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_STRING; +} + +int grib_accessor_class_non_alpha_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_handle* hand = grib_handle_of_accessor(a); + long i = 0; + + if (*len < (a->length + 1)) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", + *len, a->name, a->length + 1); + *len = a->length + 1; + return GRIB_BUFFER_TOO_SMALL; + } + + for (i = 0; i < a->length; i++) { + val[i] = hand->buffer->data[a->offset + i]; + } + val[i] = 0; + *len = i; + return GRIB_SUCCESS; +} + +int grib_accessor_class_non_alpha_t::unpack_long(grib_accessor* a, long* v, size_t* len){ + char val[1024] = {0,}; + size_t l = sizeof(val); + size_t i = 0; + char* last = NULL; + int err = a->unpack_string(val, &l); + if (err) + return err; + + i = 0; + while (i < l - 1 && val[i] == ' ') + i++; + + if (val[i] == 0) { + *v = 0; + return 0; + } + if (val[i + 1] == ' ' && i < l - 2) + val[i + 1] = 0; + + *v = strtol(val, &last, 10); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_non_alpha_t::unpack_double(grib_accessor* a, double* v, size_t* len){ + char val[1024]; + size_t l = sizeof(val); + char* last = NULL; + a->unpack_string(val, &l); + *v = strtod(val, &last); + + if (*last == 0) { + return GRIB_SUCCESS; + } + + return GRIB_NOT_IMPLEMENTED; +} + +long grib_accessor_class_non_alpha_t::next_offset(grib_accessor* a){ + return a->offset + a->length; +} diff --git a/src/accessor/grib_accessor_class_non_alpha.h b/src/accessor/grib_accessor_class_non_alpha.h new file mode 100644 index 000000000..1b1b9d830 --- /dev/null +++ b/src/accessor/grib_accessor_class_non_alpha.h @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_non_alpha_h +#define eccodes_accessor_non_alpha_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_non_alpha_t : public grib_accessor_gen_t +{ +public: + /* Members defined in non_alpha */ +}; + +class grib_accessor_class_non_alpha_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_non_alpha_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_non_alpha_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_non_alpha_h */ diff --git a/src/accessor/grib_accessor_class_number_of_coded_values.cc b/src/accessor/grib_accessor_class_number_of_coded_values.cc new file mode 100644 index 000000000..b77769898 --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_coded_values.cc @@ -0,0 +1,66 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_number_of_coded_values.h" + +grib_accessor_class_number_of_coded_values_t _grib_accessor_class_number_of_coded_values{"number_of_coded_values"}; +grib_accessor_class* grib_accessor_class_number_of_coded_values = &_grib_accessor_class_number_of_coded_values; + + +void grib_accessor_class_number_of_coded_values_t::init(grib_accessor* a, const long l, grib_arguments* c){ + int n = 0; + grib_accessor_number_of_coded_values_t* self = (grib_accessor_number_of_coded_values_t*)a; + self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +int grib_accessor_class_number_of_coded_values_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + int ret = GRIB_SUCCESS; + long bpv = 0; + long offsetBeforeData = 0, offsetAfterData = 0, unusedBits = 0, numberOfValues; + + grib_accessor_number_of_coded_values_t* self = (grib_accessor_number_of_coded_values_t*)a; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue, &bpv)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData, &offsetBeforeData)) != GRIB_SUCCESS) + return ret; + + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData, &offsetAfterData)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &unusedBits)) != GRIB_SUCCESS) + return ret; + + if (bpv != 0) { + grib_context_log(a->context, GRIB_LOG_DEBUG, "grib_accessor_number_of_coded_values_t: offsetAfterData=%ld offsetBeforeData=%ld unusedBits=%ld bpv=%ld\n", + offsetAfterData, offsetBeforeData, unusedBits, bpv); + DEBUG_ASSERT(offsetAfterData > offsetBeforeData); + *val = ((offsetAfterData - offsetBeforeData) * 8 - unusedBits) / bpv; + } + else { + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, &numberOfValues)) != GRIB_SUCCESS) + return ret; + + *val = numberOfValues; + } + + return ret; +} diff --git a/src/accessor/grib_accessor_class_number_of_coded_values.h b/src/accessor/grib_accessor_class_number_of_coded_values.h new file mode 100644 index 000000000..de5e3b76b --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_coded_values.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_number_of_coded_values_h +#define eccodes_accessor_number_of_coded_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_number_of_coded_values_t : public grib_accessor_long_t +{ +public: + /* Members defined in number_of_coded_values */ + const char* numberOfValues; + const char* bitsPerValue; + const char* offsetBeforeData; + const char* offsetAfterData; + const char* unusedBits; +}; + +class grib_accessor_class_number_of_coded_values_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_number_of_coded_values_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_coded_values_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_number_of_coded_values_h */ diff --git a/src/accessor/grib_accessor_class_number_of_points.cc b/src/accessor/grib_accessor_class_number_of_points.cc new file mode 100644 index 000000000..abd4af786 --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_points.cc @@ -0,0 +1,80 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_number_of_points.h" + +grib_accessor_class_number_of_points_t _grib_accessor_class_number_of_points{"number_of_points"}; +grib_accessor_class* grib_accessor_class_number_of_points = &_grib_accessor_class_number_of_points; + + +void grib_accessor_class_number_of_points_t::init(grib_accessor* a, const long l, grib_arguments* c){ + int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + + grib_accessor_number_of_points_t* self = (grib_accessor_number_of_points_t*)a; + self->ni = grib_arguments_get_name(hand, c, n++); + self->nj = grib_arguments_get_name(hand, c, n++); + self->plpresent = grib_arguments_get_name(hand, c, n++); + self->pl = grib_arguments_get_name(hand, c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +int grib_accessor_class_number_of_points_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_number_of_points_t* self = (grib_accessor_number_of_points_t*)a; + + int ret = GRIB_SUCCESS; + long ni = 0, nj = 0, plpresent = 0; + size_t plsize = 0; + long* pl = NULL; + int i = 0; + grib_context* c = a->context; + grib_handle* hand = grib_handle_of_accessor(a); + + if ((ret = grib_get_long_internal(hand, self->ni, &ni)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(hand, self->nj, &nj)) != GRIB_SUCCESS) + return ret; + + if (self->plpresent && + ((ret = grib_get_long_internal(hand, self->plpresent, &plpresent)) != GRIB_SUCCESS)) + return ret; + + if (grib_is_missing(hand, self->nj, &ret) && ret == GRIB_SUCCESS) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_accessor_class_number_of_points: Key %s cannot be 'missing'!", self->nj); + return GRIB_GEOCALCULUS_PROBLEM; + } + + if (nj == 0) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_accessor_class_number_of_points: Key %s cannot be 0!", self->nj); + return GRIB_GEOCALCULUS_PROBLEM; + } + + if (plpresent) { + /*reduced*/ + plsize = nj; + pl = (long*)grib_context_malloc(c, sizeof(long) * plsize); + grib_get_long_array_internal(hand, self->pl, pl, &plsize); + *val = 0; + for (i = 0; i < plsize; i++) + *val += pl[i]; + grib_context_free(c, pl); + } + else { + /*regular*/ + *val = ni * nj; + } + + return ret; +} diff --git a/src/accessor/grib_accessor_class_number_of_points.h b/src/accessor/grib_accessor_class_number_of_points.h new file mode 100644 index 000000000..db3521c05 --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_points.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_number_of_points_h +#define eccodes_accessor_number_of_points_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_number_of_points_t : public grib_accessor_long_t +{ +public: + /* Members defined in number_of_points */ + const char* ni; + const char* nj; + const char* plpresent; + const char* pl; +}; + +class grib_accessor_class_number_of_points_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_number_of_points_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_points_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_number_of_points_h */ diff --git a/src/accessor/todo/grib_accessor_class_number_of_points_gaussian.cc b/src/accessor/grib_accessor_class_number_of_points_gaussian.cc similarity index 72% rename from src/accessor/todo/grib_accessor_class_number_of_points_gaussian.cc rename to src/accessor/grib_accessor_class_number_of_points_gaussian.cc index 2114a9c87..c7fd4e4b8 100644 --- a/src/accessor/todo/grib_accessor_class_number_of_points_gaussian.cc +++ b/src/accessor/grib_accessor_class_number_of_points_gaussian.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,127 +9,19 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************** - * Enrico Fucile - ************************************/ - #include "grib_api_internal.h" +#include "grib_accessor_class_number_of_points_gaussian.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS = const char* ni - MEMBERS = const char* nj - MEMBERS = const char* plpresent - MEMBERS = const char* pl - MEMBERS = const char* order - MEMBERS = const char* lat_first - MEMBERS = const char* lon_first - MEMBERS = const char* lat_last - MEMBERS = const char* lon_last - MEMBERS = const char* support_legacy - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_number_of_points_gaussian -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in number_of_points_gaussian */ - const char* ni; - const char* nj; - const char* plpresent; - const char* pl; - const char* order; - const char* lat_first; - const char* lon_first; - const char* lat_last; - const char* lon_last; - const char* support_legacy; -} grib_accessor_number_of_points_gaussian; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_number_of_points_gaussian = { - &grib_accessor_class_long, /* super */ - "number_of_points_gaussian", /* name */ - sizeof(grib_accessor_number_of_points_gaussian), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_number_of_points_gaussian_t _grib_accessor_class_number_of_points_gaussian{"number_of_points_gaussian"}; grib_accessor_class* grib_accessor_class_number_of_points_gaussian = &_grib_accessor_class_number_of_points_gaussian; -/* END_CLASS_IMP */ #define EFDEBUG 0 -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ +void grib_accessor_class_number_of_points_gaussian_t::init(grib_accessor* a, const long l, grib_arguments* c){ int n = 0; grib_handle* h = grib_handle_of_accessor(a); - grib_accessor_number_of_points_gaussian* self = (grib_accessor_number_of_points_gaussian*)a; + grib_accessor_number_of_points_gaussian_t* self = (grib_accessor_number_of_points_gaussian_t*)a; self->ni = grib_arguments_get_name(h, c, n++); self->nj = grib_arguments_get_name(h, c, n++); self->plpresent = grib_arguments_get_name(h, c, n++); @@ -148,13 +41,11 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) // See src/deprecated/grib_accessor_class_number_of_points_gaussian.cc // -static int angleApproximatelyEqual(double A, double B, double angular_precision) -{ +int angleApproximatelyEqual(double A, double B, double angular_precision){ return angular_precision > 0 ? (fabs(A - B) <= angular_precision) : (A == B); } -static double longitude_normalise(double lon, double minimum) -{ +double longitude_normalise(double lon, double minimum){ while (lon < minimum) { lon += 360; } @@ -164,8 +55,7 @@ static double longitude_normalise(double lon, double minimum) return lon; } -static void correctWestEast(long max_pl, double angular_precision, double* pWest, double* pEast) -{ +void correctWestEast(long max_pl, double angular_precision, double* pWest, double* pEast){ double w, e; const double inc = 360.0 / max_pl; /*smallest increment*/ if (*pWest > *pEast) @@ -186,8 +76,7 @@ static void correctWestEast(long max_pl, double angular_precision, double* pWest } } -static int get_number_of_data_values(grib_handle* h, size_t* numDataValues) -{ +int get_number_of_data_values(grib_handle* h, size_t* numDataValues){ int err = 0; long bpv = 0, bitmapPresent = 0; size_t bitmapLength = 0; @@ -218,14 +107,13 @@ static int get_number_of_data_values(grib_handle* h, size_t* numDataValues) return err; } -static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len); -static int unpack_long_new(grib_accessor* a, long* val, size_t* len); +int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len); +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 grib_accessor_class_number_of_points_gaussian_t::unpack_long(grib_accessor* a, long* val, size_t* len){ int err = GRIB_SUCCESS; long support_legacy = 1; - grib_accessor_number_of_points_gaussian* self = (grib_accessor_number_of_points_gaussian*)a; + grib_accessor_number_of_points_gaussian_t* self = (grib_accessor_number_of_points_gaussian_t*)a; grib_handle* h = grib_handle_of_accessor(a); if ((err = grib_get_long_internal(h, self->support_legacy, &support_legacy)) != GRIB_SUCCESS) @@ -238,8 +126,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 unpack_long_new(grib_accessor* a, long* val, size_t* len){ int err = GRIB_SUCCESS; int is_global = 0; long ni = 0, nj = 0, plpresent = 0, order = 0; @@ -253,7 +140,7 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) long angleSubdivisions = 0; grib_handle* h = grib_handle_of_accessor(a); - grib_accessor_number_of_points_gaussian* self = (grib_accessor_number_of_points_gaussian*)a; + grib_accessor_number_of_points_gaussian_t* self = (grib_accessor_number_of_points_gaussian_t*)a; grib_context* c = a->context; if ((err = grib_get_long_internal(h, self->ni, &ni)) != GRIB_SUCCESS) @@ -347,8 +234,7 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) } /* With Legacy support */ -static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len) -{ +int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len){ int err = GRIB_SUCCESS; int is_global = 0; long ni = 0, nj = 0, plpresent = 0, order = 0; @@ -363,7 +249,7 @@ static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* grib_handle* h = grib_handle_of_accessor(a); size_t numDataValues = 0; - grib_accessor_number_of_points_gaussian* self = (grib_accessor_number_of_points_gaussian*)a; + grib_accessor_number_of_points_gaussian_t* self = (grib_accessor_number_of_points_gaussian_t*)a; grib_context* c = a->context; if ((err = grib_get_long_internal(h, self->ni, &ni)) != GRIB_SUCCESS) diff --git a/src/accessor/grib_accessor_class_number_of_points_gaussian.h b/src/accessor/grib_accessor_class_number_of_points_gaussian.h new file mode 100644 index 000000000..f01224f17 --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_points_gaussian.h @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_number_of_points_gaussian_h +#define eccodes_accessor_number_of_points_gaussian_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_number_of_points_gaussian_t : public grib_accessor_long_t +{ +public: + /* Members defined in number_of_points_gaussian */ + const char* ni; + const char* nj; + const char* plpresent; + const char* pl; + const char* order; + const char* lat_first; + const char* lon_first; + const char* lat_last; + const char* lon_last; + const char* support_legacy; +}; + +class grib_accessor_class_number_of_points_gaussian_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_number_of_points_gaussian_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_points_gaussian_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_number_of_points_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_number_of_values.cc b/src/accessor/grib_accessor_class_number_of_values.cc new file mode 100644 index 000000000..3472eb68d --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_values.cc @@ -0,0 +1,67 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_number_of_values.h" + +grib_accessor_class_number_of_values_t _grib_accessor_class_number_of_values{"number_of_values"}; +grib_accessor_class* grib_accessor_class_number_of_values = &_grib_accessor_class_number_of_values; + + +void grib_accessor_class_number_of_values_t::init(grib_accessor* a, const long l, grib_arguments* c){ + int n = 0; + grib_accessor_number_of_values_t* self = (grib_accessor_number_of_values_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + + self->values = grib_arguments_get_name(hand, c, n++); + self->bitsPerValue = grib_arguments_get_name(hand, c, n++); + self->numberOfPoints = grib_arguments_get_name(hand, c, n++); + self->bitmapPresent = grib_arguments_get_name(hand, c, n++); + self->bitmap = grib_arguments_get_name(hand, c, n++); + self->numberOfCodedValues = grib_arguments_get_name(hand, c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + + a->length = 0; +} + +int grib_accessor_class_number_of_values_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_number_of_values_t* self = (grib_accessor_number_of_values_t*)a; + int ret = GRIB_SUCCESS, i; + long npoints = 0, bitmap_present = 0; + size_t size = 0; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &npoints)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitmapPresent, &bitmap_present)) != GRIB_SUCCESS) + return ret; + + if (bitmap_present) { + double* bitmap; + size = npoints; + bitmap = (double*)grib_context_malloc(a->context, sizeof(double) * size); + if ((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->bitmap, bitmap, &size)) != GRIB_SUCCESS) { + grib_context_free(a->context, bitmap); + return ret; + } + *val = 0; + for (i = 0; i < size; i++) + if (bitmap[i] != 0) + (*val)++; + + grib_context_free(a->context, bitmap); + } + else { + *val = npoints; + } + + return ret; +} diff --git a/src/accessor/grib_accessor_class_number_of_values.h b/src/accessor/grib_accessor_class_number_of_values.h new file mode 100644 index 000000000..88b18cd6f --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_values.h @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_number_of_values_h +#define eccodes_accessor_number_of_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_number_of_values_t : public grib_accessor_long_t +{ +public: + /* Members defined in number_of_values */ + const char* values; + const char* bitsPerValue; + const char* numberOfPoints; + const char* bitmapPresent; + const char* bitmap; + const char* numberOfCodedValues; +}; + +class grib_accessor_class_number_of_values_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_number_of_values_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_values_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_number_of_values_h */ diff --git a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc new file mode 100644 index 000000000..ecfe11b22 --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc @@ -0,0 +1,63 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_number_of_values_data_raw_packing.h" + +grib_accessor_class_number_of_values_data_raw_packing_t _grib_accessor_class_number_of_values_data_raw_packing{"number_of_values_data_raw_packing"}; +grib_accessor_class* grib_accessor_class_number_of_values_data_raw_packing = &_grib_accessor_class_number_of_values_data_raw_packing; + + +void grib_accessor_class_number_of_values_data_raw_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + int n = 0; + grib_accessor_number_of_values_data_raw_packing_t* self = (grib_accessor_number_of_values_data_raw_packing_t*)a; + + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; +} + +int grib_accessor_class_number_of_values_data_raw_packing_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + int err = 0; + grib_accessor_number_of_values_data_raw_packing_t* self = (grib_accessor_number_of_values_data_raw_packing_t*)a; + grib_accessor* adata = NULL; + long precision = 0; + int bytes = 0; + long byte_count = 0; + + adata = grib_find_accessor(grib_handle_of_accessor(a), self->values); + Assert(adata != NULL); + byte_count = adata->byte_count(); + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) + return err; + + switch (precision) { + case 1: + bytes = 4; + break; + + case 2: + bytes = 8; + break; + + default: + return GRIB_NOT_IMPLEMENTED; + } + + *val = byte_count / bytes; + + return err; +} + +int grib_accessor_class_number_of_values_data_raw_packing_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h new file mode 100644 index 000000000..c0a6e9fcb --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_number_of_values_data_raw_packing_h +#define eccodes_accessor_number_of_values_data_raw_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_number_of_values_data_raw_packing_t : public grib_accessor_gen_t +{ +public: + /* Members defined in number_of_values_data_raw_packing */ + const char* values; + const char* precision; +}; + +class grib_accessor_class_number_of_values_data_raw_packing_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_number_of_values_data_raw_packing_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_values_data_raw_packing_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_number_of_values_data_raw_packing_h */ diff --git a/src/accessor/grib_accessor_class_octahedral_gaussian.cc b/src/accessor/grib_accessor_class_octahedral_gaussian.cc new file mode 100644 index 000000000..259f97375 --- /dev/null +++ b/src/accessor/grib_accessor_class_octahedral_gaussian.cc @@ -0,0 +1,120 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_octahedral_gaussian.h" + +grib_accessor_class_octahedral_gaussian_t _grib_accessor_class_octahedral_gaussian{"octahedral_gaussian"}; +grib_accessor_class* grib_accessor_class_octahedral_gaussian = &_grib_accessor_class_octahedral_gaussian; + + +void grib_accessor_class_octahedral_gaussian_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_octahedral_gaussian_t* self = (grib_accessor_octahedral_gaussian_t*)a; + int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + + self->N = grib_arguments_get_name(hand, c, n++); + self->Ni = grib_arguments_get_name(hand, c, n++); + self->plpresent = grib_arguments_get_name(hand, c, n++); + self->pl = grib_arguments_get_name(hand, c, n++); +} + +/* Returns 1 (=true) if input pl array is Octahedral, 0 otherwise. + * Possible cases for the deltas in an octahedral pl array: + * +4 .. +4 Top part, above equator + * +4 .. 0 Top part, above and including equator + * +4.. 0 -4.. Middle part, above, equator and below + * 0 -4.. Equator and below + * -4 ..-4 All below equator + * Anything else is considered not octahedral + */ +int is_pl_octahedral(const long pl[], size_t size){ + long i; + long prev_diff = -1; + for (i = 1; i < size; ++i) { + const long diff = pl[i] - pl[i - 1]; + if (diff == 0) { + /* prev must be +4 or undef */ + if (!(prev_diff == +4 || i == 1)) { + return 0; + } + } + else { + if (labs(diff) != 4) { + return 0; + } + if (diff == +4) { + /* prev must be +4 or undef */ + if (!(prev_diff == +4 || i == 1)) { + return 0; + } + } + if (diff == -4) { + /* prev must be 0, -4 or undef */ + if (!(prev_diff == -4 || prev_diff == 0 || i == 1)) { + return 0; + } + } + } + prev_diff = diff; + } + return 1; /* it's octahedral */ +} + +int grib_accessor_class_octahedral_gaussian_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_octahedral_gaussian_t* self = (grib_accessor_octahedral_gaussian_t*)a; + int ret = GRIB_SUCCESS; + long Ni; + long plpresent = 0; + long* pl = NULL; /* pl array */ + size_t plsize = 0; + grib_handle* hand = grib_handle_of_accessor(a); + + grib_context* c = a->context; + + if ((ret = grib_get_long_internal(hand, self->Ni, &Ni)) != GRIB_SUCCESS) + return ret; + + /* If Ni is not missing, then this is a plain gaussian grid and not reduced. */ + /* So it cannot be an octahedral grid */ + if (Ni != GRIB_MISSING_LONG) { + *val = 0; + return GRIB_SUCCESS; + } + + if ((ret = grib_get_long_internal(hand, self->plpresent, &plpresent)) != GRIB_SUCCESS) + return ret; + if (!plpresent) { + *val = 0; /* Not octahedral */ + return GRIB_SUCCESS; + } + + if ((ret = grib_get_size(hand, self->pl, &plsize)) != GRIB_SUCCESS) + return ret; + Assert(plsize); /* pl array must have at least one element */ + + pl = (long*)grib_context_malloc_clear(c, sizeof(long) * plsize); + if (!pl) { + return GRIB_OUT_OF_MEMORY; + } + if ((ret = grib_get_long_array_internal(hand, self->pl, pl, &plsize)) != GRIB_SUCCESS) + return ret; + + /* pl[0] is guaranteed to exist. Have already asserted previously */ + *val = is_pl_octahedral(pl, plsize); + grib_context_free(c, pl); + + return ret; +} + +int grib_accessor_class_octahedral_gaussian_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +} diff --git a/src/accessor/grib_accessor_class_octahedral_gaussian.h b/src/accessor/grib_accessor_class_octahedral_gaussian.h new file mode 100644 index 000000000..31784d000 --- /dev/null +++ b/src/accessor/grib_accessor_class_octahedral_gaussian.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_octahedral_gaussian_h +#define eccodes_accessor_octahedral_gaussian_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_octahedral_gaussian_t : public grib_accessor_long_t +{ +public: + /* Members defined in octahedral_gaussian */ + const char* N; + const char* Ni; + const char* plpresent; + const char* pl; +}; + +class grib_accessor_class_octahedral_gaussian_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_octahedral_gaussian_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_octahedral_gaussian_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_octahedral_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_octet_number.cc b/src/accessor/grib_accessor_class_octet_number.cc new file mode 100644 index 000000000..4a4c28ad7 --- /dev/null +++ b/src/accessor/grib_accessor_class_octet_number.cc @@ -0,0 +1,47 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_octet_number.h" + +grib_accessor_class_octet_number_t _grib_accessor_class_octet_number{"octet_number"}; +grib_accessor_class* grib_accessor_class_octet_number = &_grib_accessor_class_octet_number; + + +void grib_accessor_class_octet_number_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_octet_number_t* self = (grib_accessor_octet_number_t*)a; + + int n = 0; + self->left = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->right = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); + + a->length = 0; +} + +int grib_accessor_class_octet_number_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_octet_number_t* self = (grib_accessor_octet_number_t*)a; + int ret = GRIB_SUCCESS; + long offset; + + offset = a->offset + self->right; + + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->left, offset)) != GRIB_SUCCESS) + return ret; + + *val = offset; + *len = 1; + + return ret; +} + +int grib_accessor_class_octet_number_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_octet_number.h b/src/accessor/grib_accessor_class_octet_number.h new file mode 100644 index 000000000..4d6145742 --- /dev/null +++ b/src/accessor/grib_accessor_class_octet_number.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_octet_number_h +#define eccodes_accessor_octet_number_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_octet_number_t : public grib_accessor_long_t +{ +public: + /* Members defined in octet_number */ + const char* left; + long right; +}; + +class grib_accessor_class_octet_number_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_octet_number_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_octet_number_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_octet_number_h */ diff --git a/src/accessor/grib_accessor_class_offset_file.cc b/src/accessor/grib_accessor_class_offset_file.cc new file mode 100644 index 000000000..ab9c79a11 --- /dev/null +++ b/src/accessor/grib_accessor_class_offset_file.cc @@ -0,0 +1,55 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_offset_file.h" + +grib_accessor_class_offset_file_t _grib_accessor_class_offset_file{"offset_file"}; +grib_accessor_class* grib_accessor_class_offset_file = &_grib_accessor_class_offset_file; + + +void grib_accessor_class_offset_file_t::init(grib_accessor* a, const long l, grib_arguments* c){ + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; +} + +int grib_accessor_class_offset_file_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + *val = (double)grib_handle_of_accessor(a)->offset; + *len = 1; + return GRIB_SUCCESS; +} + +int grib_accessor_class_offset_file_t::unpack_string(grib_accessor* a, char* v, size_t* len){ + double val = 0; + size_t l = 1; + char repres[1024] = {0,}; + int err = 0; + const char* cclass_name = a->cclass->name; + + err = a->unpack_double(&val, &l); if (err) return err; + + snprintf(repres, sizeof(repres), "%.0f", val); + + l = strlen(repres) + 1; + if (l > *len) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + cclass_name, a->name, l, *len); + *len = l; + return GRIB_BUFFER_TOO_SMALL; + } + grib_context_log(a->context, GRIB_LOG_DEBUG, "%s: Casting double %s to string", __func__, a->name); + + *len = l; + + strcpy(v, repres); + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_offset_file.h b/src/accessor/grib_accessor_class_offset_file.h new file mode 100644 index 000000000..34243b5a4 --- /dev/null +++ b/src/accessor/grib_accessor_class_offset_file.h @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_offset_file_h +#define eccodes_accessor_offset_file_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_offset_file_t : public grib_accessor_double_t +{ +public: + /* Members defined in offset_file */ +}; + +class grib_accessor_class_offset_file_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_offset_file_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_offset_file_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_offset_file_h */ diff --git a/src/accessor/grib_accessor_class_offset_values.cc b/src/accessor/grib_accessor_class_offset_values.cc new file mode 100644 index 000000000..bbd0139c9 --- /dev/null +++ b/src/accessor/grib_accessor_class_offset_values.cc @@ -0,0 +1,83 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_offset_values.h" + +grib_accessor_class_offset_values_t _grib_accessor_class_offset_values{"offset_values"}; +grib_accessor_class* grib_accessor_class_offset_values = &_grib_accessor_class_offset_values; + + +void grib_accessor_class_offset_values_t::init(grib_accessor* a, const long l, grib_arguments* args){ + int n = 0; + grib_accessor_offset_values_t* self = (grib_accessor_offset_values_t*)a; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->missingValue = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +int grib_accessor_class_offset_values_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + int ret = 0; + *val = 0; + *len = 1; + return ret; +} + +int grib_accessor_class_offset_values_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + double* values = NULL; + size_t size = 0; + double missingValue = 0; + long missingValuesPresent = 0; + int ret = 0, i = 0; + grib_accessor_offset_values_t* self = (grib_accessor_offset_values_t*)a; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if (*val == 0) + return GRIB_SUCCESS; + + if ((ret = grib_get_double_internal(h, self->missingValue, &missingValue)) != GRIB_SUCCESS) { + return ret; + } + if ((ret = grib_get_long_internal(h, "missingValuesPresent", &missingValuesPresent)) != GRIB_SUCCESS) { + return ret; + } + + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; + + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; + + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return ret; + } + + for (i = 0; i < size; i++) { + if (missingValuesPresent) { + if (values[i] != missingValue) + values[i] += *val; + } + else { + values[i] += *val; + } + } + + if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) + return ret; + + grib_context_free(c, values); + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_offset_values.h b/src/accessor/grib_accessor_class_offset_values.h new file mode 100644 index 000000000..51e0f0f16 --- /dev/null +++ b/src/accessor/grib_accessor_class_offset_values.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_offset_values_h +#define eccodes_accessor_offset_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_offset_values_t : public grib_accessor_double_t +{ +public: + /* Members defined in offset_values */ + const char* values; + const char* missingValue; +}; + +class grib_accessor_class_offset_values_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_offset_values_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_offset_values_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_offset_values_h */ diff --git a/src/accessor/todo/grib_accessor_class_optimal_step_units.cc b/src/accessor/grib_accessor_class_optimal_step_units.cc similarity index 54% rename from src/accessor/todo/grib_accessor_class_optimal_step_units.cc rename to src/accessor/grib_accessor_class_optimal_step_units.cc index 261ff4c80..7a4802045 100644 --- a/src/accessor/todo/grib_accessor_class_optimal_step_units.cc +++ b/src/accessor/grib_accessor_class_optimal_step_units.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,116 +10,16 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_optimal_step_units.h" #include "step.h" #include "step_utilities.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = pack_long;unpack_long;dump - IMPLEMENTS = pack_string;unpack_string;dump - IMPLEMENTS = string_length;pack_expression;get_native_type;is_missing - IMPLEMENTS = init - MEMBERS = const char* forecast_time_value - MEMBERS = const char* forecast_time_unit - MEMBERS = const char* time_range_value - MEMBERS = const char* time_range_unit - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int is_missing(grib_accessor*); -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_expression(grib_accessor*, grib_expression*); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_optimal_step_units -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in optimal_step_units */ - const char* forecast_time_value; - const char* forecast_time_unit; - const char* time_range_value; - const char* time_range_unit; -} grib_accessor_optimal_step_units; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_optimal_step_units = { - &grib_accessor_class_gen, /* super */ - "optimal_step_units", /* name */ - sizeof(grib_accessor_optimal_step_units), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - &is_missing, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - &pack_expression, /* 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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +grib_accessor_class_optimal_step_units_t _grib_accessor_class_optimal_step_units{"optimal_step_units"}; grib_accessor_class* grib_accessor_class_optimal_step_units = &_grib_accessor_class_optimal_step_units; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_optimal_step_units* self = (grib_accessor_optimal_step_units*)a; +void grib_accessor_class_optimal_step_units_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_optimal_step_units_t* self = (grib_accessor_optimal_step_units_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; @@ -129,18 +30,15 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->length = 0; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_optimal_step_units_t::dump(grib_accessor* a, grib_dumper* dumper){ grib_dump_string(dumper, a, NULL); } -static size_t string_length(grib_accessor* a) -{ +size_t grib_accessor_class_optimal_step_units_t::string_length(grib_accessor* a){ return 255; } -static int pack_expression(grib_accessor* a, grib_expression* e) -{ +int grib_accessor_class_optimal_step_units_t::pack_expression(grib_accessor* a, grib_expression* e){ const char* cval = NULL; int ret = 0; long lval = 0; @@ -150,8 +48,7 @@ static int pack_expression(grib_accessor* a, grib_expression* e) if (strcmp(e->cclass->name, "long") == 0) { grib_expression_evaluate_long(hand, e, &lval); /* TODO: check return value */ - ret = grib_pack_long(a, &lval, &len); - } + ret = a->pack_long(&lval, &len); } else { char tmp[1024]; len = sizeof(tmp); @@ -165,16 +62,14 @@ static int pack_expression(grib_accessor* a, grib_expression* e) len = strlen(cval) + 1; //if (hand->context->debug) // printf("ECCODES DEBUG grib_accessor_class_codetable::pack_expression %s %s\n", a->name, cval); - ret = grib_pack_string(a, cval, &len); - } + ret = a->pack_string(cval, &len); } return ret; } static long staticStepUnits = eccodes::Unit{eccodes::Unit::Value::MISSING}.value(); static long staticForceStepUnits = eccodes::Unit{eccodes::Unit::Value::MISSING}.value(); -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ +int grib_accessor_class_optimal_step_units_t::pack_long(grib_accessor* a, const long* val, size_t* len){ grib_handle* h = grib_handle_of_accessor(a); auto supported_units = eccodes::Unit::list_supported_units(); try { @@ -205,15 +100,14 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ +int grib_accessor_class_optimal_step_units_t::unpack_long(grib_accessor* a, long* val, size_t* len){ try { if (eccodes::Unit{staticStepUnits} != eccodes::Unit{eccodes::Unit::Value::MISSING}) { *val = staticStepUnits; return GRIB_SUCCESS; } - const grib_accessor_optimal_step_units* self = (grib_accessor_optimal_step_units*)a; + const grib_accessor_optimal_step_units_t* self = (grib_accessor_optimal_step_units_t*)a; grib_handle* h = grib_handle_of_accessor(a); auto forecast_time_opt = get_step(h, self->forecast_time_value, self->forecast_time_unit); @@ -242,8 +136,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ +int grib_accessor_class_optimal_step_units_t::pack_string(grib_accessor* a, const char* val, size_t* len){ try { long unit = eccodes::Unit{val}.value(); pack_long(a, &unit, len); @@ -263,8 +156,7 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ +int grib_accessor_class_optimal_step_units_t::unpack_string(grib_accessor* a, char* val, size_t* len){ int ret = 0; long unit = 0; size_t unit_len = 0; @@ -276,12 +168,10 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) // Step units are never missing // If the user does not specify a step unit, we default to hours -static int is_missing(grib_accessor* a) -{ +int grib_accessor_class_optimal_step_units_t::is_missing(grib_accessor* a){ return 0; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_optimal_step_units_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_LONG; } diff --git a/src/accessor/grib_accessor_class_optimal_step_units.h b/src/accessor/grib_accessor_class_optimal_step_units.h new file mode 100644 index 000000000..96383b291 --- /dev/null +++ b/src/accessor/grib_accessor_class_optimal_step_units.h @@ -0,0 +1,44 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_optimal_step_units_h +#define eccodes_accessor_optimal_step_units_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_optimal_step_units_t : public grib_accessor_gen_t +{ +public: + /* Members defined in optimal_step_units */ + const char* forecast_time_value; + const char* forecast_time_unit; + const char* time_range_value; + const char* time_range_unit; +}; + +class grib_accessor_class_optimal_step_units_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_optimal_step_units_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_optimal_step_units_t{}; } + int get_native_type(grib_accessor*) override; + int is_missing(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int pack_expression(grib_accessor*, grib_expression*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_optimal_step_units_h */ diff --git a/src/accessor/grib_accessor_class_pack_bufr_values.cc b/src/accessor/grib_accessor_class_pack_bufr_values.cc new file mode 100644 index 000000000..803491932 --- /dev/null +++ b/src/accessor/grib_accessor_class_pack_bufr_values.cc @@ -0,0 +1,69 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_pack_bufr_values.h" + +grib_accessor_class_pack_bufr_values_t _grib_accessor_class_pack_bufr_values{"pack_bufr_values"}; +grib_accessor_class* grib_accessor_class_pack_bufr_values = &_grib_accessor_class_pack_bufr_values; + + +void grib_accessor_class_pack_bufr_values_t::init(grib_accessor* a, const long len, grib_arguments* params){ + char* key; + grib_accessor_pack_bufr_values_t* self = (grib_accessor_pack_bufr_values_t*)a; + key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), params, 0); + self->data_accessor = grib_find_accessor(grib_handle_of_accessor(a), key); + + a->length = 0; +} + +void grib_accessor_class_pack_bufr_values_t::dump(grib_accessor* a, grib_dumper* dumper){ +} + +int grib_accessor_class_pack_bufr_values_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_pack_bufr_values_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_pack_bufr_values_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_pack_bufr_values_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_pack_bufr_values_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +void grib_accessor_class_pack_bufr_values_t::destroy(grib_context* context, grib_accessor* a){ +} + +int grib_accessor_class_pack_bufr_values_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} + +int grib_accessor_class_pack_bufr_values_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_pack_bufr_values_t* self = (grib_accessor_pack_bufr_values_t*)a; + grib_accessor* data = (grib_accessor*)self->data_accessor; + + return data->pack_double(0, 0);} + +int grib_accessor_class_pack_bufr_values_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_pack_bufr_values_t* self = (grib_accessor_pack_bufr_values_t*)a; + grib_accessor* data = (grib_accessor*)self->data_accessor; + + return data->pack_double(0, 0);} diff --git a/src/accessor/grib_accessor_class_pack_bufr_values.h b/src/accessor/grib_accessor_class_pack_bufr_values.h new file mode 100644 index 000000000..b4bdaf43c --- /dev/null +++ b/src/accessor/grib_accessor_class_pack_bufr_values.h @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_pack_bufr_values_h +#define eccodes_accessor_pack_bufr_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_pack_bufr_values_t : public grib_accessor_gen_t +{ +public: + /* Members defined in pack_bufr_values */ + grib_accessor* data_accessor; +}; + +class grib_accessor_class_pack_bufr_values_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_pack_bufr_values_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_pack_bufr_values_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_pack_bufr_values_h */ diff --git a/src/accessor/grib_accessor_class_packing_type.cc b/src/accessor/grib_accessor_class_packing_type.cc new file mode 100644 index 000000000..845400a00 --- /dev/null +++ b/src/accessor/grib_accessor_class_packing_type.cc @@ -0,0 +1,74 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_packing_type.h" + +grib_accessor_class_packing_type_t _grib_accessor_class_packing_type{"packing_type"}; +grib_accessor_class* grib_accessor_class_packing_type = &_grib_accessor_class_packing_type; + + +void grib_accessor_class_packing_type_t::init(grib_accessor* a, const long l, grib_arguments* args){ + int n = 0; + grib_accessor_packing_type_t* self = (grib_accessor_packing_type_t*)a; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->packing_type = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +size_t grib_accessor_class_packing_type_t::string_length(grib_accessor* a){ + return 1024; +} + +int grib_accessor_class_packing_type_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_STRING; +} + +int grib_accessor_class_packing_type_t::pack_string(grib_accessor*a, const char* sval, size_t* len){ + grib_accessor_packing_type_t* self = (grib_accessor_packing_type_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + double* values = NULL; + grib_context* c = a->context; + size_t size = 0; + int err = 0; + + if ((err = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return err; + + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) return GRIB_OUT_OF_MEMORY; + + if ((err = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return err; + } + + if ((err = grib_set_string_internal(h, self->packing_type, sval, len)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return err; + } + + if ((err = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return err; + } + + grib_context_free(c, values); + return GRIB_SUCCESS; +} + +int grib_accessor_class_packing_type_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_packing_type_t* self = (grib_accessor_packing_type_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + + return grib_get_string(h, self->packing_type, val, len); +} diff --git a/src/accessor/grib_accessor_class_packing_type.h b/src/accessor/grib_accessor_class_packing_type.h new file mode 100644 index 000000000..3451db189 --- /dev/null +++ b/src/accessor/grib_accessor_class_packing_type.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_packing_type_h +#define eccodes_accessor_packing_type_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_packing_type_t : public grib_accessor_gen_t +{ +public: + /* Members defined in packing_type */ + const char* values; + const char* packing_type; +}; + +class grib_accessor_class_packing_type_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_packing_type_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_packing_type_t{}; } + int get_native_type(grib_accessor*) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_packing_type_h */ diff --git a/src/accessor/grib_accessor_class_pad.cc b/src/accessor/grib_accessor_class_pad.cc new file mode 100644 index 000000000..10ceda53c --- /dev/null +++ b/src/accessor/grib_accessor_class_pad.cc @@ -0,0 +1,36 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_pad.h" + +grib_accessor_class_pad_t _grib_accessor_class_pad{"pad"}; +grib_accessor_class* grib_accessor_class_pad = &_grib_accessor_class_pad; + + + +size_t grib_accessor_class_pad_t::preferred_size(grib_accessor* a, int from_handle){ + grib_accessor_pad_t* self = (grib_accessor_pad_t*)a; + + long length = 0; + + grib_expression_evaluate_long(grib_handle_of_accessor(a), self->expression, &length); + + return length > 0 ? length : 0; +} + + +void grib_accessor_class_pad_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_pad_t* self = (grib_accessor_pad_t*)a; + + self->expression = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); + a->length = preferred_size(a, 1); +} diff --git a/src/accessor/grib_accessor_class_pad.h b/src/accessor/grib_accessor_class_pad.h new file mode 100644 index 000000000..8ca8bb09b --- /dev/null +++ b/src/accessor/grib_accessor_class_pad.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_pad_h +#define eccodes_accessor_pad_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_padding.h" + +class grib_accessor_pad_t : public grib_accessor_padding_t +{ +public: + /* Members defined in padding */ + /* Members defined in pad */ + grib_expression* expression; +}; + +class grib_accessor_class_pad_t : public grib_accessor_class_padding_t +{ +public: + grib_accessor_class_pad_t(const char* name) : grib_accessor_class_padding_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_pad_t{}; } + void init(grib_accessor*, const long, grib_arguments*) override; + size_t preferred_size(grib_accessor*, int) override; +}; +#endif /* eccodes_accessor_pad_h */ diff --git a/src/accessor/grib_accessor_class_padding.cc b/src/accessor/grib_accessor_class_padding.cc new file mode 100644 index 000000000..5a1699124 --- /dev/null +++ b/src/accessor/grib_accessor_class_padding.cc @@ -0,0 +1,58 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_padding.h" + +grib_accessor_class_padding_t _grib_accessor_class_padding{"padding"}; +grib_accessor_class* grib_accessor_class_padding = &_grib_accessor_class_padding; + + +void grib_accessor_class_padding_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_padding_t::compare(grib_accessor* a, grib_accessor* b){ + if (a->length != b->length) + return GRIB_COUNT_MISMATCH; + return GRIB_SUCCESS; +} + +void grib_accessor_class_padding_t::update_size(grib_accessor* a, size_t new_size){ + a->length = new_size; +} + +void grib_accessor_class_padding_t::resize(grib_accessor* a, size_t new_size){ + void* zero = grib_context_malloc_clear(a->context, new_size); + + grib_buffer_replace(a, (const unsigned char*)zero, new_size, + /*update_lengths=*/1, /*update_paddings=*/0); + grib_context_free(a->context, zero); + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "grib_accessor_class_padding::resize new_size=%zu a->length=%ld %s %s", + new_size, a->length, a->cclass->name, a->name); + Assert(new_size == a->length); +} + +int grib_accessor_class_padding_t::value_count(grib_accessor* a, long* c){ + *c = a->length; + return 0; +} + +long grib_accessor_class_padding_t::byte_count(grib_accessor* a){ + return a->length; +} + +size_t grib_accessor_class_padding_t::string_length(grib_accessor* a){ + return (size_t)a->length; +} diff --git a/src/accessor/grib_accessor_class_padding.h b/src/accessor/grib_accessor_class_padding.h new file mode 100644 index 000000000..65a416c4c --- /dev/null +++ b/src/accessor/grib_accessor_class_padding.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_padding_h +#define eccodes_accessor_padding_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_bytes.h" + +class grib_accessor_padding_t : public grib_accessor_bytes_t +{ +public: + /* Members defined in padding */ +}; + +class grib_accessor_class_padding_t : public grib_accessor_class_bytes_t +{ +public: + grib_accessor_class_padding_t(const char* name) : grib_accessor_class_bytes_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_padding_t{}; } + size_t string_length(grib_accessor*) override; + long byte_count(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + void resize(grib_accessor*,size_t) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_padding_h */ diff --git a/src/accessor/grib_accessor_class_padto.cc b/src/accessor/grib_accessor_class_padto.cc new file mode 100644 index 000000000..79207c8a9 --- /dev/null +++ b/src/accessor/grib_accessor_class_padto.cc @@ -0,0 +1,45 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_padto.h" + +grib_accessor_class_padto_t _grib_accessor_class_padto{"padto"}; +grib_accessor_class* grib_accessor_class_padto = &_grib_accessor_class_padto; + + + +size_t grib_accessor_class_padto_t::preferred_size(grib_accessor* a, int from_handle){ + grib_accessor_padto_t* self = (grib_accessor_padto_t*)a; + + long length = 0; + long theEnd; + + grib_expression_evaluate_long(grib_handle_of_accessor(a), self->expression, &theEnd); + + length = theEnd - a->offset; + + /* printf("preferred_size: prefered: %ld current:%ld %s %s %ld\n", (long)length,(long)a->length,a->cclass->name,a->name,(long)a->offset); */ + + return length > 0 ? length : 0; +} + + +void grib_accessor_class_padto_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_padto_t* self = (grib_accessor_padto_t*)a; + + self->expression = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); + a->length = preferred_size(a, 1); +} + +void grib_accessor_class_padto_t::dump(grib_accessor* a, grib_dumper* dumper){ + /*grib_dump_string(dumper,a,NULL);*/ +} diff --git a/src/accessor/grib_accessor_class_padto.h b/src/accessor/grib_accessor_class_padto.h new file mode 100644 index 000000000..f7203b2cb --- /dev/null +++ b/src/accessor/grib_accessor_class_padto.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_padto_h +#define eccodes_accessor_padto_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_padding.h" + +class grib_accessor_padto_t : public grib_accessor_padding_t +{ +public: + /* Members defined in padto */ + grib_expression* expression; +}; + +class grib_accessor_class_padto_t : public grib_accessor_class_padding_t +{ +public: + grib_accessor_class_padto_t(const char* name) : grib_accessor_class_padding_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_padto_t{}; } + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + size_t preferred_size(grib_accessor*, int) override; +}; +#endif /* eccodes_accessor_padto_h */ diff --git a/src/accessor/grib_accessor_class_padtoeven.cc b/src/accessor/grib_accessor_class_padtoeven.cc new file mode 100644 index 000000000..5d3dfba45 --- /dev/null +++ b/src/accessor/grib_accessor_class_padtoeven.cc @@ -0,0 +1,48 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_padtoeven.h" + +grib_accessor_class_padtoeven_t _grib_accessor_class_padtoeven{"padtoeven"}; +grib_accessor_class* grib_accessor_class_padtoeven = &_grib_accessor_class_padtoeven; + + +size_t grib_accessor_class_padtoeven_t::preferred_size(grib_accessor* a, int from_handle){ + grib_accessor_padtoeven_t* self = (grib_accessor_padtoeven_t*)a; + long offset = 0; + long length = 0; + long seclen; + + grib_get_long_internal(grib_handle_of_accessor(a), self->section_offset, &offset); + grib_get_long_internal(grib_handle_of_accessor(a), self->section_length, &length); + + if ((length % 2) && from_handle) { + // grib_context_log(a->context, + // GRIB_LOG_ERROR,"GRIB message has an odd length section (%ld, %s)", + // (long)length,a->name); + return 0; + } + + /* printf("EVEN %ld %ld\n",(long) a->offset,(long) offset);*/ + seclen = a->offset - offset; + + return (seclen % 2) ? 1 : 0; +} + +void grib_accessor_class_padtoeven_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_padtoeven_t* self = (grib_accessor_padtoeven_t*)a; + + self->section_offset = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); + self->section_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 1); + + a->length = preferred_size(a, 1); +} diff --git a/src/accessor/grib_accessor_class_padtoeven.h b/src/accessor/grib_accessor_class_padtoeven.h new file mode 100644 index 000000000..08f8fc072 --- /dev/null +++ b/src/accessor/grib_accessor_class_padtoeven.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_padtoeven_h +#define eccodes_accessor_padtoeven_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_padding.h" + +class grib_accessor_padtoeven_t : public grib_accessor_padding_t +{ +public: + /* Members defined in padtoeven */ + const char* section_offset; + const char* section_length; +}; + +class grib_accessor_class_padtoeven_t : public grib_accessor_class_padding_t +{ +public: + grib_accessor_class_padtoeven_t(const char* name) : grib_accessor_class_padding_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_padtoeven_t{}; } + void init(grib_accessor*, const long, grib_arguments*) override; + size_t preferred_size(grib_accessor*, int) override; +}; +#endif /* eccodes_accessor_padtoeven_h */ diff --git a/src/accessor/grib_accessor_class_padtomultiple.cc b/src/accessor/grib_accessor_class_padtomultiple.cc new file mode 100644 index 000000000..3f92f8409 --- /dev/null +++ b/src/accessor/grib_accessor_class_padtomultiple.cc @@ -0,0 +1,40 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_padtomultiple.h" + +grib_accessor_class_padtomultiple_t _grib_accessor_class_padtomultiple{"padtomultiple"}; +grib_accessor_class* grib_accessor_class_padtomultiple = &_grib_accessor_class_padtomultiple; + + +size_t grib_accessor_class_padtomultiple_t::preferred_size(grib_accessor* a, int from_handle){ + grib_accessor_padtomultiple_t* self = (grib_accessor_padtomultiple_t*)a; + long padding = 0; + long begin = 0; + long multiple = 0; + + grib_expression_evaluate_long(grib_handle_of_accessor(a), self->begin, &begin); + grib_expression_evaluate_long(grib_handle_of_accessor(a), self->multiple, &multiple); + + padding = a->offset - begin; + padding = ((padding + multiple - 1) / multiple) * multiple - padding; + + return padding == 0 ? multiple : padding; +} + +void grib_accessor_class_padtomultiple_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_padtomultiple_t* self = (grib_accessor_padtomultiple_t*)a; + + self->begin = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); + self->multiple = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 1); + a->length = preferred_size(a, 1); +} diff --git a/src/accessor/grib_accessor_class_padtomultiple.h b/src/accessor/grib_accessor_class_padtomultiple.h new file mode 100644 index 000000000..f57afad37 --- /dev/null +++ b/src/accessor/grib_accessor_class_padtomultiple.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_padtomultiple_h +#define eccodes_accessor_padtomultiple_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_padding.h" + +class grib_accessor_padtomultiple_t : public grib_accessor_padding_t +{ +public: + /* Members defined in padtomultiple */ + grib_expression* begin; + grib_expression* multiple; +}; + +class grib_accessor_class_padtomultiple_t : public grib_accessor_class_padding_t +{ +public: + grib_accessor_class_padtomultiple_t(const char* name) : grib_accessor_class_padding_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_padtomultiple_t{}; } + void init(grib_accessor*, const long, grib_arguments*) override; + size_t preferred_size(grib_accessor*, int) override; +}; +#endif /* eccodes_accessor_padtomultiple_h */ diff --git a/src/accessor/grib_accessor_class_position.cc b/src/accessor/grib_accessor_class_position.cc new file mode 100644 index 000000000..fb00740f3 --- /dev/null +++ b/src/accessor/grib_accessor_class_position.cc @@ -0,0 +1,50 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_position.h" + +grib_accessor_class_position_t _grib_accessor_class_position{"position"}; +grib_accessor_class* grib_accessor_class_position = &_grib_accessor_class_position; + + +void grib_accessor_class_position_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; +} + +int grib_accessor_class_position_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} + +void grib_accessor_class_position_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_long(dumper, a, NULL); +} + +int grib_accessor_class_position_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + *val = a->offset; + *len = 1; + return GRIB_SUCCESS; +} + +// static int compare(grib_accessor* a, grib_accessor* b) +// { +// if (a->offset != b->offset) +// return GRIB_OFFSET_MISMATCH; +// return GRIB_SUCCESS; +// } diff --git a/src/accessor/grib_accessor_class_position.h b/src/accessor/grib_accessor_class_position.h new file mode 100644 index 000000000..40d690694 --- /dev/null +++ b/src/accessor/grib_accessor_class_position.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_position_h +#define eccodes_accessor_position_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_position_t : public grib_accessor_gen_t +{ +public: + /* Members defined in position */ +}; + +class grib_accessor_class_position_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_position_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_position_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_position_h */ diff --git a/src/accessor/todo/grib_accessor_class_proj_string.cc b/src/accessor/grib_accessor_class_proj_string.cc similarity index 67% rename from src/accessor/todo/grib_accessor_class_proj_string.cc rename to src/accessor/grib_accessor_class_proj_string.cc index 7edfbf5be..ab03465fb 100644 --- a/src/accessor/todo/grib_accessor_class_proj_string.cc +++ b/src/accessor/grib_accessor_class_proj_string.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,101 +10,14 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = get_native_type;init - IMPLEMENTS = unpack_string - MEMBERS = const char* grid_type - MEMBERS = int endpoint - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_string(grib_accessor*, char*, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_proj_string -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in proj_string */ - const char* grid_type; - int endpoint; -} grib_accessor_proj_string; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_proj_string = { - &grib_accessor_class_gen, /* super */ - "proj_string", /* name */ - sizeof(grib_accessor_proj_string), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_proj_string.h" +grib_accessor_class_proj_string_t _grib_accessor_class_proj_string{"proj_string"}; grib_accessor_class* grib_accessor_class_proj_string = &_grib_accessor_class_proj_string; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_proj_string* self = (grib_accessor_proj_string*)a; +void grib_accessor_class_proj_string_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_proj_string_t* self = (grib_accessor_proj_string_t*)a; grib_handle* h = grib_handle_of_accessor(a); self->grid_type = grib_arguments_get_name(h, arg, 0); @@ -113,8 +27,7 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg) a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_proj_string_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_STRING; } @@ -128,8 +41,7 @@ struct proj_mapping typedef struct proj_mapping proj_mapping; // 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 get_major_minor_axes(grib_handle* h, double* pMajor, double* pMinor){ int err = 0; if (grib_is_earth_oblate(h)) { if ((err = grib_get_double_internal(h, "earthMinorAxisInMetres", pMinor)) != GRIB_SUCCESS) return err; @@ -144,8 +56,7 @@ static int get_major_minor_axes(grib_handle* h, double* pMajor, double* pMinor) } // Caller must have allocated enough space in the 'result' argument -static int get_earth_shape(grib_handle* h, char* result) -{ +int get_earth_shape(grib_handle* h, char* result){ int err = 0; double major = 0, minor = 0; if ((err = get_major_minor_axes(h, &major, &minor)) != GRIB_SUCCESS) @@ -157,8 +68,7 @@ static int get_earth_shape(grib_handle* h, char* result) return err; } -static int proj_space_view(grib_handle* h, char* result) -{ +int proj_space_view(grib_handle* h, char* result){ return GRIB_NOT_IMPLEMENTED; // int err = 0; // char shape[128] = {0,}; @@ -174,21 +84,17 @@ static int proj_space_view(grib_handle* h, char* result) // return err; } -static int proj_albers(grib_handle* h, char* result) -{ +int proj_albers(grib_handle* h, char* result){ return GRIB_NOT_IMPLEMENTED; } -static int proj_transverse_mercator(grib_handle* h, char* result) -{ +int proj_transverse_mercator(grib_handle* h, char* result){ return GRIB_NOT_IMPLEMENTED; } -static int proj_equatorial_azimuthal_equidistant(grib_handle* h, char* result) -{ +int proj_equatorial_azimuthal_equidistant(grib_handle* h, char* result){ return GRIB_NOT_IMPLEMENTED; } -static int proj_lambert_conformal(grib_handle* h, char* result) -{ +int proj_lambert_conformal(grib_handle* h, char* result){ int err = 0; char shape[128] = {0,}; double LoVInDegrees = 0, LaDInDegrees = 0, Latin1InDegrees = 0, Latin2InDegrees = 0; @@ -208,8 +114,7 @@ static int proj_lambert_conformal(grib_handle* h, char* result) return err; } -static int proj_lambert_azimuthal_equal_area(grib_handle* h, char* result) -{ +int proj_lambert_azimuthal_equal_area(grib_handle* h, char* result){ int err = 0; char shape[128] = {0,}; double standardParallel = 0, centralLongitude = 0; @@ -225,8 +130,7 @@ static int proj_lambert_azimuthal_equal_area(grib_handle* h, char* result) return err; } -static int proj_polar_stereographic(grib_handle* h, char* result) -{ +int proj_polar_stereographic(grib_handle* h, char* result){ int err = 0; double centralLongitude = 0, centralLatitude = 0; int has_northPole = 0; @@ -249,8 +153,7 @@ static int proj_polar_stereographic(grib_handle* h, char* result) // ECC-1552: This is for regular_ll, regular_gg, reduced_ll, reduced_gg // These are not 'projected' grids! -static int proj_unprojected(grib_handle* h, char* result) -{ +int proj_unprojected(grib_handle* h, char* result){ int err = 0; //char shape[128] = {0,}; //if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) return err; @@ -260,8 +163,7 @@ static int proj_unprojected(grib_handle* h, char* result) return err; } -static int proj_mercator(grib_handle* h, char* result) -{ +int proj_mercator(grib_handle* h, char* result){ int err = 0; double LaDInDegrees = 0; char shape[128] = {0,}; @@ -293,9 +195,8 @@ static proj_mapping proj_mappings[] = { #define ENDPOINT_SOURCE 0 #define ENDPOINT_TARGET 1 -static int unpack_string(grib_accessor* a, char* v, size_t* len) -{ - grib_accessor_proj_string* self = (grib_accessor_proj_string*)a; +int grib_accessor_class_proj_string_t::unpack_string(grib_accessor* a, char* v, size_t* len){ + grib_accessor_proj_string_t* self = (grib_accessor_proj_string_t*)a; int err = 0, found = 0; size_t i = 0; char grid_type[64] = {0,}; diff --git a/src/accessor/grib_accessor_class_proj_string.h b/src/accessor/grib_accessor_class_proj_string.h new file mode 100644 index 000000000..c49c0f868 --- /dev/null +++ b/src/accessor/grib_accessor_class_proj_string.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_proj_string_h +#define eccodes_accessor_proj_string_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_proj_string_t : public grib_accessor_gen_t +{ +public: + /* Members defined in proj_string */ + const char* grid_type; + int endpoint; +}; + +class grib_accessor_class_proj_string_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_proj_string_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_proj_string_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_proj_string_h */ diff --git a/src/accessor/grib_accessor_class_raw.cc b/src/accessor/grib_accessor_class_raw.cc new file mode 100644 index 000000000..310d887e3 --- /dev/null +++ b/src/accessor/grib_accessor_class_raw.cc @@ -0,0 +1,117 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_raw.h" + +grib_accessor_class_raw_t _grib_accessor_class_raw{"raw"}; +grib_accessor_class* grib_accessor_class_raw = &_grib_accessor_class_raw; + + +void grib_accessor_class_raw_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + int n = 0; + int err = 0; + long sectionLength; + grib_accessor_raw_t* self = (grib_accessor_raw_t*)a; + grib_expression* e; + grib_handle* hand = grib_handle_of_accessor(a); + + a->length = 0; + self->totalLength = grib_arguments_get_name(hand, arg, n++); + self->sectionLength = grib_arguments_get_name(hand, arg, n++); + + e = grib_arguments_get_expression(hand, arg, n++); + err = grib_expression_evaluate_long(hand, e, &(self->relativeOffset)); + if (err) + grib_context_log(hand->context, GRIB_LOG_ERROR, "Unable to evaluate relativeOffset"); + + grib_get_long(hand, self->sectionLength, §ionLength); + + a->length = sectionLength - self->relativeOffset; + if (a->length < 0) + a->length = 0; + + /* Assert(a->length>=0); */ +} + +int grib_accessor_class_raw_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_BYTES; +} + + +int grib_accessor_class_raw_t::compare(grib_accessor* a, grib_accessor* b){ + int retval = GRIB_SUCCESS; + + size_t alen = (size_t)a->byte_count(); size_t blen = (size_t)b->byte_count(); + if (alen != blen) + return GRIB_COUNT_MISMATCH; + + return retval; +} + +long grib_accessor_class_raw_t::byte_count(grib_accessor* a){ + return a->length; +} + +int grib_accessor_class_raw_t::value_count(grib_accessor* a, long* len){ + *len = a->length; + return 0; +} + +int grib_accessor_class_raw_t::unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len){ + if (*len < a->length) { + *len = a->length; + return GRIB_ARRAY_TOO_SMALL; + } + *len = a->length; + + memcpy(buffer, grib_handle_of_accessor(a)->buffer->data + a->offset, *len); + + return GRIB_SUCCESS; +} + +void grib_accessor_class_raw_t::update_size(grib_accessor* a, size_t s){ + grib_context_log(a->context, GRIB_LOG_DEBUG, "updating size of %s old %ld new %ld", a->name, a->length, s); + a->length = s; + Assert(a->length >= 0); +} + +void accessor_raw_set_length(grib_accessor* a, size_t len) +{ + a->length = len; +} + +long accessor_raw_get_offset(grib_accessor* a) +{ + return a->offset; +} + +int grib_accessor_class_raw_t::pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len){ + size_t length = *len; + long totalLength; + long sectionLength; + grib_handle* h = grib_handle_of_accessor(a); + grib_accessor_raw_t* self = (grib_accessor_raw_t*)a; + long dlen = length - a->length; + + grib_get_long(h, self->totalLength, &totalLength); + totalLength += dlen; + grib_get_long(h, self->sectionLength, §ionLength); + sectionLength += dlen; + + grib_buffer_replace(a, val, length, 1, 1); + + grib_set_long(h, self->totalLength, totalLength); + grib_set_long(h, self->sectionLength, sectionLength); + a->length = length; + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_raw.h b/src/accessor/grib_accessor_class_raw.h new file mode 100644 index 000000000..30a2603e7 --- /dev/null +++ b/src/accessor/grib_accessor_class_raw.h @@ -0,0 +1,41 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_raw_h +#define eccodes_accessor_raw_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_raw_t : public grib_accessor_gen_t +{ +public: + /* Members defined in raw */ + const char* totalLength; + const char* sectionLength; + long relativeOffset; +}; + +class grib_accessor_class_raw_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_raw_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_raw_t{}; } + int get_native_type(grib_accessor*) override; + int pack_bytes(grib_accessor*, const unsigned char*, size_t* len) override; + int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; + long byte_count(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_raw_h */ diff --git a/src/accessor/grib_accessor_class_rdbtime_guess_date.cc b/src/accessor/grib_accessor_class_rdbtime_guess_date.cc new file mode 100644 index 000000000..346288ad2 --- /dev/null +++ b/src/accessor/grib_accessor_class_rdbtime_guess_date.cc @@ -0,0 +1,76 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_rdbtime_guess_date.h" + +grib_accessor_class_rdbtime_guess_date_t _grib_accessor_class_rdbtime_guess_date{"rdbtime_guess_date"}; +grib_accessor_class* grib_accessor_class_rdbtime_guess_date = &_grib_accessor_class_rdbtime_guess_date; + + +void grib_accessor_class_rdbtime_guess_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_rdbtime_guess_date_t* self = (grib_accessor_rdbtime_guess_date_t*)a; + int n = 0; + + self->typicalYear = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->typicalMonth = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->typicalDay = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->rdbDay = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->yearOrMonth = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); + + /* a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; */ +} + +int grib_accessor_class_rdbtime_guess_date_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_rdbtime_guess_date_t* self = (grib_accessor_rdbtime_guess_date_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + int ret = 0; + long typicalYear, typicalMonth, typicalDay, rdbDay; + long rdbYear, rdbMonth; + + ret = grib_get_long(h, self->typicalYear, &typicalYear); + if (ret) + return ret; + ret = grib_get_long(h, self->typicalMonth, &typicalMonth); + if (ret) + return ret; + ret = grib_get_long(h, self->typicalDay, &typicalDay); + if (ret) + return ret; + ret = grib_get_long(h, self->rdbDay, &rdbDay); + if (ret) + return ret; + + if (rdbDay < typicalDay) { + if (typicalDay == 31 && typicalMonth == 12) { + rdbYear = typicalYear + 1; + rdbMonth = 1; + } + else { + rdbYear = typicalYear; + rdbMonth = typicalMonth + 1; + } + } + else { + rdbYear = typicalYear; + rdbMonth = typicalMonth; + } + + *val = self->yearOrMonth == 1 ? rdbYear : rdbMonth; + *len = 1; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_rdbtime_guess_date_t::pack_long(grib_accessor* a, const long* v, size_t* len){ + /* do nothing*/ + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_rdbtime_guess_date.h b/src/accessor/grib_accessor_class_rdbtime_guess_date.h new file mode 100644 index 000000000..e9ef0b4d3 --- /dev/null +++ b/src/accessor/grib_accessor_class_rdbtime_guess_date.h @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_rdbtime_guess_date_h +#define eccodes_accessor_rdbtime_guess_date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_rdbtime_guess_date_t : public grib_accessor_long_t +{ +public: + /* Members defined in rdbtime_guess_date */ + const char* typicalYear; + const char* typicalMonth; + const char* typicalDay; + const char* rdbDay; + long yearOrMonth; +}; + +class grib_accessor_class_rdbtime_guess_date_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_rdbtime_guess_date_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_rdbtime_guess_date_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_rdbtime_guess_date_h */ diff --git a/src/accessor/grib_accessor_class_reference_value_error.cc b/src/accessor/grib_accessor_class_reference_value_error.cc new file mode 100644 index 000000000..8d4f3a1cc --- /dev/null +++ b/src/accessor/grib_accessor_class_reference_value_error.cc @@ -0,0 +1,50 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_reference_value_error.h" + +grib_accessor_class_reference_value_error_t _grib_accessor_class_reference_value_error{"reference_value_error"}; +grib_accessor_class* grib_accessor_class_reference_value_error = &_grib_accessor_class_reference_value_error; + + +void grib_accessor_class_reference_value_error_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_reference_value_error_t* self = (grib_accessor_reference_value_error_t*)a; + int n = 0; + + self->referenceValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->floatType = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; +} + +int grib_accessor_class_reference_value_error_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_reference_value_error_t* self = (grib_accessor_reference_value_error_t*)a; + int ret = 0; + double referenceValue = 0; + + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), + self->referenceValue, &referenceValue)) != GRIB_SUCCESS) + return ret; + + if (!strcmp(self->floatType, "ibm")) + *val = grib_ibmfloat_error(referenceValue); + else if (!strcmp(self->floatType, "ieee")) + *val = grib_ieeefloat_error(referenceValue); + else + Assert(1 == 0); + + if (ret == GRIB_SUCCESS) + *len = 1; + + return ret; +} diff --git a/src/accessor/grib_accessor_class_reference_value_error.h b/src/accessor/grib_accessor_class_reference_value_error.h new file mode 100644 index 000000000..e0b948e97 --- /dev/null +++ b/src/accessor/grib_accessor_class_reference_value_error.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_reference_value_error_h +#define eccodes_accessor_reference_value_error_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_reference_value_error_t : public grib_accessor_double_t +{ +public: + /* Members defined in reference_value_error */ + const char* referenceValue; + const char* floatType; +}; + +class grib_accessor_class_reference_value_error_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_reference_value_error_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_reference_value_error_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_reference_value_error_h */ diff --git a/src/accessor/grib_accessor_class_round.cc b/src/accessor/grib_accessor_class_round.cc new file mode 100644 index 000000000..b1a114d0e --- /dev/null +++ b/src/accessor/grib_accessor_class_round.cc @@ -0,0 +1,69 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_round.h" + +grib_accessor_class_round_t _grib_accessor_class_round{"round"}; +grib_accessor_class* grib_accessor_class_round = &_grib_accessor_class_round; + + +int grib_accessor_class_round_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_round_t* self = (grib_accessor_round_t*)a; + + int ret = GRIB_SUCCESS; + + size_t replen = 0; + double rounding_precision = 0; + double rounded = 0; + double toround = 0; + + const char* oval = NULL; + oval = grib_arguments_get_name(grib_handle_of_accessor(a), self->arg, 0); + + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), oval, &toround)) != 0) + return ret; + + rounding_precision = grib_arguments_get_long(grib_handle_of_accessor(a), self->arg, 1); + + rounded = floor(rounding_precision * toround + 0.5) / rounding_precision; + + *len = replen; + + *val = rounded; + + return ret; +} + +int grib_accessor_class_round_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + char result[1024]; + int ret = GRIB_SUCCESS; + size_t replen = 1; + + double value = 0; + + ret = unpack_double(a, &value, &replen); + + snprintf(result, sizeof(result), "%.3f", value); + + replen = strlen(result) + 1; + + if (*len < replen) { + *len = replen; + return GRIB_ARRAY_TOO_SMALL; + } + + *len = replen; + + snprintf(val, 1024, "%s", result); + + return ret; +} diff --git a/src/accessor/grib_accessor_class_round.h b/src/accessor/grib_accessor_class_round.h new file mode 100644 index 000000000..c38d7b6e8 --- /dev/null +++ b/src/accessor/grib_accessor_class_round.h @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_round_h +#define eccodes_accessor_round_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_evaluate.h" + +class grib_accessor_round_t : public grib_accessor_evaluate_t +{ +public: + /* Members defined in round */ +}; + +class grib_accessor_class_round_t : public grib_accessor_class_evaluate_t +{ +public: + grib_accessor_class_round_t(const char* name) : grib_accessor_class_evaluate_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_round_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; +}; +#endif /* eccodes_accessor_round_h */ diff --git a/src/accessor/grib_accessor_class_scale.cc b/src/accessor/grib_accessor_class_scale.cc new file mode 100644 index 000000000..a90f31862 --- /dev/null +++ b/src/accessor/grib_accessor_class_scale.cc @@ -0,0 +1,134 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_scale.h" + +grib_accessor_class_scale_t _grib_accessor_class_scale{"scale"}; +grib_accessor_class* grib_accessor_class_scale = &_grib_accessor_class_scale; + + +void grib_accessor_class_scale_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_scale_t* self = (grib_accessor_scale_t*)a; + int n = 0; + + self->value = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->multiplier = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->divisor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->truncating = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); +} + +int grib_accessor_class_scale_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_scale_t* self = (grib_accessor_scale_t*)a; + int ret = 0; + long value = 0; + long multiplier = 0; + long divisor = 0; + + if (*len < 1) { + ret = GRIB_ARRAY_TOO_SMALL; + grib_context_log(a->context, GRIB_LOG_ERROR, + "Accessor %s cannot gather value for %s and/or %s", + a->name, self->multiplier, self->divisor); + return ret; + } + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier, &multiplier)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->value, &value)) != GRIB_SUCCESS) + return ret; + + if (value == GRIB_MISSING_LONG) + *val = GRIB_MISSING_DOUBLE; + else + *val = ((double)(value * multiplier)) / divisor; + + if (ret == GRIB_SUCCESS) + *len = 1; + + return ret; +} + +int grib_accessor_class_scale_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + const double dval = (double)*val; + return pack_double(a, &dval, len); +} + +int grib_accessor_class_scale_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_scale_t* self = (grib_accessor_scale_t*)a; + int ret = 0; + + long value = 0; + long divisor = 0; + long multiplier = 0; + long truncating = 0; + double x; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor); + if (ret != GRIB_SUCCESS) return ret; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier, &multiplier); + if (ret != GRIB_SUCCESS) return ret; + + if (self->truncating) { + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->truncating, &truncating); + if (ret != GRIB_SUCCESS) return ret; + } + + if (multiplier == 0) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s: cannot divide by a zero multiplier %s", + a->name, self->multiplier); + return GRIB_ENCODING_ERROR; + } + + x = *val * (double)divisor / (double)multiplier; + if (*val == GRIB_MISSING_DOUBLE) + value = GRIB_MISSING_LONG; + else if (truncating) { + value = (long)x; + } + else { + value = x > 0 ? (long)(x + 0.5) : (long)(x - 0.5); + } + + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value, value); + if (ret) + grib_context_log(a->context, GRIB_LOG_ERROR, + "Accessor %s: cannot pack value for %s (%s)\n", + a->name, self->value, grib_get_error_message(ret)); + + if (ret == GRIB_SUCCESS) + *len = 1; + + return ret; +} + +int grib_accessor_class_scale_t::is_missing(grib_accessor* a){ + grib_accessor_scale_t* self = (grib_accessor_scale_t*)a; + grib_accessor* av = grib_find_accessor(grib_handle_of_accessor(a), self->value); + + if (!av) + return GRIB_NOT_FOUND; + return av->is_missing_internal(); + // int ret=0; + // long value=0; + // if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->value, &value))!= GRIB_SUCCESS){ + // grib_context_log(a->context, GRIB_LOG_ERROR, + // "Accessor %s cannot gather value for %s error %d \n", a->name, + // self->value, ret); + // return 0; + // } + // return (value == GRIB_MISSING_LONG); +} diff --git a/src/accessor/grib_accessor_class_scale.h b/src/accessor/grib_accessor_class_scale.h new file mode 100644 index 000000000..7e1f0d80d --- /dev/null +++ b/src/accessor/grib_accessor_class_scale.h @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_scale_h +#define eccodes_accessor_scale_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_scale_t : public grib_accessor_double_t +{ +public: + /* Members defined in scale */ + const char* value; + const char* multiplier; + const char* divisor; + const char* truncating; +}; + +class grib_accessor_class_scale_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_scale_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_scale_t{}; } + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_scale_h */ diff --git a/src/accessor/grib_accessor_class_scale_values.cc b/src/accessor/grib_accessor_class_scale_values.cc new file mode 100644 index 000000000..0496bd1e4 --- /dev/null +++ b/src/accessor/grib_accessor_class_scale_values.cc @@ -0,0 +1,85 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_scale_values.h" + +grib_accessor_class_scale_values_t _grib_accessor_class_scale_values{"scale_values"}; +grib_accessor_class* grib_accessor_class_scale_values = &_grib_accessor_class_scale_values; + + +void grib_accessor_class_scale_values_t::init(grib_accessor* a, const long l, grib_arguments* args){ + int n = 0; + grib_accessor_scale_values_t* self = (grib_accessor_scale_values_t*)a; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->missingValue = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +int grib_accessor_class_scale_values_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + int ret = 0; + *val = 1; + *len = 1; + return ret; +} + +int grib_accessor_class_scale_values_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + double* values = NULL; + double missingValue = 0; + long missingValuesPresent = 0; + size_t size = 0; + int ret = 0, i = 0; + grib_accessor_scale_values_t* self = (grib_accessor_scale_values_t*)a; + const grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if (*val == 1) + return GRIB_SUCCESS; + + if ((ret = grib_get_double_internal(h, self->missingValue, &missingValue)) != GRIB_SUCCESS) { + return ret; + } + if ((ret = grib_get_long_internal(h, "missingValuesPresent", &missingValuesPresent)) != GRIB_SUCCESS) { + return ret; + } + + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; + + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; + + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return ret; + } + + for (i = 0; i < size; i++) { + if (missingValuesPresent) { + if (values[i] != missingValue) + values[i] *= *val; + } + else { + values[i] *= *val; + } + } + + if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return ret; + } + + grib_context_free(c, values); + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_scale_values.h b/src/accessor/grib_accessor_class_scale_values.h new file mode 100644 index 000000000..cb94e16b8 --- /dev/null +++ b/src/accessor/grib_accessor_class_scale_values.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_scale_values_h +#define eccodes_accessor_scale_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_scale_values_t : public grib_accessor_double_t +{ +public: + /* Members defined in scale_values */ + const char* values; + const char* missingValue; +}; + +class grib_accessor_class_scale_values_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_scale_values_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_scale_values_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_scale_values_h */ diff --git a/src/accessor/todo/grib_accessor_class_second_order_bits_per_value.cc b/src/accessor/grib_accessor_class_second_order_bits_per_value.cc similarity index 51% rename from src/accessor/todo/grib_accessor_class_second_order_bits_per_value.cc rename to src/accessor/grib_accessor_class_second_order_bits_per_value.cc index 74c4b4c05..a42496716 100644 --- a/src/accessor/todo/grib_accessor_class_second_order_bits_per_value.cc +++ b/src/accessor/grib_accessor_class_second_order_bits_per_value.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,108 +9,13 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/********************************** - * Enrico Fucile - **********************************/ - -#include "grib_scaling.h" #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = pack_long - IMPLEMENTS = init - MEMBERS = const char* values - MEMBERS = const char* binaryScaleFactor - MEMBERS = const char* decimalScaleFactor - MEMBERS = long bitsPerValue - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_second_order_bits_per_value -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in second_order_bits_per_value */ - const char* values; - const char* binaryScaleFactor; - const char* decimalScaleFactor; - long bitsPerValue; -} grib_accessor_second_order_bits_per_value; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_second_order_bits_per_value = { - &grib_accessor_class_long, /* super */ - "second_order_bits_per_value", /* name */ - sizeof(grib_accessor_second_order_bits_per_value), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_second_order_bits_per_value.h" +#include "grib_scaling.h" +grib_accessor_class_second_order_bits_per_value_t _grib_accessor_class_second_order_bits_per_value{"second_order_bits_per_value"}; grib_accessor_class* grib_accessor_class_second_order_bits_per_value = &_grib_accessor_class_second_order_bits_per_value; -/* END_CLASS_IMP */ static const size_t nbits[64] = { 0x1, 0x2, 0x4, 0x8, @@ -130,8 +36,7 @@ static const size_t nbits[64] = { 0x1000000000000000, 0x2000000000000000, 0x4000000000000000, 0x8000000000000000 }; -static int number_of_bits(size_t x, long* result) -{ +int number_of_bits(size_t x, long* result){ const size_t* n = nbits; const int count = sizeof(nbits) / sizeof(nbits[0]); *result = 0; @@ -145,10 +50,9 @@ static int number_of_bits(size_t x, long* result) return GRIB_SUCCESS; } -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ +void grib_accessor_class_second_order_bits_per_value_t::init(grib_accessor* a, const long l, grib_arguments* c){ int n = 0; - grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a; + grib_accessor_second_order_bits_per_value_t* self = (grib_accessor_second_order_bits_per_value_t*)a; self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); self->binaryScaleFactor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); self->decimalScaleFactor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); @@ -157,17 +61,15 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->length = 0; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a; +int grib_accessor_class_second_order_bits_per_value_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_second_order_bits_per_value_t* self = (grib_accessor_second_order_bits_per_value_t*)a; self->bitsPerValue = (long)*val; *len = 1; return 0; } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ +int grib_accessor_class_second_order_bits_per_value_t::unpack_long(grib_accessor* a, long* val, size_t* len){ int ret = GRIB_SUCCESS; size_t size = 0; size_t i; @@ -175,7 +77,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) double* values = 0; long binaryScaleFactor, decimalScaleFactor; - grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a; + grib_accessor_second_order_bits_per_value_t* self = (grib_accessor_second_order_bits_per_value_t*)a; if (self->bitsPerValue) { *val = self->bitsPerValue; return GRIB_SUCCESS; diff --git a/src/accessor/grib_accessor_class_second_order_bits_per_value.h b/src/accessor/grib_accessor_class_second_order_bits_per_value.h new file mode 100644 index 000000000..370b364dd --- /dev/null +++ b/src/accessor/grib_accessor_class_second_order_bits_per_value.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_second_order_bits_per_value_h +#define eccodes_accessor_second_order_bits_per_value_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_second_order_bits_per_value_t : public grib_accessor_long_t +{ +public: + /* Members defined in second_order_bits_per_value */ + const char* values; + const char* binaryScaleFactor; + const char* decimalScaleFactor; + long bitsPerValue; +}; + +class grib_accessor_class_second_order_bits_per_value_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_second_order_bits_per_value_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_second_order_bits_per_value_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_second_order_bits_per_value_h */ diff --git a/src/accessor/grib_accessor_class_section.cc b/src/accessor/grib_accessor_class_section.cc new file mode 100644 index 000000000..b6222a551 --- /dev/null +++ b/src/accessor/grib_accessor_class_section.cc @@ -0,0 +1,95 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_section.h" + +grib_accessor_class_section_t _grib_accessor_class_section{"section"}; +grib_accessor_class* grib_accessor_class_section = &_grib_accessor_class_section; + + +void grib_accessor_class_section_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + a->sub_section = grib_section_create(grib_handle_of_accessor(a), a); + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +void grib_accessor_class_section_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_section(dumper, a, a->sub_section->block); +} + +long grib_accessor_class_section_t::byte_count(grib_accessor* a){ + if (!a->length || grib_handle_of_accessor(a)->loader) { + if (a->name[1] == '_') + return 0; + + /* printf("adjusting sizes SECTION %s is %ld %ld\n",a->name,(long)a->offset,(long)a->length); */ + grib_section_adjust_sizes(a->sub_section, grib_handle_of_accessor(a)->loader != NULL, 0); + /* printf(" SECTION %s is %ld %ld\n",a->name,(long)a->offset,(long)a->length); */ + } + + /* printf("SECTION %s is %ld %d\n",a->name,a->length,a->sub_section->aclength != NULL); */ + return a->length; +} + +long grib_accessor_class_section_t::next_offset(grib_accessor* a){ + return a->offset + byte_count(a); +} + +void grib_accessor_class_section_t::destroy(grib_context* ct, grib_accessor* a){ + grib_section_delete(ct, a->sub_section); +} + +int grib_accessor_class_section_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_SECTION; +} + +static grib_section* sub_section(grib_accessor* a) +{ + return a->sub_section; +} + +void grib_accessor_class_section_t::update_size(grib_accessor* a, size_t length){ + size_t size = 1; + long len = length; + Assert(length <= 0x7fffffff); + if (a->sub_section->aclength) { + int e = a->sub_section->aclength->pack_long(&len, &size); Assert(e == GRIB_SUCCESS); + // printf("update_length %s %ld %ld\n", a->sub_section->aclength->name, + // (long)a->sub_section->aclength->offset, + // (long)a->sub_section->aclength->length); + } + + a->sub_section->length = a->length = length; + a->sub_section->padding = 0; + + // printf("update_size %s %ld\n", a->name, a->length); + + Assert(a->length >= 0); +} + +static grib_accessor* next(grib_accessor* a, int explore) +{ + grib_accessor* next = NULL; + if (explore) { + next = a->sub_section->block->first; + if (!next) + next = a->next; + } + else { + next = a->next; + } + if (!next) { + if (a->parent->owner) + next = a->parent->owner->cclass->next(a->parent->owner, 0); + } + return next; +} diff --git a/src/accessor/grib_accessor_class_section.h b/src/accessor/grib_accessor_class_section.h new file mode 100644 index 000000000..b755b8b27 --- /dev/null +++ b/src/accessor/grib_accessor_class_section.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_section_h +#define eccodes_accessor_section_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_section_t : public grib_accessor_gen_t +{ +public: + /* Members defined in section */ +}; + +class grib_accessor_class_section_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_section_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_section_t{}; } + int get_native_type(grib_accessor*) override; + long byte_count(grib_accessor*) override; + long next_offset(grib_accessor*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; +}; +#endif /* eccodes_accessor_section_h */ diff --git a/src/accessor/grib_accessor_class_section_length.cc b/src/accessor/grib_accessor_class_section_length.cc new file mode 100644 index 000000000..4d78f5f19 --- /dev/null +++ b/src/accessor/grib_accessor_class_section_length.cc @@ -0,0 +1,34 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_section_length.h" + +grib_accessor_class_section_length_t _grib_accessor_class_section_length{"section_length"}; +grib_accessor_class* grib_accessor_class_section_length = &_grib_accessor_class_section_length; + + +void grib_accessor_class_section_length_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + a->parent->aclength = a; + a->length = len; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + Assert(a->length >= 0); +} + +void grib_accessor_class_section_length_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_long(dumper, a, NULL); +} + +int grib_accessor_class_section_length_t::value_count(grib_accessor* a, long* c){ + *c = 1; + return 0; +} diff --git a/src/accessor/grib_accessor_class_section_length.h b/src/accessor/grib_accessor_class_section_length.h new file mode 100644 index 000000000..09490bebd --- /dev/null +++ b/src/accessor/grib_accessor_class_section_length.h @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_section_length_h +#define eccodes_accessor_section_length_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_section_length_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in section_length */ +}; + +class grib_accessor_class_section_length_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_section_length_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_section_length_t{}; } + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_section_length_h */ diff --git a/src/accessor/grib_accessor_class_section_padding.cc b/src/accessor/grib_accessor_class_section_padding.cc new file mode 100644 index 000000000..53cd22c06 --- /dev/null +++ b/src/accessor/grib_accessor_class_section_padding.cc @@ -0,0 +1,70 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_section_padding.h" + +grib_accessor_class_section_padding_t _grib_accessor_class_section_padding{"section_padding"}; +grib_accessor_class* grib_accessor_class_section_padding = &_grib_accessor_class_section_padding; + + +size_t grib_accessor_class_section_padding_t::preferred_size(grib_accessor* a, int from_handle){ + grib_accessor_section_padding_t* self = (grib_accessor_section_padding_t*)a; + grib_accessor* b = a; + grib_accessor* section_length = 0; + long length = 0; + size_t size = 1; + + long alength = 0; + + if (!from_handle) { + if (self->preserve) + return a->length; + else + return 0; + } + + /* The section length should be a parameter */ + while (section_length == NULL && b != NULL) { + section_length = b->parent->aclength; + b = b->parent->owner; + } + + if (!section_length) { + /* printf("PADDING is no !section_length\n"); */ + return 0; + } + + if (section_length->unpack_long(&length, &size) == GRIB_SUCCESS) { + if (length) + alength = length - a->offset + section_length->parent->owner->offset; + else + alength = 0; + + /*Assert(a->length>=0);*/ + + if (alength < 0) + alength = 0; + + /* printf("PADDING is %ld\n",a->length); */ + } + else { + /* printf("PADDING unpack fails\n"); */ + } + + return alength; +} + +void grib_accessor_class_section_padding_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_section_padding_t* self = (grib_accessor_section_padding_t*)a; + self->preserve = 1; /* This should be a parameter */ + a->length = preferred_size(a, 1); +} diff --git a/src/accessor/grib_accessor_class_section_padding.h b/src/accessor/grib_accessor_class_section_padding.h new file mode 100644 index 000000000..b6fce7f34 --- /dev/null +++ b/src/accessor/grib_accessor_class_section_padding.h @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_section_padding_h +#define eccodes_accessor_section_padding_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_padding.h" + +class grib_accessor_section_padding_t : public grib_accessor_padding_t +{ +public: + /* Members defined in section_padding */ + int preserve; +}; + +class grib_accessor_class_section_padding_t : public grib_accessor_class_padding_t +{ +public: + grib_accessor_class_section_padding_t(const char* name) : grib_accessor_class_padding_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_section_padding_t{}; } + void init(grib_accessor*, const long, grib_arguments*) override; + size_t preferred_size(grib_accessor*, int) override; +}; +#endif /* eccodes_accessor_section_padding_h */ diff --git a/src/accessor/grib_accessor_class_section_pointer.cc b/src/accessor/grib_accessor_class_section_pointer.cc new file mode 100644 index 000000000..553deb30f --- /dev/null +++ b/src/accessor/grib_accessor_class_section_pointer.cc @@ -0,0 +1,97 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_section_pointer.h" + +grib_accessor_class_section_pointer_t _grib_accessor_class_section_pointer{"section_pointer"}; +grib_accessor_class* grib_accessor_class_section_pointer = &_grib_accessor_class_section_pointer; + + +void grib_accessor_class_section_pointer_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + int n = 0; + grib_accessor_section_pointer_t* self = (grib_accessor_section_pointer_t*)a; + + self->sectionOffset = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->sectionLength = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->sectionNumber = grib_arguments_get_long(grib_handle_of_accessor(a), arg, n++); + + Assert(self->sectionNumber < MAX_NUM_SECTIONS); + + grib_handle_of_accessor(a)->section_offset[self->sectionNumber] = (char*)self->sectionOffset; + grib_handle_of_accessor(a)->section_length[self->sectionNumber] = (char*)self->sectionLength; + + /* printf("++++++++++++++ GRIB_API: creating section_pointer%d %s %s\n", */ + /* self->sectionNumber,self->sectionLength,self->sectionLength); */ + + if (grib_handle_of_accessor(a)->sections_count < self->sectionNumber) + grib_handle_of_accessor(a)->sections_count = self->sectionNumber; + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + a->length = 0; +} + +int grib_accessor_class_section_pointer_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_BYTES; +} + +int grib_accessor_class_section_pointer_t::unpack_string(grib_accessor* a, char* v, size_t* len){ + /* + unsigned char* p=NULL; + char* s=v; + int i; + long length=a->byte_count(); + if (*len < length) return GRIB_ARRAY_TOO_SMALL; + + p = grib_handle_of_accessor(a)->buffer->data + a->byte_offset(); + for (i = 0; i < length; i++) { + snprintf (s,64,"%02x", *(p++)); + s+=2; + } + *len=length; + */ + snprintf(v, 64, "%ld_%ld", a->byte_offset(), a->byte_count()); return GRIB_SUCCESS; +} + +long grib_accessor_class_section_pointer_t::byte_count(grib_accessor* a){ + grib_accessor_section_pointer_t* self = (grib_accessor_section_pointer_t*)a; + long sectionLength = 0; + int ret = 0; + + ret = grib_get_long(grib_handle_of_accessor(a), self->sectionLength, §ionLength); + if (ret) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "Unable to get %s %s", + self->sectionLength, grib_get_error_message(ret)); + return -1; + } + + return sectionLength; +} + +long grib_accessor_class_section_pointer_t::byte_offset(grib_accessor* a){ + grib_accessor_section_pointer_t* self = (grib_accessor_section_pointer_t*)a; + long sectionOffset = 0; + int ret = 0; + + ret = grib_get_long(grib_handle_of_accessor(a), self->sectionOffset, §ionOffset); + if (ret) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "Unable to get %s %s", + self->sectionOffset, grib_get_error_message(ret)); + return -1; + } + + return sectionOffset; +} diff --git a/src/accessor/grib_accessor_class_section_pointer.h b/src/accessor/grib_accessor_class_section_pointer.h new file mode 100644 index 000000000..45e77fbb9 --- /dev/null +++ b/src/accessor/grib_accessor_class_section_pointer.h @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_section_pointer_h +#define eccodes_accessor_section_pointer_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_section_pointer_t : public grib_accessor_gen_t +{ +public: + /* Members defined in section_pointer */ + const char* sectionOffset; + const char* sectionLength; + long sectionNumber; +}; + +class grib_accessor_class_section_pointer_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_section_pointer_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_section_pointer_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_section_pointer_h */ diff --git a/src/accessor/todo/grib_accessor_class_select_step_template.cc b/src/accessor/grib_accessor_class_select_step_template.cc similarity index 60% rename from src/accessor/todo/grib_accessor_class_select_step_template.cc rename to src/accessor/grib_accessor_class_select_step_template.cc index 7a0e76c23..fd4578d41 100644 --- a/src/accessor/todo/grib_accessor_class_select_step_template.cc +++ b/src/accessor/grib_accessor_class_select_step_template.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,107 +10,14 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_select_step_template.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_unsigned - IMPLEMENTS = unpack_long;pack_long; value_count - IMPLEMENTS = init - MEMBERS=const char* productDefinitionTemplateNumber - MEMBERS=int instant - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_select_step_template -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in select_step_template */ - const char* productDefinitionTemplateNumber; - int instant; -} grib_accessor_select_step_template; - -extern grib_accessor_class* grib_accessor_class_unsigned; - -static grib_accessor_class _grib_accessor_class_select_step_template = { - &grib_accessor_class_unsigned, /* super */ - "select_step_template", /* name */ - sizeof(grib_accessor_select_step_template), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_select_step_template_t _grib_accessor_class_select_step_template{"select_step_template"}; grib_accessor_class* grib_accessor_class_select_step_template = &_grib_accessor_class_select_step_template; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_select_step_template* self = (grib_accessor_select_step_template*)a; +void grib_accessor_class_select_step_template_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_select_step_template_t* self = (grib_accessor_select_step_template_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; @@ -117,15 +25,13 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->instant = grib_arguments_get_long(hand, c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ +int grib_accessor_class_select_step_template_t::unpack_long(grib_accessor* a, long* val, size_t* len){ *val = 1; return GRIB_SUCCESS; } -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; +int grib_accessor_class_select_step_template_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_select_step_template_t* self = (grib_accessor_select_step_template_t*)a; grib_handle* hand = grib_handle_of_accessor(a); long productDefinitionTemplateNumber = 0; long productDefinitionTemplateNumberNew = 0; @@ -266,8 +172,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_SUCCESS; } -static int value_count(grib_accessor* a, long* c) -{ +int grib_accessor_class_select_step_template_t::value_count(grib_accessor* a, long* c){ *c = 1; return 0; } diff --git a/src/accessor/grib_accessor_class_select_step_template.h b/src/accessor/grib_accessor_class_select_step_template.h new file mode 100644 index 000000000..a83d3ddfd --- /dev/null +++ b/src/accessor/grib_accessor_class_select_step_template.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_select_step_template_h +#define eccodes_accessor_select_step_template_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_select_step_template_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in select_step_template */ + const char* productDefinitionTemplateNumber; + int instant; +}; + +class grib_accessor_class_select_step_template_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_select_step_template_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_select_step_template_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_select_step_template_h */ diff --git a/src/accessor/grib_accessor_class_sexagesimal2decimal.cc b/src/accessor/grib_accessor_class_sexagesimal2decimal.cc new file mode 100644 index 000000000..7b3a7dbfb --- /dev/null +++ b/src/accessor/grib_accessor_class_sexagesimal2decimal.cc @@ -0,0 +1,146 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_sexagesimal2decimal.h" + +grib_accessor_class_sexagesimal2decimal_t _grib_accessor_class_sexagesimal2decimal{"sexagesimal2decimal"}; +grib_accessor_class* grib_accessor_class_sexagesimal2decimal = &_grib_accessor_class_sexagesimal2decimal; + + +void grib_accessor_class_sexagesimal2decimal_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +void grib_accessor_class_sexagesimal2decimal_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_double(dumper, a, NULL); +} + +int grib_accessor_class_sexagesimal2decimal_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_DOUBLE; +} + +int grib_accessor_class_sexagesimal2decimal_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + int err = 0; + grib_accessor_sexagesimal2decimal_t* self = (grib_accessor_sexagesimal2decimal_t*)a; + char buff[512] = {0,}; + size_t length = 0; + size_t size = 512; + char* p; + char* q; + double dd, mm = 0, ss = 0; + int dd_sign = 1; + + err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); + if (err) + return err; + q = buff + self->start; + if (self->length) + q[length] = 0; + p = q; + + while (*p != '-' && *p != ':' && *p != ' ' && *p != 0) { + p++; + } + + if (*p == 0) { + return GRIB_WRONG_CONVERSION; + } + *p = 0; + + dd = atoi(q); + p++; + q = p; + while (*p != '-' && *p != ':' && *p != ' ' && *p != 'N' && *p != 'S' && *p != 'E' && *p != 'W' && *p != 0) { + p++; + } + switch (*p) { + case ' ': + case '-': + case ':': + *p = 0; + mm = atoi(q) / 60.0; + dd += mm; + p++; + q = p; + break; + case 'N': + case 'E': + *p = 0; + dd_sign = 1; + mm = atoi(q) / 60.0; + dd += mm; + p++; + q = p; + break; + case 'S': + case 'W': + *p = 0; + mm = atoi(q) / 60.0; + dd += mm; + dd_sign = -1; + p++; + q = p; + break; + case 0: + break; + default: + return GRIB_WRONG_CONVERSION; + } + if (*p) { + while (*p != '-' && *p != ':' && *p != ' ' && *p != 'N' && *p != 'S' && *p != 'E' && *p != 'W' && *p != 0) { + p++; + } + switch (*p) { + case ' ': + case '-': + case ':': + *p = 0; + ss = atof(q) / 60.0; + dd += ss; + break; + case 'N': + case 'E': + *p = 0; + ss = atof(q) / 60.0; + dd += ss; + dd_sign = 1; + break; + case 'S': + case 'W': + *p = 0; + ss = atof(q) / 60.0; + dd += ss; + dd_sign = -1; + break; + case 0: + break; + default: + return GRIB_WRONG_CONVERSION; + } + } + dd *= dd_sign; + + snprintf(buff, sizeof(buff), "%.2f", dd); + length = strlen(buff); + + if (len[0] < length + 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", + len[0], a->name, a->length + 1); + len[0] = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + strcpy(val, buff); + + len[0] = length; + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_sexagesimal2decimal.h b/src/accessor/grib_accessor_class_sexagesimal2decimal.h new file mode 100644 index 000000000..c9009293e --- /dev/null +++ b/src/accessor/grib_accessor_class_sexagesimal2decimal.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_sexagesimal2decimal_h +#define eccodes_accessor_sexagesimal2decimal_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_to_double.h" + +class grib_accessor_sexagesimal2decimal_t : public grib_accessor_to_double_t +{ +public: + /* Members defined in sexagesimal2decimal */ +}; + +class grib_accessor_class_sexagesimal2decimal_t : public grib_accessor_class_to_double_t +{ +public: + grib_accessor_class_sexagesimal2decimal_t(const char* name) : grib_accessor_class_to_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_sexagesimal2decimal_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_sexagesimal2decimal_h */ diff --git a/src/accessor/todo/grib_accessor_class_signed.cc b/src/accessor/grib_accessor_class_signed.cc similarity index 51% rename from src/accessor/todo/grib_accessor_class_signed.cc rename to src/accessor/grib_accessor_class_signed.cc index 3439934e1..ac2f7757c 100644 --- a/src/accessor/todo/grib_accessor_class_signed.cc +++ b/src/accessor/grib_accessor_class_signed.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,129 +10,25 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_signed.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init;dump - IMPLEMENTS = next_offset - IMPLEMENTS = byte_count - IMPLEMENTS = value_count - IMPLEMENTS = byte_offset - IMPLEMENTS = update_size; is_missing - MEMBERS = grib_arguments* arg - MEMBERS = int nbytes; - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int is_missing(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static long byte_count(grib_accessor*); -static long byte_offset(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); - -typedef struct grib_accessor_signed -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in signed */ - grib_arguments* arg; - int nbytes; -} grib_accessor_signed; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_signed = { - &grib_accessor_class_long, /* super */ - "signed", /* name */ - sizeof(grib_accessor_signed), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - &is_missing, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - +grib_accessor_class_signed_t _grib_accessor_class_signed{"signed"}; grib_accessor_class* grib_accessor_class_signed = &_grib_accessor_class_signed; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_signed* self = (grib_accessor_signed*)a; +void grib_accessor_class_signed_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_signed_t* self = (grib_accessor_signed_t*)a; long count = 0; self->arg = arg; - grib_value_count(a, &count); - a->length = len * count; + a->value_count(&count); a->length = len * count; self->nbytes = len; Assert(a->length >= 0); } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_signed_t::dump(grib_accessor* a, grib_dumper* dumper){ long rlen = 0; - grib_value_count(a, &rlen); - if (rlen == 1) + a->value_count(&rlen); if (rlen == 1) grib_dump_long(dumper, a, NULL); else grib_dump_values(dumper, a); @@ -145,9 +42,8 @@ static const long ones[] = { -0x7fffffff, }; -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_signed* self = (grib_accessor_signed*)a; +int grib_accessor_class_signed_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_signed_t* self = (grib_accessor_signed_t*)a; unsigned long rlen = 0; int err = 0; long count = 0; @@ -156,8 +52,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) long pos = a->offset; long missing = 0; - err = grib_value_count(a, &count); - if (err) + err = a->value_count(&count); if (err) return err; rlen = count; @@ -184,9 +79,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_signed* self = (grib_accessor_signed*)a; +int grib_accessor_class_signed_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_signed_t* self = (grib_accessor_signed_t*)a; int ret = 0; long off = 0; unsigned long rlen = 0; @@ -197,8 +91,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) unsigned long i = 0; long missing = 0; - err = grib_value_count(a, &count); - if (err) + err = a->value_count(&count); if (err) return err; rlen = count; @@ -237,7 +130,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) if (ret == GRIB_SUCCESS) len[0] = 1; if (*len > 1) - grib_context_log(a->context, GRIB_LOG_WARNING, "grib_accessor_signed : Trying to pack %d values in a scalar %s, packing first value", *len, a->name); + grib_context_log(a->context, GRIB_LOG_WARNING, "grib_accessor_signed_t : Trying to pack %d values in a scalar %s, packing first value", *len, a->name); len[0] = 1; return ret; } @@ -263,14 +156,12 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return ret; } -static long byte_count(grib_accessor* a) -{ +long grib_accessor_class_signed_t::byte_count(grib_accessor* a){ return a->length; } -static int value_count(grib_accessor* a, long* len) -{ - grib_accessor_signed* self = (grib_accessor_signed*)a; +int grib_accessor_class_signed_t::value_count(grib_accessor* a, long* len){ + grib_accessor_signed_t* self = (grib_accessor_signed_t*)a; *len = 0; if (!self->arg) { *len = 1; @@ -279,24 +170,19 @@ static int value_count(grib_accessor* a, long* len) return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); } -static long byte_offset(grib_accessor* a) -{ +long grib_accessor_class_signed_t::byte_offset(grib_accessor* a){ return a->offset; } -static void update_size(grib_accessor* a, size_t s) -{ +void grib_accessor_class_signed_t::update_size(grib_accessor* a, size_t s){ a->length = s; Assert(a->length >= 0); } -static long next_offset(grib_accessor* a) -{ - return grib_byte_offset(a) + grib_byte_count(a); -} +long grib_accessor_class_signed_t::next_offset(grib_accessor* a){ + return a->byte_offset() + a->byte_count();} -static int is_missing(grib_accessor* a) -{ +int grib_accessor_class_signed_t::is_missing(grib_accessor* a){ int i = 0; unsigned char ff = 0xff; unsigned long offset = a->offset; diff --git a/src/accessor/grib_accessor_class_signed.h b/src/accessor/grib_accessor_class_signed.h new file mode 100644 index 000000000..23c9829a4 --- /dev/null +++ b/src/accessor/grib_accessor_class_signed.h @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_signed_h +#define eccodes_accessor_signed_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_signed_t : public grib_accessor_long_t +{ +public: + /* Members defined in signed */ + grib_arguments* arg; + int nbytes; +}; + +class grib_accessor_class_signed_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_signed_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_signed_t{}; } + int is_missing(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; +}; +#endif /* eccodes_accessor_signed_h */ diff --git a/src/accessor/grib_accessor_class_signed_bits.cc b/src/accessor/grib_accessor_class_signed_bits.cc new file mode 100644 index 000000000..85a764628 --- /dev/null +++ b/src/accessor/grib_accessor_class_signed_bits.cc @@ -0,0 +1,152 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_signed_bits.h" + +grib_accessor_class_signed_bits_t _grib_accessor_class_signed_bits{"signed_bits"}; +grib_accessor_class* grib_accessor_class_signed_bits = &_grib_accessor_class_signed_bits; + + +long grib_accessor_class_signed_bits_t::byte_count(grib_accessor* a){ + return a->length; +} + +static long compute_byte_count(grib_accessor* a){ + grib_accessor_signed_bits_t* self = (grib_accessor_signed_bits_t*)a; + long numberOfBits; + long numberOfElements; + int ret = 0; + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfBits); + return 0; + } + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, &numberOfElements); + if (ret) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfElements); + return 0; + } + + return (numberOfBits * numberOfElements + 7) / 8; +} + +void grib_accessor_class_signed_bits_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_signed_bits_t* self = (grib_accessor_signed_bits_t*)a; + int n = 0; + self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->numberOfElements = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->length = compute_byte_count(a); +} + +int grib_accessor_class_signed_bits_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +#if 0 + grib_accessor_signed_bits_t* self = (grib_accessor_signed_bits_t*)a; + int i; + int ret = 0; + long pos = a->offset * 8; + long rlen = 0; + long numberOfBits = 0; + + ret = value_count(a, &rlen); + if (ret) + return ret; + + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "Wrong size (%ld) for %s it contains %ld values", *len, a->name, rlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) + return ret; + + if (numberOfBits == 0) { + for (i = 0; i < rlen; i++) + val[i] = 0; + return GRIB_SUCCESS; + } + + for (i = 0; i < rlen; i++) + val[i] = grib_decode_signed_longb(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); + + *len = rlen; + + return GRIB_SUCCESS; +#endif +} + +int grib_accessor_class_signed_bits_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +#if 0 + grib_accessor_signed_bits_t* self = (grib_accessor_signed_bits_t*)a; + int ret = 0; + long off = 0; + long numberOfBits = 0; + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned long i = 0; + unsigned long rlen = 0; + long count = 0; + + ret = value_count(a, &count); + if (ret) + return ret; + rlen = count; + if (*len != rlen) { + ret = grib_set_long(grib_handle_of_accessor(a), self->numberOfElements, rlen); + if (ret) + return ret; + } + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) + return ret; + + buflen = compute_byte_count(a); + buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen + sizeof(long)); + + for (i = 0; i < rlen; i++) + grib_encode_signed_longb(buf, val[i], &off, numberOfBits); + + grib_buffer_replace(a, buf, buflen, 1, 1); + + grib_context_free(a->context, buf); + + return ret; +#endif +} + +int grib_accessor_class_signed_bits_t::value_count(grib_accessor* a, long* numberOfElements){ + grib_accessor_signed_bits_t* self = (grib_accessor_signed_bits_t*)a; + *numberOfElements = 0; + + return grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, numberOfElements); +} + +long grib_accessor_class_signed_bits_t::byte_offset(grib_accessor* a){ + return a->offset; +} + +void grib_accessor_class_signed_bits_t::update_size(grib_accessor* a, size_t s){ + a->length = s; +} + +long grib_accessor_class_signed_bits_t::next_offset(grib_accessor* a){ + return byte_offset(a) + byte_count(a); +} diff --git a/src/accessor/grib_accessor_class_signed_bits.h b/src/accessor/grib_accessor_class_signed_bits.h new file mode 100644 index 000000000..96ba5f592 --- /dev/null +++ b/src/accessor/grib_accessor_class_signed_bits.h @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_signed_bits_h +#define eccodes_accessor_signed_bits_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_signed_bits_t : public grib_accessor_long_t +{ +public: + /* Members defined in signed_bits */ + const char* numberOfBits; + const char* numberOfElements; +}; + +class grib_accessor_class_signed_bits_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_signed_bits_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_signed_bits_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; +}; +#endif /* eccodes_accessor_signed_bits_h */ diff --git a/src/accessor/grib_accessor_class_simple_packing_error.cc b/src/accessor/grib_accessor_class_simple_packing_error.cc new file mode 100644 index 000000000..41cfddacb --- /dev/null +++ b/src/accessor/grib_accessor_class_simple_packing_error.cc @@ -0,0 +1,70 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_simple_packing_error.h" +#include "grib_scaling.h" + +grib_accessor_class_simple_packing_error_t _grib_accessor_class_simple_packing_error{"simple_packing_error"}; +grib_accessor_class* grib_accessor_class_simple_packing_error = &_grib_accessor_class_simple_packing_error; + + +void grib_accessor_class_simple_packing_error_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_simple_packing_error_t* self = (grib_accessor_simple_packing_error_t*)a; + int n = 0; + grib_handle* h = grib_handle_of_accessor(a); + + self->bitsPerValue = grib_arguments_get_name(h, c, n++); + self->binaryScaleFactor = grib_arguments_get_name(h, c, n++); + self->decimalScaleFactor = grib_arguments_get_name(h, c, n++); + self->referenceValue = grib_arguments_get_name(h, c, n++); + self->floatType = grib_arguments_get_name(h, c, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; +} + +int grib_accessor_class_simple_packing_error_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_simple_packing_error_t* self = (grib_accessor_simple_packing_error_t*)a; + + int ret = 0; + long binaryScaleFactor = 0; + long bitsPerValue = 0; + long decimalScaleFactor = 0; + double referenceValue = 0; + grib_handle* h = grib_handle_of_accessor(a); + + if ((ret = grib_get_long_internal(h, self->binaryScaleFactor, &binaryScaleFactor)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(h, self->bitsPerValue, &bitsPerValue)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(h, self->decimalScaleFactor, &decimalScaleFactor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_double_internal(h, self->referenceValue, &referenceValue)) != GRIB_SUCCESS) + return ret; + + if (!strcmp(self->floatType, "ibm")) + *val = grib_ibmfloat_error(referenceValue); + else if (!strcmp(self->floatType, "ieee")) + *val = grib_ieeefloat_error(referenceValue); + else + Assert(1 == 0); + + if (bitsPerValue != 0) + *val = (*val + codes_power(binaryScaleFactor, 2)) * codes_power(-decimalScaleFactor, 10) * 0.5; + + if (ret == GRIB_SUCCESS) + *len = 1; + + return ret; +} diff --git a/src/accessor/grib_accessor_class_simple_packing_error.h b/src/accessor/grib_accessor_class_simple_packing_error.h new file mode 100644 index 000000000..6c90188c5 --- /dev/null +++ b/src/accessor/grib_accessor_class_simple_packing_error.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_simple_packing_error_h +#define eccodes_accessor_simple_packing_error_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_simple_packing_error_t : public grib_accessor_double_t +{ +public: + /* Members defined in simple_packing_error */ + const char* binaryScaleFactor; + const char* bitsPerValue; + const char* decimalScaleFactor; + const char* referenceValue; + const char* floatType; +}; + +class grib_accessor_class_simple_packing_error_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_simple_packing_error_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_simple_packing_error_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_simple_packing_error_h */ diff --git a/src/accessor/grib_accessor_class_size.cc b/src/accessor/grib_accessor_class_size.cc new file mode 100644 index 000000000..7fbeac212 --- /dev/null +++ b/src/accessor/grib_accessor_class_size.cc @@ -0,0 +1,35 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_size.h" + +grib_accessor_class_size_t _grib_accessor_class_size{"size"}; +grib_accessor_class* grib_accessor_class_size = &_grib_accessor_class_size; + + +void grib_accessor_class_size_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_size_t* self = (grib_accessor_size_t*)a; + self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +int grib_accessor_class_size_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + int ret = 0; + size_t size = 0; + grib_accessor_size_t* self = (grib_accessor_size_t*)a; + ret = grib_get_size(grib_handle_of_accessor(a), self->accessor, &size); + *val = (long)size; + *len = 1; + return ret; +} diff --git a/src/accessor/grib_accessor_class_size.h b/src/accessor/grib_accessor_class_size.h new file mode 100644 index 000000000..dbf47f8bd --- /dev/null +++ b/src/accessor/grib_accessor_class_size.h @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_size_h +#define eccodes_accessor_size_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_size_t : public grib_accessor_long_t +{ +public: + /* Members defined in size */ + const char* accessor; +}; + +class grib_accessor_class_size_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_size_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_size_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_size_h */ diff --git a/src/accessor/grib_accessor_class_smart_table_column.cc b/src/accessor/grib_accessor_class_smart_table_column.cc new file mode 100644 index 000000000..d8a5e267f --- /dev/null +++ b/src/accessor/grib_accessor_class_smart_table_column.cc @@ -0,0 +1,177 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_smart_table_column.h" +#include "grib_accessor_class_smart_table.h" + +grib_accessor_class_smart_table_column_t _grib_accessor_class_smart_table_column{"smart_table_column"}; +grib_accessor_class* grib_accessor_class_smart_table_column = &_grib_accessor_class_smart_table_column; + + + +void grib_accessor_class_smart_table_column_t::init(grib_accessor* a, const long len, grib_arguments* params){ + int n = 0; + grib_accessor_smart_table_column_t* self = (grib_accessor_smart_table_column_t*)a; + + self->smartTable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + self->index = grib_arguments_get_long(grib_handle_of_accessor(a), params, n++); + + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +void grib_accessor_class_smart_table_column_t::dump(grib_accessor* a, grib_dumper* dumper){ + int type = get_native_type(a); + + switch (type) { + case GRIB_TYPE_LONG: + grib_dump_long(dumper, a, NULL); + break; + case GRIB_TYPE_STRING: + grib_dump_string_array(dumper, a, NULL); + break; + } +} + +int grib_accessor_class_smart_table_column_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len){ + grib_accessor_smart_table_column_t* self = (grib_accessor_smart_table_column_t*)a; + grib_accessor_smart_table_t* tableAccessor = NULL; + grib_smart_table* table = NULL; + + size_t size = 1; + long* code; + int err = GRIB_SUCCESS; + char tmp[1024] = {0,}; + int i = 0; + + tableAccessor = (grib_accessor_smart_table_t*)grib_find_accessor(grib_handle_of_accessor(a), self->smartTable); + if (!tableAccessor) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "Unable to find accessor %s", self->smartTable); + return GRIB_NOT_FOUND; + } + + err = grib_get_size_acc(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size); + if (err) + return err; + if (*len < size) { + return GRIB_BUFFER_TOO_SMALL; + } + + code = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + if (!code) { + grib_context_log(a->context, GRIB_LOG_FATAL, "%s: Memory allocation error: %zu bytes", a->name, size); + return GRIB_OUT_OF_MEMORY; + } + + if ((err = ((grib_accessor*)tableAccessor)->unpack_long(code, &size)) != GRIB_SUCCESS) + return err; + + table = tableAccessor->table; + + for (i = 0; i < size; i++) { + if (table && (code[i] >= 0) && + (code[i] < table->numberOfEntries) && + table->entries[code[i]].column[self->index]) { + strcpy(tmp, table->entries[code[i]].column[self->index]); + } + else { + snprintf(tmp, sizeof(tmp), "%d", (int)code[i]); + } + + buffer[i] = grib_context_strdup(a->context, tmp); + } + *len = size; + grib_context_free(a->context, code); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_smart_table_column_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_smart_table_column_t* self = (grib_accessor_smart_table_column_t*)a; + grib_accessor_smart_table_t* tableAccessor = NULL; + grib_smart_table* table = NULL; + + size_t size = 1; + long* code; + int err = GRIB_SUCCESS; + int i = 0; + + for (i = 0; i < *len; i++) + val[i] = GRIB_MISSING_LONG; + + tableAccessor = (grib_accessor_smart_table_t*)grib_find_accessor(grib_handle_of_accessor(a), self->smartTable); + if (!tableAccessor) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "Unable to find accessor %s", self->smartTable); + return GRIB_NOT_FOUND; + } + + err = grib_get_size_acc(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size); + if (err) + return err; + if (*len < size) { + return GRIB_BUFFER_TOO_SMALL; + } + + code = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + if (!code) return GRIB_OUT_OF_MEMORY; + + if ((err = ((grib_accessor*)tableAccessor)->unpack_long(code, &size)) != GRIB_SUCCESS) { + grib_context_free(a->context, code); + return err; + } + + table = tableAccessor->table; + + for (i = 0; i < size; i++) { + if (table && (code[i] >= 0) && + (code[i] < table->numberOfEntries) && + table->entries[code[i]].column[self->index]) { + val[i] = atol(table->entries[code[i]].column[self->index]); + } + } + *len = size; + grib_context_free(a->context, code); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_smart_table_column_t::value_count(grib_accessor* a, long* count){ + grib_accessor_smart_table_column_t* self = (grib_accessor_smart_table_column_t*)a; + size_t size = 0; + int err = 0; + *count = 0; + + if (!self->smartTable) + return 0; + + err = grib_get_size(grib_handle_of_accessor(a), self->smartTable, &size); + *count = size; + return err; +} + +void grib_accessor_class_smart_table_column_t::destroy(grib_context* context, grib_accessor* a){ + if (a->vvalue != NULL) { + grib_context_free(context, a->vvalue); + a->vvalue = NULL; + } +} + +int grib_accessor_class_smart_table_column_t::get_native_type(grib_accessor* a){ + int type = GRIB_TYPE_LONG; + /*printf("---------- %s flags=%ld GRIB_ACCESSOR_FLAG_STRING_TYPE=%d\n", + a->name,a->flags,GRIB_ACCESSOR_FLAG_STRING_TYPE);*/ + if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) + type = GRIB_TYPE_STRING; + return type; +} diff --git a/src/accessor/grib_accessor_class_smart_table_column.h b/src/accessor/grib_accessor_class_smart_table_column.h new file mode 100644 index 000000000..0c24454bc --- /dev/null +++ b/src/accessor/grib_accessor_class_smart_table_column.h @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_smart_table_column_h +#define eccodes_accessor_smart_table_column_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_smart_table_column_t : public grib_accessor_gen_t +{ +public: + /* Members defined in smart_table_column */ + const char* smartTable; + int index; +}; + +class grib_accessor_class_smart_table_column_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_smart_table_column_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_smart_table_column_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_smart_table_column_h */ diff --git a/src/accessor/grib_accessor_class_spd.cc b/src/accessor/grib_accessor_class_spd.cc new file mode 100644 index 000000000..7e1083377 --- /dev/null +++ b/src/accessor/grib_accessor_class_spd.cc @@ -0,0 +1,158 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_spd.h" + +grib_accessor_class_spd_t _grib_accessor_class_spd{"spd"}; +grib_accessor_class* grib_accessor_class_spd = &_grib_accessor_class_spd; + + +long grib_accessor_class_spd_t::byte_count(grib_accessor* a){ + return a->length; +} + +static long compute_byte_count(grib_accessor* a){ + grib_accessor_spd_t* self = (grib_accessor_spd_t*)a; + long numberOfBits; + long numberOfElements; + int ret = 0; + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfBits); + return 0; + } + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, &numberOfElements); + if (ret) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfElements); + return 0; + } + numberOfElements++; + + return (numberOfBits * numberOfElements + 7) / 8; +} + +void grib_accessor_class_spd_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_spd_t* self = (grib_accessor_spd_t*)a; + int n = 0; + self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->numberOfElements = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->length = compute_byte_count(a); +} + +int grib_accessor_class_spd_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_spd_t* self = (grib_accessor_spd_t*)a; + int i; + int ret = 0; + long pos = a->offset * 8; + long rlen = 0; + long numberOfBits = 0; + + ret = value_count(a, &rlen); + if (ret) + return ret; + + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "Wrong size (%zu) for %s, it contains %ld values", *len, a->name, rlen); + *len = rlen; + return GRIB_ARRAY_TOO_SMALL; + } + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) + return ret; + if (numberOfBits > 64) { + grib_context_log(a->context, GRIB_LOG_ERROR,"Invalid number of bits: %ld",numberOfBits); + return GRIB_DECODING_ERROR; + } + + for (i = 0; i < rlen - 1; i++) + val[i] = grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); + + val[rlen - 1] = grib_decode_signed_longb(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); + + *len = rlen; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_spd_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_spd_t* self = (grib_accessor_spd_t*)a; + int ret = 0; + long off = 0; + long numberOfBits = 0; + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned long i = 0; + long rlen = 0; + + ret = value_count(a, &rlen); + if (ret) + return ret; + + if (*len != rlen) { + ret = grib_set_long(grib_handle_of_accessor(a), self->numberOfElements, (*len) - 1); + if (ret) return ret; + } + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) + return ret; + + buflen = compute_byte_count(a); + buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen); + + for (i = 0; i < rlen - 1; i++) { + grib_encode_unsigned_longb(buf, val[i], &off, numberOfBits); + } + + grib_encode_signed_longb(buf, val[rlen - 1], &off, numberOfBits); + + grib_buffer_replace(a, buf, buflen, 1, 1); + + grib_context_free(a->context, buf); + + *len = rlen; + return ret; +} + +int grib_accessor_class_spd_t::value_count(grib_accessor* a, long* numberOfElements){ + grib_accessor_spd_t* self = (grib_accessor_spd_t*)a; + int ret; + *numberOfElements = 0; + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, numberOfElements); + if (ret) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfElements); + return ret; + } + (*numberOfElements)++; + + return ret; +} + +long grib_accessor_class_spd_t::byte_offset(grib_accessor* a){ + return a->offset; +} + +void grib_accessor_class_spd_t::update_size(grib_accessor* a, size_t s){ + a->length = s; +} + +long grib_accessor_class_spd_t::next_offset(grib_accessor* a){ + return byte_offset(a) + a->length; +} diff --git a/src/accessor/grib_accessor_class_spd.h b/src/accessor/grib_accessor_class_spd.h new file mode 100644 index 000000000..c35e5c742 --- /dev/null +++ b/src/accessor/grib_accessor_class_spd.h @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_spd_h +#define eccodes_accessor_spd_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_spd_t : public grib_accessor_long_t +{ +public: + /* Members defined in spd */ + const char* numberOfBits; + const char* numberOfElements; +}; + +class grib_accessor_class_spd_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_spd_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_spd_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; +}; +#endif /* eccodes_accessor_spd_h */ diff --git a/src/accessor/grib_accessor_class_spectral_truncation.cc b/src/accessor/grib_accessor_class_spectral_truncation.cc new file mode 100644 index 000000000..c10a32d6e --- /dev/null +++ b/src/accessor/grib_accessor_class_spectral_truncation.cc @@ -0,0 +1,81 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_spectral_truncation.h" + +grib_accessor_class_spectral_truncation_t _grib_accessor_class_spectral_truncation{"spectral_truncation"}; +grib_accessor_class* grib_accessor_class_spectral_truncation = &_grib_accessor_class_spectral_truncation; + + +void grib_accessor_class_spectral_truncation_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_spectral_truncation_t* self = (grib_accessor_spectral_truncation_t*)a; + int n = 0; + + self->J = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->K = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->M = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->T = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_spectral_truncation_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_spectral_truncation_t* self = (grib_accessor_spectral_truncation_t*)a; + int ret = 0; + + long J, K, M, T, Tc; + + if (*len < 1) + return GRIB_ARRAY_TOO_SMALL; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->J, &J)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->K, &K)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->M, &M)) != GRIB_SUCCESS) + return ret; + + Tc = -1; + if (J == K && K == M) { + /* Triangular truncation */ + Tc = (M + 1) * (M + 2); + } + if (K == J + M) { + /* Rhomboidal truncation */ + Tc = 2 * J * M; + } + if (J == K && K > M) { + /* Trapezoidal truncation */ + Tc = M * (2 * J - M); + } + *val = Tc; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->T, &T)) != GRIB_SUCCESS) { + if (Tc == -1) + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s. Spectral Truncation Type Unknown: %s=%ld %s=%ld %s=%ld", + a->name, self->J, J, self->K, K, self->M, M); + Tc = 0; + grib_set_long(grib_handle_of_accessor(a), self->T, Tc); + } + else { + if (Tc != -1 && Tc != T) + grib_set_long(grib_handle_of_accessor(a), self->T, Tc); + } + + if (ret == GRIB_SUCCESS) + *len = 1; + + return ret; +} diff --git a/src/accessor/grib_accessor_class_spectral_truncation.h b/src/accessor/grib_accessor_class_spectral_truncation.h new file mode 100644 index 000000000..0ab43b1fd --- /dev/null +++ b/src/accessor/grib_accessor_class_spectral_truncation.h @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_spectral_truncation_h +#define eccodes_accessor_spectral_truncation_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_spectral_truncation_t : public grib_accessor_long_t +{ +public: + /* Members defined in spectral_truncation */ + const char* J; + const char* K; + const char* M; + const char* T; +}; + +class grib_accessor_class_spectral_truncation_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_spectral_truncation_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_spectral_truncation_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_spectral_truncation_h */ diff --git a/src/accessor/todo/grib_accessor_class_sprintf.cc b/src/accessor/grib_accessor_class_sprintf.cc similarity index 54% rename from src/accessor/todo/grib_accessor_class_sprintf.cc rename to src/accessor/grib_accessor_class_sprintf.cc index 106ce1e4d..8df2bb732 100644 --- a/src/accessor/todo/grib_accessor_class_sprintf.cc +++ b/src/accessor/grib_accessor_class_sprintf.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,108 +10,20 @@ */ #include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_ascii - IMPLEMENTS = unpack_string;value_count - IMPLEMENTS = init;string_length - MEMBERS= grib_arguments* args - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_sprintf -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ascii */ - /* Members defined in sprintf */ - grib_arguments* args; -} grib_accessor_sprintf; - -extern grib_accessor_class* grib_accessor_class_ascii; - -static grib_accessor_class _grib_accessor_class_sprintf = { - &grib_accessor_class_ascii, /* super */ - "sprintf", /* name */ - sizeof(grib_accessor_sprintf), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_sprintf.h" +grib_accessor_class_sprintf_t _grib_accessor_class_sprintf{"sprintf"}; grib_accessor_class* grib_accessor_class_sprintf = &_grib_accessor_class_sprintf; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_sprintf* self = (grib_accessor_sprintf*)a; +void grib_accessor_class_sprintf_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_sprintf_t* self = (grib_accessor_sprintf_t*)a; self->args = c; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_sprintf* self = (grib_accessor_sprintf*)a; +int grib_accessor_class_sprintf_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_sprintf_t* self = (grib_accessor_sprintf_t*)a; char result[1024]; char tempBuffer[2048]; char sres[1024]; @@ -148,8 +61,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), tempname, &ires)) != GRIB_SUCCESS) return ret; /* Bug GRIB-56: Check to see if the key is missing */ - is_missing = grib_is_missing(grib_handle_of_accessor(a), tempname, &ret); - if (ret != GRIB_SUCCESS) + is_missing = grib_is_missing(grib_handle_of_accessor(a), tempname, &ret); if (ret != GRIB_SUCCESS) return ret; if (is_missing) { snprintf(tempBuffer, sizeof(tempBuffer), "%sMISSING", result); @@ -205,13 +117,11 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) return GRIB_SUCCESS; } -static int value_count(grib_accessor* a, long* count) -{ +int grib_accessor_class_sprintf_t::value_count(grib_accessor* a, long* count){ *count = 1; return 0; } -static size_t string_length(grib_accessor* a) -{ +size_t grib_accessor_class_sprintf_t::string_length(grib_accessor* a){ return 1024; } diff --git a/src/accessor/grib_accessor_class_sprintf.h b/src/accessor/grib_accessor_class_sprintf.h new file mode 100644 index 000000000..9bfb1c83e --- /dev/null +++ b/src/accessor/grib_accessor_class_sprintf.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_sprintf_h +#define eccodes_accessor_sprintf_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_sprintf_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in sprintf */ + grib_arguments* args; +}; + +class grib_accessor_class_sprintf_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_sprintf_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_sprintf_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_sprintf_h */ diff --git a/src/accessor/todo/grib_accessor_class_statistics.cc b/src/accessor/grib_accessor_class_statistics.cc similarity index 55% rename from src/accessor/todo/grib_accessor_class_statistics.cc rename to src/accessor/grib_accessor_class_statistics.cc index 915701a3a..9a4eeee20 100644 --- a/src/accessor/todo/grib_accessor_class_statistics.cc +++ b/src/accessor/grib_accessor_class_statistics.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -8,116 +9,15 @@ * 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 - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_abstract_vector - IMPLEMENTS = unpack_double; destroy - IMPLEMENTS = unpack_string - IMPLEMENTS = value_count;compare - IMPLEMENTS = init - MEMBERS = const char* values - MEMBERS = const char* missing_value - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_statistics -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in abstract_vector */ - double* v; - int number_of_elements; - /* Members defined in statistics */ - const char* values; - const char* missing_value; -} grib_accessor_statistics; - -extern grib_accessor_class* grib_accessor_class_abstract_vector; - -static grib_accessor_class _grib_accessor_class_statistics = { - &grib_accessor_class_abstract_vector, /* super */ - "statistics", /* name */ - sizeof(grib_accessor_statistics), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +#include "grib_accessor_class_statistics.h" +grib_accessor_class_statistics_t _grib_accessor_class_statistics{"statistics"}; grib_accessor_class* grib_accessor_class_statistics = &_grib_accessor_class_statistics; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_statistics* self = (grib_accessor_statistics*)a; +void grib_accessor_class_statistics_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_statistics_t* self = (grib_accessor_statistics_t*)a; int n = 0; self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); @@ -134,9 +34,8 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->dirty = 1; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_statistics* self = (grib_accessor_statistics*)a; +int grib_accessor_class_statistics_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_statistics_t* self = (grib_accessor_statistics_t*)a; int ret = 0; double* values = NULL; size_t i = 0, size = 0, real_size = 0; @@ -157,7 +56,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_statistics: computing statistics for %d values", size); + "grib_accessor_statistics_t: computing statistics for %d values", size); if ((ret = grib_get_double(h, self->missing_value, &missing)) != GRIB_SUCCESS) return ret; @@ -267,21 +166,18 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_statistics* self = (grib_accessor_statistics*)a; +int grib_accessor_class_statistics_t::value_count(grib_accessor* a, long* count){ + grib_accessor_statistics_t* self = (grib_accessor_statistics_t*)a; *count = self->number_of_elements; return 0; } -static void destroy(grib_context* c, grib_accessor* a) -{ - grib_accessor_statistics* self = (grib_accessor_statistics*)a; +void grib_accessor_class_statistics_t::destroy(grib_context* c, grib_accessor* a){ + grib_accessor_statistics_t* self = (grib_accessor_statistics_t*)a; grib_context_free(c, self->v); } -static int compare(grib_accessor* a, grib_accessor* b) -{ +int grib_accessor_class_statistics_t::compare(grib_accessor* a, grib_accessor* b){ int retval = GRIB_SUCCESS; double* aval = 0; double* bval = 0; @@ -291,13 +187,11 @@ static int compare(grib_accessor* a, grib_accessor* b) int err = 0; long count = 0; - err = grib_value_count(a, &count); - if (err) + err = a->value_count(&count); if (err) return err; alen = count; - err = grib_value_count(b, &count); - if (err) + err = b->value_count(&count); if (err) return err; blen = count; @@ -310,9 +204,7 @@ static int compare(grib_accessor* a, grib_accessor* b) b->dirty = 1; a->dirty = 1; - grib_unpack_double(a, aval, &alen); - grib_unpack_double(b, bval, &blen); - + a->unpack_double(aval, &alen); b->unpack_double(bval, &blen); retval = GRIB_SUCCESS; for (size_t i=0; ivalues = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->J = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->K = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->M = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->JS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + + self->number_of_elements = 4; + self->v = (double*)grib_context_malloc(a->context, + sizeof(double) * self->number_of_elements); + + a->length = 0; + a->dirty = 1; +} + +int grib_accessor_class_statistics_spectral_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_statistics_spectral_t* self = (grib_accessor_statistics_spectral_t*)a; + int ret = 0, i = 0; + double* values; + size_t size = 0; + long J, K, M, N; + double avg, enorm, sd; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if (!a->dirty) + return GRIB_SUCCESS; + + if (*len != self->number_of_elements) + return GRIB_ARRAY_TOO_SMALL; + + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long(grib_handle_of_accessor(a), self->J, &J)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long(grib_handle_of_accessor(a), self->K, &K)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long(grib_handle_of_accessor(a), self->M, &M)) != GRIB_SUCCESS) + return ret; + + if (J != M || M != K) + return GRIB_NOT_IMPLEMENTED; + + N = (M + 1) * (M + 2) / 2; + + if (2 * N != size) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "wrong number of components for spherical harmonics %ld != %ld", 2 * N, size); + return GRIB_WRONG_ARRAY_SIZE; + } + + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; + + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return ret; + } + + avg = values[0]; + sd = 0; + + for (i = 2; i < 2 * J; i += 2) + sd += values[i] * values[i]; + + for (i = 2 * J; i < size; i += 2) + sd += 2 * values[i] * values[i] + 2 * values[i + 1] * values[i + 1]; + + enorm = sd + avg * avg; + + sd = sqrt(sd); + enorm = sqrt(enorm); + + a->dirty = 0; + + grib_context_free(c, values); + + self->v[0] = avg; + self->v[1] = enorm; + self->v[2] = sd; + self->v[3] = sd == 0 ? 1 : 0; + + for (i = 0; i < self->number_of_elements; i++) + val[i] = self->v[i]; + + return ret; +} + +int grib_accessor_class_statistics_spectral_t::value_count(grib_accessor* a, long* count){ + grib_accessor_statistics_spectral_t* self = (grib_accessor_statistics_spectral_t*)a; + *count = self->number_of_elements; + return 0; +} + +void grib_accessor_class_statistics_spectral_t::destroy(grib_context* c, grib_accessor* a){ + grib_accessor_statistics_spectral_t* self = (grib_accessor_statistics_spectral_t*)a; + grib_context_free(c, self->v); +} + +int grib_accessor_class_statistics_spectral_t::compare(grib_accessor* a, grib_accessor* b){ + int retval = GRIB_SUCCESS; + double* aval = 0; + double* bval = 0; + + size_t alen = 0; + size_t blen = 0; + int err = 0; + long count = 0; + + err = a->value_count(&count); if (err) + return err; + alen = count; + + err = b->value_count(&count); if (err) + return err; + blen = count; + + if (alen != blen) + return GRIB_COUNT_MISMATCH; + + aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); + bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); + + b->dirty = 1; + a->dirty = 1; + + a->unpack_double(aval, &alen); b->unpack_double(bval, &blen); + retval = GRIB_SUCCESS; + for (size_t i=0; icontext, aval); + grib_context_free(b->context, bval); + + return retval; +} diff --git a/src/accessor/grib_accessor_class_statistics_spectral.h b/src/accessor/grib_accessor_class_statistics_spectral.h new file mode 100644 index 000000000..8075ddf31 --- /dev/null +++ b/src/accessor/grib_accessor_class_statistics_spectral.h @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_statistics_spectral_h +#define eccodes_accessor_statistics_spectral_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_abstract_vector.h" + +class grib_accessor_statistics_spectral_t : public grib_accessor_abstract_vector_t +{ +public: + /* Members defined in statistics_spectral */ + const char* values; + const char* J; + const char* K; + const char* M; + const char* JS; +}; + +class grib_accessor_class_statistics_spectral_t : public grib_accessor_class_abstract_vector_t +{ +public: + grib_accessor_class_statistics_spectral_t(const char* name) : grib_accessor_class_abstract_vector_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_statistics_spectral_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_statistics_spectral_h */ diff --git a/src/accessor/grib_accessor_class_step_human_readable.cc b/src/accessor/grib_accessor_class_step_human_readable.cc new file mode 100644 index 000000000..153468565 --- /dev/null +++ b/src/accessor/grib_accessor_class_step_human_readable.cc @@ -0,0 +1,79 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_step_human_readable.h" + +grib_accessor_class_step_human_readable_t _grib_accessor_class_step_human_readable{"step_human_readable"}; +grib_accessor_class* grib_accessor_class_step_human_readable = &_grib_accessor_class_step_human_readable; + + +void grib_accessor_class_step_human_readable_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_step_human_readable_t* self = (grib_accessor_step_human_readable_t*)a; + int n = 0; + grib_handle* h = grib_handle_of_accessor(a); + + self->stepUnits = grib_arguments_get_name(h, params, n++); + self->step = grib_arguments_get_name(h, params, n++); + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_step_human_readable_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_STRING; +} + +int get_step_human_readable(grib_handle* h, char* result, size_t* length){ + int err = 0; + size_t slen = 2; + long step, hour, minute, second; + + /* Change units to seconds (highest resolution) + * before computing the step value + */ + if ((err = grib_set_string(h, "stepUnits", "s", &slen)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long(h, "step", &step)) != GRIB_SUCCESS) + return err; + + hour = step/3600; + minute = step/60 % 60; + second = step % 60; + /* sprintf(result, "%ld:%ld:%ld", hour, minute, second); */ + + if (second) { + snprintf(result, 1024, "%ldh %ldm %lds", hour, minute, second); + } else { + if (minute) snprintf(result, 1024, "%ldh %ldm", hour, minute); + else snprintf(result, 1024, "%ldh", hour); + } + + *length = strlen(result); + return GRIB_SUCCESS; +} + +int grib_accessor_class_step_human_readable_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ + grib_accessor_step_human_readable_t* self = (grib_accessor_step_human_readable_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + long stepUnits; + int err = 0; + + /* Save the current value of stepUnits */ + err = grib_get_long_internal(h, self->stepUnits, &stepUnits); + if (err) return err; + + /* This will change stepUnits to seconds for its calculation */ + err = get_step_human_readable(h, buffer, len); + + /* Restore stepUnits */ + grib_set_long(h, self->stepUnits, stepUnits); + return err; +} diff --git a/src/accessor/grib_accessor_class_step_human_readable.h b/src/accessor/grib_accessor_class_step_human_readable.h new file mode 100644 index 000000000..793ecb618 --- /dev/null +++ b/src/accessor/grib_accessor_class_step_human_readable.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_step_human_readable_h +#define eccodes_accessor_step_human_readable_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_step_human_readable_t : public grib_accessor_gen_t +{ +public: + /* Members defined in step_human_readable */ + const char* stepUnits; + const char* step; +}; + +class grib_accessor_class_step_human_readable_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_step_human_readable_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_step_human_readable_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_step_human_readable_h */ diff --git a/src/accessor/todo/grib_accessor_class_step_in_units.cc b/src/accessor/grib_accessor_class_step_in_units.cc similarity index 63% rename from src/accessor/todo/grib_accessor_class_step_in_units.cc rename to src/accessor/grib_accessor_class_step_in_units.cc index a25c85aec..4d7cb6cf9 100644 --- a/src/accessor/todo/grib_accessor_class_step_in_units.cc +++ b/src/accessor/grib_accessor_class_step_in_units.cc @@ -1,3 +1,4 @@ + /* * (C) Copyright 2005- ECMWF. * @@ -9,120 +10,17 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_step_in_units.h" #include "step.h" #include "step_utilities.h" #include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = unpack_double - IMPLEMENTS = unpack_string;pack_string - IMPLEMENTS = init;dump - IMPLEMENTS = get_native_type - MEMBERS = const char* forecast_time_value - MEMBERS = const char* forecast_time_unit - MEMBERS = const char* step_units - MEMBERS = const char* time_range_unit - MEMBERS = const char* time_range_value - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -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 unpack_double(grib_accessor*, double* 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 void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_step_in_units -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in step_in_units */ - const char* forecast_time_value; - const char* forecast_time_unit; - const char* step_units; - const char* time_range_unit; - const char* time_range_value; -} grib_accessor_step_in_units; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_step_in_units = { - &grib_accessor_class_long, /* super */ - "step_in_units", /* name */ - sizeof(grib_accessor_step_in_units), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - +grib_accessor_class_step_in_units_t _grib_accessor_class_step_in_units{"step_in_units"}; grib_accessor_class* grib_accessor_class_step_in_units = &_grib_accessor_class_step_in_units; -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_step_in_units* self = (grib_accessor_step_in_units*)a; +void grib_accessor_class_step_in_units_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_step_in_units_t* self = (grib_accessor_step_in_units_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; @@ -133,14 +31,12 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->time_range_value = grib_arguments_get_name(hand, c, n++); } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ +void grib_accessor_class_step_in_units_t::dump(grib_accessor* a, grib_dumper* dumper){ grib_dump_double(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - const grib_accessor_step_in_units* self = (grib_accessor_step_in_units*)a; +int grib_accessor_class_step_in_units_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + const grib_accessor_step_in_units_t* self = (grib_accessor_step_in_units_t*)a; int err = 0; long forecast_time_value, forecast_time_unit, step_units; grib_handle* h = grib_handle_of_accessor(a); @@ -169,9 +65,8 @@ 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) -{ - const grib_accessor_step_in_units* self = (grib_accessor_step_in_units*)a; +int grib_accessor_class_step_in_units_t::unpack_double(grib_accessor* a, double * val, size_t* len){ + const grib_accessor_step_in_units_t* self = (grib_accessor_step_in_units_t*)a; int err = 0; long forecast_time_value, forecast_time_unit, step_units; grib_handle* h = grib_handle_of_accessor(a); @@ -199,9 +94,8 @@ static int unpack_double(grib_accessor* a, double * val, size_t* len) return GRIB_SUCCESS; } -static int pack_long_new_(grib_accessor* a, const long start_step_value, const long start_step_unit, const long force_step_units) -{ - const grib_accessor_step_in_units* self = (grib_accessor_step_in_units*)a; +int pack_long_new_(grib_accessor* a, const long start_step_value, const long start_step_unit, const long force_step_units){ + const grib_accessor_step_in_units_t* self = (grib_accessor_step_in_units_t*)a; grib_handle* h = grib_handle_of_accessor(a); int err = 0; long forecast_time_unit; @@ -211,7 +105,7 @@ static int pack_long_new_(grib_accessor* a, const long start_step_value, const l if ((err = grib_get_long_internal(h, self->forecast_time_unit, &forecast_time_unit)) != GRIB_SUCCESS) return err; - if ((err = unpack_long(a, &start_step_value_old, &len)) != GRIB_SUCCESS) + if ((err = a->unpack_long(&start_step_value_old, &len)) != GRIB_SUCCESS) return err; if ((err = grib_get_long_internal(h, "startStepUnit", &start_step_unit_old)) != GRIB_SUCCESS) return err; @@ -249,8 +143,7 @@ static int pack_long_new_(grib_accessor* a, const long start_step_value, const l return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ +int grib_accessor_class_step_in_units_t::pack_long(grib_accessor* a, const long* val, size_t* len){ grib_handle* h = grib_handle_of_accessor(a); int ret = GRIB_SUCCESS; @@ -281,8 +174,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return ret; } -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ +int grib_accessor_class_step_in_units_t::pack_string(grib_accessor* a, const char* val, size_t* len){ grib_handle* h = grib_handle_of_accessor(a); //long force_step_units = eccodes::Unit(eccodes::Unit::Value::MISSING).value(); int ret = GRIB_SUCCESS; @@ -303,9 +195,8 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - const grib_accessor_step_in_units* self = (grib_accessor_step_in_units*)a; +int grib_accessor_class_step_in_units_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + const grib_accessor_step_in_units_t* self = (grib_accessor_step_in_units_t*)a; grib_handle* h = grib_handle_of_accessor(a); int ret = GRIB_SUCCESS; long start_step_value = 0; @@ -347,8 +238,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) return GRIB_SUCCESS; } -static int get_native_type(grib_accessor* a) -{ +int grib_accessor_class_step_in_units_t::get_native_type(grib_accessor* a){ grib_handle* h = grib_handle_of_accessor(a); const int show_units_for_hours = a->context->grib_hourly_steps_with_units; diff --git a/src/accessor/grib_accessor_class_step_in_units.h b/src/accessor/grib_accessor_class_step_in_units.h new file mode 100644 index 000000000..ba088db79 --- /dev/null +++ b/src/accessor/grib_accessor_class_step_in_units.h @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_step_in_units_h +#define eccodes_accessor_step_in_units_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_step_in_units_t : public grib_accessor_long_t +{ +public: + /* Members defined in step_in_units */ + const char* forecast_time_value; + const char* forecast_time_unit; + const char* step_units; + const char* time_range_unit; + const char* time_range_value; +}; + +class grib_accessor_class_step_in_units_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_step_in_units_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_step_in_units_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_step_in_units_h */ diff --git a/src/accessor/grib_accessor_class_sum.cc b/src/accessor/grib_accessor_class_sum.cc new file mode 100644 index 000000000..5129ade27 --- /dev/null +++ b/src/accessor/grib_accessor_class_sum.cc @@ -0,0 +1,107 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_sum.h" + +grib_accessor_class_sum_t _grib_accessor_class_sum{"sum"}; +grib_accessor_class* grib_accessor_class_sum = &_grib_accessor_class_sum; + + +void grib_accessor_class_sum_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_sum_t* self = (grib_accessor_sum_t*)a; + int n = 0; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_sum_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_sum_t* self = (grib_accessor_sum_t*)a; + int ret = 0; + size_t size = 0; + long* values = 0; + long i; + long count = 0; + + ret = value_count(a, &count); + if (ret) + return ret; + size = count; + + if (size == 0) { + *val = 0; + return GRIB_SUCCESS; + } + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + if (!values) + return GRIB_OUT_OF_MEMORY; + + grib_get_long_array(grib_handle_of_accessor(a), self->values, values, &size); + + *val = 0; + for (i = 0; i < size; i++) + *val += values[i]; + + grib_context_free(a->context, values); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_sum_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_sum_t* self = (grib_accessor_sum_t*)a; + int ret = 0; + size_t size = 0; + double* values = 0; + long i; + long count = 0; + + ret = value_count(a, &count); + if (ret) + return ret; + size = count; + + if (size == 0) { + *val = 0; + return GRIB_SUCCESS; + } + values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); + if (!values) + return GRIB_OUT_OF_MEMORY; + + ret = grib_get_double_array(grib_handle_of_accessor(a), self->values, values, &size); + if (ret) { + grib_context_free(a->context, values); + return ret; + } + *val = 0; + for (i = 0; i < size; i++) + *val += values[i]; + + grib_context_free(a->context, values); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_sum_t::value_count(grib_accessor* a, long* count){ + grib_accessor_sum_t* self = (grib_accessor_sum_t*)a; + size_t n = 0; + int ret = 0; + + ret = grib_get_size(grib_handle_of_accessor(a), self->values, &n); + *count = n; + + if (ret) + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s is unable to get size of %s", a->name, self->values); + + return ret; +} diff --git a/src/accessor/grib_accessor_class_sum.h b/src/accessor/grib_accessor_class_sum.h new file mode 100644 index 000000000..ceedb788a --- /dev/null +++ b/src/accessor/grib_accessor_class_sum.h @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_sum_h +#define eccodes_accessor_sum_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_sum_t : public grib_accessor_double_t +{ +public: + /* Members defined in sum */ + const char* values; +}; + +class grib_accessor_class_sum_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_sum_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_sum_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_sum_h */ diff --git a/src/accessor/grib_accessor_class_suppressed.cc b/src/accessor/grib_accessor_class_suppressed.cc new file mode 100644 index 000000000..a209e8326 --- /dev/null +++ b/src/accessor/grib_accessor_class_suppressed.cc @@ -0,0 +1,65 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_suppressed.h" + +grib_accessor_class_suppressed_t _grib_accessor_class_suppressed{"suppressed"}; +grib_accessor_class* grib_accessor_class_suppressed = &_grib_accessor_class_suppressed; + + +void grib_accessor_class_suppressed_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_suppressed_t* self = (grib_accessor_suppressed_t*)a; + self->args = c; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +void log_message(grib_accessor* a){ + grib_accessor_suppressed_t* self = (grib_accessor_suppressed_t*)a; + int i = 0; + grib_handle* hand = grib_handle_of_accessor(a); + + grib_context_log(a->context, GRIB_LOG_ERROR, + "key '%s' is unavailable in this version.", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, + "Please use the following key(s):"); + while (grib_arguments_get_name(hand, self->args, i)) { + grib_context_log(a->context, GRIB_LOG_ERROR, "\t- %s", + grib_arguments_get_name(hand, self->args, i)); + i++; + } +} + +int grib_accessor_class_suppressed_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + log_message(a); + return GRIB_NOT_FOUND; +} + +int grib_accessor_class_suppressed_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + log_message(a); + return GRIB_NOT_FOUND; +} + +int grib_accessor_class_suppressed_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + log_message(a); + return GRIB_NOT_FOUND; +} + +int grib_accessor_class_suppressed_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +int grib_accessor_class_suppressed_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_STRING; +} diff --git a/src/accessor/grib_accessor_class_suppressed.h b/src/accessor/grib_accessor_class_suppressed.h new file mode 100644 index 000000000..c8a93274e --- /dev/null +++ b/src/accessor/grib_accessor_class_suppressed.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_suppressed_h +#define eccodes_accessor_suppressed_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_suppressed_t : public grib_accessor_long_t +{ +public: + /* Members defined in suppressed */ + grib_arguments* args; +}; + +class grib_accessor_class_suppressed_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_suppressed_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_suppressed_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_suppressed_h */ diff --git a/src/accessor/grib_accessor_class_time.cc b/src/accessor/grib_accessor_class_time.cc new file mode 100644 index 000000000..e31de829f --- /dev/null +++ b/src/accessor/grib_accessor_class_time.cc @@ -0,0 +1,113 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_time.h" + +grib_accessor_class_time_t _grib_accessor_class_time{"time"}; +grib_accessor_class* grib_accessor_class_time = &_grib_accessor_class_time; + + +void grib_accessor_class_time_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_time_t* self = (grib_accessor_time_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; + + self->hour = grib_arguments_get_name(hand, c, n++); + self->minute = grib_arguments_get_name(hand, c, n++); + self->second = grib_arguments_get_name(hand, c, n++); +} + +int grib_accessor_class_time_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + const grib_accessor_time_t* self = (grib_accessor_time_t*)a; + + int ret = 0; + long hour = 0, minute = 0, second = 0; + grib_handle* hand = grib_handle_of_accessor(a); + + if ((ret = grib_get_long_internal(hand, self->hour, &hour)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->minute, &minute)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->second, &second)) != GRIB_SUCCESS) + return ret; + + /* We ignore the 'seconds' in our time calculation! */ + if (second != 0) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "Key %s (%s): Truncating time: non-zero seconds(%ld) ignored", a->name, __func__, second); + } + + if (*len < 1) + return GRIB_WRONG_ARRAY_SIZE; + + *val = hour * 100 + minute; + + if (hour == 255) { + *val = 12 * 100; + } + if (hour != 255 && minute == 255) { + *val = hour * 100; + } + return GRIB_SUCCESS; +} + +int grib_accessor_class_time_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + const grib_accessor_time_t* self = (grib_accessor_time_t*)a; + + int ret = 0; + long v = val[0]; + grib_handle* hand = grib_handle_of_accessor(a); + long hour = 0, minute = 0, second = 0; + + if (*len != 1) + return GRIB_WRONG_ARRAY_SIZE; + + if (!is_time_valid(v)) { + // ECC-1777: For now just a warning. Will later change to an error + fprintf(stderr, "ECCODES WARNING : %s:%s: Time is not valid! hour=%ld min=%ld sec=%ld\n", + a->cclass->name, __func__, hour, minute, second); + // return GRIB_ENCODING_ERROR; + } + + hour = v / 100; + minute = v % 100; + second = 0; /* We ignore the 'seconds' in our time calculation! */ + + if ((ret = grib_set_long_internal(hand, self->hour, hour)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(hand, self->minute, minute)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(hand, self->second, second)) != GRIB_SUCCESS) + return ret; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_time_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + long v = 0; + size_t lsize = 1, lmin = 5; + + unpack_long(a, &v, &lsize); + + if (*len < lmin) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + a->cclass->name, a->name, lmin, *len); + *len = lmin; + return GRIB_BUFFER_TOO_SMALL; + } + + snprintf(val, 64, "%04ld", v); + + len[0] = lmin; + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_time.h b/src/accessor/grib_accessor_class_time.h new file mode 100644 index 000000000..b1826e1d6 --- /dev/null +++ b/src/accessor/grib_accessor_class_time.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_time_h +#define eccodes_accessor_time_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_time_t : public grib_accessor_long_t +{ +public: + /* Members defined in time */ + const char* hour; + const char* minute; + const char* second; +}; + +class grib_accessor_class_time_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_time_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_time_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_time_h */ diff --git a/src/accessor/grib_accessor_class_to_double.cc b/src/accessor/grib_accessor_class_to_double.cc new file mode 100644 index 000000000..8e9e8a0dc --- /dev/null +++ b/src/accessor/grib_accessor_class_to_double.cc @@ -0,0 +1,130 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_to_double.h" + +grib_accessor_class_to_double_t _grib_accessor_class_to_double{"to_double"}; +grib_accessor_class* grib_accessor_class_to_double = &_grib_accessor_class_to_double; + + +void grib_accessor_class_to_double_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_to_double_t* self = (grib_accessor_to_double_t*)a; + + self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); + self->start = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); + self->length = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 2); + self->scale = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 3); + if (!self->scale) + self->scale = 1; + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; +} + +int grib_accessor_class_to_double_t::value_count(grib_accessor* a, long* count){ + grib_accessor_to_double_t* self = (grib_accessor_to_double_t*)a; + size_t size = 0; + + int err = grib_get_size(grib_handle_of_accessor(a), self->key, &size); + *count = size; + + return err; +} + +size_t grib_accessor_class_to_double_t::string_length(grib_accessor* a){ + grib_accessor_to_double_t* self = (grib_accessor_to_double_t*)a; + size_t size = 0; + + if (self->length) + return self->length; + + grib_get_string_length_acc(a, &size); + return size; +} + +void grib_accessor_class_to_double_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_string(dumper, a, NULL); +} + +int grib_accessor_class_to_double_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} + +int grib_accessor_class_to_double_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_to_double_t* self = (grib_accessor_to_double_t*)a; + + int err = 0; + char buff[512] = {0,}; + size_t size = 512; + size_t length = string_length(a); + + if (*len < length + 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", + *len, a->name, a->length + 1); + *len = length + 1; + return GRIB_ARRAY_TOO_SMALL; + } + + err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); + if (err) + return err; + if (length > size) { + err = GRIB_STRING_TOO_SMALL; + length = size; + } + + memcpy(val, buff + self->start, length); + + val[length] = 0; + *len = length; + return err; +} + +int grib_accessor_class_to_double_t::unpack_long(grib_accessor* a, long* v, size_t* len){ + grib_accessor_to_double_t* self = (grib_accessor_to_double_t*)a; + char val[1024] = {0,}; + size_t l = sizeof(val); + char* last = NULL; + int err = a->unpack_string(val, &l); + if (err) + return err; + + *v = strtol(val, &last, 10); + if (*last) { + err = GRIB_WRONG_CONVERSION; + } + *v /= self->scale; + + return err; +} + +int grib_accessor_class_to_double_t::unpack_double(grib_accessor* a, double* v, size_t* len){ + grib_accessor_to_double_t* self = (grib_accessor_to_double_t*)a; + char val[1024] = {0,}; + size_t l = sizeof(val); + char* last = NULL; + int err = a->unpack_string(val, &l); + if (err) + return err; + + *v = strtod(val, &last); + if (*last) { + err = GRIB_WRONG_CONVERSION; + } + *v /= self->scale; + + return err; +} + +long grib_accessor_class_to_double_t::next_offset(grib_accessor* a){ + return a->offset + a->length; +} diff --git a/src/accessor/grib_accessor_class_to_double.h b/src/accessor/grib_accessor_class_to_double.h new file mode 100644 index 000000000..a2010cc1e --- /dev/null +++ b/src/accessor/grib_accessor_class_to_double.h @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_to_double_h +#define eccodes_accessor_to_double_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_to_double_t : public grib_accessor_gen_t +{ +public: + /* Members defined in to_double */ + const char* key; + long start; + size_t length; + long scale; +}; + +class grib_accessor_class_to_double_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_to_double_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_to_double_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_to_double_h */ diff --git a/src/accessor/grib_accessor_class_to_integer.cc b/src/accessor/grib_accessor_class_to_integer.cc new file mode 100644 index 000000000..06f268974 --- /dev/null +++ b/src/accessor/grib_accessor_class_to_integer.cc @@ -0,0 +1,132 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_to_integer.h" + +grib_accessor_class_to_integer_t _grib_accessor_class_to_integer{"to_integer"}; +grib_accessor_class* grib_accessor_class_to_integer = &_grib_accessor_class_to_integer; + + +void grib_accessor_class_to_integer_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_to_integer_t* self = (grib_accessor_to_integer_t*)a; + + self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); + self->start = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); + self->length = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 2); + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; +} + +int grib_accessor_class_to_integer_t::value_count(grib_accessor* a, long* count){ + grib_accessor_to_integer_t* self = (grib_accessor_to_integer_t*)a; + size_t size = 0; + + int err = grib_get_size(grib_handle_of_accessor(a), self->key, &size); + *count = size; + + return err; +} + +size_t grib_accessor_class_to_integer_t::string_length(grib_accessor* a){ + grib_accessor_to_integer_t* self = (grib_accessor_to_integer_t*)a; + size_t size = 0; + + if (self->length) + return self->length; + + grib_get_string_length(grib_handle_of_accessor(a), self->key, &size); + return size; +} + +void grib_accessor_class_to_integer_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_long(dumper, a, NULL); +} + +int grib_accessor_class_to_integer_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} + +int grib_accessor_class_to_integer_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_to_integer_t* self = (grib_accessor_to_integer_t*)a; + + int err = 0; + char buff[512] = {0,}; + size_t size = 512; + + size_t length = string_length(a); + + if (*len < length + 1) { + const char* cclass_name = a->cclass->name; + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + cclass_name, a->name, length+1, *len); + *len = length + 1; + return GRIB_BUFFER_TOO_SMALL; + } + + err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); + if (err) + return err; + if (length > size) { + /*err=GRIB_STRING_TOO_SMALL;*/ + length = size; + } + + memcpy(val, buff + self->start, length); + + val[length] = 0; + *len = length; + return GRIB_SUCCESS; +} + +int grib_accessor_class_to_integer_t::pack_string(grib_accessor* a, const char* val, size_t* len){ + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_to_integer_t::pack_long(grib_accessor* a, const long* v, size_t* len){ + grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as an integer", a->name); + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_to_integer_t::pack_double(grib_accessor* a, const double* v, size_t* len){ + grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as a double", a->name); + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_to_integer_t::unpack_long(grib_accessor* a, long* v, size_t* len){ + char val[1024] = {0,}; + size_t l = sizeof(val); + char* last = NULL; + int err = unpack_string(a, val, &l); + + if (err) + return err; + + *v = strtol(val, &last, 10); + /* if (*last) {err=GRIB_WRONG_CONVERSION;} */ + + return GRIB_SUCCESS; +} + +int grib_accessor_class_to_integer_t::unpack_double(grib_accessor* a, double* v, size_t* len){ + size_t l = 1; + long val = 0; + int err = unpack_long(a, &val, &l); + + *v = (double)val; + return err; +} + +long grib_accessor_class_to_integer_t::next_offset(grib_accessor* a){ + return a->offset + a->length; +} diff --git a/src/accessor/grib_accessor_class_to_integer.h b/src/accessor/grib_accessor_class_to_integer.h new file mode 100644 index 000000000..3ee9dd87b --- /dev/null +++ b/src/accessor/grib_accessor_class_to_integer.h @@ -0,0 +1,45 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_to_integer_h +#define eccodes_accessor_to_integer_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_to_integer_t : public grib_accessor_gen_t +{ +public: + /* Members defined in to_integer */ + const char* key; + long start; + size_t length; +}; + +class grib_accessor_class_to_integer_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_to_integer_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_to_integer_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_to_integer_h */ diff --git a/src/accessor/grib_accessor_class_to_string.cc b/src/accessor/grib_accessor_class_to_string.cc new file mode 100644 index 000000000..fd70a7feb --- /dev/null +++ b/src/accessor/grib_accessor_class_to_string.cc @@ -0,0 +1,120 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_to_string.h" + +grib_accessor_class_to_string_t _grib_accessor_class_to_string{"to_string"}; +grib_accessor_class* grib_accessor_class_to_string = &_grib_accessor_class_to_string; + + +void grib_accessor_class_to_string_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_to_string_t* self = (grib_accessor_to_string_t*)a; + + self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); + self->start = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); + self->length = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 2); + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; +} + +int grib_accessor_class_to_string_t::value_count(grib_accessor* a, long* count){ + grib_accessor_to_string_t* self = (grib_accessor_to_string_t*)a; + size_t size = 0; + + int err = grib_get_size(grib_handle_of_accessor(a), self->key, &size); + *count = size; + + return err; +} + +size_t grib_accessor_class_to_string_t::string_length(grib_accessor* a){ + grib_accessor_to_string_t* self = (grib_accessor_to_string_t*)a; + + if (self->length) + return self->length; + + size_t size = 0; + grib_get_string_length(grib_handle_of_accessor(a), self->key, &size); + return size; +} + +void grib_accessor_class_to_string_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_string(dumper, a, NULL); +} + +int grib_accessor_class_to_string_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_STRING; +} + +int grib_accessor_class_to_string_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_to_string_t* self = (grib_accessor_to_string_t*)a; + + int err = 0; + char buff[512] = {0,}; + + size_t length = string_length(a); + + if (*len < length + 1) { + const char* cclass_name = a->cclass->name; + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + cclass_name, a->name, length+1, *len); + *len = length + 1; + return GRIB_BUFFER_TOO_SMALL; + } + + size_t size = sizeof(buff); + err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); + if (err) + return err; + if (length > size) { + /*err=GRIB_STRING_TOO_SMALL;*/ + length = size; + } + + memcpy(val, buff + self->start, length); + + val[length] = 0; + *len = length; + return GRIB_SUCCESS; +} + +int grib_accessor_class_to_string_t::unpack_long(grib_accessor* a, long* v, size_t* len){ + char val[1024] = {0,}; + size_t l = sizeof(val); + char* last = NULL; + int err = unpack_string(a, val, &l); + + if (err) + return err; + + *v = strtol(val, &last, 10); + if (*last) { + err = GRIB_WRONG_CONVERSION; + } + + return err; +} + +int grib_accessor_class_to_string_t::unpack_double(grib_accessor* a, double* v, size_t* len){ + size_t l = 1; + long val = 0; + int err = unpack_long(a, &val, &l); + + *v = (double)val; + return err; +} + +long grib_accessor_class_to_string_t::next_offset(grib_accessor* a){ + return a->offset + a->length; +} diff --git a/src/accessor/grib_accessor_class_to_string.h b/src/accessor/grib_accessor_class_to_string.h new file mode 100644 index 000000000..0907cb82c --- /dev/null +++ b/src/accessor/grib_accessor_class_to_string.h @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_to_string_h +#define eccodes_accessor_to_string_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_to_string_t : public grib_accessor_gen_t +{ +public: + /* Members defined in to_string */ + const char* key; + long start; + size_t length; +}; + +class grib_accessor_class_to_string_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_to_string_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_to_string_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_to_string_h */ diff --git a/src/accessor/grib_accessor_class_transient_darray.cc b/src/accessor/grib_accessor_class_transient_darray.cc new file mode 100644 index 000000000..d5372e3ca --- /dev/null +++ b/src/accessor/grib_accessor_class_transient_darray.cc @@ -0,0 +1,111 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_transient_darray.h" + +grib_accessor_class_transient_darray_t _grib_accessor_class_transient_darray{"transient_darray"}; +grib_accessor_class* grib_accessor_class_transient_darray = &_grib_accessor_class_transient_darray; + + +void grib_accessor_class_transient_darray_t::init(grib_accessor* a, const long length, grib_arguments* args){ + grib_accessor_transient_darray_t* self = (grib_accessor_transient_darray_t*)a; + self->arr = NULL; + self->type = GRIB_TYPE_DOUBLE; + a->length = 0; +} + +void grib_accessor_class_transient_darray_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_double(dumper, a, NULL); +} + +int grib_accessor_class_transient_darray_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_transient_darray_t* self = (grib_accessor_transient_darray_t*)a; + + if (self->arr) + grib_darray_delete(a->context, self->arr); + self->arr = grib_darray_new(a->context, *len, 10); + + for (size_t i = 0; i < *len; i++) + grib_darray_push(a->context, self->arr, val[i]); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_transient_darray_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_transient_darray_t* self = (grib_accessor_transient_darray_t*)a; + + if (self->arr) + grib_darray_delete(a->context, self->arr); + self->arr = grib_darray_new(a->context, *len, 10); + + for (size_t i = 0; i < *len; i++) + grib_darray_push(a->context, self->arr, (double)val[i]); + + return GRIB_SUCCESS; +} + +int grib_accessor_class_transient_darray_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_transient_darray_t* self = (grib_accessor_transient_darray_t*)a; + long count = 0; + + value_count(a, &count); + + if (*len < count) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s (setting %ld, required %ld) ", a->name, *len, count); + return GRIB_ARRAY_TOO_SMALL; + } + + *len = count; + for (size_t i = 0; i < *len; i++) + val[i] = self->arr->v[i]; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_transient_darray_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_transient_darray_t* self = (grib_accessor_transient_darray_t*)a; + long count = 0; + + value_count(a, &count); + + if (*len < count) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s (setting %ld, required %ld) ", a->name, *len, count); + return GRIB_ARRAY_TOO_SMALL; + } + + *len = count; + for (size_t i = 0; i < *len; i++) + val[i] = (long)self->arr->v[i]; + + return GRIB_SUCCESS; +} + +void grib_accessor_class_transient_darray_t::destroy(grib_context* c, grib_accessor* a){ + grib_accessor_transient_darray_t* self = (grib_accessor_transient_darray_t*)a; + if (self->arr) + grib_darray_delete(a->context, self->arr); +} + +int grib_accessor_class_transient_darray_t::value_count(grib_accessor* a, long* count){ + grib_accessor_transient_darray_t* self = (grib_accessor_transient_darray_t*)a; + if (self->arr) + *count = grib_darray_used_size(self->arr); + else + *count = 0; + + return 0; +} + +int grib_accessor_class_transient_darray_t::get_native_type(grib_accessor* a){ + const grib_accessor_transient_darray_t* self = (grib_accessor_transient_darray_t*)a; + return self->type; +} diff --git a/src/accessor/grib_accessor_class_transient_darray.h b/src/accessor/grib_accessor_class_transient_darray.h new file mode 100644 index 000000000..fe918bd55 --- /dev/null +++ b/src/accessor/grib_accessor_class_transient_darray.h @@ -0,0 +1,41 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_transient_darray_h +#define eccodes_accessor_transient_darray_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_transient_darray_t : public grib_accessor_gen_t +{ +public: + /* Members defined in transient_darray */ + grib_darray* arr; + int type; +}; + +class grib_accessor_class_transient_darray_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_transient_darray_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_transient_darray_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_transient_darray_h */ diff --git a/src/accessor/grib_accessor_class_trim.cc b/src/accessor/grib_accessor_class_trim.cc new file mode 100644 index 000000000..8f45138fe --- /dev/null +++ b/src/accessor/grib_accessor_class_trim.cc @@ -0,0 +1,76 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_trim.h" + +grib_accessor_class_trim_t _grib_accessor_class_trim{"trim"}; +grib_accessor_class* grib_accessor_class_trim = &_grib_accessor_class_trim; + + +void grib_accessor_class_trim_t::init(grib_accessor* a, const long l, grib_arguments* arg){ + int n = 0; + grib_accessor_trim_t* self = (grib_accessor_trim_t*)a; + grib_handle* h = grib_handle_of_accessor(a); + + self->input = grib_arguments_get_name(h, arg, n++); + self->trim_left = grib_arguments_get_long(h, arg, n++); + self->trim_right= grib_arguments_get_long(h, arg, n++); + DEBUG_ASSERT(self->trim_left == 0 || self->trim_left == 1); + DEBUG_ASSERT(self->trim_right == 0 || self->trim_right == 1); +} + +int grib_accessor_class_trim_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + grib_accessor_trim_t* self = (grib_accessor_trim_t*)a; + + int err = 0; + grib_handle* h = grib_handle_of_accessor(a); + char input[256] = {0,}; + size_t size = sizeof(input) / sizeof(*input); + char* pInput = input; + + err = grib_get_string(h, self->input, input, &size); + if (err) return err; + + string_lrtrim(&pInput, self->trim_left, self->trim_right); + snprintf(val, 1024, "%s", pInput); + size = strlen(val); + *len = size + 1; + return GRIB_SUCCESS; +} + +int grib_accessor_class_trim_t::pack_string(grib_accessor* a, const char* val, size_t* len){ + char input[256] = {0,}; + + size_t inputLen = 256; + char buf[256] = {0,}; + char* pBuf = NULL; + int err; + grib_handle* h = grib_handle_of_accessor(a); + grib_accessor_trim_t* self = (grib_accessor_trim_t*)a; + grib_accessor* inputAccesstor = grib_find_accessor(h, self->input); + if (!inputAccesstor) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor for %s not found", self->input); + return GRIB_NOT_FOUND; + } + + if ((err = grib_get_string(h, self->input, input, &inputLen)) != GRIB_SUCCESS) + return err; + + snprintf(buf, sizeof(buf), "%s", val); + pBuf = buf; + string_lrtrim(&pBuf, self->trim_left, self->trim_right); + + return inputAccesstor->pack_string(pBuf, len);} + +size_t grib_accessor_class_trim_t::string_length(grib_accessor* a){ + return 1024; +} diff --git a/src/accessor/grib_accessor_class_trim.h b/src/accessor/grib_accessor_class_trim.h new file mode 100644 index 000000000..9fd6b9230 --- /dev/null +++ b/src/accessor/grib_accessor_class_trim.h @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_trim_h +#define eccodes_accessor_trim_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_trim_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in trim */ + const char* input; + int trim_left; + int trim_right; +}; + +class grib_accessor_class_trim_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_trim_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_trim_t{}; } + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_trim_h */ diff --git a/src/accessor/grib_accessor_class_uint16.cc b/src/accessor/grib_accessor_class_uint16.cc new file mode 100644 index 000000000..b8476105c --- /dev/null +++ b/src/accessor/grib_accessor_class_uint16.cc @@ -0,0 +1,35 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_uint16.h" + +grib_accessor_class_uint16_t _grib_accessor_class_uint16{"uint16"}; +grib_accessor_class* grib_accessor_class_uint16 = &_grib_accessor_class_uint16; + + +int grib_accessor_class_uint16_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + long value = 0; + /*long pos = a->offset;*/ + /*unsigned char* data = grib_handle_of_accessor(a)->buffer->data;*/ + + if (*len < 1) { + return GRIB_ARRAY_TOO_SMALL; + } + + *val = value; + *len = 1; + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_uint16_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_uint16.h b/src/accessor/grib_accessor_class_uint16.h new file mode 100644 index 000000000..0291df85c --- /dev/null +++ b/src/accessor/grib_accessor_class_uint16.h @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint16_h +#define eccodes_accessor_uint16_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint16_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint16 */ +}; + +class grib_accessor_class_uint16_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint16_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint16_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint16_h */ diff --git a/src/accessor/grib_accessor_class_uint32.cc b/src/accessor/grib_accessor_class_uint32.cc new file mode 100644 index 000000000..6465375b6 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint32.cc @@ -0,0 +1,35 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_uint32.h" + +grib_accessor_class_uint32_t _grib_accessor_class_uint32{"uint32"}; +grib_accessor_class* grib_accessor_class_uint32 = &_grib_accessor_class_uint32; + + +int grib_accessor_class_uint32_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + long value = 0; + /* long pos = a->offset; */ + /* unsigned char* data = grib_handle_of_accessor(a)->buffer->data; */ + + if (*len < 1) { + return GRIB_ARRAY_TOO_SMALL; + } + + *val = value; + *len = 1; + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_uint32_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_uint32.h b/src/accessor/grib_accessor_class_uint32.h new file mode 100644 index 000000000..be0457156 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint32.h @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint32_h +#define eccodes_accessor_uint32_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint32_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint32 */ +}; + +class grib_accessor_class_uint32_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint32_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint32_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint32_h */ diff --git a/src/accessor/grib_accessor_class_uint32_little_endian.cc b/src/accessor/grib_accessor_class_uint32_little_endian.cc new file mode 100644 index 000000000..7800d30c0 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint32_little_endian.cc @@ -0,0 +1,35 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_uint32_little_endian.h" + +grib_accessor_class_uint32_little_endian_t _grib_accessor_class_uint32_little_endian{"uint32_little_endian"}; +grib_accessor_class* grib_accessor_class_uint32_little_endian = &_grib_accessor_class_uint32_little_endian; + + +int grib_accessor_class_uint32_little_endian_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + long value = 0; + /* long pos = a->offset; */ + /* unsigned char* data = grib_handle_of_accessor(a)->buffer->data; */ + + if (*len < 1) { + return GRIB_ARRAY_TOO_SMALL; + } + + *val = value; + *len = 1; + return GRIB_NOT_IMPLEMENTED; +} + +int grib_accessor_class_uint32_little_endian_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_uint32_little_endian.h b/src/accessor/grib_accessor_class_uint32_little_endian.h new file mode 100644 index 000000000..4f51d3113 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint32_little_endian.h @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint32_little_endian_h +#define eccodes_accessor_uint32_little_endian_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint32_little_endian_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint32_little_endian */ +}; + +class grib_accessor_class_uint32_little_endian_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint32_little_endian_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint32_little_endian_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint32_little_endian_h */ diff --git a/src/accessor/grib_accessor_class_uint64.cc b/src/accessor/grib_accessor_class_uint64.cc new file mode 100644 index 000000000..302702dab --- /dev/null +++ b/src/accessor/grib_accessor_class_uint64.cc @@ -0,0 +1,51 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_uint64.h" + +grib_accessor_class_uint64_t _grib_accessor_class_uint64{"uint64"}; +grib_accessor_class* grib_accessor_class_uint64 = &_grib_accessor_class_uint64; + + +int grib_accessor_class_uint64_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + long value = 0; + long pos = a->offset; + unsigned char* data = grib_handle_of_accessor(a)->buffer->data; + unsigned long long result = 0, tmp; + int i; + + if (*len < 1) { + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < 8; i++) { + result <<= 8; + result |= data[pos + i]; + } + + value = result; + tmp = value; + + /* Result does not fit in long */ + if (tmp != result) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name, result); + return GRIB_DECODING_ERROR; + } + + *val = value; + *len = 1; + return GRIB_SUCCESS; +} + +int grib_accessor_class_uint64_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_uint64.h b/src/accessor/grib_accessor_class_uint64.h new file mode 100644 index 000000000..04d96b1b8 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint64.h @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint64_h +#define eccodes_accessor_uint64_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint64_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint64 */ +}; + +class grib_accessor_class_uint64_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint64_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint64_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint64_h */ diff --git a/src/accessor/grib_accessor_class_uint64_little_endian.cc b/src/accessor/grib_accessor_class_uint64_little_endian.cc new file mode 100644 index 000000000..80da3d903 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint64_little_endian.cc @@ -0,0 +1,51 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_uint64_little_endian.h" + +grib_accessor_class_uint64_little_endian_t _grib_accessor_class_uint64_little_endian{"uint64_little_endian"}; +grib_accessor_class* grib_accessor_class_uint64_little_endian = &_grib_accessor_class_uint64_little_endian; + + +int grib_accessor_class_uint64_little_endian_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + long value = 0; + long pos = a->offset; + unsigned char* data = grib_handle_of_accessor(a)->buffer->data; + unsigned long long result = 0, tmp; + int i; + + if (*len < 1) { + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 7; i >= 0; i--) { + result <<= 8; + result |= data[pos + i]; + } + + value = result; + tmp = value; + + /* Result does not fit in long */ + if (tmp != result) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name, result); + return GRIB_DECODING_ERROR; + } + + *val = value; + *len = 1; + return GRIB_SUCCESS; +} + +int grib_accessor_class_uint64_little_endian_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_uint64_little_endian.h b/src/accessor/grib_accessor_class_uint64_little_endian.h new file mode 100644 index 000000000..5eb0068bb --- /dev/null +++ b/src/accessor/grib_accessor_class_uint64_little_endian.h @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint64_little_endian_h +#define eccodes_accessor_uint64_little_endian_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint64_little_endian_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint64_little_endian */ +}; + +class grib_accessor_class_uint64_little_endian_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint64_little_endian_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint64_little_endian_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint64_little_endian_h */ diff --git a/src/accessor/grib_accessor_class_uint8.cc b/src/accessor/grib_accessor_class_uint8.cc new file mode 100644 index 000000000..b86079a53 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint8.cc @@ -0,0 +1,37 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_uint8.h" + +grib_accessor_class_uint8_t _grib_accessor_class_uint8{"uint8"}; +grib_accessor_class* grib_accessor_class_uint8 = &_grib_accessor_class_uint8; + + +int grib_accessor_class_uint8_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + long value = 0; + long pos = a->offset; + unsigned char* data = grib_handle_of_accessor(a)->buffer->data; + + if (*len < 1) { + return GRIB_ARRAY_TOO_SMALL; + } + + value = data[pos]; + + *val = value; + *len = 1; + return GRIB_SUCCESS; +} + +int grib_accessor_class_uint8_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} diff --git a/src/accessor/grib_accessor_class_uint8.h b/src/accessor/grib_accessor_class_uint8.h new file mode 100644 index 000000000..8a06d0ceb --- /dev/null +++ b/src/accessor/grib_accessor_class_uint8.h @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint8_h +#define eccodes_accessor_uint8_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint8_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint8 */ +}; + +class grib_accessor_class_uint8_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint8_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint8_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint8_h */ diff --git a/src/accessor/grib_accessor_class_unexpanded_descriptors.cc b/src/accessor/grib_accessor_class_unexpanded_descriptors.cc new file mode 100644 index 000000000..e51262387 --- /dev/null +++ b/src/accessor/grib_accessor_class_unexpanded_descriptors.cc @@ -0,0 +1,132 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_unexpanded_descriptors.h" + +grib_accessor_class_unexpanded_descriptors_t _grib_accessor_class_unexpanded_descriptors{"unexpanded_descriptors"}; +grib_accessor_class* grib_accessor_class_unexpanded_descriptors = &_grib_accessor_class_unexpanded_descriptors; + + +void grib_accessor_class_unexpanded_descriptors_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_unexpanded_descriptors_t* self = (grib_accessor_unexpanded_descriptors_t*)a; + int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + self->unexpandedDescriptorsEncoded = grib_find_accessor(hand, grib_arguments_get_name(hand, args, n++)); + self->createNewData = grib_arguments_get_name(hand, args, n++); + a->length = 0; +} + +int grib_accessor_class_unexpanded_descriptors_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_unexpanded_descriptors_t* self = (grib_accessor_unexpanded_descriptors_t*)a; + int ret = 0; + long pos = 0; + long rlen = 0; + long f, x, y; + long* v = val; + long i; + grib_handle* hand = grib_handle_of_accessor(a); + + pos = accessor_raw_get_offset(self->unexpandedDescriptorsEncoded) * 8; + + ret = value_count(a, &rlen); + if (ret) + return ret; + + if (rlen == 0) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "No descriptors in section 3. Malformed message."); + return GRIB_MESSAGE_MALFORMED; + } + + if (*len < rlen) { + /* grib_context_log(a->context, GRIB_LOG_ERROR, */ + /* " wrong size (%ld) for %s it contains %d values ",*len, a->name , rlen); */ + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < rlen; i++) { + f = grib_decode_unsigned_long(hand->buffer->data, &pos, 2); + x = grib_decode_unsigned_long(hand->buffer->data, &pos, 6); + y = grib_decode_unsigned_long(hand->buffer->data, &pos, 8); + *v++ = f * 100000 + x * 1000 + y; + } + *len = rlen; + return GRIB_SUCCESS; +} + +int grib_accessor_class_unexpanded_descriptors_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_unexpanded_descriptors_t* self = (grib_accessor_unexpanded_descriptors_t*)a; + int ret = 0; + long pos = 0; + unsigned long f, x, y; + unsigned char* buf = NULL; + grib_accessor* expanded = NULL; + size_t buflen = *len * 2; + size_t i = 0, length = *len; + long createNewData = 1; + grib_handle* hand = grib_handle_of_accessor(a); + + grib_get_long(hand, self->createNewData, &createNewData); + + buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen); + + for (i = 0; i < length; i++) { + const long tmp = val[i] % 100000; + f = val[i] / 100000; + x = tmp / 1000; + y = tmp % 1000; + grib_encode_unsigned_longb(buf, f, &pos, 2); + grib_encode_unsigned_longb(buf, x, &pos, 6); + grib_encode_unsigned_longb(buf, y, &pos, 8); + } + + self->unexpandedDescriptorsEncoded->pack_bytes(buf, &buflen); grib_context_free(hand->context, buf); + + if (createNewData == 0) + return ret; + + expanded = grib_find_accessor(hand, "expandedCodes"); + Assert(expanded != NULL); + ret = grib_accessor_class_expanded_descriptors_set_do_expand(expanded, 1); + if (ret != GRIB_SUCCESS) + return ret; + + ret = grib_set_long(hand, "unpack", 3); /* BUFR new data */ + if (ret != GRIB_SUCCESS) + return ret; + + ret = grib_set_long(hand, "unpack", 1); /* Unpack structure */ + + return ret; +} + +int grib_accessor_class_unexpanded_descriptors_t::value_count(grib_accessor* a, long* numberOfUnexpandedDescriptors){ + grib_accessor_unexpanded_descriptors_t* self = (grib_accessor_unexpanded_descriptors_t*)a; + long n = 0; + + self->unexpandedDescriptorsEncoded->value_count(&n); *numberOfUnexpandedDescriptors = n / 2; + + return 0; +} + +long grib_accessor_class_unexpanded_descriptors_t::byte_offset(grib_accessor* a){ + return a->offset; +} + +void grib_accessor_class_unexpanded_descriptors_t::update_size(grib_accessor* a, size_t s){ + a->length = s; +} + +long grib_accessor_class_unexpanded_descriptors_t::next_offset(grib_accessor* a){ + return byte_offset(a) + a->length; +} diff --git a/src/accessor/grib_accessor_class_unexpanded_descriptors.h b/src/accessor/grib_accessor_class_unexpanded_descriptors.h new file mode 100644 index 000000000..12c89f308 --- /dev/null +++ b/src/accessor/grib_accessor_class_unexpanded_descriptors.h @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_unexpanded_descriptors_h +#define eccodes_accessor_unexpanded_descriptors_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_unexpanded_descriptors_t : public grib_accessor_long_t +{ +public: + /* Members defined in unexpanded_descriptors */ + grib_accessor* unexpandedDescriptorsEncoded; + const char* createNewData; +}; + +class grib_accessor_class_unexpanded_descriptors_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_unexpanded_descriptors_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_unexpanded_descriptors_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; +}; +#endif /* eccodes_accessor_unexpanded_descriptors_h */ diff --git a/src/accessor/grib_accessor_class_unpack_bufr_values.cc b/src/accessor/grib_accessor_class_unpack_bufr_values.cc new file mode 100644 index 000000000..f7af4f6fa --- /dev/null +++ b/src/accessor/grib_accessor_class_unpack_bufr_values.cc @@ -0,0 +1,98 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_unpack_bufr_values.h" +#include "grib_accessor_class_bufr_data_array.h" + + + +grib_accessor_class_unpack_bufr_values_t _grib_accessor_class_unpack_bufr_values{"unpack_bufr_values"}; +grib_accessor_class* grib_accessor_class_unpack_bufr_values = &_grib_accessor_class_unpack_bufr_values; + + +void grib_accessor_class_unpack_bufr_values_t::init(grib_accessor* a, const long len, grib_arguments* params){ + char* key; + grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; + key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), params, 0); + self->data_accessor = grib_find_accessor(grib_handle_of_accessor(a), key); + + a->length = 0; +} + +void grib_accessor_class_unpack_bufr_values_t::dump(grib_accessor* a, grib_dumper* dumper){ +} + +int grib_accessor_class_unpack_bufr_values_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len){ + grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; + grib_accessor* data = (grib_accessor*)self->data_accessor; + + return data->unpack_double(0, 0);} + +int grib_accessor_class_unpack_bufr_values_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ + grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; + grib_accessor* data = (grib_accessor*)self->data_accessor; + strcpy(buffer, "0"); + *len=1; + + return data->unpack_double(0, 0);} + +int grib_accessor_class_unpack_bufr_values_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; + grib_accessor* data = (grib_accessor*)self->data_accessor; + + return data->unpack_double(0, 0);} + +int grib_accessor_class_unpack_bufr_values_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; + grib_accessor* data = (grib_accessor*)self->data_accessor; + + return data->unpack_double(0, 0);} + +int grib_accessor_class_unpack_bufr_values_t::value_count(grib_accessor* a, long* count){ + *count = 1; + return 0; +} + +void grib_accessor_class_unpack_bufr_values_t::destroy(grib_context* context, grib_accessor* a){ +} + +int grib_accessor_class_unpack_bufr_values_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_LONG; +} + +// static const char* mode_to_str(int p) +// { +// if (p==CODES_BUFR_UNPACK_STRUCTURE) return "CODES_BUFR_UNPACK_STRUCTURE"; +// if (p==CODES_BUFR_UNPACK_FLAT) return "CODES_BUFR_UNPACK_FLAT"; +// if (p==CODES_BUFR_NEW_DATA) return "CODES_BUFR_NEW_DATA"; +// return "unknown proc flag"; +// } + +int grib_accessor_class_unpack_bufr_values_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + int unpackMode = CODES_BUFR_UNPACK_STRUCTURE; + grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; + grib_accessor* data = (grib_accessor*)self->data_accessor; + + if (*val == 2) + unpackMode = CODES_BUFR_UNPACK_FLAT; + if (*val == 3) + unpackMode = CODES_BUFR_NEW_DATA; + + accessor_bufr_data_array_set_unpackMode(data, unpackMode); + + return data->unpack_double(0, 0);} + +int grib_accessor_class_unpack_bufr_values_t::pack_double(grib_accessor* a, const double* val, size_t* len){ + grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; + grib_accessor* data = (grib_accessor*)self->data_accessor; + + return data->unpack_double(0, 0);} diff --git a/src/accessor/grib_accessor_class_unpack_bufr_values.h b/src/accessor/grib_accessor_class_unpack_bufr_values.h new file mode 100644 index 000000000..7890e7bad --- /dev/null +++ b/src/accessor/grib_accessor_class_unpack_bufr_values.h @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_unpack_bufr_values_h +#define eccodes_accessor_unpack_bufr_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_unpack_bufr_values_t : public grib_accessor_gen_t +{ +public: + /* Members defined in unpack_bufr_values */ + grib_accessor* data_accessor; +}; + +class grib_accessor_class_unpack_bufr_values_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_unpack_bufr_values_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_unpack_bufr_values_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_unpack_bufr_values_h */ diff --git a/src/accessor/grib_accessor_class_unsigned_bits.cc b/src/accessor/grib_accessor_class_unsigned_bits.cc new file mode 100644 index 000000000..25d16fdc3 --- /dev/null +++ b/src/accessor/grib_accessor_class_unsigned_bits.cc @@ -0,0 +1,159 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_unsigned_bits.h" + +grib_accessor_class_unsigned_bits_t _grib_accessor_class_unsigned_bits{"unsigned_bits"}; +grib_accessor_class* grib_accessor_class_unsigned_bits = &_grib_accessor_class_unsigned_bits; + + + +static long compute_byte_count(grib_accessor* a){ + grib_accessor_unsigned_bits_t* self = (grib_accessor_unsigned_bits_t*)a; + long numberOfBits; + long numberOfElements; + int ret = 0; + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfBits); + return 0; + } + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, &numberOfElements); + if (ret) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfElements); + return 0; + } + + return (numberOfBits * numberOfElements + 7) / 8; +} + + +void grib_accessor_class_unsigned_bits_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_unsigned_bits_t* self = (grib_accessor_unsigned_bits_t*)a; + int n = 0; + self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->numberOfElements = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->length = compute_byte_count(a); +} + +int grib_accessor_class_unsigned_bits_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_unsigned_bits_t* self = (grib_accessor_unsigned_bits_t*)a; + int ret = 0; + long pos = a->offset * 8; + long rlen = 0; + long numberOfBits = 0; + + ret = value_count(a, &rlen); + if (ret) + return ret; + + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "Wrong size (%ld) for %s, it contains %ld values", *len, a->name, rlen); + *len = rlen; + return GRIB_ARRAY_TOO_SMALL; + } + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) + return ret; + if (numberOfBits == 0) { + int i; + for (i = 0; i < rlen; i++) + val[i] = 0; + return GRIB_SUCCESS; + } + + grib_decode_long_array(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits, rlen, val); + + *len = rlen; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_unsigned_bits_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_unsigned_bits_t* self = (grib_accessor_unsigned_bits_t*)a; + int ret = 0; + long off = 0; + long numberOfBits = 0; + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned long i = 0; + long rlen = 0; + ret = value_count(a, &rlen); + if (ret) return ret; + + /* + if(*len < rlen) + { + grib_context_log(a->context, GRIB_LOG_ERROR, + "Wrong size for %s it contains %d values ", a->name , rlen ); + return GRIB_ARRAY_TOO_SMALL; + } + */ + if (*len != rlen) + ret = grib_set_long(grib_handle_of_accessor(a), self->numberOfElements, *len); + if (ret) return ret; + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) return ret; + if (numberOfBits == 0) { + grib_buffer_replace(a, NULL, 0, 1, 1); + return GRIB_SUCCESS; + } + + buflen = compute_byte_count(a); + buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen + sizeof(long)); + + for (i = 0; i < *len; i++) + grib_encode_unsigned_longb(buf, val[i], &off, numberOfBits); + + grib_buffer_replace(a, buf, buflen, 1, 1); + + grib_context_free(a->context, buf); + + return ret; +} + +long grib_accessor_class_unsigned_bits_t::byte_count(grib_accessor* a){ + return a->length; +} + +int grib_accessor_class_unsigned_bits_t::value_count(grib_accessor* a, long* numberOfElements){ + grib_accessor_unsigned_bits_t* self = (grib_accessor_unsigned_bits_t*)a; + int ret; + *numberOfElements = 0; + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, numberOfElements); + if (ret) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfElements); + } + + return ret; +} + +long grib_accessor_class_unsigned_bits_t::byte_offset(grib_accessor* a){ + return a->offset; +} + +void grib_accessor_class_unsigned_bits_t::update_size(grib_accessor* a, size_t s){ + a->length = s; +} + +long grib_accessor_class_unsigned_bits_t::next_offset(grib_accessor* a){ + return byte_offset(a) + a->length; +} diff --git a/src/accessor/grib_accessor_class_unsigned_bits.h b/src/accessor/grib_accessor_class_unsigned_bits.h new file mode 100644 index 000000000..62ae48e60 --- /dev/null +++ b/src/accessor/grib_accessor_class_unsigned_bits.h @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_unsigned_bits_h +#define eccodes_accessor_unsigned_bits_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_unsigned_bits_t : public grib_accessor_long_t +{ +public: + /* Members defined in unsigned_bits */ + const char* numberOfBits; + const char* numberOfElements; +}; + +class grib_accessor_class_unsigned_bits_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_unsigned_bits_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_unsigned_bits_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; +}; +#endif /* eccodes_accessor_unsigned_bits_h */ diff --git a/src/accessor/grib_accessor_class_validity_date.cc b/src/accessor/grib_accessor_class_validity_date.cc new file mode 100644 index 000000000..5c250964d --- /dev/null +++ b/src/accessor/grib_accessor_class_validity_date.cc @@ -0,0 +1,96 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_validity_date.h" +#include "shared_functions.h" + +grib_accessor_class_validity_date_t _grib_accessor_class_validity_date{"validity_date"}; +grib_accessor_class* grib_accessor_class_validity_date = &_grib_accessor_class_validity_date; + +void grib_accessor_class_validity_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_validity_date_t* self = (grib_accessor_validity_date_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; + + self->date = grib_arguments_get_name(hand, c, n++); + self->time = grib_arguments_get_name(hand, c, n++); + self->step = grib_arguments_get_name(hand, c, n++); + self->stepUnits = grib_arguments_get_name(hand, c, n++); + self->year = grib_arguments_get_name(hand, c, n++); + self->month = grib_arguments_get_name(hand, c, n++); + self->day = grib_arguments_get_name(hand, c, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_validity_date_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_validity_date_t* self = (grib_accessor_validity_date_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; + long date = 0; + long time = 0; + long step = 0; + long stepUnits = 0; + long hours = 0, minutes = 0, step_mins = 0, tmp, tmp_hrs; + + if (self->year) { + long year, month, day; + if ((ret = grib_get_long_internal(hand, self->year, &year)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->month, &month)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->day, &day)) != GRIB_SUCCESS) + return ret; + *val = year * 10000 + month * 100 + day; + return GRIB_SUCCESS; + } + if ((ret = grib_get_long_internal(hand, self->date, &date)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->time, &time)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long(hand, self->step, &step)) != GRIB_SUCCESS) { + if ((ret = grib_get_long_internal(hand, "endStep", &step)) != GRIB_SUCCESS) { + return ret; /* See ECC-817 */ + } + } + + if (self->stepUnits) { + if ((ret = grib_get_long_internal(hand, self->stepUnits, &stepUnits)) != GRIB_SUCCESS) + return ret; + step_mins = convert_to_minutes(step, stepUnits); + } + + minutes = time % 100; + hours = time / 100; + tmp = minutes + step_mins; /* add the step to our minutes */ + tmp_hrs = tmp / 60; /* how many hours and mins is that? */ + hours += tmp_hrs; /* increment hours */ + + date = grib_date_to_julian(date); + /* does the new 'hours' exceed 24? if so increment julian */ + while (hours >= 24) { + date++; + hours -= 24; + } + /* GRIB-29: Negative forecast time */ + while (hours < 0) { + date--; + hours += 24; + } + + if (*len < 1) + return GRIB_ARRAY_TOO_SMALL; + + *val = grib_julian_to_date(date); + + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_validity_date.h b/src/accessor/grib_accessor_class_validity_date.h new file mode 100644 index 000000000..7a7eea971 --- /dev/null +++ b/src/accessor/grib_accessor_class_validity_date.h @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_validity_date_h +#define eccodes_accessor_validity_date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_validity_date_t : public grib_accessor_long_t +{ +public: + /* Members defined in validity_date */ + const char* date; + const char* time; + const char* step; + const char* stepUnits; + const char* year; + const char* month; + const char* day; +}; + +class grib_accessor_class_validity_date_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_validity_date_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_validity_date_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_validity_date_h */ diff --git a/src/accessor/grib_accessor_class_validity_time.cc b/src/accessor/grib_accessor_class_validity_time.cc new file mode 100644 index 000000000..074bac88e --- /dev/null +++ b/src/accessor/grib_accessor_class_validity_time.cc @@ -0,0 +1,116 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_validity_time.h" +#include "shared_functions.h" + +grib_accessor_class_validity_time_t _grib_accessor_class_validity_time{"validity_time"}; +grib_accessor_class* grib_accessor_class_validity_time = &_grib_accessor_class_validity_time; + + +void grib_accessor_class_validity_time_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_validity_time_t* self = (grib_accessor_validity_time_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; + + self->date = grib_arguments_get_name(hand, c, n++); + self->time = grib_arguments_get_name(hand, c, n++); + self->step = grib_arguments_get_name(hand, c, n++); + self->stepUnits = grib_arguments_get_name(hand, c, n++); + self->hours = grib_arguments_get_name(hand, c, n++); + self->minutes = grib_arguments_get_name(hand, c, n++); + + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +int grib_accessor_class_validity_time_t::unpack_long(grib_accessor* a, long* val, size_t* len){ + grib_accessor_validity_time_t* self = (grib_accessor_validity_time_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; + long date = 0; + long time = 0; + long step = 0; + long stepUnits = 0; + long hours = 0, minutes = 0, step_mins = 0, tmp, tmp_hrs, tmp_mins; + + if (self->hours) { + if ((ret = grib_get_long_internal(hand, self->hours, &hours)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->minutes, &minutes)) != GRIB_SUCCESS) + return ret; + *val = hours * 100 + minutes; + return GRIB_SUCCESS; + } + if ((ret = grib_get_long_internal(hand, self->date, &date)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->time, &time)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long(hand, self->step, &step)) != GRIB_SUCCESS) { + if ((ret = grib_get_long_internal(hand, "endStep", &step)) != GRIB_SUCCESS) { + return ret; /* See ECC-817 */ + } + } + + /* Seconds will always be zero. So convert to minutes */ + if (self->stepUnits) { + if ((ret = grib_get_long_internal(hand, self->stepUnits, &stepUnits)) != GRIB_SUCCESS) + return ret; + step_mins = convert_to_minutes(step, stepUnits); + } + + minutes = time % 100; + hours = time / 100; + tmp = minutes + step_mins; /* add the step to our minutes */ + tmp_hrs = tmp / 60; /* how many hours and mins is that? */ + tmp_mins = tmp % 60; + hours += tmp_hrs; /* increment hours */ + if (hours > 0) { + hours = hours % 24; /* wrap round if >= 24 */ + } + else { + /* GRIB-29: Negative forecast time */ + while (hours < 0) { + hours += 24; + } + } + time = hours * 100 + tmp_mins; + + if (*len < 1) + return GRIB_ARRAY_TOO_SMALL; + + *val = time; + + return GRIB_SUCCESS; +} + +int grib_accessor_class_validity_time_t::unpack_string(grib_accessor* a, char* val, size_t* len){ + int err = 0; + long v = 0; + size_t lsize = 1, lmin = 5; + + err = unpack_long(a, &v, &lsize); + if (err) return err; + + if (*len < lmin) { + const char* cclass_name = a->cclass->name; + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", + cclass_name, a->name, lmin, *len); + *len = lmin; + return GRIB_BUFFER_TOO_SMALL; + } + + snprintf(val, 64, "%04ld", v); + + len[0] = lmin; + return GRIB_SUCCESS; +} diff --git a/src/accessor/grib_accessor_class_validity_time.h b/src/accessor/grib_accessor_class_validity_time.h new file mode 100644 index 000000000..7fe86648a --- /dev/null +++ b/src/accessor/grib_accessor_class_validity_time.h @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_validity_time_h +#define eccodes_accessor_validity_time_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_validity_time_t : public grib_accessor_long_t +{ +public: + /* Members defined in validity_time */ + const char* date; + const char* time; + const char* step; + const char* stepUnits; + const char* hours; + const char* minutes; +}; + +class grib_accessor_class_validity_time_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_validity_time_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_validity_time_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_validity_time_h */ diff --git a/src/accessor/grib_accessor_class_values.cc b/src/accessor/grib_accessor_class_values.cc new file mode 100644 index 000000000..e7009129c --- /dev/null +++ b/src/accessor/grib_accessor_class_values.cc @@ -0,0 +1,139 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_values.h" + +grib_accessor_class_values_t _grib_accessor_class_values{"values"}; +grib_accessor_class* grib_accessor_class_values = &_grib_accessor_class_values; + +long init_length(grib_accessor* a){ + grib_accessor_values_t* self = (grib_accessor_values_t*)a; + int ret = 0; + + long seclen = 0; + long offsetsection = 0; + long offsetdata = 0; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->seclen, &seclen))) + return ret; + + if (seclen == 0) { + /* printf("init_length seclen=0\n"); */ + return 0; + } + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetsection, &offsetsection))) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetdata, &offsetdata))) + return ret; + + /* When reparsing */ + if (offsetdata < offsetsection) { + /* printf("init_length offsetdata < offsetsection=0\n"); */ + Assert(grib_handle_of_accessor(a)->loader); + return 0; + } + + return seclen - (offsetdata - offsetsection); +} + +void grib_accessor_class_values_t::init(grib_accessor* a, const long v, grib_arguments* params){ + grib_accessor_values_t* self = (grib_accessor_values_t*)a; + self->carg = 0; + + self->seclen = grib_arguments_get_name(grib_handle_of_accessor(a), params, self->carg++); + self->offsetdata = grib_arguments_get_name(grib_handle_of_accessor(a), params, self->carg++); + self->offsetsection = grib_arguments_get_name(grib_handle_of_accessor(a), params, self->carg++); + self->dirty = 1; + + a->length = init_length(a); + /* Assert(a->length>=0); */ +} + +int grib_accessor_class_values_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_DOUBLE; +} + +void grib_accessor_class_values_t::dump(grib_accessor* a, grib_dumper* dumper){ + grib_dump_values(dumper, a); +} + +long grib_accessor_class_values_t::byte_count(grib_accessor* a){ + grib_context_log(a->context, GRIB_LOG_DEBUG, "byte_count of %s = %ld", a->name, a->length); + return a->length; +} + +long grib_accessor_class_values_t::byte_offset(grib_accessor* a){ + return a->offset; +} + +long grib_accessor_class_values_t::next_offset(grib_accessor* a){ + return a->offset + a->length; +} + +void grib_accessor_class_values_t::update_size(grib_accessor* a, size_t s){ + grib_context_log(a->context, GRIB_LOG_DEBUG, "updating size of %s old %ld new %ld", a->name, a->length, s); + a->length = s; + Assert(a->length >= 0); +} + +int grib_accessor_class_values_t::compare(grib_accessor* a, grib_accessor* b){ + int retval = 0; + double* aval = 0; + double* bval = 0; + + size_t alen = 0; + size_t blen = 0; + int err = 0; + long count = 0; + + err = a->value_count(&count); if (err) + return err; + alen = count; + + err = b->value_count(&count); if (err) + return err; + blen = count; + + if (alen != blen) + return GRIB_COUNT_MISMATCH; + + aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); + bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); + + a->unpack_double(aval, &alen); b->unpack_double(bval, &blen); + retval = GRIB_SUCCESS; + for (size_t i=0; icontext, aval); + grib_context_free(b->context, bval); + + return retval; +} + +int grib_accessor_class_values_t::pack_long(grib_accessor* a, const long* val, size_t* len){ + grib_accessor_values_t* self = (grib_accessor_values_t*)a; + double* dval = (double*)grib_context_malloc(a->context, *len * sizeof(double)); + + for (size_t i = 0; i < *len; i++) + dval[i] = (double)val[i]; + + int ret = a->pack_double(dval, len); + grib_context_free(a->context, dval); + + self->dirty = 1; + + return ret; +} diff --git a/src/accessor/grib_accessor_class_values.h b/src/accessor/grib_accessor_class_values.h new file mode 100644 index 000000000..a77a5e89c --- /dev/null +++ b/src/accessor/grib_accessor_class_values.h @@ -0,0 +1,44 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_values_h +#define eccodes_accessor_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_values_t : public grib_accessor_gen_t +{ +public: + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; +}; + +class grib_accessor_class_values_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_values_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_values_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_values_h */ diff --git a/src/accessor/grib_accessor_class_vector.cc b/src/accessor/grib_accessor_class_vector.cc new file mode 100644 index 000000000..e48ab1aaf --- /dev/null +++ b/src/accessor/grib_accessor_class_vector.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 "grib_api_internal.h" +#include "grib_accessor_class_vector.h" +#include "grib_accessor_class_abstract_vector.h" + +grib_accessor_class_vector_t _grib_accessor_class_vector{"vector"}; +grib_accessor_class* grib_accessor_class_vector = &_grib_accessor_class_vector; + + +void grib_accessor_class_vector_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_vector_t* self = (grib_accessor_vector_t*)a; + int n = 0; + + self->vector = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->index = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +int grib_accessor_class_vector_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + int err = 0; + size_t size = 0; + double* stat; + grib_accessor_vector_t* self = (grib_accessor_vector_t*)a; + grib_accessor* va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); + grib_accessor_abstract_vector_t* v = (grib_accessor_abstract_vector_t*)va; + + Assert(self->index >= 0); + + if (self->index >= v->number_of_elements) { + grib_context_log(a->context, GRIB_LOG_FATAL, "index=%d number_of_elements=%d for %s", self->index, v->number_of_elements, a->name); + Assert(self->index < v->number_of_elements); + } + + if (va->dirty) { + grib_get_size(grib_handle_of_accessor(a), self->vector, &size); + stat = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); + err = va->unpack_double(stat, &size); grib_context_free(a->context, stat); + if (err) + return err; + } + + *val = v->v[self->index]; + + return err; +} diff --git a/src/accessor/grib_accessor_class_vector.h b/src/accessor/grib_accessor_class_vector.h new file mode 100644 index 000000000..df12303cd --- /dev/null +++ b/src/accessor/grib_accessor_class_vector.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_vector_h +#define eccodes_accessor_vector_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_abstract_vector.h" + +class grib_accessor_vector_t : public grib_accessor_abstract_vector_t +{ +public: + /* Members defined in vector */ + const char* vector; + int index; +}; + +class grib_accessor_class_vector_t : public grib_accessor_class_abstract_vector_t +{ +public: + grib_accessor_class_vector_t(const char* name) : grib_accessor_class_abstract_vector_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_vector_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_vector_h */ diff --git a/src/accessor/grib_accessor_class_when.cc b/src/accessor/grib_accessor_class_when.cc new file mode 100644 index 000000000..0834d0f86 --- /dev/null +++ b/src/accessor/grib_accessor_class_when.cc @@ -0,0 +1,35 @@ + +/* + * (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 "grib_api_internal.h" +#include "grib_accessor_class_when.h" + +grib_accessor_class_when_t _grib_accessor_class_when{"when"}; +grib_accessor_class* grib_accessor_class_when = &_grib_accessor_class_when; + + +void grib_accessor_class_when_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +void grib_accessor_class_when_t::dump(grib_accessor* a, grib_dumper* dumper){ + /* grib_dump_when(dumper,a,NULL); */ +} + +int grib_accessor_class_when_t::notify_change(grib_accessor* a, grib_accessor* changed){ + return grib_action_notify_change(a->creator, a, changed); +} + +int grib_accessor_class_when_t::get_native_type(grib_accessor* a){ + return GRIB_TYPE_UNDEFINED; +} diff --git a/src/accessor/grib_accessor_class_when.h b/src/accessor/grib_accessor_class_when.h new file mode 100644 index 000000000..69f1dffbb --- /dev/null +++ b/src/accessor/grib_accessor_class_when.h @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_when_h +#define eccodes_accessor_when_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_when_t : public grib_accessor_gen_t +{ +public: + /* Members defined in when */ +}; + +class grib_accessor_class_when_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_when_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_when_t{}; } + int get_native_type(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int notify_change(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_when_h */ diff --git a/src/accessor/todo/grib_accessor_class_abstract_long_vector.cc b/src/accessor/todo/grib_accessor_class_abstract_long_vector.cc deleted file mode 100644 index 523e0a740..000000000 --- a/src/accessor/todo/grib_accessor_class_abstract_long_vector.cc +++ /dev/null @@ -1,103 +0,0 @@ -/* - * (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. - */ - -/****************************************************************** - * Enrico Fucile - ******************************************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - MEMBERS = long* v - MEMBERS = long pack_index - MEMBERS = int number_of_elements - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - - -typedef struct grib_accessor_abstract_long_vector -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in abstract_long_vector */ - long* v; - long pack_index; - int number_of_elements; -} grib_accessor_abstract_long_vector; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_abstract_long_vector = { - &grib_accessor_class_gen, /* super */ - "abstract_long_vector", /* name */ - sizeof(grib_accessor_abstract_long_vector), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_abstract_long_vector = &_grib_accessor_class_abstract_long_vector; - -/* END_CLASS_IMP */ diff --git a/src/accessor/todo/grib_accessor_class_abstract_vector.cc b/src/accessor/todo/grib_accessor_class_abstract_vector.cc deleted file mode 100644 index 1353aeffc..000000000 --- a/src/accessor/todo/grib_accessor_class_abstract_vector.cc +++ /dev/null @@ -1,98 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - MEMBERS = double* v - MEMBERS = int number_of_elements - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - - -typedef struct grib_accessor_abstract_vector -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in abstract_vector */ - double* v; - int number_of_elements; -} grib_accessor_abstract_vector; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_abstract_vector = { - &grib_accessor_class_double, /* super */ - "abstract_vector", /* name */ - sizeof(grib_accessor_abstract_vector), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_abstract_vector = &_grib_accessor_class_abstract_vector; - -/* END_CLASS_IMP */ diff --git a/src/accessor/todo/grib_accessor_class_ascii.cc b/src/accessor/todo/grib_accessor_class_ascii.cc deleted file mode 100644 index b0c90182e..000000000 --- a/src/accessor/todo/grib_accessor_class_ascii.cc +++ /dev/null @@ -1,278 +0,0 @@ -/* - * (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. - */ -/*********************************************************** - * Enrico Fucile - ***********************************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_string;pack_string - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = init;dump;string_length - IMPLEMENTS = value_count - IMPLEMENTS = get_native_type - IMPLEMENTS = compare - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 pack_long(grib_accessor*, const long* val, size_t* len); -static int pack_string(grib_accessor*, const char*, size_t* len); -static int unpack_double(grib_accessor*, double* 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 size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_ascii -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ascii */ -} grib_accessor_ascii; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_ascii = { - &grib_accessor_class_gen, /* super */ - "ascii", /* name */ - sizeof(grib_accessor_ascii), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_ascii = &_grib_accessor_class_ascii; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->length = len; - Assert(a->length >= 0); -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static size_t string_length(grib_accessor* a) -{ - return a->length; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_string(dumper, a, NULL); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - size_t i = 0; - grib_handle* hand = grib_handle_of_accessor(a); - const size_t alen = a->length; - - if (*len < (alen + 1)) { - const char* cclass_name = a->cclass->name; - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, alen+1, *len); - *len = alen + 1; - return GRIB_BUFFER_TOO_SMALL; - } - - for (i = 0; i < alen; i++) - val[i] = hand->buffer->data[a->offset + i]; - val[i] = 0; - *len = i; - return GRIB_SUCCESS; -} - -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - size_t i = 0; - grib_handle* hand = grib_handle_of_accessor(a); - const size_t alen = a->length; - if (len[0] > (alen + 1)) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "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 < alen; i++) { - if (i < len[0]) - hand->buffer->data[a->offset + i] = val[i]; - else - hand->buffer->data[a->offset + i] = 0; - } - - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* v, size_t* len) -{ - grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as long (It's a string)", a->name); - return GRIB_NOT_IMPLEMENTED; -} - -static int pack_double(grib_accessor* a, const double* v, size_t* len) -{ - grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as double (It's a string)", a->name); - return GRIB_NOT_IMPLEMENTED; -} - -static int unpack_long(grib_accessor* a, long* v, size_t* len) -{ - char val[1024] = {0,}; - size_t l = sizeof(val); - size_t i = 0; - char* last = NULL; - int err = grib_unpack_string(a, val, &l); - - if (err) - return err; - - i = 0; - while (i < l - 1 && val[i] == ' ') - i++; - - if (val[i] == 0) { - *v = 0; - return 0; - } - if (val[i + 1] == ' ' && i < l - 2) - val[i + 1] = 0; - - *v = strtol(val, &last, 10); - - grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); - return GRIB_SUCCESS; -} - -static int unpack_double(grib_accessor* a, double* v, size_t* len) -{ - char val[1024]; - size_t l = sizeof(val); - char* last = NULL; - - int err = grib_unpack_string(a, val, &l); - if (err) return err; - - *v = strtod(val, &last); - - if (*last == 0) { - 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_WARNING, "Cannot unpack %s as double. Hint: Try unpacking as string", a->name); - - return GRIB_NOT_IMPLEMENTED; -} - -static int compare(grib_accessor* a, grib_accessor* b) -{ - int retval = 0; - char* aval = 0; - char* bval = 0; - int err = 0; - - size_t alen = a->length+1; - size_t blen = b->length+1; - - if (alen != blen) - return GRIB_COUNT_MISMATCH; - - aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); - bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - - err = grib_unpack_string(a, aval, &alen); - if (err) return err; - err = grib_unpack_string(b, bval, &blen); - if (err) return err; - - retval = GRIB_SUCCESS; - if (!STR_EQUAL(aval, bval)) - retval = GRIB_STRING_VALUE_MISMATCH; - - grib_context_free(a->context, aval); - grib_context_free(b->context, bval); - - return retval; -} diff --git a/src/accessor/todo/grib_accessor_class_bit.cc b/src/accessor/todo/grib_accessor_class_bit.cc deleted file mode 100644 index ab81eecda..000000000 --- a/src/accessor/todo/grib_accessor_class_bit.cc +++ /dev/null @@ -1,170 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init - MEMBERS = const char* owner - MEMBERS = int bit_index - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_bit -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in bit */ - const char* owner; - int bit_index; -} grib_accessor_bit; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_bit = { - &grib_accessor_class_long, /* super */ - "bit", /* name */ - sizeof(grib_accessor_bit), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_bit = &_grib_accessor_class_bit; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_bit* self = (grib_accessor_bit*)a; - a->length = 0; - self->owner = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); - self->bit_index = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_bit* self = (grib_accessor_bit*)a; - int ret = 0; - long data = 0; - - if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit: unpack_long: Wrong size for %s, it contains %d values ", a->name, 1); - *len = 1; - return GRIB_ARRAY_TOO_SMALL; - } - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->owner, &data)) != GRIB_SUCCESS) { - *len = 0; - return ret; - } - - if (data & (1 << self->bit_index)) - *val = 1; - else - *val = 0; - - *len = 1; - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_bit* self = (grib_accessor_bit*)a; - - if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit: pack_long: At least one value to pack for %s", a->name); - *len = 1; - return GRIB_ARRAY_TOO_SMALL; - } - - grib_accessor* owner = grib_find_accessor(grib_handle_of_accessor(a), self->owner); - if (!owner) { - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit: Cannot get the owner %s for computing the bit value of %s", - self->owner, a->name); - *len = 0; - return GRIB_NOT_FOUND; - } - - unsigned char* mdata = grib_handle_of_accessor(a)->buffer->data; - mdata += grib_byte_offset(owner); - - /* Note: In the definitions, flagbit numbers go from 7 to 0 (the bit_index), while WMO convention is from 1 to 8 */ - if (a->context->debug) { - /* Print bit positions from 1 (MSB) */ - fprintf(stderr, "ECCODES DEBUG Setting bit %d in %s to %d\n", 8 - self->bit_index, owner->name, (*val > 0) ); - } - grib_set_bit(mdata, 7 - self->bit_index, *val > 0); - - *len = 1; - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_bitmap.cc b/src/accessor/todo/grib_accessor_class_bitmap.cc deleted file mode 100644 index b86b34332..000000000 --- a/src/accessor/todo/grib_accessor_class_bitmap.cc +++ /dev/null @@ -1,297 +0,0 @@ -/* - * (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 "grib_api_internal.h" -#include - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_bytes - IMPLEMENTS = next_offset - IMPLEMENTS = unpack_double;unpack_double_element;unpack_double_element_set - IMPLEMENTS = unpack_float - IMPLEMENTS = unpack_long - IMPLEMENTS = unpack_string - IMPLEMENTS = string_length - IMPLEMENTS = init;dump;update_size - MEMBERS=const char* tableReference - MEMBERS=const char* missing_value - MEMBERS=const char* offsetbsec - MEMBERS=const char* sLength - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 size_t string_length(grib_accessor*); -static long next_offset(grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); -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_bitmap -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ - /* Members defined in bitmap */ - const char* tableReference; - const char* missing_value; - const char* offsetbsec; - const char* sLength; -} grib_accessor_bitmap; - -extern grib_accessor_class* grib_accessor_class_bytes; - -static grib_accessor_class _grib_accessor_class_bitmap = { - &grib_accessor_class_bytes, /* super */ - "bitmap", /* name */ - sizeof(grib_accessor_bitmap), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - &string_length, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_bitmap = &_grib_accessor_class_bitmap; - -/* END_CLASS_IMP */ - - -static void compute_size(grib_accessor* a) -{ - long slen = 0; - long off = 0; - grib_handle* hand = grib_handle_of_accessor(a); - - grib_accessor_bitmap* self = (grib_accessor_bitmap*)a; - grib_get_long_internal(hand, self->offsetbsec, &off); - grib_get_long_internal(hand, self->sLength, &slen); - - if (slen == 0) { - grib_accessor* seclen; - size_t size; - /* Assume reparsing */ - Assert(hand->loader != 0); - if (hand->loader != 0) { - seclen = grib_find_accessor(hand, self->sLength); - Assert(seclen); - grib_get_block_length(seclen->parent, &size); - slen = size; - } - } - - // printf("compute_size off=%ld slen=%ld a->offset=%ld\n", (long)off,(long)slen,(long)a->offset); - - a->length = off + (slen - a->offset); - - if (a->length < 0) { - /* Assume reparsing */ - /*Assert(hand->loader != 0);*/ - a->length = 0; - } - - Assert(a->length >= 0); -} - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_bitmap* self = (grib_accessor_bitmap*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; - - self->tableReference = grib_arguments_get_name(hand, arg, n++); - self->missing_value = grib_arguments_get_name(hand, arg, n++); - self->offsetbsec = grib_arguments_get_name(hand, arg, n++); - self->sLength = grib_arguments_get_name(hand, arg, n++); - - compute_size(a); -} - -static long next_offset(grib_accessor* a) -{ - return grib_byte_offset(a) + grib_byte_count(a); -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - long len = 0; - char label[1024]; - - grib_value_count(a, &len); - - snprintf(label, 1024, "Bitmap of %ld values", len); - grib_dump_bytes(dumper, a, label); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - long pos = a->offset * 8; - long tlen = 0; - const grib_handle* hand = grib_handle_of_accessor(a); - - int 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 = tlen; - return GRIB_ARRAY_TOO_SMALL; - } - - for (long i = 0; i < tlen; i++) { - val[i] = (long)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); - } - *len = tlen; - 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"); - long pos = a->offset * 8; - long tlen; - grib_handle* hand = grib_handle_of_accessor(a); - - int 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 = tlen; - return GRIB_ARRAY_TOO_SMALL; - } - - for (long 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; - - pos += idx; - *val = (double)grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, 1); - - return GRIB_SUCCESS; -} -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ - for (size_t i=0; ilength = s; -} - -static size_t string_length(grib_accessor* a) -{ - return a->length; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_handle* hand = grib_handle_of_accessor(a); - const size_t l = a->length; - - if (*len < l) { - const char* cclass_name = a->cclass->name; - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, l, *len); - *len = l; - return GRIB_BUFFER_TOO_SMALL; - } - - for (long i = 0; i < a->length; i++) { - val[i] = hand->buffer->data[a->offset + i]; - } - - *len = a->length; - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_bits_per_value.cc b/src/accessor/todo/grib_accessor_class_bits_per_value.cc deleted file mode 100644 index 5648a9a69..000000000 --- a/src/accessor/todo/grib_accessor_class_bits_per_value.cc +++ /dev/null @@ -1,165 +0,0 @@ -/* - * (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. - */ - -/********************************** - * Enrico Fucile - *********************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long; pack_long - IMPLEMENTS = init - MEMBERS = const char* values - MEMBERS = const char* bits_per_value - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_bits_per_value -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in bits_per_value */ - const char* values; - const char* bits_per_value; -} grib_accessor_bits_per_value; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_bits_per_value = { - &grib_accessor_class_long, /* super */ - "bits_per_value", /* name */ - sizeof(grib_accessor_bits_per_value), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_bits_per_value = &_grib_accessor_class_bits_per_value; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* args) -{ - int n = 0; - grib_accessor_bits_per_value* self = (grib_accessor_bits_per_value*)a; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - int ret = 0; - grib_accessor_bits_per_value* self = (grib_accessor_bits_per_value*)a; - grib_handle* h = grib_handle_of_accessor(a); - - if ((ret = grib_get_long_internal(h, self->bits_per_value, val)) != GRIB_SUCCESS) - return ret; - - *len = 1; - return ret; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - double* values = NULL; - size_t size = 0; - int ret = 0; - grib_accessor_bits_per_value* self = (grib_accessor_bits_per_value*)a; - grib_context* c = a->context; - grib_handle* h = grib_handle_of_accessor(a); - - if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) - return ret; - - values = (double*)grib_context_malloc(c, size * sizeof(double)); - if (!values) - return GRIB_OUT_OF_MEMORY; - - if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return ret; - } - - if ((ret = grib_set_long_internal(h, self->bits_per_value, *val)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return ret; - } - - if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return ret; - } - - grib_context_free(c, values); - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_blob.cc b/src/accessor/todo/grib_accessor_class_blob.cc deleted file mode 100644 index 7e1c1de62..000000000 --- a/src/accessor/todo/grib_accessor_class_blob.cc +++ /dev/null @@ -1,128 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = get_native_type;init - IMPLEMENTS = unpack_bytes;dump - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_blob -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in blob */ -} grib_accessor_blob; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_blob = { - &grib_accessor_class_gen, /* super */ - "blob", /* name */ - sizeof(grib_accessor_blob), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - &unpack_bytes, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_blob = &_grib_accessor_class_blob; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, arg, 0), &a->length); - Assert(a->length >= 0); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_BYTES; -} - -static int unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len) -{ - if (*len < (size_t)a->length) { - *len = a->length; - return GRIB_ARRAY_TOO_SMALL; - } - *len = a->length; - - memcpy(buffer, grib_handle_of_accessor(a)->buffer->data + a->offset, *len); - - return GRIB_SUCCESS; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_bytes(dumper, a, NULL); -} diff --git a/src/accessor/todo/grib_accessor_class_budgdate.cc b/src/accessor/todo/grib_accessor_class_budgdate.cc deleted file mode 100644 index 15fc9b4bd..000000000 --- a/src/accessor/todo/grib_accessor_class_budgdate.cc +++ /dev/null @@ -1,174 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init - MEMBERS=const char* year - MEMBERS=const char* month - MEMBERS=const char* day - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_budgdate -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in budgdate */ - const char* year; - const char* month; - const char* day; -} grib_accessor_budgdate; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_budgdate = { - &grib_accessor_class_long, /* super */ - "budgdate", /* name */ - sizeof(grib_accessor_budgdate), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_budgdate = &_grib_accessor_class_budgdate; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_budgdate* self = (grib_accessor_budgdate*)a; - int n = 0; - - self->year = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->month = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->day = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - int ret = 0; - grib_accessor_budgdate* self = (grib_accessor_budgdate*)a; - - long year = 0; - long month = 0; - long day = 0; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->day, &day)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->month, &month)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->year, &year)) != GRIB_SUCCESS) - return ret; - - if (*len < 1) - return GRIB_WRONG_ARRAY_SIZE; - - val[0] = (1900 + year) * 10000 + month * 100 + day; - - return ret; -} - -/* TODO: Check for a valid date */ -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - int ret = 0; - long v = val[0]; - grib_accessor_budgdate* self = (grib_accessor_budgdate*)a; - - long year = 0; - long month = 0; - long day = 0; - - if (*len != 1) - return GRIB_WRONG_ARRAY_SIZE; - - year = v / 10000; - v %= 10000; - month = v / 100; - v %= 100; - day = v; - - year -= 1900; - - Assert(year < 255); - - if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->day, day)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->month, month)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->year, year)) != GRIB_SUCCESS) - return ret; - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_bufr_extract_subsets.cc b/src/accessor/todo/grib_accessor_class_bufr_extract_subsets.cc deleted file mode 100644 index 567ceb61a..000000000 --- a/src/accessor/todo/grib_accessor_class_bufr_extract_subsets.cc +++ /dev/null @@ -1,152 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init; get_native_type - IMPLEMENTS = pack_long; - MEMBERS = const char* numericValues - MEMBERS = const char* pack - MEMBERS = grib_accessor* numericValuesAccessor - MEMBERS = grib_accessor* packAccessor - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_bufr_extract_subsets -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bufr_extract_subsets */ - const char* numericValues; - const char* pack; - grib_accessor* numericValuesAccessor; - grib_accessor* packAccessor; -} grib_accessor_bufr_extract_subsets; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_bufr_extract_subsets = { - &grib_accessor_class_gen, /* super */ - "bufr_extract_subsets", /* name */ - sizeof(grib_accessor_bufr_extract_subsets), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_bufr_extract_subsets = &_grib_accessor_class_bufr_extract_subsets; - -/* END_CLASS_IMP */ - -static void get_accessors(grib_accessor* a) -{ - grib_accessor_bufr_extract_subsets* self = (grib_accessor_bufr_extract_subsets*)a; - const grib_handle* h = grib_handle_of_accessor(a); - - if (self->packAccessor) - return; - self->numericValuesAccessor = grib_find_accessor(h, self->numericValues); - self->packAccessor = grib_find_accessor(h, self->pack); -} - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - int n = 0; - grib_accessor_bufr_extract_subsets* self = (grib_accessor_bufr_extract_subsets*)a; - - a->length = 0; - self->numericValues = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); - self->pack = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_bufr_extract_subsets* self = (grib_accessor_bufr_extract_subsets*)a; - size_t l = 1; - long v[1]; - - get_accessors(a); - - v[0] = 1; - int err = grib_pack_long(self->packAccessor, v, &l); - if (err) { - if (err == GRIB_ENCODING_ERROR) - grib_context_log(a->context, GRIB_LOG_ERROR, "Could not extract subset(s).\n\tHint: Did you forget to set unpack=1?"); - return err; - } - - return err; -} diff --git a/src/accessor/todo/grib_accessor_class_bufr_group.cc b/src/accessor/todo/grib_accessor_class_bufr_group.cc deleted file mode 100644 index 9af0a5633..000000000 --- a/src/accessor/todo/grib_accessor_class_bufr_group.cc +++ /dev/null @@ -1,126 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_variable - IMPLEMENTS = dump;next - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static void dump(grib_accessor*, grib_dumper*); -static grib_accessor* next(grib_accessor*, int); - -typedef struct grib_accessor_bufr_group -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in variable */ - double dval; - float fval; - char* cval; - char* cname; - int type; - /* Members defined in bufr_group */ -} grib_accessor_bufr_group; - -extern grib_accessor_class* grib_accessor_class_variable; - -static grib_accessor_class _grib_accessor_class_bufr_group = { - &grib_accessor_class_variable, /* super */ - "bufr_group", /* name */ - sizeof(grib_accessor_bufr_group), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - &next, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_bufr_group = &_grib_accessor_class_bufr_group; - -/* END_CLASS_IMP */ - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_section(dumper, a, a->sub_section->block); -} - -static grib_accessor* next(grib_accessor* a, int explore) -{ - grib_accessor* next = NULL; - if (explore) { - next = a->sub_section->block->first; - if (!next) - next = a->next; - } - else { - next = a->next; - } - if (!next) { - if (a->parent->owner) - next = a->parent->owner->cclass->next(a->parent->owner, 0); - } - return next; -} diff --git a/src/accessor/todo/grib_accessor_class_bufr_simple_thinning.cc b/src/accessor/todo/grib_accessor_class_bufr_simple_thinning.cc deleted file mode 100644 index cd0181fe4..000000000 --- a/src/accessor/todo/grib_accessor_class_bufr_simple_thinning.cc +++ /dev/null @@ -1,211 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init; get_native_type - IMPLEMENTS = pack_long; - MEMBERS = const char* doExtractSubsets - MEMBERS = const char* numberOfSubsets - MEMBERS = const char* extractSubsetList - MEMBERS = const char* simpleThinningStart - MEMBERS = const char* simpleThinningMissingRadius - MEMBERS = const char* simpleThinningSkip - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_bufr_simple_thinning -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bufr_simple_thinning */ - const char* doExtractSubsets; - const char* numberOfSubsets; - const char* extractSubsetList; - const char* simpleThinningStart; - const char* simpleThinningMissingRadius; - const char* simpleThinningSkip; -} grib_accessor_bufr_simple_thinning; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_bufr_simple_thinning = { - &grib_accessor_class_gen, /* super */ - "bufr_simple_thinning", /* name */ - sizeof(grib_accessor_bufr_simple_thinning), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_bufr_simple_thinning = &_grib_accessor_class_bufr_simple_thinning; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_bufr_simple_thinning* self = (grib_accessor_bufr_simple_thinning*)a; - grib_handle* h = grib_handle_of_accessor(a); - int n = 0; - - a->length = 0; - self->doExtractSubsets = grib_arguments_get_name(h, arg, n++); - self->numberOfSubsets = grib_arguments_get_name(h, arg, n++); - self->extractSubsetList = grib_arguments_get_name(h, arg, n++); - self->simpleThinningStart = grib_arguments_get_name(h, arg, n++); - self->simpleThinningMissingRadius = grib_arguments_get_name(h, arg, n++); - self->simpleThinningSkip = grib_arguments_get_name(h, arg, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} - -static int apply_thinning(grib_accessor* a) -{ - const grib_accessor_bufr_simple_thinning* self = (grib_accessor_bufr_simple_thinning*)a; - - long skip; - grib_handle* h = grib_handle_of_accessor(a); - grib_context* c = h->context; - long compressed = 0, nsubsets; - grib_iarray* subsets; - long* subsets_ar = 0; - long start = 0, radius = 0; - - int ret = grib_get_long(h, "compressedData", &compressed); - if (ret) - return ret; - if (compressed) { - long numberOfSubsets = 0; - ret = grib_get_long(h, self->numberOfSubsets, &numberOfSubsets); - if (ret) - return ret; - - ret = grib_get_long(h, self->simpleThinningStart, &start); - if (ret) - return ret; - - ret = grib_get_long(h, self->simpleThinningSkip, &skip); - if (ret) - return ret; - if (skip <= 0) - return GRIB_INVALID_KEY_VALUE; - - ret = grib_get_long(h, self->simpleThinningMissingRadius, &radius); - if (ret) - return ret; - - subsets = grib_iarray_new(c, numberOfSubsets / skip + 1, 10); - for (long i = 0; i < numberOfSubsets; i += skip + 1) { - grib_iarray_push(subsets, i + 1); - } - - nsubsets = grib_iarray_used_size(subsets); - - if (nsubsets != 0) { - subsets_ar = grib_iarray_get_array(subsets); - ret = grib_set_long_array(h, self->extractSubsetList, subsets_ar, nsubsets); - grib_context_free(c, subsets_ar); - if (ret) - return ret; - - ret = grib_set_long(h, "unpack", 1); - if (ret) - return ret; - - ret = grib_set_long(h, self->doExtractSubsets, 1); - if (ret) - return ret; - } - grib_iarray_delete(subsets); - } - else { - return GRIB_NOT_IMPLEMENTED; - } - - return ret; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - const grib_accessor_bufr_simple_thinning* self = (grib_accessor_bufr_simple_thinning*)a; - - if (*len == 0) - return GRIB_SUCCESS; - int err = apply_thinning(a); - if (err) - return err; - - return grib_set_long(a->parent->h, self->doExtractSubsets, 1); -} diff --git a/src/accessor/todo/grib_accessor_class_bufr_string_values.cc b/src/accessor/todo/grib_accessor_class_bufr_string_values.cc deleted file mode 100644 index 02627e763..000000000 --- a/src/accessor/todo/grib_accessor_class_bufr_string_values.cc +++ /dev/null @@ -1,189 +0,0 @@ -/* -* (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. -*/ - -/* Sequences and replication (not delayed) are resolved in this class. - Number of elements to which a delayed replication applies are recomputed to - take account of the expansion. - Expanded descriptors cannot contain sequences and only delayed replication - can appear -*/ - -#include "grib_api_internal.h" -/* -This is used by make_class.pl - -START_CLASS_DEF -CLASS = accessor -SUPER = grib_accessor_class_ascii -IMPLEMENTS = unpack_string_array -IMPLEMENTS = unpack_string -IMPLEMENTS = init;dump;destroy -IMPLEMENTS = value_count -MEMBERS = const char* dataAccessorName -MEMBERS = grib_accessor* dataAccessor - -END_CLASS_DEF - -*/ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_string(grib_accessor*, char*, size_t* len); -static int unpack_string_array(grib_accessor*, char**, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_bufr_string_values -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ascii */ - /* Members defined in bufr_string_values */ - const char* dataAccessorName; - grib_accessor* dataAccessor; -} grib_accessor_bufr_string_values; - -extern grib_accessor_class* grib_accessor_class_ascii; - -static grib_accessor_class _grib_accessor_class_bufr_string_values = { - &grib_accessor_class_ascii, /* super */ - "bufr_string_values", /* name */ - sizeof(grib_accessor_bufr_string_values), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - &unpack_string_array, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_bufr_string_values = &_grib_accessor_class_bufr_string_values; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_bufr_string_values* self = (grib_accessor_bufr_string_values*)a; - int n = 0; - self->dataAccessorName = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->dataAccessor = NULL; - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_string_array(dumper, a, NULL); -} - -static grib_accessor* get_accessor(grib_accessor* a) -{ - grib_accessor_bufr_string_values* self = (grib_accessor_bufr_string_values*)a; - if (!self->dataAccessor) { - self->dataAccessor = grib_find_accessor(grib_handle_of_accessor(a), self->dataAccessorName); - } - return self->dataAccessor; -} - -static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) -{ - grib_accessor* data = 0; - grib_context* c = a->context; - grib_vsarray* stringValues = NULL; - size_t l = 0, tl; - size_t i, j, n = 0; - char** b = buffer; - - data = get_accessor(a); - if (!data) - return GRIB_NOT_FOUND; - - stringValues = accessor_bufr_data_array_get_stringValues(data); - - n = grib_vsarray_used_size(stringValues); - - tl = 0; - for (j = 0; j < n; j++) { - l = grib_sarray_used_size(stringValues->v[j]); - tl += l; - - if (tl > *len) - return GRIB_ARRAY_TOO_SMALL; - - for (i = 0; i < l; i++) { - *(b++) = grib_context_strdup(c, stringValues->v[j]->v[i]); - } - } - *len = tl; - - return GRIB_SUCCESS; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static int value_count(grib_accessor* a, long* rlen) -{ - grib_accessor* descriptors = get_accessor(a); - return grib_value_count(descriptors, rlen); -} - -static void destroy(grib_context* c, grib_accessor* a) -{ -} diff --git a/src/accessor/todo/grib_accessor_class_bufrdc_expanded_descriptors.cc b/src/accessor/todo/grib_accessor_class_bufrdc_expanded_descriptors.cc deleted file mode 100644 index 929e21724..000000000 --- a/src/accessor/todo/grib_accessor_class_bufrdc_expanded_descriptors.cc +++ /dev/null @@ -1,206 +0,0 @@ -/* -* (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. -*/ - -/* Sequences and replication (not delayed) are resolved in this class. - Number of elements to which a delayed replication applies are recomputed to - take account of the expansion. - Expanded descriptors cannot contain sequences and only delayed replication - can appear -*/ - -#include "grib_api_internal.h" -/* -This is used by make_class.pl - -START_CLASS_DEF -CLASS = accessor -SUPER = grib_accessor_class_long -IMPLEMENTS = unpack_long -IMPLEMENTS = unpack_string_array -IMPLEMENTS = init;destroy -IMPLEMENTS = value_count -MEMBERS = const char* expandedDescriptors -MEMBERS = grib_accessor* expandedDescriptorsAccessor - -END_CLASS_DEF - -*/ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int unpack_string_array(grib_accessor*, char**, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_bufrdc_expanded_descriptors -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in bufrdc_expanded_descriptors */ - const char* expandedDescriptors; - grib_accessor* expandedDescriptorsAccessor; -} grib_accessor_bufrdc_expanded_descriptors; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_bufrdc_expanded_descriptors = { - &grib_accessor_class_long, /* super */ - "bufrdc_expanded_descriptors", /* name */ - sizeof(grib_accessor_bufrdc_expanded_descriptors), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - &unpack_string_array, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_bufrdc_expanded_descriptors = &_grib_accessor_class_bufrdc_expanded_descriptors; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_bufrdc_expanded_descriptors* self = (grib_accessor_bufrdc_expanded_descriptors*)a; - int n = 0; - self->expandedDescriptors = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->expandedDescriptorsAccessor = 0; - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static grib_accessor* get_accessor(grib_accessor* a) -{ - grib_accessor_bufrdc_expanded_descriptors* self = (grib_accessor_bufrdc_expanded_descriptors*)a; - if (!self->expandedDescriptorsAccessor) { - self->expandedDescriptorsAccessor = grib_find_accessor(grib_handle_of_accessor(a), self->expandedDescriptors); - } - return self->expandedDescriptorsAccessor; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor* descriptors = 0; - size_t rlen = 0, l; - long lenall = 0; - size_t i = 0; - long* v = 0; - grib_context* c = a->context; - - descriptors = get_accessor(a); - if (!descriptors) return GRIB_NOT_FOUND; - - grib_value_count(a, &lenall); - v = (long*)grib_context_malloc_clear(c, sizeof(long) * lenall); - l = lenall; - grib_unpack_long(descriptors, v, &l); - - rlen = 0; - for (i = 0; i < l; i++) { - if ((v[i] < 100000 || v[i] > 221999)) - val[rlen++] = v[i]; - } - *len = rlen; - grib_context_free(c,v); - - return GRIB_SUCCESS; -} - -static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) -{ - int err = 0; - grib_accessor* descriptors = 0; - size_t l = 0; - long lenall = 0; - size_t i = 0; - long* v = 0; - char buf[25] = {0,}; - grib_context* c = a->context; - - descriptors = get_accessor(a); - if (!descriptors) return GRIB_NOT_FOUND; - - err = grib_value_count(a, &lenall); - if (err) return err; - l = lenall; - if (l > *len) return GRIB_ARRAY_TOO_SMALL; - - v = (long*)grib_context_malloc_clear(c, sizeof(long) * l); - err = grib_unpack_long(descriptors, v, &l); - if (err) return err; - - for (i = 0; i < l; i++) { - snprintf(buf, sizeof(buf), "%06ld", v[i]); - buffer[i] = grib_context_strdup(c, buf); - } - *len = l; - grib_context_free(c,v); - - return GRIB_SUCCESS; -} - -static int value_count(grib_accessor* a, long* rlen) -{ - grib_accessor* descriptors = get_accessor(a); - - return grib_value_count(descriptors, rlen); -} - -static void destroy(grib_context* c, grib_accessor* a) -{ -} diff --git a/src/accessor/todo/grib_accessor_class_bytes.cc b/src/accessor/todo/grib_accessor_class_bytes.cc deleted file mode 100644 index 71533095e..000000000 --- a/src/accessor/todo/grib_accessor_class_bytes.cc +++ /dev/null @@ -1,192 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = get_native_type;init - IMPLEMENTS = compare;unpack_string;pack_string - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_string(grib_accessor*, const char*, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_bytes -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ -} grib_accessor_bytes; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_bytes = { - &grib_accessor_class_gen, /* super */ - "bytes", /* name */ - sizeof(grib_accessor_bytes), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_bytes = &_grib_accessor_class_bytes; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - /*grib_accessor_signed* self = (grib_accessor_signed*)a; */ - a->length = len; - Assert(a->length >= 0); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_BYTES; -} - -static int compare(grib_accessor* a, grib_accessor* b) -{ - int retval = GRIB_SUCCESS; - - size_t alen = (size_t)grib_byte_count(a); - size_t blen = (size_t)grib_byte_count(b); - - if (alen != blen) - return GRIB_COUNT_MISMATCH; - - return retval; -} - -static int unpack_string(grib_accessor* a, char* v, size_t* len) -{ - unsigned char* p = NULL; - char* s = v; - long i = 0; - const long length = grib_byte_count(a); - const long slength = 2 * length; - - if (*len < (size_t)slength) { - *len = slength; - return GRIB_BUFFER_TOO_SMALL; - } - - p = grib_handle_of_accessor(a)->buffer->data + grib_byte_offset(a); - - for (i = 0; i < length; i++) { - snprintf(s, INT_MAX, "%02x", *(p++)); - s += 2; - } - - *len = slength; - - return GRIB_SUCCESS; -} - -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - /* The string representation (val) of the byte array will have two chars - * per byte e.g. 4C5B means the 2 bytes 0114 and 0133 in octal - * so has to be twice the length of the byte array - */ - int err = 0; - grib_accessor_class* super = *(a->cclass->super); - grib_context* c = a->context; - size_t nbytes = a->length; - const size_t expected_blen = nbytes; - const size_t expected_slen = 2 * expected_blen; - unsigned char* bytearray = NULL; - size_t i = 0, slen = strlen(val); - - if (slen != expected_slen || *len != expected_slen) { - grib_context_log(c, GRIB_LOG_ERROR, - "%s: Key %s is %lu bytes. Expected a string with %lu characters (actual length=%zu)", - __func__, a->name, expected_blen, expected_slen, *len); - return GRIB_WRONG_ARRAY_SIZE; - } - - bytearray = (unsigned char*)grib_context_malloc(c, nbytes * (sizeof(unsigned char))); - if (!bytearray) return GRIB_OUT_OF_MEMORY; - - for (i = 0; i < (slen/2); i++) { - unsigned int byteVal = 0; - if (sscanf(val + 2*i, "%02x", &byteVal) != 1) { - grib_context_log(c, GRIB_LOG_ERROR,"%s: Invalid hex byte specfication '%.2s'", __func__, val + 2*i); - grib_context_free(c, bytearray); - return GRIB_INVALID_KEY_VALUE; - } - Assert(byteVal < 256); - bytearray[i] = (int)byteVal; - } - - /* Forward to base class to pack the byte array */ - err = super->pack_bytes(a, bytearray, &nbytes); - grib_context_free(c, bytearray); - return err; -} diff --git a/src/accessor/todo/grib_accessor_class_change_alternative_row_scanning.cc b/src/accessor/todo/grib_accessor_class_change_alternative_row_scanning.cc deleted file mode 100644 index d8eef0eb4..000000000 --- a/src/accessor/todo/grib_accessor_class_change_alternative_row_scanning.cc +++ /dev/null @@ -1,212 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = pack_long; - IMPLEMENTS = unpack_long - IMPLEMENTS = init;get_native_type - MEMBERS = const char* values - MEMBERS = const char* Ni - MEMBERS = const char* Nj - MEMBERS = const char* alternativeRowScanning - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_change_alternative_row_scanning -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in change_alternative_row_scanning */ - const char* values; - const char* Ni; - const char* Nj; - const char* alternativeRowScanning; -} grib_accessor_change_alternative_row_scanning; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_change_alternative_row_scanning = { - &grib_accessor_class_gen, /* super */ - "change_alternative_row_scanning", /* name */ - sizeof(grib_accessor_change_alternative_row_scanning), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_change_alternative_row_scanning = &_grib_accessor_class_change_alternative_row_scanning; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - int n = 0; - grib_accessor_change_alternative_row_scanning* self = (grib_accessor_change_alternative_row_scanning*)a; - - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->Ni = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->Nj = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->alternativeRowScanning = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - int err = 0; - grib_accessor_change_alternative_row_scanning* self = (grib_accessor_change_alternative_row_scanning*)a; - const grib_context* c = a->context; - grib_handle* h = grib_handle_of_accessor(a); - long i, j, jr, theEnd, Ni, Nj, k, kp, alternativeRowScanning; - size_t size = 0; - double* values = NULL; - double tmp = 0.0; - - if (*val == 0) - return 0; - - /* Make sure Ni / Nj are not missing */ - if (grib_is_missing(h, self->Ni, &err) && !err) { - grib_context_log(c, GRIB_LOG_ERROR, "change_alternative_row_scanning: Key %s cannot be 'missing'!", self->Ni); - return GRIB_WRONG_GRID; - } - if (grib_is_missing(h, self->Nj, &err) && !err) { - grib_context_log(c, GRIB_LOG_ERROR, "change_alternative_row_scanning: Key %s cannot be 'missing'!", self->Nj); - return GRIB_WRONG_GRID; - } - - if ((err = grib_get_long_internal(h, self->Ni, &Ni)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(h, self->Nj, &Nj)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(h, self->alternativeRowScanning, &alternativeRowScanning)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) - return err; - - 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; - } - - values = (double*)grib_context_malloc(c, size * sizeof(double)); - if (!values) - return GRIB_OUT_OF_MEMORY; - - if ((err = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return err; - } - - theEnd = Ni / 2; - for (j = 0; j < Nj; j++) { - jr = Ni * j; - for (i = 0; i < theEnd; i++) { - if (j % 2 == 1) { - /* Swap first and last value on every odd row */ - k = jr + i; - kp = jr + Ni - i - 1; - tmp = values[k]; - values[k] = values[kp]; - values[kp] = tmp; - } - } - } - alternativeRowScanning = !alternativeRowScanning; - if ((err = grib_set_long_internal(h, self->alternativeRowScanning, alternativeRowScanning)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return err; - } - - if ((err = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return err; - } - - grib_context_free(c, values); - - return GRIB_SUCCESS; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} - -static int unpack_long(grib_accessor* a, long* v, size_t* len) -{ - /* Decoding this accessor doesn't make sense so we return a dummy value */ - *v = -1; - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_check_internal_version.cc b/src/accessor/todo/grib_accessor_class_check_internal_version.cc deleted file mode 100644 index d59f353de..000000000 --- a/src/accessor/todo/grib_accessor_class_check_internal_version.cc +++ /dev/null @@ -1,136 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_ascii - IMPLEMENTS = value_count;string_length - IMPLEMENTS = init - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_check_internal_version -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ascii */ - /* Members defined in check_internal_version */ -} grib_accessor_check_internal_version; - -extern grib_accessor_class* grib_accessor_class_ascii; - -static grib_accessor_class _grib_accessor_class_check_internal_version = { - &grib_accessor_class_ascii, /* super */ - "check_internal_version", /* name */ - sizeof(grib_accessor_check_internal_version), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_check_internal_version = &_grib_accessor_class_check_internal_version; - -/* END_CLASS_IMP */ - -/* This is the internal engine version number */ -/* We check this against the version number found in the definitions boot.def file */ -/* See the key "internalVersion" */ -#define LATEST_ENGINE_VERSION 30 - -static void init(grib_accessor* a, const long l, grib_arguments* args) -{ - /* Check version of definition files is compatible with the engine */ - int err = 0; - long defs_file_version = 0; - grib_handle* h = grib_handle_of_accessor(a); - const char* s_defn_version = grib_arguments_get_name(h, args, 0); - Assert(s_defn_version); - - err = grib_get_long_internal(h, s_defn_version, &defs_file_version); - if (!err) { - if (defs_file_version > LATEST_ENGINE_VERSION) { - grib_context_log(h->context, GRIB_LOG_FATAL, - "Definition files version (%d) is greater than engine version (%d)!\n" - " " /* indent for 2nd line */ - "These definition files are for a later version of the ecCodes engine.", - defs_file_version, LATEST_ENGINE_VERSION); - } - } -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static size_t string_length(grib_accessor* a) -{ - return 255; -} diff --git a/src/accessor/todo/grib_accessor_class_codeflag.cc b/src/accessor/todo/grib_accessor_class_codeflag.cc deleted file mode 100644 index ab86a64b1..000000000 --- a/src/accessor/todo/grib_accessor_class_codeflag.cc +++ /dev/null @@ -1,216 +0,0 @@ -/* - * (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. - */ - -/**************************************** - * Enrico Fucile - **************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_unsigned - IMPLEMENTS = init;dump - IMPLEMENTS = value_count - MEMBERS = const char* tablename - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_codeflag -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in codeflag */ - const char* tablename; -} grib_accessor_codeflag; - -extern grib_accessor_class* grib_accessor_class_unsigned; - -static grib_accessor_class _grib_accessor_class_codeflag = { - &grib_accessor_class_unsigned, /* super */ - "codeflag", /* name */ - sizeof(grib_accessor_codeflag), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_codeflag = &_grib_accessor_class_codeflag; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* param) -{ - grib_accessor_codeflag* self = (grib_accessor_codeflag*)a; - a->length = len; - self->tablename = grib_arguments_get_string(grib_handle_of_accessor(a), param, 0); - Assert(a->length >= 0); -} - -static int test_bit(long a, long b) -{ - DEBUG_ASSERT(b>=0); - return a & (1 << b); -} - -static int grib_get_codeflag(grib_accessor* a, long code, char* codename) -{ - const grib_accessor_codeflag* self = (grib_accessor_codeflag*)a; - FILE* f = NULL; - char fname[1024]; - char bval[50]; - char num[50]; - char* filename = 0; - char line[1024]; - size_t i = 0; - int j = 0; - int err = 0; - - err = grib_recompose_name(grib_handle_of_accessor(a), NULL, self->tablename, fname, 1); - 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); - strcpy(codename, "Cannot open flag table"); - return GRIB_FILE_NOT_FOUND; - } - - f = codes_fopen(filename, "r"); - if (!f) { - grib_context_log(a->context, (GRIB_LOG_WARNING) | (GRIB_LOG_PERROR), "Cannot open flag table %s", filename); - strcpy(codename, "Cannot open flag table"); - return GRIB_FILE_NOT_FOUND; - } - - // strcpy(codename, self->tablename); - // strcat(codename,": "); - // j = strlen(codename); - - while (fgets(line, sizeof(line) - 1, f)) { - sscanf(line, "%49s %49s", num, bval); - - if (num[0] != '#') { - if ((test_bit(code, a->length * 8 - atol(num)) > 0) == atol(bval)) { - size_t linelen = strlen(line); - codename[j++] = '('; - codename[j++] = num[0]; - codename[j++] = '='; - codename[j++] = bval[0]; - codename[j++] = ')'; - codename[j++] = ' '; - if (j) - codename[j++] = ' '; - - for (i = (strlen(num) + strlen(bval) + 2); i < linelen - 1; i++) - codename[j++] = line[i]; - if (line[i] != '\n') - codename[j++] = line[i]; - codename[j++] = ';'; - } - } - } - - if (j > 1 && codename[j - 1] == ';') - j--; - codename[j] = 0; - - strcat(codename, ":"); - strcat(codename, fname); - - fclose(f); - return GRIB_SUCCESS; -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - const grib_accessor_codeflag* self = (grib_accessor_codeflag*)a; - long v = 0; - char flagname[1024] = {0,}; - char fname[1024] = {0,}; - - size_t llen = 1; - - grib_recompose_name(grib_handle_of_accessor(a), NULL, self->tablename, fname, 1); - grib_unpack_long(a, &v, &llen); - - grib_get_codeflag(a, v, flagname); - - grib_dump_bits(dumper, a, flagname); -} diff --git a/src/accessor/todo/grib_accessor_class_codetable_title.cc b/src/accessor/todo/grib_accessor_class_codetable_title.cc deleted file mode 100644 index 2ddd0f3cb..000000000 --- a/src/accessor/todo/grib_accessor_class_codetable_title.cc +++ /dev/null @@ -1,171 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;unpack_string; get_native_type - MEMBERS = const char* codetable - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_string(grib_accessor*, char*, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_codetable_title -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in codetable_title */ - const char* codetable; -} grib_accessor_codetable_title; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_codetable_title = { - &grib_accessor_class_gen, /* super */ - "codetable_title", /* name */ - sizeof(grib_accessor_codetable_title), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_codetable_title = &_grib_accessor_class_codetable_title; - -/* END_CLASS_IMP */ - -typedef struct grib_accessor_codetable -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in codetable */ - const char* tablename; - const char* masterDir; - const char* localDir; - grib_codetable* table; -} grib_accessor_codetable; - - -static void init(grib_accessor* a, const long len, grib_arguments* params) -{ - grib_accessor_codetable_title* self = (grib_accessor_codetable_title*)a; - int n = 0; - self->codetable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} - -static int unpack_string(grib_accessor* a, char* buffer, size_t* len) -{ - grib_accessor_codetable_title* self = (grib_accessor_codetable_title*)a; - grib_codetable* table = NULL; - - size_t size = 1; - long value; - int err = GRIB_SUCCESS; - char tmp[1024]; - size_t l = 1024; - grib_accessor_codetable* ca = (grib_accessor_codetable*)grib_find_accessor(grib_handle_of_accessor(a), self->codetable); - - if ((err = grib_unpack_long((grib_accessor*)ca, &value, &size)) != GRIB_SUCCESS) - return err; - - table = ca->table; - - if (table && (value >= 0) && (value < table->size) && table->entries[value].title) { - strcpy(tmp, table->entries[value].title); - } - else { - snprintf(tmp, sizeof(tmp), "%d", (int)value); - } - - l = strlen(tmp) + 1; - - if (*len < l) { - const char* cclass_name = a->cclass->name; - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, l, *len); - *len = l; - return GRIB_BUFFER_TOO_SMALL; - } - - strcpy(buffer, tmp); - *len = l; - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_codetable_units.cc b/src/accessor/todo/grib_accessor_class_codetable_units.cc deleted file mode 100644 index de9a9655f..000000000 --- a/src/accessor/todo/grib_accessor_class_codetable_units.cc +++ /dev/null @@ -1,171 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;unpack_string; get_native_type - MEMBERS = const char* codetable - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_string(grib_accessor*, char*, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_codetable_units -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in codetable_units */ - const char* codetable; -} grib_accessor_codetable_units; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_codetable_units = { - &grib_accessor_class_gen, /* super */ - "codetable_units", /* name */ - sizeof(grib_accessor_codetable_units), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_codetable_units = &_grib_accessor_class_codetable_units; - -/* END_CLASS_IMP */ - -typedef struct grib_accessor_codetable -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in codetable */ - const char* tablename; - const char* masterDir; - const char* localDir; - grib_codetable* table; -} grib_accessor_codetable; - -static void init(grib_accessor* a, const long len, grib_arguments* params) -{ - grib_accessor_codetable_units* self = (grib_accessor_codetable_units*)a; - - int n = 0; - self->codetable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} - -static int unpack_string(grib_accessor* a, char* buffer, size_t* len) -{ - grib_accessor_codetable_units* self = (grib_accessor_codetable_units*)a; - grib_codetable* table = NULL; - - size_t size = 1; - long value; - int err = GRIB_SUCCESS; - char tmp[1024]; - size_t l = sizeof(tmp); - grib_accessor_codetable* ca = (grib_accessor_codetable*)grib_find_accessor(grib_handle_of_accessor(a), self->codetable); - - if ((err = grib_unpack_long((grib_accessor*)ca, &value, &size)) != GRIB_SUCCESS) - return err; - - table = ca->table; - - if (table && (value >= 0) && (value < table->size) && table->entries[value].units) { - strcpy(tmp, table->entries[value].units); - } - else { - snprintf(tmp, sizeof(tmp), "%d", (int)value); - } - - l = strlen(tmp) + 1; - - if (*len < l) { - const char* cclass_name = a->cclass->name; - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, l, *len); - *len = l; - return GRIB_BUFFER_TOO_SMALL; - } - - strcpy(buffer, tmp); - *len = l; - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_count_file.cc b/src/accessor/todo/grib_accessor_class_count_file.cc deleted file mode 100644 index 196a48038..000000000 --- a/src/accessor/todo/grib_accessor_class_count_file.cc +++ /dev/null @@ -1,114 +0,0 @@ -/* - * (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. - */ - -/*********************************************** - * Enrico Fucile - **********************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_count_file -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in count_file */ -} grib_accessor_count_file; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_count_file = { - &grib_accessor_class_long, /* super */ - "count_file", /* name */ - sizeof(grib_accessor_count_file), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_count_file = &_grib_accessor_class_count_file; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - *val = grib_context_get_handle_file_count(a->context); - *len = 1; - return 0; -} diff --git a/src/accessor/todo/grib_accessor_class_count_total.cc b/src/accessor/todo/grib_accessor_class_count_total.cc deleted file mode 100644 index 022cc4998..000000000 --- a/src/accessor/todo/grib_accessor_class_count_total.cc +++ /dev/null @@ -1,116 +0,0 @@ -/* - * (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. - */ - - -/*************************************************** - * Enrico Fucile - **************************************************/ - - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_count_total -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in count_total */ -} grib_accessor_count_total; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_count_total = { - &grib_accessor_class_long, /* super */ - "count_total", /* name */ - sizeof(grib_accessor_count_total), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_count_total = &_grib_accessor_class_count_total; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - *val = grib_context_get_handle_total_count(a->context); - *len = 1; - return 0; -} diff --git a/src/accessor/todo/grib_accessor_class_data_dummy_field.cc b/src/accessor/todo/grib_accessor_class_data_dummy_field.cc deleted file mode 100644 index 65b6d5a8f..000000000 --- a/src/accessor/todo/grib_accessor_class_data_dummy_field.cc +++ /dev/null @@ -1,219 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_g1simple_packing - IMPLEMENTS = init - IMPLEMENTS = unpack_double - IMPLEMENTS = value_count - IMPLEMENTS = pack_double - MEMBERS=const char* missing_value - MEMBERS=const char* numberOfPoints - MEMBERS=const char* bitmap - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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*); - -typedef struct grib_accessor_data_dummy_field -{ - 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_g1simple_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - /* Members defined in data_dummy_field */ - const char* missing_value; - const char* numberOfPoints; - const char* bitmap; -} grib_accessor_data_dummy_field; - -extern grib_accessor_class* grib_accessor_class_data_g1simple_packing; - -static grib_accessor_class _grib_accessor_class_data_dummy_field = { - &grib_accessor_class_data_g1simple_packing, /* super */ - "data_dummy_field", /* name */ - sizeof(grib_accessor_data_dummy_field), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_data_dummy_field = &_grib_accessor_class_data_dummy_field; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; - self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; - size_t i = 0, n_vals = 0; - long numberOfPoints; - double missing_value = 0; - int err = 0; - - if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints)) != GRIB_SUCCESS) - return err; - n_vals = numberOfPoints; - - 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; - } - - for (i = 0; i < n_vals; i++) - val[i] = missing_value; - - if (grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) { - if ((err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->bitmap, val, n_vals)) != GRIB_SUCCESS) - return err; - } - - *len = (long)n_vals; - return err; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; - - size_t n_vals = *len; - int err = 0; - long bits_per_value = 0; - long half_byte = 0; - size_t buflen = 0; - unsigned char* buf = NULL; - - if (*len == 0) - return GRIB_NO_VALUES; - - if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) - return err; - - buflen = (1 + ((bits_per_value * n_vals) / 8)) * sizeof(unsigned char); - - buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen); - if (!buf) - return GRIB_OUT_OF_MEMORY; - - half_byte = (buflen * 8) - ((*len) * bits_per_value); - - if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->half_byte, half_byte)) != GRIB_SUCCESS) { - grib_context_free(a->context, buf); - return err; - } - grib_buffer_replace(a, buf, buflen, 1, 1); - - grib_context_free(a->context, buf); - - return GRIB_SUCCESS; -} - -static int value_count(grib_accessor* a, long* numberOfPoints) -{ - grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; - int err = 0; - *numberOfPoints = 0; - - if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints)) != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to get count of %s (%s)", a->name, grib_get_error_message(err)); - } - - return err; -} diff --git a/src/accessor/todo/grib_accessor_class_data_g1complex_packing.cc b/src/accessor/todo/grib_accessor_class_data_g1complex_packing.cc deleted file mode 100644 index 6c8fa5cd6..000000000 --- a/src/accessor/todo/grib_accessor_class_data_g1complex_packing.cc +++ /dev/null @@ -1,235 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_complex_packing - IMPLEMENTS = pack_double - IMPLEMENTS = init - MEMBERS= const char* N - MEMBERS=const char* half_byte - MEMBERS=const char* packingType - MEMBERS=const char* ieee_packing - MEMBERS=const char* precision - END_CLASS_DEF - - */ - - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_double(grib_accessor*, const double* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_data_g1complex_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; - /* Members defined in data_g1complex_packing */ - const char* N; - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; -} grib_accessor_data_g1complex_packing; - -extern grib_accessor_class* grib_accessor_class_data_complex_packing; - -static grib_accessor_class _grib_accessor_class_data_g1complex_packing = { - &grib_accessor_class_data_complex_packing, /* super */ - "data_g1complex_packing", /* name */ - sizeof(grib_accessor_data_g1complex_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_data_g1complex_packing = &_grib_accessor_class_data_g1complex_packing; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g1complex_packing* self = (grib_accessor_data_g1complex_packing*)a; - self->half_byte = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->N = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->packingType = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->ieee_packing = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->edition = 1; - a->flags |= GRIB_ACCESSOR_FLAG_DATA; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_g1complex_packing* self = (grib_accessor_data_g1complex_packing*)a; - int ret = GRIB_SUCCESS; - long seclen = 0; - long sub_j = 0; - long sub_k = 0; - long sub_m = 0; - long n = 0; - long half_byte = 0; - long bits_per_value = 0; - size_t buflen = 0; - grib_accessor_class* super = *(a->cclass->super); - - if (*len == 0) - return GRIB_NO_VALUES; - -// /* TODO: spectral_ieee does not work */ -// if (c->ieee_packing && self->ieee_packing) { -// grib_handle* h = grib_handle_of_accessor(a); -// grib_context* c = a->context; -// char* packingType_s = NULL; -// char* ieee_packing_s = NULL; -// long precision = c->ieee_packing == 32 ? 1 : 2; -// size_t lenstr = strlen(self->ieee_packing); - -// packingType_s = grib_context_strdup(c, self->packingType); -// ieee_packing_s = grib_context_strdup(c, self->ieee_packing); -// precision_s = grib_context_strdup(c, self->precision); - -// grib_set_string(h, packingType_s, ieee_packing_s, &lenstr); -// grib_set_long(h, precision_s, precision); - -// grib_context_free(c, packingType_s); -// grib_context_free(c, ieee_packing_s); -// grib_context_free(c, precision_s); -// return grib_set_double_array(h, "values", val, *len); -// } - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_j, &sub_j)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_k, &sub_k)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_m, &sub_m)) != GRIB_SUCCESS) - return ret; - - self->dirty = 1; - - Assert((sub_j == sub_k) && (sub_m == sub_j)); - - ret = super->pack_double(a, val, len); - - if (ret == GRIB_SUCCESS) { - n = a->offset + 4 * ((sub_k + 1) * (sub_k + 2)); - - /* Octet number starts from beginning of message but shouldn't */ - if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->N, n)) != GRIB_SUCCESS) - return ret; - - // ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetsection, &offsetsection); - // if (ret != GRIB_SUCCESS) - // return ret; - // if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->N, n - offsetsection)) != GRIB_SUCCESS) - // return ret; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value); - if (ret != GRIB_SUCCESS) - return ret; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->seclen, &seclen); - if (ret != GRIB_SUCCESS) - return ret; - - buflen = 32 * (sub_k + 1) * (sub_k + 2) + (*len - (sub_k + 1) * (sub_k + 2)) * bits_per_value + 18 * 8; - half_byte = seclen * 8 - buflen; - if (a->context->debug == -1) { - fprintf(stderr, "ECCODES DEBUG: half_byte=%ld\n", half_byte); - } - - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->half_byte, half_byte); - if (ret != GRIB_SUCCESS) - return ret; - } - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_data_g1secondary_bitmap.cc b/src/accessor/todo/grib_accessor_class_data_g1secondary_bitmap.cc deleted file mode 100644 index 4ae89c576..000000000 --- a/src/accessor/todo/grib_accessor_class_data_g1secondary_bitmap.cc +++ /dev/null @@ -1,220 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_secondary_bitmap - IMPLEMENTS = init - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - MEMBERS=const char* number_of_ones - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_data_g1secondary_bitmap -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in data_secondary_bitmap */ - const char* primary_bitmap; - const char* secondary_bitmap; - const char* missing_value; - const char* expand_by; - /* Members defined in data_g1secondary_bitmap */ - const char* number_of_ones; -} grib_accessor_data_g1secondary_bitmap; - -extern grib_accessor_class* grib_accessor_class_data_secondary_bitmap; - -static grib_accessor_class _grib_accessor_class_data_g1secondary_bitmap = { - &grib_accessor_class_data_secondary_bitmap, /* super */ - "data_g1secondary_bitmap", /* name */ - sizeof(grib_accessor_data_g1secondary_bitmap), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_data_g1secondary_bitmap = &_grib_accessor_class_data_g1secondary_bitmap; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g1secondary_bitmap* self = (grib_accessor_data_g1secondary_bitmap*)a; - self->number_of_ones = grib_arguments_get_name(grib_handle_of_accessor(a), args, 4); -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_data_g1secondary_bitmap* self = (grib_accessor_data_g1secondary_bitmap*)a; - size_t len = 0; - int err = 0; - long expand_by; - *count = 0; - - err = grib_get_long_internal(grib_handle_of_accessor(a), self->expand_by, &expand_by); - if (err) - return err; - - err = grib_get_size(grib_handle_of_accessor(a), self->primary_bitmap, &len); - if (err) - return err; - - *count = expand_by * len; - return GRIB_SUCCESS; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_g1secondary_bitmap* self = (grib_accessor_data_g1secondary_bitmap*)a; - - int err = 0; - - long primary_len = 0; - long secondary_len = 0; - double* primary_bitmap = NULL; - double* secondary_bitmap = NULL; - long i = 0; - long j = 0; - long on = 0; - long k; - long m; - double missing_value = 0; - double present_value = 0; - long expand_by = 0; - - if (*len == 0) - return GRIB_NO_VALUES; - - if ((err = grib_get_long(grib_handle_of_accessor(a), self->expand_by, &expand_by)) != GRIB_SUCCESS) - return err; - if (expand_by <= 0) - return GRIB_ENCODING_ERROR; - - if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) - return err; - - if (*len % expand_by) { - /*TODO: issue warning */ - return GRIB_ENCODING_ERROR; - } - - primary_len = *len / expand_by; - primary_bitmap = (double*)grib_context_malloc_clear(a->context, primary_len * sizeof(double)); - if (!primary_bitmap) - return GRIB_OUT_OF_MEMORY; - - secondary_len = *len; - secondary_bitmap = (double*)grib_context_malloc_clear(a->context, secondary_len * sizeof(double)); - if (!secondary_bitmap) { - grib_context_free(a->context, primary_bitmap); - return GRIB_OUT_OF_MEMORY; - } - - if (missing_value == 0) - present_value = 1; - else - present_value = 0; - - k = 0; - m = 0; - for (i = 0; i < *len; i += expand_by) { - int cnt = 0; - for (j = 0; j < expand_by; j++) - if (val[i + j] == missing_value) - cnt++; - - if (cnt == expand_by) /* all expand_by values are missing */ - primary_bitmap[k++] = missing_value; - else { - primary_bitmap[k++] = present_value; - for (j = 0; j < expand_by; j++) - secondary_bitmap[m++] = val[i + j]; - on++; - } - } - - *len = k; - - /*printf("QQQQQQQ %ld %ld second=%ld\n",primary_len,on,m);*/ - Assert(k == primary_len); - - err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->primary_bitmap, primary_bitmap, k); - if (err == GRIB_SUCCESS) - err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->secondary_bitmap, secondary_bitmap, m); - - grib_context_free(a->context, primary_bitmap); - grib_context_free(a->context, secondary_bitmap); - - if (err == GRIB_SUCCESS) - err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_ones, on); - - return err; -} diff --git a/src/accessor/todo/grib_accessor_class_data_g1shsimple_packing.cc b/src/accessor/todo/grib_accessor_class_data_g1shsimple_packing.cc deleted file mode 100644 index 332b0af0c..000000000 --- a/src/accessor/todo/grib_accessor_class_data_g1shsimple_packing.cc +++ /dev/null @@ -1,150 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_shsimple_packing - IMPLEMENTS = unpack_double - IMPLEMENTS = value_count - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int value_count(grib_accessor*, long*); - -typedef struct grib_accessor_data_g1shsimple_packing -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in data_shsimple_packing */ - const char* coded_values; - const char* real_part; - int dirty; - /* Members defined in data_g1shsimple_packing */ -} grib_accessor_data_g1shsimple_packing; - -extern grib_accessor_class* grib_accessor_class_data_shsimple_packing; - -static grib_accessor_class _grib_accessor_class_data_g1shsimple_packing = { - &grib_accessor_class_data_shsimple_packing, /* super */ - "data_g1shsimple_packing", /* name */ - sizeof(grib_accessor_data_g1shsimple_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_data_g1shsimple_packing = &_grib_accessor_class_data_g1shsimple_packing; - -/* END_CLASS_IMP */ - - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_data_g1shsimple_packing* self = (grib_accessor_data_g1shsimple_packing*)a; - size_t len = 0; - int err = 0; - - err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &len); - len += 1; - - *count = len; - return err; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_g1shsimple_packing* self = (grib_accessor_data_g1shsimple_packing*)a; - int err = GRIB_SUCCESS; - - size_t coded_n_vals = 0; - size_t n_vals = 0; - - if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &coded_n_vals)) != GRIB_SUCCESS) - return err; - - n_vals = coded_n_vals + 1; - - if (*len < n_vals) { - *len = n_vals; - return GRIB_ARRAY_TOO_SMALL; - } - - if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->real_part, val)) != GRIB_SUCCESS) - return err; - - val++; - - if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, &coded_n_vals)) != GRIB_SUCCESS) - return err; - - grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_data_g1shsimple_packing_bitmap : unpack_double : creating %s, %d values", - a->name, n_vals); - - *len = n_vals; - - return err; -} diff --git a/src/accessor/todo/grib_accessor_class_data_g2complex_packing.cc b/src/accessor/todo/grib_accessor_class_data_g2complex_packing.cc deleted file mode 100644 index 98bcaf5cc..000000000 --- a/src/accessor/todo/grib_accessor_class_data_g2complex_packing.cc +++ /dev/null @@ -1,164 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_complex_packing - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - IMPLEMENTS = init - MEMBERS=const char* numberOfValues - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_data_g2complex_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; - /* Members defined in data_g2complex_packing */ - const char* numberOfValues; -} grib_accessor_data_g2complex_packing; - -extern grib_accessor_class* grib_accessor_class_data_complex_packing; - -static grib_accessor_class _grib_accessor_class_data_g2complex_packing = { - &grib_accessor_class_data_complex_packing, /* super */ - "data_g2complex_packing", /* name */ - sizeof(grib_accessor_data_g2complex_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_data_g2complex_packing = &_grib_accessor_class_data_g2complex_packing; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g2complex_packing* self = (grib_accessor_data_g2complex_packing*)a; - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->edition = 2; - - a->flags |= GRIB_ACCESSOR_FLAG_DATA; -} - -static int value_count(grib_accessor* a, long* numberOfValues) -{ - grib_accessor_data_g2complex_packing* self = (grib_accessor_data_g2complex_packing*)a; - *numberOfValues = 0; - - return grib_get_long(grib_handle_of_accessor(a), self->numberOfValues, numberOfValues); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_g2complex_packing* self = (grib_accessor_data_g2complex_packing*)a; - int ret = GRIB_SUCCESS; - grib_accessor_class* super = *(a->cclass->super); - - if (*len == 0) - return GRIB_NO_VALUES; - - ret = super->pack_double(a, val, len); - - if (ret == GRIB_SUCCESS) - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfValues, *len); - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_data_g2secondary_bitmap.cc b/src/accessor/todo/grib_accessor_class_data_g2secondary_bitmap.cc deleted file mode 100644 index cceb3d765..000000000 --- a/src/accessor/todo/grib_accessor_class_data_g2secondary_bitmap.cc +++ /dev/null @@ -1,199 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_secondary_bitmap - IMPLEMENTS = init - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - MEMBERS=const char* number_of_values - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_data_g2secondary_bitmap -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in data_secondary_bitmap */ - const char* primary_bitmap; - const char* secondary_bitmap; - const char* missing_value; - const char* expand_by; - /* Members defined in data_g2secondary_bitmap */ - const char* number_of_values; -} grib_accessor_data_g2secondary_bitmap; - -extern grib_accessor_class* grib_accessor_class_data_secondary_bitmap; - -static grib_accessor_class _grib_accessor_class_data_g2secondary_bitmap = { - &grib_accessor_class_data_secondary_bitmap, /* super */ - "data_g2secondary_bitmap", /* name */ - sizeof(grib_accessor_data_g2secondary_bitmap), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_data_g2secondary_bitmap = &_grib_accessor_class_data_g2secondary_bitmap; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g2secondary_bitmap* self = (grib_accessor_data_g2secondary_bitmap*)a; - self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, 4); -} - -static int value_count(grib_accessor* a, long* len) -{ - grib_accessor_data_g2secondary_bitmap* self = (grib_accessor_data_g2secondary_bitmap*)a; - *len = 0; - return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, len); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_g2secondary_bitmap* self = (grib_accessor_data_g2secondary_bitmap*)a; - int err = 0; - - long primary_len = 0, secondary_len = 0; - double* primary_bitmap = NULL; - double* secondary_bitmap = NULL; - long i = 0, j = 0, k = 0, m = 0; - double missing_value = 0, present_value = 0; - long expand_by = 0; - - if (*len == 0) - return GRIB_NO_VALUES; - - if ((err = grib_get_long(grib_handle_of_accessor(a), self->expand_by, &expand_by)) != GRIB_SUCCESS) - return err; - if (expand_by <= 0) - return GRIB_ENCODING_ERROR; - - if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) - return err; - - if (*len % expand_by) { - /*TODO: issue warning */ - return GRIB_ENCODING_ERROR; - } - - primary_len = *len / expand_by; - primary_bitmap = (double*)grib_context_malloc_clear(a->context, primary_len * sizeof(double)); - if (!primary_bitmap) - return GRIB_OUT_OF_MEMORY; - - secondary_len = *len; - secondary_bitmap = (double*)grib_context_malloc_clear(a->context, secondary_len * sizeof(double)); - if (!secondary_bitmap) { - grib_context_free(a->context, primary_bitmap); - return GRIB_OUT_OF_MEMORY; - } - - if (missing_value == 0) - present_value = 1; - else - present_value = 0; - - k = 0; - m = 0; - for (i = 0; i < *len; i += expand_by) { - int cnt = 0; - for (j = 0; j < expand_by; j++) - if (val[i + j] == missing_value) - cnt++; - - if (cnt == expand_by) /* all expand_by values are missing */ - primary_bitmap[k++] = missing_value; - else { - primary_bitmap[k++] = present_value; - for (j = 0; j < expand_by; j++) - secondary_bitmap[m++] = val[i + j]; - //on++; - } - } - - *len = k; - - Assert(k == primary_len); - - err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->primary_bitmap, primary_bitmap, k); - if (err == GRIB_SUCCESS) - err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->secondary_bitmap, secondary_bitmap, m); - - grib_context_free(a->context, primary_bitmap); - grib_context_free(a->context, secondary_bitmap); - - if (err == GRIB_SUCCESS) - err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, *len * expand_by); - - return err; -} diff --git a/src/accessor/todo/grib_accessor_class_data_g2shsimple_packing.cc b/src/accessor/todo/grib_accessor_class_data_g2shsimple_packing.cc deleted file mode 100644 index bdb1157cf..000000000 --- a/src/accessor/todo/grib_accessor_class_data_g2shsimple_packing.cc +++ /dev/null @@ -1,188 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_shsimple_packing - IMPLEMENTS = init - IMPLEMENTS = unpack_double - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - MEMBERS=const char* numberOfValues - MEMBERS=const char* numberOfDataPoints - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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*); - -typedef struct grib_accessor_data_g2shsimple_packing -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in data_shsimple_packing */ - const char* coded_values; - const char* real_part; - int dirty; - /* Members defined in data_g2shsimple_packing */ - const char* numberOfValues; - const char* numberOfDataPoints; -} grib_accessor_data_g2shsimple_packing; - -extern grib_accessor_class* grib_accessor_class_data_shsimple_packing; - -static grib_accessor_class _grib_accessor_class_data_g2shsimple_packing = { - &grib_accessor_class_data_shsimple_packing, /* super */ - "data_g2shsimple_packing", /* name */ - sizeof(grib_accessor_data_g2shsimple_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_data_g2shsimple_packing = &_grib_accessor_class_data_g2shsimple_packing; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g2shsimple_packing* self = (grib_accessor_data_g2shsimple_packing*)a; - - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), args, 2); - self->numberOfDataPoints = grib_arguments_get_name(grib_handle_of_accessor(a), args, 3); - a->flags |= GRIB_ACCESSOR_FLAG_DATA; -} - -static int value_count(grib_accessor* a, long* len) -{ - grib_accessor_data_g2shsimple_packing* self = (grib_accessor_data_g2shsimple_packing*)a; - *len = 0; - return grib_get_long(grib_handle_of_accessor(a), self->numberOfValues, len); -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_g2shsimple_packing* self = (grib_accessor_data_g2shsimple_packing*)a; - int err = GRIB_SUCCESS; - - size_t n_vals = 0; - - if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &n_vals)) != GRIB_SUCCESS) - return err; - - self->dirty = 0; - - /* n_vals = coded_n_vals+1; */ - - if (*len < n_vals) { - *len = n_vals; - return GRIB_ARRAY_TOO_SMALL; - } - - if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->real_part, val)) != GRIB_SUCCESS) - return err; - - val++; - - if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, &n_vals)) != GRIB_SUCCESS) - return err; - - *len = n_vals; - - return err; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_g2shsimple_packing* self = (grib_accessor_data_g2shsimple_packing*)a; - int err = GRIB_SUCCESS; - - size_t coded_n_vals = *len - 1; - size_t n_vals = *len; - - if (*len == 0) - return GRIB_NO_VALUES; - - self->dirty = 1; - - if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->real_part, *val)) != GRIB_SUCCESS) - return err; - - val++; - - if ((err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, coded_n_vals)) != GRIB_SUCCESS) - return err; - - *len = n_vals; - - if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfValues, (long)n_vals)) != GRIB_SUCCESS) - return err; - if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfDataPoints, (long)n_vals)) != GRIB_SUCCESS) - return err; - - return err; -} diff --git a/src/accessor/todo/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc b/src/accessor/todo/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc deleted file mode 100644 index 88a4de2cb..000000000 --- a/src/accessor/todo/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc +++ /dev/null @@ -1,287 +0,0 @@ -/* - * (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 "grib_api_internal.h" -#define DIRECT 0 -#define INVERSE 1 - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_data_g2simple_packing - IMPLEMENTS = init - IMPLEMENTS = pack_double - IMPLEMENTS = unpack_double - IMPLEMENTS = value_count - MEMBERS=const char* pre_processing - MEMBERS=const char* pre_processing_parameter - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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*); - -typedef struct grib_accessor_data_g2simple_packing_with_preprocessing -{ - 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_g2simple_packing */ - /* Members defined in data_g2simple_packing_with_preprocessing */ - const char* pre_processing; - const char* pre_processing_parameter; -} grib_accessor_data_g2simple_packing_with_preprocessing; - -extern grib_accessor_class* grib_accessor_class_data_g2simple_packing; - -static grib_accessor_class _grib_accessor_class_data_g2simple_packing_with_preprocessing = { - &grib_accessor_class_data_g2simple_packing, /* super */ - "data_g2simple_packing_with_preprocessing", /* name */ - sizeof(grib_accessor_data_g2simple_packing_with_preprocessing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_data_g2simple_packing_with_preprocessing = &_grib_accessor_class_data_g2simple_packing_with_preprocessing; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_g2simple_packing_with_preprocessing* self = (grib_accessor_data_g2simple_packing_with_preprocessing*)a; - self->pre_processing = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->pre_processing_parameter = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - a->flags |= GRIB_ACCESSOR_FLAG_DATA; -} - -static int value_count(grib_accessor* a, long* n_vals) -{ - grib_accessor_data_g2simple_packing_with_preprocessing* self = (grib_accessor_data_g2simple_packing_with_preprocessing*)a; - *n_vals = 0; - - return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); -} - -static int pre_processing_func(double* values, long length, long pre_processing, - double* pre_processing_parameter, int mode) -{ - int i = 0, ret = 0; - double min = values[0]; - double next_min = values[0]; - Assert(length > 0); - - switch (pre_processing) { - /* NONE */ - case 0: - break; - /* LOGARITHM */ - case 1: - if (mode == DIRECT) { - for (i = 0; i < length; i++) { - if (values[i] < min) - min = values[i]; - if (values[i] > next_min) - next_min = values[i]; - } - for (i = 0; i < length; i++) { - if (values[i] > min && values[i] < next_min) - next_min = values[i]; - } - if (min > 0) { - *pre_processing_parameter = 0; - for (i = 0; i < length; i++) { - DEBUG_ASSERT(values[i] > 0); - values[i] = log(values[i]); - } - } - else { - double ppp = 0; - *pre_processing_parameter = next_min - 2 * min; - if (next_min == min) - return ret; - ppp = *pre_processing_parameter; - for (i = 0; i < length; i++) { - DEBUG_ASSERT((values[i] + ppp) > 0); - values[i] = log(values[i] + ppp); - } - } - } - else { - Assert(mode == INVERSE); - if (*pre_processing_parameter == 0) { - for (i = 0; i < length; i++) - values[i] = exp(values[i]); - } - else { - for (i = 0; i < length; i++) - values[i] = exp(values[i]) - *pre_processing_parameter; - } - } - break; - default: - ret = GRIB_NOT_IMPLEMENTED; - break; - } - - return ret; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_g2simple_packing_with_preprocessing* self = (grib_accessor_data_g2simple_packing_with_preprocessing*)a; - grib_accessor_class* super = *(a->cclass->super); - grib_accessor_class* super2 = NULL; - - size_t n_vals = 0; - long nn = 0; - int err = 0; - - long pre_processing; - double pre_processing_parameter; - - err = grib_value_count(a, &nn); - n_vals = nn; - if (err) - return err; - - if (n_vals == 0) { - *len = 0; - return GRIB_SUCCESS; - } - - self->dirty = 0; - - if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->pre_processing, &pre_processing)) != GRIB_SUCCESS) { - return err; - } - - if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->pre_processing_parameter, &pre_processing_parameter)) != GRIB_SUCCESS) { - return err; - } - - Assert(super->super); - super2 = *(super->super); - err = super2->unpack_double(a, val, &n_vals); /* GRIB-364 */ - if (err != GRIB_SUCCESS) - return err; - - err = pre_processing_func(val, n_vals, pre_processing, &pre_processing_parameter, INVERSE); - if (err != GRIB_SUCCESS) - return err; - - *len = (long)n_vals; - - return err; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_g2simple_packing_with_preprocessing* self = (grib_accessor_data_g2simple_packing_with_preprocessing*)a; - grib_accessor_class* super = *(a->cclass->super); - - size_t n_vals = *len; - int err = 0; - - long pre_processing = 0; - double pre_processing_parameter = 0; - - self->dirty = 1; - - if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->pre_processing, &pre_processing)) != GRIB_SUCCESS) - return err; - - err = pre_processing_func((double*)val, n_vals, pre_processing, &pre_processing_parameter, DIRECT); - if (err != GRIB_SUCCESS) - return err; - - err = super->pack_double(a, val, len); - if (err != GRIB_SUCCESS) - return err; - - if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->pre_processing_parameter, pre_processing_parameter)) != GRIB_SUCCESS) - return err; - - if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals)) != GRIB_SUCCESS) - return err; - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_data_raw_packing.cc b/src/accessor/todo/grib_accessor_class_data_raw_packing.cc deleted file mode 100644 index 27c3d62e3..000000000 --- a/src/accessor/todo/grib_accessor_class_data_raw_packing.cc +++ /dev/null @@ -1,306 +0,0 @@ -/* - * (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. - */ -/***************************** - * Enrico Fucile - ****************************/ - -#include "grib_ieeefloat.h" - -#define PRE_PROCESSING_NONE 0 -#define PRE_PROCESSING_DIFFERENCE 1 -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_values - IMPLEMENTS = init - IMPLEMENTS = unpack_double - IMPLEMENTS = unpack_double_element;unpack_double_element_set - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - MEMBERS=const char* number_of_values - MEMBERS=const char* precision - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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*); -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_raw_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_raw_packing */ - const char* number_of_values; - const char* precision; -} grib_accessor_data_raw_packing; - -extern grib_accessor_class* grib_accessor_class_values; - -static grib_accessor_class _grib_accessor_class_data_raw_packing = { - &grib_accessor_class_values, /* super */ - "data_raw_packing", /* name */ - sizeof(grib_accessor_data_raw_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_data_raw_packing = &_grib_accessor_class_data_raw_packing; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_raw_packing* self = (grib_accessor_data_raw_packing*)a; - - self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - a->flags |= GRIB_ACCESSOR_FLAG_DATA; -} - -static int value_count(grib_accessor* a, long* n_vals) -{ - grib_accessor_data_raw_packing* self = (grib_accessor_data_raw_packing*)a; - *n_vals = 0; - return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_raw_packing* self = (grib_accessor_data_raw_packing*)a; - unsigned char* buf = NULL; - int bytes = 0; - size_t nvals = 0; - long inlen = grib_byte_count(a); - - long precision = 0; - - int code = GRIB_SUCCESS; - - if ((code = grib_get_long(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) - return code; - - self->dirty = 0; - - buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - buf += grib_byte_offset(a); - - switch (precision) { - case 1: - bytes = 4; - break; - case 2: - bytes = 8; - break; - default: - return GRIB_NOT_IMPLEMENTED; - } - - nvals = inlen / bytes; - - if (*len < nvals) - return GRIB_ARRAY_TOO_SMALL; - - code = grib_ieee_decode_array(a->context, buf, nvals, bytes, val); - - *len = nvals; - - return code; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_raw_packing* self = (grib_accessor_data_raw_packing*)a; - - int bytes = 0; - unsigned char* buffer = NULL; - - long precision = 0; - - double* values = (double*)val; - size_t inlen = *len; - - /*int free_buffer = 0; - *int free_values = 0;*/ - - int code = GRIB_SUCCESS; - - size_t bufsize = 0; - - if (*len == 0) - return GRIB_NO_VALUES; - - if ((code = grib_get_long_internal(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) - return code; - - self->dirty = 1; - - switch (precision) { - case 1: - bytes = 4; - break; - - case 2: - bytes = 8; - break; - - default: - code = GRIB_NOT_IMPLEMENTED; - goto clean_up; - } - - bufsize = bytes * inlen; - - buffer = (unsigned char*)grib_context_malloc(a->context, bufsize); - - if (!buffer) { - code = GRIB_OUT_OF_MEMORY; - goto clean_up; - } - - code = grib_ieee_encode_array(a->context, values, inlen, bytes, buffer); - -clean_up: - /*if (free_buffer) - * free(buffer); - * if (free_values) - * free(values); - */ - - grib_buffer_replace(a, buffer, bufsize, 1, 1); - - grib_context_buffer_free(a->context, buffer); - - if (code == GRIB_SUCCESS) { - code = grib_set_long(grib_handle_of_accessor(a), self->number_of_values, inlen); - if (code == GRIB_READ_ONLY) - code = 0; - } - - return code; -} - -static int unpack_double_element(grib_accessor* a, size_t idx, double* val) -{ - int ret = 0; - grib_accessor_data_raw_packing* self = (grib_accessor_data_raw_packing*)a; - unsigned char* buf = NULL; - int bytes = 0; - size_t nvals = 0; - long inlen = grib_byte_count(a); - long pos = 0; - long precision = 0; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) - return ret; - - self->dirty = 0; - - buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - buf += grib_byte_offset(a); - - switch (precision) { - case 1: - bytes = 4; - break; - - case 2: - bytes = 8; - break; - - default: - return GRIB_NOT_IMPLEMENTED; - } - - pos = bytes * idx; - - Assert(pos <= inlen); - - nvals = 1; - buf += pos; - - ret = grib_ieee_decode_array(a->context, buf, nvals, bytes, val); - - return ret; -} - -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ - int err = 0; - size_t i = 0; - for (i=0; iprimary_bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); - self->secondary_bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, 1); - self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, 2); - self->expand_by = grib_arguments_get_name(grib_handle_of_accessor(a), args, 3); - - a->length = 0; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_values(dumper, a); -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_secondary_bitmap* self = (grib_accessor_data_secondary_bitmap*)a; - - size_t i = 0; - size_t j = 0; - size_t k = 0; - size_t m = 0; - size_t n_vals = 0; - long nn = 0; - long expand_by = 0; - int err = 0; - size_t primary_len; - size_t secondary_len; - double* primary_vals; - double* secondary_vals; - err = grib_value_count(a, &nn); - n_vals = nn; - if (err) - return err; - - if (*len < n_vals) { - *len = n_vals; - return GRIB_ARRAY_TOO_SMALL; - } - - if ((err = grib_get_long(grib_handle_of_accessor(a), self->expand_by, &expand_by)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_size(grib_handle_of_accessor(a), self->primary_bitmap, &primary_len)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_size(grib_handle_of_accessor(a), self->secondary_bitmap, &secondary_len)) != GRIB_SUCCESS) - return err; - - primary_vals = (double*)grib_context_malloc(a->context, primary_len * sizeof(double)); - if (!primary_vals) - return GRIB_OUT_OF_MEMORY; - - secondary_vals = (double*)grib_context_malloc(a->context, secondary_len * sizeof(double)); - if (!secondary_vals) { - grib_context_free(a->context, primary_vals); - return GRIB_OUT_OF_MEMORY; - } - - if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->primary_bitmap, primary_vals, &primary_len)) != GRIB_SUCCESS) { - grib_context_free(a->context, secondary_vals); - grib_context_free(a->context, primary_vals); - return err; - } - - if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->secondary_bitmap, secondary_vals, &secondary_len)) != GRIB_SUCCESS) { - grib_context_free(a->context, secondary_vals); - grib_context_free(a->context, primary_vals); - return err; - } - - k = 0; - m = 0; - for (i = 0; i < primary_len; i++) { - /* if(primary_vals[i]) f++; */ - if (primary_vals[i]) { - for (j = 0; j < expand_by; j++) - val[k++] = secondary_vals[m++]; - } - else { - for (j = 0; j < expand_by; j++) - val[k++] = 0; - } - } - - Assert(k <= *len); - Assert(m <= secondary_len); - - /*printf("FOOBAR %d %d %ld %d\n",f,primary_len,expand_by,n_vals);*/ - - *len = n_vals; - - grib_context_free(a->context, primary_vals); - grib_context_free(a->context, secondary_vals); - return err; -} - -static int get_native_type(grib_accessor* a) -{ - // grib_accessor_data_secondary_bitmap* self = (grib_accessor_data_secondary_bitmap*)a; - //return grib_accessor_get_native_type(grib_find_accessor(grib_handle_of_accessor(a),self->coded_values)); - return GRIB_TYPE_DOUBLE; -} diff --git a/src/accessor/todo/grib_accessor_class_data_shsimple_packing.cc b/src/accessor/todo/grib_accessor_class_data_shsimple_packing.cc deleted file mode 100644 index d06743f8d..000000000 --- a/src/accessor/todo/grib_accessor_class_data_shsimple_packing.cc +++ /dev/null @@ -1,153 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init - IMPLEMENTS = pack_double - IMPLEMENTS = dump;get_native_type - MEMBERS=const char* coded_values - MEMBERS=const char* real_part - MEMBERS=int dirty - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_data_shsimple_packing -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in data_shsimple_packing */ - const char* coded_values; - const char* real_part; - int dirty; -} grib_accessor_data_shsimple_packing; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_data_shsimple_packing = { - &grib_accessor_class_gen, /* super */ - "data_shsimple_packing", /* name */ - sizeof(grib_accessor_data_shsimple_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_data_shsimple_packing = &_grib_accessor_class_data_shsimple_packing; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - grib_accessor_data_shsimple_packing* self = (grib_accessor_data_shsimple_packing*)a; - - self->coded_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); - self->real_part = grib_arguments_get_name(grib_handle_of_accessor(a), args, 1); - a->flags |= GRIB_ACCESSOR_FLAG_DATA; - - a->length = 0; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_values(dumper, a); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_data_shsimple_packing* self = (grib_accessor_data_shsimple_packing*)a; - int err = GRIB_SUCCESS; - - size_t coded_n_vals = *len - 1; - size_t n_vals = *len; - - self->dirty = 1; - - if (*len == 0) - return GRIB_NO_VALUES; - - if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->real_part, *val)) != GRIB_SUCCESS) - return err; - - val++; - - if ((err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, coded_n_vals)) != GRIB_SUCCESS) - return err; - - *len = n_vals; - - return err; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_DOUBLE; -} diff --git a/src/accessor/todo/grib_accessor_class_decimal_precision.cc b/src/accessor/todo/grib_accessor_class_decimal_precision.cc deleted file mode 100644 index e498931b7..000000000 --- a/src/accessor/todo/grib_accessor_class_decimal_precision.cc +++ /dev/null @@ -1,199 +0,0 @@ -/* - * (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. - */ - -/********************************** - * Enrico Fucile - *********************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long; pack_long - IMPLEMENTS = init - MEMBERS = const char* values - MEMBERS = const char* bits_per_value - MEMBERS = const char* changing_precision - MEMBERS = const char* decimal_scale_factor - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_decimal_precision -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in decimal_precision */ - const char* values; - const char* bits_per_value; - const char* changing_precision; - const char* decimal_scale_factor; -} grib_accessor_decimal_precision; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_decimal_precision = { - &grib_accessor_class_long, /* super */ - "decimal_precision", /* name */ - sizeof(grib_accessor_decimal_precision), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_decimal_precision = &_grib_accessor_class_decimal_precision; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* args) -{ - int n = 0; - grib_accessor_decimal_precision* self = (grib_accessor_decimal_precision*)a; - - self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->decimal_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->changing_precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - int ret = 0; - grib_accessor_decimal_precision* self = (grib_accessor_decimal_precision*)a; - grib_handle* h = grib_handle_of_accessor(a); - - if ((ret = grib_get_long_internal(h, self->decimal_scale_factor, val)) != GRIB_SUCCESS) - return ret; - - *len = 1; - return ret; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - long bitsPerValue = 0; - double* values = NULL; - size_t size = 0; - int ret = 0; - grib_accessor_decimal_precision* self = (grib_accessor_decimal_precision*)a; - grib_context* c = a->context; - grib_handle* h = grib_handle_of_accessor(a); - - if (!self->values) { - if ((ret = grib_set_long_internal(h, self->bits_per_value, 0)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_set_long_internal(h, self->decimal_scale_factor, *val)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_set_long_internal(h, self->changing_precision, 1)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return ret; - } - - return GRIB_SUCCESS; - } - - if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) - return ret; - - values = (double*)grib_context_malloc(c, size * sizeof(double)); - if (!values) - return GRIB_OUT_OF_MEMORY; - - if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { - grib_context_buffer_free(c, values); - return ret; - } - - if ((ret = grib_set_long_internal(h, self->decimal_scale_factor, *val)) != GRIB_SUCCESS) { - grib_context_buffer_free(c, values); - return ret; - } - - if ((ret = grib_set_long_internal(h, self->bits_per_value, bitsPerValue)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return ret; - } - - if ((ret = grib_set_long_internal(h, self->changing_precision, 1)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return ret; - } - - if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { - grib_context_buffer_free(c, values); - return ret; - } - - grib_context_free(c, values); - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_dirty.cc b/src/accessor/todo/grib_accessor_class_dirty.cc deleted file mode 100644 index ec29923e3..000000000 --- a/src/accessor/todo/grib_accessor_class_dirty.cc +++ /dev/null @@ -1,138 +0,0 @@ -/* - * (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. - */ - -/************************************ - * Enrico Fucile - **********************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = pack_long - IMPLEMENTS = init - MEMBERS = const char* accessor - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_dirty -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in dirty */ - const char* accessor; -} grib_accessor_dirty; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_dirty = { - &grib_accessor_class_long, /* super */ - "dirty", /* name */ - sizeof(grib_accessor_dirty), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_dirty = &_grib_accessor_class_dirty; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_dirty* self = (grib_accessor_dirty*)a; - self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->length = 0; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_dirty* self = (grib_accessor_dirty*)a; - grib_accessor* x = grib_find_accessor(grib_handle_of_accessor(a), self->accessor); - - if (x) - x->dirty = *val; - - return GRIB_SUCCESS; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_dirty* self = (grib_accessor_dirty*)a; - grib_accessor* x = grib_find_accessor(grib_handle_of_accessor(a), self->accessor); - - if (x) - x->dirty = 1; - - *val = 1; - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_divdouble.cc b/src/accessor/todo/grib_accessor_class_divdouble.cc deleted file mode 100644 index 8ab86e22e..000000000 --- a/src/accessor/todo/grib_accessor_class_divdouble.cc +++ /dev/null @@ -1,129 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double - IMPLEMENTS = init - MEMBERS = const char* val - MEMBERS = double divisor - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_divdouble -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in divdouble */ - const char* val; - double divisor; -} grib_accessor_divdouble; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_divdouble = { - &grib_accessor_class_double, /* super */ - "divdouble", /* name */ - sizeof(grib_accessor_divdouble), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_divdouble = &_grib_accessor_class_divdouble; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_divdouble* self = (grib_accessor_divdouble*)a; - int n = 0; - - self->val = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->divisor = grib_arguments_get_double(grib_handle_of_accessor(a), c, n++); -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - const grib_accessor_divdouble* self = (grib_accessor_divdouble*)a; - int ret = GRIB_SUCCESS; - double value = 0; - - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->val, &value); - if (ret != GRIB_SUCCESS) - return ret; - - if (self->divisor == 0) { - return GRIB_INVALID_ARGUMENT; - } - *val = value / self->divisor; - - *len = 1; - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_double.cc b/src/accessor/todo/grib_accessor_class_double.cc deleted file mode 100644 index 3a2933aff..000000000 --- a/src/accessor/todo/grib_accessor_class_double.cc +++ /dev/null @@ -1,201 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = get_native_type;unpack_string - IMPLEMENTS = pack_missing; - IMPLEMENTS = dump - IMPLEMENTS = compare - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_missing(grib_accessor*); -static int unpack_string(grib_accessor*, char*, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_double -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ -} grib_accessor_double; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_double = { - &grib_accessor_class_gen, /* super */ - "double", /* name */ - sizeof(grib_accessor_double), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - &pack_missing, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_double = &_grib_accessor_class_double; - -/* END_CLASS_IMP */ - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_DOUBLE; -} - -static int unpack_string(grib_accessor* a, char* v, size_t* len) -{ - double val = 0; - size_t l = 1; - char repres[1024]; - char format[32] = "%g"; - grib_handle* h = grib_handle_of_accessor(a); - const char* cclass_name = a->cclass->name; - - grib_unpack_double(a, &val, &l); - - if ((val == GRIB_MISSING_DOUBLE) && ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0)) { - snprintf(repres, sizeof(repres), "MISSING"); - } else { - size_t size = sizeof(format); - grib_get_string(h, "formatForDoubles", format, &size); - snprintf(repres, sizeof(repres), format, val); - } - - l = strlen(repres) + 1; - - if (l > *len) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, l, *len); - *len = l; - return GRIB_BUFFER_TOO_SMALL; - } - grib_context_log(a->context, GRIB_LOG_DEBUG, "grib_accessor_long: Casting double %s to string ", a->name); - - *len = l; - - strcpy(v, repres); - return GRIB_SUCCESS; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_values(dumper, a); -} - -static int compare(grib_accessor* a, grib_accessor* b) -{ - int retval = 0; - double* aval = 0; - double* bval = 0; - - size_t alen = 0; - size_t blen = 0; - long count = 0; - int err = 0; - - err = grib_value_count(a, &count); - if (err) - return err; - alen = count; - - err = grib_value_count(b, &count); - if (err) - return err; - blen = count; - - if (alen != blen) - return GRIB_COUNT_MISMATCH; - - aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); - bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - - grib_unpack_double(a, aval, &alen); - grib_unpack_double(b, bval, &blen); - - retval = GRIB_SUCCESS; - while (alen != 0) { - if (*bval != *aval) - retval = GRIB_DOUBLE_VALUE_MISMATCH; - alen--; - } - - grib_context_free(a->context, aval); - grib_context_free(b->context, bval); - - return retval; -} - -static int pack_missing(grib_accessor* a) -{ - size_t len = 1; - double value = GRIB_MISSING_DOUBLE; - - if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) - return grib_pack_double(a, &value, &len); - return GRIB_VALUE_CANNOT_BE_MISSING; -} diff --git a/src/accessor/todo/grib_accessor_class_evaluate.cc b/src/accessor/todo/grib_accessor_class_evaluate.cc deleted file mode 100644 index 596b95884..000000000 --- a/src/accessor/todo/grib_accessor_class_evaluate.cc +++ /dev/null @@ -1,118 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS= grib_arguments* arg - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_evaluate -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in evaluate */ - grib_arguments* arg; -} grib_accessor_evaluate; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_evaluate = { - &grib_accessor_class_long, /* super */ - "evaluate", /* name */ - sizeof(grib_accessor_evaluate), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_evaluate = &_grib_accessor_class_evaluate; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_evaluate* self = (grib_accessor_evaluate*)a; - self->arg = c; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_evaluate* self = (grib_accessor_evaluate*)a; - grib_expression* e = grib_arguments_get_expression(grib_handle_of_accessor(a), self->arg, 0); - - int ret = grib_expression_evaluate_long(grib_handle_of_accessor(a), e, val); - *len = 1; - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_g1_half_byte_codeflag.cc b/src/accessor/todo/grib_accessor_class_g1_half_byte_codeflag.cc deleted file mode 100644 index c275253e5..000000000 --- a/src/accessor/todo/grib_accessor_class_g1_half_byte_codeflag.cc +++ /dev/null @@ -1,150 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init;dump - IMPLEMENTS = get_native_type - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1_half_byte_codeflag -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in g1_half_byte_codeflag */ -} grib_accessor_g1_half_byte_codeflag; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_g1_half_byte_codeflag = { - &grib_accessor_class_gen, /* super */ - "g1_half_byte_codeflag", /* name */ - sizeof(grib_accessor_g1_half_byte_codeflag), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g1_half_byte_codeflag = &_grib_accessor_class_g1_half_byte_codeflag; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - unsigned char dat = 0; - if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - dat = grib_handle_of_accessor(a)->buffer->data[a->offset] & 0x0f; - - *val = dat; - *len = 1; - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - int ret = 0; - if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - /* printf("HALF BYTE pack long %ld %02x\n",*val,grib_handle_of_accessor(a)->buffer->data[a->offset]);*/ - grib_handle_of_accessor(a)->buffer->data[a->offset] = (a->parent->h->buffer->data[a->offset] & 0xf0) | (*val & 0x0f); - /* printf("HALF BYTE pack long %ld %02x\n",*val,grib_handle_of_accessor(a)->buffer->data[a->offset]);*/ - - *len = 1; - return ret; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_g1_section4_length.cc b/src/accessor/todo/grib_accessor_class_g1_section4_length.cc deleted file mode 100644 index 8e6c2b3f1..000000000 --- a/src/accessor/todo/grib_accessor_class_g1_section4_length.cc +++ /dev/null @@ -1,143 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_section_length - IMPLEMENTS = init;unpack_long;pack_long - MEMBERS = const char* total_length - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1_section4_length -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in section_length */ - /* Members defined in g1_section4_length */ - const char* total_length; -} grib_accessor_g1_section4_length; - -extern grib_accessor_class* grib_accessor_class_section_length; - -static grib_accessor_class _grib_accessor_class_g1_section4_length = { - &grib_accessor_class_section_length, /* super */ - "g1_section4_length", /* name */ - sizeof(grib_accessor_g1_section4_length), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g1_section4_length = &_grib_accessor_class_g1_section4_length; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_g1_section4_length* self = (grib_accessor_g1_section4_length*)a; - self->total_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - // Old implementation: - // Here we assume that the totalLength will be coded AFTER the section4 length, and - // the section4 length will be overwritten by the totalLength accessor for large GRIBs - // grib_accessor_class* super = *(a->cclass->super); - // return super->pack_long(a,val,len); - - // Note: Do not directly call pack_long on base class - // because in this special case we want to skip the checks. - // So we call the helper function which has an extra argument - return pack_long_unsigned_helper(a, val, len, /*check=*/0); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g1_section4_length* self = (grib_accessor_g1_section4_length*)a; - int ret = 0; - long total_length = 0, sec4_length = 0; - - if ((ret = grib_get_g1_message_size(grib_handle_of_accessor(a), - grib_find_accessor(grib_handle_of_accessor(a), self->total_length), - a, - &total_length, - &sec4_length)) != GRIB_SUCCESS) { - return ret; - } - - *val = sec4_length; - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_g1bitmap.cc b/src/accessor/todo/grib_accessor_class_g1bitmap.cc deleted file mode 100644 index 519638f6a..000000000 --- a/src/accessor/todo/grib_accessor_class_g1bitmap.cc +++ /dev/null @@ -1,206 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_bitmap - IMPLEMENTS = pack_double; unpack_bytes - IMPLEMENTS = value_count - IMPLEMENTS = init; - MEMBERS=const char* unusedBits - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1bitmap -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ - /* Members defined in bitmap */ - const char* tableReference; - const char* missing_value; - const char* offsetbsec; - const char* sLength; - /* Members defined in g1bitmap */ - const char* unusedBits; -} grib_accessor_g1bitmap; - -extern grib_accessor_class* grib_accessor_class_bitmap; - -static grib_accessor_class _grib_accessor_class_g1bitmap = { - &grib_accessor_class_bitmap, /* super */ - "g1bitmap", /* name */ - sizeof(grib_accessor_g1bitmap), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - &unpack_bytes, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g1bitmap = &_grib_accessor_class_g1bitmap; - -/* END_CLASS_IMP */ - - -static void grib_set_bit_on(unsigned char* p, long* bitp); - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_g1bitmap* self = (grib_accessor_g1bitmap*)a; - self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 4); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_g1bitmap* self = (grib_accessor_g1bitmap*)a; - size_t tlen; - - unsigned char* buf = NULL; - size_t i; - int err = 0; - long pos = 0; - //long bmaplen = 0; - const int bit_padding = 16; - double miss_values = 0; - tlen = ((*len + bit_padding - 1) / bit_padding * bit_padding) / 8; - - if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &miss_values)) != GRIB_SUCCESS) - return err; - - buf = (unsigned char*)grib_context_malloc_clear(a->context, tlen); - if (!buf) - return GRIB_OUT_OF_MEMORY; - pos = 0; - for (i = 0; i < *len; i++) { - if (val[i] == miss_values) - pos++; - else { - //bmaplen++; - grib_set_bit_on(buf, &pos); - } - } - - if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->unusedBits, tlen * 8 - *len)) != GRIB_SUCCESS) - return err; - - err = grib_buffer_replace(a, buf, tlen, 1, 1); - if (err) return err; - - grib_context_free(a->context, buf); - - return GRIB_SUCCESS; -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_g1bitmap* self = (grib_accessor_g1bitmap*)a; - long tlen; - int err; - - if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &tlen)) != GRIB_SUCCESS) - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_class_bitmap.value_count : cannot get %s err=%d", self->unusedBits, err); - - *count = (a->length * 8) - tlen; - return err; -} - -static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len) -{ - unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; - grib_accessor_g1bitmap* self = (grib_accessor_g1bitmap*)a; - long tlen; - int err; - long length = grib_byte_count(a); - long offset = grib_byte_offset(a); - - if (*len < (size_t)length) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it is %ld bytes long\n", a->name, length); - *len = length; - return GRIB_ARRAY_TOO_SMALL; - } - - if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &tlen)) != GRIB_SUCCESS) - grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_bitmap.unpack_bytes : cannot get %s err=%d", self->unusedBits, err); - - length -= tlen / 8; - memcpy(val, buf + offset, length); - *len = length; - - return GRIB_SUCCESS; -} - -static void grib_set_bit_on(unsigned char* p, long* bitp) -{ - unsigned char o = 1; - p += (*bitp >> 3); - o <<= 7 - ((*bitp) % 8); - *p |= o; - (*bitp) += 1; -} diff --git a/src/accessor/todo/grib_accessor_class_g1day_of_the_year_date.cc b/src/accessor/todo/grib_accessor_class_g1day_of_the_year_date.cc deleted file mode 100644 index 9028d5076..000000000 --- a/src/accessor/todo/grib_accessor_class_g1day_of_the_year_date.cc +++ /dev/null @@ -1,152 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_g1date - IMPLEMENTS = unpack_string - IMPLEMENTS = dump - IMPLEMENTS = init - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_string(grib_accessor*, char*, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1day_of_the_year_date -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in g1date */ - const char* century; - const char* year; - const char* month; - const char* day; - /* Members defined in g1day_of_the_year_date */ -} grib_accessor_g1day_of_the_year_date; - -extern grib_accessor_class* grib_accessor_class_g1date; - -static grib_accessor_class _grib_accessor_class_g1day_of_the_year_date = { - &grib_accessor_class_g1date, /* super */ - "g1day_of_the_year_date", /* name */ - sizeof(grib_accessor_g1day_of_the_year_date), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g1day_of_the_year_date = &_grib_accessor_class_g1day_of_the_year_date; - -/* END_CLASS_IMP */ - - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_string(dumper, a, NULL); -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - /* special clim case where each mont have 30 days.. to comply with mars*/ - grib_accessor_g1day_of_the_year_date* self = (grib_accessor_g1day_of_the_year_date*)a; - grib_handle* hand = grib_handle_of_accessor(a); - char tmp[1024]; - - long year = 0; - long century = 0; - long month = 0; - long day = 0; - long fullyear = 0; - long fake_day_of_year = 0; - - grib_get_long_internal(hand, self->century, ¢ury); - grib_get_long_internal(hand, self->day, &day); - grib_get_long_internal(hand, self->month, &month); - grib_get_long_internal(hand, self->year, &year); - - fullyear = ((century - 1) * 100 + year); - fake_day_of_year = ((month - 1) * 30) + day; - snprintf(tmp, sizeof(tmp), "%04ld-%03ld", fullyear, fake_day_of_year); - - size_t l = strlen(tmp) + 1; - if (*len < l) { - *len = l; - return GRIB_BUFFER_TOO_SMALL; - } - - *len = l; - strcpy(val, tmp); - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_g1end_of_interval_monthly.cc b/src/accessor/todo/grib_accessor_class_g1end_of_interval_monthly.cc deleted file mode 100644 index cbf74322c..000000000 --- a/src/accessor/todo/grib_accessor_class_g1end_of_interval_monthly.cc +++ /dev/null @@ -1,234 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_abstract_vector - IMPLEMENTS = unpack_double; destroy - IMPLEMENTS = value_count;compare - IMPLEMENTS = init - MEMBERS = const char* verifyingMonth - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_g1end_of_interval_monthly -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in abstract_vector */ - double* v; - int number_of_elements; - /* Members defined in g1end_of_interval_monthly */ - const char* verifyingMonth; -} grib_accessor_g1end_of_interval_monthly; - -extern grib_accessor_class* grib_accessor_class_abstract_vector; - -static grib_accessor_class _grib_accessor_class_g1end_of_interval_monthly = { - &grib_accessor_class_abstract_vector, /* super */ - "g1end_of_interval_monthly", /* name */ - sizeof(grib_accessor_g1end_of_interval_monthly), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g1end_of_interval_monthly = &_grib_accessor_class_g1end_of_interval_monthly; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g1end_of_interval_monthly* self = (grib_accessor_g1end_of_interval_monthly*)a; - int n = 0; - - self->verifyingMonth = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - - self->number_of_elements = 6; - self->v = (double*)grib_context_malloc(a->context, sizeof(double) * self->number_of_elements); - - a->length = 0; - a->dirty = 1; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_g1end_of_interval_monthly* self = (grib_accessor_g1end_of_interval_monthly*)a; - int ret = 0; - char verifyingMonth[7] = {0,}; - size_t slen = 7; - long year = 0, month = 0, date = 0; - const long mdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - long days = 0; - - if (!a->dirty) - return GRIB_SUCCESS; - - if (*len != (size_t)self->number_of_elements) - return GRIB_ARRAY_TOO_SMALL; - - if ((ret = grib_get_string(grib_handle_of_accessor(a), self->verifyingMonth, verifyingMonth, &slen)) != GRIB_SUCCESS) - return ret; - - date = atoi(verifyingMonth); - if (date < 0) { - return GRIB_INVALID_ARGUMENT; - } - year = date / 100; - month = date - year * 100; - if (month == 2) { - days = 28; - if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) - days = 29; - } - else { - if (month < 1 || month > 12) return GRIB_INVALID_ARGUMENT; - days = mdays[month - 1]; - } - self->v[0] = year; - self->v[1] = month; - - self->v[2] = days; - self->v[3] = 24; - self->v[4] = 00; - self->v[5] = 00; - - a->dirty = 0; - - val[0] = self->v[0]; - val[1] = self->v[1]; - val[2] = self->v[2]; - val[3] = self->v[3]; - val[4] = self->v[4]; - val[5] = self->v[5]; - - return ret; -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_g1end_of_interval_monthly* self = (grib_accessor_g1end_of_interval_monthly*)a; - *count = self->number_of_elements; - return 0; -} - -static void destroy(grib_context* c, grib_accessor* a) -{ - grib_accessor_g1end_of_interval_monthly* self = (grib_accessor_g1end_of_interval_monthly*)a; - grib_context_free(c, self->v); -} - -static int compare(grib_accessor* a, grib_accessor* b) -{ - int retval = GRIB_SUCCESS; - double* aval = 0; - double* bval = 0; - - long count = 0; - size_t alen = 0; - size_t blen = 0; - int err = 0; - - err = grib_value_count(a, &count); - if (err) - return err; - alen = count; - - err = grib_value_count(b, &count); - if (err) - return err; - blen = count; - - if (alen != blen) - return GRIB_COUNT_MISMATCH; - - aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); - bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - - b->dirty = 1; - a->dirty = 1; - - err = grib_unpack_double(a, aval, &alen); if(err) return err; - err = grib_unpack_double(b, bval, &blen); if(err) return err; - - for(size_t i=0; icontext, aval); - grib_context_free(b->context, bval); - - return retval; -} diff --git a/src/accessor/todo/grib_accessor_class_g1fcperiod.cc b/src/accessor/todo/grib_accessor_class_g1fcperiod.cc deleted file mode 100644 index 03aa6e3f4..000000000 --- a/src/accessor/todo/grib_accessor_class_g1fcperiod.cc +++ /dev/null @@ -1,134 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_g1step_range - IMPLEMENTS = unpack_string - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_string(grib_accessor*, char*, size_t* len); - -typedef struct grib_accessor_g1fcperiod -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in abstract_long_vector */ - long* v; - long pack_index; - int number_of_elements; - /* Members defined in g1step_range */ - const char* p1; - const char* p2; - const char* timeRangeIndicator; - const char *unit; - const char *step_unit; - const char *stepType; - const char *patch_fp_precip; - int error_on_units; - /* Members defined in g1fcperiod */ -} grib_accessor_g1fcperiod; - -extern grib_accessor_class* grib_accessor_class_g1step_range; - -static grib_accessor_class _grib_accessor_class_g1fcperiod = { - &grib_accessor_class_g1step_range, /* super */ - "g1fcperiod", /* name */ - sizeof(grib_accessor_g1fcperiod), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g1fcperiod = &_grib_accessor_class_g1fcperiod; - -/* END_CLASS_IMP */ - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - long start = 0, theEnd = 0; - char tmp[1024]; - const size_t tmpLen = sizeof(tmp); - int err = grib_g1_step_get_steps(a, &start, &theEnd); - size_t l = 0; - - if (err) - return err; - - snprintf(tmp, tmpLen, "%ld-%ld", start / 24, theEnd / 24); - /*printf("---- FCPERIOD %s [start:%g, end:%g]",tmp,start,end);*/ - - l = strlen(tmp) + 1; - if (*len < l) { - *len = l; - return GRIB_BUFFER_TOO_SMALL; - } - - *len = l; - strcpy(val, tmp); /* NOLINT: CWE-119 clang-analyzer-security.insecureAPI.strcpy */ - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_g1monthlydate.cc b/src/accessor/todo/grib_accessor_class_g1monthlydate.cc deleted file mode 100644 index 57c3ea729..000000000 --- a/src/accessor/todo/grib_accessor_class_g1monthlydate.cc +++ /dev/null @@ -1,132 +0,0 @@ -/* - * (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. - */ - - -/*********************************************** - * Enrico Fucile - **********************************************/ - -#include "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS=const char* date - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1monthlydate -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in g1monthlydate */ - const char* date; -} grib_accessor_g1monthlydate; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_g1monthlydate = { - &grib_accessor_class_long, /* super */ - "g1monthlydate", /* name */ - sizeof(grib_accessor_g1monthlydate), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g1monthlydate = &_grib_accessor_class_g1monthlydate; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g1monthlydate* self = (grib_accessor_g1monthlydate*)a; - int n = 0; - - self->date = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g1monthlydate* self = (grib_accessor_g1monthlydate*)a; - - long date = 0; - - grib_get_long_internal(grib_handle_of_accessor(a), self->date, &date); - - date /= 100; - date *= 100; - date += 1; - - *val = date; - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_complex.cc b/src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_complex.cc deleted file mode 100644 index 45b983502..000000000 --- a/src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_complex.cc +++ /dev/null @@ -1,183 +0,0 @@ -/* - * (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. - */ - -/****************************************************** - * Enrico Fucile - *******************************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS = const char* numberOfValues - MEMBERS = const char* bitsPerValue - MEMBERS = const char* offsetBeforeData - MEMBERS = const char* offsetAfterData - MEMBERS = const char* unusedBits - MEMBERS = const char* JS - MEMBERS = const char* KS - MEMBERS = const char* MS - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1number_of_coded_values_sh_complex -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in g1number_of_coded_values_sh_complex */ - const char* numberOfValues; - const char* bitsPerValue; - const char* offsetBeforeData; - const char* offsetAfterData; - const char* unusedBits; - const char* JS; - const char* KS; - const char* MS; -} grib_accessor_g1number_of_coded_values_sh_complex; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_g1number_of_coded_values_sh_complex = { - &grib_accessor_class_long, /* super */ - "g1number_of_coded_values_sh_complex", /* name */ - sizeof(grib_accessor_g1number_of_coded_values_sh_complex), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_complex = &_grib_accessor_class_g1number_of_coded_values_sh_complex; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - int n = 0; - grib_accessor_g1number_of_coded_values_sh_complex* self = (grib_accessor_g1number_of_coded_values_sh_complex*)a; - self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->JS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->KS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->MS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - int ret = GRIB_SUCCESS; - long bpv = 0; - long offsetBeforeData = 0, offsetAfterData = 0, unusedBits = 0, numberOfValues; - long JS = 0, KS = 0, MS = 0, NS = 0; - - grib_accessor_g1number_of_coded_values_sh_complex* self = (grib_accessor_g1number_of_coded_values_sh_complex*)a; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue, &bpv)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData, &offsetBeforeData)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData, &offsetAfterData)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &unusedBits)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->JS, &JS)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->KS, &KS)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->MS, &MS)) != GRIB_SUCCESS) - return ret; - - if (JS != KS || KS != MS) - return GRIB_NOT_IMPLEMENTED; - - NS = (MS + 1) * (MS + 2); - - if (bpv != 0) { - DEBUG_ASSERT(offsetAfterData > offsetBeforeData); - *val = ((offsetAfterData - offsetBeforeData) * 8 - unusedBits + NS * (bpv - 32)) / bpv; - } - else { - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, &numberOfValues)) != GRIB_SUCCESS) - return ret; - - *val = numberOfValues; - } - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_simple.cc b/src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_simple.cc deleted file mode 100644 index 532a4c5dd..000000000 --- a/src/accessor/todo/grib_accessor_class_g1number_of_coded_values_sh_simple.cc +++ /dev/null @@ -1,158 +0,0 @@ -/* - * (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. - */ - -/********************************************** - * Enrico Fucile - **********************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS = const char* numberOfValues - MEMBERS = const char* bitsPerValue - MEMBERS = const char* offsetBeforeData - MEMBERS = const char* offsetAfterData - MEMBERS = const char* unusedBits - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1number_of_coded_values_sh_simple -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in g1number_of_coded_values_sh_simple */ - const char* numberOfValues; - const char* bitsPerValue; - const char* offsetBeforeData; - const char* offsetAfterData; - const char* unusedBits; -} grib_accessor_g1number_of_coded_values_sh_simple; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_g1number_of_coded_values_sh_simple = { - &grib_accessor_class_long, /* super */ - "g1number_of_coded_values_sh_simple", /* name */ - sizeof(grib_accessor_g1number_of_coded_values_sh_simple), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_simple = &_grib_accessor_class_g1number_of_coded_values_sh_simple; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - int n = 0; - grib_accessor_g1number_of_coded_values_sh_simple* self = (grib_accessor_g1number_of_coded_values_sh_simple*)a; - self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - int ret = GRIB_SUCCESS; - long bpv = 0; - long offsetBeforeData = 0, offsetAfterData = 0, unusedBits = 0, numberOfValues; - - grib_accessor_g1number_of_coded_values_sh_simple* self = (grib_accessor_g1number_of_coded_values_sh_simple*)a; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue, &bpv)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData, &offsetBeforeData)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData, &offsetAfterData)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &unusedBits)) != GRIB_SUCCESS) - return ret; - - if (bpv != 0) { - DEBUG_ASSERT(offsetAfterData > offsetBeforeData); - *val = ((offsetAfterData - offsetBeforeData) * 8 - unusedBits) / bpv; - } - else { - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, &numberOfValues)) != GRIB_SUCCESS) - return ret; - - *val = numberOfValues; - } - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_g1verificationdate.cc b/src/accessor/todo/grib_accessor_class_g1verificationdate.cc deleted file mode 100644 index 03c871617..000000000 --- a/src/accessor/todo/grib_accessor_class_g1verificationdate.cc +++ /dev/null @@ -1,154 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS=const char* date - MEMBERS=const char* time - MEMBERS=const char* step - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1verificationdate -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in g1verificationdate */ - const char* date; - const char* time; - const char* step; -} grib_accessor_g1verificationdate; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_g1verificationdate = { - &grib_accessor_class_long, /* super */ - "g1verificationdate", /* name */ - sizeof(grib_accessor_g1verificationdate), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g1verificationdate = &_grib_accessor_class_g1verificationdate; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g1verificationdate* self = (grib_accessor_g1verificationdate*)a; - int n = 0; - - self->date = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->time = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->step = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g1verificationdate* self = (grib_accessor_g1verificationdate*)a; - int ret = 0; - long date = 0; - long time = 0; - long cdate = 0; - long step = 0; - long vtime = 0; - long vdate = 0; - long vd = 0; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->date, &date)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->time, &time)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->step, &step)) != GRIB_SUCCESS) - return ret; - - time /= 100; - - cdate = (long)grib_date_to_julian(date); - vtime = cdate * 24 + time + step; - vd = vtime / 24; - vdate = grib_julian_to_date(vd); - - /* printf("\n********\n date %d, time %d, step %d, vdate: %d, cdate %d, vd %d\n********\n", date, time, step, vdate, cdate, vd); */ - - if (*len < 1) - return GRIB_ARRAY_TOO_SMALL; - - *val = vdate; - - /* fprintf(stdout,"\n********\n %d cdate %d vd %d\n********\n", vdate, cdate, step); */ - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_g2_aerosol.cc b/src/accessor/todo/grib_accessor_class_g2_aerosol.cc deleted file mode 100644 index 7cd8659df..000000000 --- a/src/accessor/todo/grib_accessor_class_g2_aerosol.cc +++ /dev/null @@ -1,210 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_unsigned - IMPLEMENTS = unpack_long;pack_long; value_count - IMPLEMENTS = init - MEMBERS=const char* productDefinitionTemplateNumber - MEMBERS=const char* stepType - MEMBERS=int optical - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2_aerosol -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in g2_aerosol */ - const char* productDefinitionTemplateNumber; - const char* stepType; - int optical; -} grib_accessor_g2_aerosol; - -extern grib_accessor_class* grib_accessor_class_unsigned; - -static grib_accessor_class _grib_accessor_class_g2_aerosol = { - &grib_accessor_class_unsigned, /* super */ - "g2_aerosol", /* name */ - sizeof(grib_accessor_g2_aerosol), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g2_aerosol = &_grib_accessor_class_g2_aerosol; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2_aerosol* self = (grib_accessor_g2_aerosol*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; - - self->productDefinitionTemplateNumber = grib_arguments_get_name(hand, c, n++); - self->stepType = grib_arguments_get_name(hand, c, n++); - self->optical = grib_arguments_get_long(hand, c, n++); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g2_aerosol* self = (grib_accessor_g2_aerosol*)a; - long productDefinitionTemplateNumber = 0; - grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); - - if (self->optical) - *val = grib2_is_PDTN_AerosolOptical(productDefinitionTemplateNumber); - else - *val = grib2_is_PDTN_Aerosol(productDefinitionTemplateNumber); - - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_g2_aerosol* self = (grib_accessor_g2_aerosol*)a; - grib_handle* hand = grib_handle_of_accessor(a); - long productDefinitionTemplateNumber = -1; - long productDefinitionTemplateNumberNew = -1; - /*long type=-1; - long stream=-1;*/ - long eps = -1; - char stepType[15] = {0,}; - size_t slen = 15; - /*int aerosol = *val;*/ - int isInstant = 0; - /*long derivedForecast=-1;*/ - int ret = 0; - - if (grib_get_long(hand, self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber) != GRIB_SUCCESS) - return GRIB_SUCCESS; - - /* - grib_get_long(hand, self->type,&type); - grib_get_long(hand, self->stream,&stream); - */ - 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"); - - if (!strcmp(stepType, "instant")) - isInstant = 1; - - if (eps == 1) { - if (isInstant) { - productDefinitionTemplateNumberNew = 45; - } - else { - /*productDefinitionTemplateNumberNew = 47; PDT deprecated*/ - productDefinitionTemplateNumberNew = 85; - } - } - else { - if (isInstant) { - productDefinitionTemplateNumberNew = 48; /*44 is deprecated*/ - } - else { - productDefinitionTemplateNumberNew = 46; - } - } - - if (self->optical) { - /* Note: There is no interval based template for optical properties of aerosol! */ - if (eps) - productDefinitionTemplateNumberNew = 49; - else - productDefinitionTemplateNumberNew = 48; - if (!isInstant) { - grib_context_log(hand->context, GRIB_LOG_ERROR, - "The product definition templates for optical properties of aerosol are for a point-in-time only"); - } - } - - if (productDefinitionTemplateNumber != productDefinitionTemplateNumberNew) { - grib_set_long(hand, self->productDefinitionTemplateNumber, productDefinitionTemplateNumberNew); - /*if (derivedForecast>=0) grib_set_long(hand, self->derivedForecast,derivedForecast);*/ - } - - return 0; -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} diff --git a/src/accessor/todo/grib_accessor_class_g2bitmap.cc b/src/accessor/todo/grib_accessor_class_g2bitmap.cc deleted file mode 100644 index 441ad70a6..000000000 --- a/src/accessor/todo/grib_accessor_class_g2bitmap.cc +++ /dev/null @@ -1,178 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_bitmap - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - IMPLEMENTS = init; - MEMBERS=const char* numberOfValues - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2bitmap -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ - /* Members defined in bitmap */ - const char* tableReference; - const char* missing_value; - const char* offsetbsec; - const char* sLength; - /* Members defined in g2bitmap */ - const char* numberOfValues; -} grib_accessor_g2bitmap; - -extern grib_accessor_class* grib_accessor_class_bitmap; - -static grib_accessor_class _grib_accessor_class_g2bitmap = { - &grib_accessor_class_bitmap, /* super */ - "g2bitmap", /* name */ - sizeof(grib_accessor_g2bitmap), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g2bitmap = &_grib_accessor_class_g2bitmap; - -/* END_CLASS_IMP */ - - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_g2bitmap* self = (grib_accessor_g2bitmap*)a; - - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 4); -} - - -static void grib_set_bit_on(unsigned char* p, long* bitp) -{ - unsigned char o = 1; - p += (*bitp >> 3); - o <<= 7 - ((*bitp) % 8); - *p |= o; - (*bitp) += 1; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_g2bitmap* self = (grib_accessor_g2bitmap*)a; - - size_t tlen; - - unsigned char* buf = NULL; - size_t i; - int err = 0; - long pos = 0; - // long bmaplen = 0; - double miss_values = 0; - tlen = (*len + 7) / 8; - - if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &miss_values)) != GRIB_SUCCESS) - return err; - - buf = (unsigned char*)grib_context_malloc_clear(a->context, tlen); - if (!buf) - return GRIB_OUT_OF_MEMORY; - pos = 0; - for (i = 0; i < *len; i++) { - if (val[i] == miss_values) - pos++; - else { - // bmaplen++; - grib_set_bit_on(buf, &pos); - } - } - - if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfValues, *len)) != GRIB_SUCCESS) { - grib_context_free(a->context, buf); - return err; - } - - grib_buffer_replace(a, buf, tlen, 1, 1); - - grib_context_free(a->context, buf); - - return GRIB_SUCCESS; -} - - -static int value_count(grib_accessor* a, long* tlen) -{ - grib_accessor_g2bitmap* self = (grib_accessor_g2bitmap*)a; - int err; - *tlen = 0; - - err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, tlen); - return err; -} diff --git a/src/accessor/todo/grib_accessor_class_g2bitmap_present.cc b/src/accessor/todo/grib_accessor_class_g2bitmap_present.cc deleted file mode 100644 index 52378d4eb..000000000 --- a/src/accessor/todo/grib_accessor_class_g2bitmap_present.cc +++ /dev/null @@ -1,150 +0,0 @@ -/* - * (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. - */ - -/**************************************** - * Enrico Fucile - *************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = pack_long - IMPLEMENTS = init - MEMBERS = const char* bitmapIndicator - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2bitmap_present -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in g2bitmap_present */ - const char* bitmapIndicator; -} grib_accessor_g2bitmap_present; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_g2bitmap_present = { - &grib_accessor_class_long, /* super */ - "g2bitmap_present", /* name */ - sizeof(grib_accessor_g2bitmap_present), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g2bitmap_present = &_grib_accessor_class_g2bitmap_present; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - int n = 0; - grib_accessor_g2bitmap_present* self = (grib_accessor_g2bitmap_present*)a; - self->bitmapIndicator = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - int ret = GRIB_SUCCESS; - long bitmapIndicator = 0; - - grib_accessor_g2bitmap_present* self = (grib_accessor_g2bitmap_present*)a; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitmapIndicator, &bitmapIndicator); - if (ret) { - if (ret == GRIB_NOT_FOUND) { - *val = 0; - return 0; - } - else - return ret; - } - - *val = 1; - if (bitmapIndicator == 255) - *val = 0; - - *len = 1; - return ret; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_g2bitmap_present* self = (grib_accessor_g2bitmap_present*)a; - long bitmapIndicator = 0; - - if (*val == 0) - bitmapIndicator = 255; - - return grib_set_long(grib_handle_of_accessor(a), self->bitmapIndicator, bitmapIndicator); -} diff --git a/src/accessor/todo/grib_accessor_class_g2date.cc b/src/accessor/todo/grib_accessor_class_g2date.cc deleted file mode 100644 index 698cd4a26..000000000 --- a/src/accessor/todo/grib_accessor_class_g2date.cc +++ /dev/null @@ -1,175 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long;init - MEMBERS=const char* century - MEMBERS=const char* year - MEMBERS=const char* month - MEMBERS=const char* day - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2date -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in g2date */ - const char* century; - const char* year; - const char* month; - const char* day; -} grib_accessor_g2date; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_g2date = { - &grib_accessor_class_long, /* super */ - "g2date", /* name */ - sizeof(grib_accessor_g2date), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g2date = &_grib_accessor_class_g2date; - -/* END_CLASS_IMP */ -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2date* self = (grib_accessor_g2date*)a; - int n = 0; - - self->year = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->month = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->day = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - const grib_accessor_g2date* self = (grib_accessor_g2date*)a; - - int ret = 0; - long year = 0; - long month = 0; - long day = 0; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->day, &day)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->month, &month)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->year, &year)) != GRIB_SUCCESS) - return ret; - - if (*len < 1) - return GRIB_WRONG_ARRAY_SIZE; - - val[0] = year * 10000 + month * 100 + day; - - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - const grib_accessor_g2date* self = (grib_accessor_g2date*)a; - - int ret = GRIB_SUCCESS; - long v = val[0]; - long year = 0; - long month = 0; - long day = 0; - - if (*len != 1) - return GRIB_WRONG_ARRAY_SIZE; - - year = v / 10000; - v %= 10000; - month = v / 100; - v %= 100; - day = v; - - if (!is_date_valid(year, month, day, 0, 0, 0)) { - // ECC-1777: For now just a warning. Will later change to an error - fprintf(stderr, "ECCODES WARNING : %s:%s: Date is not valid! year=%ld month=%ld day=%ld\n", - a->cclass->name, __func__, year, month, day); - } - - if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->day, day)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->month, month)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->year, year)) != GRIB_SUCCESS) - return ret; - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_g2latlon.cc b/src/accessor/todo/grib_accessor_class_g2latlon.cc deleted file mode 100644 index 5549b79a3..000000000 --- a/src/accessor/todo/grib_accessor_class_g2latlon.cc +++ /dev/null @@ -1,215 +0,0 @@ -/* - * (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. - */ - -/******************************************** - * Enrico Fucile - *********************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = is_missing;pack_missing - IMPLEMENTS = init - MEMBERS=const char* grid - MEMBERS=int index - MEMBERS=const char* given - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_missing(grib_accessor*); -static int is_missing(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 void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2latlon -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in g2latlon */ - const char* grid; - int index; - const char* given; -} grib_accessor_g2latlon; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_g2latlon = { - &grib_accessor_class_double, /* super */ - "g2latlon", /* name */ - sizeof(grib_accessor_g2latlon), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - &pack_missing, /* pack_missing */ - &is_missing, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g2latlon = &_grib_accessor_class_g2latlon; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2latlon* self = (grib_accessor_g2latlon*)a; - int n = 0; - - self->grid = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->index = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); - self->given = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_g2latlon* self = (grib_accessor_g2latlon*)a; - int ret = 0; - - long given = 1; - double grid[6]; - size_t size = 6; - - if (*len < 1) { - ret = GRIB_ARRAY_TOO_SMALL; - return ret; - } - - if (self->given) - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->given, &given)) != GRIB_SUCCESS) - return ret; - - if (!given) { - *val = GRIB_MISSING_DOUBLE; - return GRIB_SUCCESS; - } - - if ((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->grid, grid, &size)) != GRIB_SUCCESS) - return ret; - - *val = grid[self->index]; - - return GRIB_SUCCESS; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_g2latlon* self = (grib_accessor_g2latlon*)a; - int ret = 0; - double grid[6]; - size_t size = 6; - double new_val = *val; - grib_handle* hand = grib_handle_of_accessor(a); - - if (*len < 1) { - ret = GRIB_ARRAY_TOO_SMALL; - return ret; - } - - if (self->given) { - long given = *val != GRIB_MISSING_DOUBLE; - if ((ret = grib_set_long_internal(hand, self->given, given)) != GRIB_SUCCESS) - return ret; - } - - if ((ret = grib_get_double_array_internal(hand, self->grid, grid, &size)) != GRIB_SUCCESS) - return ret; - - /* index 1 is longitudeOfFirstGridPointInDegrees - * index 3 is longitudeOfLastGridPointInDegrees - */ - if ((self->index == 1 || self->index == 3)) { - /* WMO regulation for GRIB edition 2: - * The longitude values shall be limited to the range 0 to 360 degrees inclusive */ - new_val = normalise_longitude_in_degrees(*val); - if (hand->context->debug && new_val != *val) { - fprintf(stderr, "ECCODES DEBUG pack_double g2latlon: normalise longitude %g -> %g\n", *val, new_val); - } - } - grid[self->index] = new_val; - - return grib_set_double_array_internal(hand, self->grid, grid, size); -} - -static int pack_missing(grib_accessor* a) -{ - grib_accessor_g2latlon* self = (grib_accessor_g2latlon*)a; - double missing = GRIB_MISSING_DOUBLE; - size_t size = 1; - - if (!self->given) - return GRIB_NOT_IMPLEMENTED; - - return pack_double(a, &missing, &size); -} - -static int is_missing(grib_accessor* a) -{ - grib_accessor_g2latlon* self = (grib_accessor_g2latlon*)a; - long given = 1; - - if (self->given) - grib_get_long_internal(grib_handle_of_accessor(a), self->given, &given); - - return !given; -} diff --git a/src/accessor/todo/grib_accessor_class_g2lon.cc b/src/accessor/todo/grib_accessor_class_g2lon.cc deleted file mode 100644 index c84776915..000000000 --- a/src/accessor/todo/grib_accessor_class_g2lon.cc +++ /dev/null @@ -1,149 +0,0 @@ -/* - * (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. - */ - -/******************************************** - * Enrico Fucile - *********************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = init - MEMBERS=const char* longitude - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2lon -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in g2lon */ - const char* longitude; -} grib_accessor_g2lon; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_g2lon = { - &grib_accessor_class_double, /* super */ - "g2lon", /* name */ - sizeof(grib_accessor_g2lon), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g2lon = &_grib_accessor_class_g2lon; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2lon* self = (grib_accessor_g2lon*)a; - int n = 0; - - self->longitude = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_g2lon* self = (grib_accessor_g2lon*)a; - int ret = 0; - long longitude; - - if ((ret = grib_get_long(grib_handle_of_accessor(a), self->longitude, &longitude)) != GRIB_SUCCESS) - return ret; - - if (longitude == GRIB_MISSING_LONG) { - *val = GRIB_MISSING_DOUBLE; - return GRIB_SUCCESS; - } - - *val = ((double)longitude) / 1000000.0; - - return GRIB_SUCCESS; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_g2lon* self = (grib_accessor_g2lon*)a; - long longitude; - double value = *val; - - if (value == GRIB_MISSING_DOUBLE) { - longitude = GRIB_MISSING_LONG; - } - else { - if (value < 0) - value += 360; - longitude = (long)(value * 1000000); - } - return grib_set_long(grib_handle_of_accessor(a), self->longitude, longitude); -} diff --git a/src/accessor/todo/grib_accessor_class_gaussian_grid_name.cc b/src/accessor/todo/grib_accessor_class_gaussian_grid_name.cc deleted file mode 100644 index 21117d4f1..000000000 --- a/src/accessor/todo/grib_accessor_class_gaussian_grid_name.cc +++ /dev/null @@ -1,176 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;unpack_string; get_native_type;string_length - MEMBERS = const char* N - MEMBERS = const char* Ni - MEMBERS = const char* isOctahedral - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_gaussian_grid_name -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in gaussian_grid_name */ - const char* N; - const char* Ni; - const char* isOctahedral; -} grib_accessor_gaussian_grid_name; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_gaussian_grid_name = { - &grib_accessor_class_gen, /* super */ - "gaussian_grid_name", /* name */ - sizeof(grib_accessor_gaussian_grid_name), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_gaussian_grid_name = &_grib_accessor_class_gaussian_grid_name; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_gaussian_grid_name* self = (grib_accessor_gaussian_grid_name*)a; - int n = 0; - - self->N = grib_arguments_get_name(a->parent->h, arg, n++); - self->Ni = grib_arguments_get_name(a->parent->h, arg, n++); - self->isOctahedral = grib_arguments_get_name(a->parent->h, arg, n++); - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} - -#define MAX_GRIDNAME_LEN 16 - -static int unpack_string(grib_accessor* a, char* v, size_t* len) -{ - grib_accessor_gaussian_grid_name* self = (grib_accessor_gaussian_grid_name*)a; - - long N = 0, Ni = 0; - char tmp[MAX_GRIDNAME_LEN] = {0,}; - size_t length = 0; - int ret = GRIB_SUCCESS; - - if ((ret = grib_get_long_internal(a->parent->h, self->N, &N)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(a->parent->h, self->Ni, &Ni)) != GRIB_SUCCESS) - return ret; - - if (Ni == GRIB_MISSING_LONG) { - /* Reduced gaussian grid */ - long isOctahedral = 0; - if ((ret = grib_get_long_internal(a->parent->h, self->isOctahedral, &isOctahedral)) != GRIB_SUCCESS) - return ret; - if (isOctahedral == 1) { - snprintf(tmp, sizeof(tmp), "O%ld", N); - } - else { - snprintf(tmp, sizeof(tmp), "N%ld", N); /* Classic */ - } - } - else { - /* Regular gaussian grid */ - snprintf(tmp, sizeof(tmp), "F%ld", N); - } - length = strlen(tmp) + 1; - - if (*len < length) { - const char* cclass_name = a->cclass->name; - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, length, *len); - *len = length; - return GRIB_BUFFER_TOO_SMALL; - } - - strcpy(v, tmp); - *len = length; - return GRIB_SUCCESS; -} - -static size_t string_length(grib_accessor* a) -{ - return MAX_GRIDNAME_LEN; -} diff --git a/src/accessor/todo/grib_accessor_class_gds_is_present.cc b/src/accessor/todo/grib_accessor_class_gds_is_present.cc deleted file mode 100644 index 6066231ac..000000000 --- a/src/accessor/todo/grib_accessor_class_gds_is_present.cc +++ /dev/null @@ -1,183 +0,0 @@ -/* - * (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. - */ - -/****************************** - * Enrico Fucile - *****************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = pack_long - IMPLEMENTS = init - MEMBERS = const char* gds_present - MEMBERS = const char* grid_definition - MEMBERS = const char* bitmap_present - MEMBERS = const char* values - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_gds_is_present -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in gds_is_present */ - const char* gds_present; - const char* grid_definition; - const char* bitmap_present; - const char* values; -} grib_accessor_gds_is_present; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_gds_is_present = { - &grib_accessor_class_long, /* super */ - "gds_is_present", /* name */ - sizeof(grib_accessor_gds_is_present), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_gds_is_present = &_grib_accessor_class_gds_is_present; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - int n = 0; - grib_accessor_gds_is_present* self = (grib_accessor_gds_is_present*)a; - grib_handle* h = grib_handle_of_accessor(a); - self->gds_present = grib_arguments_get_name(h, c, n++); - self->grid_definition = grib_arguments_get_name(h, c, n++); - self->bitmap_present = grib_arguments_get_name(h, c, n++); - self->values = grib_arguments_get_name(h, c, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->length = 0; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_gds_is_present* self = (grib_accessor_gds_is_present*)a; - long missing = 255; - int ret = 0; - size_t size = 0; - double* values = NULL; - grib_context* c = a->context; - grib_handle* h = grib_handle_of_accessor(a); - - if (*val != 1) - return GRIB_NOT_IMPLEMENTED; - - if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) - return ret; - - values = (double*)grib_context_malloc(c, size * sizeof(double)); - if (!values) - return GRIB_OUT_OF_MEMORY; - - if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return ret; - } - - if ((ret = grib_set_long_internal(h, self->gds_present, *val)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_set_long_internal(h, self->bitmap_present, *val)) != GRIB_SUCCESS) - return ret; - - - if ((ret = grib_set_long_internal(h, self->grid_definition, missing)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) - return ret; - - grib_context_free(c, values); - - return GRIB_SUCCESS; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - int ret = 0; - grib_handle* h = grib_handle_of_accessor(a); - grib_accessor_gds_is_present* self = (grib_accessor_gds_is_present*)a; - - if ((ret = grib_get_long_internal(h, self->gds_present, val)) != GRIB_SUCCESS) - return ret; - - *len = 1; - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_gds_not_present_bitmap.cc b/src/accessor/todo/grib_accessor_class_gds_not_present_bitmap.cc deleted file mode 100644 index d8ec8ecd1..000000000 --- a/src/accessor/todo/grib_accessor_class_gds_not_present_bitmap.cc +++ /dev/null @@ -1,216 +0,0 @@ -/* - * (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. - */ - -/****************************** - * Enrico Fucile - *****************************/ - -#include "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init - IMPLEMENTS = unpack_double - IMPLEMENTS = pack_double - IMPLEMENTS = value_count - IMPLEMENTS = get_native_type - MEMBERS=const char* missing_value - MEMBERS=const char* number_of_values - MEMBERS=const char* number_of_points - MEMBERS=const char* latitude_of_first_point - MEMBERS=const char* ni - - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_gds_not_present_bitmap -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in gds_not_present_bitmap */ - const char* missing_value; - const char* number_of_values; - const char* number_of_points; - const char* latitude_of_first_point; - const char* ni; -} grib_accessor_gds_not_present_bitmap; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_gds_not_present_bitmap = { - &grib_accessor_class_gen, /* super */ - "gds_not_present_bitmap", /* name */ - sizeof(grib_accessor_gds_not_present_bitmap), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_gds_not_present_bitmap = &_grib_accessor_class_gds_not_present_bitmap; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - int n = 0; - grib_accessor_gds_not_present_bitmap* self = (grib_accessor_gds_not_present_bitmap*)a; - grib_handle* hand = grib_handle_of_accessor(a); - - self->missing_value = grib_arguments_get_name(hand, args, n++); - self->number_of_values = grib_arguments_get_name(hand, args, n++); - self->number_of_points = grib_arguments_get_name(hand, args, n++); - self->latitude_of_first_point = grib_arguments_get_name(hand, args, n++); - self->ni = grib_arguments_get_name(hand, args, n++); - a->length = 0; -} - -static int value_count(grib_accessor* a, long* number_of_points) -{ - grib_accessor_gds_not_present_bitmap* self = (grib_accessor_gds_not_present_bitmap*)a; - *number_of_points = 0; - return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_points, number_of_points); -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_gds_not_present_bitmap* self = (grib_accessor_gds_not_present_bitmap*)a; - grib_handle* hand = grib_handle_of_accessor(a); - - long number_of_points = 0, number_of_values = 0, ni = 0; - long latitude_of_first_point = 0; - size_t i = 0; - size_t n_vals = 0; - long nn = 0; - long missing_value; - - int err = 0; - double* coded_vals = NULL; - err = grib_value_count(a, &nn); - n_vals = nn; - if (err) - return err; - - if ((err = grib_get_long(hand, self->number_of_points, &number_of_points)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long(hand, self->number_of_values, &number_of_values)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long(hand, self->latitude_of_first_point, &latitude_of_first_point)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long(hand, self->missing_value, &missing_value)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long(hand, self->ni, &ni)) != GRIB_SUCCESS) - return err; - - if (*len < number_of_points) { - *len = n_vals; - return GRIB_ARRAY_TOO_SMALL; - } - - if (number_of_values > 0) { - coded_vals = (double*)grib_context_malloc(a->context, number_of_values * sizeof(double)); - - if (coded_vals == NULL) - return GRIB_OUT_OF_MEMORY; - } - - if (latitude_of_first_point == 0) { - for (i = 0; i < number_of_values; i++) - val[i] = 1; - for (i = number_of_values; i < number_of_points; i++) - val[i] = 0; - } - else { - for (i = 0; i < ni - 1; i++) - val[i] = 0; - for (i = ni - 1; i < number_of_points; i++) - val[i] = 1; - } - - *len = number_of_points; - - grib_context_free(a->context, coded_vals); - return err; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - // See deprecated/grib_accessor_class_gds_not_present_bitmap.cc for - // a possible implementation - return GRIB_NOT_IMPLEMENTED; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_DOUBLE; -} diff --git a/src/accessor/todo/grib_accessor_class_gen.cc b/src/accessor/todo/grib_accessor_class_gen.cc deleted file mode 100644 index b611f5043..000000000 --- a/src/accessor/todo/grib_accessor_class_gen.cc +++ /dev/null @@ -1,675 +0,0 @@ -/* - * (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. - */ - -/*************************************************************************** - * Jean Baptiste Filippi - 01.11.2005 * - * Enrico Fucile * - * Shahram Najm * - ***************************************************************************/ -#include "grib_api_internal.h" -#include "grib_value.h" -#include -#include - -/* - This is used by make_class.pl - - START_CLASS_DEF - 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 - IMPLEMENTS = unpack_double_subarray - IMPLEMENTS = init;dump;destroy;string_length - IMPLEMENTS = get_native_type;sub_section - IMPLEMENTS = next_offset;value_count;byte_offset;byte_count - IMPLEMENTS = notify_change;pack_expression - IMPLEMENTS = update_size; next; preferred_size - IMPLEMENTS = compare;is_missing;make_clone - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static grib_section* sub_section(grib_accessor* a); -static int get_native_type(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_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); -static size_t string_length(grib_accessor*); -static long byte_count(grib_accessor*); -static long byte_offset(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static int notify_change(grib_accessor*, grib_accessor*); -static void update_size(grib_accessor*, size_t); -static size_t preferred_size(grib_accessor*, int); -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_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* 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*); - -typedef struct grib_accessor_gen -{ - grib_accessor att; - /* Members defined in gen */ -} grib_accessor_gen; - - -static grib_accessor_class _grib_accessor_class_gen = { - 0, /* super */ - "gen", /* name */ - sizeof(grib_accessor_gen), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - &get_native_type, /* get native type */ - &sub_section, /* get sub_section */ - 0, /* pack_missing */ - &is_missing, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - &pack_string_array, /* pack_string_array */ - &unpack_string_array, /* unpack_string_array */ - &pack_bytes, /* pack_bytes */ - &unpack_bytes, /* unpack_bytes */ - &pack_expression, /* pack_expression */ - ¬ify_change, /* notify_change */ - &update_size, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - &next, /* next accessor */ - &compare, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - &unpack_double_subarray, /* unpack a subarray */ - &clear, /* clear */ - &make_clone, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_gen = &_grib_accessor_class_gen; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* param) -{ - grib_action* act = (grib_action*)(a->creator); - if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { - a->length = 0; - if (!a->vvalue) - a->vvalue = (grib_virtual_value*)grib_context_malloc_clear(a->context, sizeof(grib_virtual_value)); - a->vvalue->type = grib_accessor_get_native_type(a); - a->vvalue->length = len; - if (act->default_value != NULL) { - const char* p = 0; - size_t s_len = 1; - long l; - int ret = 0; - double d; - char tmp[1024]; - grib_expression* expression = grib_arguments_get_expression(grib_handle_of_accessor(a), act->default_value, 0); - int type = grib_expression_native_type(grib_handle_of_accessor(a), expression); - switch (type) { - case GRIB_TYPE_DOUBLE: - grib_expression_evaluate_double(grib_handle_of_accessor(a), expression, &d); - grib_pack_double(a, &d, &s_len); - break; - - case GRIB_TYPE_LONG: - grib_expression_evaluate_long(grib_handle_of_accessor(a), expression, &l); - grib_pack_long(a, &l, &s_len); - break; - - default: - s_len = sizeof(tmp); - p = grib_expression_evaluate_string(grib_handle_of_accessor(a), expression, tmp, &s_len, &ret); - if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to evaluate %s as string", a->name); - Assert(0); - } - s_len = strlen(p) + 1; - grib_pack_string(a, p, &s_len); - break; - } - } - } - else { - a->length = len; - } -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - const int type = grib_accessor_get_native_type(a); - switch (type) { - case GRIB_TYPE_STRING: - grib_dump_string(dumper, a, NULL); - break; - case GRIB_TYPE_DOUBLE: - grib_dump_double(dumper, a, NULL); - break; - case GRIB_TYPE_LONG: - grib_dump_long(dumper, a, NULL); - break; - default: - grib_dump_bytes(dumper, a, NULL); - } -} - -static long next_offset(grib_accessor* a) -{ - return a->offset + a->length; -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static size_t string_length(grib_accessor* a) -{ - return 1024; -} - -static long byte_count(grib_accessor* a) -{ - return a->length; -} - -static int get_native_type(grib_accessor* a) -{ - grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s [%s] must implement 'get_native_type'", a->name, a->cclass->name); - return GRIB_TYPE_UNDEFINED; -} - -static long byte_offset(grib_accessor* a) -{ - return a->offset; -} - -static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len) -{ - unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; - const long length = grib_byte_count(a); - const long offset = grib_byte_offset(a); - - if (*len < length) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it is %ld bytes long", a->name, length); - *len = length; - return GRIB_ARRAY_TOO_SMALL; - } - - memcpy(val, buf + offset, length); - *len = length; - - return GRIB_SUCCESS; -} - -static int clear(grib_accessor* a) -{ - unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; - const long length = grib_byte_count(a); - const long offset = grib_byte_offset(a); - - memset(buf + offset, 0, length); - - return GRIB_SUCCESS; -} - -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 != &unpack_double) { - double val = 0.0; - size_t l = 1; - grib_unpack_double(a, &val, &l); - if (val == GRIB_MISSING_DOUBLE) - *v = GRIB_MISSING_LONG; - else - *v = (long)val; - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to long", 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 = strtol(val, &last, 10); - - if (*last == 0) { - 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 key '%s' as long", 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; -} - -template -static int 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; - const char* Tname = type_to_string(*v); - 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, Tname); - 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 %s", a->name, Tname); - return GRIB_SUCCESS; - } - } - - grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as %s", a->name, Tname); - 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_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) -{ - int err = 0; - if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { - double val = 0.0; - size_t l = 1; - err = grib_unpack_double(a, &val, &l); - if (err) return err; - snprintf(v, 64, "%g", val); - *len = strlen(v); - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to string", a->name); - return GRIB_SUCCESS; - } - - if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { - long val = 0; - size_t l = 1; - err = grib_unpack_long(a, &val, &l); - if (err) return err; - snprintf(v, 64, "%ld", val); - *len = strlen(v); - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to string\n", a->name); - return GRIB_SUCCESS; - } - - return GRIB_NOT_IMPLEMENTED; -} - -static int unpack_string_array(grib_accessor* a, char** v, size_t* len) -{ - size_t length = 0; - - int err = grib_get_string_length_acc(a, &length); - if (err) - return err; - v[0] = (char*)grib_context_malloc_clear(a->context, length); - grib_unpack_string(a, v[0], &length); // TODO(masn): check return value - *len = 1; - - return GRIB_SUCCESS; -} - -static int pack_expression(grib_accessor* a, grib_expression* e) -{ - size_t len = 1; - long lval = 0; - double dval = 0; - const char* cval = NULL; - int ret = 0; - grib_handle* hand = grib_handle_of_accessor(a); - - // Use the native type of the expression not the accessor - switch (grib_expression_native_type(hand, e)) { - case GRIB_TYPE_LONG: { - len = 1; - ret = grib_expression_evaluate_long(hand, e, &lval); - if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to set %s as long (from %s)", - a->name, e->cclass->name); - return ret; - } - /*if (hand->context->debug) - printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %ld\n", a->name,lval);*/ - return grib_pack_long(a, &lval, &len); - } - - case GRIB_TYPE_DOUBLE: { - len = 1; - ret = grib_expression_evaluate_double(hand, e, &dval); - if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to set %s as double (from %s)", - a->name, e->cclass->name); - return ret; - } - /*if (hand->context->debug) - printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %g\n", a->name, dval);*/ - return grib_pack_double(a, &dval, &len); - } - - case GRIB_TYPE_STRING: { - char tmp[1024]; - len = sizeof(tmp); - cval = grib_expression_evaluate_string(hand, e, tmp, &len, &ret); - if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to set %s as string (from %s)", - a->name, e->cclass->name); - return ret; - } - len = strlen(cval); - /*if (hand->context->debug) - printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %s\n", a->name, cval);*/ - return grib_pack_string(a, cval, &len); - } - } - - return GRIB_NOT_IMPLEMENTED; -} - -static int pack_long(grib_accessor* a, const long* v, size_t* len) -{ - grib_context* c = a->context; - if (a->cclass->pack_double && a->cclass->pack_double != &pack_double) { - double* val = (double*)grib_context_malloc(c, *len * (sizeof(double))); - if (!val) { - grib_context_log(c, GRIB_LOG_ERROR, "Unable to allocate %zu bytes", *len * (sizeof(double))); - return GRIB_OUT_OF_MEMORY; - } - for (size_t i = 0; i < *len; i++) - val[i] = v[i]; - int ret = grib_pack_double(a, val, len); - grib_context_free(c, val); - return ret; - } - grib_context_log(c, GRIB_LOG_ERROR, "Should not pack '%s' as an integer", a->name); - if (a->cclass->pack_string && a->cclass->pack_string != &pack_string) { - grib_context_log(c, GRIB_LOG_ERROR, "Try packing as a string"); - } - return GRIB_NOT_IMPLEMENTED; -} - -static int pack_double_array_as_long(grib_accessor* a, const double* v, size_t* len) -{ - grib_context* c = a->context; - int ret = GRIB_SUCCESS; - size_t numBytes = *len * (sizeof(long)); - long* lValues = (long*)grib_context_malloc(c, numBytes); - if (!lValues) { - grib_context_log(c, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", numBytes); - return GRIB_OUT_OF_MEMORY; - } - for (size_t i = 0; i < *len; i++) - lValues[i] = (long)v[i]; /* convert from double to long */ - ret = grib_pack_long(a, lValues, len); - grib_context_free(c, lValues); - return ret; -} - -static int pack_double(grib_accessor* a, const double* v, size_t* len) -{ - int do_pack_as_long = 0; - grib_context* c = a->context; - if (a->cclass->pack_long && a->cclass->pack_long != &pack_long) { - do_pack_as_long = 1; - } - else { - /* ECC-648: Special case of codetable */ - if (strcmp(a->cclass->name, "codetable") == 0) { - do_pack_as_long = 1; - } - } - if (do_pack_as_long) { - return pack_double_array_as_long(a, v, len); - } - grib_context_log(c, GRIB_LOG_ERROR, "Should not pack '%s' as a double", a->name); - if (a->cclass->pack_string && a->cclass->pack_string != &pack_string) { - grib_context_log(c, GRIB_LOG_ERROR, "Try packing as a string"); - } - return GRIB_NOT_IMPLEMENTED; -} - -static int pack_string_array(grib_accessor* a, const char** v, size_t* len) -{ - int err = 0; - size_t length = 0; - grib_accessor* as = 0; - - as = a; - long i = (long)*len - 1; - while (as && i >= 0) { - length = strlen(v[i]); - err = grib_pack_string(as, v[i], &length); - if (err) - return err; - --i; - as = as->same; - } - return GRIB_SUCCESS; -} - -static int pack_string(grib_accessor* a, const char* v, size_t* len) -{ - if (a->cclass->pack_double && a->cclass->pack_double != &pack_double) { - size_t l = 1; - char* endPtr = NULL; /* for error handling */ - double val = strtod(v, &endPtr); - if (*endPtr) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Invalid value (%s) for key '%s'. String cannot be converted to a double", - __func__, v, a->name); - return GRIB_WRONG_TYPE; - } - return grib_pack_double(a, &val, &l); - } - - if (a->cclass->pack_long && a->cclass->pack_long != &pack_long) { - size_t l = 1; - long val = atol(v); - return grib_pack_long(a, &val, &l); - } - - grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack '%s' as string", a->name); - return GRIB_NOT_IMPLEMENTED; -} - -static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len) -{ - const size_t length = *len; - if (length != a->length) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "pack_bytes: Wrong size (%zu) for %s. It is %ld bytes long", - length, a->name, a->length); - return GRIB_BUFFER_TOO_SMALL; - } - grib_buffer_replace(a, val, length, 1, 1); - return GRIB_SUCCESS; -} - -static void destroy(grib_context* ct, grib_accessor* a) -{ - grib_dependency_remove_observed(a); - grib_dependency_remove_observer(a); - if (a->vvalue != NULL) { - grib_context_free(ct, a->vvalue); - a->vvalue = NULL; - } - /*grib_context_log(ct,GRIB_LOG_DEBUG,"address=%p",a);*/ -} - -static grib_section* sub_section(grib_accessor* a) -{ - return NULL; -} - -static int notify_change(grib_accessor* self, grib_accessor* observed) -{ - /* Default behaviour is to notify creator */ - return grib_action_notify_change(self->creator, self, observed); -} - -static void update_size(grib_accessor* a, size_t s) -{ - grib_context_log(a->context, GRIB_LOG_FATAL, - "Accessor %s [%s] must implement 'update_size'", a->name, a->cclass->name); -} - -static grib_accessor* next(grib_accessor* a, int mod) -{ - grib_accessor* next = NULL; - if (a->next) { - next = a->next; - } - else { - if (a->parent->owner) - next = a->parent->owner->cclass->next(a->parent->owner, 0); - } - return next; -} - -static int compare(grib_accessor* a, grib_accessor* b) -{ - return GRIB_NOT_IMPLEMENTED; -} - -/* Redefined in all padding */ - -static size_t preferred_size(grib_accessor* a, int from_handle) -{ - return a->length; -} - -static int is_missing(grib_accessor* a) -{ - int i = 0; - int is_missing = 1; - unsigned char ones = 0xff; - unsigned char* v = NULL; - - if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { - if (a->vvalue == NULL) { - grib_context_log(a->context, GRIB_LOG_ERROR, "%s internal error (flags=0x%lX)", a->name, a->flags); - Assert(!"grib_accessor_class_gen::is_missing(): a->vvalue == NULL"); - return 0; - } - return a->vvalue->missing; - } - Assert(a->length >= 0); - - v = grib_handle_of_accessor(a)->buffer->data + a->offset; - - for (i = 0; i < a->length; i++) { - if (*v != ones) { - is_missing = 0; - break; - } - v++; - } - - return is_missing; -} - -static int unpack_double_element(grib_accessor* a, size_t i, double* val) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static int unpack_double_subarray(grib_accessor* a, double* val, size_t start, size_t len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static grib_accessor* make_clone(grib_accessor* a, grib_section* s, int* err) -{ - *err = GRIB_NOT_IMPLEMENTED; - return NULL; -} diff --git a/src/accessor/todo/grib_accessor_class_getenv.cc b/src/accessor/todo/grib_accessor_class_getenv.cc deleted file mode 100644 index 6bc0ced3e..000000000 --- a/src/accessor/todo/grib_accessor_class_getenv.cc +++ /dev/null @@ -1,157 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_ascii - IMPLEMENTS = pack_string;unpack_string;value_count - IMPLEMENTS = init;string_length - MEMBERS= const char* name - MEMBERS= char* value - MEMBERS= const char* default_value - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_string(grib_accessor*, const char*, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_getenv -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ascii */ - /* Members defined in getenv */ - const char* name; - char* value; - const char* default_value; -} grib_accessor_getenv; - -extern grib_accessor_class* grib_accessor_class_ascii; - -static grib_accessor_class _grib_accessor_class_getenv = { - &grib_accessor_class_ascii, /* super */ - "getenv", /* name */ - sizeof(grib_accessor_getenv), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_getenv = &_grib_accessor_class_getenv; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* args) -{ - grib_accessor_getenv* self = (grib_accessor_getenv*)a; - static char undefined[] = "undefined"; - - self->name = grib_arguments_get_string(grib_handle_of_accessor(a), args, 0); - self->default_value = grib_arguments_get_string(grib_handle_of_accessor(a), args, 1); - if (!self->default_value) - self->default_value = undefined; - self->value = 0; -} - -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_getenv* self = (grib_accessor_getenv*)a; - char* v = 0; - size_t l = 0; - - if (!self->value) { - v = getenv(self->name); - if (!v) - v = (char*)self->default_value; - self->value = v; - } - - l = strlen(self->value); - if (*len < l) - return GRIB_BUFFER_TOO_SMALL; - snprintf(val, 1024, "%s", self->value); - *len = strlen(self->value); - - return GRIB_SUCCESS; -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static size_t string_length(grib_accessor* a) -{ - return 1024; -} diff --git a/src/accessor/todo/grib_accessor_class_group.cc b/src/accessor/todo/grib_accessor_class_group.cc deleted file mode 100644 index df2118bff..000000000 --- a/src/accessor/todo/grib_accessor_class_group.cc +++ /dev/null @@ -1,272 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_string - IMPLEMENTS = unpack_long - IMPLEMENTS = unpack_double - IMPLEMENTS = init;dump;string_length - IMPLEMENTS = value_count - IMPLEMENTS = next_offset - IMPLEMENTS = get_native_type - IMPLEMENTS = compare - MEMBERS = char endCharacter - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_double(grib_accessor*, double* 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 size_t string_length(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_group -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in group */ - char endCharacter; -} grib_accessor_group; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_group = { - &grib_accessor_class_gen, /* super */ - "group", /* name */ - sizeof(grib_accessor_group), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_group = &_grib_accessor_class_group; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; - grib_accessor_group* self = (grib_accessor_group*)a; - - size_t i = 0; - unsigned char* v; - const char* s = grib_arguments_get_string(grib_handle_of_accessor(a), arg, 0); - - if (s && strlen(s) > 1) { - grib_context_log(a->context, GRIB_LOG_WARNING, - "Using only first character as group end of %s not the string %s", a->name, s); - } - - self->endCharacter = s ? s[0] : 0; - - v = buffer->data + a->offset; - i = 0; - if (s) { - while (*v != self->endCharacter && i <= buffer->ulength) { - if (*v > 126) - *v = 32; - v++; - i++; - } - } - else { - while (*v > 32 && *v != 61 && *v < 127 && i <= buffer->ulength) { - v++; - i++; - } - } - a->length = i; - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static size_t string_length(grib_accessor* a) -{ - return a->length; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_string(dumper, a, NULL); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - long i = 0; - size_t l = a->length + 1; - grib_handle* h = grib_handle_of_accessor(a); - - if (*len < l) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - a->cclass->name, a->name, l, *len); - *len = l; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < a->length; i++) - val[i] = h->buffer->data[a->offset + i]; - val[i] = 0; - *len = i; - return GRIB_SUCCESS; -} - -static int unpack_long(grib_accessor* a, long* v, size_t* len) -{ - char val[1024] = {0,}; - size_t l = sizeof(val); - size_t i = 0; - char* last = NULL; - int err = grib_unpack_string(a, val, &l); - - if (err) - return err; - - i = 0; - while (i < l - 1 && val[i] == ' ') - i++; - - if (val[i] == 0) { - *v = 0; - return 0; - } - if (val[i + 1] == ' ' && i < l - 2) - val[i + 1] = 0; - - *v = strtol(val, &last, 10); - - grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); - return GRIB_SUCCESS; -} - -static int unpack_double(grib_accessor* a, double* v, size_t* len) -{ - char val[1024]; - size_t l = sizeof(val); - char* last = NULL; - grib_unpack_string(a, val, &l); - - *v = strtod(val, &last); - - if (*last == 0) { - grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); - return GRIB_SUCCESS; - } - - return GRIB_NOT_IMPLEMENTED; -} - -static int compare(grib_accessor* a, grib_accessor* b) -{ - grib_context_log(a->context, GRIB_LOG_ERROR, "%s:%s not implemented", __func__, a->name); - return GRIB_NOT_IMPLEMENTED; - - // int retval = 0; - // char* aval = 0; - // char* bval = 0; - // int err = 0; - // size_t alen = 0; - // size_t blen = 0; - // long count = 0; - // err = grib_value_count(a, &count); - // if (err) return err; - // alen = count; - // err = grib_value_count(b, &count); - // if (err) return err; - // blen = count; - // if (alen != blen) return GRIB_COUNT_MISMATCH; - // aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); - // bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - // grib_unpack_string(a, aval, &alen); - // grib_unpack_string(b, bval, &blen); - // retval = GRIB_SUCCESS; - // if (strcmp(aval, bval)) retval = GRIB_STRING_VALUE_MISMATCH; - // grib_context_free(a->context, aval); - // grib_context_free(b->context, bval); - // return retval; -} - -static long next_offset(grib_accessor* a) -{ - return a->offset + a->length; -} diff --git a/src/accessor/todo/grib_accessor_class_gts_header.cc b/src/accessor/todo/grib_accessor_class_gts_header.cc deleted file mode 100644 index 65b295634..000000000 --- a/src/accessor/todo/grib_accessor_class_gts_header.cc +++ /dev/null @@ -1,152 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_ascii - IMPLEMENTS = unpack_string;value_count - IMPLEMENTS = init;string_length - MEMBERS = int gts_offset - MEMBERS = int gts_length - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_gts_header -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ascii */ - /* Members defined in gts_header */ - int gts_offset; - int gts_length; -} grib_accessor_gts_header; - -extern grib_accessor_class* grib_accessor_class_ascii; - -static grib_accessor_class _grib_accessor_class_gts_header = { - &grib_accessor_class_ascii, /* super */ - "gts_header", /* name */ - sizeof(grib_accessor_gts_header), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_gts_header = &_grib_accessor_class_gts_header; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_gts_header* self = (grib_accessor_gts_header*)a; - self->gts_offset = -1; - self->gts_length = -1; - self->gts_offset = grib_arguments_get_long(grib_handle_of_accessor(a), c, 0); - self->gts_length = grib_arguments_get_long(grib_handle_of_accessor(a), c, 1); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_gts_header* self = (grib_accessor_gts_header*)a; - grib_handle* h = grib_handle_of_accessor(a); - int offset = 0; - size_t length = 0; - - if (h->gts_header == NULL || h->gts_header_len < 8) { - if (*len < 8) - return GRIB_BUFFER_TOO_SMALL; - snprintf(val, 1024, "missing"); - return GRIB_SUCCESS; - } - if (*len < h->gts_header_len) - return GRIB_BUFFER_TOO_SMALL; - - offset = self->gts_offset > 0 ? self->gts_offset : 0; - length = self->gts_length > 0 ? self->gts_length : h->gts_header_len; - - memcpy(val, h->gts_header + offset, length); - - *len = length; - - return GRIB_SUCCESS; -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static size_t string_length(grib_accessor* a) -{ - grib_handle* h = grib_handle_of_accessor(a); - return h->gts_header_len; -} diff --git a/src/accessor/todo/grib_accessor_class_hash_array.cc b/src/accessor/todo/grib_accessor_class_hash_array.cc deleted file mode 100644 index d191a5232..000000000 --- a/src/accessor/todo/grib_accessor_class_hash_array.cc +++ /dev/null @@ -1,293 +0,0 @@ -/* - * (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. - */ - - -/******************************************************* - * Enrico Fucile - ******************************************************/ - -#include "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = unpack_string;pack_string;string_length - IMPLEMENTS = unpack_long;pack_long;destroy - IMPLEMENTS = init;dump;value_count;get_native_type - IMPLEMENTS = compare - MEMBERS = char* key - MEMBERS = grib_hash_array_value* ha - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 pack_long(grib_accessor*, const long* val, size_t* len); -static int pack_string(grib_accessor*, const char*, size_t* len); -static int unpack_double(grib_accessor*, double* 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 size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_hash_array -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in hash_array */ - char* key; - grib_hash_array_value* ha; -} grib_accessor_hash_array; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_hash_array = { - &grib_accessor_class_gen, /* super */ - "hash_array", /* name */ - sizeof(grib_accessor_hash_array), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_hash_array = &_grib_accessor_class_hash_array; - -/* END_CLASS_IMP */ - -#define MAX_HASH_ARRAY_STRING_LENGTH 255 - -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; - a->length = 0; - self->key = 0; - self->ha = NULL; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_string(dumper, a, NULL); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; - char s[200] = {0,}; - snprintf(s, sizeof(s), "%g", *val); - self->key = grib_context_strdup(a->context, s); - self->ha = 0; - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; - char s[200] = {0,}; - snprintf(s, sizeof(s), "%ld", *val); - if (self->key) - grib_context_free(a->context, self->key); - self->key = grib_context_strdup(a->context, s); - self->ha = 0; - return GRIB_SUCCESS; -} - -static int pack_string(grib_accessor* a, const char* v, size_t* len) -{ - grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; - self->key = grib_context_strdup(a->context, v); - self->ha = 0; - return GRIB_SUCCESS; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static grib_hash_array_value* find_hash_value(grib_accessor* a, int* err) -{ - grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; - grib_hash_array_value* ha_ret = 0; - grib_hash_array_value* ha = NULL; - - ha = get_hash_array(grib_handle_of_accessor(a), a->creator); - if (!ha) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "unable to get hash value for %s", a->creator->name); - *err = GRIB_HASH_ARRAY_NO_MATCH; - return NULL; - } - - *err = GRIB_SUCCESS; - - Assert(ha != NULL); - if (!self->key) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "unable to get hash value for %s, set before getting", a->creator->name); - *err = GRIB_HASH_ARRAY_NO_MATCH; - return NULL; - } - - ha_ret = (grib_hash_array_value*)grib_trie_get(ha->index, self->key); - if (!ha_ret) - ha_ret = (grib_hash_array_value*)grib_trie_get(ha->index, "default"); - - if (!ha_ret) { - *err = GRIB_HASH_ARRAY_NO_MATCH; - grib_context_log(a->context, GRIB_LOG_ERROR, - "hash_array: no match for %s=%s", - a->creator->name, self->key); - const char* full_path = get_hash_array_full_path(a->creator); - if (full_path) { - grib_context_log(a->context, GRIB_LOG_ERROR, "hash_array: file path = %s", full_path); - } - grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Check the key 'masterTablesVersionNumber'"); - return NULL; - } - return ha_ret; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_hash_array_value* ha = 0; - grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; - int err = 0; - size_t i = 0; - - if (!self->ha) { - ha = find_hash_value(a, &err); - if (err) - return err; - self->ha = ha; - } - - switch (self->ha->type) { - case GRIB_HASH_ARRAY_TYPE_INTEGER: - if (*len < self->ha->iarray->n) { - return GRIB_ARRAY_TOO_SMALL; - } - *len = self->ha->iarray->n; - for (i = 0; i < *len; i++) - val[i] = self->ha->iarray->v[i]; - break; - - default: - return GRIB_NOT_IMPLEMENTED; - } - - return GRIB_SUCCESS; -} - -static int get_native_type(grib_accessor* a) -{ - int type = GRIB_TYPE_STRING; - if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) - type = GRIB_TYPE_LONG; - - return type; -} - -static void destroy(grib_context* c, grib_accessor* a) -{ - grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; - if (self->key) - grib_context_free(c, self->key); -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static size_t string_length(grib_accessor* a) -{ - return MAX_HASH_ARRAY_STRING_LENGTH; -} - -static int value_count(grib_accessor* a, long* count) -{ - int err = 0; - grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; - grib_hash_array_value* ha = 0; - - if (!self->ha) { - ha = find_hash_value(a, &err); - if (err) - return err; - self->ha = ha; - } - - *count = self->ha->iarray->n; - return err; -} - -static int compare(grib_accessor* a, grib_accessor* b) -{ - return GRIB_NOT_IMPLEMENTED; -} diff --git a/src/accessor/todo/grib_accessor_class_headers_only.cc b/src/accessor/todo/grib_accessor_class_headers_only.cc deleted file mode 100644 index d3a98efb0..000000000 --- a/src/accessor/todo/grib_accessor_class_headers_only.cc +++ /dev/null @@ -1,116 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long; get_native_type - IMPLEMENTS = init - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_headers_only -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in headers_only */ -} grib_accessor_headers_only; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_headers_only = { - &grib_accessor_class_gen, /* super */ - "headers_only", /* name */ - sizeof(grib_accessor_headers_only), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_headers_only = &_grib_accessor_class_headers_only; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - *val = grib_handle_of_accessor(a)->partial; - *len = 1; - return 0; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_ibmfloat.cc b/src/accessor/todo/grib_accessor_class_ibmfloat.cc deleted file mode 100644 index 27e6da1c5..000000000 --- a/src/accessor/todo/grib_accessor_class_ibmfloat.cc +++ /dev/null @@ -1,264 +0,0 @@ -/* - * (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 "grib_api_internal.h" -#include - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = unpack_float - IMPLEMENTS = init - IMPLEMENTS = next_offset - IMPLEMENTS = byte_count - IMPLEMENTS = value_count - IMPLEMENTS = byte_offset - MEMBERS = grib_arguments* arg - IMPLEMENTS = update_size - IMPLEMENTS = nearest_smaller_value - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 long byte_count(grib_accessor*); -static long byte_offset(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); -static int nearest_smaller_value (grib_accessor*, double, double*); - -typedef struct grib_accessor_ibmfloat -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in ibmfloat */ - grib_arguments* arg; -} grib_accessor_ibmfloat; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_ibmfloat = { - &grib_accessor_class_double, /* super */ - "ibmfloat", /* name */ - sizeof(grib_accessor_ibmfloat), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - &next_offset, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - &nearest_smaller_value, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_ibmfloat = &_grib_accessor_class_ibmfloat; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_ibmfloat* self = (grib_accessor_ibmfloat*)a; - long count = 0; - - self->arg = arg; - grib_value_count(a, &count); - a->length = 4 * count; - Assert(a->length >= 0); -} - -template -static int unpack(grib_accessor* a, T* val, size_t* len) -{ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - unsigned long rlen = 0; - long count = 0; - int err = 0; - unsigned long i = 0; - long bitp = a->offset * 8; - grib_handle* hand = grib_handle_of_accessor(a); - - err = grib_value_count(a, &count); - if (err) - return err; - rlen = count; - - if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %lu values", *len, a->name, rlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < rlen; i++) - val[i] = (T)grib_long_to_ibm(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); - - *len = rlen; - 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 pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_ibmfloat* self = (grib_accessor_ibmfloat*)a; - int ret = 0; - unsigned long i = 0; - unsigned long rlen = *len; - size_t buflen = 0; - unsigned char* buf = NULL; - long off = 0; - - if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it packs at least 1 value", a->name); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - if (rlen == 1) { - - //double x = 0; - //grib_nearest_smaller_ibm_float(val[0],&x); - //double y = grib_long_to_ibm(grib_ibm_to_long(val[0])); - //printf("IBMFLOAT val=%.20f nearest_smaller_ibm_float=%.20f long_to_ibm=%.20f\n",val[0],x ,y); - - off = byte_offset(a) * 8; - ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, grib_ibm_to_long(val[0]), &off, 32); - if (*len > 1) - grib_context_log(a->context, GRIB_LOG_WARNING, "ibmfloat: Trying to pack %zu values in a scalar %s, packing first value", - *len, a->name); - if (ret == GRIB_SUCCESS) - len[0] = 1; - return ret; - } - - buflen = rlen * 4; - - buf = (unsigned char*)grib_context_malloc(a->context, buflen); - - for (i = 0; i < rlen; i++) { - grib_encode_unsigned_longb(buf, grib_ibm_to_long(val[i]), &off, 32); - } - ret = grib_set_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), rlen); - - if (ret == GRIB_SUCCESS) - grib_buffer_replace(a, buf, buflen, 1, 1); - else - *len = 0; - - grib_context_free(a->context, buf); - - a->length = byte_count(a); - - return ret; -} - -static long byte_count(grib_accessor* a) -{ - return a->length; -} - -static int value_count(grib_accessor* a, long* len) -{ - grib_accessor_ibmfloat* self = (grib_accessor_ibmfloat*)a; - *len = 0; - if (!self->arg) { - *len = 1; - return 0; - } - return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); -} - -static long byte_offset(grib_accessor* a) -{ - return a->offset; -} - -static void update_size(grib_accessor* a, size_t s) -{ - a->length = (long)s; - Assert(a->length >= 0); -} - -static long next_offset(grib_accessor* a) -{ - return grib_byte_offset(a) + grib_byte_count(a); -} - -static int nearest_smaller_value(grib_accessor* a, double val, double* nearest) -{ - int ret = 0; - if (grib_nearest_smaller_ibm_float(val, nearest) == GRIB_INTERNAL_ERROR) { - grib_context_log(a->context, GRIB_LOG_ERROR, "ibm_float:nearest_smaller_value overflow value=%g", val); - grib_dump_content(grib_handle_of_accessor(a), stderr, "wmo", GRIB_DUMP_FLAG_HEXADECIMAL, 0); - ret = GRIB_INTERNAL_ERROR; - } - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_ieeefloat.cc b/src/accessor/todo/grib_accessor_class_ieeefloat.cc deleted file mode 100644 index d6fa411bb..000000000 --- a/src/accessor/todo/grib_accessor_class_ieeefloat.cc +++ /dev/null @@ -1,226 +0,0 @@ -/* - * (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 "grib_api_internal.h" -#include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = unpack_float - IMPLEMENTS = init - IMPLEMENTS = value_count - MEMBERS = grib_arguments* arg - IMPLEMENTS = update_size - IMPLEMENTS = nearest_smaller_value - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 update_size(grib_accessor*, size_t); -static int nearest_smaller_value (grib_accessor*, double, double*); - -typedef struct grib_accessor_ieeefloat -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in ieeefloat */ - grib_arguments* arg; -} grib_accessor_ieeefloat; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_ieeefloat = { - &grib_accessor_class_double, /* super */ - "ieeefloat", /* name */ - sizeof(grib_accessor_ieeefloat), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - &nearest_smaller_value, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_ieeefloat = &_grib_accessor_class_ieeefloat; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_ieeefloat* self = (grib_accessor_ieeefloat*)a; - long count = 0; - self->arg = arg; - grib_value_count(a, &count); - a->length = 4 * count; - Assert(a->length >= 0); -} - -static int value_count(grib_accessor* a, long* len) -{ - grib_accessor_ieeefloat* self = (grib_accessor_ieeefloat*)a; - *len = 0; - - if (!self->arg) { - *len = 1; - return 0; - } - return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_ieeefloat* self = (grib_accessor_ieeefloat*)a; - int ret = 0; - unsigned long i = 0; - unsigned long rlen = (unsigned long)*len; - size_t buflen = 0; - unsigned char* buf = NULL; - long off = 0; - - if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it packs at least 1 value", a->name); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - if (rlen == 1) { - off = a->offset * 8; - ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, grib_ieee_to_long(val[0]), &off, 32); - if (*len > 1) - grib_context_log(a->context, GRIB_LOG_WARNING, "ieeefloat: Trying to pack %zu values in a scalar %s, packing first value", - *len, a->name); - if (ret == GRIB_SUCCESS) - len[0] = 1; - return ret; - } - - buflen = rlen * 4; - - buf = (unsigned char*)grib_context_malloc(a->context, buflen); - - for (i = 0; i < rlen; i++) { - grib_encode_unsigned_longb(buf, grib_ieee_to_long(val[i]), &off, 32); - } - ret = grib_set_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), rlen); - - if (ret == GRIB_SUCCESS) - grib_buffer_replace(a, buf, buflen, 1, 1); - else - *len = 0; - - grib_context_free(a->context, buf); - - 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"); - long rlen = 0; - int err = 0; - long i = 0; - long bitp = a->offset * 8; - grib_handle* hand = grib_handle_of_accessor(a); - - err = grib_value_count(a, &rlen); - if (err) - return err; - - if (*len < (size_t)rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %ld values", *len, a->name, rlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < rlen; i++) - val[i] = (T)grib_long_to_ieee(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); - - *len = rlen; - 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 void update_size(grib_accessor* a, size_t s) -{ - a->length = (long)s; - Assert(a->length >= 0); -} - -static int nearest_smaller_value(grib_accessor* a, double val, double* nearest) -{ - return grib_nearest_smaller_ieee_float(val, nearest); -} diff --git a/src/accessor/todo/grib_accessor_class_ifs_param.cc b/src/accessor/todo/grib_accessor_class_ifs_param.cc deleted file mode 100644 index ba7e522c1..000000000 --- a/src/accessor/todo/grib_accessor_class_ifs_param.cc +++ /dev/null @@ -1,188 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long; pack_long - IMPLEMENTS = init; get_native_type - MEMBERS=const char* paramId - MEMBERS=const char* type - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_ifs_param -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ifs_param */ - const char* paramId; - const char* type; -} grib_accessor_ifs_param; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_ifs_param = { - &grib_accessor_class_gen, /* super */ - "ifs_param", /* name */ - sizeof(grib_accessor_ifs_param), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_ifs_param = &_grib_accessor_class_ifs_param; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_ifs_param* self = (grib_accessor_ifs_param*)a; - int n = 0; - - self->paramId = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->type = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_ifs_param* self = (grib_accessor_ifs_param*)a; - int ret = 0; - long paramId = 0; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->paramId, ¶mId)) != GRIB_SUCCESS) - return ret; - - if (paramId > 129000 && paramId < 129999) - *val = paramId - 129000; - else if (paramId > 200000 && paramId < 200999) - *val = paramId - 200000; - else if (paramId > 211000 && paramId < 211999) - *val = paramId - 1000; - else - *val = paramId; - - return ret; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_ifs_param* self = (grib_accessor_ifs_param*)a; - long type = 0; - long table = 128; - long paramId = *val; - long param; - - grib_get_long(grib_handle_of_accessor(a), self->type, &type); - - if (type == 33 || type == 35) { - if (paramId > 1000) { - table = paramId / 1000; - param = paramId - table * 1000; - paramId = param; - } - switch (table) { - case 210: - paramId += 211000; - break; - case 128: - paramId += 200000; - break; - default: - break; - } - } - if (type == 50 || type == 52) { - if (paramId > 1000) { - table = paramId / 1000; - param = paramId - table * 1000; - paramId = param; - } - switch (table) { - case 128: - paramId += 129000; - break; - default: - break; - } - } - - return grib_set_long_internal(grib_handle_of_accessor(a), self->paramId, paramId); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_julian_day.cc b/src/accessor/todo/grib_accessor_class_julian_day.cc deleted file mode 100644 index 7a8e28cfc..000000000 --- a/src/accessor/todo/grib_accessor_class_julian_day.cc +++ /dev/null @@ -1,209 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = dump - IMPLEMENTS = init - MEMBERS = const char *date - MEMBERS = const char *hour - MEMBERS = const char *minute - MEMBERS = const char *second - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_julian_day -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in julian_day */ - const char *date; - const char *hour; - const char *minute; - const char *second; -} grib_accessor_julian_day; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_julian_day = { - &grib_accessor_class_double, /* super */ - "julian_day", /* name */ - sizeof(grib_accessor_julian_day), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_julian_day = &_grib_accessor_class_julian_day; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_julian_day* self = (grib_accessor_julian_day*)a; - int n = 0; - - self->date = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->hour = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->minute = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->second = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - - a->length = 0; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_string(dumper, a, NULL); -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - const double v = *val; - return pack_double(a, &v, len); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_julian_day* self = (grib_accessor_julian_day*)a; - int ret = 0; - long hour = 0; - long minute = 0; - long second = 0; - long date = 0; - long year, month, day; - - ret = grib_julian_to_datetime(*val, &year, &month, &day, &hour, &minute, &second); - if (ret != 0) - return ret; - - date = year * 10000 + month * 100 + day; - - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->date, date); - if (ret != 0) - return ret; - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->hour, hour); - if (ret != 0) - return ret; - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->minute, minute); - if (ret != 0) - return ret; - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->second, second); - - return ret; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - int ret = 0; - double v = 0; - - ret = unpack_double(a, &v, len); - *val = (long)v; - - return ret; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - int ret = 0; - long date, hour, minute, second; - long year, month, day; - grib_accessor_julian_day* self = (grib_accessor_julian_day*)a; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->date, &date); - if (ret != GRIB_SUCCESS) - return ret; - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->hour, &hour); - if (ret != GRIB_SUCCESS) - return ret; - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->minute, &minute); - if (ret != GRIB_SUCCESS) - return ret; - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->second, &second); - if (ret != GRIB_SUCCESS) - return ret; - - year = date / 10000; - date %= 10000; - month = date / 100; - date %= 100; - day = date; - - ret = grib_datetime_to_julian(year, month, day, hour, minute, second, val); - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_ksec1expver.cc b/src/accessor/todo/grib_accessor_class_ksec1expver.cc deleted file mode 100644 index 762bf66e2..000000000 --- a/src/accessor/todo/grib_accessor_class_ksec1expver.cc +++ /dev/null @@ -1,185 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_ascii - IMPLEMENTS = unpack_long;pack_string; - IMPLEMENTS = pack_long - IMPLEMENTS = init - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -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 unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_ksec1expver -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ascii */ - /* Members defined in ksec1expver */ -} grib_accessor_ksec1expver; - -extern grib_accessor_class* grib_accessor_class_ascii; - -static grib_accessor_class _grib_accessor_class_ksec1expver = { - &grib_accessor_class_ascii, /* super */ - "ksec1expver", /* name */ - sizeof(grib_accessor_ksec1expver), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_ksec1expver = &_grib_accessor_class_ksec1expver; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->length = len; - Assert(a->length >= 0); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - long value = 0; - long pos = a->offset * 8; - char* intc = NULL; - char* pTemp = NULL; - char expver[5]; - char refexpver[5]; - size_t llen = a->length + 1; - Assert(a->length == 4); - - if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - value = grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, a->length * 8); - - grib_unpack_string(a, refexpver, &llen); - - /* test for endian */ - intc = (char*)&value; - pTemp = intc; - - expver[0] = *pTemp++; - expver[1] = *pTemp++; - expver[2] = *pTemp++; - expver[3] = *pTemp++; - expver[4] = 0; - -// expver[0] = intc[0]; -// expver[1] = intc[1]; -// expver[2] = intc[2]; -// expver[3] = intc[3]; -// expver[4] = 0; - - /* if there is a difference, have to reverse*/ - if (strcmp(refexpver, expver)) { - intc[0] = expver[3]; - intc[1] = expver[2]; - intc[2] = expver[1]; - intc[3] = expver[0]; - } - - *val = value; - *len = 1; - return GRIB_SUCCESS; -} - -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - int i = 0; - if (len[0] != 4) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong length for %s. It has to be 4", a->name); - return GRIB_INVALID_KEY_VALUE; - } - if (len[0] > (a->length) + 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); - len[0] = 0; - return GRIB_BUFFER_TOO_SMALL; - } - - for (i = 0; i < a->length; i++) - grib_handle_of_accessor(a)->buffer->data[a->offset + i] = val[i]; - - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - char sval[5] = {0,}; - size_t slen = 4; - snprintf(sval, sizeof(sval), "%04d", (int)(*val)); - return pack_string(a, sval, &slen); -} diff --git a/src/accessor/todo/grib_accessor_class_label.cc b/src/accessor/todo/grib_accessor_class_label.cc deleted file mode 100644 index 8d7831faf..000000000 --- a/src/accessor/todo/grib_accessor_class_label.cc +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;dump;get_native_type;unpack_string - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_string(grib_accessor*, char*, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_label -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in label */ -} grib_accessor_label; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_label = { - &grib_accessor_class_gen, /* super */ - "label", /* name */ - sizeof(grib_accessor_label), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_label = &_grib_accessor_class_label; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; - a->length = 0; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_label(dumper, a, NULL); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LABEL; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - size_t vlen = strlen(a->name); - if (vlen > *len) - return GRIB_BUFFER_TOO_SMALL; - *len = vlen; - strcpy(val, a->name); - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_latlonvalues.cc b/src/accessor/todo/grib_accessor_class_latlonvalues.cc deleted file mode 100644 index e559eaa3d..000000000 --- a/src/accessor/todo/grib_accessor_class_latlonvalues.cc +++ /dev/null @@ -1,164 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double; - IMPLEMENTS = value_count - IMPLEMENTS = init - MEMBERS =const char* values - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -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*); - -typedef struct grib_accessor_latlonvalues -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in latlonvalues */ - const char* values; -} grib_accessor_latlonvalues; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_latlonvalues = { - &grib_accessor_class_double, /* super */ - "latlonvalues", /* name */ - sizeof(grib_accessor_latlonvalues), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_latlonvalues = &_grib_accessor_class_latlonvalues; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_latlonvalues* self = (grib_accessor_latlonvalues*)a; - int n = 0; - - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_context* c = a->context; - int err = 0; - double* v = val; - double lat, lon, value; - size_t size = 0; - long count = 0; - grib_iterator* iter = grib_iterator_new(grib_handle_of_accessor(a), 0, &err); - if (err) { - if (iter) grib_iterator_delete(iter); - grib_context_log(c, GRIB_LOG_ERROR, "latlonvalues: Unable to create iterator"); - return err; - } - - err = value_count(a, &count); - if (err) return err; - size = count; - - if (*len < size) { - if (iter) grib_iterator_delete(iter); - return GRIB_ARRAY_TOO_SMALL; - } - - while (grib_iterator_next(iter, &lat, &lon, &value)) { - *(v++) = lat; - *(v++) = lon; - *(v++) = value; - } - - grib_iterator_delete(iter); - - *len = size; - - return GRIB_SUCCESS; -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_latlonvalues* self = (grib_accessor_latlonvalues*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = GRIB_SUCCESS; - size_t size; - if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) { - grib_context_log(h->context, GRIB_LOG_ERROR, "latlonvalues: Unable to get size of %s", self->values); - return ret; - } - - *count = 3 * size; - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_library_version.cc b/src/accessor/todo/grib_accessor_class_library_version.cc deleted file mode 100644 index 2088b68c4..000000000 --- a/src/accessor/todo/grib_accessor_class_library_version.cc +++ /dev/null @@ -1,130 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_ascii - IMPLEMENTS = unpack_string;value_count;string_length - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); - -typedef struct grib_accessor_library_version -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ascii */ - /* Members defined in library_version */ -} grib_accessor_library_version; - -extern grib_accessor_class* grib_accessor_class_ascii; - -static grib_accessor_class _grib_accessor_class_library_version = { - &grib_accessor_class_ascii, /* super */ - "library_version", /* name */ - sizeof(grib_accessor_library_version), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_library_version = &_grib_accessor_class_library_version; - -/* END_CLASS_IMP */ - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - char result[30] = {0,}; - size_t size; - - int major = ECCODES_MAJOR_VERSION; - int minor = ECCODES_MINOR_VERSION; - int revision = ECCODES_REVISION_VERSION; - - snprintf(result, sizeof(result), "%d.%d.%d", major, minor, revision); - size = sizeof(result); - - if (*len < size) - return GRIB_ARRAY_TOO_SMALL; - strcpy(val, result); - - *len = size; - - return GRIB_SUCCESS; -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static size_t string_length(grib_accessor* a) -{ - return 255; -} diff --git a/src/accessor/todo/grib_accessor_class_long_vector.cc b/src/accessor/todo/grib_accessor_class_long_vector.cc deleted file mode 100644 index 612163a3e..000000000 --- a/src/accessor/todo/grib_accessor_class_long_vector.cc +++ /dev/null @@ -1,208 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_abstract_long_vector - IMPLEMENTS = init - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = unpack_double;get_native_type - MEMBERS = const char* vector - MEMBERS = int index - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_long_vector -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in abstract_long_vector */ - long* v; - long pack_index; - int number_of_elements; - /* Members defined in long_vector */ - const char* vector; - int index; -} grib_accessor_long_vector; - -extern grib_accessor_class* grib_accessor_class_abstract_long_vector; - -static grib_accessor_class _grib_accessor_class_long_vector = { - &grib_accessor_class_abstract_long_vector, /* super */ - "long_vector", /* name */ - sizeof(grib_accessor_long_vector), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_long_vector = &_grib_accessor_class_long_vector; - -/* END_CLASS_IMP */ - -typedef struct grib_accessor_abstract_long_vector -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in abstract_long_vector */ - long* v; - long pack_index; - int number_of_elements; -} grib_accessor_abstract_long_vector; - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va = NULL; - grib_accessor_abstract_long_vector* v = NULL; - int n = 0; - - self->vector = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); - v = (grib_accessor_abstract_long_vector*)va; - - self->index = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); - - /* check self->index on init and never change it */ - Assert(self->index < v->number_of_elements && self->index >= 0); - - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - size_t size = 0; - int err = 0; - long* vector; - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va = NULL; - grib_accessor_abstract_long_vector* v = NULL; - - va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); - v = (grib_accessor_abstract_long_vector*)va; - - /*TODO implement the dirty mechanism to avoid to unpack every time */ - err = grib_get_size(grib_handle_of_accessor(a), self->vector, &size); - if (err) return err; - DEBUG_ASSERT(size > 0); - vector = (long*)grib_context_malloc(a->context, sizeof(long) * size); - err = grib_unpack_long(va, vector, &size); - grib_context_free(a->context, vector); - if (err) return err; - - *val = v->v[self->index]; - - return GRIB_SUCCESS; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - long lval = 0; - int err = 0; - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va = NULL; - grib_accessor_abstract_long_vector* v = NULL; - va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); - v = (grib_accessor_abstract_long_vector*)va; - - err = unpack_long(a, &lval, len); - - *val = (double)v->v[self->index]; - - return err; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - int err = 0; - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va = NULL; - grib_accessor_abstract_long_vector* v = NULL; - - va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); - v = (grib_accessor_abstract_long_vector*)va; - - v->pack_index = self->index; - - err = grib_pack_long(va, val, len); - - return err; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_lookup.cc b/src/accessor/todo/grib_accessor_class_lookup.cc deleted file mode 100644 index 5fc2880a8..000000000 --- a/src/accessor/todo/grib_accessor_class_lookup.cc +++ /dev/null @@ -1,242 +0,0 @@ -/* - * (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 "grib_api_internal.h" -#include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long; unpack_string - IMPLEMENTS = init;post_init;dump - IMPLEMENTS = byte_offset;byte_count - IMPLEMENTS = pack_long - IMPLEMENTS = notify_change - MEMBERS = long llength - MEMBERS = long loffset - MEMBERS = grib_expression* real_name - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* 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 byte_count(grib_accessor*); -static long byte_offset(grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static void post_init(grib_accessor*); -static int notify_change(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_lookup -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in lookup */ - long llength; - long loffset; - grib_expression* real_name; -} grib_accessor_lookup; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_lookup = { - &grib_accessor_class_long, /* super */ - "lookup", /* name */ - sizeof(grib_accessor_lookup), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - &post_init, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - ¬ify_change, /* 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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_lookup = &_grib_accessor_class_lookup; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_lookup* self = (grib_accessor_lookup*)a; - a->length = 0; - self->llength = len; - self->loffset = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 0); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - self->real_name = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 1); -} - -static void post_init(grib_accessor* a) -{ - grib_accessor_lookup* self = (grib_accessor_lookup*)a; - if (self->real_name) { - grib_dependency_observe_expression(a, self->real_name); - } -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_accessor_lookup* self = (grib_accessor_lookup*)a; - unsigned char bytes[1024] = {0,}; - char msg[1024] = {0,}; - char buf[2048]; - int i; - unsigned long v = 0; - - size_t llen = self->llength; - grib_unpack_bytes(a, bytes, &llen); /* TODO: Unpack byte unpack the wrong offset */ - - bytes[llen] = 0; - for (i = 0; i < llen; i++) { - msg[i] = isprint(bytes[i]) ? bytes[i] : '?'; - v <<= 8; - v |= bytes[i]; - } - - msg[llen] = 0; - - snprintf(buf, sizeof(buf), "%s %lu %ld-%ld", msg, v, (long)a->offset + self->loffset, (long)self->llength); - - grib_dump_long(dumper, a, buf); -} - -static int unpack_string(grib_accessor* a, char* v, size_t* len) -{ - grib_accessor_lookup* self = (grib_accessor_lookup*)a; - unsigned char bytes[1024] = {0,}; - int i; - - size_t llen = self->llength; - grib_unpack_bytes(a, bytes, &llen); /* TODO: Unpack byte unpack the wrong offset */ - - bytes[llen] = 0; - - for (i = 0; i < llen; i++) { - v[i] = isprint(bytes[i]) ? bytes[i] : '?'; - } - - v[llen] = 0; - if (llen == 1 && v[0] == '?') { - /* Try unpack as long */ - size_t length = 10; - long lval = 0; - int err = unpack_long(a, &lval, &length); - if (!err) { - char str[5]; - int conv = snprintf(str, sizeof(str), "%ld", lval); - if (conv == 1) { - v[0] = str[0]; - } - } - } - - return GRIB_SUCCESS; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_lookup* self = (grib_accessor_lookup*)a; - grib_handle* h = grib_handle_of_accessor(a); - - long pos = (a->offset + self->loffset) * 8; - - if (len[0] < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); - len[0] = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - /* This is used when reparsing or rebuilding */ - if (h->loader) { - Assert(*len == 1); - return h->loader->lookup_long(h->context, h->loader, a->name, val); - } - - val[0] = grib_decode_unsigned_long(h->buffer->data, &pos, self->llength * 8); - len[0] = 1; - - /*printf("###########lookup unpack_long: %s %ld %ld\n",a->name, pos/8, val[0]);*/ - - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static long byte_count(grib_accessor* a) -{ - grib_accessor_lookup* self = (grib_accessor_lookup*)a; - return self->llength; -} - -static long byte_offset(grib_accessor* a) -{ - grib_accessor_lookup* self = (grib_accessor_lookup*)a; - return self->loffset; -} - -static int notify_change(grib_accessor* self, grib_accessor* changed) -{ - /* Forward changes */ - return grib_dependency_notify_change(self); -} diff --git a/src/accessor/todo/grib_accessor_class_mars_param.cc b/src/accessor/todo/grib_accessor_class_mars_param.cc deleted file mode 100644 index beb7a68c5..000000000 --- a/src/accessor/todo/grib_accessor_class_mars_param.cc +++ /dev/null @@ -1,144 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_ascii - IMPLEMENTS = unpack_string - IMPLEMENTS = init; string_length - MEMBERS= const char* paramId - MEMBERS= const char* table - MEMBERS= const char* param - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_mars_param -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ascii */ - /* Members defined in mars_param */ - const char* paramId; - const char* table; - const char* param; -} grib_accessor_mars_param; - -extern grib_accessor_class* grib_accessor_class_ascii; - -static grib_accessor_class _grib_accessor_class_mars_param = { - &grib_accessor_class_ascii, /* super */ - "mars_param", /* name */ - sizeof(grib_accessor_mars_param), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_mars_param = &_grib_accessor_class_mars_param; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - int n = 0; - grib_accessor_mars_param* self = (grib_accessor_mars_param*)a; - self->paramId = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->table = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->param = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); -} - -// For an implementation of pack_string, see -// src/deprecated/grib_accessor_class_mars_param.cc - -// For an alternative implementation of unpack_string, see -// src/deprecated/grib_accessor_class_mars_param.cc -// -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_mars_param* self = (grib_accessor_mars_param*)a; - long param = 0; - long table = 0; - int ret = 0; - - if (self->table != NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a), self->table, &table)) != GRIB_SUCCESS) - return ret; - if (self->param != NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a), self->param, ¶m)) != GRIB_SUCCESS) - return ret; - - /*if (table==200) table=128;*/ - snprintf(val, 32, "%ld.%ld", param, table); - *len = strlen(val) + 1; - - return GRIB_SUCCESS; -} - -static size_t string_length(grib_accessor* a) -{ - return 7; -} diff --git a/src/accessor/todo/grib_accessor_class_mars_step.cc b/src/accessor/todo/grib_accessor_class_mars_step.cc deleted file mode 100644 index 7792995a7..000000000 --- a/src/accessor/todo/grib_accessor_class_mars_step.cc +++ /dev/null @@ -1,218 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_ascii - IMPLEMENTS = pack_string;unpack_string;value_count;string_length - IMPLEMENTS = pack_long; unpack_long - IMPLEMENTS = get_native_type - IMPLEMENTS = init - MEMBERS = const char* stepRange - MEMBERS = const char* stepType - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -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 unpack_long(grib_accessor*, long* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_mars_step -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ascii */ - /* Members defined in mars_step */ - const char* stepRange; - const char* stepType; -} grib_accessor_mars_step; - -extern grib_accessor_class* grib_accessor_class_ascii; - -static grib_accessor_class _grib_accessor_class_mars_step = { - &grib_accessor_class_ascii, /* super */ - "mars_step", /* name */ - sizeof(grib_accessor_mars_step), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_mars_step = &_grib_accessor_class_mars_step; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - int n = 0; - grib_accessor_mars_step* self = (grib_accessor_mars_step*)a; - self->stepRange = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->stepType = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); -} - -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - char stepType[100]; - size_t stepTypeLen = 100; - char buf[100] = {0,}; - int ret; - grib_accessor_mars_step* self = (grib_accessor_mars_step*)a; - grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); - - if (!stepRangeAcc) { - grib_context_log(a->context, GRIB_LOG_ERROR, "%s not found", self->stepRange); - return GRIB_NOT_FOUND; - } - - if ((ret = grib_get_string(grib_handle_of_accessor(a), self->stepType, stepType, &stepTypeLen)) != GRIB_SUCCESS) - return ret; - - if (!strcmp(stepType, "instant")) - snprintf(buf, sizeof(buf), "%s", val); - else - snprintf(buf, sizeof(buf), "0-%s", val); - - return grib_pack_string(stepRangeAcc, buf, len); -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - int ret = 0; - grib_accessor_mars_step* self = (grib_accessor_mars_step*)a; - char buf[100] = {0,}; - char* p = NULL; - size_t buflen = 100; - long step; - grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); - const char* cclass_name = a->cclass->name; - - if (!stepRangeAcc) { - grib_context_log(a->context, GRIB_LOG_ERROR, "%s: %s not found", cclass_name, self->stepRange); - return GRIB_NOT_FOUND; - } - - if ((ret = grib_unpack_string(stepRangeAcc, buf, &buflen)) != GRIB_SUCCESS) - return ret; - - if (*len < buflen) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, buflen, *len); - *len = buflen; - return GRIB_BUFFER_TOO_SMALL; - } - - strcpy(val, buf); - step = strtol(buf, &p, 10); - - if (p != NULL && *p == '-' && step == 0) - strcpy(val, ++p); - - *len = strlen(val); - - return ret; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - char buff[100] = {0,}; - size_t bufflen = 100; - - snprintf(buff, sizeof(buff), "%ld", *val); - - return pack_string(a, buff, &bufflen); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_mars_step* self = (grib_accessor_mars_step*)a; - grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); - - if (!stepRangeAcc) - return GRIB_NOT_FOUND; - - return grib_unpack_long(stepRangeAcc, val, len); -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static size_t string_length(grib_accessor* a) -{ - return 16; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_message.cc b/src/accessor/todo/grib_accessor_class_message.cc deleted file mode 100644 index 6c5587b22..000000000 --- a/src/accessor/todo/grib_accessor_class_message.cc +++ /dev/null @@ -1,166 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_bytes - IMPLEMENTS = init;update_size;resize; value_count - IMPLEMENTS = unpack_string; string_length - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); -static void resize(grib_accessor*,size_t); - -typedef struct grib_accessor_message -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ - /* Members defined in message */ -} grib_accessor_message; - -extern grib_accessor_class* grib_accessor_class_bytes; - -static grib_accessor_class _grib_accessor_class_message = { - &grib_accessor_class_bytes, /* super */ - "message", /* name */ - sizeof(grib_accessor_message), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - &resize, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_message = &_grib_accessor_class_message; - -/* END_CLASS_IMP */ - - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length = grib_handle_of_accessor(a)->buffer->ulength - len - a->offset; -} - -// static int compare(grib_accessor* a, grib_accessor* b) -// { -// if (a->length != b->length) -// return GRIB_COUNT_MISMATCH; -// return GRIB_SUCCESS; -// } - -static void update_size(grib_accessor* a, size_t new_size) -{ - a->length = new_size; -} - -static void resize(grib_accessor* a, size_t new_size) -{ - grib_context_log(a->context, GRIB_LOG_FATAL, "%s %s: Not supported", a->cclass->name, __func__); - - // void* zero = grib_context_malloc_clear(a->context, new_size); - // grib_buffer_replace(a, (const unsigned char*)zero, new_size, 1, 0); - // grib_context_free(a->context, zero); - // grib_context_log(a->context, GRIB_LOG_DEBUG, "resize: grib_accessor_class_message %ld %ld %s %s", - // (long)new_size, (long)a->length, a->cclass->name, a->name); - // Assert(new_size == a->length); -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - long i = 0; - size_t l = string_length(a) + 1; - grib_handle* h = grib_handle_of_accessor(a); - - if (*len < l) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - a->cclass->name, a->name, l, *len); - *len = l; - return GRIB_BUFFER_TOO_SMALL; - } - - for (i = 0; i < a->length; i++) - val[i] = h->buffer->data[a->offset + i]; - val[i] = 0; - *len = i; - return GRIB_SUCCESS; -} - -static size_t string_length(grib_accessor* a) -{ - return a->length; -} diff --git a/src/accessor/todo/grib_accessor_class_message_copy.cc b/src/accessor/todo/grib_accessor_class_message_copy.cc deleted file mode 100644 index 30806b163..000000000 --- a/src/accessor/todo/grib_accessor_class_message_copy.cc +++ /dev/null @@ -1,151 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_string;string_length - IMPLEMENTS = byte_count - IMPLEMENTS = init;dump;get_native_type - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static long byte_count(grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_message_copy -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in message_copy */ -} grib_accessor_message_copy; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_message_copy = { - &grib_accessor_class_gen, /* super */ - "message_copy", /* name */ - sizeof(grib_accessor_message_copy), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_message_copy = &_grib_accessor_class_message_copy; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long length, grib_arguments* args) -{ - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length = 0; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_string(dumper, a, NULL); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - size_t slen = grib_handle_of_accessor(a)->buffer->ulength; - size_t i; - unsigned char* v = 0; - - if (*len < slen) { - return GRIB_ARRAY_TOO_SMALL; - } - v = grib_handle_of_accessor(a)->buffer->data; - /* replace unprintable characters with space */ - for (i = 0; i < slen; i++) - if (v[i] > 126) - v[i] = 32; - memcpy(val, grib_handle_of_accessor(a)->buffer->data, slen); - val[i] = 0; - - *len = slen; - - return GRIB_SUCCESS; -} - -static size_t string_length(grib_accessor* a) -{ - return grib_handle_of_accessor(a)->buffer->ulength; -} - -static long byte_count(grib_accessor* a) -{ - return a->length; -} diff --git a/src/accessor/todo/grib_accessor_class_multdouble.cc b/src/accessor/todo/grib_accessor_class_multdouble.cc deleted file mode 100644 index ac5771627..000000000 --- a/src/accessor/todo/grib_accessor_class_multdouble.cc +++ /dev/null @@ -1,127 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double - IMPLEMENTS = init - MEMBERS = const char* val - MEMBERS = double multiplier - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_multdouble -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in multdouble */ - const char* val; - double multiplier; -} grib_accessor_multdouble; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_multdouble = { - &grib_accessor_class_double, /* super */ - "multdouble", /* name */ - sizeof(grib_accessor_multdouble), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_multdouble = &_grib_accessor_class_multdouble; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_multdouble* self = (grib_accessor_multdouble*)a; - int n = 0; - - self->val = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->multiplier = grib_arguments_get_double(grib_handle_of_accessor(a), c, n++); -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - const grib_accessor_multdouble* self = (grib_accessor_multdouble*)a; - int ret = GRIB_SUCCESS; - double value = 0; - - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->val, &value); - if (ret != GRIB_SUCCESS) - return ret; - - *val = value * self->multiplier; - - *len = 1; - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_non_alpha.cc b/src/accessor/todo/grib_accessor_class_non_alpha.cc deleted file mode 100644 index 821f2311f..000000000 --- a/src/accessor/todo/grib_accessor_class_non_alpha.cc +++ /dev/null @@ -1,215 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_string - IMPLEMENTS = unpack_long - IMPLEMENTS = unpack_double - IMPLEMENTS = init;dump;string_length - IMPLEMENTS = value_count - IMPLEMENTS = next_offset - IMPLEMENTS = get_native_type - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_double(grib_accessor*, double* 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 size_t string_length(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_non_alpha -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in non_alpha */ -} grib_accessor_non_alpha; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_non_alpha = { - &grib_accessor_class_gen, /* super */ - "non_alpha", /* name */ - sizeof(grib_accessor_non_alpha), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_non_alpha = &_grib_accessor_class_non_alpha; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; - size_t i = 0; - unsigned char* v; - - v = buffer->data + a->offset; - i = 0; - while ((*v < 33 || *v > 126) && i <= buffer->ulength) { - v++; - i++; - } - a->length = i; - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static size_t string_length(grib_accessor* a) -{ - return a->length; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_string(dumper, a, NULL); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_handle* hand = grib_handle_of_accessor(a); - long i = 0; - - if (*len < (a->length + 1)) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", - *len, a->name, a->length + 1); - *len = a->length + 1; - return GRIB_BUFFER_TOO_SMALL; - } - - for (i = 0; i < a->length; i++) { - val[i] = hand->buffer->data[a->offset + i]; - } - val[i] = 0; - *len = i; - return GRIB_SUCCESS; -} - -static int unpack_long(grib_accessor* a, long* v, size_t* len) -{ - char val[1024] = {0,}; - size_t l = sizeof(val); - size_t i = 0; - char* last = NULL; - int err = grib_unpack_string(a, val, &l); - - if (err) - return err; - - i = 0; - while (i < l - 1 && val[i] == ' ') - i++; - - if (val[i] == 0) { - *v = 0; - return 0; - } - if (val[i + 1] == ' ' && i < l - 2) - val[i + 1] = 0; - - *v = strtol(val, &last, 10); - - return GRIB_SUCCESS; -} - -static int unpack_double(grib_accessor* a, double* v, size_t* len) -{ - char val[1024]; - size_t l = sizeof(val); - char* last = NULL; - grib_unpack_string(a, val, &l); - - *v = strtod(val, &last); - - if (*last == 0) { - return GRIB_SUCCESS; - } - - return GRIB_NOT_IMPLEMENTED; -} - -static long next_offset(grib_accessor* a) -{ - return a->offset + a->length; -} diff --git a/src/accessor/todo/grib_accessor_class_number_of_coded_values.cc b/src/accessor/todo/grib_accessor_class_number_of_coded_values.cc deleted file mode 100644 index 14ef832d7..000000000 --- a/src/accessor/todo/grib_accessor_class_number_of_coded_values.cc +++ /dev/null @@ -1,162 +0,0 @@ -/* - * (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. - */ - -/***************************** - * Enrico Fucile - ****************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS = const char* numberOfValues - MEMBERS = const char* bitsPerValue - MEMBERS = const char* offsetBeforeData - MEMBERS = const char* offsetAfterData - MEMBERS = const char* unusedBits - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_number_of_coded_values -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in number_of_coded_values */ - const char* numberOfValues; - const char* bitsPerValue; - const char* offsetBeforeData; - const char* offsetAfterData; - const char* unusedBits; -} grib_accessor_number_of_coded_values; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_number_of_coded_values = { - &grib_accessor_class_long, /* super */ - "number_of_coded_values", /* name */ - sizeof(grib_accessor_number_of_coded_values), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_number_of_coded_values = &_grib_accessor_class_number_of_coded_values; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - int n = 0; - grib_accessor_number_of_coded_values* self = (grib_accessor_number_of_coded_values*)a; - self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - int ret = GRIB_SUCCESS; - long bpv = 0; - long offsetBeforeData = 0, offsetAfterData = 0, unusedBits = 0, numberOfValues; - - grib_accessor_number_of_coded_values* self = (grib_accessor_number_of_coded_values*)a; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue, &bpv)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData, &offsetBeforeData)) != GRIB_SUCCESS) - return ret; - - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData, &offsetAfterData)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &unusedBits)) != GRIB_SUCCESS) - return ret; - - if (bpv != 0) { - grib_context_log(a->context, GRIB_LOG_DEBUG, "grib_accessor_number_of_coded_values: offsetAfterData=%ld offsetBeforeData=%ld unusedBits=%ld bpv=%ld\n", - offsetAfterData, offsetBeforeData, unusedBits, bpv); - DEBUG_ASSERT(offsetAfterData > offsetBeforeData); - *val = ((offsetAfterData - offsetBeforeData) * 8 - unusedBits) / bpv; - } - else { - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, &numberOfValues)) != GRIB_SUCCESS) - return ret; - - *val = numberOfValues; - } - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_number_of_points.cc b/src/accessor/todo/grib_accessor_class_number_of_points.cc deleted file mode 100644 index b3d1eade2..000000000 --- a/src/accessor/todo/grib_accessor_class_number_of_points.cc +++ /dev/null @@ -1,174 +0,0 @@ -/* - * (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. - */ - -/**************************************** - * Enrico Fucile - *************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS = const char* ni - MEMBERS = const char* nj - MEMBERS = const char* plpresent - MEMBERS = const char* pl - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_number_of_points -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in number_of_points */ - const char* ni; - const char* nj; - const char* plpresent; - const char* pl; -} grib_accessor_number_of_points; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_number_of_points = { - &grib_accessor_class_long, /* super */ - "number_of_points", /* name */ - sizeof(grib_accessor_number_of_points), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_number_of_points = &_grib_accessor_class_number_of_points; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - int n = 0; - grib_handle* hand = grib_handle_of_accessor(a); - - grib_accessor_number_of_points* self = (grib_accessor_number_of_points*)a; - self->ni = grib_arguments_get_name(hand, c, n++); - self->nj = grib_arguments_get_name(hand, c, n++); - self->plpresent = grib_arguments_get_name(hand, c, n++); - self->pl = grib_arguments_get_name(hand, c, n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_number_of_points* self = (grib_accessor_number_of_points*)a; - - int ret = GRIB_SUCCESS; - long ni = 0, nj = 0, plpresent = 0; - size_t plsize = 0; - long* pl = NULL; - int i = 0; - grib_context* c = a->context; - grib_handle* hand = grib_handle_of_accessor(a); - - if ((ret = grib_get_long_internal(hand, self->ni, &ni)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(hand, self->nj, &nj)) != GRIB_SUCCESS) - return ret; - - if (self->plpresent && - ((ret = grib_get_long_internal(hand, self->plpresent, &plpresent)) != GRIB_SUCCESS)) - return ret; - - if (grib_is_missing(hand, self->nj, &ret) && ret == GRIB_SUCCESS) { - grib_context_log(c, GRIB_LOG_ERROR, "grib_accessor_class_number_of_points: Key %s cannot be 'missing'!", self->nj); - return GRIB_GEOCALCULUS_PROBLEM; - } - - if (nj == 0) { - grib_context_log(c, GRIB_LOG_ERROR, "grib_accessor_class_number_of_points: Key %s cannot be 0!", self->nj); - return GRIB_GEOCALCULUS_PROBLEM; - } - - if (plpresent) { - /*reduced*/ - plsize = nj; - pl = (long*)grib_context_malloc(c, sizeof(long) * plsize); - grib_get_long_array_internal(hand, self->pl, pl, &plsize); - *val = 0; - for (i = 0; i < plsize; i++) - *val += pl[i]; - grib_context_free(c, pl); - } - else { - /*regular*/ - *val = ni * nj; - } - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_number_of_values.cc b/src/accessor/todo/grib_accessor_class_number_of_values.cc deleted file mode 100644 index fb1aff779..000000000 --- a/src/accessor/todo/grib_accessor_class_number_of_values.cc +++ /dev/null @@ -1,165 +0,0 @@ -/* - * (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. - */ - -/********************************** - * Enrico Fucile - **********************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS = const char* values - MEMBERS = const char* bitsPerValue - MEMBERS = const char* numberOfPoints - MEMBERS = const char* bitmapPresent - MEMBERS = const char* bitmap - MEMBERS = const char* numberOfCodedValues - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_number_of_values -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in number_of_values */ - const char* values; - const char* bitsPerValue; - const char* numberOfPoints; - const char* bitmapPresent; - const char* bitmap; - const char* numberOfCodedValues; -} grib_accessor_number_of_values; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_number_of_values = { - &grib_accessor_class_long, /* super */ - "number_of_values", /* name */ - sizeof(grib_accessor_number_of_values), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_number_of_values = &_grib_accessor_class_number_of_values; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - int n = 0; - grib_accessor_number_of_values* self = (grib_accessor_number_of_values*)a; - grib_handle* hand = grib_handle_of_accessor(a); - - self->values = grib_arguments_get_name(hand, c, n++); - self->bitsPerValue = grib_arguments_get_name(hand, c, n++); - self->numberOfPoints = grib_arguments_get_name(hand, c, n++); - self->bitmapPresent = grib_arguments_get_name(hand, c, n++); - self->bitmap = grib_arguments_get_name(hand, c, n++); - self->numberOfCodedValues = grib_arguments_get_name(hand, c, n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_number_of_values* self = (grib_accessor_number_of_values*)a; - int ret = GRIB_SUCCESS, i; - long npoints = 0, bitmap_present = 0; - size_t size = 0; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &npoints)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitmapPresent, &bitmap_present)) != GRIB_SUCCESS) - return ret; - - if (bitmap_present) { - double* bitmap; - size = npoints; - bitmap = (double*)grib_context_malloc(a->context, sizeof(double) * size); - if ((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->bitmap, bitmap, &size)) != GRIB_SUCCESS) { - grib_context_free(a->context, bitmap); - return ret; - } - *val = 0; - for (i = 0; i < size; i++) - if (bitmap[i] != 0) - (*val)++; - - grib_context_free(a->context, bitmap); - } - else { - *val = npoints; - } - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_number_of_values_data_raw_packing.cc b/src/accessor/todo/grib_accessor_class_number_of_values_data_raw_packing.cc deleted file mode 100644 index 5652797ac..000000000 --- a/src/accessor/todo/grib_accessor_class_number_of_values_data_raw_packing.cc +++ /dev/null @@ -1,165 +0,0 @@ -/* - * (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. - */ -/***************************** - * Enrico Fucile - ****************************/ - -#include "grib_api_internal.h" -#define PRECISION_32_IEEE 1 -#define PRECISION_64_IEEE 2 -#define PRECISION_128_IEEE 3 - -#define COMPRESSION_NONE 0 -#define COMPRESSION_LZW 1 - -#define PRE_PROCESSING_NONE 0 -#define PRE_PROCESSING_DIFFERENCE 1 -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init - IMPLEMENTS = unpack_long - IMPLEMENTS = get_native_type - MEMBERS=const char* values - MEMBERS=const char* precision - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_number_of_values_data_raw_packing -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in number_of_values_data_raw_packing */ - const char* values; - const char* precision; -} grib_accessor_number_of_values_data_raw_packing; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_number_of_values_data_raw_packing = { - &grib_accessor_class_gen, /* super */ - "number_of_values_data_raw_packing", /* name */ - sizeof(grib_accessor_number_of_values_data_raw_packing), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_number_of_values_data_raw_packing = &_grib_accessor_class_number_of_values_data_raw_packing; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long v, grib_arguments* args) -{ - int n = 0; - grib_accessor_number_of_values_data_raw_packing* self = (grib_accessor_number_of_values_data_raw_packing*)a; - - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - int err = 0; - grib_accessor_number_of_values_data_raw_packing* self = (grib_accessor_number_of_values_data_raw_packing*)a; - grib_accessor* adata = NULL; - long precision = 0; - int bytes = 0; - long byte_count = 0; - - adata = grib_find_accessor(grib_handle_of_accessor(a), self->values); - Assert(adata != NULL); - byte_count = grib_byte_count(adata); - - if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) - return err; - - switch (precision) { - case 1: - bytes = 4; - break; - - case 2: - bytes = 8; - break; - - default: - return GRIB_NOT_IMPLEMENTED; - } - - *val = byte_count / bytes; - - return err; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_octahedral_gaussian.cc b/src/accessor/todo/grib_accessor_class_octahedral_gaussian.cc deleted file mode 100644 index 8035c9ab0..000000000 --- a/src/accessor/todo/grib_accessor_class_octahedral_gaussian.cc +++ /dev/null @@ -1,216 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - IMPLEMENTS = pack_long - MEMBERS=const char* N - MEMBERS=const char* Ni - MEMBERS=const char* plpresent - MEMBERS=const char* pl - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_octahedral_gaussian -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in octahedral_gaussian */ - const char* N; - const char* Ni; - const char* plpresent; - const char* pl; -} grib_accessor_octahedral_gaussian; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_octahedral_gaussian = { - &grib_accessor_class_long, /* super */ - "octahedral_gaussian", /* name */ - sizeof(grib_accessor_octahedral_gaussian), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_octahedral_gaussian = &_grib_accessor_class_octahedral_gaussian; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_octahedral_gaussian* self = (grib_accessor_octahedral_gaussian*)a; - int n = 0; - grib_handle* hand = grib_handle_of_accessor(a); - - self->N = grib_arguments_get_name(hand, c, n++); - self->Ni = grib_arguments_get_name(hand, c, n++); - self->plpresent = grib_arguments_get_name(hand, c, n++); - self->pl = grib_arguments_get_name(hand, c, n++); -} - -/* Returns 1 (=true) if input pl array is Octahedral, 0 otherwise. - * Possible cases for the deltas in an octahedral pl array: - * +4 .. +4 Top part, above equator - * +4 .. 0 Top part, above and including equator - * +4.. 0 -4.. Middle part, above, equator and below - * 0 -4.. Equator and below - * -4 ..-4 All below equator - * Anything else is considered not octahedral - */ -static int is_pl_octahedral(const long pl[], size_t size) -{ - long i; - long prev_diff = -1; - for (i = 1; i < size; ++i) { - const long diff = pl[i] - pl[i - 1]; - if (diff == 0) { - /* prev must be +4 or undef */ - if (!(prev_diff == +4 || i == 1)) { - return 0; - } - } - else { - if (labs(diff) != 4) { - return 0; - } - if (diff == +4) { - /* prev must be +4 or undef */ - if (!(prev_diff == +4 || i == 1)) { - return 0; - } - } - if (diff == -4) { - /* prev must be 0, -4 or undef */ - if (!(prev_diff == -4 || prev_diff == 0 || i == 1)) { - return 0; - } - } - } - prev_diff = diff; - } - return 1; /* it's octahedral */ -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_octahedral_gaussian* self = (grib_accessor_octahedral_gaussian*)a; - int ret = GRIB_SUCCESS; - long Ni; - long plpresent = 0; - long* pl = NULL; /* pl array */ - size_t plsize = 0; - grib_handle* hand = grib_handle_of_accessor(a); - - grib_context* c = a->context; - - if ((ret = grib_get_long_internal(hand, self->Ni, &Ni)) != GRIB_SUCCESS) - return ret; - - /* If Ni is not missing, then this is a plain gaussian grid and not reduced. */ - /* So it cannot be an octahedral grid */ - if (Ni != GRIB_MISSING_LONG) { - *val = 0; - return GRIB_SUCCESS; - } - - if ((ret = grib_get_long_internal(hand, self->plpresent, &plpresent)) != GRIB_SUCCESS) - return ret; - if (!plpresent) { - *val = 0; /* Not octahedral */ - return GRIB_SUCCESS; - } - - if ((ret = grib_get_size(hand, self->pl, &plsize)) != GRIB_SUCCESS) - return ret; - Assert(plsize); /* pl array must have at least one element */ - - pl = (long*)grib_context_malloc_clear(c, sizeof(long) * plsize); - if (!pl) { - return GRIB_OUT_OF_MEMORY; - } - if ((ret = grib_get_long_array_internal(hand, self->pl, pl, &plsize)) != GRIB_SUCCESS) - return ret; - - /* pl[0] is guaranteed to exist. Have already asserted previously */ - *val = is_pl_octahedral(pl, plsize); - grib_context_free(c, pl); - - return ret; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} diff --git a/src/accessor/todo/grib_accessor_class_octet_number.cc b/src/accessor/todo/grib_accessor_class_octet_number.cc deleted file mode 100644 index cce0e742b..000000000 --- a/src/accessor/todo/grib_accessor_class_octet_number.cc +++ /dev/null @@ -1,136 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init - MEMBERS=const char* left - MEMBERS=long right - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_octet_number -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in octet_number */ - const char* left; - long right; -} grib_accessor_octet_number; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_octet_number = { - &grib_accessor_class_long, /* super */ - "octet_number", /* name */ - sizeof(grib_accessor_octet_number), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_octet_number = &_grib_accessor_class_octet_number; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_octet_number* self = (grib_accessor_octet_number*)a; - - int n = 0; - self->left = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->right = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); - - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_octet_number* self = (grib_accessor_octet_number*)a; - int ret = GRIB_SUCCESS; - long offset; - - offset = a->offset + self->right; - - if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->left, offset)) != GRIB_SUCCESS) - return ret; - - *val = offset; - *len = 1; - - return ret; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_offset_file.cc b/src/accessor/todo/grib_accessor_class_offset_file.cc deleted file mode 100644 index 8fd0a0018..000000000 --- a/src/accessor/todo/grib_accessor_class_offset_file.cc +++ /dev/null @@ -1,141 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double - IMPLEMENTS = unpack_string - IMPLEMENTS = init - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_offset_file -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in offset_file */ -} grib_accessor_offset_file; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_offset_file = { - &grib_accessor_class_double, /* super */ - "offset_file", /* name */ - sizeof(grib_accessor_offset_file), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_offset_file = &_grib_accessor_class_offset_file; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length = 0; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - *val = (double)grib_handle_of_accessor(a)->offset; - *len = 1; - return GRIB_SUCCESS; -} - -static int unpack_string(grib_accessor* a, char* v, size_t* len) -{ - double val = 0; - size_t l = 1; - char repres[1024] = {0,}; - int err = 0; - const char* cclass_name = a->cclass->name; - - err = grib_unpack_double(a, &val, &l); - if (err) return err; - - snprintf(repres, sizeof(repres), "%.0f", val); - - l = strlen(repres) + 1; - if (l > *len) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, l, *len); - *len = l; - return GRIB_BUFFER_TOO_SMALL; - } - grib_context_log(a->context, GRIB_LOG_DEBUG, "%s: Casting double %s to string", __func__, a->name); - - *len = l; - - strcpy(v, repres); - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_offset_values.cc b/src/accessor/todo/grib_accessor_class_offset_values.cc deleted file mode 100644 index 012698f79..000000000 --- a/src/accessor/todo/grib_accessor_class_offset_values.cc +++ /dev/null @@ -1,175 +0,0 @@ -/* - * (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. - */ - -/********************************** - * Enrico Fucile - *********************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double; pack_double - IMPLEMENTS = init - MEMBERS = const char* values - MEMBERS = const char* missingValue - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_offset_values -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in offset_values */ - const char* values; - const char* missingValue; -} grib_accessor_offset_values; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_offset_values = { - &grib_accessor_class_double, /* super */ - "offset_values", /* name */ - sizeof(grib_accessor_offset_values), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_offset_values = &_grib_accessor_class_offset_values; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* args) -{ - int n = 0; - grib_accessor_offset_values* self = (grib_accessor_offset_values*)a; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->missingValue = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - int ret = 0; - *val = 0; - *len = 1; - return ret; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - double* values = NULL; - size_t size = 0; - double missingValue = 0; - long missingValuesPresent = 0; - int ret = 0, i = 0; - grib_accessor_offset_values* self = (grib_accessor_offset_values*)a; - grib_context* c = a->context; - grib_handle* h = grib_handle_of_accessor(a); - - if (*val == 0) - return GRIB_SUCCESS; - - if ((ret = grib_get_double_internal(h, self->missingValue, &missingValue)) != GRIB_SUCCESS) { - return ret; - } - if ((ret = grib_get_long_internal(h, "missingValuesPresent", &missingValuesPresent)) != GRIB_SUCCESS) { - return ret; - } - - if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) - return ret; - - values = (double*)grib_context_malloc(c, size * sizeof(double)); - if (!values) - return GRIB_OUT_OF_MEMORY; - - if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return ret; - } - - for (i = 0; i < size; i++) { - if (missingValuesPresent) { - if (values[i] != missingValue) - values[i] += *val; - } - else { - values[i] += *val; - } - } - - if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) - return ret; - - grib_context_free(c, values); - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_pack_bufr_values.cc b/src/accessor/todo/grib_accessor_class_pack_bufr_values.cc deleted file mode 100644 index a076e12ac..000000000 --- a/src/accessor/todo/grib_accessor_class_pack_bufr_values.cc +++ /dev/null @@ -1,177 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;dump - IMPLEMENTS = unpack_string;unpack_string_array;unpack_long; unpack_double - IMPLEMENTS = pack_long; pack_double - IMPLEMENTS = value_count; destroy; get_native_type; - MEMBERS = grib_accessor* data_accessor - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_double(grib_accessor*, double* 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 int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_pack_bufr_values -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in pack_bufr_values */ - grib_accessor* data_accessor; -} grib_accessor_pack_bufr_values; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_pack_bufr_values = { - &grib_accessor_class_gen, /* super */ - "pack_bufr_values", /* name */ - sizeof(grib_accessor_pack_bufr_values), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - &unpack_string_array, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_pack_bufr_values = &_grib_accessor_class_pack_bufr_values; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* params) -{ - char* key; - grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; - key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), params, 0); - self->data_accessor = grib_find_accessor(grib_handle_of_accessor(a), key); - - a->length = 0; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ -} - -static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static int unpack_string(grib_accessor* a, char* buffer, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static void destroy(grib_context* context, grib_accessor* a) -{ -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; - - return grib_pack_double(data, 0, 0); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; - - return grib_pack_double(data, 0, 0); -} diff --git a/src/accessor/todo/grib_accessor_class_packing_type.cc b/src/accessor/todo/grib_accessor_class_packing_type.cc deleted file mode 100644 index a9a4a2deb..000000000 --- a/src/accessor/todo/grib_accessor_class_packing_type.cc +++ /dev/null @@ -1,167 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_string;pack_string - IMPLEMENTS = string_length - IMPLEMENTS = get_native_type - IMPLEMENTS = init - MEMBERS = const char* values - MEMBERS = const char* packing_type - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_string(grib_accessor*, const char*, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_packing_type -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in packing_type */ - const char* values; - const char* packing_type; -} grib_accessor_packing_type; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_packing_type = { - &grib_accessor_class_gen, /* super */ - "packing_type", /* name */ - sizeof(grib_accessor_packing_type), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_packing_type = &_grib_accessor_class_packing_type; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* args) -{ - int n = 0; - grib_accessor_packing_type* self = (grib_accessor_packing_type*)a; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->packing_type = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static size_t string_length(grib_accessor* a) -{ - return 1024; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} - -static int pack_string(grib_accessor*a, const char* sval, size_t* len) -{ - grib_accessor_packing_type* self = (grib_accessor_packing_type*)a; - grib_handle* h = grib_handle_of_accessor(a); - double* values = NULL; - grib_context* c = a->context; - size_t size = 0; - int err = 0; - - if ((err = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) - return err; - - values = (double*)grib_context_malloc(c, size * sizeof(double)); - if (!values) return GRIB_OUT_OF_MEMORY; - - if ((err = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return err; - } - - if ((err = grib_set_string_internal(h, self->packing_type, sval, len)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return err; - } - - if ((err = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return err; - } - - grib_context_free(c, values); - return GRIB_SUCCESS; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_packing_type* self = (grib_accessor_packing_type*)a; - grib_handle* h = grib_handle_of_accessor(a); - - return grib_get_string(h, self->packing_type, val, len); -} diff --git a/src/accessor/todo/grib_accessor_class_pad.cc b/src/accessor/todo/grib_accessor_class_pad.cc deleted file mode 100644 index 473a507e1..000000000 --- a/src/accessor/todo/grib_accessor_class_pad.cc +++ /dev/null @@ -1,126 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_padding - IMPLEMENTS = init;preferred_size - MEMBERS =grib_expression* expression - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static void init(grib_accessor*, const long, grib_arguments*); -static size_t preferred_size(grib_accessor*, int); - -typedef struct grib_accessor_pad -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ - /* Members defined in padding */ - /* Members defined in pad */ - grib_expression* expression; -} grib_accessor_pad; - -extern grib_accessor_class* grib_accessor_class_padding; - -static grib_accessor_class _grib_accessor_class_pad = { - &grib_accessor_class_padding, /* super */ - "pad", /* name */ - sizeof(grib_accessor_pad), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_pad = &_grib_accessor_class_pad; - -/* END_CLASS_IMP */ - - -static size_t preferred_size(grib_accessor* a, int from_handle) -{ - grib_accessor_pad* self = (grib_accessor_pad*)a; - - long length = 0; - - grib_expression_evaluate_long(grib_handle_of_accessor(a), self->expression, &length); - - return length > 0 ? length : 0; -} - - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_pad* self = (grib_accessor_pad*)a; - - self->expression = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); - a->length = preferred_size(a, 1); -} diff --git a/src/accessor/todo/grib_accessor_class_padding.cc b/src/accessor/todo/grib_accessor_class_padding.cc deleted file mode 100644 index 790ea9db2..000000000 --- a/src/accessor/todo/grib_accessor_class_padding.cc +++ /dev/null @@ -1,151 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_bytes - IMPLEMENTS = init;update_size;resize; value_count - IMPLEMENTS = compare;string_length;byte_count - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static size_t string_length(grib_accessor*); -static long byte_count(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); -static void resize(grib_accessor*,size_t); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_padding -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ - /* Members defined in padding */ -} grib_accessor_padding; - -extern grib_accessor_class* grib_accessor_class_bytes; - -static grib_accessor_class _grib_accessor_class_padding = { - &grib_accessor_class_bytes, /* super */ - "padding", /* name */ - sizeof(grib_accessor_padding), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - &resize, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_padding = &_grib_accessor_class_padding; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int compare(grib_accessor* a, grib_accessor* b) -{ - if (a->length != b->length) - return GRIB_COUNT_MISMATCH; - return GRIB_SUCCESS; -} - -static void update_size(grib_accessor* a, size_t new_size) -{ - a->length = new_size; -} - -static void resize(grib_accessor* a, size_t new_size) -{ - void* zero = grib_context_malloc_clear(a->context, new_size); - - grib_buffer_replace(a, (const unsigned char*)zero, new_size, - /*update_lengths=*/1, /*update_paddings=*/0); - grib_context_free(a->context, zero); - - grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_class_padding::resize new_size=%zu a->length=%ld %s %s", - new_size, a->length, a->cclass->name, a->name); - Assert(new_size == a->length); -} - -static int value_count(grib_accessor* a, long* c) -{ - *c = a->length; - return 0; -} - -static long byte_count(grib_accessor* a) -{ - return a->length; -} - -static size_t string_length(grib_accessor* a) -{ - return (size_t)a->length; -} diff --git a/src/accessor/todo/grib_accessor_class_padto.cc b/src/accessor/todo/grib_accessor_class_padto.cc deleted file mode 100644 index f6f9417b4..000000000 --- a/src/accessor/todo/grib_accessor_class_padto.cc +++ /dev/null @@ -1,136 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_padding - IMPLEMENTS = init;preferred_size;dump - MEMBERS=grib_expression* expression - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static size_t preferred_size(grib_accessor*, int); - -typedef struct grib_accessor_padto -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ - /* Members defined in padding */ - /* Members defined in padto */ - grib_expression* expression; -} grib_accessor_padto; - -extern grib_accessor_class* grib_accessor_class_padding; - -static grib_accessor_class _grib_accessor_class_padto = { - &grib_accessor_class_padding, /* super */ - "padto", /* name */ - sizeof(grib_accessor_padto), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_padto = &_grib_accessor_class_padto; - -/* END_CLASS_IMP */ - - -static size_t preferred_size(grib_accessor* a, int from_handle) -{ - grib_accessor_padto* self = (grib_accessor_padto*)a; - - long length = 0; - long theEnd; - - grib_expression_evaluate_long(grib_handle_of_accessor(a), self->expression, &theEnd); - - length = theEnd - a->offset; - - /* printf("preferred_size: prefered: %ld current:%ld %s %s %ld\n", (long)length,(long)a->length,a->cclass->name,a->name,(long)a->offset); */ - - return length > 0 ? length : 0; -} - - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_padto* self = (grib_accessor_padto*)a; - - self->expression = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); - a->length = preferred_size(a, 1); -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - /*grib_dump_string(dumper,a,NULL);*/ -} diff --git a/src/accessor/todo/grib_accessor_class_padtoeven.cc b/src/accessor/todo/grib_accessor_class_padtoeven.cc deleted file mode 100644 index c75e0e254..000000000 --- a/src/accessor/todo/grib_accessor_class_padtoeven.cc +++ /dev/null @@ -1,139 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_padding - IMPLEMENTS = init;preferred_size - MEMBERS=const char* section_offset - MEMBERS=const char* section_length - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static void init(grib_accessor*, const long, grib_arguments*); -static size_t preferred_size(grib_accessor*, int); - -typedef struct grib_accessor_padtoeven -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ - /* Members defined in padding */ - /* Members defined in padtoeven */ - const char* section_offset; - const char* section_length; -} grib_accessor_padtoeven; - -extern grib_accessor_class* grib_accessor_class_padding; - -static grib_accessor_class _grib_accessor_class_padtoeven = { - &grib_accessor_class_padding, /* super */ - "padtoeven", /* name */ - sizeof(grib_accessor_padtoeven), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_padtoeven = &_grib_accessor_class_padtoeven; - -/* END_CLASS_IMP */ - -static size_t preferred_size(grib_accessor* a, int from_handle) -{ - grib_accessor_padtoeven* self = (grib_accessor_padtoeven*)a; - long offset = 0; - long length = 0; - long seclen; - - grib_get_long_internal(grib_handle_of_accessor(a), self->section_offset, &offset); - grib_get_long_internal(grib_handle_of_accessor(a), self->section_length, &length); - - if ((length % 2) && from_handle) { - // grib_context_log(a->context, - // GRIB_LOG_ERROR,"GRIB message has an odd length section (%ld, %s)", - // (long)length,a->name); - return 0; - } - - /* printf("EVEN %ld %ld\n",(long) a->offset,(long) offset);*/ - seclen = a->offset - offset; - - return (seclen % 2) ? 1 : 0; -} - -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_padtoeven* self = (grib_accessor_padtoeven*)a; - - self->section_offset = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); - self->section_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 1); - - a->length = preferred_size(a, 1); -} diff --git a/src/accessor/todo/grib_accessor_class_padtomultiple.cc b/src/accessor/todo/grib_accessor_class_padtomultiple.cc deleted file mode 100644 index 3104cdf2f..000000000 --- a/src/accessor/todo/grib_accessor_class_padtomultiple.cc +++ /dev/null @@ -1,132 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_padding - IMPLEMENTS = init;preferred_size - MEMBERS=grib_expression* begin - MEMBERS=grib_expression* multiple - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static void init(grib_accessor*, const long, grib_arguments*); -static size_t preferred_size(grib_accessor*, int); - -typedef struct grib_accessor_padtomultiple -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ - /* Members defined in padding */ - /* Members defined in padtomultiple */ - grib_expression* begin; - grib_expression* multiple; -} grib_accessor_padtomultiple; - -extern grib_accessor_class* grib_accessor_class_padding; - -static grib_accessor_class _grib_accessor_class_padtomultiple = { - &grib_accessor_class_padding, /* super */ - "padtomultiple", /* name */ - sizeof(grib_accessor_padtomultiple), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_padtomultiple = &_grib_accessor_class_padtomultiple; - -/* END_CLASS_IMP */ - -static size_t preferred_size(grib_accessor* a, int from_handle) -{ - grib_accessor_padtomultiple* self = (grib_accessor_padtomultiple*)a; - long padding = 0; - long begin = 0; - long multiple = 0; - - grib_expression_evaluate_long(grib_handle_of_accessor(a), self->begin, &begin); - grib_expression_evaluate_long(grib_handle_of_accessor(a), self->multiple, &multiple); - - padding = a->offset - begin; - padding = ((padding + multiple - 1) / multiple) * multiple - padding; - - return padding == 0 ? multiple : padding; -} - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_padtomultiple* self = (grib_accessor_padtomultiple*)a; - - self->begin = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); - self->multiple = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 1); - a->length = preferred_size(a, 1); -} diff --git a/src/accessor/todo/grib_accessor_class_position.cc b/src/accessor/todo/grib_accessor_class_position.cc deleted file mode 100644 index 0f9565c37..000000000 --- a/src/accessor/todo/grib_accessor_class_position.cc +++ /dev/null @@ -1,137 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long - IMPLEMENTS = get_native_type - IMPLEMENTS = init;dump - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_position -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in position */ -} grib_accessor_position; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_position = { - &grib_accessor_class_gen, /* super */ - "position", /* name */ - sizeof(grib_accessor_position), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_position = &_grib_accessor_class_position; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - *val = a->offset; - *len = 1; - return GRIB_SUCCESS; -} - -// static int compare(grib_accessor* a, grib_accessor* b) -// { -// if (a->offset != b->offset) -// return GRIB_OFFSET_MISMATCH; -// return GRIB_SUCCESS; -// } diff --git a/src/accessor/todo/grib_accessor_class_raw.cc b/src/accessor/todo/grib_accessor_class_raw.cc deleted file mode 100644 index cdac6a100..000000000 --- a/src/accessor/todo/grib_accessor_class_raw.cc +++ /dev/null @@ -1,219 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = get_native_type;init;update_size; pack_bytes - IMPLEMENTS = compare;unpack_bytes;byte_count;value_count - MEMBERS = const char* totalLength - MEMBERS = const char* sectionLength - MEMBERS = long relativeOffset - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_bytes(grib_accessor*, const unsigned char*, size_t* len); -static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); -static long byte_count(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_raw -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in raw */ - const char* totalLength; - const char* sectionLength; - long relativeOffset; -} grib_accessor_raw; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_raw = { - &grib_accessor_class_gen, /* super */ - "raw", /* name */ - sizeof(grib_accessor_raw), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - &pack_bytes, /* pack_bytes */ - &unpack_bytes, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_raw = &_grib_accessor_class_raw; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - int n = 0; - int err = 0; - long sectionLength; - grib_accessor_raw* self = (grib_accessor_raw*)a; - grib_expression* e; - grib_handle* hand = grib_handle_of_accessor(a); - - a->length = 0; - self->totalLength = grib_arguments_get_name(hand, arg, n++); - self->sectionLength = grib_arguments_get_name(hand, arg, n++); - - e = grib_arguments_get_expression(hand, arg, n++); - err = grib_expression_evaluate_long(hand, e, &(self->relativeOffset)); - if (err) - grib_context_log(hand->context, GRIB_LOG_ERROR, "Unable to evaluate relativeOffset"); - - grib_get_long(hand, self->sectionLength, §ionLength); - - a->length = sectionLength - self->relativeOffset; - if (a->length < 0) - a->length = 0; - - /* Assert(a->length>=0); */ -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_BYTES; -} - - -static int compare(grib_accessor* a, grib_accessor* b) -{ - int retval = GRIB_SUCCESS; - - size_t alen = (size_t)grib_byte_count(a); - size_t blen = (size_t)grib_byte_count(b); - - if (alen != blen) - return GRIB_COUNT_MISMATCH; - - return retval; -} - -static long byte_count(grib_accessor* a) -{ - return a->length; -} - -static int value_count(grib_accessor* a, long* len) -{ - *len = a->length; - return 0; -} - -static int unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len) -{ - if (*len < a->length) { - *len = a->length; - return GRIB_ARRAY_TOO_SMALL; - } - *len = a->length; - - memcpy(buffer, grib_handle_of_accessor(a)->buffer->data + a->offset, *len); - - return GRIB_SUCCESS; -} - -static void update_size(grib_accessor* a, size_t s) -{ - grib_context_log(a->context, GRIB_LOG_DEBUG, "updating size of %s old %ld new %ld", a->name, a->length, s); - a->length = s; - Assert(a->length >= 0); -} - -void accessor_raw_set_length(grib_accessor* a, size_t len) -{ - a->length = len; -} - -long accessor_raw_get_offset(grib_accessor* a) -{ - return a->offset; -} - -static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len) -{ - size_t length = *len; - long totalLength; - long sectionLength; - grib_handle* h = grib_handle_of_accessor(a); - grib_accessor_raw* self = (grib_accessor_raw*)a; - long dlen = length - a->length; - - grib_get_long(h, self->totalLength, &totalLength); - totalLength += dlen; - grib_get_long(h, self->sectionLength, §ionLength); - sectionLength += dlen; - - grib_buffer_replace(a, val, length, 1, 1); - - grib_set_long(h, self->totalLength, totalLength); - grib_set_long(h, self->sectionLength, sectionLength); - a->length = length; - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_rdbtime_guess_date.cc b/src/accessor/todo/grib_accessor_class_rdbtime_guess_date.cc deleted file mode 100644 index 8a3bfa2a1..000000000 --- a/src/accessor/todo/grib_accessor_class_rdbtime_guess_date.cc +++ /dev/null @@ -1,172 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init - MEMBERS=const char* typicalYear - MEMBERS=const char* typicalMonth - MEMBERS=const char* typicalDay - MEMBERS=const char* rdbDay - MEMBERS=long yearOrMonth - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_rdbtime_guess_date -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in rdbtime_guess_date */ - const char* typicalYear; - const char* typicalMonth; - const char* typicalDay; - const char* rdbDay; - long yearOrMonth; -} grib_accessor_rdbtime_guess_date; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_rdbtime_guess_date = { - &grib_accessor_class_long, /* super */ - "rdbtime_guess_date", /* name */ - sizeof(grib_accessor_rdbtime_guess_date), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_rdbtime_guess_date = &_grib_accessor_class_rdbtime_guess_date; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_rdbtime_guess_date* self = (grib_accessor_rdbtime_guess_date*)a; - int n = 0; - - self->typicalYear = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->typicalMonth = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->typicalDay = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->rdbDay = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->yearOrMonth = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); - - /* a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; */ -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_rdbtime_guess_date* self = (grib_accessor_rdbtime_guess_date*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; - long typicalYear, typicalMonth, typicalDay, rdbDay; - long rdbYear, rdbMonth; - - ret = grib_get_long(h, self->typicalYear, &typicalYear); - if (ret) - return ret; - ret = grib_get_long(h, self->typicalMonth, &typicalMonth); - if (ret) - return ret; - ret = grib_get_long(h, self->typicalDay, &typicalDay); - if (ret) - return ret; - ret = grib_get_long(h, self->rdbDay, &rdbDay); - if (ret) - return ret; - - if (rdbDay < typicalDay) { - if (typicalDay == 31 && typicalMonth == 12) { - rdbYear = typicalYear + 1; - rdbMonth = 1; - } - else { - rdbYear = typicalYear; - rdbMonth = typicalMonth + 1; - } - } - else { - rdbYear = typicalYear; - rdbMonth = typicalMonth; - } - - *val = self->yearOrMonth == 1 ? rdbYear : rdbMonth; - *len = 1; - - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* v, size_t* len) -{ - /* do nothing*/ - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_reference_value_error.cc b/src/accessor/todo/grib_accessor_class_reference_value_error.cc deleted file mode 100644 index 3cc4af20d..000000000 --- a/src/accessor/todo/grib_accessor_class_reference_value_error.cc +++ /dev/null @@ -1,142 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double - IMPLEMENTS = init - MEMBERS=const char* referenceValue - MEMBERS=const char* floatType - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_reference_value_error -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in reference_value_error */ - const char* referenceValue; - const char* floatType; -} grib_accessor_reference_value_error; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_reference_value_error = { - &grib_accessor_class_double, /* super */ - "reference_value_error", /* name */ - sizeof(grib_accessor_reference_value_error), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_reference_value_error = &_grib_accessor_class_reference_value_error; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_reference_value_error* self = (grib_accessor_reference_value_error*)a; - int n = 0; - - self->referenceValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->floatType = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length = 0; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_reference_value_error* self = (grib_accessor_reference_value_error*)a; - int ret = 0; - double referenceValue = 0; - - if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), - self->referenceValue, &referenceValue)) != GRIB_SUCCESS) - return ret; - - if (!strcmp(self->floatType, "ibm")) - *val = grib_ibmfloat_error(referenceValue); - else if (!strcmp(self->floatType, "ieee")) - *val = grib_ieeefloat_error(referenceValue); - else - Assert(1 == 0); - - if (ret == GRIB_SUCCESS) - *len = 1; - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_round.cc b/src/accessor/todo/grib_accessor_class_round.cc deleted file mode 100644 index 98fe2fda5..000000000 --- a/src/accessor/todo/grib_accessor_class_round.cc +++ /dev/null @@ -1,154 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_evaluate - IMPLEMENTS = unpack_double - IMPLEMENTS = unpack_string - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); - -typedef struct grib_accessor_round -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in evaluate */ - grib_arguments* arg; - /* Members defined in round */ -} grib_accessor_round; - -extern grib_accessor_class* grib_accessor_class_evaluate; - -static grib_accessor_class _grib_accessor_class_round = { - &grib_accessor_class_evaluate, /* super */ - "round", /* name */ - sizeof(grib_accessor_round), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_round = &_grib_accessor_class_round; - -/* END_CLASS_IMP */ - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_round* self = (grib_accessor_round*)a; - - int ret = GRIB_SUCCESS; - - size_t replen = 0; - double rounding_precision = 0; - double rounded = 0; - double toround = 0; - - const char* oval = NULL; - oval = grib_arguments_get_name(grib_handle_of_accessor(a), self->arg, 0); - - if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), oval, &toround)) != 0) - return ret; - - rounding_precision = grib_arguments_get_long(grib_handle_of_accessor(a), self->arg, 1); - - rounded = floor(rounding_precision * toround + 0.5) / rounding_precision; - - *len = replen; - - *val = rounded; - - return ret; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - char result[1024]; - int ret = GRIB_SUCCESS; - size_t replen = 1; - - double value = 0; - - ret = unpack_double(a, &value, &replen); - - snprintf(result, sizeof(result), "%.3f", value); - - replen = strlen(result) + 1; - - if (*len < replen) { - *len = replen; - return GRIB_ARRAY_TOO_SMALL; - } - - *len = replen; - - snprintf(val, 1024, "%s", result); - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_scale.cc b/src/accessor/todo/grib_accessor_class_scale.cc deleted file mode 100644 index 6fec75e94..000000000 --- a/src/accessor/todo/grib_accessor_class_scale.cc +++ /dev/null @@ -1,237 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double;pack_double;is_missing - IMPLEMENTS = pack_long - IMPLEMENTS = init - MEMBERS=const char* value - MEMBERS=const char* multiplier - MEMBERS=const char* divisor - MEMBERS=const char* truncating - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int is_missing(grib_accessor*); -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_scale -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in scale */ - const char* value; - const char* multiplier; - const char* divisor; - const char* truncating; -} grib_accessor_scale; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_scale = { - &grib_accessor_class_double, /* super */ - "scale", /* name */ - sizeof(grib_accessor_scale), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - &is_missing, /* is_missing */ - &pack_long, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_scale = &_grib_accessor_class_scale; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_scale* self = (grib_accessor_scale*)a; - int n = 0; - - self->value = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->multiplier = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->divisor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->truncating = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_scale* self = (grib_accessor_scale*)a; - int ret = 0; - long value = 0; - long multiplier = 0; - long divisor = 0; - - if (*len < 1) { - ret = GRIB_ARRAY_TOO_SMALL; - grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s cannot gather value for %s and/or %s", - a->name, self->multiplier, self->divisor); - return ret; - } - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier, &multiplier)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->value, &value)) != GRIB_SUCCESS) - return ret; - - if (value == GRIB_MISSING_LONG) - *val = GRIB_MISSING_DOUBLE; - else - *val = ((double)(value * multiplier)) / divisor; - - if (ret == GRIB_SUCCESS) - *len = 1; - - return ret; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - const double dval = (double)*val; - return pack_double(a, &dval, len); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_scale* self = (grib_accessor_scale*)a; - int ret = 0; - - long value = 0; - long divisor = 0; - long multiplier = 0; - long truncating = 0; - double x; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor); - if (ret != GRIB_SUCCESS) return ret; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier, &multiplier); - if (ret != GRIB_SUCCESS) return ret; - - if (self->truncating) { - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->truncating, &truncating); - if (ret != GRIB_SUCCESS) return ret; - } - - if (multiplier == 0) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s: cannot divide by a zero multiplier %s", - a->name, self->multiplier); - return GRIB_ENCODING_ERROR; - } - - x = *val * (double)divisor / (double)multiplier; - if (*val == GRIB_MISSING_DOUBLE) - value = GRIB_MISSING_LONG; - else if (truncating) { - value = (long)x; - } - else { - value = x > 0 ? (long)(x + 0.5) : (long)(x - 0.5); - } - - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value, value); - if (ret) - grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s: cannot pack value for %s (%s)\n", - a->name, self->value, grib_get_error_message(ret)); - - if (ret == GRIB_SUCCESS) - *len = 1; - - return ret; -} - -static int is_missing(grib_accessor* a) -{ - grib_accessor_scale* self = (grib_accessor_scale*)a; - grib_accessor* av = grib_find_accessor(grib_handle_of_accessor(a), self->value); - - if (!av) - return GRIB_NOT_FOUND; - return grib_is_missing_internal(av); - // int ret=0; - // long value=0; - // if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->value, &value))!= GRIB_SUCCESS){ - // grib_context_log(a->context, GRIB_LOG_ERROR, - // "Accessor %s cannot gather value for %s error %d \n", a->name, - // self->value, ret); - // return 0; - // } - // return (value == GRIB_MISSING_LONG); -} diff --git a/src/accessor/todo/grib_accessor_class_scale_values.cc b/src/accessor/todo/grib_accessor_class_scale_values.cc deleted file mode 100644 index 8c4b33fcb..000000000 --- a/src/accessor/todo/grib_accessor_class_scale_values.cc +++ /dev/null @@ -1,177 +0,0 @@ -/* - * (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. - */ - -/********************************** - * Enrico Fucile - *********************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double; pack_double - IMPLEMENTS = init - MEMBERS = const char* values - MEMBERS = const char* missingValue - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_scale_values -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in scale_values */ - const char* values; - const char* missingValue; -} grib_accessor_scale_values; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_scale_values = { - &grib_accessor_class_double, /* super */ - "scale_values", /* name */ - sizeof(grib_accessor_scale_values), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_scale_values = &_grib_accessor_class_scale_values; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* args) -{ - int n = 0; - grib_accessor_scale_values* self = (grib_accessor_scale_values*)a; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->missingValue = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - int ret = 0; - *val = 1; - *len = 1; - return ret; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - double* values = NULL; - double missingValue = 0; - long missingValuesPresent = 0; - size_t size = 0; - int ret = 0, i = 0; - grib_accessor_scale_values* self = (grib_accessor_scale_values*)a; - const grib_context* c = a->context; - grib_handle* h = grib_handle_of_accessor(a); - - if (*val == 1) - return GRIB_SUCCESS; - - if ((ret = grib_get_double_internal(h, self->missingValue, &missingValue)) != GRIB_SUCCESS) { - return ret; - } - if ((ret = grib_get_long_internal(h, "missingValuesPresent", &missingValuesPresent)) != GRIB_SUCCESS) { - return ret; - } - - if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) - return ret; - - values = (double*)grib_context_malloc(c, size * sizeof(double)); - if (!values) - return GRIB_OUT_OF_MEMORY; - - if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return ret; - } - - for (i = 0; i < size; i++) { - if (missingValuesPresent) { - if (values[i] != missingValue) - values[i] *= *val; - } - else { - values[i] *= *val; - } - } - - if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return ret; - } - - grib_context_free(c, values); - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_section.cc b/src/accessor/todo/grib_accessor_class_section.cc deleted file mode 100644 index f9c8857a7..000000000 --- a/src/accessor/todo/grib_accessor_class_section.cc +++ /dev/null @@ -1,194 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = next_offset;byte_count - IMPLEMENTS = destroy;sub_section - IMPLEMENTS = get_native_type - IMPLEMENTS = init;dump;update_size - IMPLEMENTS = next - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static grib_section* sub_section(grib_accessor* a); -static int get_native_type(grib_accessor*); -static long byte_count(grib_accessor*); -static long next_offset(grib_accessor*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); -static grib_accessor* next(grib_accessor*, int); - -typedef struct grib_accessor_section -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in section */ -} grib_accessor_section; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_section = { - &grib_accessor_class_gen, /* super */ - "section", /* name */ - sizeof(grib_accessor_section), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - &sub_section, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - &next, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_section = &_grib_accessor_class_section; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->sub_section = grib_section_create(grib_handle_of_accessor(a), a); - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_section(dumper, a, a->sub_section->block); -} - -static long byte_count(grib_accessor* a) -{ - if (!a->length || grib_handle_of_accessor(a)->loader) { - if (a->name[1] == '_') - return 0; - - /* printf("adjusting sizes SECTION %s is %ld %ld\n",a->name,(long)a->offset,(long)a->length); */ - grib_section_adjust_sizes(a->sub_section, grib_handle_of_accessor(a)->loader != NULL, 0); - /* printf(" SECTION %s is %ld %ld\n",a->name,(long)a->offset,(long)a->length); */ - } - - /* printf("SECTION %s is %ld %d\n",a->name,a->length,a->sub_section->aclength != NULL); */ - return a->length; -} - -static long next_offset(grib_accessor* a) -{ - return a->offset + byte_count(a); -} - -static void destroy(grib_context* ct, grib_accessor* a) -{ - grib_section_delete(ct, a->sub_section); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_SECTION; -} - -static grib_section* sub_section(grib_accessor* a) -{ - return a->sub_section; -} - -static void update_size(grib_accessor* a, size_t length) -{ - size_t size = 1; - long len = length; - Assert(length <= 0x7fffffff); - if (a->sub_section->aclength) { - int e = grib_pack_long(a->sub_section->aclength, &len, &size); - Assert(e == GRIB_SUCCESS); - // printf("update_length %s %ld %ld\n", a->sub_section->aclength->name, - // (long)a->sub_section->aclength->offset, - // (long)a->sub_section->aclength->length); - } - - a->sub_section->length = a->length = length; - a->sub_section->padding = 0; - - // printf("update_size %s %ld\n", a->name, a->length); - - Assert(a->length >= 0); -} - -static grib_accessor* next(grib_accessor* a, int explore) -{ - grib_accessor* next = NULL; - if (explore) { - next = a->sub_section->block->first; - if (!next) - next = a->next; - } - else { - next = a->next; - } - if (!next) { - if (a->parent->owner) - next = a->parent->owner->cclass->next(a->parent->owner, 0); - } - return next; -} diff --git a/src/accessor/todo/grib_accessor_class_section_length.cc b/src/accessor/todo/grib_accessor_class_section_length.cc deleted file mode 100644 index 4e5957e71..000000000 --- a/src/accessor/todo/grib_accessor_class_section_length.cc +++ /dev/null @@ -1,122 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_unsigned - IMPLEMENTS = init;dump - IMPLEMENTS = value_count - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_section_length -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in section_length */ -} grib_accessor_section_length; - -extern grib_accessor_class* grib_accessor_class_unsigned; - -static grib_accessor_class _grib_accessor_class_section_length = { - &grib_accessor_class_unsigned, /* super */ - "section_length", /* name */ - sizeof(grib_accessor_section_length), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_section_length = &_grib_accessor_class_section_length; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->parent->aclength = a; - a->length = len; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; - Assert(a->length >= 0); -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - -static int value_count(grib_accessor* a, long* c) -{ - *c = 1; - return 0; -} diff --git a/src/accessor/todo/grib_accessor_class_section_padding.cc b/src/accessor/todo/grib_accessor_class_section_padding.cc deleted file mode 100644 index 682946df5..000000000 --- a/src/accessor/todo/grib_accessor_class_section_padding.cc +++ /dev/null @@ -1,155 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_padding - IMPLEMENTS = init;preferred_size - MEMBERS = int preserve - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static void init(grib_accessor*, const long, grib_arguments*); -static size_t preferred_size(grib_accessor*, int); - -typedef struct grib_accessor_section_padding -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ - /* Members defined in padding */ - /* Members defined in section_padding */ - int preserve; -} grib_accessor_section_padding; - -extern grib_accessor_class* grib_accessor_class_padding; - -static grib_accessor_class _grib_accessor_class_section_padding = { - &grib_accessor_class_padding, /* super */ - "section_padding", /* name */ - sizeof(grib_accessor_section_padding), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_section_padding = &_grib_accessor_class_section_padding; - -/* END_CLASS_IMP */ - -static size_t preferred_size(grib_accessor* a, int from_handle) -{ - grib_accessor_section_padding* self = (grib_accessor_section_padding*)a; - grib_accessor* b = a; - grib_accessor* section_length = 0; - long length = 0; - size_t size = 1; - - long alength = 0; - - if (!from_handle) { - if (self->preserve) - return a->length; - else - return 0; - } - - /* The section length should be a parameter */ - while (section_length == NULL && b != NULL) { - section_length = b->parent->aclength; - b = b->parent->owner; - } - - if (!section_length) { - /* printf("PADDING is no !section_length\n"); */ - return 0; - } - - if (grib_unpack_long(section_length, &length, &size) == GRIB_SUCCESS) { - if (length) - alength = length - a->offset + section_length->parent->owner->offset; - else - alength = 0; - - /*Assert(a->length>=0);*/ - - if (alength < 0) - alength = 0; - - /* printf("PADDING is %ld\n",a->length); */ - } - else { - /* printf("PADDING unpack fails\n"); */ - } - - return alength; -} - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_section_padding* self = (grib_accessor_section_padding*)a; - self->preserve = 1; /* This should be a parameter */ - a->length = preferred_size(a, 1); -} diff --git a/src/accessor/todo/grib_accessor_class_section_pointer.cc b/src/accessor/todo/grib_accessor_class_section_pointer.cc deleted file mode 100644 index 861ab12e7..000000000 --- a/src/accessor/todo/grib_accessor_class_section_pointer.cc +++ /dev/null @@ -1,194 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;get_native_type;unpack_string - IMPLEMENTS = byte_count; byte_offset - MEMBERS = const char* sectionOffset - MEMBERS = const char* sectionLength - MEMBERS = long sectionNumber - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_string(grib_accessor*, char*, size_t* len); -static long byte_count(grib_accessor*); -static long byte_offset(grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_section_pointer -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in section_pointer */ - const char* sectionOffset; - const char* sectionLength; - long sectionNumber; -} grib_accessor_section_pointer; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_section_pointer = { - &grib_accessor_class_gen, /* super */ - "section_pointer", /* name */ - sizeof(grib_accessor_section_pointer), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_section_pointer = &_grib_accessor_class_section_pointer; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - int n = 0; - grib_accessor_section_pointer* self = (grib_accessor_section_pointer*)a; - - self->sectionOffset = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); - self->sectionLength = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); - self->sectionNumber = grib_arguments_get_long(grib_handle_of_accessor(a), arg, n++); - - Assert(self->sectionNumber < MAX_NUM_SECTIONS); - - grib_handle_of_accessor(a)->section_offset[self->sectionNumber] = (char*)self->sectionOffset; - grib_handle_of_accessor(a)->section_length[self->sectionNumber] = (char*)self->sectionLength; - - /* printf("++++++++++++++ GRIB_API: creating section_pointer%d %s %s\n", */ - /* self->sectionNumber,self->sectionLength,self->sectionLength); */ - - if (grib_handle_of_accessor(a)->sections_count < self->sectionNumber) - grib_handle_of_accessor(a)->sections_count = self->sectionNumber; - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; - a->length = 0; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_BYTES; -} - -static int unpack_string(grib_accessor* a, char* v, size_t* len) -{ - /* - unsigned char* p=NULL; - char* s=v; - int i; - long length=grib_byte_count(a); - - if (*len < length) return GRIB_ARRAY_TOO_SMALL; - - p = grib_handle_of_accessor(a)->buffer->data + grib_byte_offset(a); - - for (i = 0; i < length; i++) { - snprintf (s,64,"%02x", *(p++)); - s+=2; - } - *len=length; - */ - snprintf(v, 64, "%ld_%ld", grib_byte_offset(a), grib_byte_count(a)); - return GRIB_SUCCESS; -} - -static long byte_count(grib_accessor* a) -{ - grib_accessor_section_pointer* self = (grib_accessor_section_pointer*)a; - long sectionLength = 0; - int ret = 0; - - ret = grib_get_long(grib_handle_of_accessor(a), self->sectionLength, §ionLength); - if (ret) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "Unable to get %s %s", - self->sectionLength, grib_get_error_message(ret)); - return -1; - } - - return sectionLength; -} - -static long byte_offset(grib_accessor* a) -{ - grib_accessor_section_pointer* self = (grib_accessor_section_pointer*)a; - long sectionOffset = 0; - int ret = 0; - - ret = grib_get_long(grib_handle_of_accessor(a), self->sectionOffset, §ionOffset); - if (ret) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "Unable to get %s %s", - self->sectionOffset, grib_get_error_message(ret)); - return -1; - } - - return sectionOffset; -} diff --git a/src/accessor/todo/grib_accessor_class_sexagesimal2decimal.cc b/src/accessor/todo/grib_accessor_class_sexagesimal2decimal.cc deleted file mode 100644 index 9e132d9c2..000000000 --- a/src/accessor/todo/grib_accessor_class_sexagesimal2decimal.cc +++ /dev/null @@ -1,241 +0,0 @@ -/* - * (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. - */ -/*********************************************************** - * Enrico Fucile - ***********************************************************/ - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_to_double - IMPLEMENTS = init; unpack_string - IMPLEMENTS = dump - IMPLEMENTS = get_native_type - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_string(grib_accessor*, char*, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_sexagesimal2decimal -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in to_double */ - const char* key; - long start; - size_t length; - long scale; - /* Members defined in sexagesimal2decimal */ -} grib_accessor_sexagesimal2decimal; - -extern grib_accessor_class* grib_accessor_class_to_double; - -static grib_accessor_class _grib_accessor_class_sexagesimal2decimal = { - &grib_accessor_class_to_double, /* super */ - "sexagesimal2decimal", /* name */ - sizeof(grib_accessor_sexagesimal2decimal), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_sexagesimal2decimal = &_grib_accessor_class_sexagesimal2decimal; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_double(dumper, a, NULL); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_DOUBLE; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - int err = 0; - grib_accessor_sexagesimal2decimal* self = (grib_accessor_sexagesimal2decimal*)a; - char buff[512] = {0,}; - size_t length = 0; - size_t size = 512; - char* p; - char* q; - double dd, mm = 0, ss = 0; - int dd_sign = 1; - - err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); - if (err) - return err; - q = buff + self->start; - if (self->length) - q[length] = 0; - p = q; - - while (*p != '-' && *p != ':' && *p != ' ' && *p != 0) { - p++; - } - - if (*p == 0) { - return GRIB_WRONG_CONVERSION; - } - *p = 0; - - dd = atoi(q); - p++; - q = p; - while (*p != '-' && *p != ':' && *p != ' ' && *p != 'N' && *p != 'S' && *p != 'E' && *p != 'W' && *p != 0) { - p++; - } - switch (*p) { - case ' ': - case '-': - case ':': - *p = 0; - mm = atoi(q) / 60.0; - dd += mm; - p++; - q = p; - break; - case 'N': - case 'E': - *p = 0; - dd_sign = 1; - mm = atoi(q) / 60.0; - dd += mm; - p++; - q = p; - break; - case 'S': - case 'W': - *p = 0; - mm = atoi(q) / 60.0; - dd += mm; - dd_sign = -1; - p++; - q = p; - break; - case 0: - break; - default: - return GRIB_WRONG_CONVERSION; - } - if (*p) { - while (*p != '-' && *p != ':' && *p != ' ' && *p != 'N' && *p != 'S' && *p != 'E' && *p != 'W' && *p != 0) { - p++; - } - switch (*p) { - case ' ': - case '-': - case ':': - *p = 0; - ss = atof(q) / 60.0; - dd += ss; - break; - case 'N': - case 'E': - *p = 0; - ss = atof(q) / 60.0; - dd += ss; - dd_sign = 1; - break; - case 'S': - case 'W': - *p = 0; - ss = atof(q) / 60.0; - dd += ss; - dd_sign = -1; - break; - case 0: - break; - default: - return GRIB_WRONG_CONVERSION; - } - } - dd *= dd_sign; - - snprintf(buff, sizeof(buff), "%.2f", dd); - length = strlen(buff); - - if (len[0] < length + 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", - len[0], a->name, a->length + 1); - len[0] = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - strcpy(val, buff); - - len[0] = length; - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_signed_bits.cc b/src/accessor/todo/grib_accessor_class_signed_bits.cc deleted file mode 100644 index dc8ccf488..000000000 --- a/src/accessor/todo/grib_accessor_class_signed_bits.cc +++ /dev/null @@ -1,258 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init - IMPLEMENTS = next_offset - IMPLEMENTS = byte_count - IMPLEMENTS = value_count - IMPLEMENTS = byte_offset - IMPLEMENTS = update_size - MEMBERS = const char* numberOfBits - MEMBERS = const char* numberOfElements - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static long byte_count(grib_accessor*); -static long byte_offset(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); - -typedef struct grib_accessor_signed_bits -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in signed_bits */ - const char* numberOfBits; - const char* numberOfElements; -} grib_accessor_signed_bits; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_signed_bits = { - &grib_accessor_class_long, /* super */ - "signed_bits", /* name */ - sizeof(grib_accessor_signed_bits), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - &next_offset, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_signed_bits = &_grib_accessor_class_signed_bits; - -/* END_CLASS_IMP */ - -static long byte_count(grib_accessor* a) -{ - return a->length; -} - -static long compute_byte_count(grib_accessor* a) -{ - grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a; - long numberOfBits; - long numberOfElements; - int ret = 0; - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); - if (ret) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s unable to get %s to compute size", a->name, self->numberOfBits); - return 0; - } - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, &numberOfElements); - if (ret) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s unable to get %s to compute size", a->name, self->numberOfElements); - return 0; - } - - return (numberOfBits * numberOfElements + 7) / 8; -} - -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a; - int n = 0; - self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->numberOfElements = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - a->length = compute_byte_count(a); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -#if 0 - grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a; - int i; - int ret = 0; - long pos = a->offset * 8; - long rlen = 0; - long numberOfBits = 0; - - ret = value_count(a, &rlen); - if (ret) - return ret; - - if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "Wrong size (%ld) for %s it contains %ld values", *len, a->name, rlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); - if (ret) - return ret; - - if (numberOfBits == 0) { - for (i = 0; i < rlen; i++) - val[i] = 0; - return GRIB_SUCCESS; - } - - for (i = 0; i < rlen; i++) - val[i] = grib_decode_signed_longb(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); - - *len = rlen; - - return GRIB_SUCCESS; -#endif -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -#if 0 - grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a; - int ret = 0; - long off = 0; - long numberOfBits = 0; - size_t buflen = 0; - unsigned char* buf = NULL; - unsigned long i = 0; - unsigned long rlen = 0; - long count = 0; - - ret = value_count(a, &count); - if (ret) - return ret; - rlen = count; - if (*len != rlen) { - ret = grib_set_long(grib_handle_of_accessor(a), self->numberOfElements, rlen); - if (ret) - return ret; - } - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); - if (ret) - return ret; - - buflen = compute_byte_count(a); - buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen + sizeof(long)); - - for (i = 0; i < rlen; i++) - grib_encode_signed_longb(buf, val[i], &off, numberOfBits); - - grib_buffer_replace(a, buf, buflen, 1, 1); - - grib_context_free(a->context, buf); - - return ret; -#endif -} - -static int value_count(grib_accessor* a, long* numberOfElements) -{ - grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a; - *numberOfElements = 0; - - return grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, numberOfElements); -} - -static long byte_offset(grib_accessor* a) -{ - return a->offset; -} - -static void update_size(grib_accessor* a, size_t s) -{ - a->length = s; -} - -static long next_offset(grib_accessor* a) -{ - return byte_offset(a) + byte_count(a); -} diff --git a/src/accessor/todo/grib_accessor_class_simple_packing_error.cc b/src/accessor/todo/grib_accessor_class_simple_packing_error.cc deleted file mode 100644 index 64f96eeea..000000000 --- a/src/accessor/todo/grib_accessor_class_simple_packing_error.cc +++ /dev/null @@ -1,163 +0,0 @@ -/* - * (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 "grib_scaling.h" -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_double - IMPLEMENTS = init - MEMBERS=const char* binaryScaleFactor - MEMBERS=const char* bitsPerValue - MEMBERS=const char* decimalScaleFactor - MEMBERS=const char* referenceValue - MEMBERS=const char* floatType - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_simple_packing_error -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in simple_packing_error */ - const char* binaryScaleFactor; - const char* bitsPerValue; - const char* decimalScaleFactor; - const char* referenceValue; - const char* floatType; -} grib_accessor_simple_packing_error; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_simple_packing_error = { - &grib_accessor_class_double, /* super */ - "simple_packing_error", /* name */ - sizeof(grib_accessor_simple_packing_error), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_simple_packing_error = &_grib_accessor_class_simple_packing_error; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_simple_packing_error* self = (grib_accessor_simple_packing_error*)a; - int n = 0; - grib_handle* h = grib_handle_of_accessor(a); - - self->bitsPerValue = grib_arguments_get_name(h, c, n++); - self->binaryScaleFactor = grib_arguments_get_name(h, c, n++); - self->decimalScaleFactor = grib_arguments_get_name(h, c, n++); - self->referenceValue = grib_arguments_get_name(h, c, n++); - self->floatType = grib_arguments_get_name(h, c, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length = 0; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_simple_packing_error* self = (grib_accessor_simple_packing_error*)a; - - int ret = 0; - long binaryScaleFactor = 0; - long bitsPerValue = 0; - long decimalScaleFactor = 0; - double referenceValue = 0; - grib_handle* h = grib_handle_of_accessor(a); - - if ((ret = grib_get_long_internal(h, self->binaryScaleFactor, &binaryScaleFactor)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(h, self->bitsPerValue, &bitsPerValue)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(h, self->decimalScaleFactor, &decimalScaleFactor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_double_internal(h, self->referenceValue, &referenceValue)) != GRIB_SUCCESS) - return ret; - - if (!strcmp(self->floatType, "ibm")) - *val = grib_ibmfloat_error(referenceValue); - else if (!strcmp(self->floatType, "ieee")) - *val = grib_ieeefloat_error(referenceValue); - else - Assert(1 == 0); - - if (bitsPerValue != 0) - *val = (*val + codes_power(binaryScaleFactor, 2)) * codes_power(-decimalScaleFactor, 10) * 0.5; - - if (ret == GRIB_SUCCESS) - *len = 1; - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_size.cc b/src/accessor/todo/grib_accessor_class_size.cc deleted file mode 100644 index 410cec3c3..000000000 --- a/src/accessor/todo/grib_accessor_class_size.cc +++ /dev/null @@ -1,119 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS = const char* accessor - END_CLASS_DEF - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_size -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in size */ - const char* accessor; -} grib_accessor_size; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_size = { - &grib_accessor_class_long, /* super */ - "size", /* name */ - sizeof(grib_accessor_size), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_size = &_grib_accessor_class_size; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_size* self = (grib_accessor_size*)a; - self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - int ret = 0; - size_t size = 0; - grib_accessor_size* self = (grib_accessor_size*)a; - ret = grib_get_size(grib_handle_of_accessor(a), self->accessor, &size); - *val = (long)size; - *len = 1; - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_smart_table_column.cc b/src/accessor/todo/grib_accessor_class_smart_table_column.cc deleted file mode 100644 index 295f29281..000000000 --- a/src/accessor/todo/grib_accessor_class_smart_table_column.cc +++ /dev/null @@ -1,294 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;dump;unpack_string_array;unpack_long - IMPLEMENTS = value_count; destroy; get_native_type; - MEMBERS = const char* smartTable - MEMBERS = int index - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int unpack_string_array(grib_accessor*, char**, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_smart_table_column -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in smart_table_column */ - const char* smartTable; - int index; -} grib_accessor_smart_table_column; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_smart_table_column = { - &grib_accessor_class_gen, /* super */ - "smart_table_column", /* name */ - sizeof(grib_accessor_smart_table_column), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - &unpack_string_array, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_smart_table_column = &_grib_accessor_class_smart_table_column; - -/* END_CLASS_IMP */ - -typedef struct grib_accessor_smart_table -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; - /* Members defined in smart_table */ - const char* values; - const char* tablename; - const char* masterDir; - const char* localDir; - const char* extraDir; - const char* extraTable; - int widthOfCode; - long* tableCodes; - size_t tableCodesSize; - grib_smart_table* table; - int dirty; -} grib_accessor_smart_table; - -static void init(grib_accessor* a, const long len, grib_arguments* params) -{ - int n = 0; - grib_accessor_smart_table_column* self = (grib_accessor_smart_table_column*)a; - - self->smartTable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); - self->index = grib_arguments_get_long(grib_handle_of_accessor(a), params, n++); - - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - int type = get_native_type(a); - - switch (type) { - case GRIB_TYPE_LONG: - grib_dump_long(dumper, a, NULL); - break; - case GRIB_TYPE_STRING: - grib_dump_string_array(dumper, a, NULL); - break; - } -} - -static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) -{ - grib_accessor_smart_table_column* self = (grib_accessor_smart_table_column*)a; - grib_accessor_smart_table* tableAccessor = NULL; - grib_smart_table* table = NULL; - - size_t size = 1; - long* code; - int err = GRIB_SUCCESS; - char tmp[1024] = {0,}; - int i = 0; - - tableAccessor = (grib_accessor_smart_table*)grib_find_accessor(grib_handle_of_accessor(a), self->smartTable); - if (!tableAccessor) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "Unable to find accessor %s", self->smartTable); - return GRIB_NOT_FOUND; - } - - err = grib_get_size_acc(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size); - if (err) - return err; - if (*len < size) { - return GRIB_BUFFER_TOO_SMALL; - } - - code = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - if (!code) { - grib_context_log(a->context, GRIB_LOG_FATAL, "%s: Memory allocation error: %zu bytes", a->name, size); - return GRIB_OUT_OF_MEMORY; - } - - if ((err = grib_unpack_long((grib_accessor*)tableAccessor, code, &size)) != GRIB_SUCCESS) - return err; - - table = tableAccessor->table; - - for (i = 0; i < size; i++) { - if (table && (code[i] >= 0) && - (code[i] < table->numberOfEntries) && - table->entries[code[i]].column[self->index]) { - strcpy(tmp, table->entries[code[i]].column[self->index]); - } - else { - snprintf(tmp, sizeof(tmp), "%d", (int)code[i]); - } - - buffer[i] = grib_context_strdup(a->context, tmp); - } - *len = size; - grib_context_free(a->context, code); - - return GRIB_SUCCESS; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_smart_table_column* self = (grib_accessor_smart_table_column*)a; - grib_accessor_smart_table* tableAccessor = NULL; - grib_smart_table* table = NULL; - - size_t size = 1; - long* code; - int err = GRIB_SUCCESS; - int i = 0; - - for (i = 0; i < *len; i++) - val[i] = GRIB_MISSING_LONG; - - tableAccessor = (grib_accessor_smart_table*)grib_find_accessor(grib_handle_of_accessor(a), self->smartTable); - if (!tableAccessor) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "Unable to find accessor %s", self->smartTable); - return GRIB_NOT_FOUND; - } - - err = grib_get_size_acc(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size); - if (err) - return err; - if (*len < size) { - return GRIB_BUFFER_TOO_SMALL; - } - - code = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - if (!code) return GRIB_OUT_OF_MEMORY; - - if ((err = grib_unpack_long((grib_accessor*)tableAccessor, code, &size)) != GRIB_SUCCESS) { - grib_context_free(a->context, code); - return err; - } - - table = tableAccessor->table; - - for (i = 0; i < size; i++) { - if (table && (code[i] >= 0) && - (code[i] < table->numberOfEntries) && - table->entries[code[i]].column[self->index]) { - val[i] = atol(table->entries[code[i]].column[self->index]); - } - } - *len = size; - grib_context_free(a->context, code); - - return GRIB_SUCCESS; -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_smart_table_column* self = (grib_accessor_smart_table_column*)a; - size_t size = 0; - int err = 0; - *count = 0; - - if (!self->smartTable) - return 0; - - err = grib_get_size(grib_handle_of_accessor(a), self->smartTable, &size); - *count = size; - return err; -} - -static void destroy(grib_context* context, grib_accessor* a) -{ - if (a->vvalue != NULL) { - grib_context_free(context, a->vvalue); - a->vvalue = NULL; - } -} - -static int get_native_type(grib_accessor* a) -{ - int type = GRIB_TYPE_LONG; - /*printf("---------- %s flags=%ld GRIB_ACCESSOR_FLAG_STRING_TYPE=%d\n", - a->name,a->flags,GRIB_ACCESSOR_FLAG_STRING_TYPE);*/ - if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) - type = GRIB_TYPE_STRING; - return type; -} diff --git a/src/accessor/todo/grib_accessor_class_spd.cc b/src/accessor/todo/grib_accessor_class_spd.cc deleted file mode 100644 index e0f4a20a7..000000000 --- a/src/accessor/todo/grib_accessor_class_spd.cc +++ /dev/null @@ -1,264 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init - IMPLEMENTS = next_offset - IMPLEMENTS = byte_count - IMPLEMENTS = value_count - IMPLEMENTS = byte_offset - IMPLEMENTS = update_size - MEMBERS = const char* numberOfBits - MEMBERS = const char* numberOfElements - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static long byte_count(grib_accessor*); -static long byte_offset(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); - -typedef struct grib_accessor_spd -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in spd */ - const char* numberOfBits; - const char* numberOfElements; -} grib_accessor_spd; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_spd = { - &grib_accessor_class_long, /* super */ - "spd", /* name */ - sizeof(grib_accessor_spd), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - &next_offset, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_spd = &_grib_accessor_class_spd; - -/* END_CLASS_IMP */ - -static long byte_count(grib_accessor* a) -{ - return a->length; -} - -static long compute_byte_count(grib_accessor* a) -{ - grib_accessor_spd* self = (grib_accessor_spd*)a; - long numberOfBits; - long numberOfElements; - int ret = 0; - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); - if (ret) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s unable to get %s to compute size", a->name, self->numberOfBits); - return 0; - } - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, &numberOfElements); - if (ret) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s unable to get %s to compute size", a->name, self->numberOfElements); - return 0; - } - numberOfElements++; - - return (numberOfBits * numberOfElements + 7) / 8; -} - -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_spd* self = (grib_accessor_spd*)a; - int n = 0; - self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->numberOfElements = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - a->length = compute_byte_count(a); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_spd* self = (grib_accessor_spd*)a; - int i; - int ret = 0; - long pos = a->offset * 8; - long rlen = 0; - long numberOfBits = 0; - - ret = value_count(a, &rlen); - if (ret) - return ret; - - if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "Wrong size (%zu) for %s, it contains %ld values", *len, a->name, rlen); - *len = rlen; - return GRIB_ARRAY_TOO_SMALL; - } - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); - if (ret) - return ret; - if (numberOfBits > 64) { - grib_context_log(a->context, GRIB_LOG_ERROR,"Invalid number of bits: %ld",numberOfBits); - return GRIB_DECODING_ERROR; - } - - for (i = 0; i < rlen - 1; i++) - val[i] = grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); - - val[rlen - 1] = grib_decode_signed_longb(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); - - *len = rlen; - - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_spd* self = (grib_accessor_spd*)a; - int ret = 0; - long off = 0; - long numberOfBits = 0; - size_t buflen = 0; - unsigned char* buf = NULL; - unsigned long i = 0; - long rlen = 0; - - ret = value_count(a, &rlen); - if (ret) - return ret; - - if (*len != rlen) { - ret = grib_set_long(grib_handle_of_accessor(a), self->numberOfElements, (*len) - 1); - if (ret) return ret; - } - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); - if (ret) - return ret; - - buflen = compute_byte_count(a); - buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen); - - for (i = 0; i < rlen - 1; i++) { - grib_encode_unsigned_longb(buf, val[i], &off, numberOfBits); - } - - grib_encode_signed_longb(buf, val[rlen - 1], &off, numberOfBits); - - grib_buffer_replace(a, buf, buflen, 1, 1); - - grib_context_free(a->context, buf); - - *len = rlen; - return ret; -} - -static int value_count(grib_accessor* a, long* numberOfElements) -{ - grib_accessor_spd* self = (grib_accessor_spd*)a; - int ret; - *numberOfElements = 0; - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, numberOfElements); - if (ret) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s unable to get %s to compute size", a->name, self->numberOfElements); - return ret; - } - (*numberOfElements)++; - - return ret; -} - -static long byte_offset(grib_accessor* a) -{ - return a->offset; -} - -static void update_size(grib_accessor* a, size_t s) -{ - a->length = s; -} - -static long next_offset(grib_accessor* a) -{ - return byte_offset(a) + a->length; -} diff --git a/src/accessor/todo/grib_accessor_class_spectral_truncation.cc b/src/accessor/todo/grib_accessor_class_spectral_truncation.cc deleted file mode 100644 index 6cc902fa7..000000000 --- a/src/accessor/todo/grib_accessor_class_spectral_truncation.cc +++ /dev/null @@ -1,177 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS=const char* J - MEMBERS=const char* K - MEMBERS=const char* M - MEMBERS=const char* T - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_spectral_truncation -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in spectral_truncation */ - const char* J; - const char* K; - const char* M; - const char* T; -} grib_accessor_spectral_truncation; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_spectral_truncation = { - &grib_accessor_class_long, /* super */ - "spectral_truncation", /* name */ - sizeof(grib_accessor_spectral_truncation), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_spectral_truncation = &_grib_accessor_class_spectral_truncation; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_spectral_truncation* self = (grib_accessor_spectral_truncation*)a; - int n = 0; - - self->J = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->K = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->M = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->T = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_spectral_truncation* self = (grib_accessor_spectral_truncation*)a; - int ret = 0; - - long J, K, M, T, Tc; - - if (*len < 1) - return GRIB_ARRAY_TOO_SMALL; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->J, &J)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->K, &K)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->M, &M)) != GRIB_SUCCESS) - return ret; - - Tc = -1; - if (J == K && K == M) { - /* Triangular truncation */ - Tc = (M + 1) * (M + 2); - } - if (K == J + M) { - /* Rhomboidal truncation */ - Tc = 2 * J * M; - } - if (J == K && K > M) { - /* Trapezoidal truncation */ - Tc = M * (2 * J - M); - } - *val = Tc; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->T, &T)) != GRIB_SUCCESS) { - if (Tc == -1) - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s. Spectral Truncation Type Unknown: %s=%ld %s=%ld %s=%ld", - a->name, self->J, J, self->K, K, self->M, M); - Tc = 0; - grib_set_long(grib_handle_of_accessor(a), self->T, Tc); - } - else { - if (Tc != -1 && Tc != T) - grib_set_long(grib_handle_of_accessor(a), self->T, Tc); - } - - if (ret == GRIB_SUCCESS) - *len = 1; - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_statistics_spectral.cc b/src/accessor/todo/grib_accessor_class_statistics_spectral.cc deleted file mode 100644 index 435582bef..000000000 --- a/src/accessor/todo/grib_accessor_class_statistics_spectral.cc +++ /dev/null @@ -1,277 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_abstract_vector - IMPLEMENTS = unpack_double; destroy - IMPLEMENTS = value_count;compare - IMPLEMENTS = init - MEMBERS = const char* values - MEMBERS = const char* J - MEMBERS = const char* K - MEMBERS = const char* M - MEMBERS = const char* JS - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_statistics_spectral -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in abstract_vector */ - double* v; - int number_of_elements; - /* Members defined in statistics_spectral */ - const char* values; - const char* J; - const char* K; - const char* M; - const char* JS; -} grib_accessor_statistics_spectral; - -extern grib_accessor_class* grib_accessor_class_abstract_vector; - -static grib_accessor_class _grib_accessor_class_statistics_spectral = { - &grib_accessor_class_abstract_vector, /* super */ - "statistics_spectral", /* name */ - sizeof(grib_accessor_statistics_spectral), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_statistics_spectral = &_grib_accessor_class_statistics_spectral; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_statistics_spectral* self = (grib_accessor_statistics_spectral*)a; - int n = 0; - - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->J = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->K = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->M = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->JS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - - self->number_of_elements = 4; - self->v = (double*)grib_context_malloc(a->context, - sizeof(double) * self->number_of_elements); - - a->length = 0; - a->dirty = 1; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_statistics_spectral* self = (grib_accessor_statistics_spectral*)a; - int ret = 0, i = 0; - double* values; - size_t size = 0; - long J, K, M, N; - double avg, enorm, sd; - grib_context* c = a->context; - grib_handle* h = grib_handle_of_accessor(a); - - if (!a->dirty) - return GRIB_SUCCESS; - - if (*len != self->number_of_elements) - return GRIB_ARRAY_TOO_SMALL; - - if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long(grib_handle_of_accessor(a), self->J, &J)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long(grib_handle_of_accessor(a), self->K, &K)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long(grib_handle_of_accessor(a), self->M, &M)) != GRIB_SUCCESS) - return ret; - - if (J != M || M != K) - return GRIB_NOT_IMPLEMENTED; - - N = (M + 1) * (M + 2) / 2; - - if (2 * N != size) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "wrong number of components for spherical harmonics %ld != %ld", 2 * N, size); - return GRIB_WRONG_ARRAY_SIZE; - } - - values = (double*)grib_context_malloc(c, size * sizeof(double)); - if (!values) - return GRIB_OUT_OF_MEMORY; - - if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { - grib_context_free(c, values); - return ret; - } - - avg = values[0]; - sd = 0; - - for (i = 2; i < 2 * J; i += 2) - sd += values[i] * values[i]; - - for (i = 2 * J; i < size; i += 2) - sd += 2 * values[i] * values[i] + 2 * values[i + 1] * values[i + 1]; - - enorm = sd + avg * avg; - - sd = sqrt(sd); - enorm = sqrt(enorm); - - a->dirty = 0; - - grib_context_free(c, values); - - self->v[0] = avg; - self->v[1] = enorm; - self->v[2] = sd; - self->v[3] = sd == 0 ? 1 : 0; - - for (i = 0; i < self->number_of_elements; i++) - val[i] = self->v[i]; - - return ret; -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_statistics_spectral* self = (grib_accessor_statistics_spectral*)a; - *count = self->number_of_elements; - return 0; -} - -static void destroy(grib_context* c, grib_accessor* a) -{ - grib_accessor_statistics_spectral* self = (grib_accessor_statistics_spectral*)a; - grib_context_free(c, self->v); -} - -static int compare(grib_accessor* a, grib_accessor* b) -{ - int retval = GRIB_SUCCESS; - double* aval = 0; - double* bval = 0; - - size_t alen = 0; - size_t blen = 0; - int err = 0; - long count = 0; - - err = grib_value_count(a, &count); - if (err) - return err; - alen = count; - - err = grib_value_count(b, &count); - if (err) - return err; - blen = count; - - if (alen != blen) - return GRIB_COUNT_MISMATCH; - - aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); - bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - - b->dirty = 1; - a->dirty = 1; - - grib_unpack_double(a, aval, &alen); - grib_unpack_double(b, bval, &blen); - - retval = GRIB_SUCCESS; - for (size_t i=0; icontext, aval); - grib_context_free(b->context, bval); - - return retval; -} diff --git a/src/accessor/todo/grib_accessor_class_step_human_readable.cc b/src/accessor/todo/grib_accessor_class_step_human_readable.cc deleted file mode 100644 index 557a58185..000000000 --- a/src/accessor/todo/grib_accessor_class_step_human_readable.cc +++ /dev/null @@ -1,169 +0,0 @@ -/* - * (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 "grib_api_internal.h" -#include "step.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;unpack_string; get_native_type - MEMBERS = const char* stepUnits - MEMBERS = const char* step - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_string(grib_accessor*, char*, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_step_human_readable -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in step_human_readable */ - const char* stepUnits; - const char* step; -} grib_accessor_step_human_readable; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_step_human_readable = { - &grib_accessor_class_gen, /* super */ - "step_human_readable", /* name */ - sizeof(grib_accessor_step_human_readable), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_step_human_readable = &_grib_accessor_class_step_human_readable; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* params) -{ - grib_accessor_step_human_readable* self = (grib_accessor_step_human_readable*)a; - int n = 0; - grib_handle* h = grib_handle_of_accessor(a); - - self->stepUnits = grib_arguments_get_name(h, params, n++); - self->step = grib_arguments_get_name(h, params, n++); - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} - -static int get_step_human_readable(grib_handle* h, char* result, size_t* length) -{ - int err = 0; - size_t slen = 2; - long step, hour, minute, second; - - /* Change units to seconds (highest resolution) - * before computing the step value - */ - if ((err = grib_set_string(h, "stepUnits", "s", &slen)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long(h, "step", &step)) != GRIB_SUCCESS) - return err; - - hour = step/3600; - minute = step/60 % 60; - second = step % 60; - /* sprintf(result, "%ld:%ld:%ld", hour, minute, second); */ - - if (second) { - snprintf(result, 1024, "%ldh %ldm %lds", hour, minute, second); - } else { - if (minute) snprintf(result, 1024, "%ldh %ldm", hour, minute); - else snprintf(result, 1024, "%ldh", hour); - } - - *length = strlen(result); - return GRIB_SUCCESS; -} - -static int unpack_string(grib_accessor* a, char* buffer, size_t* len) -{ - grib_accessor_step_human_readable* self = (grib_accessor_step_human_readable*)a; - grib_handle* h = grib_handle_of_accessor(a); - long stepUnits; - int err = 0; - - /* Save the current value of stepUnits */ - err = grib_get_long_internal(h, self->stepUnits, &stepUnits); - if (err) return err; - - /* This will change stepUnits to seconds for its calculation */ - err = get_step_human_readable(h, buffer, len); - - /* Restore stepUnits */ - grib_set_long(h, self->stepUnits, stepUnits); - return err; -} diff --git a/src/accessor/todo/grib_accessor_class_sum.cc b/src/accessor/todo/grib_accessor_class_sum.cc deleted file mode 100644 index 4d964fc0c..000000000 --- a/src/accessor/todo/grib_accessor_class_sum.cc +++ /dev/null @@ -1,203 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_double - IMPLEMENTS = unpack_long - IMPLEMENTS = unpack_double - IMPLEMENTS = value_count - IMPLEMENTS = init - MEMBERS=const char* values - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_sum -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in sum */ - const char* values; -} grib_accessor_sum; - -extern grib_accessor_class* grib_accessor_class_double; - -static grib_accessor_class _grib_accessor_class_sum = { - &grib_accessor_class_double, /* super */ - "sum", /* name */ - sizeof(grib_accessor_sum), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 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, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_sum = &_grib_accessor_class_sum; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_sum* self = (grib_accessor_sum*)a; - int n = 0; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_sum* self = (grib_accessor_sum*)a; - int ret = 0; - size_t size = 0; - long* values = 0; - long i; - long count = 0; - - ret = value_count(a, &count); - if (ret) - return ret; - size = count; - - if (size == 0) { - *val = 0; - return GRIB_SUCCESS; - } - values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - if (!values) - return GRIB_OUT_OF_MEMORY; - - grib_get_long_array(grib_handle_of_accessor(a), self->values, values, &size); - - *val = 0; - for (i = 0; i < size; i++) - *val += values[i]; - - grib_context_free(a->context, values); - - return GRIB_SUCCESS; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_sum* self = (grib_accessor_sum*)a; - int ret = 0; - size_t size = 0; - double* values = 0; - long i; - long count = 0; - - ret = value_count(a, &count); - if (ret) - return ret; - size = count; - - if (size == 0) { - *val = 0; - return GRIB_SUCCESS; - } - values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); - if (!values) - return GRIB_OUT_OF_MEMORY; - - ret = grib_get_double_array(grib_handle_of_accessor(a), self->values, values, &size); - if (ret) { - grib_context_free(a->context, values); - return ret; - } - *val = 0; - for (i = 0; i < size; i++) - *val += values[i]; - - grib_context_free(a->context, values); - - return GRIB_SUCCESS; -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_sum* self = (grib_accessor_sum*)a; - size_t n = 0; - int ret = 0; - - ret = grib_get_size(grib_handle_of_accessor(a), self->values, &n); - *count = n; - - if (ret) - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s is unable to get size of %s", a->name, self->values); - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_suppressed.cc b/src/accessor/todo/grib_accessor_class_suppressed.cc deleted file mode 100644 index a95269c5d..000000000 --- a/src/accessor/todo/grib_accessor_class_suppressed.cc +++ /dev/null @@ -1,162 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = value_count;get_native_type - IMPLEMENTS = unpack_string - IMPLEMENTS = unpack_long - IMPLEMENTS = unpack_double - IMPLEMENTS = init - MEMBERS= grib_arguments* args - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_double(grib_accessor*, double* 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 value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_suppressed -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in suppressed */ - grib_arguments* args; -} grib_accessor_suppressed; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_suppressed = { - &grib_accessor_class_long, /* super */ - "suppressed", /* name */ - sizeof(grib_accessor_suppressed), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_suppressed = &_grib_accessor_class_suppressed; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_suppressed* self = (grib_accessor_suppressed*)a; - self->args = c; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static void log_message(grib_accessor* a) -{ - grib_accessor_suppressed* self = (grib_accessor_suppressed*)a; - int i = 0; - grib_handle* hand = grib_handle_of_accessor(a); - - grib_context_log(a->context, GRIB_LOG_ERROR, - "key '%s' is unavailable in this version.", a->name); - grib_context_log(a->context, GRIB_LOG_ERROR, - "Please use the following key(s):"); - while (grib_arguments_get_name(hand, self->args, i)) { - grib_context_log(a->context, GRIB_LOG_ERROR, "\t- %s", - grib_arguments_get_name(hand, self->args, i)); - i++; - } -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - log_message(a); - return GRIB_NOT_FOUND; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - log_message(a); - return GRIB_NOT_FOUND; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - log_message(a); - return GRIB_NOT_FOUND; -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} diff --git a/src/accessor/todo/grib_accessor_class_time.cc b/src/accessor/todo/grib_accessor_class_time.cc deleted file mode 100644 index 3251fdd33..000000000 --- a/src/accessor/todo/grib_accessor_class_time.cc +++ /dev/null @@ -1,208 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = unpack_string - IMPLEMENTS = init - MEMBERS=const char* hour - MEMBERS=const char* minute - MEMBERS=const char* second - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* 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 void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_time -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in time */ - const char* hour; - const char* minute; - const char* second; -} grib_accessor_time; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_time = { - &grib_accessor_class_long, /* super */ - "time", /* name */ - sizeof(grib_accessor_time), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_time = &_grib_accessor_class_time; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_time* self = (grib_accessor_time*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; - - self->hour = grib_arguments_get_name(hand, c, n++); - self->minute = grib_arguments_get_name(hand, c, n++); - self->second = grib_arguments_get_name(hand, c, n++); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - const grib_accessor_time* self = (grib_accessor_time*)a; - - int ret = 0; - long hour = 0, minute = 0, second = 0; - grib_handle* hand = grib_handle_of_accessor(a); - - if ((ret = grib_get_long_internal(hand, self->hour, &hour)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(hand, self->minute, &minute)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(hand, self->second, &second)) != GRIB_SUCCESS) - return ret; - - /* We ignore the 'seconds' in our time calculation! */ - if (second != 0) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "Key %s (%s): Truncating time: non-zero seconds(%ld) ignored", a->name, __func__, second); - } - - if (*len < 1) - return GRIB_WRONG_ARRAY_SIZE; - - *val = hour * 100 + minute; - - if (hour == 255) { - *val = 12 * 100; - } - if (hour != 255 && minute == 255) { - *val = hour * 100; - } - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - const grib_accessor_time* self = (grib_accessor_time*)a; - - int ret = 0; - long v = val[0]; - grib_handle* hand = grib_handle_of_accessor(a); - long hour = 0, minute = 0, second = 0; - - if (*len != 1) - return GRIB_WRONG_ARRAY_SIZE; - - if (!is_time_valid(v)) { - // ECC-1777: For now just a warning. Will later change to an error - fprintf(stderr, "ECCODES WARNING : %s:%s: Time is not valid! hour=%ld min=%ld sec=%ld\n", - a->cclass->name, __func__, hour, minute, second); - // return GRIB_ENCODING_ERROR; - } - - hour = v / 100; - minute = v % 100; - second = 0; /* We ignore the 'seconds' in our time calculation! */ - - if ((ret = grib_set_long_internal(hand, self->hour, hour)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_set_long_internal(hand, self->minute, minute)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_set_long_internal(hand, self->second, second)) != GRIB_SUCCESS) - return ret; - - return GRIB_SUCCESS; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - long v = 0; - size_t lsize = 1, lmin = 5; - - unpack_long(a, &v, &lsize); - - if (*len < lmin) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - a->cclass->name, a->name, lmin, *len); - *len = lmin; - return GRIB_BUFFER_TOO_SMALL; - } - - snprintf(val, 64, "%04ld", v); - - len[0] = lmin; - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_to_double.cc b/src/accessor/todo/grib_accessor_class_to_double.cc deleted file mode 100644 index 69b06add9..000000000 --- a/src/accessor/todo/grib_accessor_class_to_double.cc +++ /dev/null @@ -1,241 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_string - IMPLEMENTS = unpack_long - IMPLEMENTS = unpack_double - IMPLEMENTS = init;dump;string_length - IMPLEMENTS = value_count - IMPLEMENTS = next_offset - IMPLEMENTS = get_native_type - MEMBERS = const char* key - MEMBERS = long start - MEMBERS = size_t length - MEMBERS = long scale - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_double(grib_accessor*, double* 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 size_t string_length(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_to_double -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in to_double */ - const char* key; - long start; - size_t length; - long scale; -} grib_accessor_to_double; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_to_double = { - &grib_accessor_class_gen, /* super */ - "to_double", /* name */ - sizeof(grib_accessor_to_double), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_to_double = &_grib_accessor_class_to_double; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_to_double* self = (grib_accessor_to_double*)a; - - self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); - self->start = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); - self->length = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 2); - self->scale = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 3); - if (!self->scale) - self->scale = 1; - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length = 0; -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_to_double* self = (grib_accessor_to_double*)a; - size_t size = 0; - - int err = grib_get_size(grib_handle_of_accessor(a), self->key, &size); - *count = size; - - return err; -} - -static size_t string_length(grib_accessor* a) -{ - grib_accessor_to_double* self = (grib_accessor_to_double*)a; - size_t size = 0; - - if (self->length) - return self->length; - - grib_get_string_length_acc(a, &size); - return size; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_string(dumper, a, NULL); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_to_double* self = (grib_accessor_to_double*)a; - - int err = 0; - char buff[512] = {0,}; - size_t size = 512; - size_t length = string_length(a); - - if (*len < length + 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", - *len, a->name, a->length + 1); - *len = length + 1; - return GRIB_ARRAY_TOO_SMALL; - } - - err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); - if (err) - return err; - if (length > size) { - err = GRIB_STRING_TOO_SMALL; - length = size; - } - - memcpy(val, buff + self->start, length); - - val[length] = 0; - *len = length; - return err; -} - -static int unpack_long(grib_accessor* a, long* v, size_t* len) -{ - grib_accessor_to_double* self = (grib_accessor_to_double*)a; - char val[1024] = {0,}; - size_t l = sizeof(val); - char* last = NULL; - int err = grib_unpack_string(a, val, &l); - - if (err) - return err; - - *v = strtol(val, &last, 10); - if (*last) { - err = GRIB_WRONG_CONVERSION; - } - *v /= self->scale; - - return err; -} - -static int unpack_double(grib_accessor* a, double* v, size_t* len) -{ - grib_accessor_to_double* self = (grib_accessor_to_double*)a; - char val[1024] = {0,}; - size_t l = sizeof(val); - char* last = NULL; - int err = grib_unpack_string(a, val, &l); - - if (err) - return err; - - *v = strtod(val, &last); - if (*last) { - err = GRIB_WRONG_CONVERSION; - } - *v /= self->scale; - - return err; -} - -static long next_offset(grib_accessor* a) -{ - return a->offset + a->length; -} diff --git a/src/accessor/todo/grib_accessor_class_to_integer.cc b/src/accessor/todo/grib_accessor_class_to_integer.cc deleted file mode 100644 index 76ce1205d..000000000 --- a/src/accessor/todo/grib_accessor_class_to_integer.cc +++ /dev/null @@ -1,245 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_string;pack_string - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = init;dump;string_length - IMPLEMENTS = value_count - IMPLEMENTS = next_offset - IMPLEMENTS = get_native_type - MEMBERS = const char* key - MEMBERS = long start - MEMBERS = size_t length - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 pack_long(grib_accessor*, const long* val, size_t* len); -static int pack_string(grib_accessor*, const char*, size_t* len); -static int unpack_double(grib_accessor*, double* 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 size_t string_length(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_to_integer -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in to_integer */ - const char* key; - long start; - size_t length; -} grib_accessor_to_integer; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_to_integer = { - &grib_accessor_class_gen, /* super */ - "to_integer", /* name */ - sizeof(grib_accessor_to_integer), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_to_integer = &_grib_accessor_class_to_integer; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_to_integer* self = (grib_accessor_to_integer*)a; - - self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); - self->start = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); - self->length = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 2); - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length = 0; -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_to_integer* self = (grib_accessor_to_integer*)a; - size_t size = 0; - - int err = grib_get_size(grib_handle_of_accessor(a), self->key, &size); - *count = size; - - return err; -} - -static size_t string_length(grib_accessor* a) -{ - grib_accessor_to_integer* self = (grib_accessor_to_integer*)a; - size_t size = 0; - - if (self->length) - return self->length; - - grib_get_string_length(grib_handle_of_accessor(a), self->key, &size); - return size; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_to_integer* self = (grib_accessor_to_integer*)a; - - int err = 0; - char buff[512] = {0,}; - size_t size = 512; - - size_t length = string_length(a); - - if (*len < length + 1) { - const char* cclass_name = a->cclass->name; - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, length+1, *len); - *len = length + 1; - return GRIB_BUFFER_TOO_SMALL; - } - - err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); - if (err) - return err; - if (length > size) { - /*err=GRIB_STRING_TOO_SMALL;*/ - length = size; - } - - memcpy(val, buff + self->start, length); - - val[length] = 0; - *len = length; - return GRIB_SUCCESS; -} - -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static int pack_long(grib_accessor* a, const long* v, size_t* len) -{ - grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as an integer", a->name); - return GRIB_NOT_IMPLEMENTED; -} - -static int pack_double(grib_accessor* a, const double* v, size_t* len) -{ - grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as a double", a->name); - return GRIB_NOT_IMPLEMENTED; -} - -static int unpack_long(grib_accessor* a, long* v, size_t* len) -{ - char val[1024] = {0,}; - size_t l = sizeof(val); - char* last = NULL; - int err = unpack_string(a, val, &l); - - if (err) - return err; - - *v = strtol(val, &last, 10); - /* if (*last) {err=GRIB_WRONG_CONVERSION;} */ - - return GRIB_SUCCESS; -} - -static int unpack_double(grib_accessor* a, double* v, size_t* len) -{ - size_t l = 1; - long val = 0; - int err = unpack_long(a, &val, &l); - - *v = (double)val; - return err; -} - -static long next_offset(grib_accessor* a) -{ - return a->offset + a->length; -} diff --git a/src/accessor/todo/grib_accessor_class_to_string.cc b/src/accessor/todo/grib_accessor_class_to_string.cc deleted file mode 100644 index 648edd1aa..000000000 --- a/src/accessor/todo/grib_accessor_class_to_string.cc +++ /dev/null @@ -1,227 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_string - IMPLEMENTS = unpack_long - IMPLEMENTS = unpack_double - IMPLEMENTS = init;dump;string_length - IMPLEMENTS = value_count - IMPLEMENTS = next_offset - IMPLEMENTS = get_native_type - MEMBERS = const char* key - MEMBERS = long start - MEMBERS = size_t length - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_double(grib_accessor*, double* 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 size_t string_length(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_to_string -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in to_string */ - const char* key; - long start; - size_t length; -} grib_accessor_to_string; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_to_string = { - &grib_accessor_class_gen, /* super */ - "to_string", /* name */ - sizeof(grib_accessor_to_string), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_to_string = &_grib_accessor_class_to_string; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_to_string* self = (grib_accessor_to_string*)a; - - self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); - self->start = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); - self->length = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 2); - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length = 0; -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_to_string* self = (grib_accessor_to_string*)a; - size_t size = 0; - - int err = grib_get_size(grib_handle_of_accessor(a), self->key, &size); - *count = size; - - return err; -} - -static size_t string_length(grib_accessor* a) -{ - grib_accessor_to_string* self = (grib_accessor_to_string*)a; - - if (self->length) - return self->length; - - size_t size = 0; - grib_get_string_length(grib_handle_of_accessor(a), self->key, &size); - return size; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_string(dumper, a, NULL); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_to_string* self = (grib_accessor_to_string*)a; - - int err = 0; - char buff[512] = {0,}; - - size_t length = string_length(a); - - if (*len < length + 1) { - const char* cclass_name = a->cclass->name; - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, length+1, *len); - *len = length + 1; - return GRIB_BUFFER_TOO_SMALL; - } - - size_t size = sizeof(buff); - err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); - if (err) - return err; - if (length > size) { - /*err=GRIB_STRING_TOO_SMALL;*/ - length = size; - } - - memcpy(val, buff + self->start, length); - - val[length] = 0; - *len = length; - return GRIB_SUCCESS; -} - -static int unpack_long(grib_accessor* a, long* v, size_t* len) -{ - char val[1024] = {0,}; - size_t l = sizeof(val); - char* last = NULL; - int err = unpack_string(a, val, &l); - - if (err) - return err; - - *v = strtol(val, &last, 10); - if (*last) { - err = GRIB_WRONG_CONVERSION; - } - - return err; -} - -static int unpack_double(grib_accessor* a, double* v, size_t* len) -{ - size_t l = 1; - long val = 0; - int err = unpack_long(a, &val, &l); - - *v = (double)val; - return err; -} - -static long next_offset(grib_accessor* a) -{ - return a->offset + a->length; -} diff --git a/src/accessor/todo/grib_accessor_class_transient_darray.cc b/src/accessor/todo/grib_accessor_class_transient_darray.cc deleted file mode 100644 index ba830849a..000000000 --- a/src/accessor/todo/grib_accessor_class_transient_darray.cc +++ /dev/null @@ -1,214 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = unpack_long;pack_long;destroy - IMPLEMENTS = init;dump;value_count - IMPLEMENTS = get_native_type - MEMBERS=grib_darray* arr - MEMBERS=int type; - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_transient_darray -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in transient_darray */ - grib_darray* arr; - int type; -} grib_accessor_transient_darray; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_transient_darray = { - &grib_accessor_class_gen, /* super */ - "transient_darray", /* name */ - sizeof(grib_accessor_transient_darray), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_transient_darray = &_grib_accessor_class_transient_darray; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long length, grib_arguments* args) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - self->arr = NULL; - self->type = GRIB_TYPE_DOUBLE; - a->length = 0; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_double(dumper, a, NULL); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - - if (self->arr) - grib_darray_delete(a->context, self->arr); - self->arr = grib_darray_new(a->context, *len, 10); - - for (size_t i = 0; i < *len; i++) - grib_darray_push(a->context, self->arr, val[i]); - - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - - if (self->arr) - grib_darray_delete(a->context, self->arr); - self->arr = grib_darray_new(a->context, *len, 10); - - for (size_t i = 0; i < *len; i++) - grib_darray_push(a->context, self->arr, (double)val[i]); - - return GRIB_SUCCESS; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - long count = 0; - - value_count(a, &count); - - if (*len < count) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s (setting %ld, required %ld) ", a->name, *len, count); - return GRIB_ARRAY_TOO_SMALL; - } - - *len = count; - for (size_t i = 0; i < *len; i++) - val[i] = self->arr->v[i]; - - return GRIB_SUCCESS; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - long count = 0; - - value_count(a, &count); - - if (*len < count) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s (setting %ld, required %ld) ", a->name, *len, count); - return GRIB_ARRAY_TOO_SMALL; - } - - *len = count; - for (size_t i = 0; i < *len; i++) - val[i] = (long)self->arr->v[i]; - - return GRIB_SUCCESS; -} - -static void destroy(grib_context* c, grib_accessor* a) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - if (self->arr) - grib_darray_delete(a->context, self->arr); -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - if (self->arr) - *count = grib_darray_used_size(self->arr); - else - *count = 0; - - return 0; -} - -static int get_native_type(grib_accessor* a) -{ - const grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - return self->type; -} diff --git a/src/accessor/todo/grib_accessor_class_trim.cc b/src/accessor/todo/grib_accessor_class_trim.cc deleted file mode 100644 index 21948ab82..000000000 --- a/src/accessor/todo/grib_accessor_class_trim.cc +++ /dev/null @@ -1,170 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_ascii - IMPLEMENTS = unpack_string;pack_string - IMPLEMENTS = init; string_length - MEMBERS= const char* input - MEMBERS= int trim_left - MEMBERS= int trim_right - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_string(grib_accessor*, const char*, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static size_t string_length(grib_accessor*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_trim -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in ascii */ - /* Members defined in trim */ - const char* input; - int trim_left; - int trim_right; -} grib_accessor_trim; - -extern grib_accessor_class* grib_accessor_class_ascii; - -static grib_accessor_class _grib_accessor_class_trim = { - &grib_accessor_class_ascii, /* super */ - "trim", /* name */ - sizeof(grib_accessor_trim), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_trim = &_grib_accessor_class_trim; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* arg) -{ - int n = 0; - grib_accessor_trim* self = (grib_accessor_trim*)a; - grib_handle* h = grib_handle_of_accessor(a); - - self->input = grib_arguments_get_name(h, arg, n++); - self->trim_left = grib_arguments_get_long(h, arg, n++); - self->trim_right= grib_arguments_get_long(h, arg, n++); - DEBUG_ASSERT(self->trim_left == 0 || self->trim_left == 1); - DEBUG_ASSERT(self->trim_right == 0 || self->trim_right == 1); -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_trim* self = (grib_accessor_trim*)a; - - int err = 0; - grib_handle* h = grib_handle_of_accessor(a); - char input[256] = {0,}; - size_t size = sizeof(input) / sizeof(*input); - char* pInput = input; - - err = grib_get_string(h, self->input, input, &size); - if (err) return err; - - string_lrtrim(&pInput, self->trim_left, self->trim_right); - snprintf(val, 1024, "%s", pInput); - size = strlen(val); - *len = size + 1; - return GRIB_SUCCESS; -} - -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - char input[256] = {0,}; - - size_t inputLen = 256; - char buf[256] = {0,}; - char* pBuf = NULL; - int err; - grib_handle* h = grib_handle_of_accessor(a); - grib_accessor_trim* self = (grib_accessor_trim*)a; - grib_accessor* inputAccesstor = grib_find_accessor(h, self->input); - if (!inputAccesstor) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor for %s not found", self->input); - return GRIB_NOT_FOUND; - } - - if ((err = grib_get_string(h, self->input, input, &inputLen)) != GRIB_SUCCESS) - return err; - - snprintf(buf, sizeof(buf), "%s", val); - pBuf = buf; - string_lrtrim(&pBuf, self->trim_left, self->trim_right); - - return grib_pack_string(inputAccesstor, pBuf, len); -} - -static size_t string_length(grib_accessor* a) -{ - return 1024; -} diff --git a/src/accessor/todo/grib_accessor_class_uint16.cc b/src/accessor/todo/grib_accessor_class_uint16.cc deleted file mode 100644 index 4bac26b59..000000000 --- a/src/accessor/todo/grib_accessor_class_uint16.cc +++ /dev/null @@ -1,118 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long - IMPLEMENTS = get_native_type - END_CLASS_DEF - -*/ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val, size_t* len); - -typedef struct grib_accessor_uint16 -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in uint16 */ -} grib_accessor_uint16; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_uint16 = { - &grib_accessor_class_gen, /* super */ - "uint16", /* name */ - sizeof(grib_accessor_uint16), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_uint16 = &_grib_accessor_class_uint16; - -/* END_CLASS_IMP */ - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - long value = 0; - /*long pos = a->offset;*/ - /*unsigned char* data = grib_handle_of_accessor(a)->buffer->data;*/ - - if (*len < 1) { - return GRIB_ARRAY_TOO_SMALL; - } - - *val = value; - *len = 1; - return GRIB_NOT_IMPLEMENTED; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_uint32.cc b/src/accessor/todo/grib_accessor_class_uint32.cc deleted file mode 100644 index b45b7451f..000000000 --- a/src/accessor/todo/grib_accessor_class_uint32.cc +++ /dev/null @@ -1,118 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long - IMPLEMENTS = get_native_type - END_CLASS_DEF - -*/ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val, size_t* len); - -typedef struct grib_accessor_uint32 -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in uint32 */ -} grib_accessor_uint32; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_uint32 = { - &grib_accessor_class_gen, /* super */ - "uint32", /* name */ - sizeof(grib_accessor_uint32), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_uint32 = &_grib_accessor_class_uint32; - -/* END_CLASS_IMP */ - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - long value = 0; - /* long pos = a->offset; */ - /* unsigned char* data = grib_handle_of_accessor(a)->buffer->data; */ - - if (*len < 1) { - return GRIB_ARRAY_TOO_SMALL; - } - - *val = value; - *len = 1; - return GRIB_NOT_IMPLEMENTED; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_uint32_little_endian.cc b/src/accessor/todo/grib_accessor_class_uint32_little_endian.cc deleted file mode 100644 index 3e39e0586..000000000 --- a/src/accessor/todo/grib_accessor_class_uint32_little_endian.cc +++ /dev/null @@ -1,118 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long - IMPLEMENTS = get_native_type - END_CLASS_DEF - -*/ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val, size_t* len); - -typedef struct grib_accessor_uint32_little_endian -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in uint32_little_endian */ -} grib_accessor_uint32_little_endian; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_uint32_little_endian = { - &grib_accessor_class_gen, /* super */ - "uint32_little_endian", /* name */ - sizeof(grib_accessor_uint32_little_endian), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_uint32_little_endian = &_grib_accessor_class_uint32_little_endian; - -/* END_CLASS_IMP */ - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - long value = 0; - /* long pos = a->offset; */ - /* unsigned char* data = grib_handle_of_accessor(a)->buffer->data; */ - - if (*len < 1) { - return GRIB_ARRAY_TOO_SMALL; - } - - *val = value; - *len = 1; - return GRIB_NOT_IMPLEMENTED; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_uint64.cc b/src/accessor/todo/grib_accessor_class_uint64.cc deleted file mode 100644 index 20bd7e194..000000000 --- a/src/accessor/todo/grib_accessor_class_uint64.cc +++ /dev/null @@ -1,134 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long - IMPLEMENTS = get_native_type - END_CLASS_DEF - -*/ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val, size_t* len); - -typedef struct grib_accessor_uint64 -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in uint64 */ -} grib_accessor_uint64; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_uint64 = { - &grib_accessor_class_gen, /* super */ - "uint64", /* name */ - sizeof(grib_accessor_uint64), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_uint64 = &_grib_accessor_class_uint64; - -/* END_CLASS_IMP */ - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - long value = 0; - long pos = a->offset; - unsigned char* data = grib_handle_of_accessor(a)->buffer->data; - unsigned long long result = 0, tmp; - int i; - - if (*len < 1) { - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < 8; i++) { - result <<= 8; - result |= data[pos + i]; - } - - value = result; - tmp = value; - - /* Result does not fit in long */ - if (tmp != result) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name, result); - return GRIB_DECODING_ERROR; - } - - *val = value; - *len = 1; - return GRIB_SUCCESS; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_uint64_little_endian.cc b/src/accessor/todo/grib_accessor_class_uint64_little_endian.cc deleted file mode 100644 index 0553aefbf..000000000 --- a/src/accessor/todo/grib_accessor_class_uint64_little_endian.cc +++ /dev/null @@ -1,134 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long - IMPLEMENTS = get_native_type - END_CLASS_DEF - -*/ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val, size_t* len); - -typedef struct grib_accessor_uint64_little_endian -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in uint64_little_endian */ -} grib_accessor_uint64_little_endian; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_uint64_little_endian = { - &grib_accessor_class_gen, /* super */ - "uint64_little_endian", /* name */ - sizeof(grib_accessor_uint64_little_endian), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_uint64_little_endian = &_grib_accessor_class_uint64_little_endian; - -/* END_CLASS_IMP */ - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - long value = 0; - long pos = a->offset; - unsigned char* data = grib_handle_of_accessor(a)->buffer->data; - unsigned long long result = 0, tmp; - int i; - - if (*len < 1) { - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 7; i >= 0; i--) { - result <<= 8; - result |= data[pos + i]; - } - - value = result; - tmp = value; - - /* Result does not fit in long */ - if (tmp != result) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name, result); - return GRIB_DECODING_ERROR; - } - - *val = value; - *len = 1; - return GRIB_SUCCESS; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_uint8.cc b/src/accessor/todo/grib_accessor_class_uint8.cc deleted file mode 100644 index 3f4195eff..000000000 --- a/src/accessor/todo/grib_accessor_class_uint8.cc +++ /dev/null @@ -1,120 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long - IMPLEMENTS = get_native_type - END_CLASS_DEF - -*/ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val, size_t* len); - -typedef struct grib_accessor_uint8 -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in uint8 */ -} grib_accessor_uint8; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_uint8 = { - &grib_accessor_class_gen, /* super */ - "uint8", /* name */ - sizeof(grib_accessor_uint8), /* size */ - 0, /* inited */ - 0, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_uint8 = &_grib_accessor_class_uint8; - -/* END_CLASS_IMP */ - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - long value = 0; - long pos = a->offset; - unsigned char* data = grib_handle_of_accessor(a)->buffer->data; - - if (*len < 1) { - return GRIB_ARRAY_TOO_SMALL; - } - - value = data[pos]; - - *val = value; - *len = 1; - return GRIB_SUCCESS; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/accessor/todo/grib_accessor_class_unexpanded_descriptors.cc b/src/accessor/todo/grib_accessor_class_unexpanded_descriptors.cc deleted file mode 100644 index a026388f2..000000000 --- a/src/accessor/todo/grib_accessor_class_unexpanded_descriptors.cc +++ /dev/null @@ -1,236 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init - IMPLEMENTS = next_offset - IMPLEMENTS = value_count - IMPLEMENTS = byte_offset - IMPLEMENTS = update_size - MEMBERS = grib_accessor* unexpandedDescriptorsEncoded - MEMBERS = const char* createNewData - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static long byte_offset(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); - -typedef struct grib_accessor_unexpanded_descriptors -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unexpanded_descriptors */ - grib_accessor* unexpandedDescriptorsEncoded; - const char* createNewData; -} grib_accessor_unexpanded_descriptors; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_unexpanded_descriptors = { - &grib_accessor_class_long, /* super */ - "unexpanded_descriptors", /* name */ - sizeof(grib_accessor_unexpanded_descriptors), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - &next_offset, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_unexpanded_descriptors = &_grib_accessor_class_unexpanded_descriptors; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_unexpanded_descriptors* self = (grib_accessor_unexpanded_descriptors*)a; - int n = 0; - grib_handle* hand = grib_handle_of_accessor(a); - self->unexpandedDescriptorsEncoded = grib_find_accessor(hand, grib_arguments_get_name(hand, args, n++)); - self->createNewData = grib_arguments_get_name(hand, args, n++); - a->length = 0; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_unexpanded_descriptors* self = (grib_accessor_unexpanded_descriptors*)a; - int ret = 0; - long pos = 0; - long rlen = 0; - long f, x, y; - long* v = val; - long i; - grib_handle* hand = grib_handle_of_accessor(a); - - pos = accessor_raw_get_offset(self->unexpandedDescriptorsEncoded) * 8; - - ret = value_count(a, &rlen); - if (ret) - return ret; - - if (rlen == 0) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "No descriptors in section 3. Malformed message."); - return GRIB_MESSAGE_MALFORMED; - } - - if (*len < rlen) { - /* grib_context_log(a->context, GRIB_LOG_ERROR, */ - /* " wrong size (%ld) for %s it contains %d values ",*len, a->name , rlen); */ - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < rlen; i++) { - f = grib_decode_unsigned_long(hand->buffer->data, &pos, 2); - x = grib_decode_unsigned_long(hand->buffer->data, &pos, 6); - y = grib_decode_unsigned_long(hand->buffer->data, &pos, 8); - *v++ = f * 100000 + x * 1000 + y; - } - *len = rlen; - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_unexpanded_descriptors* self = (grib_accessor_unexpanded_descriptors*)a; - int ret = 0; - long pos = 0; - unsigned long f, x, y; - unsigned char* buf = NULL; - grib_accessor* expanded = NULL; - size_t buflen = *len * 2; - size_t i = 0, length = *len; - long createNewData = 1; - grib_handle* hand = grib_handle_of_accessor(a); - - grib_get_long(hand, self->createNewData, &createNewData); - - buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen); - - for (i = 0; i < length; i++) { - const long tmp = val[i] % 100000; - f = val[i] / 100000; - x = tmp / 1000; - y = tmp % 1000; - grib_encode_unsigned_longb(buf, f, &pos, 2); - grib_encode_unsigned_longb(buf, x, &pos, 6); - grib_encode_unsigned_longb(buf, y, &pos, 8); - } - - grib_pack_bytes(self->unexpandedDescriptorsEncoded, buf, &buflen); - grib_context_free(hand->context, buf); - - if (createNewData == 0) - return ret; - - expanded = grib_find_accessor(hand, "expandedCodes"); - Assert(expanded != NULL); - ret = grib_accessor_class_expanded_descriptors_set_do_expand(expanded, 1); - if (ret != GRIB_SUCCESS) - return ret; - - ret = grib_set_long(hand, "unpack", 3); /* BUFR new data */ - if (ret != GRIB_SUCCESS) - return ret; - - ret = grib_set_long(hand, "unpack", 1); /* Unpack structure */ - - return ret; -} - -static int value_count(grib_accessor* a, long* numberOfUnexpandedDescriptors) -{ - grib_accessor_unexpanded_descriptors* self = (grib_accessor_unexpanded_descriptors*)a; - long n = 0; - - grib_value_count(self->unexpandedDescriptorsEncoded, &n); - *numberOfUnexpandedDescriptors = n / 2; - - return 0; -} - -static long byte_offset(grib_accessor* a) -{ - return a->offset; -} - -static void update_size(grib_accessor* a, size_t s) -{ - a->length = s; -} - -static long next_offset(grib_accessor* a) -{ - return byte_offset(a) + a->length; -} diff --git a/src/accessor/todo/grib_accessor_class_unpack_bufr_values.cc b/src/accessor/todo/grib_accessor_class_unpack_bufr_values.cc deleted file mode 100644 index cac0cdfd7..000000000 --- a/src/accessor/todo/grib_accessor_class_unpack_bufr_values.cc +++ /dev/null @@ -1,207 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;dump - IMPLEMENTS = unpack_string;unpack_string_array;unpack_long; unpack_double - IMPLEMENTS = pack_long; pack_double - IMPLEMENTS = value_count; destroy; get_native_type; - MEMBERS = grib_accessor* data_accessor - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_double(grib_accessor*, double* 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 int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_unpack_bufr_values -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in unpack_bufr_values */ - grib_accessor* data_accessor; -} grib_accessor_unpack_bufr_values; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_unpack_bufr_values = { - &grib_accessor_class_gen, /* super */ - "unpack_bufr_values", /* name */ - sizeof(grib_accessor_unpack_bufr_values), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - &unpack_string_array, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_unpack_bufr_values = &_grib_accessor_class_unpack_bufr_values; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* params) -{ - char* key; - grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), params, 0); - self->data_accessor = grib_find_accessor(grib_handle_of_accessor(a), key); - - a->length = 0; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ -} - -static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) -{ - grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; - - return grib_unpack_double(data, 0, 0); -} - -static int unpack_string(grib_accessor* a, char* buffer, size_t* len) -{ - grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; - strcpy(buffer, "0"); - *len=1; - - return grib_unpack_double(data, 0, 0); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; - - return grib_unpack_double(data, 0, 0); -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; - - return grib_unpack_double(data, 0, 0); -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static void destroy(grib_context* context, grib_accessor* a) -{ -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} - -// static const char* mode_to_str(int p) -// { -// if (p==CODES_BUFR_UNPACK_STRUCTURE) return "CODES_BUFR_UNPACK_STRUCTURE"; -// if (p==CODES_BUFR_UNPACK_FLAT) return "CODES_BUFR_UNPACK_FLAT"; -// if (p==CODES_BUFR_NEW_DATA) return "CODES_BUFR_NEW_DATA"; -// return "unknown proc flag"; -// } - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - int unpackMode = CODES_BUFR_UNPACK_STRUCTURE; - grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; - - if (*val == 2) - unpackMode = CODES_BUFR_UNPACK_FLAT; - if (*val == 3) - unpackMode = CODES_BUFR_NEW_DATA; - - accessor_bufr_data_array_set_unpackMode(data, unpackMode); - - return grib_unpack_double(data, 0, 0); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; - - return grib_unpack_double(data, 0, 0); -} diff --git a/src/accessor/todo/grib_accessor_class_unsigned_bits.cc b/src/accessor/todo/grib_accessor_class_unsigned_bits.cc deleted file mode 100644 index 38c3425cf..000000000 --- a/src/accessor/todo/grib_accessor_class_unsigned_bits.cc +++ /dev/null @@ -1,265 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init - IMPLEMENTS = next_offset - IMPLEMENTS = byte_count - IMPLEMENTS = value_count - IMPLEMENTS = byte_offset - IMPLEMENTS = update_size - MEMBERS = const char* numberOfBits - MEMBERS = const char* numberOfElements - - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static long byte_count(grib_accessor*); -static long byte_offset(grib_accessor*); -static long next_offset(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); - -typedef struct grib_accessor_unsigned_bits -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in unsigned_bits */ - const char* numberOfBits; - const char* numberOfElements; -} grib_accessor_unsigned_bits; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_unsigned_bits = { - &grib_accessor_class_long, /* super */ - "unsigned_bits", /* name */ - sizeof(grib_accessor_unsigned_bits), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - &next_offset, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_unsigned_bits = &_grib_accessor_class_unsigned_bits; - -/* END_CLASS_IMP */ - - -static long compute_byte_count(grib_accessor* a) -{ - grib_accessor_unsigned_bits* self = (grib_accessor_unsigned_bits*)a; - long numberOfBits; - long numberOfElements; - int ret = 0; - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); - if (ret) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s unable to get %s to compute size", a->name, self->numberOfBits); - return 0; - } - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, &numberOfElements); - if (ret) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s unable to get %s to compute size", a->name, self->numberOfElements); - return 0; - } - - return (numberOfBits * numberOfElements + 7) / 8; -} - - -static void init(grib_accessor* a, const long len, grib_arguments* args) -{ - grib_accessor_unsigned_bits* self = (grib_accessor_unsigned_bits*)a; - int n = 0; - self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->numberOfElements = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - a->length = compute_byte_count(a); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_unsigned_bits* self = (grib_accessor_unsigned_bits*)a; - int ret = 0; - long pos = a->offset * 8; - long rlen = 0; - long numberOfBits = 0; - - ret = value_count(a, &rlen); - if (ret) - return ret; - - if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "Wrong size (%ld) for %s, it contains %ld values", *len, a->name, rlen); - *len = rlen; - return GRIB_ARRAY_TOO_SMALL; - } - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); - if (ret) - return ret; - if (numberOfBits == 0) { - int i; - for (i = 0; i < rlen; i++) - val[i] = 0; - return GRIB_SUCCESS; - } - - grib_decode_long_array(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits, rlen, val); - - *len = rlen; - - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_unsigned_bits* self = (grib_accessor_unsigned_bits*)a; - int ret = 0; - long off = 0; - long numberOfBits = 0; - size_t buflen = 0; - unsigned char* buf = NULL; - unsigned long i = 0; - long rlen = 0; - ret = value_count(a, &rlen); - if (ret) return ret; - - /* - if(*len < rlen) - { - grib_context_log(a->context, GRIB_LOG_ERROR, - "Wrong size for %s it contains %d values ", a->name , rlen ); - return GRIB_ARRAY_TOO_SMALL; - } - */ - if (*len != rlen) - ret = grib_set_long(grib_handle_of_accessor(a), self->numberOfElements, *len); - if (ret) return ret; - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); - if (ret) return ret; - if (numberOfBits == 0) { - grib_buffer_replace(a, NULL, 0, 1, 1); - return GRIB_SUCCESS; - } - - buflen = compute_byte_count(a); - buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen + sizeof(long)); - - for (i = 0; i < *len; i++) - grib_encode_unsigned_longb(buf, val[i], &off, numberOfBits); - - grib_buffer_replace(a, buf, buflen, 1, 1); - - grib_context_free(a->context, buf); - - return ret; -} - -static long byte_count(grib_accessor* a) -{ - return a->length; -} - -static int value_count(grib_accessor* a, long* numberOfElements) -{ - grib_accessor_unsigned_bits* self = (grib_accessor_unsigned_bits*)a; - int ret; - *numberOfElements = 0; - - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, numberOfElements); - if (ret) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s unable to get %s to compute size", a->name, self->numberOfElements); - } - - return ret; -} - -static long byte_offset(grib_accessor* a) -{ - return a->offset; -} - -static void update_size(grib_accessor* a, size_t s) -{ - a->length = s; -} - -static long next_offset(grib_accessor* a) -{ - return byte_offset(a) + a->length; -} diff --git a/src/accessor/todo/grib_accessor_class_validity_date.cc b/src/accessor/todo/grib_accessor_class_validity_date.cc deleted file mode 100644 index 760b7bccd..000000000 --- a/src/accessor/todo/grib_accessor_class_validity_date.cc +++ /dev/null @@ -1,229 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = init - MEMBERS=const char* date - MEMBERS=const char* time - MEMBERS=const char* step - MEMBERS=const char* stepUnits - MEMBERS=const char* year - MEMBERS=const char* month - MEMBERS=const char* day - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_validity_date -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in validity_date */ - const char* date; - const char* time; - const char* step; - const char* stepUnits; - const char* year; - const char* month; - const char* day; -} grib_accessor_validity_date; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_validity_date = { - &grib_accessor_class_long, /* super */ - "validity_date", /* name */ - sizeof(grib_accessor_validity_date), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_validity_date = &_grib_accessor_class_validity_date; - -/* END_CLASS_IMP */ - -/* Table of multipliers to convert step units to minutes */ -static const double u2m[] = { - 1, /* index 0: minutes */ - 60, /* index 1: hour */ - 24 * 60, /* index 2: day */ - 24 * 60 * 30, /* index 3: month */ - -1, /* index 4: year */ - -1, /* index 5: decade */ - -1, /* index 6: 30 years */ - -1, /* index 7: century */ - -1, /* index 8: RESERVED */ - -1, /* index 9: RESERVED */ - 3 * 60, /* index 10: 3 hours */ - 6 * 60, /* index 11: 6 hours */ - 12 * 60, /* index 12: 12 hours */ - 1 / 60.0, /* index 13: seconds */ - 15, /* index 14: 15 mins */ - 30 /* index 15: 30 mins */ -}; - -static long convert_to_minutes(long step, long stepUnits) -{ - double result = 0; - if (stepUnits == 0) - return step; /* unit=minutes so no change */ - if (stepUnits == 1) - return step * 60; /* unit=hours */ - if (stepUnits == 13) - return step / 60; /* unit=seconds */ - /* Assert( stepUnits < sizeof(u2m)/sizeof(u2m[0]) ); */ - - result = step * u2m[stepUnits]; - return (long)result; -} - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_validity_date* self = (grib_accessor_validity_date*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; - - self->date = grib_arguments_get_name(hand, c, n++); - self->time = grib_arguments_get_name(hand, c, n++); - self->step = grib_arguments_get_name(hand, c, n++); - self->stepUnits = grib_arguments_get_name(hand, c, n++); - self->year = grib_arguments_get_name(hand, c, n++); - self->month = grib_arguments_get_name(hand, c, n++); - self->day = grib_arguments_get_name(hand, c, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_validity_date* self = (grib_accessor_validity_date*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret = 0; - long date = 0; - long time = 0; - long step = 0; - long stepUnits = 0; - long hours = 0, minutes = 0, step_mins = 0, tmp, tmp_hrs; - - if (self->year) { - long year, month, day; - if ((ret = grib_get_long_internal(hand, self->year, &year)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(hand, self->month, &month)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(hand, self->day, &day)) != GRIB_SUCCESS) - return ret; - *val = year * 10000 + month * 100 + day; - return GRIB_SUCCESS; - } - if ((ret = grib_get_long_internal(hand, self->date, &date)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(hand, self->time, &time)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long(hand, self->step, &step)) != GRIB_SUCCESS) { - if ((ret = grib_get_long_internal(hand, "endStep", &step)) != GRIB_SUCCESS) { - return ret; /* See ECC-817 */ - } - } - - if (self->stepUnits) { - if ((ret = grib_get_long_internal(hand, self->stepUnits, &stepUnits)) != GRIB_SUCCESS) - return ret; - step_mins = convert_to_minutes(step, stepUnits); - } - - minutes = time % 100; - hours = time / 100; - tmp = minutes + step_mins; /* add the step to our minutes */ - tmp_hrs = tmp / 60; /* how many hours and mins is that? */ - hours += tmp_hrs; /* increment hours */ - - date = grib_date_to_julian(date); - /* does the new 'hours' exceed 24? if so increment julian */ - while (hours >= 24) { - date++; - hours -= 24; - } - /* GRIB-29: Negative forecast time */ - while (hours < 0) { - date--; - hours += 24; - } - - if (*len < 1) - return GRIB_ARRAY_TOO_SMALL; - - *val = grib_julian_to_date(date); - - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_validity_time.cc b/src/accessor/todo/grib_accessor_class_validity_time.cc deleted file mode 100644 index 34eb78128..000000000 --- a/src/accessor/todo/grib_accessor_class_validity_time.cc +++ /dev/null @@ -1,249 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long - IMPLEMENTS = unpack_string - IMPLEMENTS = init - MEMBERS=const char* date - MEMBERS=const char* time - MEMBERS=const char* step - MEMBERS=const char* stepUnits - MEMBERS=const char* hours - MEMBERS=const char* minutes - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_validity_time -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in long */ - /* Members defined in validity_time */ - const char* date; - const char* time; - const char* step; - const char* stepUnits; - const char* hours; - const char* minutes; -} grib_accessor_validity_time; - -extern grib_accessor_class* grib_accessor_class_long; - -static grib_accessor_class _grib_accessor_class_validity_time = { - &grib_accessor_class_long, /* super */ - "validity_time", /* name */ - sizeof(grib_accessor_validity_time), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_validity_time = &_grib_accessor_class_validity_time; - -/* END_CLASS_IMP */ - -/* Table of multipliers to convert step units to minutes */ -static const double u2m[] = { - 1, /* index 0: minutes */ - 60, /* index 1: hour */ - 24 * 60, /* index 2: day */ - 24 * 60 * 30, /* index 3: month */ - -1, /* index 4: year */ - -1, /* index 5: decade */ - -1, /* index 6: 30 years */ - -1, /* index 7: century */ - -1, /* index 8: RESERVED */ - -1, /* index 9: RESERVED */ - 3 * 60, /* index 10: 3 hours */ - 6 * 60, /* index 11: 6 hours */ - 12 * 60, /* index 12: 12 hours */ - 1 / 60.0, /* index 13: seconds */ - 15, /* index 14: 15 mins */ - 30 /* index 15: 30 mins */ -}; - -static long convert_to_minutes(long step, long stepUnits) -{ - double result = 0; - if (stepUnits == 0) - return step; /* unit=minutes so no change */ - if (stepUnits == 1) - return step * 60; /* unit=hours */ - if (stepUnits == 13) - return step / 60; /* unit=seconds*/ - /* Assert( stepUnits < sizeof(u2m)/sizeof(u2m[0]) ); */ - - result = step * u2m[stepUnits]; - return (long)result; -} - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_validity_time* self = (grib_accessor_validity_time*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; - - self->date = grib_arguments_get_name(hand, c, n++); - self->time = grib_arguments_get_name(hand, c, n++); - self->step = grib_arguments_get_name(hand, c, n++); - self->stepUnits = grib_arguments_get_name(hand, c, n++); - self->hours = grib_arguments_get_name(hand, c, n++); - self->minutes = grib_arguments_get_name(hand, c, n++); - - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_validity_time* self = (grib_accessor_validity_time*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret = 0; - long date = 0; - long time = 0; - long step = 0; - long stepUnits = 0; - long hours = 0, minutes = 0, step_mins = 0, tmp, tmp_hrs, tmp_mins; - - if (self->hours) { - if ((ret = grib_get_long_internal(hand, self->hours, &hours)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(hand, self->minutes, &minutes)) != GRIB_SUCCESS) - return ret; - *val = hours * 100 + minutes; - return GRIB_SUCCESS; - } - if ((ret = grib_get_long_internal(hand, self->date, &date)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(hand, self->time, &time)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long(hand, self->step, &step)) != GRIB_SUCCESS) { - if ((ret = grib_get_long_internal(hand, "endStep", &step)) != GRIB_SUCCESS) { - return ret; /* See ECC-817 */ - } - } - - /* Seconds will always be zero. So convert to minutes */ - if (self->stepUnits) { - if ((ret = grib_get_long_internal(hand, self->stepUnits, &stepUnits)) != GRIB_SUCCESS) - return ret; - step_mins = convert_to_minutes(step, stepUnits); - } - - minutes = time % 100; - hours = time / 100; - tmp = minutes + step_mins; /* add the step to our minutes */ - tmp_hrs = tmp / 60; /* how many hours and mins is that? */ - tmp_mins = tmp % 60; - hours += tmp_hrs; /* increment hours */ - if (hours > 0) { - hours = hours % 24; /* wrap round if >= 24 */ - } - else { - /* GRIB-29: Negative forecast time */ - while (hours < 0) { - hours += 24; - } - } - time = hours * 100 + tmp_mins; - - if (*len < 1) - return GRIB_ARRAY_TOO_SMALL; - - *val = time; - - return GRIB_SUCCESS; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - int err = 0; - long v = 0; - size_t lsize = 1, lmin = 5; - - err = unpack_long(a, &v, &lsize); - if (err) return err; - - if (*len < lmin) { - const char* cclass_name = a->cclass->name; - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, lmin, *len); - *len = lmin; - return GRIB_BUFFER_TOO_SMALL; - } - - snprintf(val, 64, "%04ld", v); - - len[0] = lmin; - return GRIB_SUCCESS; -} diff --git a/src/accessor/todo/grib_accessor_class_values.cc b/src/accessor/todo/grib_accessor_class_values.cc deleted file mode 100644 index 384282317..000000000 --- a/src/accessor/todo/grib_accessor_class_values.cc +++ /dev/null @@ -1,259 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init - IMPLEMENTS = dump - IMPLEMENTS = next_offset - IMPLEMENTS = byte_count - IMPLEMENTS = byte_offset - IMPLEMENTS = get_native_type - IMPLEMENTS = update_size - IMPLEMENTS = compare - IMPLEMENTS = pack_long - MEMBERS= int carg - MEMBERS= const char* seclen - MEMBERS= const char* offsetdata - MEMBERS= const char* offsetsection - MEMBERS= int dirty - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static long byte_count(grib_accessor*); -static long byte_offset(grib_accessor*); -static long next_offset(grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); -static int compare(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_values -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -} grib_accessor_values; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_values = { - &grib_accessor_class_gen, /* super */ - "values", /* name */ - sizeof(grib_accessor_values), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_values = &_grib_accessor_class_values; - -/* END_CLASS_IMP */ -static long init_length(grib_accessor* a) -{ - grib_accessor_values* self = (grib_accessor_values*)a; - int ret = 0; - - long seclen = 0; - long offsetsection = 0; - long offsetdata = 0; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->seclen, &seclen))) - return ret; - - if (seclen == 0) { - /* printf("init_length seclen=0\n"); */ - return 0; - } - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetsection, &offsetsection))) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetdata, &offsetdata))) - return ret; - - /* When reparsing */ - if (offsetdata < offsetsection) { - /* printf("init_length offsetdata < offsetsection=0\n"); */ - Assert(grib_handle_of_accessor(a)->loader); - return 0; - } - - return seclen - (offsetdata - offsetsection); -} - -static void init(grib_accessor* a, const long v, grib_arguments* params) -{ - grib_accessor_values* self = (grib_accessor_values*)a; - self->carg = 0; - - self->seclen = grib_arguments_get_name(grib_handle_of_accessor(a), params, self->carg++); - self->offsetdata = grib_arguments_get_name(grib_handle_of_accessor(a), params, self->carg++); - self->offsetsection = grib_arguments_get_name(grib_handle_of_accessor(a), params, self->carg++); - self->dirty = 1; - - a->length = init_length(a); - /* Assert(a->length>=0); */ -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_DOUBLE; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_values(dumper, a); -} - -static long byte_count(grib_accessor* a) -{ - grib_context_log(a->context, GRIB_LOG_DEBUG, "byte_count of %s = %ld", a->name, a->length); - return a->length; -} - -static long byte_offset(grib_accessor* a) -{ - return a->offset; -} - -static long next_offset(grib_accessor* a) -{ - return a->offset + a->length; -} - -static void update_size(grib_accessor* a, size_t s) -{ - grib_context_log(a->context, GRIB_LOG_DEBUG, "updating size of %s old %ld new %ld", a->name, a->length, s); - a->length = s; - Assert(a->length >= 0); -} - -static int compare(grib_accessor* a, grib_accessor* b) -{ - int retval = 0; - double* aval = 0; - double* bval = 0; - - size_t alen = 0; - size_t blen = 0; - int err = 0; - long count = 0; - - err = grib_value_count(a, &count); - if (err) - return err; - alen = count; - - err = grib_value_count(b, &count); - if (err) - return err; - blen = count; - - if (alen != blen) - return GRIB_COUNT_MISMATCH; - - aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); - bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - - grib_unpack_double(a, aval, &alen); - grib_unpack_double(b, bval, &blen); - - retval = GRIB_SUCCESS; - for (size_t i=0; icontext, aval); - grib_context_free(b->context, bval); - - return retval; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_values* self = (grib_accessor_values*)a; - double* dval = (double*)grib_context_malloc(a->context, *len * sizeof(double)); - - for (size_t i = 0; i < *len; i++) - dval[i] = (double)val[i]; - - int ret = grib_pack_double(a, dval, len); - - grib_context_free(a->context, dval); - - self->dirty = 1; - - return ret; -} diff --git a/src/accessor/todo/grib_accessor_class_vector.cc b/src/accessor/todo/grib_accessor_class_vector.cc deleted file mode 100644 index 1cc69a4c7..000000000 --- a/src/accessor/todo/grib_accessor_class_vector.cc +++ /dev/null @@ -1,162 +0,0 @@ -/* - * (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. - */ - -/************************************** - * Enrico Fucile - **************************************/ - - -#include "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_abstract_vector - IMPLEMENTS = init - IMPLEMENTS = unpack_double - MEMBERS = const char* vector - MEMBERS = int index - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int unpack_double(grib_accessor*, double* val, size_t* len); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_vector -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in abstract_vector */ - double* v; - int number_of_elements; - /* Members defined in vector */ - const char* vector; - int index; -} grib_accessor_vector; - -extern grib_accessor_class* grib_accessor_class_abstract_vector; - -static grib_accessor_class _grib_accessor_class_vector = { - &grib_accessor_class_abstract_vector, /* super */ - "vector", /* name */ - sizeof(grib_accessor_vector), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_vector = &_grib_accessor_class_vector; - -/* END_CLASS_IMP */ - -typedef struct grib_accessor_abstract_vector -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in double */ - /* Members defined in abstract_vector */ - double* v; - int number_of_elements; -} grib_accessor_abstract_vector; - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_vector* self = (grib_accessor_vector*)a; - int n = 0; - - self->vector = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->index = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length = 0; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - int err = 0; - size_t size = 0; - double* stat; - grib_accessor_vector* self = (grib_accessor_vector*)a; - grib_accessor* va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); - grib_accessor_abstract_vector* v = (grib_accessor_abstract_vector*)va; - - Assert(self->index >= 0); - - if (self->index >= v->number_of_elements) { - grib_context_log(a->context, GRIB_LOG_FATAL, "index=%d number_of_elements=%d for %s", self->index, v->number_of_elements, a->name); - Assert(self->index < v->number_of_elements); - } - - if (va->dirty) { - grib_get_size(grib_handle_of_accessor(a), self->vector, &size); - stat = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); - err = grib_unpack_double(va, stat, &size); - grib_context_free(a->context, stat); - if (err) - return err; - } - - *val = v->v[self->index]; - - return err; -} diff --git a/src/accessor/todo/grib_accessor_class_when.cc b/src/accessor/todo/grib_accessor_class_when.cc deleted file mode 100644 index 1bf0d999e..000000000 --- a/src/accessor/todo/grib_accessor_class_when.cc +++ /dev/null @@ -1,122 +0,0 @@ -/* - * (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 "grib_api_internal.h" -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = init;dump; - IMPLEMENTS = get_native_type - IMPLEMENTS = notify_change - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static int notify_change(grib_accessor*, grib_accessor*); - -typedef struct grib_accessor_when -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in when */ -} grib_accessor_when; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_when = { - &grib_accessor_class_gen, /* super */ - "when", /* name */ - sizeof(grib_accessor_when), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - 0, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - ¬ify_change, /* 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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_when = &_grib_accessor_class_when; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - /* grib_dump_when(dumper,a,NULL); */ -} - -static int notify_change(grib_accessor* a, grib_accessor* changed) -{ - return grib_action_notify_change(a->creator, a, changed); -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_UNDEFINED; -} diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 30fcd82b0..cf7673e19 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -206,13 +206,6 @@ void grib_viarray_delete_content(grib_context* c, grib_viarray* v); /* grib_accessor_class_bits_per_value.cc*/ /* grib_accessor_class_bufr_data_array.cc*/ -// ===== TODO(maee): Reenable these functions ===== -//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); -// ===== END ===== - /* grib_accessor_class_bufr_data_element.cc*/ void accessor_bufr_data_element_set_index(grib_accessor* a, long index); diff --git a/src/grib_accessor_class.h b/src/grib_accessor_class.h index fd0370719..ceda43659 100644 --- a/src/grib_accessor_class.h +++ b/src/grib_accessor_class.h @@ -1,216 +1,216 @@ #include "grib_api_internal.h" -//extern grib_accessor_class* grib_accessor_class_abstract_long_vector; -//extern grib_accessor_class* grib_accessor_class_abstract_vector; -//extern grib_accessor_class* grib_accessor_class_ascii; -//extern grib_accessor_class* grib_accessor_class_bit; -//extern grib_accessor_class* grib_accessor_class_bitmap; -//extern grib_accessor_class* grib_accessor_class_bits; -//extern grib_accessor_class* grib_accessor_class_bits_per_value; -//extern grib_accessor_class* grib_accessor_class_blob; -//extern grib_accessor_class* grib_accessor_class_budgdate; -//extern grib_accessor_class* grib_accessor_class_bufr_data_array; -//extern grib_accessor_class* grib_accessor_class_bufr_data_element; -//extern grib_accessor_class* grib_accessor_class_bufr_elements_table; -//extern grib_accessor_class* grib_accessor_class_bufr_extract_area_subsets; -//extern grib_accessor_class* grib_accessor_class_bufr_extract_datetime_subsets; -//extern grib_accessor_class* grib_accessor_class_bufr_extract_subsets; -//extern grib_accessor_class* grib_accessor_class_bufr_group; -//extern grib_accessor_class* grib_accessor_class_bufr_simple_thinning; -//extern grib_accessor_class* grib_accessor_class_bufr_string_values; -//extern grib_accessor_class* grib_accessor_class_bufrdc_expanded_descriptors; -//extern grib_accessor_class* grib_accessor_class_bytes; -//extern grib_accessor_class* grib_accessor_class_change_alternative_row_scanning; -//extern grib_accessor_class* grib_accessor_class_change_scanning_direction; -//extern grib_accessor_class* grib_accessor_class_check_internal_version; -//extern grib_accessor_class* grib_accessor_class_closest_date; -//extern grib_accessor_class* grib_accessor_class_codeflag; +extern grib_accessor_class* grib_accessor_class_abstract_long_vector; +extern grib_accessor_class* grib_accessor_class_abstract_vector; +extern grib_accessor_class* grib_accessor_class_ascii; +extern grib_accessor_class* grib_accessor_class_bit; +extern grib_accessor_class* grib_accessor_class_bitmap; +extern grib_accessor_class* grib_accessor_class_bits; +extern grib_accessor_class* grib_accessor_class_bits_per_value; +extern grib_accessor_class* grib_accessor_class_blob; +extern grib_accessor_class* grib_accessor_class_budgdate; +extern grib_accessor_class* grib_accessor_class_bufr_data_array; +extern grib_accessor_class* grib_accessor_class_bufr_data_element; +extern grib_accessor_class* grib_accessor_class_bufr_elements_table; +extern grib_accessor_class* grib_accessor_class_bufr_extract_area_subsets; +extern grib_accessor_class* grib_accessor_class_bufr_extract_datetime_subsets; +extern grib_accessor_class* grib_accessor_class_bufr_extract_subsets; +extern grib_accessor_class* grib_accessor_class_bufr_group; +extern grib_accessor_class* grib_accessor_class_bufr_simple_thinning; +extern grib_accessor_class* grib_accessor_class_bufr_string_values; +extern grib_accessor_class* grib_accessor_class_bufrdc_expanded_descriptors; +extern grib_accessor_class* grib_accessor_class_bytes; +extern grib_accessor_class* grib_accessor_class_change_alternative_row_scanning; +extern grib_accessor_class* grib_accessor_class_change_scanning_direction; +extern grib_accessor_class* grib_accessor_class_check_internal_version; +extern grib_accessor_class* grib_accessor_class_closest_date; +extern grib_accessor_class* grib_accessor_class_codeflag; #include "accessor/grib_accessor_class_codetable.h" extern grib_accessor_class* grib_accessor_class_codetable; -//extern grib_accessor_class* grib_accessor_class_codetable_title; -//extern grib_accessor_class* grib_accessor_class_codetable_units; -//extern grib_accessor_class* grib_accessor_class_concept; +extern grib_accessor_class* grib_accessor_class_codetable_title; +extern grib_accessor_class* grib_accessor_class_codetable_units; +extern grib_accessor_class* grib_accessor_class_concept; #include "accessor/grib_accessor_class_constant.h" extern grib_accessor_class* grib_accessor_class_constant; -//extern grib_accessor_class* grib_accessor_class_count_file; -//extern grib_accessor_class* grib_accessor_class_count_missing; -//extern grib_accessor_class* grib_accessor_class_count_total; -//extern grib_accessor_class* grib_accessor_class_data_apply_bitmap; -//extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic; -//extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic_bitmap; -//extern grib_accessor_class* grib_accessor_class_data_ccsds_packing; -//extern grib_accessor_class* grib_accessor_class_data_complex_packing; -//extern grib_accessor_class* grib_accessor_class_data_dummy_field; -//extern grib_accessor_class* grib_accessor_class_data_g1complex_packing; -//extern grib_accessor_class* grib_accessor_class_data_g1second_order_constant_width_packing; -//extern grib_accessor_class* grib_accessor_class_data_g1second_order_general_extended_packing; -//extern grib_accessor_class* grib_accessor_class_data_g1second_order_general_packing; -//extern grib_accessor_class* grib_accessor_class_data_g1second_order_row_by_row_packing; -//extern grib_accessor_class* grib_accessor_class_data_g1secondary_bitmap; -//extern grib_accessor_class* grib_accessor_class_data_g1shsimple_packing; -//extern grib_accessor_class* grib_accessor_class_data_g1simple_packing; -//extern grib_accessor_class* grib_accessor_class_data_g22order_packing; -//extern grib_accessor_class* grib_accessor_class_data_g2bifourier_packing; -//extern grib_accessor_class* grib_accessor_class_data_g2complex_packing; -//extern grib_accessor_class* grib_accessor_class_data_g2secondary_bitmap; -//extern grib_accessor_class* grib_accessor_class_data_g2shsimple_packing; -//extern grib_accessor_class* grib_accessor_class_data_g2simple_packing; -//extern grib_accessor_class* grib_accessor_class_data_g2simple_packing_with_preprocessing; -//extern grib_accessor_class* grib_accessor_class_data_jpeg2000_packing; -//extern grib_accessor_class* grib_accessor_class_data_png_packing; -//extern grib_accessor_class* grib_accessor_class_data_raw_packing; -//extern grib_accessor_class* grib_accessor_class_data_run_length_packing; -//extern grib_accessor_class* grib_accessor_class_data_secondary_bitmap; -//extern grib_accessor_class* grib_accessor_class_data_sh_packed; -//extern grib_accessor_class* grib_accessor_class_data_sh_unpacked; -//extern grib_accessor_class* grib_accessor_class_data_shsimple_packing; -//extern grib_accessor_class* grib_accessor_class_data_simple_packing; -//extern grib_accessor_class* grib_accessor_class_decimal_precision; -//extern grib_accessor_class* grib_accessor_class_dictionary; -//extern grib_accessor_class* grib_accessor_class_dirty; -//extern grib_accessor_class* grib_accessor_class_divdouble; -//extern grib_accessor_class* grib_accessor_class_double; -//extern grib_accessor_class* grib_accessor_class_element; -//extern grib_accessor_class* grib_accessor_class_evaluate; -//extern grib_accessor_class* grib_accessor_class_expanded_descriptors; -//extern grib_accessor_class* grib_accessor_class_from_scale_factor_scaled_value; -//extern grib_accessor_class* grib_accessor_class_g1_half_byte_codeflag; -//extern grib_accessor_class* grib_accessor_class_g1_message_length; -//extern grib_accessor_class* grib_accessor_class_g1_section4_length; -//extern grib_accessor_class* grib_accessor_class_g1bitmap; -//extern grib_accessor_class* grib_accessor_class_g1date; -//extern grib_accessor_class* grib_accessor_class_g1day_of_the_year_date; -//extern grib_accessor_class* grib_accessor_class_g1end_of_interval_monthly; -//extern grib_accessor_class* grib_accessor_class_g1fcperiod; -//extern grib_accessor_class* grib_accessor_class_g1forecastmonth; -//extern grib_accessor_class* grib_accessor_class_g1monthlydate; -//extern grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_complex; -//extern grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_simple; -//extern grib_accessor_class* grib_accessor_class_g1step_range; -//extern grib_accessor_class* grib_accessor_class_g1verificationdate; -//extern grib_accessor_class* grib_accessor_class_g2_aerosol; -//extern grib_accessor_class* grib_accessor_class_g2_chemical; -//extern grib_accessor_class* grib_accessor_class_g2_eps; -//extern grib_accessor_class* grib_accessor_class_g2_mars_labeling; -//extern grib_accessor_class* grib_accessor_class_g2bitmap; -//extern grib_accessor_class* grib_accessor_class_g2bitmap_present; -//extern grib_accessor_class* grib_accessor_class_g2date; -//extern grib_accessor_class* grib_accessor_class_g2end_step; -//extern grib_accessor_class* grib_accessor_class_g2grid; -//extern grib_accessor_class* grib_accessor_class_g2latlon; -//extern grib_accessor_class* grib_accessor_class_g2level; -//extern grib_accessor_class* grib_accessor_class_g2lon; -//extern grib_accessor_class* grib_accessor_class_g2step_range; -//extern grib_accessor_class* grib_accessor_class_gaussian_grid_name; -//extern grib_accessor_class* grib_accessor_class_gds_is_present; -//extern grib_accessor_class* grib_accessor_class_gds_not_present_bitmap; -//extern grib_accessor_class* grib_accessor_class_gen; -//extern grib_accessor_class* grib_accessor_class_getenv; -//extern grib_accessor_class* grib_accessor_class_global_gaussian; -//extern grib_accessor_class* grib_accessor_class_group; -//extern grib_accessor_class* grib_accessor_class_group_copy; -//extern grib_accessor_class* grib_accessor_class_gts_header; -//extern grib_accessor_class* grib_accessor_class_hash_array; -//extern grib_accessor_class* grib_accessor_class_headers_only; -//extern grib_accessor_class* grib_accessor_class_ibmfloat; -//extern grib_accessor_class* grib_accessor_class_ieeefloat; -//extern grib_accessor_class* grib_accessor_class_ifs_param; +extern grib_accessor_class* grib_accessor_class_count_file; +extern grib_accessor_class* grib_accessor_class_count_missing; +extern grib_accessor_class* grib_accessor_class_count_total; +extern grib_accessor_class* grib_accessor_class_data_apply_bitmap; +extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic; +extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic_bitmap; +extern grib_accessor_class* grib_accessor_class_data_ccsds_packing; +extern grib_accessor_class* grib_accessor_class_data_complex_packing; +extern grib_accessor_class* grib_accessor_class_data_dummy_field; +extern grib_accessor_class* grib_accessor_class_data_g1complex_packing; +extern grib_accessor_class* grib_accessor_class_data_g1second_order_constant_width_packing; +extern grib_accessor_class* grib_accessor_class_data_g1second_order_general_extended_packing; +extern grib_accessor_class* grib_accessor_class_data_g1second_order_general_packing; +extern grib_accessor_class* grib_accessor_class_data_g1second_order_row_by_row_packing; +extern grib_accessor_class* grib_accessor_class_data_g1secondary_bitmap; +extern grib_accessor_class* grib_accessor_class_data_g1shsimple_packing; +extern grib_accessor_class* grib_accessor_class_data_g1simple_packing; +extern grib_accessor_class* grib_accessor_class_data_g22order_packing; +extern grib_accessor_class* grib_accessor_class_data_g2bifourier_packing; +extern grib_accessor_class* grib_accessor_class_data_g2complex_packing; +extern grib_accessor_class* grib_accessor_class_data_g2secondary_bitmap; +extern grib_accessor_class* grib_accessor_class_data_g2shsimple_packing; +extern grib_accessor_class* grib_accessor_class_data_g2simple_packing; +extern grib_accessor_class* grib_accessor_class_data_g2simple_packing_with_preprocessing; +extern grib_accessor_class* grib_accessor_class_data_jpeg2000_packing; +extern grib_accessor_class* grib_accessor_class_data_png_packing; +extern grib_accessor_class* grib_accessor_class_data_raw_packing; +extern grib_accessor_class* grib_accessor_class_data_run_length_packing; +extern grib_accessor_class* grib_accessor_class_data_secondary_bitmap; +extern grib_accessor_class* grib_accessor_class_data_sh_packed; +extern grib_accessor_class* grib_accessor_class_data_sh_unpacked; +extern grib_accessor_class* grib_accessor_class_data_shsimple_packing; +extern grib_accessor_class* grib_accessor_class_data_simple_packing; +extern grib_accessor_class* grib_accessor_class_decimal_precision; +extern grib_accessor_class* grib_accessor_class_dictionary; +extern grib_accessor_class* grib_accessor_class_dirty; +extern grib_accessor_class* grib_accessor_class_divdouble; +extern grib_accessor_class* grib_accessor_class_double; +extern grib_accessor_class* grib_accessor_class_element; +extern grib_accessor_class* grib_accessor_class_evaluate; +extern grib_accessor_class* grib_accessor_class_expanded_descriptors; +extern grib_accessor_class* grib_accessor_class_from_scale_factor_scaled_value; +extern grib_accessor_class* grib_accessor_class_g1_half_byte_codeflag; +extern grib_accessor_class* grib_accessor_class_g1_message_length; +extern grib_accessor_class* grib_accessor_class_g1_section4_length; +extern grib_accessor_class* grib_accessor_class_g1bitmap; +extern grib_accessor_class* grib_accessor_class_g1date; +extern grib_accessor_class* grib_accessor_class_g1day_of_the_year_date; +extern grib_accessor_class* grib_accessor_class_g1end_of_interval_monthly; +extern grib_accessor_class* grib_accessor_class_g1fcperiod; +extern grib_accessor_class* grib_accessor_class_g1forecastmonth; +extern grib_accessor_class* grib_accessor_class_g1monthlydate; +extern grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_complex; +extern grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_simple; +extern grib_accessor_class* grib_accessor_class_g1step_range; +extern grib_accessor_class* grib_accessor_class_g1verificationdate; +extern grib_accessor_class* grib_accessor_class_g2_aerosol; +extern grib_accessor_class* grib_accessor_class_g2_chemical; +extern grib_accessor_class* grib_accessor_class_g2_eps; +extern grib_accessor_class* grib_accessor_class_g2_mars_labeling; +extern grib_accessor_class* grib_accessor_class_g2bitmap; +extern grib_accessor_class* grib_accessor_class_g2bitmap_present; +extern grib_accessor_class* grib_accessor_class_g2date; +extern grib_accessor_class* grib_accessor_class_g2end_step; +extern grib_accessor_class* grib_accessor_class_g2grid; +extern grib_accessor_class* grib_accessor_class_g2latlon; +extern grib_accessor_class* grib_accessor_class_g2level; +extern grib_accessor_class* grib_accessor_class_g2lon; +extern grib_accessor_class* grib_accessor_class_g2step_range; +extern grib_accessor_class* grib_accessor_class_gaussian_grid_name; +extern grib_accessor_class* grib_accessor_class_gds_is_present; +extern grib_accessor_class* grib_accessor_class_gds_not_present_bitmap; +extern grib_accessor_class* grib_accessor_class_gen; +extern grib_accessor_class* grib_accessor_class_getenv; +extern grib_accessor_class* grib_accessor_class_global_gaussian; +extern grib_accessor_class* grib_accessor_class_group; +extern grib_accessor_class* grib_accessor_class_group_copy; +extern grib_accessor_class* grib_accessor_class_gts_header; +extern grib_accessor_class* grib_accessor_class_hash_array; +extern grib_accessor_class* grib_accessor_class_headers_only; +extern grib_accessor_class* grib_accessor_class_ibmfloat; +extern grib_accessor_class* grib_accessor_class_ieeefloat; +extern grib_accessor_class* grib_accessor_class_ifs_param; #include "accessor/grib_accessor_class_iterator.h" extern grib_accessor_class* grib_accessor_class_iterator; -//extern grib_accessor_class* grib_accessor_class_julian_date; -//extern grib_accessor_class* grib_accessor_class_julian_day; -//extern grib_accessor_class* grib_accessor_class_ksec1expver; -//extern grib_accessor_class* grib_accessor_class_label; -//extern grib_accessor_class* grib_accessor_class_latitudes; -//extern grib_accessor_class* grib_accessor_class_latlon_increment; -//extern grib_accessor_class* grib_accessor_class_latlonvalues; -//extern grib_accessor_class* grib_accessor_class_library_version; -//extern grib_accessor_class* grib_accessor_class_local_definition; +extern grib_accessor_class* grib_accessor_class_julian_date; +extern grib_accessor_class* grib_accessor_class_julian_day; +extern grib_accessor_class* grib_accessor_class_ksec1expver; +extern grib_accessor_class* grib_accessor_class_label; +extern grib_accessor_class* grib_accessor_class_latitudes; +extern grib_accessor_class* grib_accessor_class_latlon_increment; +extern grib_accessor_class* grib_accessor_class_latlonvalues; +extern grib_accessor_class* grib_accessor_class_library_version; +extern grib_accessor_class* grib_accessor_class_local_definition; #include "accessor/grib_accessor_class_long.h" extern grib_accessor_class* grib_accessor_class_long; -//extern grib_accessor_class* grib_accessor_class_long_vector; -//extern grib_accessor_class* grib_accessor_class_longitudes; -//extern grib_accessor_class* grib_accessor_class_lookup; -//extern grib_accessor_class* grib_accessor_class_mars_param; -//extern grib_accessor_class* grib_accessor_class_mars_step; -//extern grib_accessor_class* grib_accessor_class_md5; -//extern grib_accessor_class* grib_accessor_class_message; -//extern grib_accessor_class* grib_accessor_class_message_copy; -//extern grib_accessor_class* grib_accessor_class_multdouble; +extern grib_accessor_class* grib_accessor_class_long_vector; +extern grib_accessor_class* grib_accessor_class_longitudes; +extern grib_accessor_class* grib_accessor_class_lookup; +extern grib_accessor_class* grib_accessor_class_mars_param; +extern grib_accessor_class* grib_accessor_class_mars_step; +extern grib_accessor_class* grib_accessor_class_md5; +extern grib_accessor_class* grib_accessor_class_message; +extern grib_accessor_class* grib_accessor_class_message_copy; +extern grib_accessor_class* grib_accessor_class_multdouble; #include "accessor/grib_accessor_class_nearest.h" extern grib_accessor_class* grib_accessor_class_nearest; -//extern grib_accessor_class* grib_accessor_class_non_alpha; -//extern grib_accessor_class* grib_accessor_class_number_of_coded_values; -//extern grib_accessor_class* grib_accessor_class_number_of_points; -//extern grib_accessor_class* grib_accessor_class_number_of_points_gaussian; -//extern grib_accessor_class* grib_accessor_class_number_of_values; -//extern grib_accessor_class* grib_accessor_class_number_of_values_data_raw_packing; -//extern grib_accessor_class* grib_accessor_class_octahedral_gaussian; -//extern grib_accessor_class* grib_accessor_class_octet_number; -//extern grib_accessor_class* grib_accessor_class_offset_file; -//extern grib_accessor_class* grib_accessor_class_offset_values; -//extern grib_accessor_class* grib_accessor_class_optimal_step_units; -//extern grib_accessor_class* grib_accessor_class_pack_bufr_values; -//extern grib_accessor_class* grib_accessor_class_packing_type; -//extern grib_accessor_class* grib_accessor_class_pad; -//extern grib_accessor_class* grib_accessor_class_padding; -//extern grib_accessor_class* grib_accessor_class_padto; -//extern grib_accessor_class* grib_accessor_class_padtoeven; -//extern grib_accessor_class* grib_accessor_class_padtomultiple; -//extern grib_accessor_class* grib_accessor_class_position; -//extern grib_accessor_class* grib_accessor_class_proj_string; -//extern grib_accessor_class* grib_accessor_class_raw; -//extern grib_accessor_class* grib_accessor_class_rdbtime_guess_date; -//extern grib_accessor_class* grib_accessor_class_reference_value_error; -//extern grib_accessor_class* grib_accessor_class_round; -//extern grib_accessor_class* grib_accessor_class_scale; -//extern grib_accessor_class* grib_accessor_class_scale_values; -//extern grib_accessor_class* grib_accessor_class_second_order_bits_per_value; -//extern grib_accessor_class* grib_accessor_class_section; -//extern grib_accessor_class* grib_accessor_class_section_length; -//extern grib_accessor_class* grib_accessor_class_section_padding; -//extern grib_accessor_class* grib_accessor_class_section_pointer; -//extern grib_accessor_class* grib_accessor_class_select_step_template; -//extern grib_accessor_class* grib_accessor_class_sexagesimal2decimal; -//extern grib_accessor_class* grib_accessor_class_signed; -//extern grib_accessor_class* grib_accessor_class_signed_bits; -//extern grib_accessor_class* grib_accessor_class_simple_packing_error; -//extern grib_accessor_class* grib_accessor_class_size; +extern grib_accessor_class* grib_accessor_class_non_alpha; +extern grib_accessor_class* grib_accessor_class_number_of_coded_values; +extern grib_accessor_class* grib_accessor_class_number_of_points; +extern grib_accessor_class* grib_accessor_class_number_of_points_gaussian; +extern grib_accessor_class* grib_accessor_class_number_of_values; +extern grib_accessor_class* grib_accessor_class_number_of_values_data_raw_packing; +extern grib_accessor_class* grib_accessor_class_octahedral_gaussian; +extern grib_accessor_class* grib_accessor_class_octet_number; +extern grib_accessor_class* grib_accessor_class_offset_file; +extern grib_accessor_class* grib_accessor_class_offset_values; +extern grib_accessor_class* grib_accessor_class_optimal_step_units; +extern grib_accessor_class* grib_accessor_class_pack_bufr_values; +extern grib_accessor_class* grib_accessor_class_packing_type; +extern grib_accessor_class* grib_accessor_class_pad; +extern grib_accessor_class* grib_accessor_class_padding; +extern grib_accessor_class* grib_accessor_class_padto; +extern grib_accessor_class* grib_accessor_class_padtoeven; +extern grib_accessor_class* grib_accessor_class_padtomultiple; +extern grib_accessor_class* grib_accessor_class_position; +extern grib_accessor_class* grib_accessor_class_proj_string; +extern grib_accessor_class* grib_accessor_class_raw; +extern grib_accessor_class* grib_accessor_class_rdbtime_guess_date; +extern grib_accessor_class* grib_accessor_class_reference_value_error; +extern grib_accessor_class* grib_accessor_class_round; +extern grib_accessor_class* grib_accessor_class_scale; +extern grib_accessor_class* grib_accessor_class_scale_values; +extern grib_accessor_class* grib_accessor_class_second_order_bits_per_value; +extern grib_accessor_class* grib_accessor_class_section; +extern grib_accessor_class* grib_accessor_class_section_length; +extern grib_accessor_class* grib_accessor_class_section_padding; +extern grib_accessor_class* grib_accessor_class_section_pointer; +extern grib_accessor_class* grib_accessor_class_select_step_template; +extern grib_accessor_class* grib_accessor_class_sexagesimal2decimal; +extern grib_accessor_class* grib_accessor_class_signed; +extern grib_accessor_class* grib_accessor_class_signed_bits; +extern grib_accessor_class* grib_accessor_class_simple_packing_error; +extern grib_accessor_class* grib_accessor_class_size; #include "accessor/grib_accessor_class_smart_table.h" extern grib_accessor_class* grib_accessor_class_smart_table; -//extern grib_accessor_class* grib_accessor_class_smart_table_column; -//extern grib_accessor_class* grib_accessor_class_spd; -//extern grib_accessor_class* grib_accessor_class_spectral_truncation; -//extern grib_accessor_class* grib_accessor_class_sprintf; -//extern grib_accessor_class* grib_accessor_class_statistics; -//extern grib_accessor_class* grib_accessor_class_statistics_spectral; -//extern grib_accessor_class* grib_accessor_class_step_human_readable; -//extern grib_accessor_class* grib_accessor_class_step_in_units; -//extern grib_accessor_class* grib_accessor_class_sum; -//extern grib_accessor_class* grib_accessor_class_suppressed; -//extern grib_accessor_class* grib_accessor_class_time; -//extern grib_accessor_class* grib_accessor_class_to_double; -//extern grib_accessor_class* grib_accessor_class_to_integer; -//extern grib_accessor_class* grib_accessor_class_to_string; +extern grib_accessor_class* grib_accessor_class_smart_table_column; +extern grib_accessor_class* grib_accessor_class_spd; +extern grib_accessor_class* grib_accessor_class_spectral_truncation; +extern grib_accessor_class* grib_accessor_class_sprintf; +extern grib_accessor_class* grib_accessor_class_statistics; +extern grib_accessor_class* grib_accessor_class_statistics_spectral; +extern grib_accessor_class* grib_accessor_class_step_human_readable; +extern grib_accessor_class* grib_accessor_class_step_in_units; +extern grib_accessor_class* grib_accessor_class_sum; +extern grib_accessor_class* grib_accessor_class_suppressed; +extern grib_accessor_class* grib_accessor_class_time; +extern grib_accessor_class* grib_accessor_class_to_double; +extern grib_accessor_class* grib_accessor_class_to_integer; +extern grib_accessor_class* grib_accessor_class_to_string; #include "accessor/grib_accessor_class_transient.h" extern grib_accessor_class* grib_accessor_class_transient; -//extern grib_accessor_class* grib_accessor_class_transient_darray; -//extern grib_accessor_class* grib_accessor_class_trim; -//extern grib_accessor_class* grib_accessor_class_uint16; -//extern grib_accessor_class* grib_accessor_class_uint32; -//extern grib_accessor_class* grib_accessor_class_uint32_little_endian; -//extern grib_accessor_class* grib_accessor_class_uint64; -//extern grib_accessor_class* grib_accessor_class_uint64_little_endian; -//extern grib_accessor_class* grib_accessor_class_uint8; -//extern grib_accessor_class* grib_accessor_class_unexpanded_descriptors; -//extern grib_accessor_class* grib_accessor_class_unpack_bufr_values; +extern grib_accessor_class* grib_accessor_class_transient_darray; +extern grib_accessor_class* grib_accessor_class_trim; +extern grib_accessor_class* grib_accessor_class_uint16; +extern grib_accessor_class* grib_accessor_class_uint32; +extern grib_accessor_class* grib_accessor_class_uint32_little_endian; +extern grib_accessor_class* grib_accessor_class_uint64; +extern grib_accessor_class* grib_accessor_class_uint64_little_endian; +extern grib_accessor_class* grib_accessor_class_uint8; +extern grib_accessor_class* grib_accessor_class_unexpanded_descriptors; +extern grib_accessor_class* grib_accessor_class_unpack_bufr_values; #include "accessor/grib_accessor_class_unsigned.h" extern grib_accessor_class* grib_accessor_class_unsigned; -//extern grib_accessor_class* grib_accessor_class_unsigned_bits; -//extern grib_accessor_class* grib_accessor_class_validity_date; -//extern grib_accessor_class* grib_accessor_class_validity_time; -//extern grib_accessor_class* grib_accessor_class_values; +extern grib_accessor_class* grib_accessor_class_unsigned_bits; +extern grib_accessor_class* grib_accessor_class_validity_date; +extern grib_accessor_class* grib_accessor_class_validity_time; +extern grib_accessor_class* grib_accessor_class_values; #include "accessor/grib_accessor_class_variable.h" extern grib_accessor_class* grib_accessor_class_variable; -//extern grib_accessor_class* grib_accessor_class_vector; -//extern grib_accessor_class* grib_accessor_class_when; +extern grib_accessor_class* grib_accessor_class_vector; +extern grib_accessor_class* grib_accessor_class_when; diff --git a/src/grib_accessor_classes_hash.cc b/src/grib_accessor_classes_hash.cc index dd88339f7..178ed937b 100644 --- a/src/grib_accessor_classes_hash.cc +++ b/src/grib_accessor_classes_hash.cc @@ -1,6 +1,6 @@ /* ANSI-C code produced by gperf version 3.1 */ /* Command-line: 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 */ -/* Computed positions: -k'1' */ +/* Computed positions: -k'1-2,5,7,11' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ @@ -37,12 +37,12 @@ #line 6 "accessor_class_list.gperf" struct accessor_class_hash { const char *name; grib_accessor_class **cclass;}; -#define TOTAL_KEYWORDS 10 +#define TOTAL_KEYWORDS 205 #define MIN_WORD_LENGTH 1 -#define MAX_WORD_LENGTH 11 +#define MAX_WORD_LENGTH 44 #define MIN_HASH_VALUE 1 -#define MAX_HASH_VALUE 14 -/* maximum key range = 14, duplicates = 0 */ +#define MAX_HASH_VALUE 506 +/* maximum key range = 506, duplicates = 0 */ #ifdef __GNUC__ @@ -54,36 +54,62 @@ struct accessor_class_hash { const char *name; grib_accessor_class **cclass;}; static unsigned int grib_accessor_classes_get_id (const char *str, size_t len) { - static const unsigned char asso_values[] = + static const unsigned short asso_values[] = { - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, - 15, 15, 15, 15, 15, 6, 15, 15, 0, 15, - 0, 15, 15, 15, 15, 2, 3, 3, 0, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15 + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 0, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 1, 145, + 23, 6, 2, 507, 4, 507, 1, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 0, 507, 0, 69, 84, + 0, 0, 161, 24, 187, 1, 8, 9, 87, 102, + 13, 51, 6, 507, 118, 1, 40, 59, 171, 0, + 4, 6, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507 }; - return len + asso_values[(unsigned char)str[0]]; + unsigned int hval = len; + + switch (hval) + { + default: + hval += asso_values[(unsigned char)str[10]]; + /*FALLTHROUGH*/ + case 10: + case 9: + case 8: + case 7: + hval += asso_values[(unsigned char)str[6]]; + /*FALLTHROUGH*/ + case 6: + case 5: + hval += asso_values[(unsigned char)str[4]]; + /*FALLTHROUGH*/ + case 4: + case 3: + case 2: + hval += asso_values[(unsigned char)str[1]]; + /*FALLTHROUGH*/ + case 1: + hval += asso_values[(unsigned char)str[0]]; + break; + } + return hval; } static const struct accessor_class_hash classes[] = @@ -91,26 +117,509 @@ static const struct accessor_class_hash classes[] = {""}, #line 9 "accessor_class_list.gperf" {" "}, + {""}, {""}, {""}, {""}, +#line 179 "accessor_class_list.gperf" + {"size", &grib_accessor_class_size}, +#line 12 "accessor_class_list.gperf" + {"ascii", &grib_accessor_class_ascii}, +#line 176 "accessor_class_list.gperf" + {"signed", &grib_accessor_class_signed}, +#line 156 "accessor_class_list.gperf" + {"pad", &grib_accessor_class_pad}, +#line 182 "accessor_class_list.gperf" + {"spd", &grib_accessor_class_spd}, + {""}, +#line 75 "accessor_class_list.gperf" + {"dirty", &grib_accessor_class_dirty}, + {""}, +#line 177 "accessor_class_list.gperf" + {"signed_bits", &grib_accessor_class_signed_bits}, + {""}, +#line 66 "accessor_class_list.gperf" + {"data_raw_packing", &grib_accessor_class_data_raw_packing}, + {""}, {""}, {""}, +#line 72 "accessor_class_list.gperf" + {"data_simple_packing", &grib_accessor_class_data_simple_packing}, +#line 68 "accessor_class_list.gperf" + {"data_secondary_bitmap", &grib_accessor_class_data_secondary_bitmap}, +#line 170 "accessor_class_list.gperf" + {"section", &grib_accessor_class_section}, +#line 43 "accessor_class_list.gperf" + {"data_apply_bitmap", &grib_accessor_class_data_apply_bitmap}, + {""}, +#line 74 "accessor_class_list.gperf" + {"dictionary", &grib_accessor_class_dictionary}, + {""}, +#line 112 "accessor_class_list.gperf" + {"gen", &grib_accessor_class_gen}, +#line 64 "accessor_class_list.gperf" + {"data_jpeg2000_packing", &grib_accessor_class_data_jpeg2000_packing}, +#line 65 "accessor_class_list.gperf" + {"data_png_packing", &grib_accessor_class_data_png_packing}, +#line 172 "accessor_class_list.gperf" + {"section_padding", &grib_accessor_class_section_padding}, +#line 173 "accessor_class_list.gperf" + {"section_pointer", &grib_accessor_class_section_pointer}, +#line 44 "accessor_class_list.gperf" + {"data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic}, + {""}, {""}, {""}, {""}, +#line 80 "accessor_class_list.gperf" + {"expanded_descriptors", &grib_accessor_class_expanded_descriptors}, +#line 157 "accessor_class_list.gperf" + {"padding", &grib_accessor_class_padding}, +#line 45 "accessor_class_list.gperf" + {"data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap}, +#line 110 "accessor_class_list.gperf" + {"gds_is_present", &grib_accessor_class_gds_is_present}, +#line 169 "accessor_class_list.gperf" + {"second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value}, +#line 171 "accessor_class_list.gperf" + {"section_length", &grib_accessor_class_section_length}, +#line 113 "accessor_class_list.gperf" + {"getenv", &grib_accessor_class_getenv}, +#line 57 "accessor_class_list.gperf" + {"data_g22order_packing", &grib_accessor_class_data_g22order_packing}, +#line 191 "accessor_class_list.gperf" + {"time", &grib_accessor_class_time}, + {""}, +#line 61 "accessor_class_list.gperf" + {"data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing}, + {""}, +#line 155 "accessor_class_list.gperf" + {"packing_type", &grib_accessor_class_packing_type}, +#line 62 "accessor_class_list.gperf" + {"data_g2simple_packing", &grib_accessor_class_data_g2simple_packing}, +#line 59 "accessor_class_list.gperf" + {"data_g2complex_packing", &grib_accessor_class_data_g2complex_packing}, {""}, {""}, -#line 132 "accessor_class_list.gperf" - {"long", &grib_accessor_class_long}, - {""}, {""}, +#line 104 "accessor_class_list.gperf" + {"g2grid", &grib_accessor_class_g2grid}, + {""}, {""}, {""}, +#line 103 "accessor_class_list.gperf" + {"g2end_step", &grib_accessor_class_g2end_step}, +#line 98 "accessor_class_list.gperf" + {"g2_eps", &grib_accessor_class_g2_eps}, #line 142 "accessor_class_list.gperf" {"nearest", &grib_accessor_class_nearest}, -#line 211 "accessor_class_list.gperf" - {"variable", &grib_accessor_class_variable}, -#line 39 "accessor_class_list.gperf" - {"constant", &grib_accessor_class_constant}, -#line 35 "accessor_class_list.gperf" - {"codetable", &grib_accessor_class_codetable}, + {""}, +#line 158 "accessor_class_list.gperf" + {"padto", &grib_accessor_class_padto}, +#line 189 "accessor_class_list.gperf" + {"sum", &grib_accessor_class_sum}, + {""}, +#line 107 "accessor_class_list.gperf" + {"g2lon", &grib_accessor_class_g2lon}, +#line 203 "accessor_class_list.gperf" + {"uint8", &grib_accessor_class_uint8}, + {""}, +#line 188 "accessor_class_list.gperf" + {"step_in_units", &grib_accessor_class_step_in_units}, +#line 63 "accessor_class_list.gperf" + {"data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing}, +#line 201 "accessor_class_list.gperf" + {"uint64", &grib_accessor_class_uint64}, +#line 47 "accessor_class_list.gperf" + {"data_complex_packing", &grib_accessor_class_data_complex_packing}, +#line 199 "accessor_class_list.gperf" + {"uint32", &grib_accessor_class_uint32}, +#line 13 "accessor_class_list.gperf" + {"bit", &grib_accessor_class_bit}, +#line 15 "accessor_class_list.gperf" + {"bits", &grib_accessor_class_bits}, +#line 48 "accessor_class_list.gperf" + {"data_dummy_field", &grib_accessor_class_data_dummy_field}, +#line 14 "accessor_class_list.gperf" + {"bitmap", &grib_accessor_class_bitmap}, +#line 124 "accessor_class_list.gperf" + {"julian_day", &grib_accessor_class_julian_day}, +#line 123 "accessor_class_list.gperf" + {"julian_date", &grib_accessor_class_julian_date}, +#line 143 "accessor_class_list.gperf" + {"non_alpha", &grib_accessor_class_non_alpha}, + {""}, +#line 29 "accessor_class_list.gperf" + {"bytes", &grib_accessor_class_bytes}, +#line 67 "accessor_class_list.gperf" + {"data_run_length_packing", &grib_accessor_class_data_run_length_packing}, +#line 108 "accessor_class_list.gperf" + {"g2step_range", &grib_accessor_class_g2step_range}, +#line 16 "accessor_class_list.gperf" + {"bits_per_value", &grib_accessor_class_bits_per_value}, + {""}, {""}, {""}, {""}, {""}, +#line 167 "accessor_class_list.gperf" + {"scale", &grib_accessor_class_scale}, + {""}, +#line 185 "accessor_class_list.gperf" + {"statistics", &grib_accessor_class_statistics}, +#line 102 "accessor_class_list.gperf" + {"g2date", &grib_accessor_class_g2date}, +#line 145 "accessor_class_list.gperf" + {"number_of_points", &grib_accessor_class_number_of_points}, +#line 100 "accessor_class_list.gperf" + {"g2bitmap", &grib_accessor_class_g2bitmap}, + {""}, +#line 60 "accessor_class_list.gperf" + {"data_g2secondary_bitmap", &grib_accessor_class_data_g2secondary_bitmap}, +#line 58 "accessor_class_list.gperf" + {"data_g2bifourier_packing", &grib_accessor_class_data_g2bifourier_packing}, +#line 111 "accessor_class_list.gperf" + {"gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap}, +#line 122 "accessor_class_list.gperf" + {"iterator", &grib_accessor_class_iterator}, +#line 186 "accessor_class_list.gperf" + {"statistics_spectral", &grib_accessor_class_statistics_spectral}, +#line 46 "accessor_class_list.gperf" + {"data_ccsds_packing", &grib_accessor_class_data_ccsds_packing}, +#line 146 "accessor_class_list.gperf" + {"number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian}, #line 206 "accessor_class_list.gperf" {"unsigned", &grib_accessor_class_unsigned}, +#line 138 "accessor_class_list.gperf" + {"md5", &grib_accessor_class_md5}, + {""}, {""}, +#line 96 "accessor_class_list.gperf" + {"g2_aerosol", &grib_accessor_class_g2_aerosol}, +#line 139 "accessor_class_list.gperf" + {"message", &grib_accessor_class_message}, +#line 207 "accessor_class_list.gperf" + {"unsigned_bits", &grib_accessor_class_unsigned_bits}, +#line 174 "accessor_class_list.gperf" + {"select_step_template", &grib_accessor_class_select_step_template}, +#line 136 "accessor_class_list.gperf" + {"mars_param", &grib_accessor_class_mars_param}, +#line 204 "accessor_class_list.gperf" + {"unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors}, +#line 193 "accessor_class_list.gperf" + {"to_integer", &grib_accessor_class_to_integer}, + {""}, {""}, {""}, +#line 178 "accessor_class_list.gperf" + {"simple_packing_error", &grib_accessor_class_simple_packing_error}, +#line 187 "accessor_class_list.gperf" + {"step_human_readable", &grib_accessor_class_step_human_readable}, +#line 140 "accessor_class_list.gperf" + {"message_copy", &grib_accessor_class_message_copy}, +#line 163 "accessor_class_list.gperf" + {"raw", &grib_accessor_class_raw}, + {""}, {""}, +#line 202 "accessor_class_list.gperf" + {"uint64_little_endian", &grib_accessor_class_uint64_little_endian}, + {""}, +#line 200 "accessor_class_list.gperf" + {"uint32_little_endian", &grib_accessor_class_uint32_little_endian}, +#line 114 "accessor_class_list.gperf" + {"global_gaussian", &grib_accessor_class_global_gaussian}, + {""}, {""}, +#line 76 "accessor_class_list.gperf" + {"divdouble", &grib_accessor_class_divdouble}, + {""}, +#line 175 "accessor_class_list.gperf" + {"sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal}, +#line 99 "accessor_class_list.gperf" + {"g2_mars_labeling", &grib_accessor_class_g2_mars_labeling}, +#line 78 "accessor_class_list.gperf" + {"element", &grib_accessor_class_element}, +#line 160 "accessor_class_list.gperf" + {"padtomultiple", &grib_accessor_class_padtomultiple}, +#line 127 "accessor_class_list.gperf" + {"latitudes", &grib_accessor_class_latitudes}, +#line 164 "accessor_class_list.gperf" + {"rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date}, + {""}, {""}, {""}, +#line 194 "accessor_class_list.gperf" + {"to_string", &grib_accessor_class_to_string}, +#line 132 "accessor_class_list.gperf" + {"long", &grib_accessor_class_long}, +#line 19 "accessor_class_list.gperf" + {"bufr_data_array", &grib_accessor_class_bufr_data_array}, +#line 77 "accessor_class_list.gperf" + {"double", &grib_accessor_class_double}, +#line 20 "accessor_class_list.gperf" + {"bufr_data_element", &grib_accessor_class_bufr_data_element}, +#line 105 "accessor_class_list.gperf" + {"g2latlon", &grib_accessor_class_g2latlon}, + {""}, {""}, +#line 26 "accessor_class_list.gperf" + {"bufr_simple_thinning", &grib_accessor_class_bufr_simple_thinning}, + {""}, +#line 137 "accessor_class_list.gperf" + {"mars_step", &grib_accessor_class_mars_step}, + {""}, +#line 115 "accessor_class_list.gperf" + {"group", &grib_accessor_class_group}, + {""}, +#line 28 "accessor_class_list.gperf" + {"bufrdc_expanded_descriptors", &grib_accessor_class_bufrdc_expanded_descriptors}, +#line 161 "accessor_class_list.gperf" + {"position", &grib_accessor_class_position}, + {""}, {""}, {""}, +#line 17 "accessor_class_list.gperf" + {"blob", &grib_accessor_class_blob}, +#line 109 "accessor_class_list.gperf" + {"gaussian_grid_name", &grib_accessor_class_gaussian_grid_name}, +#line 197 "accessor_class_list.gperf" + {"trim", &grib_accessor_class_trim}, + {""}, {""}, +#line 119 "accessor_class_list.gperf" + {"ibmfloat", &grib_accessor_class_ibmfloat}, + {""}, {""}, #line 195 "accessor_class_list.gperf" {"transient", &grib_accessor_class_transient}, +#line 55 "accessor_class_list.gperf" + {"data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing}, + {""}, {""}, +#line 56 "accessor_class_list.gperf" + {"data_g1simple_packing", &grib_accessor_class_data_g1simple_packing}, +#line 49 "accessor_class_list.gperf" + {"data_g1complex_packing", &grib_accessor_class_data_g1complex_packing}, +#line 166 "accessor_class_list.gperf" + {"round", &grib_accessor_class_round}, +#line 196 "accessor_class_list.gperf" + {"transient_darray", &grib_accessor_class_transient_darray}, +#line 18 "accessor_class_list.gperf" + {"budgdate", &grib_accessor_class_budgdate}, +#line 210 "accessor_class_list.gperf" + {"values", &grib_accessor_class_values}, +#line 144 "accessor_class_list.gperf" + {"number_of_coded_values", &grib_accessor_class_number_of_coded_values}, +#line 126 "accessor_class_list.gperf" + {"label", &grib_accessor_class_label}, + {""}, {""}, +#line 38 "accessor_class_list.gperf" + {"concept", &grib_accessor_class_concept}, + {""}, +#line 183 "accessor_class_list.gperf" + {"spectral_truncation", &grib_accessor_class_spectral_truncation}, + {""}, {""}, +#line 83 "accessor_class_list.gperf" + {"g1_message_length", &grib_accessor_class_g1_message_length}, +#line 184 "accessor_class_list.gperf" + {"sprintf", &grib_accessor_class_sprintf}, +#line 190 "accessor_class_list.gperf" + {"suppressed", &grib_accessor_class_suppressed}, + {""}, +#line 213 "accessor_class_list.gperf" + {"when", &grib_accessor_class_when}, + {""}, {""}, #line 180 "accessor_class_list.gperf" {"smart_table", &grib_accessor_class_smart_table}, -#line 122 "accessor_class_list.gperf" - {"iterator", &grib_accessor_class_iterator} + {""}, +#line 39 "accessor_class_list.gperf" + {"constant", &grib_accessor_class_constant}, + {""}, {""}, +#line 162 "accessor_class_list.gperf" + {"proj_string", &grib_accessor_class_proj_string}, +#line 150 "accessor_class_list.gperf" + {"octet_number", &grib_accessor_class_octet_number}, +#line 181 "accessor_class_list.gperf" + {"smart_table_column", &grib_accessor_class_smart_table_column}, + {""}, +#line 135 "accessor_class_list.gperf" + {"lookup", &grib_accessor_class_lookup}, + {""}, +#line 94 "accessor_class_list.gperf" + {"g1step_range", &grib_accessor_class_g1step_range}, +#line 73 "accessor_class_list.gperf" + {"decimal_precision", &grib_accessor_class_decimal_precision}, + {""}, +#line 134 "accessor_class_list.gperf" + {"longitudes", &grib_accessor_class_longitudes}, +#line 70 "accessor_class_list.gperf" + {"data_sh_unpacked", &grib_accessor_class_data_sh_unpacked}, +#line 27 "accessor_class_list.gperf" + {"bufr_string_values", &grib_accessor_class_bufr_string_values}, +#line 198 "accessor_class_list.gperf" + {"uint16", &grib_accessor_class_uint16}, + {""}, {""}, +#line 71 "accessor_class_list.gperf" + {"data_shsimple_packing", &grib_accessor_class_data_shsimple_packing}, +#line 86 "accessor_class_list.gperf" + {"g1date", &grib_accessor_class_g1date}, + {""}, +#line 85 "accessor_class_list.gperf" + {"g1bitmap", &grib_accessor_class_g1bitmap}, + {""}, +#line 54 "accessor_class_list.gperf" + {"data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap}, +#line 192 "accessor_class_list.gperf" + {"to_double", &grib_accessor_class_to_double}, +#line 101 "accessor_class_list.gperf" + {"g2bitmap_present", &grib_accessor_class_g2bitmap_present}, +#line 120 "accessor_class_list.gperf" + {"ieeefloat", &grib_accessor_class_ieeefloat}, +#line 151 "accessor_class_list.gperf" + {"offset_file", &grib_accessor_class_offset_file}, +#line 208 "accessor_class_list.gperf" + {"validity_date", &grib_accessor_class_validity_date}, +#line 209 "accessor_class_list.gperf" + {"validity_time", &grib_accessor_class_validity_time}, + {""}, +#line 130 "accessor_class_list.gperf" + {"library_version", &grib_accessor_class_library_version}, +#line 212 "accessor_class_list.gperf" + {"vector", &grib_accessor_class_vector}, +#line 84 "accessor_class_list.gperf" + {"g1_section4_length", &grib_accessor_class_g1_section4_length}, +#line 141 "accessor_class_list.gperf" + {"multdouble", &grib_accessor_class_multdouble}, +#line 52 "accessor_class_list.gperf" + {"data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing}, + {""}, {""}, +#line 53 "accessor_class_list.gperf" + {"data_g1second_order_row_by_row_packing", &grib_accessor_class_data_g1second_order_row_by_row_packing}, + {""}, +#line 24 "accessor_class_list.gperf" + {"bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets}, +#line 159 "accessor_class_list.gperf" + {"padtoeven", &grib_accessor_class_padtoeven}, +#line 50 "accessor_class_list.gperf" + {"data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing}, + {""}, +#line 51 "accessor_class_list.gperf" + {"data_g1second_order_general_extended_packing", &grib_accessor_class_data_g1second_order_general_extended_packing}, +#line 22 "accessor_class_list.gperf" + {"bufr_extract_area_subsets", &grib_accessor_class_bufr_extract_area_subsets}, + {""}, {""}, {""}, +#line 23 "accessor_class_list.gperf" + {"bufr_extract_datetime_subsets", &grib_accessor_class_bufr_extract_datetime_subsets}, + {""}, +#line 21 "accessor_class_list.gperf" + {"bufr_elements_table", &grib_accessor_class_bufr_elements_table}, + {""}, {""}, {""}, {""}, +#line 154 "accessor_class_list.gperf" + {"pack_bufr_values", &grib_accessor_class_pack_bufr_values}, +#line 35 "accessor_class_list.gperf" + {"codetable", &grib_accessor_class_codetable}, +#line 131 "accessor_class_list.gperf" + {"local_definition", &grib_accessor_class_local_definition}, + {""}, +#line 25 "accessor_class_list.gperf" + {"bufr_group", &grib_accessor_class_bufr_group}, + {""}, +#line 88 "accessor_class_list.gperf" + {"g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly}, +#line 147 "accessor_class_list.gperf" + {"number_of_values", &grib_accessor_class_number_of_values}, + {""}, +#line 116 "accessor_class_list.gperf" + {"gts_header", &grib_accessor_class_gts_header}, + {""}, +#line 33 "accessor_class_list.gperf" + {"closest_date", &grib_accessor_class_closest_date}, +#line 153 "accessor_class_list.gperf" + {"optimal_step_units", &grib_accessor_class_optimal_step_units}, + {""}, +#line 211 "accessor_class_list.gperf" + {"variable", &grib_accessor_class_variable}, +#line 133 "accessor_class_list.gperf" + {"long_vector", &grib_accessor_class_long_vector}, +#line 168 "accessor_class_list.gperf" + {"scale_values", &grib_accessor_class_scale_values}, + {""}, {""}, {""}, +#line 128 "accessor_class_list.gperf" + {"latlon_increment", &grib_accessor_class_latlon_increment}, + {""}, {""}, {""}, +#line 148 "accessor_class_list.gperf" + {"number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing}, + {""}, +#line 79 "accessor_class_list.gperf" + {"evaluate", &grib_accessor_class_evaluate}, + {""}, {""}, {""}, {""}, {""}, +#line 152 "accessor_class_list.gperf" + {"offset_values", &grib_accessor_class_offset_values}, +#line 69 "accessor_class_list.gperf" + {"data_sh_packed", &grib_accessor_class_data_sh_packed}, +#line 11 "accessor_class_list.gperf" + {"abstract_vector", &grib_accessor_class_abstract_vector}, +#line 118 "accessor_class_list.gperf" + {"headers_only", &grib_accessor_class_headers_only}, +#line 125 "accessor_class_list.gperf" + {"ksec1expver", &grib_accessor_class_ksec1expver}, + {""}, {""}, +#line 41 "accessor_class_list.gperf" + {"count_missing", &grib_accessor_class_count_missing}, +#line 205 "accessor_class_list.gperf" + {"unpack_bufr_values", &grib_accessor_class_unpack_bufr_values}, + {""}, {""}, +#line 121 "accessor_class_list.gperf" + {"ifs_param", &grib_accessor_class_ifs_param}, + {""}, {""}, {""}, +#line 36 "accessor_class_list.gperf" + {"codetable_title", &grib_accessor_class_codetable_title}, + {""}, {""}, {""}, +#line 89 "accessor_class_list.gperf" + {"g1fcperiod", &grib_accessor_class_g1fcperiod}, +#line 34 "accessor_class_list.gperf" + {"codeflag", &grib_accessor_class_codeflag}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 106 "accessor_class_list.gperf" + {"g2level", &grib_accessor_class_g2level}, +#line 42 "accessor_class_list.gperf" + {"count_total", &grib_accessor_class_count_total}, + {""}, +#line 117 "accessor_class_list.gperf" + {"hash_array", &grib_accessor_class_hash_array}, + {""}, {""}, +#line 37 "accessor_class_list.gperf" + {"codetable_units", &grib_accessor_class_codetable_units}, + {""}, {""}, +#line 129 "accessor_class_list.gperf" + {"latlonvalues", &grib_accessor_class_latlonvalues}, + {""}, {""}, {""}, {""}, +#line 30 "accessor_class_list.gperf" + {"change_alternative_row_scanning", &grib_accessor_class_change_alternative_row_scanning}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 31 "accessor_class_list.gperf" + {"change_scanning_direction", &grib_accessor_class_change_scanning_direction}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 149 "accessor_class_list.gperf" + {"octahedral_gaussian", &grib_accessor_class_octahedral_gaussian}, +#line 10 "accessor_class_list.gperf" + {"abstract_long_vector", &grib_accessor_class_abstract_long_vector}, + {""}, {""}, {""}, +#line 40 "accessor_class_list.gperf" + {"count_file", &grib_accessor_class_count_file}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 91 "accessor_class_list.gperf" + {"g1monthlydate", &grib_accessor_class_g1monthlydate}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 82 "accessor_class_list.gperf" + {"g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag}, + {""}, +#line 81 "accessor_class_list.gperf" + {"from_scale_factor_scaled_value", &grib_accessor_class_from_scale_factor_scaled_value}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 32 "accessor_class_list.gperf" + {"check_internal_version", &grib_accessor_class_check_internal_version}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, +#line 97 "accessor_class_list.gperf" + {"g2_chemical", &grib_accessor_class_g2_chemical}, +#line 87 "accessor_class_list.gperf" + {"g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date}, + {""}, {""}, {""}, {""}, {""}, +#line 165 "accessor_class_list.gperf" + {"reference_value_error", &grib_accessor_class_reference_value_error}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 93 "accessor_class_list.gperf" + {"g1number_of_coded_values_sh_simple", &grib_accessor_class_g1number_of_coded_values_sh_simple}, +#line 92 "accessor_class_list.gperf" + {"g1number_of_coded_values_sh_complex", &grib_accessor_class_g1number_of_coded_values_sh_complex}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, +#line 90 "accessor_class_list.gperf" + {"g1forecastmonth", &grib_accessor_class_g1forecastmonth}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 95 "accessor_class_list.gperf" + {"g1verificationdate", &grib_accessor_class_g1verificationdate} }; const struct accessor_class_hash * diff --git a/src/grib_accessor_factory.h b/src/grib_accessor_factory.h index 644d2e89b..2f889a0c6 100644 --- a/src/grib_accessor_factory.h +++ b/src/grib_accessor_factory.h @@ -1,205 +1,205 @@ /* This file is automatically generated by ./make_class.pl, do not edit */ -//{ "abstract_long_vector", &grib_accessor_class_abstract_long_vector, }, -//{ "abstract_vector", &grib_accessor_class_abstract_vector, }, -//{ "ascii", &grib_accessor_class_ascii, }, -//{ "bit", &grib_accessor_class_bit, }, -//{ "bitmap", &grib_accessor_class_bitmap, }, -//{ "bits", &grib_accessor_class_bits, }, -//{ "bits_per_value", &grib_accessor_class_bits_per_value, }, -//{ "blob", &grib_accessor_class_blob, }, -//{ "budgdate", &grib_accessor_class_budgdate, }, -//{ "bufr_data_array", &grib_accessor_class_bufr_data_array, }, -//{ "bufr_data_element", &grib_accessor_class_bufr_data_element, }, -//{ "bufr_elements_table", &grib_accessor_class_bufr_elements_table, }, -//{ "bufr_extract_area_subsets", &grib_accessor_class_bufr_extract_area_subsets, }, -//{ "bufr_extract_datetime_subsets", &grib_accessor_class_bufr_extract_datetime_subsets, }, -//{ "bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets, }, -//{ "bufr_group", &grib_accessor_class_bufr_group, }, -//{ "bufr_simple_thinning", &grib_accessor_class_bufr_simple_thinning, }, -//{ "bufr_string_values", &grib_accessor_class_bufr_string_values, }, -//{ "bufrdc_expanded_descriptors", &grib_accessor_class_bufrdc_expanded_descriptors, }, -//{ "bytes", &grib_accessor_class_bytes, }, -//{ "change_alternative_row_scanning", &grib_accessor_class_change_alternative_row_scanning, }, -//{ "change_scanning_direction", &grib_accessor_class_change_scanning_direction, }, -//{ "check_internal_version", &grib_accessor_class_check_internal_version, }, -//{ "closest_date", &grib_accessor_class_closest_date, }, -//{ "codeflag", &grib_accessor_class_codeflag, }, +{ "abstract_long_vector", &grib_accessor_class_abstract_long_vector, }, +{ "abstract_vector", &grib_accessor_class_abstract_vector, }, +{ "ascii", &grib_accessor_class_ascii, }, +{ "bit", &grib_accessor_class_bit, }, +{ "bitmap", &grib_accessor_class_bitmap, }, +{ "bits", &grib_accessor_class_bits, }, +{ "bits_per_value", &grib_accessor_class_bits_per_value, }, +{ "blob", &grib_accessor_class_blob, }, +{ "budgdate", &grib_accessor_class_budgdate, }, +{ "bufr_data_array", &grib_accessor_class_bufr_data_array, }, +{ "bufr_data_element", &grib_accessor_class_bufr_data_element, }, +{ "bufr_elements_table", &grib_accessor_class_bufr_elements_table, }, +{ "bufr_extract_area_subsets", &grib_accessor_class_bufr_extract_area_subsets, }, +{ "bufr_extract_datetime_subsets", &grib_accessor_class_bufr_extract_datetime_subsets, }, +{ "bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets, }, +{ "bufr_group", &grib_accessor_class_bufr_group, }, +{ "bufr_simple_thinning", &grib_accessor_class_bufr_simple_thinning, }, +{ "bufr_string_values", &grib_accessor_class_bufr_string_values, }, +{ "bufrdc_expanded_descriptors", &grib_accessor_class_bufrdc_expanded_descriptors, }, +{ "bytes", &grib_accessor_class_bytes, }, +{ "change_alternative_row_scanning", &grib_accessor_class_change_alternative_row_scanning, }, +{ "change_scanning_direction", &grib_accessor_class_change_scanning_direction, }, +{ "check_internal_version", &grib_accessor_class_check_internal_version, }, +{ "closest_date", &grib_accessor_class_closest_date, }, +{ "codeflag", &grib_accessor_class_codeflag, }, { "codetable", &grib_accessor_class_codetable, }, -//{ "codetable_title", &grib_accessor_class_codetable_title, }, -//{ "codetable_units", &grib_accessor_class_codetable_units, }, -//{ "concept", &grib_accessor_class_concept, }, +{ "codetable_title", &grib_accessor_class_codetable_title, }, +{ "codetable_units", &grib_accessor_class_codetable_units, }, +{ "concept", &grib_accessor_class_concept, }, { "constant", &grib_accessor_class_constant, }, -//{ "count_file", &grib_accessor_class_count_file, }, -//{ "count_missing", &grib_accessor_class_count_missing, }, -//{ "count_total", &grib_accessor_class_count_total, }, -//{ "data_apply_bitmap", &grib_accessor_class_data_apply_bitmap, }, -//{ "data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic, }, -//{ "data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap, }, -//{ "data_ccsds_packing", &grib_accessor_class_data_ccsds_packing, }, -//{ "data_complex_packing", &grib_accessor_class_data_complex_packing, }, -//{ "data_dummy_field", &grib_accessor_class_data_dummy_field, }, -//{ "data_g1complex_packing", &grib_accessor_class_data_g1complex_packing, }, -//{ "data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing, }, -//{ "data_g1second_order_general_extended_packing", &grib_accessor_class_data_g1second_order_general_extended_packing, }, -//{ "data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing, }, -//{ "data_g1second_order_row_by_row_packing", &grib_accessor_class_data_g1second_order_row_by_row_packing, }, -//{ "data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap, }, -//{ "data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing, }, -//{ "data_g1simple_packing", &grib_accessor_class_data_g1simple_packing, }, -//{ "data_g22order_packing", &grib_accessor_class_data_g22order_packing, }, -//{ "data_g2bifourier_packing", &grib_accessor_class_data_g2bifourier_packing, }, -//{ "data_g2complex_packing", &grib_accessor_class_data_g2complex_packing, }, -//{ "data_g2secondary_bitmap", &grib_accessor_class_data_g2secondary_bitmap, }, -//{ "data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing, }, -//{ "data_g2simple_packing", &grib_accessor_class_data_g2simple_packing, }, -//{ "data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing, }, -//{ "data_jpeg2000_packing", &grib_accessor_class_data_jpeg2000_packing, }, -//{ "data_png_packing", &grib_accessor_class_data_png_packing, }, -//{ "data_raw_packing", &grib_accessor_class_data_raw_packing, }, -//{ "data_run_length_packing", &grib_accessor_class_data_run_length_packing, }, -//{ "data_secondary_bitmap", &grib_accessor_class_data_secondary_bitmap, }, -//{ "data_sh_packed", &grib_accessor_class_data_sh_packed, }, -//{ "data_sh_unpacked", &grib_accessor_class_data_sh_unpacked, }, -//{ "data_shsimple_packing", &grib_accessor_class_data_shsimple_packing, }, -//{ "data_simple_packing", &grib_accessor_class_data_simple_packing, }, -//{ "decimal_precision", &grib_accessor_class_decimal_precision, }, -//{ "dictionary", &grib_accessor_class_dictionary, }, -//{ "dirty", &grib_accessor_class_dirty, }, -//{ "divdouble", &grib_accessor_class_divdouble, }, -//{ "double", &grib_accessor_class_double, }, -//{ "element", &grib_accessor_class_element, }, -//{ "evaluate", &grib_accessor_class_evaluate, }, -//{ "expanded_descriptors", &grib_accessor_class_expanded_descriptors, }, -//{ "from_scale_factor_scaled_value", &grib_accessor_class_from_scale_factor_scaled_value, }, -//{ "g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag, }, -//{ "g1_message_length", &grib_accessor_class_g1_message_length, }, -//{ "g1_section4_length", &grib_accessor_class_g1_section4_length, }, -//{ "g1bitmap", &grib_accessor_class_g1bitmap, }, -//{ "g1date", &grib_accessor_class_g1date, }, -//{ "g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date, }, -//{ "g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly, }, -//{ "g1fcperiod", &grib_accessor_class_g1fcperiod, }, -//{ "g1forecastmonth", &grib_accessor_class_g1forecastmonth, }, -//{ "g1monthlydate", &grib_accessor_class_g1monthlydate, }, -//{ "g1number_of_coded_values_sh_complex", &grib_accessor_class_g1number_of_coded_values_sh_complex, }, -//{ "g1number_of_coded_values_sh_simple", &grib_accessor_class_g1number_of_coded_values_sh_simple, }, -//{ "g1step_range", &grib_accessor_class_g1step_range, }, -//{ "g1verificationdate", &grib_accessor_class_g1verificationdate, }, -//{ "g2_aerosol", &grib_accessor_class_g2_aerosol, }, -//{ "g2_chemical", &grib_accessor_class_g2_chemical, }, -//{ "g2_eps", &grib_accessor_class_g2_eps, }, -//{ "g2_mars_labeling", &grib_accessor_class_g2_mars_labeling, }, -//{ "g2bitmap", &grib_accessor_class_g2bitmap, }, -//{ "g2bitmap_present", &grib_accessor_class_g2bitmap_present, }, -//{ "g2date", &grib_accessor_class_g2date, }, -//{ "g2end_step", &grib_accessor_class_g2end_step, }, -//{ "g2grid", &grib_accessor_class_g2grid, }, -//{ "g2latlon", &grib_accessor_class_g2latlon, }, -//{ "g2level", &grib_accessor_class_g2level, }, -//{ "g2lon", &grib_accessor_class_g2lon, }, -//{ "g2step_range", &grib_accessor_class_g2step_range, }, -//{ "gaussian_grid_name", &grib_accessor_class_gaussian_grid_name, }, -//{ "gds_is_present", &grib_accessor_class_gds_is_present, }, -//{ "gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap, }, -//{ "gen", &grib_accessor_class_gen, }, -//{ "getenv", &grib_accessor_class_getenv, }, -//{ "global_gaussian", &grib_accessor_class_global_gaussian, }, -//{ "group", &grib_accessor_class_group, }, -//{ "gts_header", &grib_accessor_class_gts_header, }, -//{ "hash_array", &grib_accessor_class_hash_array, }, -//{ "headers_only", &grib_accessor_class_headers_only, }, -//{ "ibmfloat", &grib_accessor_class_ibmfloat, }, -//{ "ieeefloat", &grib_accessor_class_ieeefloat, }, -//{ "ifs_param", &grib_accessor_class_ifs_param, }, +{ "count_file", &grib_accessor_class_count_file, }, +{ "count_missing", &grib_accessor_class_count_missing, }, +{ "count_total", &grib_accessor_class_count_total, }, +{ "data_apply_bitmap", &grib_accessor_class_data_apply_bitmap, }, +{ "data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic, }, +{ "data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap, }, +{ "data_ccsds_packing", &grib_accessor_class_data_ccsds_packing, }, +{ "data_complex_packing", &grib_accessor_class_data_complex_packing, }, +{ "data_dummy_field", &grib_accessor_class_data_dummy_field, }, +{ "data_g1complex_packing", &grib_accessor_class_data_g1complex_packing, }, +{ "data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing, }, +{ "data_g1second_order_general_extended_packing", &grib_accessor_class_data_g1second_order_general_extended_packing, }, +{ "data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing, }, +{ "data_g1second_order_row_by_row_packing", &grib_accessor_class_data_g1second_order_row_by_row_packing, }, +{ "data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap, }, +{ "data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing, }, +{ "data_g1simple_packing", &grib_accessor_class_data_g1simple_packing, }, +{ "data_g22order_packing", &grib_accessor_class_data_g22order_packing, }, +{ "data_g2bifourier_packing", &grib_accessor_class_data_g2bifourier_packing, }, +{ "data_g2complex_packing", &grib_accessor_class_data_g2complex_packing, }, +{ "data_g2secondary_bitmap", &grib_accessor_class_data_g2secondary_bitmap, }, +{ "data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing, }, +{ "data_g2simple_packing", &grib_accessor_class_data_g2simple_packing, }, +{ "data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing, }, +{ "data_jpeg2000_packing", &grib_accessor_class_data_jpeg2000_packing, }, +{ "data_png_packing", &grib_accessor_class_data_png_packing, }, +{ "data_raw_packing", &grib_accessor_class_data_raw_packing, }, +{ "data_run_length_packing", &grib_accessor_class_data_run_length_packing, }, +{ "data_secondary_bitmap", &grib_accessor_class_data_secondary_bitmap, }, +{ "data_sh_packed", &grib_accessor_class_data_sh_packed, }, +{ "data_sh_unpacked", &grib_accessor_class_data_sh_unpacked, }, +{ "data_shsimple_packing", &grib_accessor_class_data_shsimple_packing, }, +{ "data_simple_packing", &grib_accessor_class_data_simple_packing, }, +{ "decimal_precision", &grib_accessor_class_decimal_precision, }, +{ "dictionary", &grib_accessor_class_dictionary, }, +{ "dirty", &grib_accessor_class_dirty, }, +{ "divdouble", &grib_accessor_class_divdouble, }, +{ "double", &grib_accessor_class_double, }, +{ "element", &grib_accessor_class_element, }, +{ "evaluate", &grib_accessor_class_evaluate, }, +{ "expanded_descriptors", &grib_accessor_class_expanded_descriptors, }, +{ "from_scale_factor_scaled_value", &grib_accessor_class_from_scale_factor_scaled_value, }, +{ "g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag, }, +{ "g1_message_length", &grib_accessor_class_g1_message_length, }, +{ "g1_section4_length", &grib_accessor_class_g1_section4_length, }, +{ "g1bitmap", &grib_accessor_class_g1bitmap, }, +{ "g1date", &grib_accessor_class_g1date, }, +{ "g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date, }, +{ "g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly, }, +{ "g1fcperiod", &grib_accessor_class_g1fcperiod, }, +{ "g1forecastmonth", &grib_accessor_class_g1forecastmonth, }, +{ "g1monthlydate", &grib_accessor_class_g1monthlydate, }, +{ "g1number_of_coded_values_sh_complex", &grib_accessor_class_g1number_of_coded_values_sh_complex, }, +{ "g1number_of_coded_values_sh_simple", &grib_accessor_class_g1number_of_coded_values_sh_simple, }, +{ "g1step_range", &grib_accessor_class_g1step_range, }, +{ "g1verificationdate", &grib_accessor_class_g1verificationdate, }, +{ "g2_aerosol", &grib_accessor_class_g2_aerosol, }, +{ "g2_chemical", &grib_accessor_class_g2_chemical, }, +{ "g2_eps", &grib_accessor_class_g2_eps, }, +{ "g2_mars_labeling", &grib_accessor_class_g2_mars_labeling, }, +{ "g2bitmap", &grib_accessor_class_g2bitmap, }, +{ "g2bitmap_present", &grib_accessor_class_g2bitmap_present, }, +{ "g2date", &grib_accessor_class_g2date, }, +{ "g2end_step", &grib_accessor_class_g2end_step, }, +{ "g2grid", &grib_accessor_class_g2grid, }, +{ "g2latlon", &grib_accessor_class_g2latlon, }, +{ "g2level", &grib_accessor_class_g2level, }, +{ "g2lon", &grib_accessor_class_g2lon, }, +{ "g2step_range", &grib_accessor_class_g2step_range, }, +{ "gaussian_grid_name", &grib_accessor_class_gaussian_grid_name, }, +{ "gds_is_present", &grib_accessor_class_gds_is_present, }, +{ "gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap, }, +{ "gen", &grib_accessor_class_gen, }, +{ "getenv", &grib_accessor_class_getenv, }, +{ "global_gaussian", &grib_accessor_class_global_gaussian, }, +{ "group", &grib_accessor_class_group, }, +{ "gts_header", &grib_accessor_class_gts_header, }, +{ "hash_array", &grib_accessor_class_hash_array, }, +{ "headers_only", &grib_accessor_class_headers_only, }, +{ "ibmfloat", &grib_accessor_class_ibmfloat, }, +{ "ieeefloat", &grib_accessor_class_ieeefloat, }, +{ "ifs_param", &grib_accessor_class_ifs_param, }, { "iterator", &grib_accessor_class_iterator, }, -//{ "julian_date", &grib_accessor_class_julian_date, }, -//{ "julian_day", &grib_accessor_class_julian_day, }, -//{ "ksec1expver", &grib_accessor_class_ksec1expver, }, -//{ "label", &grib_accessor_class_label, }, -//{ "latitudes", &grib_accessor_class_latitudes, }, -//{ "latlon_increment", &grib_accessor_class_latlon_increment, }, -//{ "latlonvalues", &grib_accessor_class_latlonvalues, }, -//{ "library_version", &grib_accessor_class_library_version, }, -//{ "local_definition", &grib_accessor_class_local_definition, }, +{ "julian_date", &grib_accessor_class_julian_date, }, +{ "julian_day", &grib_accessor_class_julian_day, }, +{ "ksec1expver", &grib_accessor_class_ksec1expver, }, +{ "label", &grib_accessor_class_label, }, +{ "latitudes", &grib_accessor_class_latitudes, }, +{ "latlon_increment", &grib_accessor_class_latlon_increment, }, +{ "latlonvalues", &grib_accessor_class_latlonvalues, }, +{ "library_version", &grib_accessor_class_library_version, }, +{ "local_definition", &grib_accessor_class_local_definition, }, { "long", &grib_accessor_class_long, }, -//{ "long_vector", &grib_accessor_class_long_vector, }, -//{ "longitudes", &grib_accessor_class_longitudes, }, -//{ "lookup", &grib_accessor_class_lookup, }, -//{ "mars_param", &grib_accessor_class_mars_param, }, -//{ "mars_step", &grib_accessor_class_mars_step, }, -//{ "md5", &grib_accessor_class_md5, }, -//{ "message", &grib_accessor_class_message, }, -//{ "message_copy", &grib_accessor_class_message_copy, }, -//{ "multdouble", &grib_accessor_class_multdouble, }, +{ "long_vector", &grib_accessor_class_long_vector, }, +{ "longitudes", &grib_accessor_class_longitudes, }, +{ "lookup", &grib_accessor_class_lookup, }, +{ "mars_param", &grib_accessor_class_mars_param, }, +{ "mars_step", &grib_accessor_class_mars_step, }, +{ "md5", &grib_accessor_class_md5, }, +{ "message", &grib_accessor_class_message, }, +{ "message_copy", &grib_accessor_class_message_copy, }, +{ "multdouble", &grib_accessor_class_multdouble, }, { "nearest", &grib_accessor_class_nearest, }, -//{ "non_alpha", &grib_accessor_class_non_alpha, }, -//{ "number_of_coded_values", &grib_accessor_class_number_of_coded_values, }, -//{ "number_of_points", &grib_accessor_class_number_of_points, }, -//{ "number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian, }, -//{ "number_of_values", &grib_accessor_class_number_of_values, }, -//{ "number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing, }, -//{ "octahedral_gaussian", &grib_accessor_class_octahedral_gaussian, }, -//{ "octet_number", &grib_accessor_class_octet_number, }, -//{ "offset_file", &grib_accessor_class_offset_file, }, -//{ "offset_values", &grib_accessor_class_offset_values, }, -//{ "optimal_step_units", &grib_accessor_class_optimal_step_units, }, -//{ "pack_bufr_values", &grib_accessor_class_pack_bufr_values, }, -//{ "packing_type", &grib_accessor_class_packing_type, }, -//{ "pad", &grib_accessor_class_pad, }, -//{ "padding", &grib_accessor_class_padding, }, -//{ "padto", &grib_accessor_class_padto, }, -//{ "padtoeven", &grib_accessor_class_padtoeven, }, -//{ "padtomultiple", &grib_accessor_class_padtomultiple, }, -//{ "position", &grib_accessor_class_position, }, -//{ "proj_string", &grib_accessor_class_proj_string, }, -//{ "raw", &grib_accessor_class_raw, }, -//{ "rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date, }, -//{ "reference_value_error", &grib_accessor_class_reference_value_error, }, -//{ "round", &grib_accessor_class_round, }, -//{ "scale", &grib_accessor_class_scale, }, -//{ "scale_values", &grib_accessor_class_scale_values, }, -//{ "second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value, }, -//{ "section", &grib_accessor_class_section, }, -//{ "section_length", &grib_accessor_class_section_length, }, -//{ "section_padding", &grib_accessor_class_section_padding, }, -//{ "section_pointer", &grib_accessor_class_section_pointer, }, -//{ "select_step_template", &grib_accessor_class_select_step_template, }, -//{ "sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal, }, -//{ "signed", &grib_accessor_class_signed, }, -//{ "signed_bits", &grib_accessor_class_signed_bits, }, -//{ "simple_packing_error", &grib_accessor_class_simple_packing_error, }, -//{ "size", &grib_accessor_class_size, }, +{ "non_alpha", &grib_accessor_class_non_alpha, }, +{ "number_of_coded_values", &grib_accessor_class_number_of_coded_values, }, +{ "number_of_points", &grib_accessor_class_number_of_points, }, +{ "number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian, }, +{ "number_of_values", &grib_accessor_class_number_of_values, }, +{ "number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing, }, +{ "octahedral_gaussian", &grib_accessor_class_octahedral_gaussian, }, +{ "octet_number", &grib_accessor_class_octet_number, }, +{ "offset_file", &grib_accessor_class_offset_file, }, +{ "offset_values", &grib_accessor_class_offset_values, }, +{ "optimal_step_units", &grib_accessor_class_optimal_step_units, }, +{ "pack_bufr_values", &grib_accessor_class_pack_bufr_values, }, +{ "packing_type", &grib_accessor_class_packing_type, }, +{ "pad", &grib_accessor_class_pad, }, +{ "padding", &grib_accessor_class_padding, }, +{ "padto", &grib_accessor_class_padto, }, +{ "padtoeven", &grib_accessor_class_padtoeven, }, +{ "padtomultiple", &grib_accessor_class_padtomultiple, }, +{ "position", &grib_accessor_class_position, }, +{ "proj_string", &grib_accessor_class_proj_string, }, +{ "raw", &grib_accessor_class_raw, }, +{ "rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date, }, +{ "reference_value_error", &grib_accessor_class_reference_value_error, }, +{ "round", &grib_accessor_class_round, }, +{ "scale", &grib_accessor_class_scale, }, +{ "scale_values", &grib_accessor_class_scale_values, }, +{ "second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value, }, +{ "section", &grib_accessor_class_section, }, +{ "section_length", &grib_accessor_class_section_length, }, +{ "section_padding", &grib_accessor_class_section_padding, }, +{ "section_pointer", &grib_accessor_class_section_pointer, }, +{ "select_step_template", &grib_accessor_class_select_step_template, }, +{ "sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal, }, +{ "signed", &grib_accessor_class_signed, }, +{ "signed_bits", &grib_accessor_class_signed_bits, }, +{ "simple_packing_error", &grib_accessor_class_simple_packing_error, }, +{ "size", &grib_accessor_class_size, }, { "smart_table", &grib_accessor_class_smart_table, }, -//{ "smart_table_column", &grib_accessor_class_smart_table_column, }, -//{ "spd", &grib_accessor_class_spd, }, -//{ "spectral_truncation", &grib_accessor_class_spectral_truncation, }, -//{ "sprintf", &grib_accessor_class_sprintf, }, -//{ "statistics", &grib_accessor_class_statistics, }, -//{ "statistics_spectral", &grib_accessor_class_statistics_spectral, }, -//{ "step_human_readable", &grib_accessor_class_step_human_readable, }, -//{ "step_in_units", &grib_accessor_class_step_in_units, }, -//{ "sum", &grib_accessor_class_sum, }, -//{ "suppressed", &grib_accessor_class_suppressed, }, -//{ "time", &grib_accessor_class_time, }, -//{ "to_double", &grib_accessor_class_to_double, }, -//{ "to_integer", &grib_accessor_class_to_integer, }, -//{ "to_string", &grib_accessor_class_to_string, }, +{ "smart_table_column", &grib_accessor_class_smart_table_column, }, +{ "spd", &grib_accessor_class_spd, }, +{ "spectral_truncation", &grib_accessor_class_spectral_truncation, }, +{ "sprintf", &grib_accessor_class_sprintf, }, +{ "statistics", &grib_accessor_class_statistics, }, +{ "statistics_spectral", &grib_accessor_class_statistics_spectral, }, +{ "step_human_readable", &grib_accessor_class_step_human_readable, }, +{ "step_in_units", &grib_accessor_class_step_in_units, }, +{ "sum", &grib_accessor_class_sum, }, +{ "suppressed", &grib_accessor_class_suppressed, }, +{ "time", &grib_accessor_class_time, }, +{ "to_double", &grib_accessor_class_to_double, }, +{ "to_integer", &grib_accessor_class_to_integer, }, +{ "to_string", &grib_accessor_class_to_string, }, { "transient", &grib_accessor_class_transient, }, -//{ "transient_darray", &grib_accessor_class_transient_darray, }, -//{ "trim", &grib_accessor_class_trim, }, -//{ "uint16", &grib_accessor_class_uint16, }, -//{ "uint32", &grib_accessor_class_uint32, }, -//{ "uint32_little_endian", &grib_accessor_class_uint32_little_endian, }, -//{ "uint64", &grib_accessor_class_uint64, }, -//{ "uint64_little_endian", &grib_accessor_class_uint64_little_endian, }, -//{ "uint8", &grib_accessor_class_uint8, }, -//{ "unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors, }, -//{ "unpack_bufr_values", &grib_accessor_class_unpack_bufr_values, }, +{ "transient_darray", &grib_accessor_class_transient_darray, }, +{ "trim", &grib_accessor_class_trim, }, +{ "uint16", &grib_accessor_class_uint16, }, +{ "uint32", &grib_accessor_class_uint32, }, +{ "uint32_little_endian", &grib_accessor_class_uint32_little_endian, }, +{ "uint64", &grib_accessor_class_uint64, }, +{ "uint64_little_endian", &grib_accessor_class_uint64_little_endian, }, +{ "uint8", &grib_accessor_class_uint8, }, +{ "unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors, }, +{ "unpack_bufr_values", &grib_accessor_class_unpack_bufr_values, }, { "unsigned", &grib_accessor_class_unsigned, }, -//{ "unsigned_bits", &grib_accessor_class_unsigned_bits, }, -//{ "validity_date", &grib_accessor_class_validity_date, }, -//{ "validity_time", &grib_accessor_class_validity_time, }, -//{ "values", &grib_accessor_class_values, }, +{ "unsigned_bits", &grib_accessor_class_unsigned_bits, }, +{ "validity_date", &grib_accessor_class_validity_date, }, +{ "validity_time", &grib_accessor_class_validity_time, }, +{ "values", &grib_accessor_class_values, }, { "variable", &grib_accessor_class_variable, }, -//{ "vector", &grib_accessor_class_vector, }, -//{ "when", &grib_accessor_class_when, }, +{ "vector", &grib_accessor_class_vector, }, +{ "when", &grib_accessor_class_when, }, diff --git a/src/grib_accessor_factory_hash_list b/src/grib_accessor_factory_hash_list index 136aedc43..1f7687f38 100644 --- a/src/grib_accessor_factory_hash_list +++ b/src/grib_accessor_factory_hash_list @@ -1,206 +1,206 @@ /* This file is automatically generated by ./make_class.pl, do not edit */ -#abstract_long_vector, &grib_accessor_class_abstract_long_vector -#abstract_vector, &grib_accessor_class_abstract_vector -#ascii, &grib_accessor_class_ascii -#bit, &grib_accessor_class_bit -#bitmap, &grib_accessor_class_bitmap -#bits, &grib_accessor_class_bits -#bits_per_value, &grib_accessor_class_bits_per_value -#blob, &grib_accessor_class_blob -#budgdate, &grib_accessor_class_budgdate -#bufr_data_array, &grib_accessor_class_bufr_data_array -#bufr_data_element, &grib_accessor_class_bufr_data_element -#bufr_elements_table, &grib_accessor_class_bufr_elements_table -#bufr_extract_area_subsets, &grib_accessor_class_bufr_extract_area_subsets -#bufr_extract_datetime_subsets, &grib_accessor_class_bufr_extract_datetime_subsets -#bufr_extract_subsets, &grib_accessor_class_bufr_extract_subsets -#bufr_group, &grib_accessor_class_bufr_group -#bufr_simple_thinning, &grib_accessor_class_bufr_simple_thinning -#bufr_string_values, &grib_accessor_class_bufr_string_values -#bufrdc_expanded_descriptors, &grib_accessor_class_bufrdc_expanded_descriptors -#bytes, &grib_accessor_class_bytes -#change_alternative_row_scanning, &grib_accessor_class_change_alternative_row_scanning -#change_scanning_direction, &grib_accessor_class_change_scanning_direction -#check_internal_version, &grib_accessor_class_check_internal_version -#closest_date, &grib_accessor_class_closest_date -#codeflag, &grib_accessor_class_codeflag +abstract_long_vector, &grib_accessor_class_abstract_long_vector +abstract_vector, &grib_accessor_class_abstract_vector +ascii, &grib_accessor_class_ascii +bit, &grib_accessor_class_bit +bitmap, &grib_accessor_class_bitmap +bits, &grib_accessor_class_bits +bits_per_value, &grib_accessor_class_bits_per_value +blob, &grib_accessor_class_blob +budgdate, &grib_accessor_class_budgdate +bufr_data_array, &grib_accessor_class_bufr_data_array +bufr_data_element, &grib_accessor_class_bufr_data_element +bufr_elements_table, &grib_accessor_class_bufr_elements_table +bufr_extract_area_subsets, &grib_accessor_class_bufr_extract_area_subsets +bufr_extract_datetime_subsets, &grib_accessor_class_bufr_extract_datetime_subsets +bufr_extract_subsets, &grib_accessor_class_bufr_extract_subsets +bufr_group, &grib_accessor_class_bufr_group +bufr_simple_thinning, &grib_accessor_class_bufr_simple_thinning +bufr_string_values, &grib_accessor_class_bufr_string_values +bufrdc_expanded_descriptors, &grib_accessor_class_bufrdc_expanded_descriptors +bytes, &grib_accessor_class_bytes +change_alternative_row_scanning, &grib_accessor_class_change_alternative_row_scanning +change_scanning_direction, &grib_accessor_class_change_scanning_direction +check_internal_version, &grib_accessor_class_check_internal_version +closest_date, &grib_accessor_class_closest_date +codeflag, &grib_accessor_class_codeflag codetable, &grib_accessor_class_codetable -#codetable_title, &grib_accessor_class_codetable_title -#codetable_units, &grib_accessor_class_codetable_units -#concept, &grib_accessor_class_concept +codetable_title, &grib_accessor_class_codetable_title +codetable_units, &grib_accessor_class_codetable_units +concept, &grib_accessor_class_concept constant, &grib_accessor_class_constant -#count_file, &grib_accessor_class_count_file -#count_missing, &grib_accessor_class_count_missing -#count_total, &grib_accessor_class_count_total -#data_apply_bitmap, &grib_accessor_class_data_apply_bitmap -#data_apply_boustrophedonic, &grib_accessor_class_data_apply_boustrophedonic -#data_apply_boustrophedonic_bitmap, &grib_accessor_class_data_apply_boustrophedonic_bitmap -#data_ccsds_packing, &grib_accessor_class_data_ccsds_packing -#data_complex_packing, &grib_accessor_class_data_complex_packing -#data_dummy_field, &grib_accessor_class_data_dummy_field -#data_g1complex_packing, &grib_accessor_class_data_g1complex_packing -#data_g1second_order_constant_width_packing, &grib_accessor_class_data_g1second_order_constant_width_packing -#data_g1second_order_general_extended_packing, &grib_accessor_class_data_g1second_order_general_extended_packing -#data_g1second_order_general_packing, &grib_accessor_class_data_g1second_order_general_packing -#data_g1second_order_row_by_row_packing, &grib_accessor_class_data_g1second_order_row_by_row_packing -#data_g1secondary_bitmap, &grib_accessor_class_data_g1secondary_bitmap -#data_g1shsimple_packing, &grib_accessor_class_data_g1shsimple_packing -#data_g1simple_packing, &grib_accessor_class_data_g1simple_packing -#data_g22order_packing, &grib_accessor_class_data_g22order_packing -#data_g2bifourier_packing, &grib_accessor_class_data_g2bifourier_packing -#data_g2complex_packing, &grib_accessor_class_data_g2complex_packing -#data_g2secondary_bitmap, &grib_accessor_class_data_g2secondary_bitmap -#data_g2shsimple_packing, &grib_accessor_class_data_g2shsimple_packing -#data_g2simple_packing, &grib_accessor_class_data_g2simple_packing -#data_g2simple_packing_with_preprocessing, &grib_accessor_class_data_g2simple_packing_with_preprocessing -#data_jpeg2000_packing, &grib_accessor_class_data_jpeg2000_packing -#data_png_packing, &grib_accessor_class_data_png_packing -#data_raw_packing, &grib_accessor_class_data_raw_packing -#data_run_length_packing, &grib_accessor_class_data_run_length_packing -#data_secondary_bitmap, &grib_accessor_class_data_secondary_bitmap -#data_sh_packed, &grib_accessor_class_data_sh_packed -#data_sh_unpacked, &grib_accessor_class_data_sh_unpacked -#data_shsimple_packing, &grib_accessor_class_data_shsimple_packing -#data_simple_packing, &grib_accessor_class_data_simple_packing -#decimal_precision, &grib_accessor_class_decimal_precision -#dictionary, &grib_accessor_class_dictionary -#dirty, &grib_accessor_class_dirty -#divdouble, &grib_accessor_class_divdouble -#double, &grib_accessor_class_double -#element, &grib_accessor_class_element -#evaluate, &grib_accessor_class_evaluate -#expanded_descriptors, &grib_accessor_class_expanded_descriptors -#from_scale_factor_scaled_value, &grib_accessor_class_from_scale_factor_scaled_value -#g1_half_byte_codeflag, &grib_accessor_class_g1_half_byte_codeflag -#g1_message_length, &grib_accessor_class_g1_message_length -#g1_section4_length, &grib_accessor_class_g1_section4_length -#g1bitmap, &grib_accessor_class_g1bitmap -#g1date, &grib_accessor_class_g1date -#g1day_of_the_year_date, &grib_accessor_class_g1day_of_the_year_date -#g1end_of_interval_monthly, &grib_accessor_class_g1end_of_interval_monthly -#g1fcperiod, &grib_accessor_class_g1fcperiod -#g1forecastmonth, &grib_accessor_class_g1forecastmonth -#g1monthlydate, &grib_accessor_class_g1monthlydate -#g1number_of_coded_values_sh_complex, &grib_accessor_class_g1number_of_coded_values_sh_complex -#g1number_of_coded_values_sh_simple, &grib_accessor_class_g1number_of_coded_values_sh_simple -#g1step_range, &grib_accessor_class_g1step_range -#g1verificationdate, &grib_accessor_class_g1verificationdate -#g2_aerosol, &grib_accessor_class_g2_aerosol -#g2_chemical, &grib_accessor_class_g2_chemical -#g2_eps, &grib_accessor_class_g2_eps -#g2_mars_labeling, &grib_accessor_class_g2_mars_labeling -#g2bitmap, &grib_accessor_class_g2bitmap -#g2bitmap_present, &grib_accessor_class_g2bitmap_present -#g2date, &grib_accessor_class_g2date -#g2end_step, &grib_accessor_class_g2end_step -#g2grid, &grib_accessor_class_g2grid -#g2latlon, &grib_accessor_class_g2latlon -#g2level, &grib_accessor_class_g2level -#g2lon, &grib_accessor_class_g2lon -#g2step_range, &grib_accessor_class_g2step_range -#gaussian_grid_name, &grib_accessor_class_gaussian_grid_name -#gds_is_present, &grib_accessor_class_gds_is_present -#gds_not_present_bitmap, &grib_accessor_class_gds_not_present_bitmap -#gen, &grib_accessor_class_gen -#getenv, &grib_accessor_class_getenv -#global_gaussian, &grib_accessor_class_global_gaussian -#group, &grib_accessor_class_group -#gts_header, &grib_accessor_class_gts_header -#hash_array, &grib_accessor_class_hash_array -#headers_only, &grib_accessor_class_headers_only -#ibmfloat, &grib_accessor_class_ibmfloat -#ieeefloat, &grib_accessor_class_ieeefloat -#ifs_param, &grib_accessor_class_ifs_param +count_file, &grib_accessor_class_count_file +count_missing, &grib_accessor_class_count_missing +count_total, &grib_accessor_class_count_total +data_apply_bitmap, &grib_accessor_class_data_apply_bitmap +data_apply_boustrophedonic, &grib_accessor_class_data_apply_boustrophedonic +data_apply_boustrophedonic_bitmap, &grib_accessor_class_data_apply_boustrophedonic_bitmap +data_ccsds_packing, &grib_accessor_class_data_ccsds_packing +data_complex_packing, &grib_accessor_class_data_complex_packing +data_dummy_field, &grib_accessor_class_data_dummy_field +data_g1complex_packing, &grib_accessor_class_data_g1complex_packing +data_g1second_order_constant_width_packing, &grib_accessor_class_data_g1second_order_constant_width_packing +data_g1second_order_general_extended_packing, &grib_accessor_class_data_g1second_order_general_extended_packing +data_g1second_order_general_packing, &grib_accessor_class_data_g1second_order_general_packing +data_g1second_order_row_by_row_packing, &grib_accessor_class_data_g1second_order_row_by_row_packing +data_g1secondary_bitmap, &grib_accessor_class_data_g1secondary_bitmap +data_g1shsimple_packing, &grib_accessor_class_data_g1shsimple_packing +data_g1simple_packing, &grib_accessor_class_data_g1simple_packing +data_g22order_packing, &grib_accessor_class_data_g22order_packing +data_g2bifourier_packing, &grib_accessor_class_data_g2bifourier_packing +data_g2complex_packing, &grib_accessor_class_data_g2complex_packing +data_g2secondary_bitmap, &grib_accessor_class_data_g2secondary_bitmap +data_g2shsimple_packing, &grib_accessor_class_data_g2shsimple_packing +data_g2simple_packing, &grib_accessor_class_data_g2simple_packing +data_g2simple_packing_with_preprocessing, &grib_accessor_class_data_g2simple_packing_with_preprocessing +data_jpeg2000_packing, &grib_accessor_class_data_jpeg2000_packing +data_png_packing, &grib_accessor_class_data_png_packing +data_raw_packing, &grib_accessor_class_data_raw_packing +data_run_length_packing, &grib_accessor_class_data_run_length_packing +data_secondary_bitmap, &grib_accessor_class_data_secondary_bitmap +data_sh_packed, &grib_accessor_class_data_sh_packed +data_sh_unpacked, &grib_accessor_class_data_sh_unpacked +data_shsimple_packing, &grib_accessor_class_data_shsimple_packing +data_simple_packing, &grib_accessor_class_data_simple_packing +decimal_precision, &grib_accessor_class_decimal_precision +dictionary, &grib_accessor_class_dictionary +dirty, &grib_accessor_class_dirty +divdouble, &grib_accessor_class_divdouble +double, &grib_accessor_class_double +element, &grib_accessor_class_element +evaluate, &grib_accessor_class_evaluate +expanded_descriptors, &grib_accessor_class_expanded_descriptors +from_scale_factor_scaled_value, &grib_accessor_class_from_scale_factor_scaled_value +g1_half_byte_codeflag, &grib_accessor_class_g1_half_byte_codeflag +g1_message_length, &grib_accessor_class_g1_message_length +g1_section4_length, &grib_accessor_class_g1_section4_length +g1bitmap, &grib_accessor_class_g1bitmap +g1date, &grib_accessor_class_g1date +g1day_of_the_year_date, &grib_accessor_class_g1day_of_the_year_date +g1end_of_interval_monthly, &grib_accessor_class_g1end_of_interval_monthly +g1fcperiod, &grib_accessor_class_g1fcperiod +g1forecastmonth, &grib_accessor_class_g1forecastmonth +g1monthlydate, &grib_accessor_class_g1monthlydate +g1number_of_coded_values_sh_complex, &grib_accessor_class_g1number_of_coded_values_sh_complex +g1number_of_coded_values_sh_simple, &grib_accessor_class_g1number_of_coded_values_sh_simple +g1step_range, &grib_accessor_class_g1step_range +g1verificationdate, &grib_accessor_class_g1verificationdate +g2_aerosol, &grib_accessor_class_g2_aerosol +g2_chemical, &grib_accessor_class_g2_chemical +g2_eps, &grib_accessor_class_g2_eps +g2_mars_labeling, &grib_accessor_class_g2_mars_labeling +g2bitmap, &grib_accessor_class_g2bitmap +g2bitmap_present, &grib_accessor_class_g2bitmap_present +g2date, &grib_accessor_class_g2date +g2end_step, &grib_accessor_class_g2end_step +g2grid, &grib_accessor_class_g2grid +g2latlon, &grib_accessor_class_g2latlon +g2level, &grib_accessor_class_g2level +g2lon, &grib_accessor_class_g2lon +g2step_range, &grib_accessor_class_g2step_range +gaussian_grid_name, &grib_accessor_class_gaussian_grid_name +gds_is_present, &grib_accessor_class_gds_is_present +gds_not_present_bitmap, &grib_accessor_class_gds_not_present_bitmap +gen, &grib_accessor_class_gen +getenv, &grib_accessor_class_getenv +global_gaussian, &grib_accessor_class_global_gaussian +group, &grib_accessor_class_group +gts_header, &grib_accessor_class_gts_header +hash_array, &grib_accessor_class_hash_array +headers_only, &grib_accessor_class_headers_only +ibmfloat, &grib_accessor_class_ibmfloat +ieeefloat, &grib_accessor_class_ieeefloat +ifs_param, &grib_accessor_class_ifs_param iterator, &grib_accessor_class_iterator -#julian_date, &grib_accessor_class_julian_date -#julian_day, &grib_accessor_class_julian_day -#ksec1expver, &grib_accessor_class_ksec1expver -#label, &grib_accessor_class_label -#latitudes, &grib_accessor_class_latitudes -#latlon_increment, &grib_accessor_class_latlon_increment -#latlonvalues, &grib_accessor_class_latlonvalues -#library_version, &grib_accessor_class_library_version -#local_definition, &grib_accessor_class_local_definition +julian_date, &grib_accessor_class_julian_date +julian_day, &grib_accessor_class_julian_day +ksec1expver, &grib_accessor_class_ksec1expver +label, &grib_accessor_class_label +latitudes, &grib_accessor_class_latitudes +latlon_increment, &grib_accessor_class_latlon_increment +latlonvalues, &grib_accessor_class_latlonvalues +library_version, &grib_accessor_class_library_version +local_definition, &grib_accessor_class_local_definition long, &grib_accessor_class_long -#long_vector, &grib_accessor_class_long_vector -#longitudes, &grib_accessor_class_longitudes -#lookup, &grib_accessor_class_lookup -#mars_param, &grib_accessor_class_mars_param -#mars_step, &grib_accessor_class_mars_step -#md5, &grib_accessor_class_md5 -#message, &grib_accessor_class_message -#message_copy, &grib_accessor_class_message_copy -#multdouble, &grib_accessor_class_multdouble +long_vector, &grib_accessor_class_long_vector +longitudes, &grib_accessor_class_longitudes +lookup, &grib_accessor_class_lookup +mars_param, &grib_accessor_class_mars_param +mars_step, &grib_accessor_class_mars_step +md5, &grib_accessor_class_md5 +message, &grib_accessor_class_message +message_copy, &grib_accessor_class_message_copy +multdouble, &grib_accessor_class_multdouble nearest, &grib_accessor_class_nearest -#non_alpha, &grib_accessor_class_non_alpha -#number_of_coded_values, &grib_accessor_class_number_of_coded_values -#number_of_points, &grib_accessor_class_number_of_points -#number_of_points_gaussian, &grib_accessor_class_number_of_points_gaussian -#number_of_values, &grib_accessor_class_number_of_values -#number_of_values_data_raw_packing, &grib_accessor_class_number_of_values_data_raw_packing -#octahedral_gaussian, &grib_accessor_class_octahedral_gaussian -#octet_number, &grib_accessor_class_octet_number -#offset_file, &grib_accessor_class_offset_file -#offset_values, &grib_accessor_class_offset_values -#optimal_step_units, &grib_accessor_class_optimal_step_units -#pack_bufr_values, &grib_accessor_class_pack_bufr_values -#packing_type, &grib_accessor_class_packing_type -#pad, &grib_accessor_class_pad -#padding, &grib_accessor_class_padding -#padto, &grib_accessor_class_padto -#padtoeven, &grib_accessor_class_padtoeven -#padtomultiple, &grib_accessor_class_padtomultiple -#position, &grib_accessor_class_position -#proj_string, &grib_accessor_class_proj_string -#raw, &grib_accessor_class_raw -#rdbtime_guess_date, &grib_accessor_class_rdbtime_guess_date -#reference_value_error, &grib_accessor_class_reference_value_error -#round, &grib_accessor_class_round -#scale, &grib_accessor_class_scale -#scale_values, &grib_accessor_class_scale_values -#second_order_bits_per_value, &grib_accessor_class_second_order_bits_per_value -#section, &grib_accessor_class_section -#section_length, &grib_accessor_class_section_length -#section_padding, &grib_accessor_class_section_padding -#section_pointer, &grib_accessor_class_section_pointer -#select_step_template, &grib_accessor_class_select_step_template -#sexagesimal2decimal, &grib_accessor_class_sexagesimal2decimal -#signed, &grib_accessor_class_signed -#signed_bits, &grib_accessor_class_signed_bits -#simple_packing_error, &grib_accessor_class_simple_packing_error -#size, &grib_accessor_class_size +non_alpha, &grib_accessor_class_non_alpha +number_of_coded_values, &grib_accessor_class_number_of_coded_values +number_of_points, &grib_accessor_class_number_of_points +number_of_points_gaussian, &grib_accessor_class_number_of_points_gaussian +number_of_values, &grib_accessor_class_number_of_values +number_of_values_data_raw_packing, &grib_accessor_class_number_of_values_data_raw_packing +octahedral_gaussian, &grib_accessor_class_octahedral_gaussian +octet_number, &grib_accessor_class_octet_number +offset_file, &grib_accessor_class_offset_file +offset_values, &grib_accessor_class_offset_values +optimal_step_units, &grib_accessor_class_optimal_step_units +pack_bufr_values, &grib_accessor_class_pack_bufr_values +packing_type, &grib_accessor_class_packing_type +pad, &grib_accessor_class_pad +padding, &grib_accessor_class_padding +padto, &grib_accessor_class_padto +padtoeven, &grib_accessor_class_padtoeven +padtomultiple, &grib_accessor_class_padtomultiple +position, &grib_accessor_class_position +proj_string, &grib_accessor_class_proj_string +raw, &grib_accessor_class_raw +rdbtime_guess_date, &grib_accessor_class_rdbtime_guess_date +reference_value_error, &grib_accessor_class_reference_value_error +round, &grib_accessor_class_round +scale, &grib_accessor_class_scale +scale_values, &grib_accessor_class_scale_values +second_order_bits_per_value, &grib_accessor_class_second_order_bits_per_value +section, &grib_accessor_class_section +section_length, &grib_accessor_class_section_length +section_padding, &grib_accessor_class_section_padding +section_pointer, &grib_accessor_class_section_pointer +select_step_template, &grib_accessor_class_select_step_template +sexagesimal2decimal, &grib_accessor_class_sexagesimal2decimal +signed, &grib_accessor_class_signed +signed_bits, &grib_accessor_class_signed_bits +simple_packing_error, &grib_accessor_class_simple_packing_error +size, &grib_accessor_class_size smart_table, &grib_accessor_class_smart_table -#smart_table_column, &grib_accessor_class_smart_table_column -#spd, &grib_accessor_class_spd -#spectral_truncation, &grib_accessor_class_spectral_truncation -#sprintf, &grib_accessor_class_sprintf -#statistics, &grib_accessor_class_statistics -#statistics_spectral, &grib_accessor_class_statistics_spectral -#step_human_readable, &grib_accessor_class_step_human_readable -#step_in_units, &grib_accessor_class_step_in_units -#sum, &grib_accessor_class_sum -#suppressed, &grib_accessor_class_suppressed -#time, &grib_accessor_class_time -#to_double, &grib_accessor_class_to_double -#to_integer, &grib_accessor_class_to_integer -#to_string, &grib_accessor_class_to_string +smart_table_column, &grib_accessor_class_smart_table_column +spd, &grib_accessor_class_spd +spectral_truncation, &grib_accessor_class_spectral_truncation +sprintf, &grib_accessor_class_sprintf +statistics, &grib_accessor_class_statistics +statistics_spectral, &grib_accessor_class_statistics_spectral +step_human_readable, &grib_accessor_class_step_human_readable +step_in_units, &grib_accessor_class_step_in_units +sum, &grib_accessor_class_sum +suppressed, &grib_accessor_class_suppressed +time, &grib_accessor_class_time +to_double, &grib_accessor_class_to_double +to_integer, &grib_accessor_class_to_integer +to_string, &grib_accessor_class_to_string transient, &grib_accessor_class_transient -#transient_darray, &grib_accessor_class_transient_darray -#trim, &grib_accessor_class_trim -#uint16, &grib_accessor_class_uint16 -#uint32, &grib_accessor_class_uint32 -#uint32_little_endian, &grib_accessor_class_uint32_little_endian -#uint64, &grib_accessor_class_uint64 -#uint64_little_endian, &grib_accessor_class_uint64_little_endian -#uint8, &grib_accessor_class_uint8 -#unexpanded_descriptors, &grib_accessor_class_unexpanded_descriptors -#unpack_bufr_values, &grib_accessor_class_unpack_bufr_values +transient_darray, &grib_accessor_class_transient_darray +trim, &grib_accessor_class_trim +uint16, &grib_accessor_class_uint16 +uint32, &grib_accessor_class_uint32 +uint32_little_endian, &grib_accessor_class_uint32_little_endian +uint64, &grib_accessor_class_uint64 +uint64_little_endian, &grib_accessor_class_uint64_little_endian +uint8, &grib_accessor_class_uint8 +unexpanded_descriptors, &grib_accessor_class_unexpanded_descriptors +unpack_bufr_values, &grib_accessor_class_unpack_bufr_values unsigned, &grib_accessor_class_unsigned -#unsigned_bits, &grib_accessor_class_unsigned_bits -#validity_date, &grib_accessor_class_validity_date -#validity_time, &grib_accessor_class_validity_time -#values, &grib_accessor_class_values +unsigned_bits, &grib_accessor_class_unsigned_bits +validity_date, &grib_accessor_class_validity_date +validity_time, &grib_accessor_class_validity_time +values, &grib_accessor_class_values variable, &grib_accessor_class_variable -#vector, &grib_accessor_class_vector -#when, &grib_accessor_class_when +vector, &grib_accessor_class_vector +when, &grib_accessor_class_when diff --git a/src/shared_functions.cc b/src/shared_functions.cc new file mode 100644 index 000000000..fc6f090fb --- /dev/null +++ b/src/shared_functions.cc @@ -0,0 +1,47 @@ +#include "shared_functions.h" + + +/* Table of multipliers to convert step units to minutes */ +static const double u2m[] = { + 1, /* index 0: minutes */ + 60, /* index 1: hour */ + 24 * 60, /* index 2: day */ + 24 * 60 * 30, /* index 3: month */ + -1, /* index 4: year */ + -1, /* index 5: decade */ + -1, /* index 6: 30 years */ + -1, /* index 7: century */ + -1, /* index 8: RESERVED */ + -1, /* index 9: RESERVED */ + 3 * 60, /* index 10: 3 hours */ + 6 * 60, /* index 11: 6 hours */ + 12 * 60, /* index 12: 12 hours */ + 1 / 60.0, /* index 13: seconds */ + 15, /* index 14: 15 mins */ + 30 /* index 15: 30 mins */ +}; + + +void grib_set_bit_on(unsigned char* p, long* bitp){ + unsigned char o = 1; + p += (*bitp >> 3); + o <<= 7 - ((*bitp) % 8); + *p |= o; + (*bitp) += 1; +} + +long convert_to_minutes(long step, long stepUnits) +{ + double result = 0; + if (stepUnits == 0) + return step; /* unit=minutes so no change */ + if (stepUnits == 1) + return step * 60; /* unit=hours */ + if (stepUnits == 13) + return step / 60; /* unit=seconds */ + /* Assert( stepUnits < sizeof(u2m)/sizeof(u2m[0]) ); */ + + result = step * u2m[stepUnits]; + return (long)result; +} + diff --git a/src/shared_functions.h b/src/shared_functions.h new file mode 100644 index 000000000..04ae2f90f --- /dev/null +++ b/src/shared_functions.h @@ -0,0 +1,9 @@ +#ifndef eccodes_shared_functions_h +#define eccodes_shared_functions_h + +#include "grib_api_internal.h" + +void grib_set_bit_on(unsigned char*, long*); +long convert_to_minutes(long step, long stepUnits); + +#endif // eccodes_shared_functions_h From 8529fc3a1f6d3e2a6cfeecf118928b3d1c550698 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 19 Mar 2024 12:17:17 +0000 Subject: [PATCH 009/196] Enable disabled BUFR function calls --- src/grib_bufr_descriptor.cc | 9 +++------ src/grib_query.cc | 12 +++--------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/grib_bufr_descriptor.cc b/src/grib_bufr_descriptor.cc index ef6bc1fbc..6b7f2b3ce 100644 --- a/src/grib_bufr_descriptor.cc +++ b/src/grib_bufr_descriptor.cc @@ -9,16 +9,13 @@ */ -#include "grib_scaling.h" #include "grib_api_internal.h" +#include "accessor/grib_accessor_class_bufr_data_array.h" +#include "grib_scaling.h" bufr_descriptor* grib_bufr_descriptor_new(grib_accessor* tables_accessor, int code, int silent, int* err) { - // ===== TODO(maee): Enable this when grib_accessor_class_bufr_elements_table.cc is moved to C++ ===== - throw std::runtime_error("grib_bufr_descriptor_new not implemented"); - bufr_descriptor* ret = NULL; - //bufr_descriptor* ret = accessor_bufr_elements_table_get_descriptor(tables_accessor, code, err); - // ===== END TODO ===== + bufr_descriptor* ret = accessor_bufr_elements_table_get_descriptor(tables_accessor, code, err); if (!silent && *err) grib_context_log(tables_accessor->context, GRIB_LOG_ERROR, "unable to get descriptor %06d from table", code); diff --git a/src/grib_query.cc b/src/grib_query.cc index e8d82541d..7b2ecb08a 100644 --- a/src/grib_query.cc +++ b/src/grib_query.cc @@ -14,6 +14,7 @@ * * ***************************************************************************/ #include "grib_api_internal.h" +#include "accessor/grib_accessor_class_bufr_data_array.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 */ @@ -213,11 +214,7 @@ static char* get_condition(const char* name, codes_condition* condition) static grib_accessor* _search_by_rank(grib_accessor* a, const char* name, int rank) { - // ===== TODO(maee): Enable when grib_accessor_class_bufr_data_array.cc is moved to C++ ===== - throw "grib_accessor_class_bufr_data_array.cc is not yet moved to C++"; - grib_trie_with_rank* t = NULL; - //grib_trie_with_rank* t = accessor_bufr_data_array_get_dataAccessorsTrie(a); - // ===== END TODO ===== + grib_trie_with_rank* t = accessor_bufr_data_array_get_dataAccessorsTrie(a); grib_accessor* ret = (grib_accessor*)grib_trie_with_rank_get(t, name, rank); return ret; } @@ -438,10 +435,7 @@ static grib_accessors_list* search_by_condition(grib_handle* h, const char* name grib_accessors_list* result = NULL; grib_accessor* data = search_and_cache(h, "dataAccessors", 0); if (data && condition->left) { - // ===== TODO(maee): Enable when grib_accessor_class_bufr_data_array.cc is moved to C++ ===== - //al = accessor_bufr_data_array_get_dataAccessors(data); - throw "grib_accessor_class_bufr_data_array.cc is not yet moved to C++"; - // ===== END TODO ===== + al = accessor_bufr_data_array_get_dataAccessors(data); if (!al) return NULL; result = (grib_accessors_list*)grib_context_malloc_clear(al->accessor->context, sizeof(grib_accessors_list)); From 78c1129ed7c78b4195a50b71ae8e48ebd63e16cb Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 19 Mar 2024 12:19:54 +0000 Subject: [PATCH 010/196] Fix offsets --- src/accessor/grib_accessor_class_ibmfloat.cc | 4 ++-- src/accessor/grib_accessor_class_section.cc | 2 +- src/accessor/grib_accessor_class_signed_bits.cc | 2 +- src/accessor/grib_accessor_class_spd.cc | 2 +- src/accessor/grib_accessor_class_unexpanded_descriptors.cc | 2 +- src/accessor/grib_accessor_class_unsigned_bits.cc | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/accessor/grib_accessor_class_ibmfloat.cc b/src/accessor/grib_accessor_class_ibmfloat.cc index 4528c0807..65a471eb5 100644 --- a/src/accessor/grib_accessor_class_ibmfloat.cc +++ b/src/accessor/grib_accessor_class_ibmfloat.cc @@ -82,7 +82,7 @@ int grib_accessor_class_ibmfloat_t::pack_double(grib_accessor* a, const double* //double y = grib_long_to_ibm(grib_ibm_to_long(val[0])); //printf("IBMFLOAT val=%.20f nearest_smaller_ibm_float=%.20f long_to_ibm=%.20f\n",val[0],x ,y); - off = byte_offset(a) * 8; + off = a->byte_offset() * 8; ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, grib_ibm_to_long(val[0]), &off, 32); if (*len > 1) grib_context_log(a->context, GRIB_LOG_WARNING, "ibmfloat: Trying to pack %zu values in a scalar %s, packing first value", @@ -108,7 +108,7 @@ int grib_accessor_class_ibmfloat_t::pack_double(grib_accessor* a, const double* grib_context_free(a->context, buf); - a->length = byte_count(a); + a->length = a->byte_count(); return ret; } diff --git a/src/accessor/grib_accessor_class_section.cc b/src/accessor/grib_accessor_class_section.cc index b6222a551..732435d67 100644 --- a/src/accessor/grib_accessor_class_section.cc +++ b/src/accessor/grib_accessor_class_section.cc @@ -41,7 +41,7 @@ long grib_accessor_class_section_t::byte_count(grib_accessor* a){ } long grib_accessor_class_section_t::next_offset(grib_accessor* a){ - return a->offset + byte_count(a); + return a->offset + a->byte_count(); } void grib_accessor_class_section_t::destroy(grib_context* ct, grib_accessor* a){ diff --git a/src/accessor/grib_accessor_class_signed_bits.cc b/src/accessor/grib_accessor_class_signed_bits.cc index 85a764628..e27f8b53c 100644 --- a/src/accessor/grib_accessor_class_signed_bits.cc +++ b/src/accessor/grib_accessor_class_signed_bits.cc @@ -148,5 +148,5 @@ void grib_accessor_class_signed_bits_t::update_size(grib_accessor* a, size_t s){ } long grib_accessor_class_signed_bits_t::next_offset(grib_accessor* a){ - return byte_offset(a) + byte_count(a); + return a->byte_offset() + a->byte_count(); } diff --git a/src/accessor/grib_accessor_class_spd.cc b/src/accessor/grib_accessor_class_spd.cc index 7e1083377..709cfef6e 100644 --- a/src/accessor/grib_accessor_class_spd.cc +++ b/src/accessor/grib_accessor_class_spd.cc @@ -154,5 +154,5 @@ void grib_accessor_class_spd_t::update_size(grib_accessor* a, size_t s){ } long grib_accessor_class_spd_t::next_offset(grib_accessor* a){ - return byte_offset(a) + a->length; + return a->byte_offset() + a->length; } diff --git a/src/accessor/grib_accessor_class_unexpanded_descriptors.cc b/src/accessor/grib_accessor_class_unexpanded_descriptors.cc index e51262387..5cfa0970d 100644 --- a/src/accessor/grib_accessor_class_unexpanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_unexpanded_descriptors.cc @@ -128,5 +128,5 @@ void grib_accessor_class_unexpanded_descriptors_t::update_size(grib_accessor* a, } long grib_accessor_class_unexpanded_descriptors_t::next_offset(grib_accessor* a){ - return byte_offset(a) + a->length; + return a->byte_offset() + a->length; } diff --git a/src/accessor/grib_accessor_class_unsigned_bits.cc b/src/accessor/grib_accessor_class_unsigned_bits.cc index 25d16fdc3..953951fd9 100644 --- a/src/accessor/grib_accessor_class_unsigned_bits.cc +++ b/src/accessor/grib_accessor_class_unsigned_bits.cc @@ -155,5 +155,5 @@ void grib_accessor_class_unsigned_bits_t::update_size(grib_accessor* a, size_t s } long grib_accessor_class_unsigned_bits_t::next_offset(grib_accessor* a){ - return byte_offset(a) + a->length; + return a->byte_offset() + a->length; } From 6fc7074c50ce45997a62afeb6bcc8059391f6813 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 19 Mar 2024 13:24:04 +0000 Subject: [PATCH 011/196] Fix initialisation --- src/accessor/grib_accessor_class_ascii.cc | 1 + src/accessor/grib_accessor_class_bit.cc | 1 + src/accessor/grib_accessor_class_bitmap.cc | 1 + src/accessor/grib_accessor_class_bits.cc | 1 + src/accessor/grib_accessor_class_bits_per_value.cc | 1 + src/accessor/grib_accessor_class_blob.cc | 1 + src/accessor/grib_accessor_class_budgdate.cc | 1 + src/accessor/grib_accessor_class_bufr_data_array.cc | 1 + src/accessor/grib_accessor_class_bufr_data_element.cc | 1 + src/accessor/grib_accessor_class_bufr_elements_table.cc | 1 + src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc | 1 + .../grib_accessor_class_bufr_extract_datetime_subsets.cc | 1 + src/accessor/grib_accessor_class_bufr_extract_subsets.cc | 1 + src/accessor/grib_accessor_class_bufr_simple_thinning.cc | 1 + src/accessor/grib_accessor_class_bufr_string_values.cc | 1 + src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc | 1 + src/accessor/grib_accessor_class_bytes.cc | 1 + .../grib_accessor_class_change_alternative_row_scanning.cc | 1 + src/accessor/grib_accessor_class_change_scanning_direction.cc | 1 + src/accessor/grib_accessor_class_check_internal_version.cc | 1 + src/accessor/grib_accessor_class_closest_date.cc | 1 + src/accessor/grib_accessor_class_codeflag.cc | 1 + src/accessor/grib_accessor_class_codetable_title.cc | 1 + src/accessor/grib_accessor_class_codetable_units.cc | 1 + src/accessor/grib_accessor_class_concept.cc | 1 + src/accessor/grib_accessor_class_count_file.cc | 1 + src/accessor/grib_accessor_class_count_missing.cc | 1 + src/accessor/grib_accessor_class_count_total.cc | 1 + src/accessor/grib_accessor_class_data_apply_bitmap.cc | 1 + src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc | 1 + .../grib_accessor_class_data_apply_boustrophedonic_bitmap.cc | 1 + src/accessor/grib_accessor_class_data_ccsds_packing.cc | 1 + src/accessor/grib_accessor_class_data_complex_packing.cc | 1 + src/accessor/grib_accessor_class_data_dummy_field.cc | 1 + src/accessor/grib_accessor_class_data_g1complex_packing.cc | 1 + ..._accessor_class_data_g1second_order_constant_width_packing.cc | 1 + ...ccessor_class_data_g1second_order_general_extended_packing.cc | 1 + .../grib_accessor_class_data_g1second_order_general_packing.cc | 1 + ...grib_accessor_class_data_g1second_order_row_by_row_packing.cc | 1 + src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc | 1 + src/accessor/grib_accessor_class_data_g1simple_packing.cc | 1 + src/accessor/grib_accessor_class_data_g22order_packing.cc | 1 + src/accessor/grib_accessor_class_data_g2bifourier_packing.cc | 1 + src/accessor/grib_accessor_class_data_g2complex_packing.cc | 1 + src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc | 1 + src/accessor/grib_accessor_class_data_g2shsimple_packing.cc | 1 + src/accessor/grib_accessor_class_data_g2simple_packing.cc | 1 + ...ib_accessor_class_data_g2simple_packing_with_preprocessing.cc | 1 + src/accessor/grib_accessor_class_data_jpeg2000_packing.cc | 1 + src/accessor/grib_accessor_class_data_png_packing.cc | 1 + src/accessor/grib_accessor_class_data_raw_packing.cc | 1 + src/accessor/grib_accessor_class_data_run_length_packing.cc | 1 + src/accessor/grib_accessor_class_data_secondary_bitmap.cc | 1 + src/accessor/grib_accessor_class_data_sh_packed.cc | 1 + src/accessor/grib_accessor_class_data_sh_unpacked.cc | 1 + src/accessor/grib_accessor_class_data_shsimple_packing.cc | 1 + src/accessor/grib_accessor_class_data_simple_packing.cc | 1 + src/accessor/grib_accessor_class_decimal_precision.cc | 1 + src/accessor/grib_accessor_class_dictionary.cc | 1 + src/accessor/grib_accessor_class_dirty.cc | 1 + src/accessor/grib_accessor_class_divdouble.cc | 1 + src/accessor/grib_accessor_class_element.cc | 1 + src/accessor/grib_accessor_class_evaluate.cc | 1 + src/accessor/grib_accessor_class_expanded_descriptors.cc | 1 + .../grib_accessor_class_from_scale_factor_scaled_value.cc | 1 + src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc | 1 + src/accessor/grib_accessor_class_g1_message_length.cc | 1 + src/accessor/grib_accessor_class_g1_section4_length.cc | 1 + src/accessor/grib_accessor_class_g1bitmap.cc | 1 + src/accessor/grib_accessor_class_g1date.cc | 1 + src/accessor/grib_accessor_class_g1day_of_the_year_date.cc | 1 + src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc | 1 + src/accessor/grib_accessor_class_g1forecastmonth.cc | 1 + src/accessor/grib_accessor_class_g1monthlydate.cc | 1 + .../grib_accessor_class_g1number_of_coded_values_sh_complex.cc | 1 + .../grib_accessor_class_g1number_of_coded_values_sh_simple.cc | 1 + src/accessor/grib_accessor_class_g1step_range.cc | 1 + src/accessor/grib_accessor_class_g1verificationdate.cc | 1 + src/accessor/grib_accessor_class_g2_aerosol.cc | 1 + src/accessor/grib_accessor_class_g2_chemical.cc | 1 + src/accessor/grib_accessor_class_g2_eps.cc | 1 + src/accessor/grib_accessor_class_g2_mars_labeling.cc | 1 + src/accessor/grib_accessor_class_g2bitmap.cc | 1 + src/accessor/grib_accessor_class_g2bitmap_present.cc | 1 + src/accessor/grib_accessor_class_g2date.cc | 1 + src/accessor/grib_accessor_class_g2end_step.cc | 1 + src/accessor/grib_accessor_class_g2grid.cc | 1 + src/accessor/grib_accessor_class_g2latlon.cc | 1 + src/accessor/grib_accessor_class_g2level.cc | 1 + src/accessor/grib_accessor_class_g2lon.cc | 1 + src/accessor/grib_accessor_class_g2step_range.cc | 1 + src/accessor/grib_accessor_class_gaussian_grid_name.cc | 1 + src/accessor/grib_accessor_class_gds_is_present.cc | 1 + src/accessor/grib_accessor_class_gds_not_present_bitmap.cc | 1 + src/accessor/grib_accessor_class_getenv.cc | 1 + src/accessor/grib_accessor_class_global_gaussian.cc | 1 + src/accessor/grib_accessor_class_group.cc | 1 + src/accessor/grib_accessor_class_gts_header.cc | 1 + src/accessor/grib_accessor_class_hash_array.cc | 1 + src/accessor/grib_accessor_class_headers_only.cc | 1 + src/accessor/grib_accessor_class_ibmfloat.cc | 1 + src/accessor/grib_accessor_class_ieeefloat.cc | 1 + src/accessor/grib_accessor_class_ifs_param.cc | 1 + src/accessor/grib_accessor_class_julian_date.cc | 1 + src/accessor/grib_accessor_class_julian_day.cc | 1 + src/accessor/grib_accessor_class_ksec1expver.cc | 1 + src/accessor/grib_accessor_class_label.cc | 1 + src/accessor/grib_accessor_class_latitudes.cc | 1 + src/accessor/grib_accessor_class_latlon_increment.cc | 1 + src/accessor/grib_accessor_class_latlonvalues.cc | 1 + src/accessor/grib_accessor_class_local_definition.cc | 1 + src/accessor/grib_accessor_class_long_vector.cc | 1 + src/accessor/grib_accessor_class_longitudes.cc | 1 + src/accessor/grib_accessor_class_lookup.cc | 1 + src/accessor/grib_accessor_class_mars_param.cc | 1 + src/accessor/grib_accessor_class_mars_step.cc | 1 + src/accessor/grib_accessor_class_md5.cc | 1 + src/accessor/grib_accessor_class_message.cc | 1 + src/accessor/grib_accessor_class_message_copy.cc | 1 + src/accessor/grib_accessor_class_multdouble.cc | 1 + src/accessor/grib_accessor_class_non_alpha.cc | 1 + src/accessor/grib_accessor_class_number_of_coded_values.cc | 1 + src/accessor/grib_accessor_class_number_of_points.cc | 1 + src/accessor/grib_accessor_class_number_of_points_gaussian.cc | 1 + src/accessor/grib_accessor_class_number_of_values.cc | 1 + .../grib_accessor_class_number_of_values_data_raw_packing.cc | 1 + src/accessor/grib_accessor_class_octahedral_gaussian.cc | 1 + src/accessor/grib_accessor_class_octet_number.cc | 1 + src/accessor/grib_accessor_class_offset_file.cc | 1 + src/accessor/grib_accessor_class_offset_values.cc | 1 + src/accessor/grib_accessor_class_optimal_step_units.cc | 1 + src/accessor/grib_accessor_class_pack_bufr_values.cc | 1 + src/accessor/grib_accessor_class_packing_type.cc | 1 + src/accessor/grib_accessor_class_pad.cc | 1 + src/accessor/grib_accessor_class_padding.cc | 1 + src/accessor/grib_accessor_class_padto.cc | 1 + src/accessor/grib_accessor_class_padtoeven.cc | 1 + src/accessor/grib_accessor_class_padtomultiple.cc | 1 + src/accessor/grib_accessor_class_position.cc | 1 + src/accessor/grib_accessor_class_proj_string.cc | 1 + src/accessor/grib_accessor_class_raw.cc | 1 + src/accessor/grib_accessor_class_rdbtime_guess_date.cc | 1 + src/accessor/grib_accessor_class_reference_value_error.cc | 1 + src/accessor/grib_accessor_class_scale.cc | 1 + src/accessor/grib_accessor_class_scale_values.cc | 1 + src/accessor/grib_accessor_class_second_order_bits_per_value.cc | 1 + src/accessor/grib_accessor_class_section.cc | 1 + src/accessor/grib_accessor_class_section_length.cc | 1 + src/accessor/grib_accessor_class_section_padding.cc | 1 + src/accessor/grib_accessor_class_section_pointer.cc | 1 + src/accessor/grib_accessor_class_select_step_template.cc | 1 + src/accessor/grib_accessor_class_sexagesimal2decimal.cc | 1 + src/accessor/grib_accessor_class_signed.cc | 1 + src/accessor/grib_accessor_class_signed_bits.cc | 1 + src/accessor/grib_accessor_class_simple_packing_error.cc | 1 + src/accessor/grib_accessor_class_size.cc | 1 + src/accessor/grib_accessor_class_smart_table_column.cc | 1 + src/accessor/grib_accessor_class_spd.cc | 1 + src/accessor/grib_accessor_class_spectral_truncation.cc | 1 + src/accessor/grib_accessor_class_sprintf.cc | 1 + src/accessor/grib_accessor_class_statistics.cc | 1 + src/accessor/grib_accessor_class_statistics_spectral.cc | 1 + src/accessor/grib_accessor_class_step_human_readable.cc | 1 + src/accessor/grib_accessor_class_step_in_units.cc | 1 + src/accessor/grib_accessor_class_sum.cc | 1 + src/accessor/grib_accessor_class_suppressed.cc | 1 + src/accessor/grib_accessor_class_time.cc | 1 + src/accessor/grib_accessor_class_to_double.cc | 1 + src/accessor/grib_accessor_class_to_integer.cc | 1 + src/accessor/grib_accessor_class_to_string.cc | 1 + src/accessor/grib_accessor_class_transient_darray.cc | 1 + src/accessor/grib_accessor_class_trim.cc | 1 + src/accessor/grib_accessor_class_unexpanded_descriptors.cc | 1 + src/accessor/grib_accessor_class_unpack_bufr_values.cc | 1 + src/accessor/grib_accessor_class_unsigned_bits.cc | 1 + src/accessor/grib_accessor_class_validity_date.cc | 1 + src/accessor/grib_accessor_class_validity_time.cc | 1 + src/accessor/grib_accessor_class_values.cc | 1 + src/accessor/grib_accessor_class_vector.cc | 1 + src/accessor/grib_accessor_class_when.cc | 1 + 180 files changed, 180 insertions(+) diff --git a/src/accessor/grib_accessor_class_ascii.cc b/src/accessor/grib_accessor_class_ascii.cc index 4fedc7c60..2c824fe29 100644 --- a/src/accessor/grib_accessor_class_ascii.cc +++ b/src/accessor/grib_accessor_class_ascii.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_ascii = &_grib_accessor_class_ascii; void grib_accessor_class_ascii_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); a->length = len; Assert(a->length >= 0); } diff --git a/src/accessor/grib_accessor_class_bit.cc b/src/accessor/grib_accessor_class_bit.cc index 2cf31bd48..ef30efe24 100644 --- a/src/accessor/grib_accessor_class_bit.cc +++ b/src/accessor/grib_accessor_class_bit.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_bit = &_grib_accessor_class_bit; void grib_accessor_class_bit_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_long_t::init(a, len, arg); grib_accessor_bit_t* self = (grib_accessor_bit_t*)a; a->length = 0; self->owner = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); diff --git a/src/accessor/grib_accessor_class_bitmap.cc b/src/accessor/grib_accessor_class_bitmap.cc index eb45c4464..a2d659f65 100644 --- a/src/accessor/grib_accessor_class_bitmap.cc +++ b/src/accessor/grib_accessor_class_bitmap.cc @@ -53,6 +53,7 @@ void compute_size(grib_accessor* a){ } void grib_accessor_class_bitmap_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_bytes_t::init(a, len, arg); grib_accessor_bitmap_t* self = (grib_accessor_bitmap_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_bits.cc b/src/accessor/grib_accessor_class_bits.cc index b38de626c..bb2b8f9ad 100644 --- a/src/accessor/grib_accessor_class_bits.cc +++ b/src/accessor/grib_accessor_class_bits.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_bits = &_grib_accessor_class_bits; void grib_accessor_class_bits_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_gen_t::init(a, l, c); grib_accessor_bits_t* self = (grib_accessor_bits_t*)a; grib_handle* hand = grib_handle_of_accessor(a); grib_expression* e = NULL; diff --git a/src/accessor/grib_accessor_class_bits_per_value.cc b/src/accessor/grib_accessor_class_bits_per_value.cc index b5d3698e0..51403f855 100644 --- a/src/accessor/grib_accessor_class_bits_per_value.cc +++ b/src/accessor/grib_accessor_class_bits_per_value.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_bits_per_value = &_grib_accessor_class_ void grib_accessor_class_bits_per_value_t::init(grib_accessor* a, const long l, grib_arguments* args){ + grib_accessor_class_long_t::init(a, l, args); int n = 0; grib_accessor_bits_per_value_t* self = (grib_accessor_bits_per_value_t*)a; self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); diff --git a/src/accessor/grib_accessor_class_blob.cc b/src/accessor/grib_accessor_class_blob.cc index ddcfc9961..93c7095bb 100644 --- a/src/accessor/grib_accessor_class_blob.cc +++ b/src/accessor/grib_accessor_class_blob.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_blob = &_grib_accessor_class_blob; void grib_accessor_class_blob_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, arg, 0), &a->length); Assert(a->length >= 0); } diff --git a/src/accessor/grib_accessor_class_budgdate.cc b/src/accessor/grib_accessor_class_budgdate.cc index 1bfd6e7b9..e496488e2 100644 --- a/src/accessor/grib_accessor_class_budgdate.cc +++ b/src/accessor/grib_accessor_class_budgdate.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_budgdate = &_grib_accessor_class_budgda void grib_accessor_class_budgdate_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_budgdate_t* self = (grib_accessor_budgdate_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_bufr_data_array.cc b/src/accessor/grib_accessor_class_bufr_data_array.cc index ea32d69c4..dc903a154 100644 --- a/src/accessor/grib_accessor_class_bufr_data_array.cc +++ b/src/accessor/grib_accessor_class_bufr_data_array.cc @@ -157,6 +157,7 @@ int check_overridden_reference_values(const grib_context* c, long* refValList, s #define DYN_ARRAY_SIZE_INCR 1000 /* Increment size for grib_iarray_new and grib_darray_new */ void grib_accessor_class_bufr_data_array_t::init(grib_accessor* a, const long v, grib_arguments* params){ + grib_accessor_class_gen_t::init(a, v, params); grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; int n = 0; const char* dataKeysName = NULL; diff --git a/src/accessor/grib_accessor_class_bufr_data_element.cc b/src/accessor/grib_accessor_class_bufr_data_element.cc index 295c0b13e..584515de2 100644 --- a/src/accessor/grib_accessor_class_bufr_data_element.cc +++ b/src/accessor/grib_accessor_class_bufr_data_element.cc @@ -119,6 +119,7 @@ void accessor_bufr_data_element_set_elementsDescriptorsIndex(grib_accessor* a, g } void grib_accessor_class_bufr_data_element_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_class_gen_t::init(a, len, params); grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_BUFR_DATA; diff --git a/src/accessor/grib_accessor_class_bufr_elements_table.cc b/src/accessor/grib_accessor_class_bufr_elements_table.cc index 9b589c114..9a34353de 100644 --- a/src/accessor/grib_accessor_class_bufr_elements_table.cc +++ b/src/accessor/grib_accessor_class_bufr_elements_table.cc @@ -48,6 +48,7 @@ grib_accessor_class* grib_accessor_class_bufr_elements_table = &_grib_accessor_c void grib_accessor_class_bufr_elements_table_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_class_gen_t::init(a, len, params); int n = 0; grib_accessor_bufr_elements_table_t* self = (grib_accessor_bufr_elements_table_t*)a; diff --git a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc index 85eb98d0d..cbd6b5c5f 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc +++ b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_bufr_extract_area_subsets = &_grib_acce void grib_accessor_class_bufr_extract_area_subsets_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_bufr_extract_area_subsets_t* self = (grib_accessor_bufr_extract_area_subsets_t*)a; grib_handle* h = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc index 0568f02dc..400473180 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc +++ b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_bufr_extract_datetime_subsets = &_grib_ void grib_accessor_class_bufr_extract_datetime_subsets_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); int n = 0; grib_accessor_bufr_extract_datetime_subsets_t* self = (grib_accessor_bufr_extract_datetime_subsets_t*)a; diff --git a/src/accessor/grib_accessor_class_bufr_extract_subsets.cc b/src/accessor/grib_accessor_class_bufr_extract_subsets.cc index 6fbea28a2..75f0618b8 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_subsets.cc +++ b/src/accessor/grib_accessor_class_bufr_extract_subsets.cc @@ -27,6 +27,7 @@ void get_accessors(grib_accessor* a){ } void grib_accessor_class_bufr_extract_subsets_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); int n = 0; grib_accessor_bufr_extract_subsets_t* self = (grib_accessor_bufr_extract_subsets_t*)a; diff --git a/src/accessor/grib_accessor_class_bufr_simple_thinning.cc b/src/accessor/grib_accessor_class_bufr_simple_thinning.cc index 1743104fd..c2621e52c 100644 --- a/src/accessor/grib_accessor_class_bufr_simple_thinning.cc +++ b/src/accessor/grib_accessor_class_bufr_simple_thinning.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_bufr_simple_thinning = &_grib_accessor_ void grib_accessor_class_bufr_simple_thinning_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_bufr_simple_thinning_t* self = (grib_accessor_bufr_simple_thinning_t*)a; grib_handle* h = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_bufr_string_values.cc b/src/accessor/grib_accessor_class_bufr_string_values.cc index 2568021a4..3015a7b8c 100644 --- a/src/accessor/grib_accessor_class_bufr_string_values.cc +++ b/src/accessor/grib_accessor_class_bufr_string_values.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_bufr_string_values = &_grib_accessor_cl void grib_accessor_class_bufr_string_values_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_ascii_t::init(a, len, args); grib_accessor_bufr_string_values_t* self = (grib_accessor_bufr_string_values_t*)a; int n = 0; self->dataAccessorName = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); diff --git a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc index 2f4073460..73282fcea 100644 --- a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_bufrdc_expanded_descriptors = &_grib_ac void grib_accessor_class_bufrdc_expanded_descriptors_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_long_t::init(a, len, args); grib_accessor_bufrdc_expanded_descriptors_t* self = (grib_accessor_bufrdc_expanded_descriptors_t*)a; int n = 0; self->expandedDescriptors = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); diff --git a/src/accessor/grib_accessor_class_bytes.cc b/src/accessor/grib_accessor_class_bytes.cc index e0002429a..b7719e232 100644 --- a/src/accessor/grib_accessor_class_bytes.cc +++ b/src/accessor/grib_accessor_class_bytes.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_bytes = &_grib_accessor_class_bytes; void grib_accessor_class_bytes_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); /*grib_accessor_signed* self = (grib_accessor_signed*)a; */ a->length = len; Assert(a->length >= 0); diff --git a/src/accessor/grib_accessor_class_change_alternative_row_scanning.cc b/src/accessor/grib_accessor_class_change_alternative_row_scanning.cc index 8375ee26d..f9d740206 100644 --- a/src/accessor/grib_accessor_class_change_alternative_row_scanning.cc +++ b/src/accessor/grib_accessor_class_change_alternative_row_scanning.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_change_alternative_row_scanning = &_gri void grib_accessor_class_change_alternative_row_scanning_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, len, args); int n = 0; grib_accessor_change_alternative_row_scanning_t* self = (grib_accessor_change_alternative_row_scanning_t*)a; diff --git a/src/accessor/grib_accessor_class_change_scanning_direction.cc b/src/accessor/grib_accessor_class_change_scanning_direction.cc index b8f71f14c..cfa45c592 100644 --- a/src/accessor/grib_accessor_class_change_scanning_direction.cc +++ b/src/accessor/grib_accessor_class_change_scanning_direction.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_change_scanning_direction = &_grib_acce void grib_accessor_class_change_scanning_direction_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, len, args); grib_accessor_change_scanning_direction_t* self = (grib_accessor_change_scanning_direction_t*)a; grib_handle* h = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_check_internal_version.cc b/src/accessor/grib_accessor_class_check_internal_version.cc index 65bdbcbf0..987a512f5 100644 --- a/src/accessor/grib_accessor_class_check_internal_version.cc +++ b/src/accessor/grib_accessor_class_check_internal_version.cc @@ -22,6 +22,7 @@ grib_accessor_class* grib_accessor_class_check_internal_version = &_grib_accesso #define LATEST_ENGINE_VERSION 30 void grib_accessor_class_check_internal_version_t::init(grib_accessor* a, const long l, grib_arguments* args){ + grib_accessor_class_ascii_t::init(a, l, args); /* Check version of definition files is compatible with the engine */ int err = 0; long defs_file_version = 0; diff --git a/src/accessor/grib_accessor_class_closest_date.cc b/src/accessor/grib_accessor_class_closest_date.cc index 462b90078..ace5bdf71 100644 --- a/src/accessor/grib_accessor_class_closest_date.cc +++ b/src/accessor/grib_accessor_class_closest_date.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_closest_date = &_grib_accessor_class_cl void grib_accessor_class_closest_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_closest_date_t* self = (grib_accessor_closest_date_t*)a; grib_handle* h = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_codeflag.cc b/src/accessor/grib_accessor_class_codeflag.cc index 3baa24c1b..d81c031a9 100644 --- a/src/accessor/grib_accessor_class_codeflag.cc +++ b/src/accessor/grib_accessor_class_codeflag.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_codeflag = &_grib_accessor_class_codefl void grib_accessor_class_codeflag_t::init(grib_accessor* a, const long len, grib_arguments* param){ + grib_accessor_class_unsigned_t::init(a, len, param); grib_accessor_codeflag_t* self = (grib_accessor_codeflag_t*)a; a->length = len; self->tablename = grib_arguments_get_string(grib_handle_of_accessor(a), param, 0); diff --git a/src/accessor/grib_accessor_class_codetable_title.cc b/src/accessor/grib_accessor_class_codetable_title.cc index 27d787170..52d8b8b32 100644 --- a/src/accessor/grib_accessor_class_codetable_title.cc +++ b/src/accessor/grib_accessor_class_codetable_title.cc @@ -17,6 +17,7 @@ grib_accessor_class_codetable_title_t _grib_accessor_class_codetable_title{"code grib_accessor_class* grib_accessor_class_codetable_title = &_grib_accessor_class_codetable_title; void grib_accessor_class_codetable_title_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_class_gen_t::init(a, len, params); grib_accessor_codetable_title_t* self = (grib_accessor_codetable_title_t*)a; int n = 0; self->codetable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); diff --git a/src/accessor/grib_accessor_class_codetable_units.cc b/src/accessor/grib_accessor_class_codetable_units.cc index cc2c3815b..cb72847e0 100644 --- a/src/accessor/grib_accessor_class_codetable_units.cc +++ b/src/accessor/grib_accessor_class_codetable_units.cc @@ -17,6 +17,7 @@ grib_accessor_class_codetable_units_t _grib_accessor_class_codetable_units{"code grib_accessor_class* grib_accessor_class_codetable_units = &_grib_accessor_class_codetable_units; void grib_accessor_class_codetable_units_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_class_gen_t::init(a, len, params); grib_accessor_codetable_units_t* self = (grib_accessor_codetable_units_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_concept.cc b/src/accessor/grib_accessor_class_concept.cc index 55f535cb2..1e4eb27c1 100644 --- a/src/accessor/grib_accessor_class_concept.cc +++ b/src/accessor/grib_accessor_class_concept.cc @@ -35,6 +35,7 @@ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) } void grib_accessor_class_concept_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, len, args); a->length = 0; } diff --git a/src/accessor/grib_accessor_class_count_file.cc b/src/accessor/grib_accessor_class_count_file.cc index 9e88700a3..b3317e515 100644 --- a/src/accessor/grib_accessor_class_count_file.cc +++ b/src/accessor/grib_accessor_class_count_file.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_count_file = &_grib_accessor_class_coun void grib_accessor_class_count_file_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->length = 0; } diff --git a/src/accessor/grib_accessor_class_count_missing.cc b/src/accessor/grib_accessor_class_count_missing.cc index f0e74d165..a14c6d6c0 100644 --- a/src/accessor/grib_accessor_class_count_missing.cc +++ b/src/accessor/grib_accessor_class_count_missing.cc @@ -36,6 +36,7 @@ static const unsigned char bitsoff[] = { }; void grib_accessor_class_count_missing_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_long_t::init(a, len, arg); int n = 0; grib_accessor_count_missing_t* self = (grib_accessor_count_missing_t*)a; grib_handle* h = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_count_total.cc b/src/accessor/grib_accessor_class_count_total.cc index 2c2c69c3c..604981a56 100644 --- a/src/accessor/grib_accessor_class_count_total.cc +++ b/src/accessor/grib_accessor_class_count_total.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_count_total = &_grib_accessor_class_cou void grib_accessor_class_count_total_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->length = 0; } diff --git a/src/accessor/grib_accessor_class_data_apply_bitmap.cc b/src/accessor/grib_accessor_class_data_apply_bitmap.cc index ac7fccc1c..865d9be74 100644 --- a/src/accessor/grib_accessor_class_data_apply_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_apply_bitmap.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_apply_bitmap = &_grib_accessor_cla void grib_accessor_class_data_apply_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, v, args); int n = 0; grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc index ef36eb2b2..2f1456b39 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic = &_grib_acc void grib_accessor_class_data_apply_boustrophedonic_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, v, args); int n = 0; grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc index 217431b43..d7e07a561 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic_bitmap = &_g void grib_accessor_class_data_apply_boustrophedonic_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, v, args); int n = 0; grib_accessor_data_apply_boustrophedonic_bitmap_t* self = (grib_accessor_data_apply_boustrophedonic_bitmap_t*)a; grib_handle* gh = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.cc b/src/accessor/grib_accessor_class_data_ccsds_packing.cc index 5158ee7fd..46af9722f 100644 --- a/src/accessor/grib_accessor_class_data_ccsds_packing.cc +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_data_ccsds_packing = &_grib_accessor_cl void grib_accessor_class_data_ccsds_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_values_t::init(a, v, args); grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; grib_handle* h = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_complex_packing.cc b/src/accessor/grib_accessor_class_data_complex_packing.cc index e9c36000f..5709b4798 100644 --- a/src/accessor/grib_accessor_class_data_complex_packing.cc +++ b/src/accessor/grib_accessor_class_data_complex_packing.cc @@ -22,6 +22,7 @@ typedef unsigned long (*encode_float_proc)(double); typedef double (*decode_float_proc)(unsigned long); void grib_accessor_class_data_complex_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_complex_packing_t* self = (grib_accessor_data_complex_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_dummy_field.cc b/src/accessor/grib_accessor_class_data_dummy_field.cc index 5216c2a94..23bc83c9c 100644 --- a/src/accessor/grib_accessor_class_data_dummy_field.cc +++ b/src/accessor/grib_accessor_class_data_dummy_field.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_dummy_field = &_grib_accessor_clas void grib_accessor_class_data_dummy_field_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_g1simple_packing_t::init(a, v, args); grib_accessor_data_dummy_field_t* self = (grib_accessor_data_dummy_field_t*)a; self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); diff --git a/src/accessor/grib_accessor_class_data_g1complex_packing.cc b/src/accessor/grib_accessor_class_data_g1complex_packing.cc index eecf83cfb..b1fc4fa4b 100644 --- a/src/accessor/grib_accessor_class_data_g1complex_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1complex_packing.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_g1complex_packing = &_grib_accesso void grib_accessor_class_data_g1complex_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_complex_packing_t::init(a, v, args); grib_accessor_data_g1complex_packing_t* self = (grib_accessor_data_g1complex_packing_t*)a; self->half_byte = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); self->N = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); diff --git a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc index b0009cfa9..44452957e 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_data_g1second_order_constant_width_pack void grib_accessor_class_data_g1second_order_constant_width_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_g1second_order_constant_width_packing_t* self = (grib_accessor_data_g1second_order_constant_width_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc index 5058a2102..cf47dee15 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc @@ -56,6 +56,7 @@ long number_of_bits(grib_handle* h, unsigned long x){ } void grib_accessor_class_data_g1second_order_general_extended_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; grib_handle* handle = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc index e9d620f52..e709da053 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_data_g1second_order_general_packing = & void grib_accessor_class_data_g1second_order_general_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_g1second_order_general_packing_t* self = (grib_accessor_data_g1second_order_general_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc index 10dc06079..8237cf577 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_data_g1second_order_row_by_row_packing void grib_accessor_class_data_g1second_order_row_by_row_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_g1second_order_row_by_row_packing_t* self = (grib_accessor_data_g1second_order_row_by_row_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc index cbabc9cf1..639512a57 100644 --- a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_g1secondary_bitmap = &_grib_access void grib_accessor_class_data_g1secondary_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_secondary_bitmap_t::init(a, v, args); grib_accessor_data_g1secondary_bitmap_t* self = (grib_accessor_data_g1secondary_bitmap_t*)a; self->number_of_ones = grib_arguments_get_name(grib_handle_of_accessor(a), args, 4); } diff --git a/src/accessor/grib_accessor_class_data_g1simple_packing.cc b/src/accessor/grib_accessor_class_data_g1simple_packing.cc index a3320a810..2346e33dd 100644 --- a/src/accessor/grib_accessor_class_data_g1simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1simple_packing.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_data_g1simple_packing = &_grib_accessor void grib_accessor_class_data_g1simple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_g1simple_packing_t* self = (grib_accessor_data_g1simple_packing_t*)a; self->half_byte = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.cc b/src/accessor/grib_accessor_class_data_g22order_packing.cc index e8e9aed36..6b82e035e 100644 --- a/src/accessor/grib_accessor_class_data_g22order_packing.cc +++ b/src/accessor/grib_accessor_class_data_g22order_packing.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_data_g22order_packing = &_grib_accessor void grib_accessor_class_data_g22order_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_values_t::init(a, v, args); grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); grib_handle* gh = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc b/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc index f4196a36c..06121f9aa 100644 --- a/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc @@ -21,6 +21,7 @@ typedef unsigned long (*encode_float_proc)(double); typedef double (*decode_float_proc)(unsigned long); void grib_accessor_class_data_g2bifourier_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_g2bifourier_packing_t* self = (grib_accessor_data_g2bifourier_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_g2complex_packing.cc b/src/accessor/grib_accessor_class_data_g2complex_packing.cc index 28958de56..7ccd19117 100644 --- a/src/accessor/grib_accessor_class_data_g2complex_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2complex_packing.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_g2complex_packing = &_grib_accesso void grib_accessor_class_data_g2complex_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_complex_packing_t::init(a, v, args); grib_accessor_data_g2complex_packing_t* self = (grib_accessor_data_g2complex_packing_t*)a; self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); self->edition = 2; diff --git a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc index bce04078b..f16ccf74f 100644 --- a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_g2secondary_bitmap = &_grib_access void grib_accessor_class_data_g2secondary_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_secondary_bitmap_t::init(a, v, args); grib_accessor_data_g2secondary_bitmap_t* self = (grib_accessor_data_g2secondary_bitmap_t*)a; self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, 4); } diff --git a/src/accessor/grib_accessor_class_data_g2shsimple_packing.cc b/src/accessor/grib_accessor_class_data_g2shsimple_packing.cc index e765539ee..ad204da06 100644 --- a/src/accessor/grib_accessor_class_data_g2shsimple_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2shsimple_packing.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_g2shsimple_packing = &_grib_access void grib_accessor_class_data_g2shsimple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_shsimple_packing_t::init(a, v, args); grib_accessor_data_g2shsimple_packing_t* self = (grib_accessor_data_g2shsimple_packing_t*)a; self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), args, 2); diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing.cc b/src/accessor/grib_accessor_class_data_g2simple_packing.cc index 051239cbc..849c4647a 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2simple_packing.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_data_g2simple_packing = &_grib_accessor void grib_accessor_class_data_g2simple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_g2simple_packing_t* self = (grib_accessor_data_g2simple_packing_t*)a; a->flags |= GRIB_ACCESSOR_FLAG_DATA; self->edition = 2; diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc index 21493c113..ad877ca82 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc +++ b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc @@ -19,6 +19,7 @@ grib_accessor_class* grib_accessor_class_data_g2simple_packing_with_preprocessin void grib_accessor_class_data_g2simple_packing_with_preprocessing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_g2simple_packing_t::init(a, v, args); grib_accessor_data_g2simple_packing_with_preprocessing_t* self = (grib_accessor_data_g2simple_packing_with_preprocessing_t*)a; self->pre_processing = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); self->pre_processing_parameter = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc index d5f3eaaf4..245d2f6a6 100644 --- a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc @@ -22,6 +22,7 @@ static int first = 1; #define OPENJPEG_LIB 2 void grib_accessor_class_data_jpeg2000_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_simple_packing_t::init(a, v, args); const char* user_lib = NULL; grib_accessor_data_jpeg2000_packing_t* self = (grib_accessor_data_jpeg2000_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_png_packing.cc b/src/accessor/grib_accessor_class_data_png_packing.cc index 8c1c62bb3..7e2c90baf 100644 --- a/src/accessor/grib_accessor_class_data_png_packing.cc +++ b/src/accessor/grib_accessor_class_data_png_packing.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_png_packing = &_grib_accessor_clas void grib_accessor_class_data_png_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_values_t::init(a, v, args); grib_accessor_data_png_packing_t* self = (grib_accessor_data_png_packing_t*)a; grib_handle* h = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_raw_packing.cc b/src/accessor/grib_accessor_class_data_raw_packing.cc index 943359f47..e9de19af0 100644 --- a/src/accessor/grib_accessor_class_data_raw_packing.cc +++ b/src/accessor/grib_accessor_class_data_raw_packing.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_data_raw_packing = &_grib_accessor_clas void grib_accessor_class_data_raw_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_values_t::init(a, v, args); grib_accessor_data_raw_packing_t* self = (grib_accessor_data_raw_packing_t*)a; self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); diff --git a/src/accessor/grib_accessor_class_data_run_length_packing.cc b/src/accessor/grib_accessor_class_data_run_length_packing.cc index c0b61c254..849652127 100644 --- a/src/accessor/grib_accessor_class_data_run_length_packing.cc +++ b/src/accessor/grib_accessor_class_data_run_length_packing.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_data_run_length_packing = &_grib_access void grib_accessor_class_data_run_length_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_values_t::init(a, v, args); grib_accessor_data_run_length_packing_t* self = (grib_accessor_data_run_length_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); self->number_of_values = grib_arguments_get_name(gh, args, self->carg++); diff --git a/src/accessor/grib_accessor_class_data_secondary_bitmap.cc b/src/accessor/grib_accessor_class_data_secondary_bitmap.cc index 51bfb4afc..b453aa5b1 100644 --- a/src/accessor/grib_accessor_class_data_secondary_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_secondary_bitmap.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_secondary_bitmap = &_grib_accessor void grib_accessor_class_data_secondary_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, v, args); grib_accessor_data_secondary_bitmap_t* self = (grib_accessor_data_secondary_bitmap_t*)a; self->primary_bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); self->secondary_bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, 1); diff --git a/src/accessor/grib_accessor_class_data_sh_packed.cc b/src/accessor/grib_accessor_class_data_sh_packed.cc index a1cb7a7ba..f7febe225 100644 --- a/src/accessor/grib_accessor_class_data_sh_packed.cc +++ b/src/accessor/grib_accessor_class_data_sh_packed.cc @@ -21,6 +21,7 @@ typedef unsigned long (*encode_float_proc)(double); typedef double (*decode_float_proc)(unsigned long); void grib_accessor_class_data_sh_packed_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_sh_packed_t* self = (grib_accessor_data_sh_packed_t*)a; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_sh_unpacked.cc b/src/accessor/grib_accessor_class_data_sh_unpacked.cc index 842411f26..9573bd732 100644 --- a/src/accessor/grib_accessor_class_data_sh_unpacked.cc +++ b/src/accessor/grib_accessor_class_data_sh_unpacked.cc @@ -21,6 +21,7 @@ typedef unsigned long (*encode_float_proc)(double); typedef double (*decode_float_proc)(unsigned long); void grib_accessor_class_data_sh_unpacked_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_sh_unpacked_t* self = (grib_accessor_data_sh_unpacked_t*)a; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_data_shsimple_packing.cc b/src/accessor/grib_accessor_class_data_shsimple_packing.cc index 68fc83a7b..6fd8d9f6b 100644 --- a/src/accessor/grib_accessor_class_data_shsimple_packing.cc +++ b/src/accessor/grib_accessor_class_data_shsimple_packing.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_data_shsimple_packing = &_grib_accessor void grib_accessor_class_data_shsimple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, v, args); grib_accessor_data_shsimple_packing_t* self = (grib_accessor_data_shsimple_packing_t*)a; self->coded_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); diff --git a/src/accessor/grib_accessor_class_data_simple_packing.cc b/src/accessor/grib_accessor_class_data_simple_packing.cc index f01a2c612..a167d0b53 100644 --- a/src/accessor/grib_accessor_class_data_simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_simple_packing.cc @@ -22,6 +22,7 @@ grib_accessor_class* grib_accessor_class_data_simple_packing = &_grib_accessor_c void grib_accessor_class_data_simple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_values_t::init(a, v, args); grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); self->units_factor = grib_arguments_get_name(gh, args, self->carg++); diff --git a/src/accessor/grib_accessor_class_decimal_precision.cc b/src/accessor/grib_accessor_class_decimal_precision.cc index 0ffe7b0c1..c063512c0 100644 --- a/src/accessor/grib_accessor_class_decimal_precision.cc +++ b/src/accessor/grib_accessor_class_decimal_precision.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_decimal_precision = &_grib_accessor_cla void grib_accessor_class_decimal_precision_t::init(grib_accessor* a, const long l, grib_arguments* args){ + grib_accessor_class_long_t::init(a, l, args); int n = 0; grib_accessor_decimal_precision_t* self = (grib_accessor_decimal_precision_t*)a; diff --git a/src/accessor/grib_accessor_class_dictionary.cc b/src/accessor/grib_accessor_class_dictionary.cc index e078cde45..59ed89b32 100644 --- a/src/accessor/grib_accessor_class_dictionary.cc +++ b/src/accessor/grib_accessor_class_dictionary.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_dictionary = &_grib_accessor_class_dict void grib_accessor_class_dictionary_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_class_gen_t::init(a, len, params); int n = 0; grib_accessor_dictionary_t* self = (grib_accessor_dictionary_t*)a; diff --git a/src/accessor/grib_accessor_class_dirty.cc b/src/accessor/grib_accessor_class_dirty.cc index 633c3dee2..89a05806b 100644 --- a/src/accessor/grib_accessor_class_dirty.cc +++ b/src/accessor/grib_accessor_class_dirty.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_dirty = &_grib_accessor_class_dirty; void grib_accessor_class_dirty_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_dirty_t* self = (grib_accessor_dirty_t*)a; self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; diff --git a/src/accessor/grib_accessor_class_divdouble.cc b/src/accessor/grib_accessor_class_divdouble.cc index 03a1b63b5..cf79b434d 100644 --- a/src/accessor/grib_accessor_class_divdouble.cc +++ b/src/accessor/grib_accessor_class_divdouble.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_divdouble = &_grib_accessor_class_divdo void grib_accessor_class_divdouble_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_divdouble_t* self = (grib_accessor_divdouble_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_element.cc b/src/accessor/grib_accessor_class_element.cc index a393a57aa..a058d3dea 100644 --- a/src/accessor/grib_accessor_class_element.cc +++ b/src/accessor/grib_accessor_class_element.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_element = &_grib_accessor_class_element void grib_accessor_class_element_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_element_t* self = (grib_accessor_element_t*)a; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_evaluate.cc b/src/accessor/grib_accessor_class_evaluate.cc index 62228b065..25f4f5ba5 100644 --- a/src/accessor/grib_accessor_class_evaluate.cc +++ b/src/accessor/grib_accessor_class_evaluate.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_evaluate = &_grib_accessor_class_evalua void grib_accessor_class_evaluate_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_evaluate_t* self = (grib_accessor_evaluate_t*)a; self->arg = c; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; diff --git a/src/accessor/grib_accessor_class_expanded_descriptors.cc b/src/accessor/grib_accessor_class_expanded_descriptors.cc index 8a12d93ff..6ea941b55 100644 --- a/src/accessor/grib_accessor_class_expanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_expanded_descriptors.cc @@ -43,6 +43,7 @@ typedef struct change_coding_params } void grib_accessor_class_expanded_descriptors_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_long_t::init(a, len, args); grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; int n = 0; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc index 3ba6e198e..9ba8aa65e 100644 --- a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc +++ b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_from_scale_factor_scaled_value = &_grib void grib_accessor_class_from_scale_factor_scaled_value_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_from_scale_factor_scaled_value_t* self = (grib_accessor_from_scale_factor_scaled_value_t*)a; int n = 0; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc index cf115535f..f2d309d06 100644 --- a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc +++ b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g1_half_byte_codeflag = &_grib_accessor void grib_accessor_class_g1_half_byte_codeflag_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; diff --git a/src/accessor/grib_accessor_class_g1_message_length.cc b/src/accessor/grib_accessor_class_g1_message_length.cc index 9b318b6a0..de8145a53 100644 --- a/src/accessor/grib_accessor_class_g1_message_length.cc +++ b/src/accessor/grib_accessor_class_g1_message_length.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g1_message_length = &_grib_accessor_cla void grib_accessor_class_g1_message_length_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_section_length_t::init(a, len, args); grib_accessor_g1_message_length_t* self = (grib_accessor_g1_message_length_t*)a; self->sec4_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); } diff --git a/src/accessor/grib_accessor_class_g1_section4_length.cc b/src/accessor/grib_accessor_class_g1_section4_length.cc index 858ef0d69..1c4f9ccf1 100644 --- a/src/accessor/grib_accessor_class_g1_section4_length.cc +++ b/src/accessor/grib_accessor_class_g1_section4_length.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g1_section4_length = &_grib_accessor_cl void grib_accessor_class_g1_section4_length_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_section_length_t::init(a, len, args); grib_accessor_g1_section4_length_t* self = (grib_accessor_g1_section4_length_t*)a; self->total_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); } diff --git a/src/accessor/grib_accessor_class_g1bitmap.cc b/src/accessor/grib_accessor_class_g1bitmap.cc index ad186dff0..1a7a7bb9e 100644 --- a/src/accessor/grib_accessor_class_g1bitmap.cc +++ b/src/accessor/grib_accessor_class_g1bitmap.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_g1bitmap = &_grib_accessor_class_g1bitm void grib_accessor_class_g1bitmap_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_bitmap_t::init(a, len, arg); grib_accessor_g1bitmap_t* self = (grib_accessor_g1bitmap_t*)a; self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 4); } diff --git a/src/accessor/grib_accessor_class_g1date.cc b/src/accessor/grib_accessor_class_g1date.cc index de787abba..938628031 100644 --- a/src/accessor/grib_accessor_class_g1date.cc +++ b/src/accessor/grib_accessor_class_g1date.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g1date = &_grib_accessor_class_g1date; void grib_accessor_class_g1date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_g1date_t* self = (grib_accessor_g1date_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_g1day_of_the_year_date.cc b/src/accessor/grib_accessor_class_g1day_of_the_year_date.cc index 9bf107e94..a75e043c9 100644 --- a/src/accessor/grib_accessor_class_g1day_of_the_year_date.cc +++ b/src/accessor/grib_accessor_class_g1day_of_the_year_date.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_g1day_of_the_year_date = &_grib_accesso void grib_accessor_class_g1day_of_the_year_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_g1date_t::init(a, l, c); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } diff --git a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc index c362016b1..fddd7f48e 100644 --- a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc +++ b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g1end_of_interval_monthly = &_grib_acce void grib_accessor_class_g1end_of_interval_monthly_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_abstract_vector_t::init(a, l, c); grib_accessor_g1end_of_interval_monthly_t* self = (grib_accessor_g1end_of_interval_monthly_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_g1forecastmonth.cc b/src/accessor/grib_accessor_class_g1forecastmonth.cc index f0a0e86db..a849125f9 100644 --- a/src/accessor/grib_accessor_class_g1forecastmonth.cc +++ b/src/accessor/grib_accessor_class_g1forecastmonth.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g1forecastmonth = &_grib_accessor_class void grib_accessor_class_g1forecastmonth_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_g1forecastmonth_t* self = (grib_accessor_g1forecastmonth_t*)a; grib_handle* h = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_g1monthlydate.cc b/src/accessor/grib_accessor_class_g1monthlydate.cc index 3a184669b..79aba52ed 100644 --- a/src/accessor/grib_accessor_class_g1monthlydate.cc +++ b/src/accessor/grib_accessor_class_g1monthlydate.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g1monthlydate = &_grib_accessor_class_g void grib_accessor_class_g1monthlydate_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_g1monthlydate_t* self = (grib_accessor_g1monthlydate_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc index 17d36f908..0623a32d7 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_complex = & void grib_accessor_class_g1number_of_coded_values_sh_complex_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); int n = 0; grib_accessor_g1number_of_coded_values_sh_complex_t* self = (grib_accessor_g1number_of_coded_values_sh_complex_t*)a; self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc index c2d9801f8..50fe992c9 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_simple = &_ void grib_accessor_class_g1number_of_coded_values_sh_simple_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); int n = 0; grib_accessor_g1number_of_coded_values_sh_simple_t* self = (grib_accessor_g1number_of_coded_values_sh_simple_t*)a; self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); diff --git a/src/accessor/grib_accessor_class_g1step_range.cc b/src/accessor/grib_accessor_class_g1step_range.cc index f2444486a..5cf69c863 100644 --- a/src/accessor/grib_accessor_class_g1step_range.cc +++ b/src/accessor/grib_accessor_class_g1step_range.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g1step_range = &_grib_accessor_class_g1 void grib_accessor_class_g1step_range_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_abstract_long_vector_t::init(a, l, c); grib_accessor_g1step_range_t* self = (grib_accessor_g1step_range_t*)a; grib_handle* h = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_g1verificationdate.cc b/src/accessor/grib_accessor_class_g1verificationdate.cc index 7f91c5b99..b77267427 100644 --- a/src/accessor/grib_accessor_class_g1verificationdate.cc +++ b/src/accessor/grib_accessor_class_g1verificationdate.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g1verificationdate = &_grib_accessor_cl void grib_accessor_class_g1verificationdate_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_g1verificationdate_t* self = (grib_accessor_g1verificationdate_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_g2_aerosol.cc b/src/accessor/grib_accessor_class_g2_aerosol.cc index 654c0e97a..4d20e0d9a 100644 --- a/src/accessor/grib_accessor_class_g2_aerosol.cc +++ b/src/accessor/grib_accessor_class_g2_aerosol.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g2_aerosol = &_grib_accessor_class_g2_a void grib_accessor_class_g2_aerosol_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_unsigned_t::init(a, l, c); grib_accessor_g2_aerosol_t* self = (grib_accessor_g2_aerosol_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_g2_chemical.cc b/src/accessor/grib_accessor_class_g2_chemical.cc index 72d7581e1..d00e90feb 100644 --- a/src/accessor/grib_accessor_class_g2_chemical.cc +++ b/src/accessor/grib_accessor_class_g2_chemical.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g2_chemical = &_grib_accessor_class_g2_ void grib_accessor_class_g2_chemical_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_unsigned_t::init(a, l, c); grib_accessor_g2_chemical_t* self = (grib_accessor_g2_chemical_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_g2_eps.cc b/src/accessor/grib_accessor_class_g2_eps.cc index 336245721..afdea42bf 100644 --- a/src/accessor/grib_accessor_class_g2_eps.cc +++ b/src/accessor/grib_accessor_class_g2_eps.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g2_eps = &_grib_accessor_class_g2_eps; void grib_accessor_class_g2_eps_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_unsigned_t::init(a, l, c); grib_accessor_g2_eps_t* self = (grib_accessor_g2_eps_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_g2_mars_labeling.cc b/src/accessor/grib_accessor_class_g2_mars_labeling.cc index 4de889cfa..8fcc03141 100644 --- a/src/accessor/grib_accessor_class_g2_mars_labeling.cc +++ b/src/accessor/grib_accessor_class_g2_mars_labeling.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g2_mars_labeling = &_grib_accessor_clas void grib_accessor_class_g2_mars_labeling_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_gen_t::init(a, l, c); grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; int n = 0; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_g2bitmap.cc b/src/accessor/grib_accessor_class_g2bitmap.cc index f6ed3f1c8..3996e0c7f 100644 --- a/src/accessor/grib_accessor_class_g2bitmap.cc +++ b/src/accessor/grib_accessor_class_g2bitmap.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_g2bitmap = &_grib_accessor_class_g2bitm void grib_accessor_class_g2bitmap_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_bitmap_t::init(a, len, arg); grib_accessor_g2bitmap_t* self = (grib_accessor_g2bitmap_t*)a; self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 4); diff --git a/src/accessor/grib_accessor_class_g2bitmap_present.cc b/src/accessor/grib_accessor_class_g2bitmap_present.cc index b4dfb5cf5..4e31cb3ba 100644 --- a/src/accessor/grib_accessor_class_g2bitmap_present.cc +++ b/src/accessor/grib_accessor_class_g2bitmap_present.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g2bitmap_present = &_grib_accessor_clas void grib_accessor_class_g2bitmap_present_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); int n = 0; grib_accessor_g2bitmap_present_t* self = (grib_accessor_g2bitmap_present_t*)a; self->bitmapIndicator = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); diff --git a/src/accessor/grib_accessor_class_g2date.cc b/src/accessor/grib_accessor_class_g2date.cc index 5b54ccc83..b4ea04eda 100644 --- a/src/accessor/grib_accessor_class_g2date.cc +++ b/src/accessor/grib_accessor_class_g2date.cc @@ -16,6 +16,7 @@ grib_accessor_class_g2date_t _grib_accessor_class_g2date{"g2date"}; grib_accessor_class* grib_accessor_class_g2date = &_grib_accessor_class_g2date; void grib_accessor_class_g2date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_g2date_t* self = (grib_accessor_g2date_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_g2end_step.cc b/src/accessor/grib_accessor_class_g2end_step.cc index 947b867fd..1e0f77c03 100644 --- a/src/accessor/grib_accessor_class_g2end_step.cc +++ b/src/accessor/grib_accessor_class_g2end_step.cc @@ -20,6 +20,7 @@ grib_accessor_class* grib_accessor_class_g2end_step = &_grib_accessor_class_g2en void grib_accessor_class_g2end_step_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; int n = 0; grib_handle* h = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_g2grid.cc b/src/accessor/grib_accessor_class_g2grid.cc index 74f276c62..c28351a29 100644 --- a/src/accessor/grib_accessor_class_g2grid.cc +++ b/src/accessor/grib_accessor_class_g2grid.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g2grid = &_grib_accessor_class_g2grid; void grib_accessor_class_g2grid_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_g2grid_t* self = (grib_accessor_g2grid_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_g2latlon.cc b/src/accessor/grib_accessor_class_g2latlon.cc index f3d64f1e6..35bb09e7e 100644 --- a/src/accessor/grib_accessor_class_g2latlon.cc +++ b/src/accessor/grib_accessor_class_g2latlon.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g2latlon = &_grib_accessor_class_g2latl void grib_accessor_class_g2latlon_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_g2latlon_t* self = (grib_accessor_g2latlon_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_g2level.cc b/src/accessor/grib_accessor_class_g2level.cc index 084b6eba9..37e3c01d6 100644 --- a/src/accessor/grib_accessor_class_g2level.cc +++ b/src/accessor/grib_accessor_class_g2level.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g2level = &_grib_accessor_class_g2level void grib_accessor_class_g2level_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_g2level_t* self = (grib_accessor_g2level_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_g2lon.cc b/src/accessor/grib_accessor_class_g2lon.cc index 1ef641a89..e5b25640f 100644 --- a/src/accessor/grib_accessor_class_g2lon.cc +++ b/src/accessor/grib_accessor_class_g2lon.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_g2lon = &_grib_accessor_class_g2lon; void grib_accessor_class_g2lon_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_g2lon_t* self = (grib_accessor_g2lon_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_g2step_range.cc b/src/accessor/grib_accessor_class_g2step_range.cc index ca7595ace..b53d8c92f 100644 --- a/src/accessor/grib_accessor_class_g2step_range.cc +++ b/src/accessor/grib_accessor_class_g2step_range.cc @@ -23,6 +23,7 @@ grib_accessor_class* grib_accessor_class_g2step_range = &_grib_accessor_class_g2 void grib_accessor_class_g2step_range_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_gen_t::init(a, l, c); grib_accessor_g2step_range_t* self = (grib_accessor_g2step_range_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_gaussian_grid_name.cc b/src/accessor/grib_accessor_class_gaussian_grid_name.cc index 7b27f2c05..b77970ae9 100644 --- a/src/accessor/grib_accessor_class_gaussian_grid_name.cc +++ b/src/accessor/grib_accessor_class_gaussian_grid_name.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_gaussian_grid_name = &_grib_accessor_cl void grib_accessor_class_gaussian_grid_name_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_gaussian_grid_name_t* self = (grib_accessor_gaussian_grid_name_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_gds_is_present.cc b/src/accessor/grib_accessor_class_gds_is_present.cc index 4939d0949..b2685ee3a 100644 --- a/src/accessor/grib_accessor_class_gds_is_present.cc +++ b/src/accessor/grib_accessor_class_gds_is_present.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_gds_is_present = &_grib_accessor_class_ void grib_accessor_class_gds_is_present_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); int n = 0; grib_accessor_gds_is_present_t* self = (grib_accessor_gds_is_present_t*)a; grib_handle* h = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_gds_not_present_bitmap.cc b/src/accessor/grib_accessor_class_gds_not_present_bitmap.cc index 368f112d4..0fd8c9e01 100644 --- a/src/accessor/grib_accessor_class_gds_not_present_bitmap.cc +++ b/src/accessor/grib_accessor_class_gds_not_present_bitmap.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_gds_not_present_bitmap = &_grib_accesso void grib_accessor_class_gds_not_present_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, v, args); int n = 0; grib_accessor_gds_not_present_bitmap_t* self = (grib_accessor_gds_not_present_bitmap_t*)a; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_getenv.cc b/src/accessor/grib_accessor_class_getenv.cc index 2c714767d..e95c3d39a 100644 --- a/src/accessor/grib_accessor_class_getenv.cc +++ b/src/accessor/grib_accessor_class_getenv.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_getenv = &_grib_accessor_class_getenv; void grib_accessor_class_getenv_t::init(grib_accessor* a, const long l, grib_arguments* args){ + grib_accessor_class_ascii_t::init(a, l, args); grib_accessor_getenv_t* self = (grib_accessor_getenv_t*)a; static char undefined[] = "undefined"; diff --git a/src/accessor/grib_accessor_class_global_gaussian.cc b/src/accessor/grib_accessor_class_global_gaussian.cc index a26b77252..1a86afd55 100644 --- a/src/accessor/grib_accessor_class_global_gaussian.cc +++ b/src/accessor/grib_accessor_class_global_gaussian.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_global_gaussian = &_grib_accessor_class void grib_accessor_class_global_gaussian_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_global_gaussian_t* self = (grib_accessor_global_gaussian_t*)a; int n = 0; grib_handle* h = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_group.cc b/src/accessor/grib_accessor_class_group.cc index 20ca66ae2..d540c927c 100644 --- a/src/accessor/grib_accessor_class_group.cc +++ b/src/accessor/grib_accessor_class_group.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_group = &_grib_accessor_class_group; void grib_accessor_class_group_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; grib_accessor_group_t* self = (grib_accessor_group_t*)a; diff --git a/src/accessor/grib_accessor_class_gts_header.cc b/src/accessor/grib_accessor_class_gts_header.cc index 4d24c8835..493cbf0f8 100644 --- a/src/accessor/grib_accessor_class_gts_header.cc +++ b/src/accessor/grib_accessor_class_gts_header.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_gts_header = &_grib_accessor_class_gts_ void grib_accessor_class_gts_header_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_ascii_t::init(a, l, c); grib_accessor_gts_header_t* self = (grib_accessor_gts_header_t*)a; self->gts_offset = -1; self->gts_length = -1; diff --git a/src/accessor/grib_accessor_class_hash_array.cc b/src/accessor/grib_accessor_class_hash_array.cc index d2fd1a8ef..757b1887e 100644 --- a/src/accessor/grib_accessor_class_hash_array.cc +++ b/src/accessor/grib_accessor_class_hash_array.cc @@ -19,6 +19,7 @@ grib_accessor_class* grib_accessor_class_hash_array = &_grib_accessor_class_hash #define MAX_HASH_ARRAY_STRING_LENGTH 255 void grib_accessor_class_hash_array_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, len, args); grib_accessor_hash_array_t* self = (grib_accessor_hash_array_t*)a; a->length = 0; self->key = 0; diff --git a/src/accessor/grib_accessor_class_headers_only.cc b/src/accessor/grib_accessor_class_headers_only.cc index b1c00a529..802fd3f67 100644 --- a/src/accessor/grib_accessor_class_headers_only.cc +++ b/src/accessor/grib_accessor_class_headers_only.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_headers_only = &_grib_accessor_class_he void grib_accessor_class_headers_only_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_gen_t::init(a, l, c); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; a->length = 0; diff --git a/src/accessor/grib_accessor_class_ibmfloat.cc b/src/accessor/grib_accessor_class_ibmfloat.cc index 65a471eb5..54bdb05c6 100644 --- a/src/accessor/grib_accessor_class_ibmfloat.cc +++ b/src/accessor/grib_accessor_class_ibmfloat.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_ibmfloat = &_grib_accessor_class_ibmflo void grib_accessor_class_ibmfloat_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_double_t::init(a, len, arg); grib_accessor_ibmfloat_t* self = (grib_accessor_ibmfloat_t*)a; long count = 0; diff --git a/src/accessor/grib_accessor_class_ieeefloat.cc b/src/accessor/grib_accessor_class_ieeefloat.cc index 1433bd8d5..4d220d18e 100644 --- a/src/accessor/grib_accessor_class_ieeefloat.cc +++ b/src/accessor/grib_accessor_class_ieeefloat.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_ieeefloat = &_grib_accessor_class_ieeef void grib_accessor_class_ieeefloat_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_double_t::init(a, len, arg); grib_accessor_ieeefloat_t* self = (grib_accessor_ieeefloat_t*)a; long count = 0; self->arg = arg; diff --git a/src/accessor/grib_accessor_class_ifs_param.cc b/src/accessor/grib_accessor_class_ifs_param.cc index 291849046..419eeff91 100644 --- a/src/accessor/grib_accessor_class_ifs_param.cc +++ b/src/accessor/grib_accessor_class_ifs_param.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_ifs_param = &_grib_accessor_class_ifs_p void grib_accessor_class_ifs_param_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_gen_t::init(a, l, c); grib_accessor_ifs_param_t* self = (grib_accessor_ifs_param_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_julian_date.cc b/src/accessor/grib_accessor_class_julian_date.cc index 966dc2d66..8e3f1e1c4 100644 --- a/src/accessor/grib_accessor_class_julian_date.cc +++ b/src/accessor/grib_accessor_class_julian_date.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_julian_date = &_grib_accessor_class_jul void grib_accessor_class_julian_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_julian_date_t* self = (grib_accessor_julian_date_t*)a; int n = 0; grib_handle* h = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_julian_day.cc b/src/accessor/grib_accessor_class_julian_day.cc index 4e978c20e..f96213a0e 100644 --- a/src/accessor/grib_accessor_class_julian_day.cc +++ b/src/accessor/grib_accessor_class_julian_day.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_julian_day = &_grib_accessor_class_juli void grib_accessor_class_julian_day_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_julian_day_t* self = (grib_accessor_julian_day_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_ksec1expver.cc b/src/accessor/grib_accessor_class_ksec1expver.cc index dcd3c336e..0b6d94754 100644 --- a/src/accessor/grib_accessor_class_ksec1expver.cc +++ b/src/accessor/grib_accessor_class_ksec1expver.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_ksec1expver = &_grib_accessor_class_kse void grib_accessor_class_ksec1expver_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_ascii_t::init(a, len, arg); a->length = len; Assert(a->length >= 0); } diff --git a/src/accessor/grib_accessor_class_label.cc b/src/accessor/grib_accessor_class_label.cc index 547bdb11a..dfcecd887 100644 --- a/src/accessor/grib_accessor_class_label.cc +++ b/src/accessor/grib_accessor_class_label.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_label = &_grib_accessor_class_label; void grib_accessor_class_label_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; a->length = 0; diff --git a/src/accessor/grib_accessor_class_latitudes.cc b/src/accessor/grib_accessor_class_latitudes.cc index 65fcf65a8..c290c9f8e 100644 --- a/src/accessor/grib_accessor_class_latitudes.cc +++ b/src/accessor/grib_accessor_class_latitudes.cc @@ -43,6 +43,7 @@ int compare_doubles_descending(const void* a, const void* b){ } void grib_accessor_class_latitudes_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_latitudes_t* self = (grib_accessor_latitudes_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_latlon_increment.cc b/src/accessor/grib_accessor_class_latlon_increment.cc index 3ecff170a..66e0944ac 100644 --- a/src/accessor/grib_accessor_class_latlon_increment.cc +++ b/src/accessor/grib_accessor_class_latlon_increment.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_latlon_increment = &_grib_accessor_clas void grib_accessor_class_latlon_increment_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_latlon_increment_t* self = (grib_accessor_latlon_increment_t*)a; int n = 0; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_latlonvalues.cc b/src/accessor/grib_accessor_class_latlonvalues.cc index ca52ffb6d..42a2b8c31 100644 --- a/src/accessor/grib_accessor_class_latlonvalues.cc +++ b/src/accessor/grib_accessor_class_latlonvalues.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_latlonvalues = &_grib_accessor_class_la void grib_accessor_class_latlonvalues_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_latlonvalues_t* self = (grib_accessor_latlonvalues_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_local_definition.cc b/src/accessor/grib_accessor_class_local_definition.cc index c216ddb2a..b0633c698 100644 --- a/src/accessor/grib_accessor_class_local_definition.cc +++ b/src/accessor/grib_accessor_class_local_definition.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_local_definition = &_grib_accessor_clas void grib_accessor_class_local_definition_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_unsigned_t::init(a, l, c); grib_accessor_local_definition_t* self = (grib_accessor_local_definition_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_long_vector.cc b/src/accessor/grib_accessor_class_long_vector.cc index d99b6e860..2ca32aa48 100644 --- a/src/accessor/grib_accessor_class_long_vector.cc +++ b/src/accessor/grib_accessor_class_long_vector.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_long_vector = &_grib_accessor_class_lon void grib_accessor_class_long_vector_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_abstract_long_vector_t::init(a, l, c); grib_accessor_long_vector_t* self = (grib_accessor_long_vector_t*)a; grib_accessor* va = NULL; grib_accessor_abstract_long_vector_t* v = NULL; diff --git a/src/accessor/grib_accessor_class_longitudes.cc b/src/accessor/grib_accessor_class_longitudes.cc index 09fd4a4e6..5b2f363b7 100644 --- a/src/accessor/grib_accessor_class_longitudes.cc +++ b/src/accessor/grib_accessor_class_longitudes.cc @@ -20,6 +20,7 @@ grib_accessor_class* grib_accessor_class_longitudes = &_grib_accessor_class_long static int get_distinct(grib_accessor* a, double** val, long* len); int compare_doubles(const void* a, const void* b); void grib_accessor_class_longitudes_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_longitudes_t* self = (grib_accessor_longitudes_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_lookup.cc b/src/accessor/grib_accessor_class_lookup.cc index d480866c5..3275b9d4e 100644 --- a/src/accessor/grib_accessor_class_lookup.cc +++ b/src/accessor/grib_accessor_class_lookup.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_lookup = &_grib_accessor_class_lookup; void grib_accessor_class_lookup_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_long_t::init(a, len, arg); grib_accessor_lookup_t* self = (grib_accessor_lookup_t*)a; a->length = 0; self->llength = len; diff --git a/src/accessor/grib_accessor_class_mars_param.cc b/src/accessor/grib_accessor_class_mars_param.cc index 76b55a1fe..99012ca4f 100644 --- a/src/accessor/grib_accessor_class_mars_param.cc +++ b/src/accessor/grib_accessor_class_mars_param.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_mars_param = &_grib_accessor_class_mars void grib_accessor_class_mars_param_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_ascii_t::init(a, l, c); int n = 0; grib_accessor_mars_param_t* self = (grib_accessor_mars_param_t*)a; self->paramId = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); diff --git a/src/accessor/grib_accessor_class_mars_step.cc b/src/accessor/grib_accessor_class_mars_step.cc index 05a5120c2..40e198ba3 100644 --- a/src/accessor/grib_accessor_class_mars_step.cc +++ b/src/accessor/grib_accessor_class_mars_step.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_mars_step = &_grib_accessor_class_mars_ void grib_accessor_class_mars_step_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_ascii_t::init(a, l, c); int n = 0; grib_accessor_mars_step_t* self = (grib_accessor_mars_step_t*)a; self->stepRange = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); diff --git a/src/accessor/grib_accessor_class_md5.cc b/src/accessor/grib_accessor_class_md5.cc index f19836aea..7d5fd330f 100644 --- a/src/accessor/grib_accessor_class_md5.cc +++ b/src/accessor/grib_accessor_class_md5.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_md5 = &_grib_accessor_class_md5; void grib_accessor_class_md5_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_md5_t* self = (grib_accessor_md5_t*)a; char* b = 0; int n = 0; diff --git a/src/accessor/grib_accessor_class_message.cc b/src/accessor/grib_accessor_class_message.cc index 76fcb7be7..c855e067e 100644 --- a/src/accessor/grib_accessor_class_message.cc +++ b/src/accessor/grib_accessor_class_message.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_message = &_grib_accessor_class_message void grib_accessor_class_message_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_bytes_t::init(a, len, arg); a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->length = grib_handle_of_accessor(a)->buffer->ulength - len - a->offset; diff --git a/src/accessor/grib_accessor_class_message_copy.cc b/src/accessor/grib_accessor_class_message_copy.cc index e32d39355..36490fb89 100644 --- a/src/accessor/grib_accessor_class_message_copy.cc +++ b/src/accessor/grib_accessor_class_message_copy.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_message_copy = &_grib_accessor_class_me void grib_accessor_class_message_copy_t::init(grib_accessor* a, const long length, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, length, args); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->length = 0; } diff --git a/src/accessor/grib_accessor_class_multdouble.cc b/src/accessor/grib_accessor_class_multdouble.cc index 3b8b42bd5..ea5068291 100644 --- a/src/accessor/grib_accessor_class_multdouble.cc +++ b/src/accessor/grib_accessor_class_multdouble.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_multdouble = &_grib_accessor_class_mult void grib_accessor_class_multdouble_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_multdouble_t* self = (grib_accessor_multdouble_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_non_alpha.cc b/src/accessor/grib_accessor_class_non_alpha.cc index 05f8ca01c..26401d764 100644 --- a/src/accessor/grib_accessor_class_non_alpha.cc +++ b/src/accessor/grib_accessor_class_non_alpha.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_non_alpha = &_grib_accessor_class_non_a void grib_accessor_class_non_alpha_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; size_t i = 0; unsigned char* v; diff --git a/src/accessor/grib_accessor_class_number_of_coded_values.cc b/src/accessor/grib_accessor_class_number_of_coded_values.cc index b77769898..3cbcf7324 100644 --- a/src/accessor/grib_accessor_class_number_of_coded_values.cc +++ b/src/accessor/grib_accessor_class_number_of_coded_values.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_number_of_coded_values = &_grib_accesso void grib_accessor_class_number_of_coded_values_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); int n = 0; grib_accessor_number_of_coded_values_t* self = (grib_accessor_number_of_coded_values_t*)a; self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); diff --git a/src/accessor/grib_accessor_class_number_of_points.cc b/src/accessor/grib_accessor_class_number_of_points.cc index abd4af786..d1c164fac 100644 --- a/src/accessor/grib_accessor_class_number_of_points.cc +++ b/src/accessor/grib_accessor_class_number_of_points.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_number_of_points = &_grib_accessor_clas void grib_accessor_class_number_of_points_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); int n = 0; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_number_of_points_gaussian.cc b/src/accessor/grib_accessor_class_number_of_points_gaussian.cc index c7fd4e4b8..909aa1b3d 100644 --- a/src/accessor/grib_accessor_class_number_of_points_gaussian.cc +++ b/src/accessor/grib_accessor_class_number_of_points_gaussian.cc @@ -19,6 +19,7 @@ grib_accessor_class* grib_accessor_class_number_of_points_gaussian = &_grib_acce #define EFDEBUG 0 void grib_accessor_class_number_of_points_gaussian_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); int n = 0; grib_handle* h = grib_handle_of_accessor(a); grib_accessor_number_of_points_gaussian_t* self = (grib_accessor_number_of_points_gaussian_t*)a; diff --git a/src/accessor/grib_accessor_class_number_of_values.cc b/src/accessor/grib_accessor_class_number_of_values.cc index 3472eb68d..1b8e9fd65 100644 --- a/src/accessor/grib_accessor_class_number_of_values.cc +++ b/src/accessor/grib_accessor_class_number_of_values.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_number_of_values = &_grib_accessor_clas void grib_accessor_class_number_of_values_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); int n = 0; grib_accessor_number_of_values_t* self = (grib_accessor_number_of_values_t*)a; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc index ecfe11b22..1605faa21 100644 --- a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc +++ b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_number_of_values_data_raw_packing = &_g void grib_accessor_class_number_of_values_data_raw_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, v, args); int n = 0; grib_accessor_number_of_values_data_raw_packing_t* self = (grib_accessor_number_of_values_data_raw_packing_t*)a; diff --git a/src/accessor/grib_accessor_class_octahedral_gaussian.cc b/src/accessor/grib_accessor_class_octahedral_gaussian.cc index 259f97375..a5e4c7a76 100644 --- a/src/accessor/grib_accessor_class_octahedral_gaussian.cc +++ b/src/accessor/grib_accessor_class_octahedral_gaussian.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_octahedral_gaussian = &_grib_accessor_c void grib_accessor_class_octahedral_gaussian_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_octahedral_gaussian_t* self = (grib_accessor_octahedral_gaussian_t*)a; int n = 0; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_octet_number.cc b/src/accessor/grib_accessor_class_octet_number.cc index 4a4c28ad7..bb30500a4 100644 --- a/src/accessor/grib_accessor_class_octet_number.cc +++ b/src/accessor/grib_accessor_class_octet_number.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_octet_number = &_grib_accessor_class_oc void grib_accessor_class_octet_number_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_octet_number_t* self = (grib_accessor_octet_number_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_offset_file.cc b/src/accessor/grib_accessor_class_offset_file.cc index ab9c79a11..9bcb55f99 100644 --- a/src/accessor/grib_accessor_class_offset_file.cc +++ b/src/accessor/grib_accessor_class_offset_file.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_offset_file = &_grib_accessor_class_off void grib_accessor_class_offset_file_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->length = 0; } diff --git a/src/accessor/grib_accessor_class_offset_values.cc b/src/accessor/grib_accessor_class_offset_values.cc index bbd0139c9..700bdb0f4 100644 --- a/src/accessor/grib_accessor_class_offset_values.cc +++ b/src/accessor/grib_accessor_class_offset_values.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_offset_values = &_grib_accessor_class_o void grib_accessor_class_offset_values_t::init(grib_accessor* a, const long l, grib_arguments* args){ + grib_accessor_class_double_t::init(a, l, args); int n = 0; grib_accessor_offset_values_t* self = (grib_accessor_offset_values_t*)a; self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); diff --git a/src/accessor/grib_accessor_class_optimal_step_units.cc b/src/accessor/grib_accessor_class_optimal_step_units.cc index 7a4802045..c6d5006c5 100644 --- a/src/accessor/grib_accessor_class_optimal_step_units.cc +++ b/src/accessor/grib_accessor_class_optimal_step_units.cc @@ -19,6 +19,7 @@ grib_accessor_class* grib_accessor_class_optimal_step_units = &_grib_accessor_cl void grib_accessor_class_optimal_step_units_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_gen_t::init(a, l, c); grib_accessor_optimal_step_units_t* self = (grib_accessor_optimal_step_units_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_pack_bufr_values.cc b/src/accessor/grib_accessor_class_pack_bufr_values.cc index 803491932..17d17746b 100644 --- a/src/accessor/grib_accessor_class_pack_bufr_values.cc +++ b/src/accessor/grib_accessor_class_pack_bufr_values.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_pack_bufr_values = &_grib_accessor_clas void grib_accessor_class_pack_bufr_values_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_class_gen_t::init(a, len, params); char* key; grib_accessor_pack_bufr_values_t* self = (grib_accessor_pack_bufr_values_t*)a; key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), params, 0); diff --git a/src/accessor/grib_accessor_class_packing_type.cc b/src/accessor/grib_accessor_class_packing_type.cc index 845400a00..8be8c02aa 100644 --- a/src/accessor/grib_accessor_class_packing_type.cc +++ b/src/accessor/grib_accessor_class_packing_type.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_packing_type = &_grib_accessor_class_pa void grib_accessor_class_packing_type_t::init(grib_accessor* a, const long l, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, l, args); int n = 0; grib_accessor_packing_type_t* self = (grib_accessor_packing_type_t*)a; self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); diff --git a/src/accessor/grib_accessor_class_pad.cc b/src/accessor/grib_accessor_class_pad.cc index 10ceda53c..aa6ff538f 100644 --- a/src/accessor/grib_accessor_class_pad.cc +++ b/src/accessor/grib_accessor_class_pad.cc @@ -29,6 +29,7 @@ size_t grib_accessor_class_pad_t::preferred_size(grib_accessor* a, int from_hand void grib_accessor_class_pad_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_padding_t::init(a, len, arg); grib_accessor_pad_t* self = (grib_accessor_pad_t*)a; self->expression = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); diff --git a/src/accessor/grib_accessor_class_padding.cc b/src/accessor/grib_accessor_class_padding.cc index 5a1699124..2dd0c6265 100644 --- a/src/accessor/grib_accessor_class_padding.cc +++ b/src/accessor/grib_accessor_class_padding.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_padding = &_grib_accessor_class_padding void grib_accessor_class_padding_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_bytes_t::init(a, len, arg); a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } diff --git a/src/accessor/grib_accessor_class_padto.cc b/src/accessor/grib_accessor_class_padto.cc index 79207c8a9..d162403ed 100644 --- a/src/accessor/grib_accessor_class_padto.cc +++ b/src/accessor/grib_accessor_class_padto.cc @@ -34,6 +34,7 @@ size_t grib_accessor_class_padto_t::preferred_size(grib_accessor* a, int from_ha void grib_accessor_class_padto_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_padding_t::init(a, len, arg); grib_accessor_padto_t* self = (grib_accessor_padto_t*)a; self->expression = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); diff --git a/src/accessor/grib_accessor_class_padtoeven.cc b/src/accessor/grib_accessor_class_padtoeven.cc index 5d3dfba45..ff6aef055 100644 --- a/src/accessor/grib_accessor_class_padtoeven.cc +++ b/src/accessor/grib_accessor_class_padtoeven.cc @@ -39,6 +39,7 @@ size_t grib_accessor_class_padtoeven_t::preferred_size(grib_accessor* a, int fro } void grib_accessor_class_padtoeven_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_padding_t::init(a, len, args); grib_accessor_padtoeven_t* self = (grib_accessor_padtoeven_t*)a; self->section_offset = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); diff --git a/src/accessor/grib_accessor_class_padtomultiple.cc b/src/accessor/grib_accessor_class_padtomultiple.cc index 3f92f8409..88e4c6591 100644 --- a/src/accessor/grib_accessor_class_padtomultiple.cc +++ b/src/accessor/grib_accessor_class_padtomultiple.cc @@ -32,6 +32,7 @@ size_t grib_accessor_class_padtomultiple_t::preferred_size(grib_accessor* a, int } void grib_accessor_class_padtomultiple_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_padding_t::init(a, len, arg); grib_accessor_padtomultiple_t* self = (grib_accessor_padtomultiple_t*)a; self->begin = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); diff --git a/src/accessor/grib_accessor_class_position.cc b/src/accessor/grib_accessor_class_position.cc index fb00740f3..a8d6201d4 100644 --- a/src/accessor/grib_accessor_class_position.cc +++ b/src/accessor/grib_accessor_class_position.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_position = &_grib_accessor_class_positi void grib_accessor_class_position_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; diff --git a/src/accessor/grib_accessor_class_proj_string.cc b/src/accessor/grib_accessor_class_proj_string.cc index ab03465fb..da7f7ac35 100644 --- a/src/accessor/grib_accessor_class_proj_string.cc +++ b/src/accessor/grib_accessor_class_proj_string.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_proj_string = &_grib_accessor_class_pro void grib_accessor_class_proj_string_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_proj_string_t* self = (grib_accessor_proj_string_t*)a; grib_handle* h = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_raw.cc b/src/accessor/grib_accessor_class_raw.cc index 310d887e3..1473325a3 100644 --- a/src/accessor/grib_accessor_class_raw.cc +++ b/src/accessor/grib_accessor_class_raw.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_raw = &_grib_accessor_class_raw; void grib_accessor_class_raw_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); int n = 0; int err = 0; long sectionLength; diff --git a/src/accessor/grib_accessor_class_rdbtime_guess_date.cc b/src/accessor/grib_accessor_class_rdbtime_guess_date.cc index 346288ad2..77d917757 100644 --- a/src/accessor/grib_accessor_class_rdbtime_guess_date.cc +++ b/src/accessor/grib_accessor_class_rdbtime_guess_date.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_rdbtime_guess_date = &_grib_accessor_cl void grib_accessor_class_rdbtime_guess_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_rdbtime_guess_date_t* self = (grib_accessor_rdbtime_guess_date_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_reference_value_error.cc b/src/accessor/grib_accessor_class_reference_value_error.cc index 8d4f3a1cc..7329acaee 100644 --- a/src/accessor/grib_accessor_class_reference_value_error.cc +++ b/src/accessor/grib_accessor_class_reference_value_error.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_reference_value_error = &_grib_accessor void grib_accessor_class_reference_value_error_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_reference_value_error_t* self = (grib_accessor_reference_value_error_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_scale.cc b/src/accessor/grib_accessor_class_scale.cc index a90f31862..76deb2dc5 100644 --- a/src/accessor/grib_accessor_class_scale.cc +++ b/src/accessor/grib_accessor_class_scale.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_scale = &_grib_accessor_class_scale; void grib_accessor_class_scale_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_scale_t* self = (grib_accessor_scale_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_scale_values.cc b/src/accessor/grib_accessor_class_scale_values.cc index 0496bd1e4..dcb3e8a1a 100644 --- a/src/accessor/grib_accessor_class_scale_values.cc +++ b/src/accessor/grib_accessor_class_scale_values.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_scale_values = &_grib_accessor_class_sc void grib_accessor_class_scale_values_t::init(grib_accessor* a, const long l, grib_arguments* args){ + grib_accessor_class_double_t::init(a, l, args); int n = 0; grib_accessor_scale_values_t* self = (grib_accessor_scale_values_t*)a; self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); diff --git a/src/accessor/grib_accessor_class_second_order_bits_per_value.cc b/src/accessor/grib_accessor_class_second_order_bits_per_value.cc index a42496716..5d0075ad3 100644 --- a/src/accessor/grib_accessor_class_second_order_bits_per_value.cc +++ b/src/accessor/grib_accessor_class_second_order_bits_per_value.cc @@ -51,6 +51,7 @@ int number_of_bits(size_t x, long* result){ } void grib_accessor_class_second_order_bits_per_value_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); int n = 0; grib_accessor_second_order_bits_per_value_t* self = (grib_accessor_second_order_bits_per_value_t*)a; self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); diff --git a/src/accessor/grib_accessor_class_section.cc b/src/accessor/grib_accessor_class_section.cc index 732435d67..da5380280 100644 --- a/src/accessor/grib_accessor_class_section.cc +++ b/src/accessor/grib_accessor_class_section.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_section = &_grib_accessor_class_section void grib_accessor_class_section_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); a->sub_section = grib_section_create(grib_handle_of_accessor(a), a); a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; diff --git a/src/accessor/grib_accessor_class_section_length.cc b/src/accessor/grib_accessor_class_section_length.cc index 4d78f5f19..3378d60c8 100644 --- a/src/accessor/grib_accessor_class_section_length.cc +++ b/src/accessor/grib_accessor_class_section_length.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_section_length = &_grib_accessor_class_ void grib_accessor_class_section_length_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_unsigned_t::init(a, len, arg); a->parent->aclength = a; a->length = len; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; diff --git a/src/accessor/grib_accessor_class_section_padding.cc b/src/accessor/grib_accessor_class_section_padding.cc index 53cd22c06..d05abcd25 100644 --- a/src/accessor/grib_accessor_class_section_padding.cc +++ b/src/accessor/grib_accessor_class_section_padding.cc @@ -64,6 +64,7 @@ size_t grib_accessor_class_section_padding_t::preferred_size(grib_accessor* a, i } void grib_accessor_class_section_padding_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_padding_t::init(a, len, arg); grib_accessor_section_padding_t* self = (grib_accessor_section_padding_t*)a; self->preserve = 1; /* This should be a parameter */ a->length = preferred_size(a, 1); diff --git a/src/accessor/grib_accessor_class_section_pointer.cc b/src/accessor/grib_accessor_class_section_pointer.cc index 553deb30f..93344acfc 100644 --- a/src/accessor/grib_accessor_class_section_pointer.cc +++ b/src/accessor/grib_accessor_class_section_pointer.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_section_pointer = &_grib_accessor_class void grib_accessor_class_section_pointer_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); int n = 0; grib_accessor_section_pointer_t* self = (grib_accessor_section_pointer_t*)a; diff --git a/src/accessor/grib_accessor_class_select_step_template.cc b/src/accessor/grib_accessor_class_select_step_template.cc index fd4578d41..8de2bc24f 100644 --- a/src/accessor/grib_accessor_class_select_step_template.cc +++ b/src/accessor/grib_accessor_class_select_step_template.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_select_step_template = &_grib_accessor_ void grib_accessor_class_select_step_template_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_unsigned_t::init(a, l, c); grib_accessor_select_step_template_t* self = (grib_accessor_select_step_template_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_sexagesimal2decimal.cc b/src/accessor/grib_accessor_class_sexagesimal2decimal.cc index 7b3a7dbfb..275ce2ff0 100644 --- a/src/accessor/grib_accessor_class_sexagesimal2decimal.cc +++ b/src/accessor/grib_accessor_class_sexagesimal2decimal.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_sexagesimal2decimal = &_grib_accessor_c void grib_accessor_class_sexagesimal2decimal_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_to_double_t::init(a, len, arg); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } diff --git a/src/accessor/grib_accessor_class_signed.cc b/src/accessor/grib_accessor_class_signed.cc index ac2f7757c..84822b421 100644 --- a/src/accessor/grib_accessor_class_signed.cc +++ b/src/accessor/grib_accessor_class_signed.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_signed = &_grib_accessor_class_signed; void grib_accessor_class_signed_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_long_t::init(a, len, arg); grib_accessor_signed_t* self = (grib_accessor_signed_t*)a; long count = 0; diff --git a/src/accessor/grib_accessor_class_signed_bits.cc b/src/accessor/grib_accessor_class_signed_bits.cc index e27f8b53c..c43f2c064 100644 --- a/src/accessor/grib_accessor_class_signed_bits.cc +++ b/src/accessor/grib_accessor_class_signed_bits.cc @@ -44,6 +44,7 @@ static long compute_byte_count(grib_accessor* a){ } void grib_accessor_class_signed_bits_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_long_t::init(a, len, args); grib_accessor_signed_bits_t* self = (grib_accessor_signed_bits_t*)a; int n = 0; self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); diff --git a/src/accessor/grib_accessor_class_simple_packing_error.cc b/src/accessor/grib_accessor_class_simple_packing_error.cc index 41cfddacb..3675b7d15 100644 --- a/src/accessor/grib_accessor_class_simple_packing_error.cc +++ b/src/accessor/grib_accessor_class_simple_packing_error.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_simple_packing_error = &_grib_accessor_ void grib_accessor_class_simple_packing_error_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_simple_packing_error_t* self = (grib_accessor_simple_packing_error_t*)a; int n = 0; grib_handle* h = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_size.cc b/src/accessor/grib_accessor_class_size.cc index 7fbeac212..363cafd28 100644 --- a/src/accessor/grib_accessor_class_size.cc +++ b/src/accessor/grib_accessor_class_size.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_size = &_grib_accessor_class_size; void grib_accessor_class_size_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_size_t* self = (grib_accessor_size_t*)a; self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; diff --git a/src/accessor/grib_accessor_class_smart_table_column.cc b/src/accessor/grib_accessor_class_smart_table_column.cc index d8a5e267f..d63587cd1 100644 --- a/src/accessor/grib_accessor_class_smart_table_column.cc +++ b/src/accessor/grib_accessor_class_smart_table_column.cc @@ -19,6 +19,7 @@ grib_accessor_class* grib_accessor_class_smart_table_column = &_grib_accessor_cl void grib_accessor_class_smart_table_column_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_class_gen_t::init(a, len, params); int n = 0; grib_accessor_smart_table_column_t* self = (grib_accessor_smart_table_column_t*)a; diff --git a/src/accessor/grib_accessor_class_spd.cc b/src/accessor/grib_accessor_class_spd.cc index 709cfef6e..546007ef0 100644 --- a/src/accessor/grib_accessor_class_spd.cc +++ b/src/accessor/grib_accessor_class_spd.cc @@ -45,6 +45,7 @@ static long compute_byte_count(grib_accessor* a){ } void grib_accessor_class_spd_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_long_t::init(a, len, args); grib_accessor_spd_t* self = (grib_accessor_spd_t*)a; int n = 0; self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); diff --git a/src/accessor/grib_accessor_class_spectral_truncation.cc b/src/accessor/grib_accessor_class_spectral_truncation.cc index c10a32d6e..5a51a416c 100644 --- a/src/accessor/grib_accessor_class_spectral_truncation.cc +++ b/src/accessor/grib_accessor_class_spectral_truncation.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_spectral_truncation = &_grib_accessor_c void grib_accessor_class_spectral_truncation_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_spectral_truncation_t* self = (grib_accessor_spectral_truncation_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_sprintf.cc b/src/accessor/grib_accessor_class_sprintf.cc index 8df2bb732..6c361604e 100644 --- a/src/accessor/grib_accessor_class_sprintf.cc +++ b/src/accessor/grib_accessor_class_sprintf.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_sprintf = &_grib_accessor_class_sprintf void grib_accessor_class_sprintf_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_ascii_t::init(a, l, c); grib_accessor_sprintf_t* self = (grib_accessor_sprintf_t*)a; self->args = c; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; diff --git a/src/accessor/grib_accessor_class_statistics.cc b/src/accessor/grib_accessor_class_statistics.cc index 9a4eeee20..ea73e69c3 100644 --- a/src/accessor/grib_accessor_class_statistics.cc +++ b/src/accessor/grib_accessor_class_statistics.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_statistics = &_grib_accessor_class_stat void grib_accessor_class_statistics_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_abstract_vector_t::init(a, l, c); grib_accessor_statistics_t* self = (grib_accessor_statistics_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_statistics_spectral.cc b/src/accessor/grib_accessor_class_statistics_spectral.cc index f8596b84b..57fd16549 100644 --- a/src/accessor/grib_accessor_class_statistics_spectral.cc +++ b/src/accessor/grib_accessor_class_statistics_spectral.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_statistics_spectral = &_grib_accessor_c void grib_accessor_class_statistics_spectral_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_abstract_vector_t::init(a, l, c); grib_accessor_statistics_spectral_t* self = (grib_accessor_statistics_spectral_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_step_human_readable.cc b/src/accessor/grib_accessor_class_step_human_readable.cc index 153468565..ea6930f90 100644 --- a/src/accessor/grib_accessor_class_step_human_readable.cc +++ b/src/accessor/grib_accessor_class_step_human_readable.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_step_human_readable = &_grib_accessor_c void grib_accessor_class_step_human_readable_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_class_gen_t::init(a, len, params); grib_accessor_step_human_readable_t* self = (grib_accessor_step_human_readable_t*)a; int n = 0; grib_handle* h = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_step_in_units.cc b/src/accessor/grib_accessor_class_step_in_units.cc index 4d7cb6cf9..1d6c0afb9 100644 --- a/src/accessor/grib_accessor_class_step_in_units.cc +++ b/src/accessor/grib_accessor_class_step_in_units.cc @@ -20,6 +20,7 @@ grib_accessor_class* grib_accessor_class_step_in_units = &_grib_accessor_class_s void grib_accessor_class_step_in_units_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_step_in_units_t* self = (grib_accessor_step_in_units_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_sum.cc b/src/accessor/grib_accessor_class_sum.cc index 5129ade27..5001e6b52 100644 --- a/src/accessor/grib_accessor_class_sum.cc +++ b/src/accessor/grib_accessor_class_sum.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_sum = &_grib_accessor_class_sum; void grib_accessor_class_sum_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_double_t::init(a, l, c); grib_accessor_sum_t* self = (grib_accessor_sum_t*)a; int n = 0; self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); diff --git a/src/accessor/grib_accessor_class_suppressed.cc b/src/accessor/grib_accessor_class_suppressed.cc index a209e8326..e205b782e 100644 --- a/src/accessor/grib_accessor_class_suppressed.cc +++ b/src/accessor/grib_accessor_class_suppressed.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_suppressed = &_grib_accessor_class_supp void grib_accessor_class_suppressed_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_suppressed_t* self = (grib_accessor_suppressed_t*)a; self->args = c; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; diff --git a/src/accessor/grib_accessor_class_time.cc b/src/accessor/grib_accessor_class_time.cc index e31de829f..ead200ca3 100644 --- a/src/accessor/grib_accessor_class_time.cc +++ b/src/accessor/grib_accessor_class_time.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_time = &_grib_accessor_class_time; void grib_accessor_class_time_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_time_t* self = (grib_accessor_time_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_to_double.cc b/src/accessor/grib_accessor_class_to_double.cc index 8e9e8a0dc..51e6de3e1 100644 --- a/src/accessor/grib_accessor_class_to_double.cc +++ b/src/accessor/grib_accessor_class_to_double.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_to_double = &_grib_accessor_class_to_do void grib_accessor_class_to_double_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_to_double_t* self = (grib_accessor_to_double_t*)a; self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); diff --git a/src/accessor/grib_accessor_class_to_integer.cc b/src/accessor/grib_accessor_class_to_integer.cc index 06f268974..9109ab603 100644 --- a/src/accessor/grib_accessor_class_to_integer.cc +++ b/src/accessor/grib_accessor_class_to_integer.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_to_integer = &_grib_accessor_class_to_i void grib_accessor_class_to_integer_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_to_integer_t* self = (grib_accessor_to_integer_t*)a; self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); diff --git a/src/accessor/grib_accessor_class_to_string.cc b/src/accessor/grib_accessor_class_to_string.cc index fd70a7feb..65f7a3647 100644 --- a/src/accessor/grib_accessor_class_to_string.cc +++ b/src/accessor/grib_accessor_class_to_string.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_to_string = &_grib_accessor_class_to_st void grib_accessor_class_to_string_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_to_string_t* self = (grib_accessor_to_string_t*)a; self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); diff --git a/src/accessor/grib_accessor_class_transient_darray.cc b/src/accessor/grib_accessor_class_transient_darray.cc index d5372e3ca..5f1ec2b2b 100644 --- a/src/accessor/grib_accessor_class_transient_darray.cc +++ b/src/accessor/grib_accessor_class_transient_darray.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_transient_darray = &_grib_accessor_clas void grib_accessor_class_transient_darray_t::init(grib_accessor* a, const long length, grib_arguments* args){ + grib_accessor_class_gen_t::init(a, length, args); grib_accessor_transient_darray_t* self = (grib_accessor_transient_darray_t*)a; self->arr = NULL; self->type = GRIB_TYPE_DOUBLE; diff --git a/src/accessor/grib_accessor_class_trim.cc b/src/accessor/grib_accessor_class_trim.cc index 8f45138fe..8e0e45a6b 100644 --- a/src/accessor/grib_accessor_class_trim.cc +++ b/src/accessor/grib_accessor_class_trim.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_trim = &_grib_accessor_class_trim; void grib_accessor_class_trim_t::init(grib_accessor* a, const long l, grib_arguments* arg){ + grib_accessor_class_ascii_t::init(a, l, arg); int n = 0; grib_accessor_trim_t* self = (grib_accessor_trim_t*)a; grib_handle* h = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_unexpanded_descriptors.cc b/src/accessor/grib_accessor_class_unexpanded_descriptors.cc index 5cfa0970d..4339691a9 100644 --- a/src/accessor/grib_accessor_class_unexpanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_unexpanded_descriptors.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_unexpanded_descriptors = &_grib_accesso void grib_accessor_class_unexpanded_descriptors_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_long_t::init(a, len, args); grib_accessor_unexpanded_descriptors_t* self = (grib_accessor_unexpanded_descriptors_t*)a; int n = 0; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/accessor/grib_accessor_class_unpack_bufr_values.cc b/src/accessor/grib_accessor_class_unpack_bufr_values.cc index f7af4f6fa..984378dc2 100644 --- a/src/accessor/grib_accessor_class_unpack_bufr_values.cc +++ b/src/accessor/grib_accessor_class_unpack_bufr_values.cc @@ -20,6 +20,7 @@ grib_accessor_class* grib_accessor_class_unpack_bufr_values = &_grib_accessor_cl void grib_accessor_class_unpack_bufr_values_t::init(grib_accessor* a, const long len, grib_arguments* params){ + grib_accessor_class_gen_t::init(a, len, params); char* key; grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), params, 0); diff --git a/src/accessor/grib_accessor_class_unsigned_bits.cc b/src/accessor/grib_accessor_class_unsigned_bits.cc index 953951fd9..14c22d309 100644 --- a/src/accessor/grib_accessor_class_unsigned_bits.cc +++ b/src/accessor/grib_accessor_class_unsigned_bits.cc @@ -42,6 +42,7 @@ static long compute_byte_count(grib_accessor* a){ void grib_accessor_class_unsigned_bits_t::init(grib_accessor* a, const long len, grib_arguments* args){ + grib_accessor_class_long_t::init(a, len, args); grib_accessor_unsigned_bits_t* self = (grib_accessor_unsigned_bits_t*)a; int n = 0; self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); diff --git a/src/accessor/grib_accessor_class_validity_date.cc b/src/accessor/grib_accessor_class_validity_date.cc index 5c250964d..8a62f296b 100644 --- a/src/accessor/grib_accessor_class_validity_date.cc +++ b/src/accessor/grib_accessor_class_validity_date.cc @@ -17,6 +17,7 @@ grib_accessor_class_validity_date_t _grib_accessor_class_validity_date{"validity grib_accessor_class* grib_accessor_class_validity_date = &_grib_accessor_class_validity_date; void grib_accessor_class_validity_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_validity_date_t* self = (grib_accessor_validity_date_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_validity_time.cc b/src/accessor/grib_accessor_class_validity_time.cc index 074bac88e..c74b44035 100644 --- a/src/accessor/grib_accessor_class_validity_time.cc +++ b/src/accessor/grib_accessor_class_validity_time.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_validity_time = &_grib_accessor_class_v void grib_accessor_class_validity_time_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_long_t::init(a, l, c); grib_accessor_validity_time_t* self = (grib_accessor_validity_time_t*)a; grib_handle* hand = grib_handle_of_accessor(a); int n = 0; diff --git a/src/accessor/grib_accessor_class_values.cc b/src/accessor/grib_accessor_class_values.cc index e7009129c..7def5b09e 100644 --- a/src/accessor/grib_accessor_class_values.cc +++ b/src/accessor/grib_accessor_class_values.cc @@ -48,6 +48,7 @@ long init_length(grib_accessor* a){ } void grib_accessor_class_values_t::init(grib_accessor* a, const long v, grib_arguments* params){ + grib_accessor_class_gen_t::init(a, v, params); grib_accessor_values_t* self = (grib_accessor_values_t*)a; self->carg = 0; diff --git a/src/accessor/grib_accessor_class_vector.cc b/src/accessor/grib_accessor_class_vector.cc index e48ab1aaf..36b252f95 100644 --- a/src/accessor/grib_accessor_class_vector.cc +++ b/src/accessor/grib_accessor_class_vector.cc @@ -18,6 +18,7 @@ grib_accessor_class* grib_accessor_class_vector = &_grib_accessor_class_vector; void grib_accessor_class_vector_t::init(grib_accessor* a, const long l, grib_arguments* c){ + grib_accessor_class_abstract_vector_t::init(a, l, c); grib_accessor_vector_t* self = (grib_accessor_vector_t*)a; int n = 0; diff --git a/src/accessor/grib_accessor_class_when.cc b/src/accessor/grib_accessor_class_when.cc index 0834d0f86..68b7196c3 100644 --- a/src/accessor/grib_accessor_class_when.cc +++ b/src/accessor/grib_accessor_class_when.cc @@ -17,6 +17,7 @@ grib_accessor_class* grib_accessor_class_when = &_grib_accessor_class_when; void grib_accessor_class_when_t::init(grib_accessor* a, const long len, grib_arguments* arg){ + grib_accessor_class_gen_t::init(a, len, arg); a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; From 05e8b45d424ed6559a7d18482c249147ecdcaa14 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Thu, 4 Apr 2024 12:47:20 +0000 Subject: [PATCH 012/196] 99% tests passed, 4 tests failed out of 337 --- src/accessor/grib_accessor.cc | 12 - src/accessor/grib_accessor.h | 54 +--- src/accessor/grib_accessor_class_bits.cc | 1 - .../grib_accessor_class_bufr_data_array.h | 3 +- .../grib_accessor_class_bufr_data_element.cc | 5 +- .../grib_accessor_class_bufr_data_element.h | 1 + .../grib_accessor_class_bufr_group.cc | 6 +- src/accessor/grib_accessor_class_bufr_group.h | 1 + .../grib_accessor_class_data_apply_bitmap.cc | 80 ------ .../grib_accessor_class_data_apply_bitmap.h | 86 ++++++ ...cessor_class_data_apply_boustrophedonic.cc | 95 ------- ...ccessor_class_data_apply_boustrophedonic.h | 101 +++++++ .../grib_accessor_class_data_ccsds_packing.cc | 152 +---------- .../grib_accessor_class_data_ccsds_packing.h | 158 ++++++++++- ...rib_accessor_class_data_complex_packing.cc | 225 ---------------- ...grib_accessor_class_data_complex_packing.h | 229 +++++++++++++++- ...g1second_order_general_extended_packing.cc | 2 +- ..._g1second_order_general_extended_packing.h | 3 + ...ass_data_g1second_order_general_packing.cc | 105 -------- ...lass_data_g1second_order_general_packing.h | 110 +++++++- ..._data_g1second_order_row_by_row_packing.cc | 167 ------------ ...s_data_g1second_order_row_by_row_packing.h | 173 +++++++++++- ...ib_accessor_class_data_g22order_packing.cc | 250 +---------------- ...rib_accessor_class_data_g22order_packing.h | 254 +++++++++++++++++- ...rib_accessor_class_data_g2simple_packing.h | 8 +- ...ib_accessor_class_data_jpeg2000_packing.cc | 4 +- ...grib_accessor_class_data_simple_packing.cc | 142 ---------- .../grib_accessor_class_data_simple_packing.h | 149 +++++++++- src/accessor/grib_accessor_class_double.cc | 3 +- src/accessor/grib_accessor_class_double.h | 7 +- src/accessor/grib_accessor_class_gen.cc | 151 ++++++----- src/accessor/grib_accessor_class_gen.h | 65 +++++ src/accessor/grib_accessor_class_ibmfloat.cc | 26 -- src/accessor/grib_accessor_class_ibmfloat.h | 31 +++ src/accessor/grib_accessor_class_ieeefloat.cc | 25 -- src/accessor/grib_accessor_class_ieeefloat.h | 31 ++- src/accessor/grib_accessor_class_lookup.h | 2 - src/accessor/grib_accessor_class_section.cc | 9 +- src/accessor/grib_accessor_class_section.h | 9 +- .../grib_accessor_class_smart_table_column.h | 2 - src/accessor/grib_accessor_class_transient.h | 1 - src/accessor/grib_accessor_class_values.h | 3 - src/accessor/grib_accessor_class_variable.h | 1 - src/accessor/grib_accessors_list.cc | 3 - src/accessor/grib_accessors_list.h | 7 +- src/action_class_remove.cc | 8 +- src/action_class_section.cc | 6 +- src/eccodes_prototypes.h | 4 - src/grib_accessor_class.cc | 17 +- src/grib_api_internal.h | 2 +- src/grib_buffer.cc | 4 +- src/grib_dumper_class.cc | 2 +- src/grib_handle.cc | 6 +- src/grib_query.cc | 6 +- src/grib_value.cc | 11 +- tools/bufr_dump.cc | 6 +- tools/gts_compare.cc | 2 +- tools/metar_compare.cc | 2 +- 58 files changed, 1529 insertions(+), 1499 deletions(-) diff --git a/src/accessor/grib_accessor.cc b/src/accessor/grib_accessor.cc index da14833bd..08e50cb78 100644 --- a/src/accessor/grib_accessor.cc +++ b/src/accessor/grib_accessor.cc @@ -28,18 +28,6 @@ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) return (*a == 0 && *b == 0) ? 0 : 1; } -template <> -int grib_accessor::unpack(double* v, size_t* len) -{ - return unpack_double(v, len); -} - -template <> -int grib_accessor::unpack(float* v, size_t* len) -{ - return unpack_float(v, len); -} - int grib_accessor::compare_accessors(grib_accessor* a2, int compare_flags) { int ret = 0; diff --git a/src/accessor/grib_accessor.h b/src/accessor/grib_accessor.h index d79e30111..7220e90e7 100644 --- a/src/accessor/grib_accessor.h +++ b/src/accessor/grib_accessor.h @@ -12,16 +12,13 @@ #include "../grib_api_internal.h" #include "../grib_value.h" -#include class grib_accessor { public: - grib_accessor() : name(nullptr), name_space(nullptr), context(nullptr), h(nullptr), creator(nullptr), length(0), offset(0), parent(nullptr), next(nullptr), previous(nullptr), cclass(nullptr), flags(0), sub_section(nullptr), dirty(0), same(nullptr), loop(0), vvalue(nullptr), set(nullptr), parent_as_attribute(nullptr) {} + grib_accessor() : name(nullptr), name_space(nullptr), context(nullptr), h(nullptr), creator(nullptr), length(0), offset(0), parent(nullptr), next_(nullptr), previous_(nullptr), cclass(nullptr), flags(0), sub_section(nullptr), dirty(0), same(nullptr), loop(0), vvalue(nullptr), set(nullptr), parent_as_attribute(nullptr) {} virtual ~grib_accessor() {} - template int unpack(T* v, size_t* len); - virtual void init_accessor(const long, grib_arguments*) = 0; virtual void dump(grib_dumper* f) = 0; virtual int pack_missing() = 0; @@ -75,8 +72,8 @@ class grib_accessor long length; /** < byte length of the accessor */ long offset; /** < offset of the data in the buffer */ grib_section* parent; /** < section to which the accessor is attached */ - grib_accessor* next; /** < next accessor in list */ - grib_accessor* previous; /** < next accessor in list */ + grib_accessor* next_; /** < next accessor in list */ + grib_accessor* previous_; /** < next accessor in list */ grib_accessor_class* cclass; /** < behaviour of the accessor */ unsigned long flags; /** < Various flags */ grib_section* sub_section; @@ -93,6 +90,7 @@ class grib_accessor grib_accessor* parent_as_attribute; }; + class grib_accessor_class { public: @@ -145,47 +143,3 @@ class grib_accessor_class }; -template -int unpack_helper(grib_accessor* a, T* v, size_t* len) -{ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - int type = GRIB_TYPE_UNDEFINED; - const char* Tname = type_to_string(*v); - //if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { - try { - long val = 0; - size_t l = 1; - a->unpack_long(&val, &l); - *v = val; - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to %s", a->name, Tname); - return GRIB_SUCCESS; - } - catch (std::runtime_error& e) { - // TODO(maee): log error - } - - //if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { - try { - char val[1024]; - size_t l = sizeof(val); - char* last = NULL; - a->unpack_string(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 %s", a->name, Tname); - return GRIB_SUCCESS; - } - } - catch (std::runtime_error& e) { - // TODO(maee): log error - } - - grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as %s", a->name, Tname); - 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/accessor/grib_accessor_class_bits.cc b/src/accessor/grib_accessor_class_bits.cc index bb2b8f9ad..d5d1f248c 100644 --- a/src/accessor/grib_accessor_class_bits.cc +++ b/src/accessor/grib_accessor_class_bits.cc @@ -192,7 +192,6 @@ int grib_accessor_class_bits_t::unpack_string(grib_accessor* a, char* v, size_t* double dval = 0; long lval = 0; size_t llen = 1; - grib_accessor_class* super = NULL; switch (get_native_type(a)) { case GRIB_TYPE_LONG: diff --git a/src/accessor/grib_accessor_class_bufr_data_array.h b/src/accessor/grib_accessor_class_bufr_data_array.h index 386d4ce9c..c6089fa63 100644 --- a/src/accessor/grib_accessor_class_bufr_data_array.h +++ b/src/accessor/grib_accessor_class_bufr_data_array.h @@ -12,13 +12,11 @@ #ifndef eccodes_accessor_bufr_data_array_h #define eccodes_accessor_bufr_data_array_h -#include "../grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_data_array_t : public grib_accessor_gen_t { public: - /* Members defined in bufr_data_array */ const char* bufrDataEncodedName; const char* numberOfSubsetsName; const char* expandedDescriptorsName; @@ -90,4 +88,5 @@ 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); + #endif /* eccodes_accessor_bufr_data_array_h */ diff --git a/src/accessor/grib_accessor_class_bufr_data_element.cc b/src/accessor/grib_accessor_class_bufr_data_element.cc index 584515de2..f479fd236 100644 --- a/src/accessor/grib_accessor_class_bufr_data_element.cc +++ b/src/accessor/grib_accessor_class_bufr_data_element.cc @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,14 +8,12 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bufr_data_element.h" grib_accessor_class_bufr_data_element_t _grib_accessor_class_bufr_data_element{"bufr_data_element"}; grib_accessor_class* grib_accessor_class_bufr_data_element = &_grib_accessor_class_bufr_data_element; - -static grib_accessor* make_clone(grib_accessor* a, grib_section* s, int* err) +grib_accessor* grib_accessor_class_bufr_data_element_t::make_clone(grib_accessor* a, grib_section* s, int* err) { grib_accessor* the_clone = NULL; grib_accessor* attribute = NULL; diff --git a/src/accessor/grib_accessor_class_bufr_data_element.h b/src/accessor/grib_accessor_class_bufr_data_element.h index d75afbe03..6cba5b91c 100644 --- a/src/accessor/grib_accessor_class_bufr_data_element.h +++ b/src/accessor/grib_accessor_class_bufr_data_element.h @@ -52,5 +52,6 @@ class grib_accessor_class_bufr_data_element_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; int unpack_double_element(grib_accessor*, size_t i, double* val) override; + grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; }; #endif /* eccodes_accessor_bufr_data_element_h */ diff --git a/src/accessor/grib_accessor_class_bufr_group.cc b/src/accessor/grib_accessor_class_bufr_group.cc index 73075fcf1..2aae5e583 100644 --- a/src/accessor/grib_accessor_class_bufr_group.cc +++ b/src/accessor/grib_accessor_class_bufr_group.cc @@ -20,16 +20,16 @@ void grib_accessor_class_bufr_group_t::dump(grib_accessor* a, grib_dumper* dumpe grib_dump_section(dumper, a, a->sub_section->block); } -static grib_accessor* next(grib_accessor* a, int explore) +grib_accessor* grib_accessor_class_bufr_group_t::next(grib_accessor* a, int explore) { grib_accessor* next = NULL; if (explore) { next = a->sub_section->block->first; if (!next) - next = a->next; + next = a->next_; } else { - next = a->next; + next = a->next_; } if (!next) { if (a->parent->owner) diff --git a/src/accessor/grib_accessor_class_bufr_group.h b/src/accessor/grib_accessor_class_bufr_group.h index 84a202583..3bd71690f 100644 --- a/src/accessor/grib_accessor_class_bufr_group.h +++ b/src/accessor/grib_accessor_class_bufr_group.h @@ -27,5 +27,6 @@ class grib_accessor_class_bufr_group_t : public grib_accessor_class_variable_t grib_accessor_class_bufr_group_t(const char* name) : grib_accessor_class_variable_t(name) {} grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_group_t{}; } void dump(grib_accessor*, grib_dumper*) override; + grib_accessor* next(grib_accessor* a, int explore) override; }; #endif /* eccodes_accessor_bufr_group_h */ diff --git a/src/accessor/grib_accessor_class_data_apply_bitmap.cc b/src/accessor/grib_accessor_class_data_apply_bitmap.cc index 865d9be74..5529ab36f 100644 --- a/src/accessor/grib_accessor_class_data_apply_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_apply_bitmap.cc @@ -231,86 +231,6 @@ int grib_accessor_class_data_apply_bitmap_t::pack_double(grib_accessor* a, const return err; } -template -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_t* self = (grib_accessor_data_apply_bitmap_t*)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 = a->value_count(&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", - __func__, - 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, __func__, coded_n_vals, n_vals); - - return GRIB_ARRAY_TOO_SMALL; - } - } - } - - *len = n_vals; - - grib_context_free(a->context, coded_vals); - return err; -} int grib_accessor_class_data_apply_bitmap_t::unpack_double(grib_accessor* a, double* val, size_t* len){ return unpack(a, val, len); diff --git a/src/accessor/grib_accessor_class_data_apply_bitmap.h b/src/accessor/grib_accessor_class_data_apply_bitmap.h index 42091e75d..b2516ec4e 100644 --- a/src/accessor/grib_accessor_class_data_apply_bitmap.h +++ b/src/accessor/grib_accessor_class_data_apply_bitmap.h @@ -42,5 +42,91 @@ class grib_accessor_class_data_apply_bitmap_t : public grib_accessor_class_gen_t int compare(grib_accessor*, grib_accessor*) override; int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; + +private: + template int unpack(grib_accessor*, T*, size_t*); }; + + +template +int grib_accessor_class_data_apply_bitmap_t::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_t* self = (grib_accessor_data_apply_bitmap_t*)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 = a->value_count(&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", + __func__, + 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, __func__, coded_n_vals, n_vals); + + return GRIB_ARRAY_TOO_SMALL; + } + } + } + + *len = n_vals; + + grib_context_free(a->context, coded_vals); + return err; +} + #endif /* eccodes_accessor_data_apply_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc index 2f1456b39..4222078fe 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc @@ -43,101 +43,6 @@ int grib_accessor_class_data_apply_boustrophedonic_t::value_count(grib_accessor* return ret; } -template -int unpack(grib_accessor* a, T* val, size_t* len){ - grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; - - size_t plSize = 0; - long* pl = 0; - double* values = 0; - double* pvalues = 0; - T* pval = 0; - size_t valuesSize = 0; - long i, j; - int ret; - long numberOfPoints, numberOfRows, numberOfColumns; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints); - if (ret) - return ret; - - if (*len < numberOfPoints) { - *len = numberOfPoints; - return GRIB_ARRAY_TOO_SMALL; - } - - ret = grib_get_size(grib_handle_of_accessor(a), self->values, &valuesSize); - if (ret) - return ret; - - /* constant field */ - if (valuesSize == 0) - return 0; - - if (valuesSize != numberOfPoints) { - grib_context_log(a->context, GRIB_LOG_ERROR, "boustrophedonic ordering error: ( %s=%ld ) != (sizeOf(%s)=%ld)", - self->numberOfPoints, numberOfPoints, self->values, (long)valuesSize); - return GRIB_DECODING_ERROR; - } - - values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * numberOfPoints); - ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->values, values, &valuesSize); - if (ret) - return ret; - - pvalues = values; - pval = val; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfRows, &numberOfRows); - if (ret) - return ret; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfColumns, &numberOfColumns); - if (ret) - return ret; - - if (grib_get_size(grib_handle_of_accessor(a), self->pl, &plSize) == GRIB_SUCCESS) { - Assert(plSize == numberOfRows); - pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); - ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->pl, pl, &plSize); - if (ret) - return ret; - - for (j = 0; j < numberOfRows; j++) { - if (j % 2) { - pval += pl[j]; - for (i = 0; i < pl[j]; i++) - *(pval--) = *(pvalues++); - pval += pl[j]; - } - else { - for (i = 0; i < pl[j]; i++) - *(pval++) = *(pvalues++); - } - } - - grib_context_free(a->context, pl); - } - else { - for (j = 0; j < numberOfRows; j++) { - if (j % 2) { - pval += numberOfColumns - 1; - for (i = 0; i < numberOfColumns; i++) - *(pval--) = *(pvalues++); - pval += numberOfColumns + 1; - } - else { - for (i = 0; i < numberOfColumns; i++) - *(pval++) = *(pvalues++); - } - } - } - - grib_context_free(a->context, values); - - return GRIB_SUCCESS; -} - int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double(grib_accessor* a, double* val, size_t* len){ return unpack(a, val, len); } diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h index a0358195f..9810efe25 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h @@ -40,5 +40,106 @@ class grib_accessor_class_data_apply_boustrophedonic_t : public grib_accessor_cl void init(grib_accessor*, const long, grib_arguments*) override; int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; + +private: + template int unpack(grib_accessor*, T*, size_t*); }; + + +template +int grib_accessor_class_data_apply_boustrophedonic_t::unpack(grib_accessor* a, T* val, size_t* len){ + grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; + + size_t plSize = 0; + long* pl = 0; + double* values = 0; + double* pvalues = 0; + T* pval = 0; + size_t valuesSize = 0; + long i, j; + int ret; + long numberOfPoints, numberOfRows, numberOfColumns; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints); + if (ret) + return ret; + + if (*len < numberOfPoints) { + *len = numberOfPoints; + return GRIB_ARRAY_TOO_SMALL; + } + + ret = grib_get_size(grib_handle_of_accessor(a), self->values, &valuesSize); + if (ret) + return ret; + + /* constant field */ + if (valuesSize == 0) + return 0; + + if (valuesSize != numberOfPoints) { + grib_context_log(a->context, GRIB_LOG_ERROR, "boustrophedonic ordering error: ( %s=%ld ) != (sizeOf(%s)=%ld)", + self->numberOfPoints, numberOfPoints, self->values, (long)valuesSize); + return GRIB_DECODING_ERROR; + } + + values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * numberOfPoints); + ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->values, values, &valuesSize); + if (ret) + return ret; + + pvalues = values; + pval = val; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfRows, &numberOfRows); + if (ret) + return ret; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfColumns, &numberOfColumns); + if (ret) + return ret; + + if (grib_get_size(grib_handle_of_accessor(a), self->pl, &plSize) == GRIB_SUCCESS) { + Assert(plSize == numberOfRows); + pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); + ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->pl, pl, &plSize); + if (ret) + return ret; + + for (j = 0; j < numberOfRows; j++) { + if (j % 2) { + pval += pl[j]; + for (i = 0; i < pl[j]; i++) + *(pval--) = *(pvalues++); + pval += pl[j]; + } + else { + for (i = 0; i < pl[j]; i++) + *(pval++) = *(pvalues++); + } + } + + grib_context_free(a->context, pl); + } + else { + for (j = 0; j < numberOfRows; j++) { + if (j % 2) { + pval += numberOfColumns - 1; + for (i = 0; i < numberOfColumns; i++) + *(pval--) = *(pvalues++); + pval += numberOfColumns + 1; + } + else { + for (i = 0; i < numberOfColumns; i++) + *(pval++) = *(pvalues++); + } + } + } + + grib_context_free(a->context, values); + + return GRIB_SUCCESS; +} + + #endif /* eccodes_accessor_data_apply_boustrophedonic_h */ diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.cc b/src/accessor/grib_accessor_class_data_ccsds_packing.cc index 46af9722f..1feed1323 100644 --- a/src/accessor/grib_accessor_class_data_ccsds_packing.cc +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.cc @@ -9,9 +9,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" -#include "grib_scaling.h" grib_accessor_class_data_ccsds_packing_t _grib_accessor_class_data_ccsds_packing{"data_ccsds_packing"}; grib_accessor_class* grib_accessor_class_data_ccsds_packing = &_grib_accessor_class_data_ccsds_packing; @@ -44,20 +42,14 @@ int grib_accessor_class_data_ccsds_packing_t::value_count(grib_accessor* a, long #if defined(HAVE_LIBAEC) || defined(HAVE_AEC) -#include - -#ifndef LIBAEC_DLL_EXPORTED - #error Version of libaec appears to be too old. Please upgrade. -#endif - -static bool is_big_endian() +bool grib_accessor_class_data_ccsds_packing_t::is_big_endian() { unsigned char is_big_endian = 0; unsigned short endianess_test = 1; return reinterpret_cast(&endianess_test)[0] == is_big_endian; } -void modify_aec_flags(long* flags){ +void grib_accessor_class_data_ccsds_packing_t::modify_aec_flags(long* flags){ // ECC-1602: Performance improvement: enabled the use of native data types *flags &= ~AEC_DATA_3BYTE; // disable support for 3-bytes per value if (is_big_endian()) @@ -66,7 +58,7 @@ void modify_aec_flags(long* flags){ *flags &= ~AEC_DATA_MSB; // enable little-endian } -static const char* aec_get_error_message(int code) +const char* grib_accessor_class_data_ccsds_packing_t::aec_get_error_message(int code) { if (code == AEC_MEM_ERROR) return "AEC_MEM_ERROR"; if (code == AEC_DATA_ERROR) return "AEC_DATA_ERROR"; @@ -76,7 +68,7 @@ static const char* aec_get_error_message(int code) return "Unknown error code"; } -void print_aec_stream_info(struct aec_stream* strm, const char* func){ +void grib_accessor_class_data_ccsds_packing_t::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); fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.block_size=%u\n", func, strm->block_size); @@ -375,142 +367,6 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons return err; } -template -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_t* self = (grib_accessor_data_ccsds_packing_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - const char* cclass_name = a->cclass->name; - - 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 nn = 0; - - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - double reference_value = 0; - long bits_per_value = 0; - - long ccsds_flags; - long ccsds_block_size; - long ccsds_rsi; - size_t nbytes; - - self->dirty = 0; - - if ((err = a->value_count(&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; - - modify_aec_flags(&ccsds_flags); - - // TODO(masn): 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 = codes_power(binary_scale_factor, 2); - dscale = codes_power(-decimal_scale_factor, 10); - - buflen = a->byte_count(); buf = (unsigned char*)hand->buffer->data; - buf += a->byte_offset(); - 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; - - nbytes = (bits_per_value + 7) / 8; - if (nbytes == 3) - nbytes = 4; - - size = n_vals * nbytes; - 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, "%s %s: aec_buffer_decode error %d (%s)", - cclass_name, __func__, err, aec_get_error_message(err)); - err = GRIB_DECODING_ERROR; - goto cleanup; - } - - // ECC-1427: Performance improvement (replaced by ECC-1602) - //grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); - - // ECC-1602: Performance improvement - switch (nbytes) { - case 1: - for (i = 0; i < n_vals; i++) { - val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; - } - break; - case 2: - for (i = 0; i < n_vals; i++) { - val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; - } - break; - case 4: - for (i = 0; i < n_vals; i++) { - val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; - } - break; - default: - grib_context_log(a->context, GRIB_LOG_ERROR, "%s %s: unpacking %s, bits_per_value=%ld (max 32)", - cclass_name, __func__, a->name, bits_per_value); - err = GRIB_INVALID_BPV; - goto cleanup; - } - - *len = n_vals; - -cleanup: - grib_context_buffer_free(a->context, decoded); - return err; -} - int grib_accessor_class_data_ccsds_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ return unpack(a, val, len); } diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.h b/src/accessor/grib_accessor_class_data_ccsds_packing.h index 2d06c6f09..19889e937 100644 --- a/src/accessor/grib_accessor_class_data_ccsds_packing.h +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.h @@ -12,8 +12,16 @@ #ifndef eccodes_accessor_data_ccsds_packing_h #define eccodes_accessor_data_ccsds_packing_h -#include "../grib_api_internal.h" #include "grib_accessor_class_values.h" +#include "grib_scaling.h" + +#if defined(HAVE_LIBAEC) || defined(HAVE_AEC) +#include +#endif + +#ifndef LIBAEC_DLL_EXPORTED + #error Version of libaec appears to be too old. Please upgrade. +#endif class grib_accessor_data_ccsds_packing_t : public grib_accessor_values_t { @@ -31,6 +39,9 @@ class grib_accessor_data_ccsds_packing_t : public grib_accessor_values_t const char* ccsds_rsi; }; + + +// TODO(maee): if libaec is not available, this class should not be defined class grib_accessor_class_data_ccsds_packing_t : public grib_accessor_class_values_t { public: @@ -43,5 +54,150 @@ class grib_accessor_class_data_ccsds_packing_t : public grib_accessor_class_valu void init(grib_accessor*, const long, grib_arguments*) override; int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; + +private: + template int unpack(grib_accessor*, T*, size_t* ); + void print_aec_stream_info(struct aec_stream*, const char*); + void modify_aec_flags(long*); + const char* aec_get_error_message(int); + bool is_big_endian(); }; + + +template +int grib_accessor_class_data_ccsds_packing_t::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_t* self = (grib_accessor_data_ccsds_packing_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + const char* cclass_name = a->cclass->name; + + 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 nn = 0; + + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + double reference_value = 0; + long bits_per_value = 0; + + long ccsds_flags; + long ccsds_block_size; + long ccsds_rsi; + size_t nbytes; + + self->dirty = 0; + + if ((err = a->value_count(&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; + + modify_aec_flags(&ccsds_flags); + + // TODO(masn): 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 = codes_power(binary_scale_factor, 2); + dscale = codes_power(-decimal_scale_factor, 10); + + buflen = a->byte_count(); buf = (unsigned char*)hand->buffer->data; + buf += a->byte_offset(); + 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; + + nbytes = (bits_per_value + 7) / 8; + if (nbytes == 3) + nbytes = 4; + + size = n_vals * nbytes; + 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, "%s %s: aec_buffer_decode error %d (%s)", + cclass_name, __func__, err, aec_get_error_message(err)); + err = GRIB_DECODING_ERROR; + goto cleanup; + } + + // ECC-1427: Performance improvement (replaced by ECC-1602) + //grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); + + // ECC-1602: Performance improvement + switch (nbytes) { + case 1: + for (i = 0; i < n_vals; i++) { + val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; + } + break; + case 2: + for (i = 0; i < n_vals; i++) { + val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; + } + break; + case 4: + for (i = 0; i < n_vals; i++) { + val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; + } + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, "%s %s: unpacking %s, bits_per_value=%ld (max 32)", + cclass_name, __func__, a->name, bits_per_value); + err = GRIB_INVALID_BPV; + goto cleanup; + } + + *len = n_vals; + +cleanup: + grib_context_buffer_free(a->context, decoded); + return err; +} + #endif /* eccodes_accessor_data_ccsds_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_complex_packing.cc b/src/accessor/grib_accessor_class_data_complex_packing.cc index 5709b4798..77a3ab822 100644 --- a/src/accessor/grib_accessor_class_data_complex_packing.cc +++ b/src/accessor/grib_accessor_class_data_complex_packing.cc @@ -9,18 +9,11 @@ * 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_scaling.h" -#include "grib_ieeefloat.h" grib_accessor_class_data_complex_packing_t _grib_accessor_class_data_complex_packing{"data_complex_packing"}; grib_accessor_class* grib_accessor_class_data_complex_packing = &_grib_accessor_class_data_complex_packing; - -typedef unsigned long (*encode_float_proc)(double); -typedef double (*decode_float_proc)(unsigned long); - void grib_accessor_class_data_complex_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_complex_packing_t* self = (grib_accessor_data_complex_packing_t*)a; @@ -544,224 +537,6 @@ int grib_accessor_class_data_complex_packing_t::pack_double(grib_accessor* a, co } -template -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_t* self = (grib_accessor_data_complex_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); - const char* cclass_name = a->cclass->name; - - 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; - - T s = 0; - T d = 0; - T 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; - T 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; - double tmp; - - decode_float_proc decode_float = NULL; - - err = a->value_count(&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, &tmp)) != GRIB_SUCCESS) - return ret; - reference_value = tmp; - 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, &tmp)) != GRIB_SUCCESS) - return ret; - laplacianOperator = tmp; - - 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; - } - - if (sub_j != sub_k || sub_j != sub_m || pen_j != pen_k || pen_j != pen_m) { - grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Invalid pentagonal resolution parameters", cclass_name); - return GRIB_DECODING_ERROR; - } - - buf = (unsigned char*)gh->buffer->data; - - maxv = pen_j + 1; - - buf += a->byte_offset(); hres = buf; - lres = buf; - - if (pen_j == sub_j) { - n_vals = (pen_j + 1) * (pen_j + 2); - d = codes_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 = a->byte_offset() + bytes * (sub_k + 1) * (sub_k + 2); - lpos = 8 * (packed_offset - offsetdata); - - s = codes_power(binary_scale_factor, 2); - d = codes_power(-decimal_scale_factor, 10); - - scals = (T*)grib_context_malloc(a->context, maxv * sizeof(T)); - if (!scals) return GRIB_OUT_OF_MEMORY; - - 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, - "%s: Problem with operator div by zero at index %d of %d", cclass_name, 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; -} int grib_accessor_class_data_complex_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ return unpack(a, val, len); diff --git a/src/accessor/grib_accessor_class_data_complex_packing.h b/src/accessor/grib_accessor_class_data_complex_packing.h index 2c4618865..d588eef38 100644 --- a/src/accessor/grib_accessor_class_data_complex_packing.h +++ b/src/accessor/grib_accessor_class_data_complex_packing.h @@ -12,8 +12,12 @@ #ifndef eccodes_accessor_data_complex_packing_h #define eccodes_accessor_data_complex_packing_h -#include "../grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" +#include "grib_scaling.h" +#include "grib_ieeefloat.h" + +typedef unsigned long (*encode_float_proc)(double); +typedef double (*decode_float_proc)(unsigned long); class grib_accessor_data_complex_packing_t : public grib_accessor_data_simple_packing_t { @@ -41,5 +45,228 @@ class grib_accessor_class_data_complex_packing_t : public grib_accessor_class_da int unpack_float(grib_accessor*, float* val, size_t* len) override; int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; + +private: + template int unpack(grib_accessor*, T*, size_t*); }; + +template +int grib_accessor_class_data_complex_packing_t::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_t* self = (grib_accessor_data_complex_packing_t*)a; + grib_handle* gh = grib_handle_of_accessor(a); + const char* cclass_name = a->cclass->name; + + 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; + + T s = 0; + T d = 0; + T 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; + T 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; + double tmp; + + decode_float_proc decode_float = NULL; + + err = a->value_count(&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, &tmp)) != GRIB_SUCCESS) + return ret; + reference_value = tmp; + 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, &tmp)) != GRIB_SUCCESS) + return ret; + laplacianOperator = tmp; + + 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; + } + + if (sub_j != sub_k || sub_j != sub_m || pen_j != pen_k || pen_j != pen_m) { + grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Invalid pentagonal resolution parameters", cclass_name); + return GRIB_DECODING_ERROR; + } + + buf = (unsigned char*)gh->buffer->data; + + maxv = pen_j + 1; + + buf += a->byte_offset(); hres = buf; + lres = buf; + + if (pen_j == sub_j) { + n_vals = (pen_j + 1) * (pen_j + 2); + d = codes_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 = a->byte_offset() + bytes * (sub_k + 1) * (sub_k + 2); + lpos = 8 * (packed_offset - offsetdata); + + s = codes_power(binary_scale_factor, 2); + d = codes_power(-decimal_scale_factor, 10); + + scals = (T*)grib_context_malloc(a->context, maxv * sizeof(T)); + if (!scals) return GRIB_OUT_OF_MEMORY; + + 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, + "%s: Problem with operator div by zero at index %d of %d", cclass_name, 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; +} + #endif /* eccodes_accessor_data_complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc index cf47dee15..f95103d73 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc @@ -177,7 +177,7 @@ int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_d return GRIB_SUCCESS; } -int unpack(grib_accessor* a, double* dvalues, float* fvalues, size_t* len){ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack(grib_accessor* a, double* dvalues, float* fvalues, size_t* len){ grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; int ret = 0; long numberOfGroups, numberOfSecondOrderPackedValues; diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h index a870edcf6..245217f7f 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h @@ -61,5 +61,8 @@ class grib_accessor_class_data_g1second_order_general_extended_packing_t : publi void init(grib_accessor*, const long, grib_arguments*) override; int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; + +private: + int unpack(grib_accessor* a, double*, float*, size_t*); }; #endif /* eccodes_accessor_data_g1second_order_general_extended_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc index e709da053..07ecb170a 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc @@ -9,9 +9,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_g1second_order_general_packing.h" -#include "grib_scaling.h" grib_accessor_class_data_g1second_order_general_packing_t _grib_accessor_class_data_g1second_order_general_packing{"data_g1second_order_general_packing"}; grib_accessor_class* grib_accessor_class_data_g1second_order_general_packing = &_grib_accessor_class_data_g1second_order_general_packing; @@ -52,109 +50,6 @@ int grib_accessor_class_data_g1second_order_general_packing_t::value_count(grib_ return err; } -template -int unpack(grib_accessor* a, T* values, size_t* len){ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - grib_accessor_data_g1second_order_general_packing_t* self = (grib_accessor_data_g1second_order_general_packing_t*)a; - int ret = 0; - long numberOfGroups, numberOfSecondOrderPackedValues; - long* groupWidths = 0; - long* firstOrderValues = 0; - long* X = 0; - long pos = 0; - long widthOfFirstOrderValues = 0; - unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - long i, n; - double reference_value; - long binary_scale_factor; - long decimal_scale_factor; - double s, d; - long* secondaryBitmap; - long groupLength, j; - size_t groupWidthsSize; - - buf += a->byte_offset(); - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->widthOfFirstOrderValues, &widthOfFirstOrderValues)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, - &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) - return ret; - - if (*len < (size_t)numberOfSecondOrderPackedValues) - return GRIB_ARRAY_TOO_SMALL; - - groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); - groupWidthsSize = numberOfGroups; - if ((ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->groupWidths, groupWidths, &groupWidthsSize)) != GRIB_SUCCESS) - return ret; - - secondaryBitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * (numberOfSecondOrderPackedValues + 1)); - secondaryBitmap[numberOfSecondOrderPackedValues] = 1; - grib_decode_long_array(buf, &pos, 1, numberOfSecondOrderPackedValues, secondaryBitmap); - pos = 8 * ((pos + 7) / 8); - - firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); - grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); - pos = 8 * ((pos + 7) / 8); - - X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfSecondOrderPackedValues); - - n = 0; - i = -1; - groupLength = 0; - while (n < numberOfSecondOrderPackedValues) { - if (secondaryBitmap[n]) { - long* p = secondaryBitmap + n + 1; - groupLength = 1; - while (*p != 1) { - groupLength++; - p++; - } - i++; - } - if (groupWidths[i] > 0) { - for (j = 0; j < groupLength; j++) { - X[n] = grib_decode_unsigned_long(buf, &pos, groupWidths[i]); - X[n] = firstOrderValues[i] + X[n]; - n++; - } - } - else { - for (j = 0; j < groupLength; j++) { - X[n] = firstOrderValues[i]; - n++; - } - } - } - - s = codes_power(binary_scale_factor, 2); - d = codes_power(-decimal_scale_factor, 10); - for (i = 0; i < numberOfSecondOrderPackedValues; i++) { - values[i] = (T)(((X[i] * s) + reference_value) * d); - } - - *len = numberOfSecondOrderPackedValues; - grib_context_free(a->context, secondaryBitmap); - grib_context_free(a->context, firstOrderValues); - grib_context_free(a->context, X); - grib_context_free(a->context, groupWidths); - - return ret; -} - int grib_accessor_class_data_g1second_order_general_packing_t::unpack_float(grib_accessor* a, float* values, size_t* len){ return unpack(a, values, len); } diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h index 5161324f0..837e10097 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h @@ -12,8 +12,8 @@ #ifndef eccodes_accessor_data_g1second_order_general_packing_h #define eccodes_accessor_data_g1second_order_general_packing_h -#include "../grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" +#include "grib_scaling.h" class grib_accessor_data_g1second_order_general_packing_t : public grib_accessor_data_simple_packing_t { @@ -47,5 +47,113 @@ class grib_accessor_class_data_g1second_order_general_packing_t : public grib_ac int unpack_float(grib_accessor*, float* val, size_t* len) override; int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; + +private: + template int unpack(grib_accessor*, T*, size_t*); }; + + +template +int grib_accessor_class_data_g1second_order_general_packing_t::unpack(grib_accessor* a, T* values, size_t* len){ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + grib_accessor_data_g1second_order_general_packing_t* self = (grib_accessor_data_g1second_order_general_packing_t*)a; + int ret = 0; + long numberOfGroups, numberOfSecondOrderPackedValues; + long* groupWidths = 0; + long* firstOrderValues = 0; + long* X = 0; + long pos = 0; + long widthOfFirstOrderValues = 0; + unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; + long i, n; + double reference_value; + long binary_scale_factor; + long decimal_scale_factor; + double s, d; + long* secondaryBitmap; + long groupLength, j; + size_t groupWidthsSize; + + buf += a->byte_offset(); + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->widthOfFirstOrderValues, &widthOfFirstOrderValues)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, + &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) + return ret; + + if (*len < (size_t)numberOfSecondOrderPackedValues) + return GRIB_ARRAY_TOO_SMALL; + + groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + groupWidthsSize = numberOfGroups; + if ((ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->groupWidths, groupWidths, &groupWidthsSize)) != GRIB_SUCCESS) + return ret; + + secondaryBitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * (numberOfSecondOrderPackedValues + 1)); + secondaryBitmap[numberOfSecondOrderPackedValues] = 1; + grib_decode_long_array(buf, &pos, 1, numberOfSecondOrderPackedValues, secondaryBitmap); + pos = 8 * ((pos + 7) / 8); + + firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); + pos = 8 * ((pos + 7) / 8); + + X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfSecondOrderPackedValues); + + n = 0; + i = -1; + groupLength = 0; + while (n < numberOfSecondOrderPackedValues) { + if (secondaryBitmap[n]) { + long* p = secondaryBitmap + n + 1; + groupLength = 1; + while (*p != 1) { + groupLength++; + p++; + } + i++; + } + if (groupWidths[i] > 0) { + for (j = 0; j < groupLength; j++) { + X[n] = grib_decode_unsigned_long(buf, &pos, groupWidths[i]); + X[n] = firstOrderValues[i] + X[n]; + n++; + } + } + else { + for (j = 0; j < groupLength; j++) { + X[n] = firstOrderValues[i]; + n++; + } + } + } + + s = codes_power(binary_scale_factor, 2); + d = codes_power(-decimal_scale_factor, 10); + for (i = 0; i < numberOfSecondOrderPackedValues; i++) { + values[i] = (T)(((X[i] * s) + reference_value) * d); + } + + *len = numberOfSecondOrderPackedValues; + grib_context_free(a->context, secondaryBitmap); + grib_context_free(a->context, firstOrderValues); + grib_context_free(a->context, X); + grib_context_free(a->context, groupWidths); + + return ret; +} + #endif /* eccodes_accessor_data_g1second_order_general_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc index 8237cf577..f49a52586 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc @@ -9,9 +9,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_g1second_order_row_by_row_packing.h" -#include "grib_scaling.h" grib_accessor_class_data_g1second_order_row_by_row_packing_t _grib_accessor_class_data_g1second_order_row_by_row_packing{"data_g1second_order_row_by_row_packing"}; grib_accessor_class* grib_accessor_class_data_g1second_order_row_by_row_packing = &_grib_accessor_class_data_g1second_order_row_by_row_packing; @@ -116,171 +114,6 @@ int grib_accessor_class_data_g1second_order_row_by_row_packing_t::value_count(gr return ret; } -template -int unpack(grib_accessor* a, T* values, size_t* len){ - grib_accessor_data_g1second_order_row_by_row_packing_t* self = (grib_accessor_data_g1second_order_row_by_row_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); - int ret = 0; - long numberOfGroups, numberOfSecondOrderPackedValues; - long* groupWidths = 0; - long* firstOrderValues = 0; - long* X = 0; - long numberOfRows, numberOfColumns; - long* numbersPerRow; - long pos = 0; - long widthOfFirstOrderValues = 0; - long jPointsAreConsecutive; - unsigned char* buf = (unsigned char*)gh->buffer->data; - long k, i, j, n, Ni, Nj; - double reference_value; - long binary_scale_factor; - long decimal_scale_factor; - double s, d; - size_t groupWidthsSize = 0; - int bitmapPresent = 0; - size_t plSize = 0; - long* pl = 0; - - buf += a->byte_offset(); - if ((ret = grib_get_long_internal(gh, self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(gh, self->jPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) - return ret; - - if (self->bitmap) - bitmapPresent = 1; - ret = grib_get_size(gh, self->pl, &plSize); - if (ret == GRIB_SUCCESS) { - pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); - if ((ret = grib_get_long_array(gh, self->pl, pl, &plSize)) != GRIB_SUCCESS) - return ret; - } - - if ((ret = grib_get_long_internal(gh, self->Ni, &Ni)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->Nj, &Nj)) != GRIB_SUCCESS) - return ret; - if (jPointsAreConsecutive) { - numberOfRows = Ni; - numberOfColumns = Nj; - } - else { - numberOfRows = Nj; - numberOfColumns = Ni; - } - - numbersPerRow = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfRows); - if (!numbersPerRow) - return GRIB_OUT_OF_MEMORY; - if (bitmapPresent) { - long *bitmap, *pbitmap; - size_t numberOfPoints = Ni * Nj; - - if (plSize && pl) { - numberOfPoints = 0; - for (i = 0; i < numberOfRows; i++) - numberOfPoints += pl[i]; - } - bitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfPoints); - pbitmap = bitmap; - grib_get_long_array(gh, self->bitmap, bitmap, &numberOfPoints); - if (plSize && pl) { - for (i = 0; i < numberOfRows; i++) { - for (j = 0; j < pl[i]; j++) { - numbersPerRow[i] += *(bitmap++); - } - } - } - else { - for (i = 0; i < numberOfRows; i++) { - numbersPerRow[i] = 0; - for (j = 0; j < Ni; j++) { - numbersPerRow[i] += *(bitmap++); - } - } - } - - grib_context_free(a->context, pbitmap); - } - else { - if (plSize && pl) { - for (i = 0; i < numberOfRows; i++) - numbersPerRow[i] = pl[i]; - } - else { - for (i = 0; i < numberOfRows; i++) - numbersPerRow[i] = numberOfColumns; - } - } - - if ((ret = grib_get_long_internal(gh, self->widthOfFirstOrderValues, &widthOfFirstOrderValues)) != 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_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(gh, self->numberOfSecondOrderPackedValues, - &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) - return ret; - - groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); - groupWidthsSize = numberOfGroups; - if ((ret = grib_get_long_array_internal(gh, self->groupWidths, groupWidths, &groupWidthsSize)) != GRIB_SUCCESS) - return ret; - - firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); - grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); - pos = 8 * ((pos + 7) / 8); - - n = 0; - for (i = 0; i < numberOfGroups; i++) - n += numbersPerRow[i]; - - if (*len < (size_t)n) - return GRIB_ARRAY_TOO_SMALL; - - X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * n); - n = 0; - k = 0; - for (i = 0; i < numberOfGroups; i++) { - if (groupWidths[i] > 0) { - for (j = 0; j < numbersPerRow[k]; j++) { - X[n] = grib_decode_unsigned_long(buf, &pos, groupWidths[i]); - X[n] += firstOrderValues[i]; - n++; - } - } - else { - for (j = 0; j < numbersPerRow[k]; j++) { - X[n] = firstOrderValues[i]; - n++; - } - } - k++; - } - - s = codes_power(binary_scale_factor, 2); - d = codes_power(-decimal_scale_factor, 10); - for (i = 0; i < n; i++) { - values[i] = (T)(((X[i] * s) + reference_value) * d); - } - grib_context_free(a->context, firstOrderValues); - grib_context_free(a->context, X); - grib_context_free(a->context, groupWidths); - if (plSize) - grib_context_free(a->context, pl); - if (numbersPerRow) - grib_context_free(a->context, numbersPerRow); - - return ret; -} int grib_accessor_class_data_g1second_order_row_by_row_packing_t::unpack_float(grib_accessor* a, float* values, size_t* len){ return unpack(a, values, len); diff --git a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h index 1e9c27f39..d2db87fe9 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h @@ -12,8 +12,8 @@ #ifndef eccodes_accessor_data_g1second_order_row_by_row_packing_h #define eccodes_accessor_data_g1second_order_row_by_row_packing_h -#include "../grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" +#include "grib_scaling.h" class grib_accessor_data_g1second_order_row_by_row_packing_t : public grib_accessor_data_simple_packing_t { @@ -47,5 +47,176 @@ class grib_accessor_class_data_g1second_order_row_by_row_packing_t : public grib int unpack_float(grib_accessor*, float* val, size_t* len) override; int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; + +private: + template int unpack(grib_accessor*, T*, size_t*); }; + + +template +int grib_accessor_class_data_g1second_order_row_by_row_packing_t::unpack(grib_accessor* a, T* values, size_t* len){ + grib_accessor_data_g1second_order_row_by_row_packing_t* self = (grib_accessor_data_g1second_order_row_by_row_packing_t*)a; + grib_handle* gh = grib_handle_of_accessor(a); + int ret = 0; + long numberOfGroups, numberOfSecondOrderPackedValues; + long* groupWidths = 0; + long* firstOrderValues = 0; + long* X = 0; + long numberOfRows, numberOfColumns; + long* numbersPerRow; + long pos = 0; + long widthOfFirstOrderValues = 0; + long jPointsAreConsecutive; + unsigned char* buf = (unsigned char*)gh->buffer->data; + long k, i, j, n, Ni, Nj; + double reference_value; + long binary_scale_factor; + long decimal_scale_factor; + double s, d; + size_t groupWidthsSize = 0; + int bitmapPresent = 0; + size_t plSize = 0; + long* pl = 0; + + buf += a->byte_offset(); + if ((ret = grib_get_long_internal(gh, self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(gh, self->jPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) + return ret; + + if (self->bitmap) + bitmapPresent = 1; + ret = grib_get_size(gh, self->pl, &plSize); + if (ret == GRIB_SUCCESS) { + pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); + if ((ret = grib_get_long_array(gh, self->pl, pl, &plSize)) != GRIB_SUCCESS) + return ret; + } + + if ((ret = grib_get_long_internal(gh, self->Ni, &Ni)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->Nj, &Nj)) != GRIB_SUCCESS) + return ret; + if (jPointsAreConsecutive) { + numberOfRows = Ni; + numberOfColumns = Nj; + } + else { + numberOfRows = Nj; + numberOfColumns = Ni; + } + + numbersPerRow = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfRows); + if (!numbersPerRow) + return GRIB_OUT_OF_MEMORY; + if (bitmapPresent) { + long *bitmap, *pbitmap; + size_t numberOfPoints = Ni * Nj; + + if (plSize && pl) { + numberOfPoints = 0; + for (i = 0; i < numberOfRows; i++) + numberOfPoints += pl[i]; + } + bitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfPoints); + pbitmap = bitmap; + grib_get_long_array(gh, self->bitmap, bitmap, &numberOfPoints); + if (plSize && pl) { + for (i = 0; i < numberOfRows; i++) { + for (j = 0; j < pl[i]; j++) { + numbersPerRow[i] += *(bitmap++); + } + } + } + else { + for (i = 0; i < numberOfRows; i++) { + numbersPerRow[i] = 0; + for (j = 0; j < Ni; j++) { + numbersPerRow[i] += *(bitmap++); + } + } + } + + grib_context_free(a->context, pbitmap); + } + else { + if (plSize && pl) { + for (i = 0; i < numberOfRows; i++) + numbersPerRow[i] = pl[i]; + } + else { + for (i = 0; i < numberOfRows; i++) + numbersPerRow[i] = numberOfColumns; + } + } + + if ((ret = grib_get_long_internal(gh, self->widthOfFirstOrderValues, &widthOfFirstOrderValues)) != 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_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(gh, self->numberOfSecondOrderPackedValues, + &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) + return ret; + + groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + groupWidthsSize = numberOfGroups; + if ((ret = grib_get_long_array_internal(gh, self->groupWidths, groupWidths, &groupWidthsSize)) != GRIB_SUCCESS) + return ret; + + firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); + pos = 8 * ((pos + 7) / 8); + + n = 0; + for (i = 0; i < numberOfGroups; i++) + n += numbersPerRow[i]; + + if (*len < (size_t)n) + return GRIB_ARRAY_TOO_SMALL; + + X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * n); + n = 0; + k = 0; + for (i = 0; i < numberOfGroups; i++) { + if (groupWidths[i] > 0) { + for (j = 0; j < numbersPerRow[k]; j++) { + X[n] = grib_decode_unsigned_long(buf, &pos, groupWidths[i]); + X[n] += firstOrderValues[i]; + n++; + } + } + else { + for (j = 0; j < numbersPerRow[k]; j++) { + X[n] = firstOrderValues[i]; + n++; + } + } + k++; + } + + s = codes_power(binary_scale_factor, 2); + d = codes_power(-decimal_scale_factor, 10); + for (i = 0; i < n; i++) { + values[i] = (T)(((X[i] * s) + reference_value) * d); + } + grib_context_free(a->context, firstOrderValues); + grib_context_free(a->context, X); + grib_context_free(a->context, groupWidths); + if (plSize) + grib_context_free(a->context, pl); + if (numbersPerRow) + grib_context_free(a->context, numbersPerRow); + + return ret; +} + #endif /* eccodes_accessor_data_g1second_order_row_by_row_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.cc b/src/accessor/grib_accessor_class_data_g22order_packing.cc index 6b82e035e..8fe861965 100644 --- a/src/accessor/grib_accessor_class_data_g22order_packing.cc +++ b/src/accessor/grib_accessor_class_data_g22order_packing.cc @@ -9,9 +9,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_g22order_packing.h" -#include "../grib_scaling.h" grib_accessor_class_data_g22order_packing_t _grib_accessor_class_data_g22order_packing{"data_g22order_packing"}; grib_accessor_class* grib_accessor_class_data_g22order_packing = &_grib_accessor_class_data_g22order_packing; @@ -299,7 +297,7 @@ int min_max_array(double* data, unsigned int n, double* min, double* max){ // return bms; // } -int post_process(grib_context* c, long* vals, long len, long order, long bias, const unsigned long extras[2]){ +int grib_accessor_class_data_g22order_packing_t::post_process(grib_context* c, long* vals, long len, long order, long bias, const unsigned long extras[2]){ unsigned long last, penultimate = 0, j = 0; Assert(order > 0); Assert(order <= 3); @@ -359,252 +357,6 @@ int post_process(grib_context* c, long* vals, long len, long order, long bias, c return GRIB_SUCCESS; } -template -int unpack(grib_accessor* a, T* val, const size_t* len){ - static_assert(std::is_floating_point::value, "Requires floating points numbers"); - grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); - const char* cclass_name = a->cclass->name; - grib_handle* gh = grib_handle_of_accessor(a); - - size_t i = 0; - size_t j = 0; - long n_vals = 0; - long vcount = 0; - int err = GRIB_SUCCESS; - long* sec_val = NULL; - unsigned char* buf = reinterpret_cast(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 = 0; - long numberOfOctetsExtraDescriptors = 0; - double missingValue = 0; - - err = a->value_count(&n_vals); if (err) - return err; - - if (*len < static_cast(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; - if (n_vals < vcount + nvals_per_group) { - return GRIB_DECODING_ERROR; - } - - // 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++) { - DEBUG_ASSERT_ACCESS(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, - "%s unpacking: Unsupported order of spatial differencing %ld", cclass_name, 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 = (T)codes_power(binary_scale_factor, 2); - decimal_s = (T)codes_power(-decimal_scale_factor, 10); - - for (i = 0; i < n_vals; i++) { - if (sec_val[i] == LONG_MAX) { - val[i] = (T)missingValue; - } - else { - val[i] = (T)((((T)sec_val[i]) * binary_s) + reference_value) * decimal_s; - } - } - - grib_context_free(a->context, sec_val); - return err; -} int find_nbits(unsigned int i){ #if !defined __GNUC__ || __GNUC__ < 4 diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.h b/src/accessor/grib_accessor_class_data_g22order_packing.h index 87d7e3a8d..0b87602a9 100644 --- a/src/accessor/grib_accessor_class_data_g22order_packing.h +++ b/src/accessor/grib_accessor_class_data_g22order_packing.h @@ -12,8 +12,8 @@ #ifndef eccodes_accessor_data_g22order_packing_h #define eccodes_accessor_data_g22order_packing_h -#include "../grib_api_internal.h" #include "grib_accessor_class_values.h" +#include "../grib_scaling.h" class grib_accessor_data_g22order_packing_t : public grib_accessor_values_t { @@ -53,5 +53,257 @@ class grib_accessor_class_data_g22order_packing_t : public grib_accessor_class_v void init(grib_accessor*, const long, grib_arguments*) override; int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +private: + int post_process(grib_context*, long*, long, long, long, const unsigned long[2]); + template int unpack(grib_accessor*, T*, const size_t*); }; + + +template +int grib_accessor_class_data_g22order_packing_t::unpack(grib_accessor* a, T* val, const size_t* len){ + static_assert(std::is_floating_point::value, "Requires floating points numbers"); + grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); + const char* cclass_name = a->cclass->name; + grib_handle* gh = grib_handle_of_accessor(a); + + size_t i = 0; + size_t j = 0; + long n_vals = 0; + long vcount = 0; + int err = GRIB_SUCCESS; + long* sec_val = NULL; + unsigned char* buf = reinterpret_cast(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 = 0; + long numberOfOctetsExtraDescriptors = 0; + double missingValue = 0; + + err = a->value_count(&n_vals); if (err) + return err; + + if (*len < static_cast(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; + if (n_vals < vcount + nvals_per_group) { + return GRIB_DECODING_ERROR; + } + + // 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++) { + DEBUG_ASSERT_ACCESS(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, + "%s unpacking: Unsupported order of spatial differencing %ld", cclass_name, 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 = (T)codes_power(binary_scale_factor, 2); + decimal_s = (T)codes_power(-decimal_scale_factor, 10); + + for (i = 0; i < n_vals; i++) { + if (sec_val[i] == LONG_MAX) { + val[i] = (T)missingValue; + } + else { + val[i] = (T)((((T)sec_val[i]) * binary_s) + reference_value) * decimal_s; + } + } + + grib_context_free(a->context, sec_val); + return err; +} + #endif /* eccodes_accessor_data_g22order_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing.h b/src/accessor/grib_accessor_class_data_g2simple_packing.h index b3982c40d..4f27ab87c 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing.h +++ b/src/accessor/grib_accessor_class_data_g2simple_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -12,14 +11,9 @@ #ifndef eccodes_accessor_data_g2simple_packing_h #define eccodes_accessor_data_g2simple_packing_h -#include "../grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" -class grib_accessor_data_g2simple_packing_t : public grib_accessor_data_simple_packing_t -{ -public: - /* Members defined in data_g2simple_packing */ -}; +class grib_accessor_data_g2simple_packing_t : public grib_accessor_data_simple_packing_t {}; class grib_accessor_class_data_g2simple_packing_t : public grib_accessor_class_data_simple_packing_t { diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc index 245d2f6a6..73ad0ea64 100644 --- a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc @@ -194,7 +194,6 @@ int grib_accessor_class_data_jpeg2000_packing_t::unpack_double(grib_accessor* a, int grib_accessor_class_data_jpeg2000_packing_t::pack_double(grib_accessor* a, const double* cval, size_t* len){ grib_accessor_data_jpeg2000_packing_t* self = (grib_accessor_data_jpeg2000_packing_t*)a; - grib_accessor_class* super = *(a->cclass->super); size_t n_vals = *len; int err = 0; int i; @@ -251,7 +250,8 @@ int grib_accessor_class_data_jpeg2000_packing_t::pack_double(grib_accessor* a, c for (i = 0; i < n_vals; i++) val[i] += units_bias; - ret = super->pack_double(a, val, len); + ret = grib_accessor_class_data_simple_packing_t::pack_double(a, val, len); + switch (ret) { case GRIB_CONSTANT_FIELD: grib_buffer_replace(a, NULL, 0, 1, 1); diff --git a/src/accessor/grib_accessor_class_data_simple_packing.cc b/src/accessor/grib_accessor_class_data_simple_packing.cc index a167d0b53..d1032808e 100644 --- a/src/accessor/grib_accessor_class_data_simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_simple_packing.cc @@ -9,10 +9,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_simple_packing.h" -#include "grib_scaling.h" -#include "grib_bits_any_endian_simple.h" #include "grib_optimize_decimal_factor.h" #include #include @@ -159,145 +156,6 @@ int grib_accessor_class_data_simple_packing_t::unpack_double_element_set(grib_ac return GRIB_SUCCESS; } -template -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_t* self = (grib_accessor_data_simple_packing_t*)a; - const char* cclass_name = a->cclass->name; - 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 n_vals = 0; - long pos = 0; - long count = 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; - - err = a->value_count(&count); if (err) - return err; - n_vals = count; - - 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) { - for (i = 0; i < n_vals; i++) - val[i] = reference_value; - *len = n_vals; - return GRIB_SUCCESS; - } - - s = codes_power(binary_scale_factor, 2); - d = codes_power(-decimal_scale_factor, 10); - - grib_context_log(a->context, GRIB_LOG_DEBUG, - "%s %s: Creating %s, %zu values", cclass_name, __func__, a->name, n_vals); - - offsetBeforeData = a->byte_offset(); 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, - "%s: Data section size mismatch: " - "offset before data=%ld, offset after data=%ld (num values=%zu, bits per value=%ld)", - cclass_name, offsetBeforeData, offsetAfterData, n_vals, bits_per_value); - return GRIB_DECODING_ERROR; - } - } - // 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; - // } - } - - grib_context_log(a->context, GRIB_LOG_DEBUG, - "%s %s: calling outline function: bpv: %ld, rv: %g, bsf: %ld, dsf: %ld", - cclass_name, __func__, bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); - grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, val); - - *len = (long)n_vals; - - if (units_factor != 1.0) { - if (units_bias != 0.0) { - for (i = 0; i < n_vals; i++) { - val[i] = val[i] * units_factor + units_bias; - } - } else { - for (i = 0; i < n_vals; i++) { - val[i] *= units_factor; - } - } - } - else if (units_bias != 0.0) { - for (i = 0; i < n_vals; i++) { - val[i] += units_bias; - } - } - return err; -} int grib_accessor_class_data_simple_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ return unpack(a, val, len); diff --git a/src/accessor/grib_accessor_class_data_simple_packing.h b/src/accessor/grib_accessor_class_data_simple_packing.h index 9187f37eb..92f355b3f 100644 --- a/src/accessor/grib_accessor_class_data_simple_packing.h +++ b/src/accessor/grib_accessor_class_data_simple_packing.h @@ -12,8 +12,9 @@ #ifndef eccodes_accessor_data_simple_packing_h #define eccodes_accessor_data_simple_packing_h -#include "../grib_api_internal.h" #include "grib_accessor_class_values.h" +#include "grib_bits_any_endian_simple.h" +#include "grib_scaling.h" class grib_accessor_data_simple_packing_t : public grib_accessor_values_t { @@ -44,5 +45,151 @@ class grib_accessor_class_data_simple_packing_t : public grib_accessor_class_val int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len) override; + +private: + template int unpack(grib_accessor*, T*, size_t*); }; + + +template +int grib_accessor_class_data_simple_packing_t::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_t* self = (grib_accessor_data_simple_packing_t*)a; + const char* cclass_name = a->cclass->name; + 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 n_vals = 0; + long pos = 0; + long count = 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; + + err = a->value_count(&count); if (err) + return err; + n_vals = count; + + 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) { + for (i = 0; i < n_vals; i++) + val[i] = reference_value; + *len = n_vals; + return GRIB_SUCCESS; + } + + s = codes_power(binary_scale_factor, 2); + d = codes_power(-decimal_scale_factor, 10); + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "%s %s: Creating %s, %zu values", cclass_name, __func__, a->name, n_vals); + + offsetBeforeData = a->byte_offset(); 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, + "%s: Data section size mismatch: " + "offset before data=%ld, offset after data=%ld (num values=%zu, bits per value=%ld)", + cclass_name, offsetBeforeData, offsetAfterData, n_vals, bits_per_value); + return GRIB_DECODING_ERROR; + } + } + // 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; + // } + } + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "%s %s: calling outline function: bpv: %ld, rv: %g, bsf: %ld, dsf: %ld", + cclass_name, __func__, bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); + grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, val); + + *len = (long)n_vals; + + if (units_factor != 1.0) { + if (units_bias != 0.0) { + for (i = 0; i < n_vals; i++) { + val[i] = val[i] * units_factor + units_bias; + } + } else { + for (i = 0; i < n_vals; i++) { + val[i] *= units_factor; + } + } + } + else if (units_bias != 0.0) { + for (i = 0; i < n_vals; i++) { + val[i] += units_bias; + } + } + return err; +} + + #endif /* eccodes_accessor_data_simple_packing_h */ diff --git a/src/accessor/grib_accessor_class_double.cc b/src/accessor/grib_accessor_class_double.cc index 2d8e019a7..0e3b0ea00 100644 --- a/src/accessor/grib_accessor_class_double.cc +++ b/src/accessor/grib_accessor_class_double.cc @@ -101,5 +101,6 @@ int grib_accessor_class_double_t::pack_missing(grib_accessor* a){ double value = GRIB_MISSING_DOUBLE; if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) - return a->pack_double(&value, &len); return GRIB_VALUE_CANNOT_BE_MISSING; + return a->pack_double(&value, &len); + return GRIB_VALUE_CANNOT_BE_MISSING; } diff --git a/src/accessor/grib_accessor_class_double.h b/src/accessor/grib_accessor_class_double.h index 865bab9bc..1c1e2fb4f 100644 --- a/src/accessor/grib_accessor_class_double.h +++ b/src/accessor/grib_accessor_class_double.h @@ -12,14 +12,9 @@ #ifndef eccodes_accessor_double_h #define eccodes_accessor_double_h -#include "../grib_api_internal.h" #include "grib_accessor_class_gen.h" -class grib_accessor_double_t : public grib_accessor_gen_t -{ -public: - /* Members defined in double */ -}; +class grib_accessor_double_t : public grib_accessor_gen_t {}; class grib_accessor_class_double_t : public grib_accessor_class_gen_t { diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index 08f2f1bba..89debb2ac 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -77,8 +77,7 @@ int grib_accessor_gen_t::unpack_double(double* v, size_t* len) int grib_accessor_gen_t::unpack_float(float* v, size_t* len) { - // return cclass->unpack_float(this, v, len); - return GRIB_NOT_IMPLEMENTED; + return cclass->unpack_float(this, v, len); } int grib_accessor_gen_t::unpack_double_element(size_t i, double* v) @@ -180,7 +179,7 @@ size_t grib_accessor_gen_t::preferred_size(int from_handle) grib_accessor* grib_accessor_gen_t::next_accessor() { - return cclass->next(this, 0); + return cclass->next(this, 1); } void grib_accessor_gen_t::resize(size_t new_size) @@ -192,7 +191,7 @@ void grib_accessor_gen_t::resize(size_t new_size) void grib_accessor_gen_t::destroy(grib_context* ct) { cclass->destroy(ct, this); - delete this; + //delete this; } @@ -223,6 +222,7 @@ void grib_accessor_class_gen_t::init(grib_accessor* a, const long len, grib_argu grib_expression* expression = grib_arguments_get_expression(grib_handle_of_accessor(a), act->default_value, 0); int type = grib_expression_native_type(grib_handle_of_accessor(a), expression); switch (type) { + // TODO(maee): single-precision case GRIB_TYPE_DOUBLE: grib_expression_evaluate_double(grib_handle_of_accessor(a), expression, &d); a->pack_double(&d, &s_len); @@ -333,40 +333,39 @@ int grib_accessor_class_gen_t::clear(grib_accessor* a) int grib_accessor_class_gen_t::unpack_long(grib_accessor* a, long* v, size_t* len) { + is_overridden_[UNPACK_LONG] = 0; int type = GRIB_TYPE_UNDEFINED; //if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { - try { + if (is_overridden_[UNPACK_DOUBLE] == 1) { double val = 0.0; size_t l = 1; a->unpack_double(&val, &l); - if (val == GRIB_MISSING_DOUBLE) - *v = GRIB_MISSING_LONG; - else - *v = (long)val; - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to long", a->name); - return GRIB_SUCCESS; - } - catch (std::runtime_error& e) { - // TODO(maee): log error + if (is_overridden_[UNPACK_DOUBLE] == 1) { + if (val == GRIB_MISSING_DOUBLE) + *v = GRIB_MISSING_LONG; + else + *v = (long)val; + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to long", a->name); + return GRIB_SUCCESS; + } } //if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { - try { + if (is_overridden_[UNPACK_STRING] == 1) { char val[1024]; size_t l = sizeof(val); char* last = NULL; a->unpack_string(val, &l); - *v = strtol(val, &last, 10); + if (is_overridden_[UNPACK_STRING] == 1) { + *v = strtol(val, &last, 10); - if (*last == 0) { - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting string %s to long", a->name); - return GRIB_SUCCESS; + if (*last == 0) { + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting string %s to long", a->name); + return GRIB_SUCCESS; + } } } - catch (std::runtime_error& e) { - // TODO(maee): log error - } grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as long", a->name); if (grib_get_native_type(grib_handle_of_accessor(a), a->name, &type) == GRIB_SUCCESS) { @@ -387,35 +386,33 @@ int grib_accessor_class_gen_t::unpack_float(grib_accessor* a, float* v, size_t* int grib_accessor_class_gen_t::unpack_string(grib_accessor* a, char* v, size_t* len) { + is_overridden_[UNPACK_STRING] = 0; + int err = 0; - //if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { - try { + if (is_overridden_[UNPACK_DOUBLE] == 1) { double val = 0.0; size_t l = 1; err = a->unpack_double(&val, &l); - if (err) return err; - snprintf(v, 64, "%g", val); - *len = strlen(v); - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to string", a->name); - return GRIB_SUCCESS; - } - catch (std::runtime_error& e) { - // TODO(maee): log error + if (is_overridden_[UNPACK_DOUBLE] == 1) { + if (err) return err; + snprintf(v, 64, "%g", val); + *len = strlen(v); + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to string", a->name); + return GRIB_SUCCESS; + } } - //if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { - try { + if (is_overridden_[UNPACK_LONG] == 1) { long val = 0; size_t l = 1; err = a->unpack_long(&val, &l); - if (err) return err; - snprintf(v, 64, "%ld", val); - *len = strlen(v); - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to string\n", a->name); - return GRIB_SUCCESS; - } - catch (std::runtime_error& e) { - // TODO(maee): log error + if (is_overridden_[UNPACK_LONG] == 1) { + if (err) return err; + snprintf(v, 64, "%ld", val); + *len = strlen(v); + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to string\n", a->name); + return GRIB_SUCCESS; + } } return GRIB_NOT_IMPLEMENTED; @@ -493,9 +490,9 @@ int grib_accessor_class_gen_t::pack_expression(grib_accessor* a, grib_expression int grib_accessor_class_gen_t::pack_long(grib_accessor* a, const long* v, size_t* len) { + is_overridden_[PACK_LONG] = 0; grib_context* c = a->context; - //if (a->cclass->pack_double && a->cclass->pack_double != &pack_double) { - try { + if (is_overridden_[PACK_DOUBLE]) { double* val = (double*)grib_context_malloc(c, *len * (sizeof(double))); if (!val) { grib_context_log(c, GRIB_LOG_ERROR, "Unable to allocate %zu bytes", *len * (sizeof(double))); @@ -505,19 +502,16 @@ int grib_accessor_class_gen_t::pack_long(grib_accessor* a, const long* v, size_t val[i] = v[i]; int ret = a->pack_double(val, len); grib_context_free(c, val); - return ret; - } - catch (std::runtime_error& e) { - // TODO(maee): log error + if (is_overridden_[PACK_DOUBLE]) { + return ret; + } } + grib_context_log(c, GRIB_LOG_ERROR, "Should not pack '%s' as an integer", a->name); - //if (a->cclass->pack_string && a->cclass->pack_string != &pack_string) { - try { + if (is_overridden_[PACK_STRING]) { grib_context_log(c, GRIB_LOG_ERROR, "Try packing as a string"); } - catch (std::runtime_error& e) { - // TODO(maee): log error - } + return GRIB_NOT_IMPLEMENTED; } @@ -540,31 +534,37 @@ int pack_double_array_as_long(grib_accessor* a, const double* v, size_t* len) int grib_accessor_class_gen_t::pack_double(grib_accessor* a, const double* v, size_t* len) { + static int check_pack_long = 1; + if (check_pack_long) { + const long v_tmp = 0; + size_t l_tmp = 0; + pack_long(a, &v_tmp, &l_tmp); + check_pack_long = 0; + } + + is_overridden_[PACK_DOUBLE] = 0; + int do_pack_as_long = 0; grib_context* c = a->context; //if (a->cclass->pack_long && a->cclass->pack_long != &pack_long) { - try { + if (is_overridden_[PACK_LONG]) { do_pack_as_long = 1; } - //else { - catch (std::runtime_error& e) { + else { /* ECC-648: Special case of codetable */ if (strcmp(a->cclass->name, "codetable") == 0) { do_pack_as_long = 1; } - // TODO(maee): replace try-catch logic } + if (do_pack_as_long) { return pack_double_array_as_long(a, v, len); } grib_context_log(c, GRIB_LOG_ERROR, "Should not pack '%s' as a double", a->name); - //if (a->cclass->pack_string && a->cclass->pack_string != &pack_string) { - try { + + if (is_overridden_[PACK_STRING]) { grib_context_log(c, GRIB_LOG_ERROR, "Try packing as a string"); } - catch (std::runtime_error& e) { - // TODO(maee): replace try-catch logic - } return GRIB_NOT_IMPLEMENTED; } @@ -589,8 +589,8 @@ int grib_accessor_class_gen_t::pack_string_array(grib_accessor* a, const char** int grib_accessor_class_gen_t::pack_string(grib_accessor* a, const char* v, size_t* len) { - //if (a->cclass->pack_double && a->cclass->pack_double != &pack_double) { - try { + is_overridden_[PACK_STRING] = 0; + if (is_overridden_[PACK_DOUBLE]) { size_t l = 1; char* endPtr = NULL; /* for error handling */ double val = strtod(v, &endPtr); @@ -600,20 +600,19 @@ int grib_accessor_class_gen_t::pack_string(grib_accessor* a, const char* v, size __func__, v, a->name); return GRIB_WRONG_TYPE; } - return a->pack_double(&val, &l); - } - catch (std::runtime_error& e) { - // TODO(maee): replace try-catch logic + int err = a->pack_double(&val, &l); + if (is_overridden_[PACK_DOUBLE]) { + return err; + } } - //if (a->cclass->pack_long && a->cclass->pack_long != &pack_long) { - try { + if (is_overridden_[PACK_LONG]) { size_t l = 1; long val = atol(v); - return a->pack_long(&val, &l); - } - catch (std::runtime_error& e) { - // TODO(maee): replace try-catch logic + int err = a->pack_long(&val, &l); + if (is_overridden_[PACK_LONG]) { + return err; + } } grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack '%s' as string", a->name); @@ -664,8 +663,8 @@ void grib_accessor_class_gen_t::update_size(grib_accessor* a, size_t s) grib_accessor* grib_accessor_class_gen_t::next(grib_accessor* a, int mod) { grib_accessor* next = NULL; - if (a->next) { - next = a->next; + if (a->next_) { + next = a->next_; } else { if (a->parent->owner) diff --git a/src/accessor/grib_accessor_class_gen.h b/src/accessor/grib_accessor_class_gen.h index d68ad4320..2d76361ae 100644 --- a/src/accessor/grib_accessor_class_gen.h +++ b/src/accessor/grib_accessor_class_gen.h @@ -2,6 +2,7 @@ #include "../grib_api_internal.h" #include "grib_accessor.h" +#include class grib_accessor_gen_t : public grib_accessor { void init_accessor(const long, grib_arguments*) override; @@ -90,4 +91,68 @@ class grib_accessor_class_gen_t : public grib_accessor_class int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len) override; int clear(grib_accessor*) override; grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; + + template + int unpack_helper(grib_accessor* a, T* v, size_t* len); + +private: + enum { + PACK_DOUBLE, + PACK_FLOAT, + PACK_LONG, + PACK_STRING, + UNPACK_DOUBLE, + UNPACK_FLOAT, + UNPACK_LONG, + UNPACK_STRING, + }; + std::bitset<8> is_overridden_ = 0b11111111; }; + + +template +int grib_accessor_class_gen_t::unpack_helper(grib_accessor* a, T* v, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + int type = GRIB_TYPE_UNDEFINED; + const char* Tname = type_to_string(*v); + + if constexpr (std::is_same_v) { + is_overridden_[UNPACK_FLOAT] = 0; + } + else if constexpr (std::is_same_v) { + is_overridden_[UNPACK_DOUBLE] = 0; + } + + if (is_overridden_[UNPACK_LONG]) { + long val = 0; + size_t l = 1; + a->unpack_long(&val, &l); + if (is_overridden_[UNPACK_LONG]) { + *v = val; + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to %s", a->name, Tname); + return GRIB_SUCCESS; + } + } + + if (is_overridden_[UNPACK_STRING]) { + char val[1024]; + size_t l = sizeof(val); + char* last = NULL; + a->unpack_string(val, &l); + if (is_overridden_[UNPACK_STRING]) { + *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 %s", a->name, Tname); + return GRIB_SUCCESS; + } + } + } + + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as %s", a->name, Tname); + 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/accessor/grib_accessor_class_ibmfloat.cc b/src/accessor/grib_accessor_class_ibmfloat.cc index 54bdb05c6..65c59ba0f 100644 --- a/src/accessor/grib_accessor_class_ibmfloat.cc +++ b/src/accessor/grib_accessor_class_ibmfloat.cc @@ -26,32 +26,6 @@ void grib_accessor_class_ibmfloat_t::init(grib_accessor* a, const long len, grib Assert(a->length >= 0); } -template -int unpack(grib_accessor* a, T* val, size_t* len){ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - unsigned long rlen = 0; - long count = 0; - int err = 0; - unsigned long i = 0; - long bitp = a->offset * 8; - grib_handle* hand = grib_handle_of_accessor(a); - - err = a->value_count(&count); if (err) - return err; - rlen = count; - - if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %lu values", *len, a->name, rlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < rlen; i++) - val[i] = (T)grib_long_to_ibm(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); - - *len = rlen; - return GRIB_SUCCESS; -} int grib_accessor_class_ibmfloat_t::unpack_double(grib_accessor* a, double* val, size_t* len){ return unpack(a, val, len); diff --git a/src/accessor/grib_accessor_class_ibmfloat.h b/src/accessor/grib_accessor_class_ibmfloat.h index 4a82dda63..d98864516 100644 --- a/src/accessor/grib_accessor_class_ibmfloat.h +++ b/src/accessor/grib_accessor_class_ibmfloat.h @@ -36,5 +36,36 @@ class grib_accessor_class_ibmfloat_t : public grib_accessor_class_double_t void init(grib_accessor*, const long, grib_arguments*) override; void update_size(grib_accessor*, size_t) override; int nearest_smaller_value(grib_accessor*, double, double*) override; +private: + template int unpack(grib_accessor*, T*, size_t*); }; + + +template +int grib_accessor_class_ibmfloat_t::unpack(grib_accessor* a, T* val, size_t* len){ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + unsigned long rlen = 0; + long count = 0; + int err = 0; + unsigned long i = 0; + long bitp = a->offset * 8; + grib_handle* hand = grib_handle_of_accessor(a); + + err = a->value_count(&count); if (err) + return err; + rlen = count; + + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %lu values", *len, a->name, rlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < rlen; i++) + val[i] = (T)grib_long_to_ibm(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); + + *len = rlen; + return GRIB_SUCCESS; +} + #endif /* eccodes_accessor_ibmfloat_h */ diff --git a/src/accessor/grib_accessor_class_ieeefloat.cc b/src/accessor/grib_accessor_class_ieeefloat.cc index 4d220d18e..e15091925 100644 --- a/src/accessor/grib_accessor_class_ieeefloat.cc +++ b/src/accessor/grib_accessor_class_ieeefloat.cc @@ -81,31 +81,6 @@ int grib_accessor_class_ieeefloat_t::pack_double(grib_accessor* a, const double* return ret; } -template -int unpack(grib_accessor* a, T* val, size_t* len){ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - long rlen = 0; - int err = 0; - long i = 0; - long bitp = a->offset * 8; - grib_handle* hand = grib_handle_of_accessor(a); - - err = a->value_count(&rlen); if (err) - return err; - - if (*len < (size_t)rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %ld values", *len, a->name, rlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < rlen; i++) - val[i] = (T)grib_long_to_ieee(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); - - *len = rlen; - return GRIB_SUCCESS; -} - int grib_accessor_class_ieeefloat_t::unpack_double(grib_accessor* a, double* val, size_t* len){ return unpack(a, val, len); } diff --git a/src/accessor/grib_accessor_class_ieeefloat.h b/src/accessor/grib_accessor_class_ieeefloat.h index b59357d72..100b2ad6a 100644 --- a/src/accessor/grib_accessor_class_ieeefloat.h +++ b/src/accessor/grib_accessor_class_ieeefloat.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_ieeefloat_h #define eccodes_accessor_ieeefloat_h -#include "../grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_ieeefloat_t : public grib_accessor_double_t @@ -33,5 +32,35 @@ class grib_accessor_class_ieeefloat_t : public grib_accessor_class_double_t void init(grib_accessor*, const long, grib_arguments*) override; void update_size(grib_accessor*, size_t) override; int nearest_smaller_value(grib_accessor* a, double val, double* nearest) override; + +private: + template int unpack(grib_accessor*, T*, size_t*); }; + + +template +int grib_accessor_class_ieeefloat_t::unpack(grib_accessor* a, T* val, size_t* len){ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + long rlen = 0; + int err = 0; + long i = 0; + long bitp = a->offset * 8; + grib_handle* hand = grib_handle_of_accessor(a); + + err = a->value_count(&rlen); if (err) + return err; + + if (*len < (size_t)rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %ld values", *len, a->name, rlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < rlen; i++) + val[i] = (T)grib_long_to_ieee(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); + + *len = rlen; + return GRIB_SUCCESS; +} + #endif /* eccodes_accessor_ieeefloat_h */ diff --git a/src/accessor/grib_accessor_class_lookup.h b/src/accessor/grib_accessor_class_lookup.h index 4237d4517..1fba42fe5 100644 --- a/src/accessor/grib_accessor_class_lookup.h +++ b/src/accessor/grib_accessor_class_lookup.h @@ -12,13 +12,11 @@ #ifndef eccodes_accessor_lookup_h #define eccodes_accessor_lookup_h -#include "../grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_lookup_t : public grib_accessor_long_t { public: - /* Members defined in lookup */ long llength; long loffset; grib_expression* real_name; diff --git a/src/accessor/grib_accessor_class_section.cc b/src/accessor/grib_accessor_class_section.cc index da5380280..b859639b0 100644 --- a/src/accessor/grib_accessor_class_section.cc +++ b/src/accessor/grib_accessor_class_section.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_section.h" grib_accessor_class_section_t _grib_accessor_class_section{"section"}; @@ -53,7 +52,7 @@ int grib_accessor_class_section_t::get_native_type(grib_accessor* a){ return GRIB_TYPE_SECTION; } -static grib_section* sub_section(grib_accessor* a) +grib_section* grib_accessor_class_section_t::sub_section(grib_accessor* a) { return a->sub_section; } @@ -77,16 +76,16 @@ void grib_accessor_class_section_t::update_size(grib_accessor* a, size_t length) Assert(a->length >= 0); } -static grib_accessor* next(grib_accessor* a, int explore) +grib_accessor* grib_accessor_class_section_t::next(grib_accessor* a, int explore) { grib_accessor* next = NULL; if (explore) { next = a->sub_section->block->first; if (!next) - next = a->next; + next = a->next_; } else { - next = a->next; + next = a->next_; } if (!next) { if (a->parent->owner) diff --git a/src/accessor/grib_accessor_class_section.h b/src/accessor/grib_accessor_class_section.h index b755b8b27..b1905b182 100644 --- a/src/accessor/grib_accessor_class_section.h +++ b/src/accessor/grib_accessor_class_section.h @@ -12,14 +12,9 @@ #ifndef eccodes_accessor_section_h #define eccodes_accessor_section_h -#include "../grib_api_internal.h" #include "grib_accessor_class_gen.h" -class grib_accessor_section_t : public grib_accessor_gen_t -{ -public: - /* Members defined in section */ -}; +class grib_accessor_section_t : public grib_accessor_gen_t {}; class grib_accessor_class_section_t : public grib_accessor_class_gen_t { @@ -33,5 +28,7 @@ class grib_accessor_class_section_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; void update_size(grib_accessor*, size_t) override; + grib_section* sub_section(grib_accessor*) override; + grib_accessor* next(grib_accessor*, int) override; }; #endif /* eccodes_accessor_section_h */ diff --git a/src/accessor/grib_accessor_class_smart_table_column.h b/src/accessor/grib_accessor_class_smart_table_column.h index 0c24454bc..f5787f780 100644 --- a/src/accessor/grib_accessor_class_smart_table_column.h +++ b/src/accessor/grib_accessor_class_smart_table_column.h @@ -12,13 +12,11 @@ #ifndef eccodes_accessor_smart_table_column_h #define eccodes_accessor_smart_table_column_h -#include "../grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_smart_table_column_t : public grib_accessor_gen_t { public: - /* Members defined in smart_table_column */ const char* smartTable; int index; }; diff --git a/src/accessor/grib_accessor_class_transient.h b/src/accessor/grib_accessor_class_transient.h index fa6771ecd..e330ad686 100644 --- a/src/accessor/grib_accessor_class_transient.h +++ b/src/accessor/grib_accessor_class_transient.h @@ -10,7 +10,6 @@ #pragma once -#include "../grib_api_internal.h" #include "grib_accessor_class_variable.h" class grib_accessor_transient_t : public grib_accessor_variable_t { diff --git a/src/accessor/grib_accessor_class_values.h b/src/accessor/grib_accessor_class_values.h index a77a5e89c..c7cbf54e7 100644 --- a/src/accessor/grib_accessor_class_values.h +++ b/src/accessor/grib_accessor_class_values.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -12,13 +11,11 @@ #ifndef eccodes_accessor_values_h #define eccodes_accessor_values_h -#include "../grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_values_t : public grib_accessor_gen_t { public: - /* Members defined in values */ int carg; const char* seclen; const char* offsetdata; diff --git a/src/accessor/grib_accessor_class_variable.h b/src/accessor/grib_accessor_class_variable.h index 91c7f815d..90ff71238 100644 --- a/src/accessor/grib_accessor_class_variable.h +++ b/src/accessor/grib_accessor_class_variable.h @@ -10,7 +10,6 @@ #pragma once -#include "../grib_api_internal.h" #include "grib_accessor.h" #include "grib_accessor_class_gen.h" diff --git a/src/accessor/grib_accessors_list.cc b/src/accessor/grib_accessors_list.cc index 29d8b1f0d..935516964 100644 --- a/src/accessor/grib_accessors_list.cc +++ b/src/accessor/grib_accessors_list.cc @@ -15,9 +15,6 @@ void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al) { } } - - - int grib_accessors_list::value_count(size_t* count) { long lcount = 0; diff --git a/src/accessor/grib_accessors_list.h b/src/accessor/grib_accessors_list.h index f088414f5..0ec5798a4 100644 --- a/src/accessor/grib_accessors_list.h +++ b/src/accessor/grib_accessors_list.h @@ -2,7 +2,7 @@ #include "grib_accessor.h" -struct grib_accessors_list +class grib_accessors_list { public: grib_accessors_list(); @@ -23,6 +23,5 @@ struct grib_accessors_list grib_accessors_list* last_; }; -//grib_accessors_list* grib_accessors_list_create(grib_context* c); -//void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al); - +grib_accessors_list* grib_accessors_list_create(grib_context* c); +void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al); diff --git a/src/action_class_remove.cc b/src/action_class_remove.cc index a334a79f1..eff91cdce 100644 --- a/src/action_class_remove.cc +++ b/src/action_class_remove.cc @@ -94,7 +94,7 @@ static void remove_accessor(grib_accessor* a) grib_section* s = NULL; int id; - if (!a || !a->previous) + if (!a || !a->previous_) return; s = a->parent; @@ -103,12 +103,12 @@ static void remove_accessor(grib_accessor* a) grib_handle_of_accessor(a)->accessors[id] = NULL; } - if (a->next) - a->previous->next = a->next; + if (a->next_) + a->previous_->next_ = a->next_; else return; - a->next->previous = a->previous; + a->next_->previous_ = a->previous_; a->destroy(s->h->context); } diff --git a/src/action_class_section.cc b/src/action_class_section.cc index 9dda3dc30..e8f8b0a39 100644 --- a/src/action_class_section.cc +++ b/src/action_class_section.cc @@ -171,7 +171,8 @@ static int notify_change(grib_action* act, grib_accessor* notified, /*err = GRIB_SUCCESS;*/ } else { - grib_handle_delete(tmp_handle); + // TODO(maee): segmentation fault + //grib_handle_delete(tmp_handle); h->kid = NULL; /* ECC-1314: must set to NULL for grib_handle_delete(h) to work */ return err; } @@ -203,7 +204,8 @@ static int notify_change(grib_action* act, grib_accessor* notified, Assert(tmp_handle->dependencies == NULL); /* printf("grib_handle_delete %p\n",(void*)tmp_handle); */ - grib_handle_delete(tmp_handle); + //TODO(maee): causes segmentation fault + //grib_handle_delete(tmp_handle); h->use_trie = 1; h->trie_invalid = 1; diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index cf7673e19..5e0c68cd0 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -106,10 +106,6 @@ grib_action* grib_action_create_modify(grib_context* context, const char* name, grib_action* grib_action_create_transient_darray(grib_context* context, const char* name, grib_darray* darray, int flags); /* grib_accessor.cc*/ -grib_accessors_list* grib_accessors_list_create(grib_context* c); -void grib_accessors_list_push(grib_accessors_list* al, grib_accessor* a, int rank); -grib_accessors_list* grib_accessors_list_last(grib_accessors_list* al); -void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al); /* grib_concept.cc*/ grib_concept_value* grib_concept_value_new(grib_context* c, const char* name, grib_concept_condition* conditions); diff --git a/src/grib_accessor_class.cc b/src/grib_accessor_class.cc index 63c2fede6..4120fb5bd 100644 --- a/src/grib_accessor_class.cc +++ b/src/grib_accessor_class.cc @@ -11,6 +11,7 @@ #include "grib_api_internal.h" #include "grib_accessor_classes_hash.cc" +#include /* grib level */ @@ -150,8 +151,8 @@ grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator, a->creator = creator; a->context = p->h->context; a->h = NULL; - a->next = NULL; - a->previous = NULL; + a->next_ = NULL; + a->previous_ = NULL; a->parent = p; a->length = 0; a->offset = 0; @@ -240,8 +241,8 @@ void grib_push_accessor(grib_accessor* a, grib_block_of_accessors* l) if (!l->first) l->first = l->last = a; else { - l->last->next = a; - a->previous = l->last; + l->last->next_ = a; + a->previous_ = l->last; } l->last = a; @@ -270,13 +271,11 @@ void grib_section_post_init(grib_section* s) while (a) { grib_accessor_class* c = a->cclass; - //if (c->post_init) - // c->post_init(a); c->post_init(a); if (a->sub_section) grib_section_post_init(a->sub_section); - a = a->next; + a = a->next_; } } @@ -308,7 +307,7 @@ int grib_section_adjust_sizes(grib_section* s, int update, int depth) } length += l; offset += l; - a = a->next; + a = a->next_; } if (s) { @@ -402,7 +401,7 @@ grib_accessor* find_paddings(grib_section* s) if (a->preferred_size(0) != a->length) return a; - a = a->next; + a = a->next_; } return NULL; diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 0cff18a9b..2b28ad91c 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -739,7 +739,7 @@ struct grib_handle grib_context* context; /** < context attached to this handle */ grib_buffer* buffer; /** < buffer attached to the handle */ grib_section* root; /** the root section*/ - grib_section* rules; /** the rules section*/ + //grib_section* rules; [>* the rules section<] grib_dependency* dependencies; /** List of dependencies */ grib_handle* main; /** Used during reparsing */ grib_handle* kid; /** Used during reparsing */ diff --git a/src/grib_buffer.cc b/src/grib_buffer.cc index 89313429d..cb313141c 100644 --- a/src/grib_buffer.cc +++ b/src/grib_buffer.cc @@ -123,14 +123,14 @@ static void update_offsets(grib_accessor* a, long len) grib_context_log(a->context, GRIB_LOG_DEBUG, "::::: grib_buffer : accessor %s is moving by %d bytes to %ld", a->name, len, a->offset); if (s) update_offsets(s->block->first, len); - a = a->next; + a = a->next_; } } static void update_offsets_after(grib_accessor* a, long len) { while (a) { - update_offsets(a->next, len); + update_offsets(a->next_, len); a = a->parent->owner; } } diff --git a/src/grib_dumper_class.cc b/src/grib_dumper_class.cc index eca1610b0..4af527151 100644 --- a/src/grib_dumper_class.cc +++ b/src/grib_dumper_class.cc @@ -53,7 +53,7 @@ void grib_dump_accessors_block(grib_dumper* dumper, grib_block_of_accessors* blo grib_accessor* a = block->first; while (a) { a->dump(dumper); - a = a->next; + a = a->next_; } } diff --git a/src/grib_handle.cc b/src/grib_handle.cc index 08b6f7eaa..faaefbebe 100644 --- a/src/grib_handle.cc +++ b/src/grib_handle.cc @@ -54,7 +54,7 @@ static void update_sections(grib_section* s, grib_handle* h, long offset) a->offset += offset; /* update_sections ( grib_get_sub_section ( a ),h,offset ); */ update_sections(a->sub_section, h, offset); - a = a->next; + a = a->next_; } } @@ -74,7 +74,7 @@ void grib_swap_sections(grib_section* the_old, grib_section* the_new) a = the_old->block->first; while (a) { a->parent = the_old; - a = a->next; + a = a->next_; } update_sections(the_old, the_old->h, the_old->owner->offset); @@ -94,7 +94,7 @@ void grib_empty_section(grib_context* c, grib_section* b) current = b->block->first; while (current) { - grib_accessor* next = current->next; + grib_accessor* next = current->next_; if (current->sub_section) { grib_section_delete(c, current->sub_section); current->sub_section = 0; diff --git a/src/grib_query.cc b/src/grib_query.cc index 7b2ecb08a..29e3e1322 100644 --- a/src/grib_query.cc +++ b/src/grib_query.cc @@ -64,7 +64,7 @@ static grib_accessor* search(grib_section* s, const char* name, const char* name if ((b = search(sub, name, name_space)) != NULL) match = b; - a = a->next; + a = a->next_; } return match; @@ -95,7 +95,7 @@ static void rebuild_hash_keys(grib_handle* h, grib_section* s) i++; } rebuild_hash_keys(h, sub); - a = a->next; + a = a->next_; } } @@ -229,7 +229,7 @@ static grib_accessor* _search_by_rank(grib_accessor* a,const char* name,long ran if (r==rank) return al->accessor; r++; } - al=al->next; + al=al->next_; } return NULL; diff --git a/src/grib_value.cc b/src/grib_value.cc index 2913d5849..13efc00e4 100644 --- a/src/grib_value.cc +++ b/src/grib_value.cc @@ -1274,13 +1274,18 @@ int grib_get_native_type(const grib_handle* h, const char* name, int* type) 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"); + 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); if (err == GRIB_SUCCESS) { size_t len = buffer_len - *decoded_length; - err = a->unpack(val + *decoded_length, &len); + if constexpr (std::is_same::value) { + err = a->unpack_double(val + *decoded_length, &len); + } + else if constexpr (std::is_same::value) { + err = a->unpack_float(val + *decoded_length, &len); + } *decoded_length += len; } @@ -1321,7 +1326,7 @@ 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 a->unpack(val, length); + return a->unpack_double(val, length); } else { *length = 0; diff --git a/tools/bufr_dump.cc b/tools/bufr_dump.cc index 679ec79a3..6c31ce76e 100644 --- a/tools/bufr_dump.cc +++ b/tools/bufr_dump.cc @@ -9,6 +9,7 @@ */ #include "grib_tools.h" +#include "accessor/grib_accessor_class_bufr_data_array.h" grib_option grib_options[] = { /* {id, args, help}, on, command_line, value*/ @@ -475,10 +476,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) } } a = grib_find_accessor(h, "numericValues"); - // ===== TODO(maee): Reanable this ==== - //al = accessor_bufr_data_array_get_dataAccessors(a); - throw std::runtime_error("Functionality disabled"); - // ===== TODO(maee): Reanable this ==== + al = accessor_bufr_data_array_get_dataAccessors(a); options->dump_flags = GRIB_DUMP_FLAG_ALL_ATTRIBUTES; codes_dump_bufr_flat(al, h, stdout, options->dump_mode, options->dump_flags, 0); break; diff --git a/tools/gts_compare.cc b/tools/gts_compare.cc index 2f570c61c..0bdd6751b 100644 --- a/tools/gts_compare.cc +++ b/tools/gts_compare.cc @@ -609,7 +609,7 @@ static int compare_all_dump_keys(grib_handle* h1, grib_handle* h2, grib_runtime_ if (xa == NULL || (xa->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) continue; if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { - err++; + (*err)++; write_messages(h1, h2); ret = 1; } diff --git a/tools/metar_compare.cc b/tools/metar_compare.cc index 258a09024..b201c8f6e 100644 --- a/tools/metar_compare.cc +++ b/tools/metar_compare.cc @@ -772,7 +772,7 @@ static int compare_all_dump_keys(grib_handle* h1, grib_handle* h2, grib_runtime_ if (xa == NULL || (xa->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) continue; if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { - err++; + (*err)++; write_messages(h1, h2); ret = 1; } From 8a7f8c8ef44118d867bd9ad907fe8b5d928fd175 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 4 Apr 2024 16:10:06 +0100 Subject: [PATCH 013/196] Fix compilation --- src/accessor/grib_accessor_class_data_png_packing.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/accessor/grib_accessor_class_data_png_packing.h b/src/accessor/grib_accessor_class_data_png_packing.h index d8c9211a3..1bd29fda4 100644 --- a/src/accessor/grib_accessor_class_data_png_packing.h +++ b/src/accessor/grib_accessor_class_data_png_packing.h @@ -12,8 +12,8 @@ #ifndef eccodes_accessor_data_png_packing_h #define eccodes_accessor_data_png_packing_h -#include "../grib_api_internal.h" #include "grib_accessor_class_values.h" +#include "grib_scaling.h" class grib_accessor_data_png_packing_t : public grib_accessor_values_t { From 1184bcca24a580baec277d92d5933e0c74c99d5a Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 4 Apr 2024 16:21:11 +0100 Subject: [PATCH 014/196] Make local functions static --- .../grib_accessor_class_proj_string.cc | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/accessor/grib_accessor_class_proj_string.cc b/src/accessor/grib_accessor_class_proj_string.cc index da7f7ac35..d55b277e0 100644 --- a/src/accessor/grib_accessor_class_proj_string.cc +++ b/src/accessor/grib_accessor_class_proj_string.cc @@ -42,7 +42,7 @@ struct proj_mapping typedef struct proj_mapping proj_mapping; // This should only be called for GRID POINT data (not spherical harmonics etc) -int get_major_minor_axes(grib_handle* h, double* pMajor, double* pMinor){ +static int get_major_minor_axes(grib_handle* h, double* pMajor, double* pMinor){ int err = 0; if (grib_is_earth_oblate(h)) { if ((err = grib_get_double_internal(h, "earthMinorAxisInMetres", pMinor)) != GRIB_SUCCESS) return err; @@ -57,7 +57,7 @@ int get_major_minor_axes(grib_handle* h, double* pMajor, double* pMinor){ } // Caller must have allocated enough space in the 'result' argument -int get_earth_shape(grib_handle* h, char* result){ +static int get_earth_shape(grib_handle* h, char* result){ int err = 0; double major = 0, minor = 0; if ((err = get_major_minor_axes(h, &major, &minor)) != GRIB_SUCCESS) @@ -69,7 +69,7 @@ int get_earth_shape(grib_handle* h, char* result){ return err; } -int proj_space_view(grib_handle* h, char* result){ +static int proj_space_view(grib_handle* h, char* result){ return GRIB_NOT_IMPLEMENTED; // int err = 0; // char shape[128] = {0,}; @@ -85,17 +85,17 @@ int proj_space_view(grib_handle* h, char* result){ // return err; } -int proj_albers(grib_handle* h, char* result){ +static int proj_albers(grib_handle* h, char* result){ return GRIB_NOT_IMPLEMENTED; } -int proj_transverse_mercator(grib_handle* h, char* result){ +static int proj_transverse_mercator(grib_handle* h, char* result){ return GRIB_NOT_IMPLEMENTED; } -int proj_equatorial_azimuthal_equidistant(grib_handle* h, char* result){ +static int proj_equatorial_azimuthal_equidistant(grib_handle* h, char* result){ return GRIB_NOT_IMPLEMENTED; } -int proj_lambert_conformal(grib_handle* h, char* result){ +static int proj_lambert_conformal(grib_handle* h, char* result){ int err = 0; char shape[128] = {0,}; double LoVInDegrees = 0, LaDInDegrees = 0, Latin1InDegrees = 0, Latin2InDegrees = 0; @@ -115,7 +115,7 @@ int proj_lambert_conformal(grib_handle* h, char* result){ return err; } -int proj_lambert_azimuthal_equal_area(grib_handle* h, char* result){ +static int proj_lambert_azimuthal_equal_area(grib_handle* h, char* result){ int err = 0; char shape[128] = {0,}; double standardParallel = 0, centralLongitude = 0; @@ -131,7 +131,7 @@ int proj_lambert_azimuthal_equal_area(grib_handle* h, char* result){ return err; } -int proj_polar_stereographic(grib_handle* h, char* result){ +static int proj_polar_stereographic(grib_handle* h, char* result){ int err = 0; double centralLongitude = 0, centralLatitude = 0; int has_northPole = 0; @@ -154,7 +154,7 @@ int proj_polar_stereographic(grib_handle* h, char* result){ // ECC-1552: This is for regular_ll, regular_gg, reduced_ll, reduced_gg // These are not 'projected' grids! -int proj_unprojected(grib_handle* h, char* result){ +static int proj_unprojected(grib_handle* h, char* result){ int err = 0; //char shape[128] = {0,}; //if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) return err; @@ -164,7 +164,7 @@ int proj_unprojected(grib_handle* h, char* result){ return err; } -int proj_mercator(grib_handle* h, char* result){ +static int proj_mercator(grib_handle* h, char* result){ int err = 0; double LaDInDegrees = 0; char shape[128] = {0,}; From 77d358a4d04742d28abf50f2403a2d794bf3e6c8 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 9 Apr 2024 11:46:43 +0000 Subject: [PATCH 015/196] Fix memory issue --- .../grib_accessor_class_bufrdc_expanded_descriptors.cc | 1 + .../grib_accessor_class_g1end_of_interval_monthly.cc | 1 + src/accessor/grib_accessor_class_g1step_range.cc | 1 + src/accessor/grib_accessor_class_gen.cc | 5 +---- src/accessor/grib_accessor_class_hash_array.cc | 1 + src/accessor/grib_accessor_class_md5.cc | 1 + src/accessor/grib_accessor_class_pack_bufr_values.cc | 1 + src/accessor/grib_accessor_class_section.cc | 1 + src/accessor/grib_accessor_class_smart_table.cc | 2 ++ src/accessor/grib_accessor_class_smart_table_column.cc | 2 ++ src/accessor/grib_accessor_class_statistics.cc | 1 + src/accessor/grib_accessor_class_statistics_spectral.cc | 1 + src/accessor/grib_accessor_class_transient_darray.cc | 1 + src/accessor/grib_accessor_class_unpack_bufr_values.cc | 1 + src/accessor/grib_accessor_class_unsigned.cc | 2 ++ src/accessor/grib_accessor_class_variable.cc | 2 ++ src/action_class_section.cc | 4 ++-- 17 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc index 73282fcea..9aa38faa4 100644 --- a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc @@ -96,4 +96,5 @@ int grib_accessor_class_bufrdc_expanded_descriptors_t::value_count(grib_accessor return descriptors->value_count(rlen);} void grib_accessor_class_bufrdc_expanded_descriptors_t::destroy(grib_context* c, grib_accessor* a){ + grib_accessor_class_long_t::destroy(c, a); } diff --git a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc index fddd7f48e..c280f26b3 100644 --- a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc +++ b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc @@ -95,6 +95,7 @@ int grib_accessor_class_g1end_of_interval_monthly_t::value_count(grib_accessor* void grib_accessor_class_g1end_of_interval_monthly_t::destroy(grib_context* c, grib_accessor* a){ grib_accessor_g1end_of_interval_monthly_t* self = (grib_accessor_g1end_of_interval_monthly_t*)a; grib_context_free(c, self->v); + grib_accessor_class_abstract_vector_t::destroy(c, a); } int grib_accessor_class_g1end_of_interval_monthly_t::compare(grib_accessor* a, grib_accessor* b){ diff --git a/src/accessor/grib_accessor_class_g1step_range.cc b/src/accessor/grib_accessor_class_g1step_range.cc index 5cf69c863..8ad1b3e12 100644 --- a/src/accessor/grib_accessor_class_g1step_range.cc +++ b/src/accessor/grib_accessor_class_g1step_range.cc @@ -635,4 +635,5 @@ int grib_accessor_class_g1step_range_t::get_native_type(grib_accessor* a){ void grib_accessor_class_g1step_range_t::destroy(grib_context* c, grib_accessor* a){ grib_accessor_g1step_range_t* self = (grib_accessor_g1step_range_t*)a; grib_context_free(c, self->v); + grib_accessor_class_abstract_long_vector_t::destroy(c, a); } diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index 89debb2ac..a27e1e9ca 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -335,7 +335,6 @@ int grib_accessor_class_gen_t::unpack_long(grib_accessor* a, long* v, size_t* le { is_overridden_[UNPACK_LONG] = 0; int type = GRIB_TYPE_UNDEFINED; - //if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { if (is_overridden_[UNPACK_DOUBLE] == 1) { double val = 0.0; size_t l = 1; @@ -350,7 +349,6 @@ int grib_accessor_class_gen_t::unpack_long(grib_accessor* a, long* v, size_t* le } } - //if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { if (is_overridden_[UNPACK_STRING] == 1) { char val[1024]; size_t l = sizeof(val); @@ -536,7 +534,7 @@ int grib_accessor_class_gen_t::pack_double(grib_accessor* a, const double* v, si { static int check_pack_long = 1; if (check_pack_long) { - const long v_tmp = 0; + const long v_tmp = (long) (*v); size_t l_tmp = 0; pack_long(a, &v_tmp, &l_tmp); check_pack_long = 0; @@ -546,7 +544,6 @@ int grib_accessor_class_gen_t::pack_double(grib_accessor* a, const double* v, si int do_pack_as_long = 0; grib_context* c = a->context; - //if (a->cclass->pack_long && a->cclass->pack_long != &pack_long) { if (is_overridden_[PACK_LONG]) { do_pack_as_long = 1; } diff --git a/src/accessor/grib_accessor_class_hash_array.cc b/src/accessor/grib_accessor_class_hash_array.cc index 757b1887e..d4f005710 100644 --- a/src/accessor/grib_accessor_class_hash_array.cc +++ b/src/accessor/grib_accessor_class_hash_array.cc @@ -146,6 +146,7 @@ void grib_accessor_class_hash_array_t::destroy(grib_context* c, grib_accessor* a grib_accessor_hash_array_t* self = (grib_accessor_hash_array_t*)a; if (self->key) grib_context_free(c, self->key); + grib_accessor_class_gen_t::destroy(c, a); } int grib_accessor_class_hash_array_t::unpack_string(grib_accessor* a, char* val, size_t* len){ diff --git a/src/accessor/grib_accessor_class_md5.cc b/src/accessor/grib_accessor_class_md5.cc index 7d5fd330f..4cc9beaf0 100644 --- a/src/accessor/grib_accessor_class_md5.cc +++ b/src/accessor/grib_accessor_class_md5.cc @@ -143,6 +143,7 @@ void grib_accessor_class_md5_t::destroy(grib_context* c, grib_accessor* a){ grib_context_free(c, cur); } } + grib_accessor_class_gen_t::destroy(c, a); } int grib_accessor_class_md5_t::value_count(grib_accessor* a, long* count){ diff --git a/src/accessor/grib_accessor_class_pack_bufr_values.cc b/src/accessor/grib_accessor_class_pack_bufr_values.cc index 17d17746b..4c276ed42 100644 --- a/src/accessor/grib_accessor_class_pack_bufr_values.cc +++ b/src/accessor/grib_accessor_class_pack_bufr_values.cc @@ -51,6 +51,7 @@ int grib_accessor_class_pack_bufr_values_t::value_count(grib_accessor* a, long* } void grib_accessor_class_pack_bufr_values_t::destroy(grib_context* context, grib_accessor* a){ + grib_accessor_class_gen_t::destroy(context, a); } int grib_accessor_class_pack_bufr_values_t::get_native_type(grib_accessor* a){ diff --git a/src/accessor/grib_accessor_class_section.cc b/src/accessor/grib_accessor_class_section.cc index b859639b0..ec6e14c2b 100644 --- a/src/accessor/grib_accessor_class_section.cc +++ b/src/accessor/grib_accessor_class_section.cc @@ -46,6 +46,7 @@ long grib_accessor_class_section_t::next_offset(grib_accessor* a){ void grib_accessor_class_section_t::destroy(grib_context* ct, grib_accessor* a){ grib_section_delete(ct, a->sub_section); + grib_accessor_class_gen_t::destroy(ct, a); } int grib_accessor_class_section_t::get_native_type(grib_accessor* a){ diff --git a/src/accessor/grib_accessor_class_smart_table.cc b/src/accessor/grib_accessor_class_smart_table.cc index 4d1997854..e26169656 100644 --- a/src/accessor/grib_accessor_class_smart_table.cc +++ b/src/accessor/grib_accessor_class_smart_table.cc @@ -405,6 +405,8 @@ void grib_accessor_class_smart_table_t::destroy(grib_context* context, grib_acce } if (self->tableCodes) grib_context_free(a->context, self->tableCodes); + + grib_accessor_class_unsigned_t::destroy(context, a); } int grib_accessor_class_smart_table_t::get_native_type(grib_accessor* a) diff --git a/src/accessor/grib_accessor_class_smart_table_column.cc b/src/accessor/grib_accessor_class_smart_table_column.cc index d63587cd1..d04f63e5e 100644 --- a/src/accessor/grib_accessor_class_smart_table_column.cc +++ b/src/accessor/grib_accessor_class_smart_table_column.cc @@ -166,6 +166,8 @@ void grib_accessor_class_smart_table_column_t::destroy(grib_context* context, gr grib_context_free(context, a->vvalue); a->vvalue = NULL; } + + grib_accessor_class_gen_t::destroy(context, a); } int grib_accessor_class_smart_table_column_t::get_native_type(grib_accessor* a){ diff --git a/src/accessor/grib_accessor_class_statistics.cc b/src/accessor/grib_accessor_class_statistics.cc index ea73e69c3..f84731e0e 100644 --- a/src/accessor/grib_accessor_class_statistics.cc +++ b/src/accessor/grib_accessor_class_statistics.cc @@ -176,6 +176,7 @@ int grib_accessor_class_statistics_t::value_count(grib_accessor* a, long* count) void grib_accessor_class_statistics_t::destroy(grib_context* c, grib_accessor* a){ grib_accessor_statistics_t* self = (grib_accessor_statistics_t*)a; grib_context_free(c, self->v); + grib_accessor_class_abstract_vector_t::destroy(c, a); } int grib_accessor_class_statistics_t::compare(grib_accessor* a, grib_accessor* b){ diff --git a/src/accessor/grib_accessor_class_statistics_spectral.cc b/src/accessor/grib_accessor_class_statistics_spectral.cc index 57fd16549..ea57cd2be 100644 --- a/src/accessor/grib_accessor_class_statistics_spectral.cc +++ b/src/accessor/grib_accessor_class_statistics_spectral.cc @@ -124,6 +124,7 @@ int grib_accessor_class_statistics_spectral_t::value_count(grib_accessor* a, lon void grib_accessor_class_statistics_spectral_t::destroy(grib_context* c, grib_accessor* a){ grib_accessor_statistics_spectral_t* self = (grib_accessor_statistics_spectral_t*)a; grib_context_free(c, self->v); + grib_accessor_class_abstract_vector_t::destroy(c, a); } int grib_accessor_class_statistics_spectral_t::compare(grib_accessor* a, grib_accessor* b){ diff --git a/src/accessor/grib_accessor_class_transient_darray.cc b/src/accessor/grib_accessor_class_transient_darray.cc index 5f1ec2b2b..5ed3333db 100644 --- a/src/accessor/grib_accessor_class_transient_darray.cc +++ b/src/accessor/grib_accessor_class_transient_darray.cc @@ -94,6 +94,7 @@ void grib_accessor_class_transient_darray_t::destroy(grib_context* c, grib_acces grib_accessor_transient_darray_t* self = (grib_accessor_transient_darray_t*)a; if (self->arr) grib_darray_delete(a->context, self->arr); + grib_accessor_class_gen_t::destroy(c, a); } int grib_accessor_class_transient_darray_t::value_count(grib_accessor* a, long* count){ diff --git a/src/accessor/grib_accessor_class_unpack_bufr_values.cc b/src/accessor/grib_accessor_class_unpack_bufr_values.cc index 984378dc2..4b3be3ad4 100644 --- a/src/accessor/grib_accessor_class_unpack_bufr_values.cc +++ b/src/accessor/grib_accessor_class_unpack_bufr_values.cc @@ -64,6 +64,7 @@ int grib_accessor_class_unpack_bufr_values_t::value_count(grib_accessor* a, long } void grib_accessor_class_unpack_bufr_values_t::destroy(grib_context* context, grib_accessor* a){ + grib_accessor_class_gen_t::destroy(context, a); } int grib_accessor_class_unpack_bufr_values_t::get_native_type(grib_accessor* a){ diff --git a/src/accessor/grib_accessor_class_unsigned.cc b/src/accessor/grib_accessor_class_unsigned.cc index b5615ac37..0a60e809c 100644 --- a/src/accessor/grib_accessor_class_unsigned.cc +++ b/src/accessor/grib_accessor_class_unsigned.cc @@ -268,4 +268,6 @@ void grib_accessor_class_unsigned_t::destroy(grib_context* context, grib_accesso grib_context_free(context, a->vvalue); a->vvalue = NULL; + + grib_accessor_class_long_t::destroy(context, a); } diff --git a/src/accessor/grib_accessor_class_variable.cc b/src/accessor/grib_accessor_class_variable.cc index 879da527b..a9bd8741b 100644 --- a/src/accessor/grib_accessor_class_variable.cc +++ b/src/accessor/grib_accessor_class_variable.cc @@ -218,6 +218,8 @@ void grib_accessor_class_variable_t::destroy(grib_context* c, grib_accessor* a) a->attributes[i] = NULL; ++i; } + + grib_accessor_class_gen_t::destroy(c, a); } int grib_accessor_class_variable_t::unpack_string(grib_accessor* a, char* val, size_t* len) diff --git a/src/action_class_section.cc b/src/action_class_section.cc index e8f8b0a39..d5a986f5d 100644 --- a/src/action_class_section.cc +++ b/src/action_class_section.cc @@ -172,7 +172,7 @@ static int notify_change(grib_action* act, grib_accessor* notified, } else { // TODO(maee): segmentation fault - //grib_handle_delete(tmp_handle); + grib_handle_delete(tmp_handle); h->kid = NULL; /* ECC-1314: must set to NULL for grib_handle_delete(h) to work */ return err; } @@ -205,7 +205,7 @@ static int notify_change(grib_action* act, grib_accessor* notified, /* printf("grib_handle_delete %p\n",(void*)tmp_handle); */ //TODO(maee): causes segmentation fault - //grib_handle_delete(tmp_handle); + grib_handle_delete(tmp_handle); h->use_trie = 1; h->trie_invalid = 1; From 6bdef3a4c68d973ea7afb7f619b15d99cf4f9e06 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 9 Apr 2024 12:13:37 +0000 Subject: [PATCH 016/196] Fix compare function --- src/accessor/grib_accessor_class_long.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/accessor/grib_accessor_class_long.cc b/src/accessor/grib_accessor_class_long.cc index a1f125f25..89d757acb 100644 --- a/src/accessor/grib_accessor_class_long.cc +++ b/src/accessor/grib_accessor_class_long.cc @@ -129,7 +129,7 @@ int grib_accessor_class_long_t::compare(grib_accessor* a, grib_accessor* b) return err; alen = count; - err = a->value_count(&count); + err = b->value_count(&count); if (err) return err; blen = count; From ea48de72dfb879aff56cf9c98459ac63c573a501 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 9 Apr 2024 15:02:44 +0000 Subject: [PATCH 017/196] PNG fix --- src/accessor/grib_accessor_class_data_png_packing.cc | 4 +++- src/accessor/grib_accessor_class_data_png_packing.h | 7 +------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/accessor/grib_accessor_class_data_png_packing.cc b/src/accessor/grib_accessor_class_data_png_packing.cc index 7e2c90baf..8db2e5b3b 100644 --- a/src/accessor/grib_accessor_class_data_png_packing.cc +++ b/src/accessor/grib_accessor_class_data_png_packing.cc @@ -9,8 +9,10 @@ * 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_png_packing.h" +#include "grib_scaling.h" + +#define PNG_ANYBITS grib_accessor_class_data_png_packing_t _grib_accessor_class_data_png_packing{"data_png_packing"}; grib_accessor_class* grib_accessor_class_data_png_packing = &_grib_accessor_class_data_png_packing; diff --git a/src/accessor/grib_accessor_class_data_png_packing.h b/src/accessor/grib_accessor_class_data_png_packing.h index 1bd29fda4..841ed9d31 100644 --- a/src/accessor/grib_accessor_class_data_png_packing.h +++ b/src/accessor/grib_accessor_class_data_png_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,16 +8,13 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_png_packing_h -#define eccodes_accessor_data_png_packing_h +#pragma once #include "grib_accessor_class_values.h" -#include "grib_scaling.h" class grib_accessor_data_png_packing_t : public grib_accessor_values_t { public: - /* Members defined in data_png_packing */ const char* number_of_values; const char* reference_value; const char* binary_scale_factor; @@ -43,4 +39,3 @@ class grib_accessor_class_data_png_packing_t : public grib_accessor_class_values int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; }; -#endif /* eccodes_accessor_data_png_packing_h */ From 78a9429c4e93fc6bab58b2743d5527dc4a4a407e Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 9 Apr 2024 16:02:57 +0100 Subject: [PATCH 018/196] Add PNG_ANYBITS --- src/accessor/grib_accessor_class_data_png_packing.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/accessor/grib_accessor_class_data_png_packing.cc b/src/accessor/grib_accessor_class_data_png_packing.cc index 7e2c90baf..d10d0765e 100644 --- a/src/accessor/grib_accessor_class_data_png_packing.cc +++ b/src/accessor/grib_accessor_class_data_png_packing.cc @@ -11,6 +11,7 @@ #include "grib_api_internal.h" #include "grib_accessor_class_data_png_packing.h" +#define PNG_ANYBITS grib_accessor_class_data_png_packing_t _grib_accessor_class_data_png_packing{"data_png_packing"}; grib_accessor_class* grib_accessor_class_data_png_packing = &_grib_accessor_class_data_png_packing; From cec5b2f4e15625f954d80bebaeb3d998af6daa71 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 9 Apr 2024 20:32:45 +0000 Subject: [PATCH 019/196] Fix destroy() function --- src/accessor/grib_accessor_class_bufr_data_array.cc | 1 + src/accessor/grib_accessor_class_bufr_data_element.cc | 1 + src/accessor/grib_accessor_class_bufr_string_values.cc | 1 + src/accessor/grib_accessor_class_codetable.cc | 1 + src/accessor/grib_accessor_class_concept.cc | 1 + ...ssor_class_data_g1second_order_general_extended_packing.cc | 1 + src/accessor/grib_accessor_class_expanded_descriptors.cc | 1 + src/accessor/grib_accessor_class_getenv.cc | 1 - src/accessor/grib_accessor_class_getenv.h | 4 +--- src/action_class_section.cc | 2 -- 10 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/accessor/grib_accessor_class_bufr_data_array.cc b/src/accessor/grib_accessor_class_bufr_data_array.cc index dc903a154..e89d096b1 100644 --- a/src/accessor/grib_accessor_class_bufr_data_array.cc +++ b/src/accessor/grib_accessor_class_bufr_data_array.cc @@ -3242,4 +3242,5 @@ void grib_accessor_class_bufr_data_array_t::destroy(grib_context* c, grib_access } grib_iarray_delete(self->iss_list); + grib_accessor_class_gen_t::destroy(c, a); } diff --git a/src/accessor/grib_accessor_class_bufr_data_element.cc b/src/accessor/grib_accessor_class_bufr_data_element.cc index f479fd236..e2c9eafbe 100644 --- a/src/accessor/grib_accessor_class_bufr_data_element.cc +++ b/src/accessor/grib_accessor_class_bufr_data_element.cc @@ -497,6 +497,7 @@ void grib_accessor_class_bufr_data_element_t::destroy(grib_context* ct, grib_acc a->attributes[i] = NULL; i++; } + grib_accessor_class_gen_t::destroy(ct, a); } #define MAX_STRING_SIZE 4096 diff --git a/src/accessor/grib_accessor_class_bufr_string_values.cc b/src/accessor/grib_accessor_class_bufr_string_values.cc index 3015a7b8c..f6b7d561a 100644 --- a/src/accessor/grib_accessor_class_bufr_string_values.cc +++ b/src/accessor/grib_accessor_class_bufr_string_values.cc @@ -82,4 +82,5 @@ int grib_accessor_class_bufr_string_values_t::value_count(grib_accessor* a, long return descriptors->value_count(rlen);} void grib_accessor_class_bufr_string_values_t::destroy(grib_context* c, grib_accessor* a){ + grib_accessor_class_ascii_t::destroy(c, a); } diff --git a/src/accessor/grib_accessor_class_codetable.cc b/src/accessor/grib_accessor_class_codetable.cc index 696370ba9..54f51929b 100644 --- a/src/accessor/grib_accessor_class_codetable.cc +++ b/src/accessor/grib_accessor_class_codetable.cc @@ -775,6 +775,7 @@ void grib_accessor_class_codetable_t::destroy(grib_context* context, grib_access grib_context_free(context, a->vvalue); a->vvalue = NULL; } + grib_accessor_class_unsigned_t::destroy(context, a); } int grib_accessor_class_codetable_t::get_native_type(grib_accessor* a) diff --git a/src/accessor/grib_accessor_class_concept.cc b/src/accessor/grib_accessor_class_concept.cc index 1e4eb27c1..a5b9fba44 100644 --- a/src/accessor/grib_accessor_class_concept.cc +++ b/src/accessor/grib_accessor_class_concept.cc @@ -424,6 +424,7 @@ int grib_accessor_class_concept_t::get_native_type(grib_accessor* a){ void grib_accessor_class_concept_t::destroy(grib_context* c, grib_accessor* a){ //grib_accessor_concept_t *self = (grib_accessor_concept_t*)a; //grib_context_free(c,self->cval); + grib_accessor_class_gen_t::destroy(c, a); } int grib_accessor_class_concept_t::unpack_string(grib_accessor* a, char* val, size_t* len){ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc index f95103d73..48b5081df 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc @@ -1203,4 +1203,5 @@ void grib_accessor_class_data_g1second_order_general_extended_packing_t::destroy grib_context_free(context, self->fvalues); self->fvalues = NULL; } + grib_accessor_class_data_simple_packing_t::destroy(context, a); } diff --git a/src/accessor/grib_accessor_class_expanded_descriptors.cc b/src/accessor/grib_accessor_class_expanded_descriptors.cc index 6ea941b55..d885ad1d8 100644 --- a/src/accessor/grib_accessor_class_expanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_expanded_descriptors.cc @@ -725,6 +725,7 @@ int grib_accessor_class_expanded_descriptors_t::value_count(grib_accessor* a, lo } void grib_accessor_class_expanded_descriptors_t::destroy(grib_context* c, grib_accessor* a){ + grib_accessor_class_long_t::destroy(c, a); // grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; // if (self->rank==0 && self->expanded) // grib_bufr_descriptors_array_delete(self->expanded); diff --git a/src/accessor/grib_accessor_class_getenv.cc b/src/accessor/grib_accessor_class_getenv.cc index e95c3d39a..d812cc276 100644 --- a/src/accessor/grib_accessor_class_getenv.cc +++ b/src/accessor/grib_accessor_class_getenv.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_getenv.h" grib_accessor_class_getenv_t _grib_accessor_class_getenv{"getenv"}; diff --git a/src/accessor/grib_accessor_class_getenv.h b/src/accessor/grib_accessor_class_getenv.h index 8ddf7db14..5068dad2c 100644 --- a/src/accessor/grib_accessor_class_getenv.h +++ b/src/accessor/grib_accessor_class_getenv.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -12,13 +11,11 @@ #ifndef eccodes_accessor_getenv_h #define eccodes_accessor_getenv_h -#include "../grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_getenv_t : public grib_accessor_ascii_t { public: - /* Members defined in getenv */ const char* name; char* value; const char* default_value; @@ -35,4 +32,5 @@ class grib_accessor_class_getenv_t : public grib_accessor_class_ascii_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; + #endif /* eccodes_accessor_getenv_h */ diff --git a/src/action_class_section.cc b/src/action_class_section.cc index d5a986f5d..9dda3dc30 100644 --- a/src/action_class_section.cc +++ b/src/action_class_section.cc @@ -171,7 +171,6 @@ static int notify_change(grib_action* act, grib_accessor* notified, /*err = GRIB_SUCCESS;*/ } else { - // TODO(maee): segmentation fault grib_handle_delete(tmp_handle); h->kid = NULL; /* ECC-1314: must set to NULL for grib_handle_delete(h) to work */ return err; @@ -204,7 +203,6 @@ static int notify_change(grib_action* act, grib_accessor* notified, Assert(tmp_handle->dependencies == NULL); /* printf("grib_handle_delete %p\n",(void*)tmp_handle); */ - //TODO(maee): causes segmentation fault grib_handle_delete(tmp_handle); h->use_trie = 1; From cc40569e216529ba475a5a0b658d6ea556085bfa Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 9 Apr 2024 20:38:08 +0000 Subject: [PATCH 020/196] Fix memory leak --- src/accessor/grib_accessor_class_gen.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index a27e1e9ca..f118d45e3 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -191,7 +191,7 @@ void grib_accessor_gen_t::resize(size_t new_size) void grib_accessor_gen_t::destroy(grib_context* ct) { cclass->destroy(ct, this); - //delete this; + delete this; } From a74264659edf5c1847dc97af13d271f4eb6cdd85 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 10 Apr 2024 12:18:23 +0000 Subject: [PATCH 021/196] Bump up version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index aa5388f63..3a05135cd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.35.0 +2.36.0 From e6a4240f77788421a86128a286c425ef3e1ee9d0 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 10 Apr 2024 12:18:48 +0000 Subject: [PATCH 022/196] Testing: grib_repair depends on downloaded data --- tests/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ff56770f8..26592f16c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -391,7 +391,8 @@ if( HAVE_BUILD_TOOLS ) ecbuild_add_test( TARGET eccodes_t_grib_repair TYPE SCRIPT CONDITION ECCODES_INSTALL_EXTRA_TOOLS AND ENABLE_EXTRA_TESTS - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_repair.sh ) + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_repair.sh + TEST_DEPENDS eccodes_download_gribs ) # Note: making the test dependent on the grib files (with DEPENDS) From d10140227d1238880ca89176b89be91e8ff44b68 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 10 Apr 2024 14:18:12 +0100 Subject: [PATCH 023/196] ECC-1797: Add aliases to key names --- definitions/grib2/template.4.categorical.def | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/definitions/grib2/template.4.categorical.def b/definitions/grib2/template.4.categorical.def index 6d0393f94..006e46a3a 100644 --- a/definitions/grib2/template.4.categorical.def +++ b/definitions/grib2/template.4.categorical.def @@ -11,4 +11,9 @@ categories list(numberOfCategories) { unsigned[4] scaledValueOfLowerLimit : can_be_missing,dump ; unsigned[1] scaleFactorOfUpperLimit : can_be_missing,dump; unsigned[4] scaledValueOfUpperLimit : can_be_missing,dump; + + alias scaleFactorOfFirstLimit = scaleFactorOfLowerLimit; + alias scaledValueOfFirstLimit = scaledValueOfLowerLimit; + alias scaleFactorOfSecondLimit = scaleFactorOfUpperLimit; + alias scaledValueOfSecondLimit = scaledValueOfUpperLimit; } From 95539f79dd80aee1b07a065e84239684730de0db Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 10 Apr 2024 16:06:19 +0000 Subject: [PATCH 024/196] Clang 17 compiler warnings --- examples/C/large_grib1.c | 2 +- examples/F90/codes_dump.f90 | 2 +- examples/F90/grib_count_messages_multi.f90 | 8 ++++---- examples/F90/grib_read_bytes.f90 | 2 +- fortran/grib_fortran.c | 14 +++++++------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/C/large_grib1.c b/examples/C/large_grib1.c index a01761ced..3131ead64 100644 --- a/examples/C/large_grib1.c +++ b/examples/C/large_grib1.c @@ -14,7 +14,7 @@ #include "eccodes.h" /* See JIRA issue GRIB-361 */ -int main() +int main(void) { const int ni = 2880; const int nj = 2880; diff --git a/examples/F90/codes_dump.f90 b/examples/F90/codes_dump.f90 index b68c68e51..ab547ec04 100644 --- a/examples/F90/codes_dump.f90 +++ b/examples/F90/codes_dump.f90 @@ -12,7 +12,7 @@ program codes_dump_test implicit none integer :: ifile, iret, msgid integer :: product_kind - character(len=10) :: product_string + character(len=512) :: product_string character(len=512) :: infile_name call getarg(1, product_string) diff --git a/examples/F90/grib_count_messages_multi.f90 b/examples/F90/grib_count_messages_multi.f90 index 5e4fe92d9..67178fa6f 100644 --- a/examples/F90/grib_count_messages_multi.f90 +++ b/examples/F90/grib_count_messages_multi.f90 @@ -13,10 +13,10 @@ program grib_count_messages_multi use eccodes implicit none - integer :: ifile - character(len=100) :: grib_file - integer :: n, stat - character(len=1) :: multi_flag + integer :: ifile + character(len=100) :: multi_flag + character(len=100) :: grib_file + integer :: n, stat call getarg(1, multi_flag) call getarg(2, grib_file) diff --git a/examples/F90/grib_read_bytes.f90 b/examples/F90/grib_read_bytes.f90 index 950eb2924..c118bdab4 100644 --- a/examples/F90/grib_read_bytes.f90 +++ b/examples/F90/grib_read_bytes.f90 @@ -7,7 +7,7 @@ ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. ! ! -program grib_read_bytes +program read_bytes use eccodes implicit none integer :: ifile diff --git a/fortran/grib_fortran.c b/fortran/grib_fortran.c index ce9298348..3cb17739a 100644 --- a/fortran/grib_fortran.c +++ b/fortran/grib_fortran.c @@ -41,7 +41,7 @@ static pthread_mutex_t multi_handle_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t iterator_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t keys_iterator_mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { +static void init(void) { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); @@ -996,13 +996,13 @@ void grib_f_write_on_fail_(int* gid) { grib_f_write_on_fail(gid); } /*****************************************************************************/ -int grib_f_multi_support_on_() +int grib_f_multi_support_on_(void) { grib_multi_support_on(0); return GRIB_SUCCESS; } -int grib_f_multi_support_off_() +int grib_f_multi_support_off_(void) { grib_multi_support_off(0); return GRIB_SUCCESS; @@ -1181,13 +1181,13 @@ int grib_f_keys_iterator_delete_(int* iterid) } /*****************************************************************************/ -int grib_f_gribex_mode_on_() +int grib_f_gribex_mode_on_(void) { grib_gribex_mode_on(0); return GRIB_SUCCESS; } -int grib_f_gribex_mode_off_() +int grib_f_gribex_mode_off_(void) { grib_gribex_mode_off(0); return GRIB_SUCCESS; @@ -2877,13 +2877,13 @@ int grib_f_multi_append_(int* ingid, int* sec,int* mgid) } /*****************************************************************************/ -int codes_f_bufr_multi_element_constant_arrays_on_() +int codes_f_bufr_multi_element_constant_arrays_on_(void) { codes_bufr_multi_element_constant_arrays_on(NULL); return GRIB_SUCCESS; } -int codes_f_bufr_multi_element_constant_arrays_off_() +int codes_f_bufr_multi_element_constant_arrays_off_(void) { codes_bufr_multi_element_constant_arrays_off(NULL); return GRIB_SUCCESS; From 8c28b0fcc59abecaec7120fb38164aadd987f8a9 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 12 Apr 2024 11:33:00 +0100 Subject: [PATCH 025/196] ECC-1800: GRIB2: Failure setting stepUnits=s,paramId=210203 --- src/grib_accessor_class_g2step_range.cc | 4 ++++ tests/grib_sub_hourly.sh | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/grib_accessor_class_g2step_range.cc b/src/grib_accessor_class_g2step_range.cc index c39601a40..3800a4342 100644 --- a/src/grib_accessor_class_g2step_range.cc +++ b/src/grib_accessor_class_g2step_range.cc @@ -211,6 +211,10 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) if ((ret = grib_get_long_internal(h, "forceStepUnits", &force_step_units)) != GRIB_SUCCESS) return ret; + if (h->loader) { // h->loader is set only when rebuilding or reparsing + force_step_units = 255; // See ECC-1768 and ECC-1800 + } + try { std::vector steps = parse_range(val, eccodes::Unit{force_step_units}); if (steps.size() == 0) { diff --git a/tests/grib_sub_hourly.sh b/tests/grib_sub_hourly.sh index fdd174c28..eb1405111 100755 --- a/tests/grib_sub_hourly.sh +++ b/tests/grib_sub_hourly.sh @@ -542,5 +542,24 @@ set -e [ $status -ne 0 ] grep -q "Invalid unit" $tempText + +# ECC-1800: Set stepUnits before paramIds, which cause changes in the PTDN +${tools_dir}/grib_set -s stepUnits=s,paramId=210203 $sample_g2 $temp # is_chemical +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 40' + +${tools_dir}/grib_set -s stepUnits=s,paramId=131060 $sample_g2 $temp # probability forecasts +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 9' + +${tools_dir}/grib_set -s stepUnits=s,paramId=210073 $sample_g2 $temp # is_aerosol +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 48' + +${tools_dir}/grib_set -s stepUnits=s,paramId=210170 $sample_g2 $temp # is_chemical_srcsink +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 76' + +# Add a case with filter too +echo "set stepUnits='s'; set paramId=210203; write;" | ${tools_dir}/grib_filter -o $temp - $sample_g2 +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 40' + + # Clean up rm -f $temp $temp2 $tempFilt $tempText From d937a838c75194e7664f8007cfcdf4721cc95592 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 13 Apr 2024 12:32:50 +0100 Subject: [PATCH 026/196] Cleanup --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6859a1f1a..05d59c9f1 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ INSTALLATION ``` cmake ../eccodes-x.y.z-Source -DCMAKE_INSTALL_PREFIX=/path/to/where/you/install/eccodes ``` - + It is strongly recommended that you install into a clean directory 5. Compile, test and install: From 68457aafa3d24142fbb18ce7a4a64dd8c2c0c33c Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 13 Apr 2024 12:33:09 +0100 Subject: [PATCH 027/196] ECC-1800: More tests --- tests/grib_sub_hourly.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/grib_sub_hourly.sh b/tests/grib_sub_hourly.sh index eb1405111..2f399da0f 100755 --- a/tests/grib_sub_hourly.sh +++ b/tests/grib_sub_hourly.sh @@ -13,6 +13,14 @@ # See JIRA issues ECC-1620, ECC-1238 # ----------------------------------- +label="grib_sub_hourly" +temp=temp.1.$label +temp2=temp.2.$label +tempFilt=temp.$label.filt +tempText=temp.$label.txt + +sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + grib_expect_failure() { a_file=$1 @@ -51,14 +59,6 @@ if (set -u; : ${ECCODES_GRIB_HOURLY_STEPS_WITH_UNITS?}) 2> /dev/null; then fi -label="grib_sub_hourly" -temp=temp.1.$label -temp2=temp.2.$label -tempFilt=temp.$label.filt -tempText=temp.$label.txt - -sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl - instantaneous_field=$data_dir/reduced_gaussian_surface.grib2 accumulated_field=$data_dir/reduced_gaussian_sub_area.grib2 @@ -544,6 +544,12 @@ grep -q "Invalid unit" $tempText # ECC-1800: Set stepUnits before paramIds, which cause changes in the PTDN +${tools_dir}/grib_set -s stepUnits=m,productDefinitionTemplateNumber=40 $sample_g2 $temp +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '0 m 40' + +${tools_dir}/grib_set -s stepUnits=m,step=6,productDefinitionTemplateNumber=40 $sample_g2 $temp +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,forecastTime' '0 m 6' + ${tools_dir}/grib_set -s stepUnits=s,paramId=210203 $sample_g2 $temp # is_chemical grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 40' From 518fdc677c7578175d72ba0fd8d7075e497b2d11 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 13 Apr 2024 12:33:36 +0100 Subject: [PATCH 028/196] Debugging messages --- src/grib_index.cc | 5 +++++ tests/grib_indexing.sh | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/grib_index.cc b/src/grib_index.cc index b6eb0b3a2..211b30cb5 100644 --- a/src/grib_index.cc +++ b/src/grib_index.cc @@ -1290,6 +1290,11 @@ static int codes_index_add_file_internal(grib_index* index, const char* filename grib_context_log(c, GRIB_LOG_ERROR, "File %s contains no messages", filename); return GRIB_END_OF_FILE; } + + if (c->debug) { + fprintf(stderr, "ECCODES DEBUG %s %s\n", __func__, filename); + grib_index_dump(stderr, index, GRIB_DUMP_FLAG_TYPE); + } return GRIB_SUCCESS; } diff --git a/tests/grib_indexing.sh b/tests/grib_indexing.sh index bd4908bf1..5f73f7039 100755 --- a/tests/grib_indexing.sh +++ b/tests/grib_indexing.sh @@ -158,6 +158,9 @@ rm -rf $temp_dir_A ${tools_dir}/grib_index_build -N -o $tempIndex1 $sample1 > /dev/null ${tools_dir}/grib_dump $tempIndex1 >/dev/null +# With DEBUG enabled +# -------------------- +ECCODES_DEBUG=-1 ${tools_dir}/grib_index_build -N -o $tempIndex1 $sample1 > /dev/null # ECC-1773: GRIB2 multi-field messages # ------------------------------------- From 7250f5cbc3e2c5857ce7518c89e34f73d95f799a Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 15 Apr 2024 14:46:32 +0100 Subject: [PATCH 029/196] Documentation --- src/grib_accessor_class_g2step_range.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/grib_accessor_class_g2step_range.cc b/src/grib_accessor_class_g2step_range.cc index 3800a4342..e1dd9494b 100644 --- a/src/grib_accessor_class_g2step_range.cc +++ b/src/grib_accessor_class_g2step_range.cc @@ -211,6 +211,12 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) if ((ret = grib_get_long_internal(h, "forceStepUnits", &force_step_units)) != GRIB_SUCCESS) return ret; + // Note: + // forceStepUnits is a special key that is used to identify the origin of the defined units + // i.e., whether they have been defined by the user. + // If this key is defined (!= 255), it indicates that the stepUnits have been defined by the user. + // Once this key is set, it has the highest priority: it automatically overrides certain units and the default value in stepUnits + if (h->loader) { // h->loader is set only when rebuilding or reparsing force_step_units = 255; // See ECC-1768 and ECC-1800 } From cc3caa2938e4c2d66a4ee0ed389ee69928be96cb Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 15 Apr 2024 16:31:43 +0100 Subject: [PATCH 030/196] Definitions: Faster to decode two keys than concept --- definitions/grib2/template.4.horizontal.def | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/definitions/grib2/template.4.horizontal.def b/definitions/grib2/template.4.horizontal.def index db0913dbc..0c10f5fe0 100644 --- a/definitions/grib2/template.4.horizontal.def +++ b/definitions/grib2/template.4.horizontal.def @@ -66,7 +66,9 @@ if (extraDim) { } else { # See GRIB-74 why we store the pressureUnits in a transient transient tempPressureUnits=pressureUnits; - if (!(typeOfLevel is "surface")) { + # Same as typeOfLevel != "surface" but much quicker to evaluate + # than via the concept + if ( ! (typeOfFirstFixedSurface == 1 && typeOfSecondFixedSurface == 255) ) { if (tempPressureUnits is "Pa") { meta marsLevel scale(level,one,hundred) : read_only; alias mars.levelist=marsLevel; From afbd560a00d64a8f22a4f3f810faefc8c94be335 Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 16 Apr 2024 10:28:04 +0100 Subject: [PATCH 031/196] ECC-1801: GRIB2: Issue with post metadata hook for DestinE --- definitions/grib2/post_meta_data.hook.products_12.def | 2 +- tests/grib_ecc-1691.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/definitions/grib2/post_meta_data.hook.products_12.def b/definitions/grib2/post_meta_data.hook.products_12.def index d7ad4e586..f01e08f71 100644 --- a/definitions/grib2/post_meta_data.hook.products_12.def +++ b/definitions/grib2/post_meta_data.hook.products_12.def @@ -9,6 +9,6 @@ concept destineOrigin(unknown, "destineOriginConcept.def", conceptsDir2, concept unalias mars.domain; # ECC-1796: stepRange indexing for DestinE ExtremesDT and On-Demand ExtremesDT data -if (!(dataset is "climate-dt")) { +if ( defined(dataset) && !(dataset is "climate-dt") ) { alias mars.step=stepRange; } diff --git a/tests/grib_ecc-1691.sh b/tests/grib_ecc-1691.sh index bb0cb6d62..d64bae087 100755 --- a/tests/grib_ecc-1691.sh +++ b/tests/grib_ecc-1691.sh @@ -93,5 +93,9 @@ ${tools_dir}/grib_ls -jm $temp_grib_a [ $( ${tools_dir}/grib_get -f -p mars.time $temp_grib_a ) = "not_found" ] [ $( ${tools_dir}/grib_get -f -p mars.step $temp_grib_a ) = "not_found" ] +# ECC-1801 +${tools_dir}/grib_set -s productionStatusOfProcessedData=12 $sample_grib2 $temp_grib_a +${tools_dir}/grib_compare -b productionStatusOfProcessedData $sample_grib2 $temp_grib_a + # Clean up rm -f $temp_grib_a $temp_grib_b $destine_sample From eb8bdcf87e86ef42bbde15959f3f16caf216caba Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 16 Apr 2024 11:36:39 +0100 Subject: [PATCH 032/196] ECC-1800: GRIB2: Failure setting stepUnits=s,paramId=210203 --- .../grib_accessor_class_g2step_range.cc | 10 +++++ tests/grib_sub_hourly.sh | 41 +++++++++++++++---- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/accessor/grib_accessor_class_g2step_range.cc b/src/accessor/grib_accessor_class_g2step_range.cc index b53d8c92f..ae2b9976d 100644 --- a/src/accessor/grib_accessor_class_g2step_range.cc +++ b/src/accessor/grib_accessor_class_g2step_range.cc @@ -115,6 +115,16 @@ int grib_accessor_class_g2step_range_t::pack_string(grib_accessor* a, const char if ((ret = grib_get_long_internal(h, "forceStepUnits", &force_step_units)) != GRIB_SUCCESS) return ret; + // Note: + // forceStepUnits is a special key that is used to identify the origin of the defined units + // i.e., whether they have been defined by the user. + // If this key is defined (!= 255), it indicates that the stepUnits have been defined by the user. + // Once this key is set, it has the highest priority: it automatically overrides certain units and the default value in stepUnits + + if (h->loader) { // h->loader is set only when rebuilding or reparsing + force_step_units = 255; // See ECC-1768 and ECC-1800 + } + try { std::vector steps = parse_range(val, eccodes::Unit{force_step_units}); if (steps.size() == 0) { diff --git a/tests/grib_sub_hourly.sh b/tests/grib_sub_hourly.sh index fdd174c28..2f399da0f 100755 --- a/tests/grib_sub_hourly.sh +++ b/tests/grib_sub_hourly.sh @@ -13,6 +13,14 @@ # See JIRA issues ECC-1620, ECC-1238 # ----------------------------------- +label="grib_sub_hourly" +temp=temp.1.$label +temp2=temp.2.$label +tempFilt=temp.$label.filt +tempText=temp.$label.txt + +sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + grib_expect_failure() { a_file=$1 @@ -51,14 +59,6 @@ if (set -u; : ${ECCODES_GRIB_HOURLY_STEPS_WITH_UNITS?}) 2> /dev/null; then fi -label="grib_sub_hourly" -temp=temp.1.$label -temp2=temp.2.$label -tempFilt=temp.$label.filt -tempText=temp.$label.txt - -sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl - instantaneous_field=$data_dir/reduced_gaussian_surface.grib2 accumulated_field=$data_dir/reduced_gaussian_sub_area.grib2 @@ -542,5 +542,30 @@ set -e [ $status -ne 0 ] grep -q "Invalid unit" $tempText + +# ECC-1800: Set stepUnits before paramIds, which cause changes in the PTDN +${tools_dir}/grib_set -s stepUnits=m,productDefinitionTemplateNumber=40 $sample_g2 $temp +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '0 m 40' + +${tools_dir}/grib_set -s stepUnits=m,step=6,productDefinitionTemplateNumber=40 $sample_g2 $temp +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,forecastTime' '0 m 6' + +${tools_dir}/grib_set -s stepUnits=s,paramId=210203 $sample_g2 $temp # is_chemical +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 40' + +${tools_dir}/grib_set -s stepUnits=s,paramId=131060 $sample_g2 $temp # probability forecasts +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 9' + +${tools_dir}/grib_set -s stepUnits=s,paramId=210073 $sample_g2 $temp # is_aerosol +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 48' + +${tools_dir}/grib_set -s stepUnits=s,paramId=210170 $sample_g2 $temp # is_chemical_srcsink +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 76' + +# Add a case with filter too +echo "set stepUnits='s'; set paramId=210203; write;" | ${tools_dir}/grib_filter -o $temp - $sample_g2 +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 40' + + # Clean up rm -f $temp $temp2 $tempFilt $tempText From 65f4d736a0eeba5228840361ab635b2173713ed7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 16 Apr 2024 14:40:12 +0000 Subject: [PATCH 033/196] ECC-1799: GRIB2: Populate the ERA pseudo-centre with relevant encodings --- definitions/grib2/cfVarName.def | 42 + .../grib2/localConcepts/ecmf/cfName.def | 36 - .../localConcepts/ecmf/cfName.legacy.def | 36 + .../grib2/localConcepts/ecmf/cfVarName.def | 228 ------ .../localConcepts/ecmf/cfVarName.legacy.def | 228 ++++++ definitions/grib2/localConcepts/ecmf/name.def | 228 ------ .../grib2/localConcepts/ecmf/name.legacy.def | 228 ++++++ .../grib2/localConcepts/ecmf/paramId.def | 228 ------ .../localConcepts/ecmf/paramId.legacy.def | 228 ++++++ .../grib2/localConcepts/ecmf/shortName.def | 228 ------ .../localConcepts/ecmf/shortName.legacy.def | 228 ++++++ .../grib2/localConcepts/ecmf/units.def | 228 ------ .../grib2/localConcepts/ecmf/units.legacy.def | 228 ++++++ .../grib2/localConcepts/era/cfName.def | 72 ++ definitions/grib2/localConcepts/era/name.def | 716 ++++++++++++++++++ .../grib2/localConcepts/era/paramId.def | 716 ++++++++++++++++++ .../grib2/localConcepts/era/shortName.def | 716 ++++++++++++++++++ definitions/grib2/localConcepts/era/units.def | 716 ++++++++++++++++++ .../grib2/localConcepts/uerra/cfName.def | 21 + .../grib2/localConcepts/uerra/cfVarName.def | 21 + .../grib2/localConcepts/uerra/name.def | 21 + .../grib2/localConcepts/uerra/paramId.def | 21 + .../grib2/localConcepts/uerra/shortName.def | 21 + .../grib2/localConcepts/uerra/units.def | 21 + definitions/grib2/name.def | 42 + definitions/grib2/paramId.def | 42 + definitions/grib2/shortName.def | 42 + definitions/grib2/units.def | 42 + tests/grib_cfNames.sh | 4 +- tests/grib_check_param_concepts.sh | 25 +- 30 files changed, 4458 insertions(+), 1195 deletions(-) create mode 100644 definitions/grib2/localConcepts/era/cfName.def create mode 100644 definitions/grib2/localConcepts/era/name.def create mode 100644 definitions/grib2/localConcepts/era/paramId.def create mode 100644 definitions/grib2/localConcepts/era/shortName.def create mode 100644 definitions/grib2/localConcepts/era/units.def diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 494c41ada..510e4b2af 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -4916,6 +4916,34 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean snow depth +'msde' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow cover +'msnowc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean geopotential +'mz' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean temperature +'mt' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean U component of wind 'mu' = { discipline = 0 ; @@ -4930,6 +4958,13 @@ parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific humidity +'mq' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean surface pressure 'msp' = { discipline = 0 ; @@ -4938,6 +4973,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean vertical velocity +'mw' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean total column water 'mtcw' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfName.def b/definitions/grib2/localConcepts/ecmf/cfName.def index f32ddc9a7..2ef70fa76 100644 --- a/definitions/grib2/localConcepts/ecmf/cfName.def +++ b/definitions/grib2/localConcepts/ecmf/cfName.def @@ -476,48 +476,12 @@ parameterCategory = 218 ; parameterNumber = 200 ; } -#Sea water potential temperature -'sea_water_potential_temperature' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 129 ; - } -#Sea water practical salinity -'sea_water_practical_salinity' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 130 ; - } -#Upward sea water velocity -'upward_sea_water_velocity' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 133 ; - } -#Sea water sigma theta -'sea_water_sigma_theta' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 138 ; - } #Ocean barotropic stream function 'ocean_barotropic_streamfunction' = { discipline = 192 ; parameterCategory = 151 ; parameterNumber = 147 ; } -#Surface downward eastward stress -'surface_downward_eastward_stress' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 153 ; - } -#Surface downward northward stress -'surface_downward_northward_stress' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 154 ; - } #Carbon dioxide mass mixing ratio 'mass_fraction_of_carbon_dioxide_in_air' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfName.legacy.def b/definitions/grib2/localConcepts/ecmf/cfName.legacy.def index e3b2b9750..b343a5b2c 100644 --- a/definitions/grib2/localConcepts/ecmf/cfName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/cfName.legacy.def @@ -148,3 +148,39 @@ parameterCategory = 128 ; parameterNumber = 206 ; } +#Sea water potential temperature +'sea_water_potential_temperature' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 129 ; +} +#Sea water practical salinity +'sea_water_practical_salinity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 130 ; +} +#Upward sea water velocity +'upward_sea_water_velocity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 133 ; +} +#Sea water sigma theta +'sea_water_sigma_theta' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 138 ; +} +#Surface downward eastward stress +'surface_downward_eastward_stress' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 153 ; +} +#Surface downward northward stress +'surface_downward_northward_stress' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 154 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.def b/definitions/grib2/localConcepts/ecmf/cfVarName.def index da85ede9c..801bd6b5d 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.def @@ -16871,24 +16871,6 @@ parameterCategory = 151 ; parameterNumber = 128 ; } -#Sea water potential temperature -'thetao' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 129 ; - } -#Sea water practical salinity -'so' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 130 ; - } -#Upward sea water velocity -'wo' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 133 ; - } #Modulus of strain rate tensor 'mst' = { discipline = 192 ; @@ -16913,12 +16895,6 @@ parameterCategory = 151 ; parameterNumber = 137 ; } -#Sea water sigma theta -'sigmat' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 138 ; - } #Richardson number 'rn' = { discipline = 192 ; @@ -16991,18 +16967,6 @@ parameterCategory = 151 ; parameterNumber = 152 ; } -#Surface downward eastward stress -'taueo' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 153 ; - } -#Surface downward northward stress -'tauno' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 154 ; - } #Turbulent kinetic energy input 'tki' = { discipline = 192 ; @@ -17603,198 +17567,6 @@ parameterCategory = 160 ; parameterNumber = 254 ; } -#Surface geopotential -'p51.162' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 51 ; - } -#Vertical integral of temperature -'vit' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 54 ; - } -#Vertical integral of cloud liquid water -'vilw' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 56 ; - } -#Vertical integral of cloud frozen water -'viiw' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 57 ; - } -#Vertical integral of ozone -'vioz' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 58 ; - } -#Vertical integral of energy conversion -'viec' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 64 ; - } -#Vertical integral of eastward mass flux -'vimae' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 65 ; - } -#Vertical integral of northward mass flux -'viman' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 66 ; - } -#Vertical integral of eastward kinetic energy flux -'vikee' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 67 ; - } -#Vertical integral of northward kinetic energy flux -'viken' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 68 ; - } -#Vertical integral of eastward geopotential flux -'vige' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 73 ; - } -#Vertical integral of northward geopotential flux -'vign' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 74 ; - } -#Vertical integral of eastward total energy flux -'vitoee' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 75 ; - } -#Vertical integral of northward total energy flux -'vitoen' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 76 ; - } -#Vertical integral of eastward ozone flux -'vioze' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 77 ; - } -#Vertical integral of northward ozone flux -'viozn' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 78 ; - } -#Vertical integral of divergence of mass flux -'vimad' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 81 ; - } -#Vertical integral of divergence of kinetic energy flux -'viked' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 82 ; - } -#Vertical integral of divergence of thermal energy flux -'vithed' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 83 ; - } -#Vertical integral of divergence of geopotential flux -'vigd' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 85 ; - } -#Vertical integral of divergence of total energy flux -'vitoed' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 86 ; - } -#Vertical integral of divergence of ozone flux -'viozd' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 87 ; - } -#Variance of geopotential -'p206.162' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 206 ; - } -#Covariance of geopotential/temperature -'p207.162' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 207 ; - } -#Variance of temperature -'p208.162' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 208 ; - } -#Covariance of geopotential/specific humidity -'p209.162' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 209 ; - } -#Covariance of temperature/specific humidity -'p210.162' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 210 ; - } -#Variance of specific humidity -'p211.162' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 211 ; - } -#Covariance of u component/geopotential -'p212.162' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 212 ; - } -#Covariance of u component/temperature -'p213.162' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 213 ; - } -#Covariance of u component/specific humidity -'p214.162' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 214 ; - } -#Variance of u component -'p215.162' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 215 ; - } #Covariance of v component/geopotential 'p216.162' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def index 93fff7f80..4af98e981 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def @@ -1399,3 +1399,231 @@ parameterCategory = 228 ; parameterNumber = 5 ; } +#Sea water potential temperature +'thetao' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 129 ; +} +#Sea water practical salinity +'so' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 130 ; +} +#Upward sea water velocity +'wo' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 133 ; +} +#Sea water sigma theta +'sigmat' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 138 ; +} +#Surface downward eastward stress +'taueo' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 153 ; +} +#Surface downward northward stress +'tauno' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 154 ; +} +#Surface geopotential +'p51.162' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 51 ; +} +#Vertical integral of temperature +'vit' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 54 ; +} +#Vertical integral of cloud liquid water +'vilw' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 56 ; +} +#Vertical integral of cloud frozen water +'viiw' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 57 ; +} +#Vertical integral of ozone +'vioz' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 58 ; +} +#Vertical integral of energy conversion +'viec' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 64 ; +} +#Vertical integral of eastward mass flux +'vimae' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 65 ; +} +#Vertical integral of northward mass flux +'viman' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 66 ; +} +#Vertical integral of eastward kinetic energy flux +'vikee' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 67 ; +} +#Vertical integral of northward kinetic energy flux +'viken' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 68 ; +} +#Vertical integral of eastward geopotential flux +'vige' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 73 ; +} +#Vertical integral of northward geopotential flux +'vign' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 74 ; +} +#Vertical integral of eastward total energy flux +'vitoee' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 75 ; +} +#Vertical integral of northward total energy flux +'vitoen' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 76 ; +} +#Vertical integral of eastward ozone flux +'vioze' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 77 ; +} +#Vertical integral of northward ozone flux +'viozn' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 78 ; +} +#Vertical integral of divergence of mass flux +'vimad' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 81 ; +} +#Vertical integral of divergence of kinetic energy flux +'viked' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 82 ; +} +#Vertical integral of divergence of thermal energy flux +'vithed' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 83 ; +} +#Vertical integral of divergence of geopotential flux +'vigd' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 85 ; +} +#Vertical integral of divergence of total energy flux +'vitoed' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 86 ; +} +#Vertical integral of divergence of ozone flux +'viozd' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 87 ; +} +#Variance of geopotential +'p206.162' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 206 ; +} +#Covariance of geopotential/temperature +'p207.162' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 207 ; +} +#Variance of temperature +'p208.162' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 208 ; +} +#Covariance of geopotential/specific humidity +'p209.162' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 209 ; +} +#Covariance of temperature/specific humidity +'p210.162' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 210 ; +} +#Variance of specific humidity +'p211.162' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 211 ; +} +#Covariance of u component/geopotential +'p212.162' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 212 ; +} +#Covariance of u component/temperature +'p213.162' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 213 ; +} +#Covariance of u component/specific humidity +'p214.162' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 214 ; +} +#Variance of u component +'p215.162' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 215 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/name.def b/definitions/grib2/localConcepts/ecmf/name.def index 3fd5fdf95..d615c6e98 100644 --- a/definitions/grib2/localConcepts/ecmf/name.def +++ b/definitions/grib2/localConcepts/ecmf/name.def @@ -16871,24 +16871,6 @@ parameterCategory = 151 ; parameterNumber = 128 ; } -#Sea water potential temperature -'Sea water potential temperature' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 129 ; - } -#Sea water practical salinity -'Sea water practical salinity' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 130 ; - } -#Upward sea water velocity -'Upward sea water velocity' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 133 ; - } #Modulus of strain rate tensor 'Modulus of strain rate tensor' = { discipline = 192 ; @@ -16913,12 +16895,6 @@ parameterCategory = 151 ; parameterNumber = 137 ; } -#Sea water sigma theta -'Sea water sigma theta' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 138 ; - } #Richardson number 'Richardson number' = { discipline = 192 ; @@ -16991,18 +16967,6 @@ parameterCategory = 151 ; parameterNumber = 152 ; } -#Surface downward eastward stress -'Surface downward eastward stress' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 153 ; - } -#Surface downward northward stress -'Surface downward northward stress' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 154 ; - } #Turbulent kinetic energy input 'Turbulent kinetic energy input' = { discipline = 192 ; @@ -17603,198 +17567,6 @@ parameterCategory = 160 ; parameterNumber = 254 ; } -#Surface geopotential -'Surface geopotential' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 51 ; - } -#Vertical integral of temperature -'Vertical integral of temperature' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 54 ; - } -#Vertical integral of cloud liquid water -'Vertical integral of cloud liquid water' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 56 ; - } -#Vertical integral of cloud frozen water -'Vertical integral of cloud frozen water' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 57 ; - } -#Vertical integral of ozone -'Vertical integral of ozone' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 58 ; - } -#Vertical integral of energy conversion -'Vertical integral of energy conversion' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 64 ; - } -#Vertical integral of eastward mass flux -'Vertical integral of eastward mass flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 65 ; - } -#Vertical integral of northward mass flux -'Vertical integral of northward mass flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 66 ; - } -#Vertical integral of eastward kinetic energy flux -'Vertical integral of eastward kinetic energy flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 67 ; - } -#Vertical integral of northward kinetic energy flux -'Vertical integral of northward kinetic energy flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 68 ; - } -#Vertical integral of eastward geopotential flux -'Vertical integral of eastward geopotential flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 73 ; - } -#Vertical integral of northward geopotential flux -'Vertical integral of northward geopotential flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 74 ; - } -#Vertical integral of eastward total energy flux -'Vertical integral of eastward total energy flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 75 ; - } -#Vertical integral of northward total energy flux -'Vertical integral of northward total energy flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 76 ; - } -#Vertical integral of eastward ozone flux -'Vertical integral of eastward ozone flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 77 ; - } -#Vertical integral of northward ozone flux -'Vertical integral of northward ozone flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 78 ; - } -#Vertical integral of divergence of mass flux -'Vertical integral of divergence of mass flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 81 ; - } -#Vertical integral of divergence of kinetic energy flux -'Vertical integral of divergence of kinetic energy flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 82 ; - } -#Vertical integral of divergence of thermal energy flux -'Vertical integral of divergence of thermal energy flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 83 ; - } -#Vertical integral of divergence of geopotential flux -'Vertical integral of divergence of geopotential flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 85 ; - } -#Vertical integral of divergence of total energy flux -'Vertical integral of divergence of total energy flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 86 ; - } -#Vertical integral of divergence of ozone flux -'Vertical integral of divergence of ozone flux' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 87 ; - } -#Variance of geopotential -'Variance of geopotential' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 206 ; - } -#Covariance of geopotential/temperature -'Covariance of geopotential/temperature' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 207 ; - } -#Variance of temperature -'Variance of temperature' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 208 ; - } -#Covariance of geopotential/specific humidity -'Covariance of geopotential/specific humidity' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 209 ; - } -#Covariance of temperature/specific humidity -'Covariance of temperature/specific humidity' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 210 ; - } -#Variance of specific humidity -'Variance of specific humidity' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 211 ; - } -#Covariance of u component/geopotential -'Covariance of u component/geopotential' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 212 ; - } -#Covariance of u component/temperature -'Covariance of u component/temperature' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 213 ; - } -#Covariance of u component/specific humidity -'Covariance of u component/specific humidity' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 214 ; - } -#Variance of u component -'Variance of u component' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 215 ; - } #Covariance of v component/geopotential 'Covariance of v component/geopotential' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/name.legacy.def b/definitions/grib2/localConcepts/ecmf/name.legacy.def index 5881e995d..42f558b37 100644 --- a/definitions/grib2/localConcepts/ecmf/name.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/name.legacy.def @@ -1399,3 +1399,231 @@ parameterCategory = 228 ; parameterNumber = 5 ; } +#Sea water potential temperature +'Sea water potential temperature' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 129 ; +} +#Sea water practical salinity +'Sea water practical salinity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 130 ; +} +#Upward sea water velocity +'Upward sea water velocity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 133 ; +} +#Sea water sigma theta +'Sea water sigma theta' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 138 ; +} +#Surface downward eastward stress +'Surface downward eastward stress' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 153 ; +} +#Surface downward northward stress +'Surface downward northward stress' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 154 ; +} +#Surface geopotential +'Surface geopotential' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 51 ; +} +#Vertical integral of temperature +'Vertical integral of temperature' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 54 ; +} +#Vertical integral of cloud liquid water +'Vertical integral of cloud liquid water' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 56 ; +} +#Vertical integral of cloud frozen water +'Vertical integral of cloud frozen water' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 57 ; +} +#Vertical integral of ozone +'Vertical integral of ozone' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 58 ; +} +#Vertical integral of energy conversion +'Vertical integral of energy conversion' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 64 ; +} +#Vertical integral of eastward mass flux +'Vertical integral of eastward mass flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 65 ; +} +#Vertical integral of northward mass flux +'Vertical integral of northward mass flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 66 ; +} +#Vertical integral of eastward kinetic energy flux +'Vertical integral of eastward kinetic energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 67 ; +} +#Vertical integral of northward kinetic energy flux +'Vertical integral of northward kinetic energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 68 ; +} +#Vertical integral of eastward geopotential flux +'Vertical integral of eastward geopotential flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 73 ; +} +#Vertical integral of northward geopotential flux +'Vertical integral of northward geopotential flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 74 ; +} +#Vertical integral of eastward total energy flux +'Vertical integral of eastward total energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 75 ; +} +#Vertical integral of northward total energy flux +'Vertical integral of northward total energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 76 ; +} +#Vertical integral of eastward ozone flux +'Vertical integral of eastward ozone flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 77 ; +} +#Vertical integral of northward ozone flux +'Vertical integral of northward ozone flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 78 ; +} +#Vertical integral of divergence of mass flux +'Vertical integral of divergence of mass flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 81 ; +} +#Vertical integral of divergence of kinetic energy flux +'Vertical integral of divergence of kinetic energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 82 ; +} +#Vertical integral of divergence of thermal energy flux +'Vertical integral of divergence of thermal energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 83 ; +} +#Vertical integral of divergence of geopotential flux +'Vertical integral of divergence of geopotential flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 85 ; +} +#Vertical integral of divergence of total energy flux +'Vertical integral of divergence of total energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 86 ; +} +#Vertical integral of divergence of ozone flux +'Vertical integral of divergence of ozone flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 87 ; +} +#Variance of geopotential +'Variance of geopotential' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 206 ; +} +#Covariance of geopotential/temperature +'Covariance of geopotential/temperature' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 207 ; +} +#Variance of temperature +'Variance of temperature' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 208 ; +} +#Covariance of geopotential/specific humidity +'Covariance of geopotential/specific humidity' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 209 ; +} +#Covariance of temperature/specific humidity +'Covariance of temperature/specific humidity' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 210 ; +} +#Variance of specific humidity +'Variance of specific humidity' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 211 ; +} +#Covariance of u component/geopotential +'Covariance of u component/geopotential' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 212 ; +} +#Covariance of u component/temperature +'Covariance of u component/temperature' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 213 ; +} +#Covariance of u component/specific humidity +'Covariance of u component/specific humidity' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 214 ; +} +#Variance of u component +'Variance of u component' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 215 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/paramId.def b/definitions/grib2/localConcepts/ecmf/paramId.def index 4f9498d96..46c8cd040 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.def @@ -16871,24 +16871,6 @@ parameterCategory = 151 ; parameterNumber = 128 ; } -#Sea water potential temperature -'151129' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 129 ; - } -#Sea water practical salinity -'151130' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 130 ; - } -#Upward sea water velocity -'151133' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 133 ; - } #Modulus of strain rate tensor '151134' = { discipline = 192 ; @@ -16913,12 +16895,6 @@ parameterCategory = 151 ; parameterNumber = 137 ; } -#Sea water sigma theta -'151138' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 138 ; - } #Richardson number '151139' = { discipline = 192 ; @@ -16991,18 +16967,6 @@ parameterCategory = 151 ; parameterNumber = 152 ; } -#Surface downward eastward stress -'151153' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 153 ; - } -#Surface downward northward stress -'151154' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 154 ; - } #Turbulent kinetic energy input '151155' = { discipline = 192 ; @@ -17603,198 +17567,6 @@ parameterCategory = 160 ; parameterNumber = 254 ; } -#Surface geopotential -'162051' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 51 ; - } -#Vertical integral of temperature -'162054' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 54 ; - } -#Vertical integral of cloud liquid water -'162056' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 56 ; - } -#Vertical integral of cloud frozen water -'162057' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 57 ; - } -#Vertical integral of ozone -'162058' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 58 ; - } -#Vertical integral of energy conversion -'162064' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 64 ; - } -#Vertical integral of eastward mass flux -'162065' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 65 ; - } -#Vertical integral of northward mass flux -'162066' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 66 ; - } -#Vertical integral of eastward kinetic energy flux -'162067' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 67 ; - } -#Vertical integral of northward kinetic energy flux -'162068' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 68 ; - } -#Vertical integral of eastward geopotential flux -'162073' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 73 ; - } -#Vertical integral of northward geopotential flux -'162074' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 74 ; - } -#Vertical integral of eastward total energy flux -'162075' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 75 ; - } -#Vertical integral of northward total energy flux -'162076' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 76 ; - } -#Vertical integral of eastward ozone flux -'162077' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 77 ; - } -#Vertical integral of northward ozone flux -'162078' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 78 ; - } -#Vertical integral of divergence of mass flux -'162081' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 81 ; - } -#Vertical integral of divergence of kinetic energy flux -'162082' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 82 ; - } -#Vertical integral of divergence of thermal energy flux -'162083' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 83 ; - } -#Vertical integral of divergence of geopotential flux -'162085' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 85 ; - } -#Vertical integral of divergence of total energy flux -'162086' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 86 ; - } -#Vertical integral of divergence of ozone flux -'162087' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 87 ; - } -#Variance of geopotential -'162206' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 206 ; - } -#Covariance of geopotential/temperature -'162207' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 207 ; - } -#Variance of temperature -'162208' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 208 ; - } -#Covariance of geopotential/specific humidity -'162209' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 209 ; - } -#Covariance of temperature/specific humidity -'162210' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 210 ; - } -#Variance of specific humidity -'162211' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 211 ; - } -#Covariance of u component/geopotential -'162212' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 212 ; - } -#Covariance of u component/temperature -'162213' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 213 ; - } -#Covariance of u component/specific humidity -'162214' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 214 ; - } -#Variance of u component -'162215' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 215 ; - } #Covariance of v component/geopotential '162216' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def index 2326cf7b7..082896fc5 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def @@ -1399,3 +1399,231 @@ parameterCategory = 228 ; parameterNumber = 5 ; } +#Sea water potential temperature +'151129' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 129 ; +} +#Sea water practical salinity +'151130' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 130 ; +} +#Upward sea water velocity +'151133' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 133 ; +} +#Sea water sigma theta +'151138' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 138 ; +} +#Surface downward eastward stress +'151153' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 153 ; +} +#Surface downward northward stress +'151154' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 154 ; +} +#Surface geopotential +'162051' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 51 ; +} +#Vertical integral of temperature +'162054' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 54 ; +} +#Vertical integral of cloud liquid water +'162056' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 56 ; +} +#Vertical integral of cloud frozen water +'162057' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 57 ; +} +#Vertical integral of ozone +'162058' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 58 ; +} +#Vertical integral of energy conversion +'162064' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 64 ; +} +#Vertical integral of eastward mass flux +'162065' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 65 ; +} +#Vertical integral of northward mass flux +'162066' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 66 ; +} +#Vertical integral of eastward kinetic energy flux +'162067' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 67 ; +} +#Vertical integral of northward kinetic energy flux +'162068' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 68 ; +} +#Vertical integral of eastward geopotential flux +'162073' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 73 ; +} +#Vertical integral of northward geopotential flux +'162074' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 74 ; +} +#Vertical integral of eastward total energy flux +'162075' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 75 ; +} +#Vertical integral of northward total energy flux +'162076' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 76 ; +} +#Vertical integral of eastward ozone flux +'162077' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 77 ; +} +#Vertical integral of northward ozone flux +'162078' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 78 ; +} +#Vertical integral of divergence of mass flux +'162081' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 81 ; +} +#Vertical integral of divergence of kinetic energy flux +'162082' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 82 ; +} +#Vertical integral of divergence of thermal energy flux +'162083' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 83 ; +} +#Vertical integral of divergence of geopotential flux +'162085' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 85 ; +} +#Vertical integral of divergence of total energy flux +'162086' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 86 ; +} +#Vertical integral of divergence of ozone flux +'162087' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 87 ; +} +#Variance of geopotential +'162206' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 206 ; +} +#Covariance of geopotential/temperature +'162207' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 207 ; +} +#Variance of temperature +'162208' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 208 ; +} +#Covariance of geopotential/specific humidity +'162209' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 209 ; +} +#Covariance of temperature/specific humidity +'162210' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 210 ; +} +#Variance of specific humidity +'162211' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 211 ; +} +#Covariance of u component/geopotential +'162212' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 212 ; +} +#Covariance of u component/temperature +'162213' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 213 ; +} +#Covariance of u component/specific humidity +'162214' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 214 ; +} +#Variance of u component +'162215' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 215 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/shortName.def b/definitions/grib2/localConcepts/ecmf/shortName.def index 945244df8..563048c1b 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.def @@ -16871,24 +16871,6 @@ parameterCategory = 151 ; parameterNumber = 128 ; } -#Sea water potential temperature -'thetao' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 129 ; - } -#Sea water practical salinity -'so' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 130 ; - } -#Upward sea water velocity -'wo' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 133 ; - } #Modulus of strain rate tensor 'mst' = { discipline = 192 ; @@ -16913,12 +16895,6 @@ parameterCategory = 151 ; parameterNumber = 137 ; } -#Sea water sigma theta -'sigmat' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 138 ; - } #Richardson number 'rn' = { discipline = 192 ; @@ -16991,18 +16967,6 @@ parameterCategory = 151 ; parameterNumber = 152 ; } -#Surface downward eastward stress -'taueo' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 153 ; - } -#Surface downward northward stress -'tauno' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 154 ; - } #Turbulent kinetic energy input 'tki' = { discipline = 192 ; @@ -17603,198 +17567,6 @@ parameterCategory = 160 ; parameterNumber = 254 ; } -#Surface geopotential -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 51 ; - } -#Vertical integral of temperature -'vit' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 54 ; - } -#Vertical integral of cloud liquid water -'vilw' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 56 ; - } -#Vertical integral of cloud frozen water -'viiw' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 57 ; - } -#Vertical integral of ozone -'vioz' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 58 ; - } -#Vertical integral of energy conversion -'viec' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 64 ; - } -#Vertical integral of eastward mass flux -'vimae' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 65 ; - } -#Vertical integral of northward mass flux -'viman' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 66 ; - } -#Vertical integral of eastward kinetic energy flux -'vikee' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 67 ; - } -#Vertical integral of northward kinetic energy flux -'viken' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 68 ; - } -#Vertical integral of eastward geopotential flux -'vige' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 73 ; - } -#Vertical integral of northward geopotential flux -'vign' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 74 ; - } -#Vertical integral of eastward total energy flux -'vitoee' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 75 ; - } -#Vertical integral of northward total energy flux -'vitoen' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 76 ; - } -#Vertical integral of eastward ozone flux -'vioze' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 77 ; - } -#Vertical integral of northward ozone flux -'viozn' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 78 ; - } -#Vertical integral of divergence of mass flux -'vimad' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 81 ; - } -#Vertical integral of divergence of kinetic energy flux -'viked' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 82 ; - } -#Vertical integral of divergence of thermal energy flux -'vithed' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 83 ; - } -#Vertical integral of divergence of geopotential flux -'vigd' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 85 ; - } -#Vertical integral of divergence of total energy flux -'vitoed' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 86 ; - } -#Vertical integral of divergence of ozone flux -'viozd' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 87 ; - } -#Variance of geopotential -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 206 ; - } -#Covariance of geopotential/temperature -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 207 ; - } -#Variance of temperature -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 208 ; - } -#Covariance of geopotential/specific humidity -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 209 ; - } -#Covariance of temperature/specific humidity -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 210 ; - } -#Variance of specific humidity -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 211 ; - } -#Covariance of u component/geopotential -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 212 ; - } -#Covariance of u component/temperature -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 213 ; - } -#Covariance of u component/specific humidity -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 214 ; - } -#Variance of u component -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 215 ; - } #Covariance of v component/geopotential '~' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def index 69ef9ec96..a09f11b7f 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def @@ -1399,3 +1399,231 @@ parameterCategory = 228 ; parameterNumber = 5 ; } +#Sea water potential temperature +'thetao' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 129 ; +} +#Sea water practical salinity +'so' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 130 ; +} +#Upward sea water velocity +'wo' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 133 ; +} +#Sea water sigma theta +'sigmat' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 138 ; +} +#Surface downward eastward stress +'taueo' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 153 ; +} +#Surface downward northward stress +'tauno' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 154 ; +} +#Surface geopotential +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 51 ; +} +#Vertical integral of temperature +'vit' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 54 ; +} +#Vertical integral of cloud liquid water +'vilw' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 56 ; +} +#Vertical integral of cloud frozen water +'viiw' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 57 ; +} +#Vertical integral of ozone +'vioz' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 58 ; +} +#Vertical integral of energy conversion +'viec' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 64 ; +} +#Vertical integral of eastward mass flux +'vimae' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 65 ; +} +#Vertical integral of northward mass flux +'viman' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 66 ; +} +#Vertical integral of eastward kinetic energy flux +'vikee' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 67 ; +} +#Vertical integral of northward kinetic energy flux +'viken' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 68 ; +} +#Vertical integral of eastward geopotential flux +'vige' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 73 ; +} +#Vertical integral of northward geopotential flux +'vign' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 74 ; +} +#Vertical integral of eastward total energy flux +'vitoee' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 75 ; +} +#Vertical integral of northward total energy flux +'vitoen' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 76 ; +} +#Vertical integral of eastward ozone flux +'vioze' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 77 ; +} +#Vertical integral of northward ozone flux +'viozn' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 78 ; +} +#Vertical integral of divergence of mass flux +'vimad' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 81 ; +} +#Vertical integral of divergence of kinetic energy flux +'viked' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 82 ; +} +#Vertical integral of divergence of thermal energy flux +'vithed' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 83 ; +} +#Vertical integral of divergence of geopotential flux +'vigd' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 85 ; +} +#Vertical integral of divergence of total energy flux +'vitoed' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 86 ; +} +#Vertical integral of divergence of ozone flux +'viozd' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 87 ; +} +#Variance of geopotential +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 206 ; +} +#Covariance of geopotential/temperature +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 207 ; +} +#Variance of temperature +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 208 ; +} +#Covariance of geopotential/specific humidity +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 209 ; +} +#Covariance of temperature/specific humidity +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 210 ; +} +#Variance of specific humidity +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 211 ; +} +#Covariance of u component/geopotential +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 212 ; +} +#Covariance of u component/temperature +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 213 ; +} +#Covariance of u component/specific humidity +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 214 ; +} +#Variance of u component +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 215 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/units.def b/definitions/grib2/localConcepts/ecmf/units.def index d6286a028..6adc93e89 100644 --- a/definitions/grib2/localConcepts/ecmf/units.def +++ b/definitions/grib2/localConcepts/ecmf/units.def @@ -16871,24 +16871,6 @@ parameterCategory = 151 ; parameterNumber = 128 ; } -#Sea water potential temperature -'deg C' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 129 ; - } -#Sea water practical salinity -'psu' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 130 ; - } -#Upward sea water velocity -'m s**-1' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 133 ; - } #Modulus of strain rate tensor 's**-1' = { discipline = 192 ; @@ -16913,12 +16895,6 @@ parameterCategory = 151 ; parameterNumber = 137 ; } -#Sea water sigma theta -'kg m**-3' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 138 ; - } #Richardson number '~' = { discipline = 192 ; @@ -16991,18 +16967,6 @@ parameterCategory = 151 ; parameterNumber = 152 ; } -#Surface downward eastward stress -'N m**-2' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 153 ; - } -#Surface downward northward stress -'N m**-2' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 154 ; - } #Turbulent kinetic energy input 'J m**-2' = { discipline = 192 ; @@ -17603,198 +17567,6 @@ parameterCategory = 160 ; parameterNumber = 254 ; } -#Surface geopotential -'m**2 s**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 51 ; - } -#Vertical integral of temperature -'K kg m**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 54 ; - } -#Vertical integral of cloud liquid water -'kg m**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 56 ; - } -#Vertical integral of cloud frozen water -'kg m**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 57 ; - } -#Vertical integral of ozone -'kg m**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 58 ; - } -#Vertical integral of energy conversion -'W m**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 64 ; - } -#Vertical integral of eastward mass flux -'kg m**-1 s**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 65 ; - } -#Vertical integral of northward mass flux -'kg m**-1 s**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 66 ; - } -#Vertical integral of eastward kinetic energy flux -'W m**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 67 ; - } -#Vertical integral of northward kinetic energy flux -'W m**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 68 ; - } -#Vertical integral of eastward geopotential flux -'W m**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 73 ; - } -#Vertical integral of northward geopotential flux -'W m**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 74 ; - } -#Vertical integral of eastward total energy flux -'W m**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 75 ; - } -#Vertical integral of northward total energy flux -'W m**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 76 ; - } -#Vertical integral of eastward ozone flux -'kg m**-1 s**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 77 ; - } -#Vertical integral of northward ozone flux -'kg m**-1 s**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 78 ; - } -#Vertical integral of divergence of mass flux -'kg m**-2 s**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 81 ; - } -#Vertical integral of divergence of kinetic energy flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 82 ; - } -#Vertical integral of divergence of thermal energy flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 83 ; - } -#Vertical integral of divergence of geopotential flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 85 ; - } -#Vertical integral of divergence of total energy flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 86 ; - } -#Vertical integral of divergence of ozone flux -'kg m**-2 s**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 87 ; - } -#Variance of geopotential -'m**4 s**-4' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 206 ; - } -#Covariance of geopotential/temperature -'m**2 K s**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 207 ; - } -#Variance of temperature -'K**2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 208 ; - } -#Covariance of geopotential/specific humidity -'m**2 s**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 209 ; - } -#Covariance of temperature/specific humidity -'K' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 210 ; - } -#Variance of specific humidity -'~' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 211 ; - } -#Covariance of u component/geopotential -'m**3 s**-3' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 212 ; - } -#Covariance of u component/temperature -'m s**-1 K' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 213 ; - } -#Covariance of u component/specific humidity -'m s**-1' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 214 ; - } -#Variance of u component -'m**2 s**-2' = { - discipline = 192 ; - parameterCategory = 162 ; - parameterNumber = 215 ; - } #Covariance of v component/geopotential 'm**3 s**-3' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/units.legacy.def b/definitions/grib2/localConcepts/ecmf/units.legacy.def index 36fe4bb79..6094190f0 100644 --- a/definitions/grib2/localConcepts/ecmf/units.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/units.legacy.def @@ -1399,3 +1399,231 @@ parameterCategory = 228 ; parameterNumber = 5 ; } +#Sea water potential temperature +'deg C' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 129 ; +} +#Sea water practical salinity +'psu' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 130 ; +} +#Upward sea water velocity +'m s**-1' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 133 ; +} +#Sea water sigma theta +'kg m**-3' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 138 ; +} +#Surface downward eastward stress +'N m**-2' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 153 ; +} +#Surface downward northward stress +'N m**-2' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 154 ; +} +#Surface geopotential +'m**2 s**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 51 ; +} +#Vertical integral of temperature +'K kg m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 54 ; +} +#Vertical integral of cloud liquid water +'kg m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 56 ; +} +#Vertical integral of cloud frozen water +'kg m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 57 ; +} +#Vertical integral of ozone +'kg m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 58 ; +} +#Vertical integral of energy conversion +'W m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 64 ; +} +#Vertical integral of eastward mass flux +'kg m**-1 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 65 ; +} +#Vertical integral of northward mass flux +'kg m**-1 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 66 ; +} +#Vertical integral of eastward kinetic energy flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 67 ; +} +#Vertical integral of northward kinetic energy flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 68 ; +} +#Vertical integral of eastward geopotential flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 73 ; +} +#Vertical integral of northward geopotential flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 74 ; +} +#Vertical integral of eastward total energy flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 75 ; +} +#Vertical integral of northward total energy flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 76 ; +} +#Vertical integral of eastward ozone flux +'kg m**-1 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 77 ; +} +#Vertical integral of northward ozone flux +'kg m**-1 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 78 ; +} +#Vertical integral of divergence of mass flux +'kg m**-2 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 81 ; +} +#Vertical integral of divergence of kinetic energy flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 82 ; +} +#Vertical integral of divergence of thermal energy flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 83 ; +} +#Vertical integral of divergence of geopotential flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 85 ; +} +#Vertical integral of divergence of total energy flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 86 ; +} +#Vertical integral of divergence of ozone flux +'kg m**-2 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 87 ; +} +#Variance of geopotential +'m**4 s**-4' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 206 ; +} +#Covariance of geopotential/temperature +'m**2 K s**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 207 ; +} +#Variance of temperature +'K**2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 208 ; +} +#Covariance of geopotential/specific humidity +'m**2 s**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 209 ; +} +#Covariance of temperature/specific humidity +'K' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 210 ; +} +#Variance of specific humidity +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 211 ; +} +#Covariance of u component/geopotential +'m**3 s**-3' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 212 ; +} +#Covariance of u component/temperature +'m s**-1 K' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 213 ; +} +#Covariance of u component/specific humidity +'m s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 214 ; +} +#Variance of u component +'m**2 s**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 215 ; +} diff --git a/definitions/grib2/localConcepts/era/cfName.def b/definitions/grib2/localConcepts/era/cfName.def new file mode 100644 index 000000000..f4a8abea5 --- /dev/null +++ b/definitions/grib2/localConcepts/era/cfName.def @@ -0,0 +1,72 @@ +# Automatically generated by ./create_def.pl, do not edit +#Geopotential +'geopotential' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Temperature +'air_temperature' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific humidity +'specific_humidity' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Vertical velocity +'lagrangian_tendency_of_air_pressure' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } +#Snow depth +'lwe_thickness_of_surface_snow_amount' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Sea water potential temperature +'sea_water_potential_temperature' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 129 ; + } +#Sea water practical salinity +'sea_water_practical_salinity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 130 ; + } +#Upward sea water velocity +'upward_sea_water_velocity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 133 ; + } +#Sea water sigma theta +'sea_water_sigma_theta' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 138 ; + } +#Surface downward eastward stress +'surface_downward_eastward_stress' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 153 ; + } +#Surface downward northward stress +'surface_downward_northward_stress' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 154 ; +} diff --git a/definitions/grib2/localConcepts/era/name.def b/definitions/grib2/localConcepts/era/name.def new file mode 100644 index 000000000..4d2ad4109 --- /dev/null +++ b/definitions/grib2/localConcepts/era/name.def @@ -0,0 +1,716 @@ +# Automatically generated by ./create_def.pl, do not edit +#Geopotential +'Geopotential' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Temperature +'Temperature' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific humidity +'Specific humidity' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Vertical velocity +'Vertical velocity' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } +#Logarithm of surface pressure +'Logarithm of surface pressure' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 105 ; + } +#Temperature difference +'Temperature difference' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 130 ; + } +#Specific humidity difference +'Specific humidity difference' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 133 ; + } +#Vorticity (relative) difference +'Vorticity (relative) difference' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 138 ; + } +#Logarithm of surface pressure difference +'Logarithm of surface pressure difference' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 152 ; + } +#Divergence difference +'Divergence difference' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 155 ; + } +#Ozone mass mixing ratio difference +'Ozone mass mixing ratio difference' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 203 ; + } +#Snow depth +'Snow depth' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Random pattern 1 for sppt +'Random pattern 1 for sppt' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 1 ; + } +#Random pattern 2 for sppt +'Random pattern 2 for sppt' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 2 ; + } +#Random pattern 3 for sppt +'Random pattern 3 for sppt' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 3 ; + } +#Random pattern 1 for SPP scheme +'Random pattern 1 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 101 ; + } +#Random pattern 2 for SPP scheme +'Random pattern 2 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 102 ; + } +#Random pattern 3 for SPP scheme +'Random pattern 3 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 103 ; + } +#Random pattern 4 for SPP scheme +'Random pattern 4 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 104 ; + } +#Random pattern 5 for SPP scheme +'Random pattern 5 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 105 ; + } +#Random pattern 6 for SPP scheme +'Random pattern 6 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 106 ; + } +#Random pattern 7 for SPP scheme +'Random pattern 7 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 107 ; + } +#Random pattern 8 for SPP scheme +'Random pattern 8 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 108 ; + } +#Random pattern 9 for SPP scheme +'Random pattern 9 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 109 ; + } +#Random pattern 10 for SPP scheme +'Random pattern 10 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 110 ; + } +#Random pattern 11 for SPP scheme +'Random pattern 11 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 111 ; + } +#Random pattern 12 for SPP scheme +'Random pattern 12 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 112 ; + } +#Random pattern 13 for SPP scheme +'Random pattern 13 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 113 ; + } +#Random pattern 14 for SPP scheme +'Random pattern 14 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 114 ; + } +#Random pattern 15 for SPP scheme +'Random pattern 15 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 115 ; + } +#Random pattern 16 for SPP scheme +'Random pattern 16 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 116 ; + } +#Random pattern 17 for SPP scheme +'Random pattern 17 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 117 ; + } +#Random pattern 18 for SPP scheme +'Random pattern 18 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 118 ; + } +#Random pattern 19 for SPP scheme +'Random pattern 19 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 119 ; + } +#Random pattern 20 for SPP scheme +'Random pattern 20 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 120 ; + } +#Random pattern 21 for SPP scheme +'Random pattern 21 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 121 ; + } +#Random pattern 22 for SPP scheme +'Random pattern 22 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 122 ; + } +#Random pattern 23 for SPP scheme +'Random pattern 23 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 123 ; + } +#Random pattern 24 for SPP scheme +'Random pattern 24 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 124 ; + } +#Random pattern 25 for SPP scheme +'Random pattern 25 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 125 ; + } +#Random pattern 26 for SPP scheme +'Random pattern 26 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 126 ; + } +#Random pattern 27 for SPP scheme +'Random pattern 27 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 127 ; + } +#Random pattern 28 for SPP scheme +'Random pattern 28 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 128 ; + } +#Random pattern 29 for SPP scheme +'Random pattern 29 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 129 ; + } +#Random pattern 30 for SPP scheme +'Random pattern 30 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 130 ; + } +#Random pattern 31 for SPP scheme +'Random pattern 31 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 131 ; + } +#Random pattern 32 for SPP scheme +'Random pattern 32 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 132 ; + } +#Random pattern 33 for SPP scheme +'Random pattern 33 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 133 ; + } +#Random pattern 34 for SPP scheme +'Random pattern 34 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 134 ; + } +#Random pattern 35 for SPP scheme +'Random pattern 35 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 135 ; + } +#Random pattern 36 for SPP scheme +'Random pattern 36 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 136 ; + } +#Random pattern 37 for SPP scheme +'Random pattern 37 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 137 ; + } +#Random pattern 38 for SPP scheme +'Random pattern 38 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 138 ; + } +#Random pattern 39 for SPP scheme +'Random pattern 39 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 139 ; + } +#Random pattern 40 for SPP scheme +'Random pattern 40 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 140 ; + } +#Random pattern 41 for SPP scheme +'Random pattern 41 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 141 ; + } +#Random pattern 42 for SPP scheme +'Random pattern 42 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 142 ; + } +#Random pattern 43 for SPP scheme +'Random pattern 43 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 143 ; + } +#Random pattern 44 for SPP scheme +'Random pattern 44 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 144 ; + } +#Random pattern 45 for SPP scheme +'Random pattern 45 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 145 ; + } +#Random pattern 46 for SPP scheme +'Random pattern 46 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 146 ; + } +#Random pattern 47 for SPP scheme +'Random pattern 47 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 147 ; + } +#Random pattern 48 for SPP scheme +'Random pattern 48 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 148 ; + } +#Random pattern 49 for SPP scheme +'Random pattern 49 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 149 ; + } +#Random pattern 50 for SPP scheme +'Random pattern 50 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 150 ; + } +#Random pattern 51 for SPP scheme +'Random pattern 51 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 151 ; + } +#Random pattern 52 for SPP scheme +'Random pattern 52 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 152 ; + } +#Random pattern 53 for SPP scheme +'Random pattern 53 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 153 ; + } +#Random pattern 54 for SPP scheme +'Random pattern 54 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 154 ; + } +#Random pattern 55 for SPP scheme +'Random pattern 55 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 155 ; + } +#Random pattern 56 for SPP scheme +'Random pattern 56 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 156 ; + } +#Random pattern 57 for SPP scheme +'Random pattern 57 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 157 ; + } +#Random pattern 58 for SPP scheme +'Random pattern 58 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 158 ; + } +#Random pattern 59 for SPP scheme +'Random pattern 59 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 159 ; + } +#Random pattern 60 for SPP scheme +'Random pattern 60 for SPP scheme' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 160 ; + } +#Evaporation from the top of canopy +'Evaporation from the top of canopy' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 100 ; + } +#Evaporation from bare soil +'Evaporation from bare soil' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 101 ; + } +#Evaporation from open water surfaces excluding oceans +'Evaporation from open water surfaces excluding oceans' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 102 ; + } +#Evaporation from vegetation transpiration +'Evaporation from vegetation transpiration' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 103 ; + } +#Snow cover +'Snow cover' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Sea water potential temperature +'Sea water potential temperature' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 129 ; + } +#Sea water practical salinity +'Sea water practical salinity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 130 ; + } +#Upward sea water velocity +'Upward sea water velocity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 133 ; + } +#Sea water sigma theta +'Sea water sigma theta' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 138 ; + } +#Surface downward eastward stress +'Surface downward eastward stress' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 153 ; + } +#Surface downward northward stress +'Surface downward northward stress' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 154 ; + } +#Surface geopotential +'Surface geopotential' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 51 ; + } +#Vertical integral of temperature +'Vertical integral of temperature' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 54 ; + } +#Vertical integral of cloud liquid water +'Vertical integral of cloud liquid water' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 56 ; + } +#Vertical integral of cloud frozen water +'Vertical integral of cloud frozen water' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 57 ; + } +#Vertical integral of ozone +'Vertical integral of ozone' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 58 ; + } +#Vertical integral of energy conversion +'Vertical integral of energy conversion' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 64 ; + } +#Vertical integral of eastward mass flux +'Vertical integral of eastward mass flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 65 ; + } +#Vertical integral of northward mass flux +'Vertical integral of northward mass flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 66 ; + } +#Vertical integral of eastward kinetic energy flux +'Vertical integral of eastward kinetic energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 67 ; + } +#Vertical integral of northward kinetic energy flux +'Vertical integral of northward kinetic energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 68 ; + } +#Vertical integral of eastward geopotential flux +'Vertical integral of eastward geopotential flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 73 ; + } +#Vertical integral of northward geopotential flux +'Vertical integral of northward geopotential flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 74 ; + } +#Vertical integral of eastward total energy flux +'Vertical integral of eastward total energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 75 ; + } +#Vertical integral of northward total energy flux +'Vertical integral of northward total energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 76 ; + } +#Vertical integral of eastward ozone flux +'Vertical integral of eastward ozone flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 77 ; + } +#Vertical integral of northward ozone flux +'Vertical integral of northward ozone flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 78 ; + } +#Vertical integral of divergence of mass flux +'Vertical integral of divergence of mass flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 81 ; + } +#Vertical integral of divergence of kinetic energy flux +'Vertical integral of divergence of kinetic energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 82 ; + } +#Vertical integral of divergence of thermal energy flux +'Vertical integral of divergence of thermal energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 83 ; + } +#Vertical integral of divergence of geopotential flux +'Vertical integral of divergence of geopotential flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 85 ; + } +#Vertical integral of divergence of total energy flux +'Vertical integral of divergence of total energy flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 86 ; + } +#Vertical integral of divergence of ozone flux +'Vertical integral of divergence of ozone flux' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 87 ; + } +#Variance of geopotential +'Variance of geopotential' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 206 ; + } +#Covariance of geopotential/temperature +'Covariance of geopotential/temperature' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 207 ; + } +#Variance of temperature +'Variance of temperature' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 208 ; + } +#Covariance of geopotential/specific humidity +'Covariance of geopotential/specific humidity' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 209 ; + } +#Covariance of temperature/specific humidity +'Covariance of temperature/specific humidity' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 210 ; + } +#Variance of specific humidity +'Variance of specific humidity' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 211 ; + } +#Covariance of u component/geopotential +'Covariance of u component/geopotential' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 212 ; + } +#Covariance of u component/temperature +'Covariance of u component/temperature' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 213 ; + } +#Covariance of u component/specific humidity +'Covariance of u component/specific humidity' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 214 ; + } +#Variance of u component +'Variance of u component' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 215 ; +} diff --git a/definitions/grib2/localConcepts/era/paramId.def b/definitions/grib2/localConcepts/era/paramId.def new file mode 100644 index 000000000..7b3a0ca44 --- /dev/null +++ b/definitions/grib2/localConcepts/era/paramId.def @@ -0,0 +1,716 @@ +# Automatically generated by ./create_def.pl, do not edit +#Geopotential +'129' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Temperature +'130' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific humidity +'133' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Vertical velocity +'135' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } +#Logarithm of surface pressure +'152' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 105 ; + } +#Temperature difference +'200130' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 130 ; + } +#Specific humidity difference +'200133' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 133 ; + } +#Vorticity (relative) difference +'200138' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 138 ; + } +#Logarithm of surface pressure difference +'200152' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 152 ; + } +#Divergence difference +'200155' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 155 ; + } +#Ozone mass mixing ratio difference +'200203' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 203 ; + } +#Snow depth +'3066' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Random pattern 1 for sppt +'213001' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 1 ; + } +#Random pattern 2 for sppt +'213002' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 2 ; + } +#Random pattern 3 for sppt +'213003' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 3 ; + } +#Random pattern 1 for SPP scheme +'213101' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 101 ; + } +#Random pattern 2 for SPP scheme +'213102' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 102 ; + } +#Random pattern 3 for SPP scheme +'213103' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 103 ; + } +#Random pattern 4 for SPP scheme +'213104' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 104 ; + } +#Random pattern 5 for SPP scheme +'213105' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 105 ; + } +#Random pattern 6 for SPP scheme +'213106' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 106 ; + } +#Random pattern 7 for SPP scheme +'213107' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 107 ; + } +#Random pattern 8 for SPP scheme +'213108' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 108 ; + } +#Random pattern 9 for SPP scheme +'213109' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 109 ; + } +#Random pattern 10 for SPP scheme +'213110' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 110 ; + } +#Random pattern 11 for SPP scheme +'213111' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 111 ; + } +#Random pattern 12 for SPP scheme +'213112' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 112 ; + } +#Random pattern 13 for SPP scheme +'213113' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 113 ; + } +#Random pattern 14 for SPP scheme +'213114' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 114 ; + } +#Random pattern 15 for SPP scheme +'213115' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 115 ; + } +#Random pattern 16 for SPP scheme +'213116' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 116 ; + } +#Random pattern 17 for SPP scheme +'213117' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 117 ; + } +#Random pattern 18 for SPP scheme +'213118' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 118 ; + } +#Random pattern 19 for SPP scheme +'213119' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 119 ; + } +#Random pattern 20 for SPP scheme +'213120' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 120 ; + } +#Random pattern 21 for SPP scheme +'213121' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 121 ; + } +#Random pattern 22 for SPP scheme +'213122' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 122 ; + } +#Random pattern 23 for SPP scheme +'213123' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 123 ; + } +#Random pattern 24 for SPP scheme +'213124' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 124 ; + } +#Random pattern 25 for SPP scheme +'213125' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 125 ; + } +#Random pattern 26 for SPP scheme +'213126' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 126 ; + } +#Random pattern 27 for SPP scheme +'213127' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 127 ; + } +#Random pattern 28 for SPP scheme +'213128' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 128 ; + } +#Random pattern 29 for SPP scheme +'213129' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 129 ; + } +#Random pattern 30 for SPP scheme +'213130' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 130 ; + } +#Random pattern 31 for SPP scheme +'213131' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 131 ; + } +#Random pattern 32 for SPP scheme +'213132' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 132 ; + } +#Random pattern 33 for SPP scheme +'213133' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 133 ; + } +#Random pattern 34 for SPP scheme +'213134' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 134 ; + } +#Random pattern 35 for SPP scheme +'213135' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 135 ; + } +#Random pattern 36 for SPP scheme +'213136' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 136 ; + } +#Random pattern 37 for SPP scheme +'213137' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 137 ; + } +#Random pattern 38 for SPP scheme +'213138' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 138 ; + } +#Random pattern 39 for SPP scheme +'213139' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 139 ; + } +#Random pattern 40 for SPP scheme +'213140' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 140 ; + } +#Random pattern 41 for SPP scheme +'213141' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 141 ; + } +#Random pattern 42 for SPP scheme +'213142' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 142 ; + } +#Random pattern 43 for SPP scheme +'213143' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 143 ; + } +#Random pattern 44 for SPP scheme +'213144' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 144 ; + } +#Random pattern 45 for SPP scheme +'213145' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 145 ; + } +#Random pattern 46 for SPP scheme +'213146' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 146 ; + } +#Random pattern 47 for SPP scheme +'213147' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 147 ; + } +#Random pattern 48 for SPP scheme +'213148' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 148 ; + } +#Random pattern 49 for SPP scheme +'213149' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 149 ; + } +#Random pattern 50 for SPP scheme +'213150' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 150 ; + } +#Random pattern 51 for SPP scheme +'213151' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 151 ; + } +#Random pattern 52 for SPP scheme +'213152' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 152 ; + } +#Random pattern 53 for SPP scheme +'213153' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 153 ; + } +#Random pattern 54 for SPP scheme +'213154' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 154 ; + } +#Random pattern 55 for SPP scheme +'213155' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 155 ; + } +#Random pattern 56 for SPP scheme +'213156' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 156 ; + } +#Random pattern 57 for SPP scheme +'213157' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 157 ; + } +#Random pattern 58 for SPP scheme +'213158' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 158 ; + } +#Random pattern 59 for SPP scheme +'213159' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 159 ; + } +#Random pattern 60 for SPP scheme +'213160' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 160 ; + } +#Evaporation from the top of canopy +'228100' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 100 ; + } +#Evaporation from bare soil +'228101' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 101 ; + } +#Evaporation from open water surfaces excluding oceans +'228102' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 102 ; + } +#Evaporation from vegetation transpiration +'228103' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 103 ; + } +#Snow cover +'260038' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Sea water potential temperature +'151129' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 129 ; + } +#Sea water practical salinity +'151130' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 130 ; + } +#Upward sea water velocity +'151133' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 133 ; + } +#Sea water sigma theta +'151138' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 138 ; + } +#Surface downward eastward stress +'151153' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 153 ; + } +#Surface downward northward stress +'151154' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 154 ; + } +#Surface geopotential +'162051' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 51 ; + } +#Vertical integral of temperature +'162054' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 54 ; + } +#Vertical integral of cloud liquid water +'162056' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 56 ; + } +#Vertical integral of cloud frozen water +'162057' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 57 ; + } +#Vertical integral of ozone +'162058' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 58 ; + } +#Vertical integral of energy conversion +'162064' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 64 ; + } +#Vertical integral of eastward mass flux +'162065' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 65 ; + } +#Vertical integral of northward mass flux +'162066' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 66 ; + } +#Vertical integral of eastward kinetic energy flux +'162067' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 67 ; + } +#Vertical integral of northward kinetic energy flux +'162068' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 68 ; + } +#Vertical integral of eastward geopotential flux +'162073' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 73 ; + } +#Vertical integral of northward geopotential flux +'162074' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 74 ; + } +#Vertical integral of eastward total energy flux +'162075' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 75 ; + } +#Vertical integral of northward total energy flux +'162076' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 76 ; + } +#Vertical integral of eastward ozone flux +'162077' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 77 ; + } +#Vertical integral of northward ozone flux +'162078' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 78 ; + } +#Vertical integral of divergence of mass flux +'162081' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 81 ; + } +#Vertical integral of divergence of kinetic energy flux +'162082' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 82 ; + } +#Vertical integral of divergence of thermal energy flux +'162083' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 83 ; + } +#Vertical integral of divergence of geopotential flux +'162085' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 85 ; + } +#Vertical integral of divergence of total energy flux +'162086' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 86 ; + } +#Vertical integral of divergence of ozone flux +'162087' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 87 ; + } +#Variance of geopotential +'162206' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 206 ; + } +#Covariance of geopotential/temperature +'162207' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 207 ; + } +#Variance of temperature +'162208' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 208 ; + } +#Covariance of geopotential/specific humidity +'162209' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 209 ; + } +#Covariance of temperature/specific humidity +'162210' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 210 ; + } +#Variance of specific humidity +'162211' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 211 ; + } +#Covariance of u component/geopotential +'162212' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 212 ; + } +#Covariance of u component/temperature +'162213' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 213 ; + } +#Covariance of u component/specific humidity +'162214' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 214 ; + } +#Variance of u component +'162215' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 215 ; +} diff --git a/definitions/grib2/localConcepts/era/shortName.def b/definitions/grib2/localConcepts/era/shortName.def new file mode 100644 index 000000000..5deb9835b --- /dev/null +++ b/definitions/grib2/localConcepts/era/shortName.def @@ -0,0 +1,716 @@ +# Automatically generated by ./create_def.pl, do not edit +#Geopotential +'z' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Temperature +'t' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific humidity +'q' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Vertical velocity +'w' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } +#Logarithm of surface pressure +'lnsp' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 105 ; + } +#Temperature difference +'tdiff' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 130 ; + } +#Specific humidity difference +'qdiff' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 133 ; + } +#Vorticity (relative) difference +'vodiff' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 138 ; + } +#Logarithm of surface pressure difference +'lnspdiff' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 152 ; + } +#Divergence difference +'ddiff' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 155 ; + } +#Ozone mass mixing ratio difference +'o3diff' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 203 ; + } +#Snow depth +'sde' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Random pattern 1 for sppt +'sppt1' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 1 ; + } +#Random pattern 2 for sppt +'sppt2' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 2 ; + } +#Random pattern 3 for sppt +'sppt3' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 3 ; + } +#Random pattern 1 for SPP scheme +'spp1' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 101 ; + } +#Random pattern 2 for SPP scheme +'spp2' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 102 ; + } +#Random pattern 3 for SPP scheme +'spp3' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 103 ; + } +#Random pattern 4 for SPP scheme +'spp4' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 104 ; + } +#Random pattern 5 for SPP scheme +'spp5' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 105 ; + } +#Random pattern 6 for SPP scheme +'spp6' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 106 ; + } +#Random pattern 7 for SPP scheme +'spp7' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 107 ; + } +#Random pattern 8 for SPP scheme +'spp8' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 108 ; + } +#Random pattern 9 for SPP scheme +'spp9' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 109 ; + } +#Random pattern 10 for SPP scheme +'spp10' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 110 ; + } +#Random pattern 11 for SPP scheme +'spp11' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 111 ; + } +#Random pattern 12 for SPP scheme +'spp12' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 112 ; + } +#Random pattern 13 for SPP scheme +'spp13' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 113 ; + } +#Random pattern 14 for SPP scheme +'spp14' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 114 ; + } +#Random pattern 15 for SPP scheme +'spp15' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 115 ; + } +#Random pattern 16 for SPP scheme +'spp16' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 116 ; + } +#Random pattern 17 for SPP scheme +'spp17' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 117 ; + } +#Random pattern 18 for SPP scheme +'spp18' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 118 ; + } +#Random pattern 19 for SPP scheme +'spp19' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 119 ; + } +#Random pattern 20 for SPP scheme +'spp20' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 120 ; + } +#Random pattern 21 for SPP scheme +'spp21' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 121 ; + } +#Random pattern 22 for SPP scheme +'spp22' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 122 ; + } +#Random pattern 23 for SPP scheme +'spp23' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 123 ; + } +#Random pattern 24 for SPP scheme +'spp24' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 124 ; + } +#Random pattern 25 for SPP scheme +'spp25' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 125 ; + } +#Random pattern 26 for SPP scheme +'spp26' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 126 ; + } +#Random pattern 27 for SPP scheme +'spp27' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 127 ; + } +#Random pattern 28 for SPP scheme +'spp28' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 128 ; + } +#Random pattern 29 for SPP scheme +'spp29' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 129 ; + } +#Random pattern 30 for SPP scheme +'spp30' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 130 ; + } +#Random pattern 31 for SPP scheme +'spp31' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 131 ; + } +#Random pattern 32 for SPP scheme +'spp32' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 132 ; + } +#Random pattern 33 for SPP scheme +'spp33' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 133 ; + } +#Random pattern 34 for SPP scheme +'spp34' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 134 ; + } +#Random pattern 35 for SPP scheme +'spp35' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 135 ; + } +#Random pattern 36 for SPP scheme +'spp36' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 136 ; + } +#Random pattern 37 for SPP scheme +'spp37' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 137 ; + } +#Random pattern 38 for SPP scheme +'spp38' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 138 ; + } +#Random pattern 39 for SPP scheme +'spp39' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 139 ; + } +#Random pattern 40 for SPP scheme +'spp40' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 140 ; + } +#Random pattern 41 for SPP scheme +'spp41' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 141 ; + } +#Random pattern 42 for SPP scheme +'spp42' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 142 ; + } +#Random pattern 43 for SPP scheme +'spp43' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 143 ; + } +#Random pattern 44 for SPP scheme +'spp44' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 144 ; + } +#Random pattern 45 for SPP scheme +'spp45' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 145 ; + } +#Random pattern 46 for SPP scheme +'spp46' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 146 ; + } +#Random pattern 47 for SPP scheme +'spp47' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 147 ; + } +#Random pattern 48 for SPP scheme +'spp48' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 148 ; + } +#Random pattern 49 for SPP scheme +'spp49' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 149 ; + } +#Random pattern 50 for SPP scheme +'spp50' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 150 ; + } +#Random pattern 51 for SPP scheme +'spp51' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 151 ; + } +#Random pattern 52 for SPP scheme +'spp52' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 152 ; + } +#Random pattern 53 for SPP scheme +'spp53' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 153 ; + } +#Random pattern 54 for SPP scheme +'spp54' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 154 ; + } +#Random pattern 55 for SPP scheme +'spp55' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 155 ; + } +#Random pattern 56 for SPP scheme +'spp56' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 156 ; + } +#Random pattern 57 for SPP scheme +'spp57' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 157 ; + } +#Random pattern 58 for SPP scheme +'spp58' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 158 ; + } +#Random pattern 59 for SPP scheme +'spp59' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 159 ; + } +#Random pattern 60 for SPP scheme +'spp60' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 160 ; + } +#Evaporation from the top of canopy +'evatc' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 100 ; + } +#Evaporation from bare soil +'evabs' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 101 ; + } +#Evaporation from open water surfaces excluding oceans +'evaow' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 102 ; + } +#Evaporation from vegetation transpiration +'evavt' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 103 ; + } +#Snow cover +'snowc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Sea water potential temperature +'thetao' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 129 ; + } +#Sea water practical salinity +'so' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 130 ; + } +#Upward sea water velocity +'wo' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 133 ; + } +#Sea water sigma theta +'sigmat' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 138 ; + } +#Surface downward eastward stress +'taueo' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 153 ; + } +#Surface downward northward stress +'tauno' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 154 ; + } +#Surface geopotential +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 51 ; + } +#Vertical integral of temperature +'vit' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 54 ; + } +#Vertical integral of cloud liquid water +'vilw' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 56 ; + } +#Vertical integral of cloud frozen water +'viiw' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 57 ; + } +#Vertical integral of ozone +'vioz' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 58 ; + } +#Vertical integral of energy conversion +'viec' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 64 ; + } +#Vertical integral of eastward mass flux +'vimae' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 65 ; + } +#Vertical integral of northward mass flux +'viman' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 66 ; + } +#Vertical integral of eastward kinetic energy flux +'vikee' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 67 ; + } +#Vertical integral of northward kinetic energy flux +'viken' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 68 ; + } +#Vertical integral of eastward geopotential flux +'vige' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 73 ; + } +#Vertical integral of northward geopotential flux +'vign' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 74 ; + } +#Vertical integral of eastward total energy flux +'vitoee' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 75 ; + } +#Vertical integral of northward total energy flux +'vitoen' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 76 ; + } +#Vertical integral of eastward ozone flux +'vioze' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 77 ; + } +#Vertical integral of northward ozone flux +'viozn' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 78 ; + } +#Vertical integral of divergence of mass flux +'vimad' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 81 ; + } +#Vertical integral of divergence of kinetic energy flux +'viked' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 82 ; + } +#Vertical integral of divergence of thermal energy flux +'vithed' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 83 ; + } +#Vertical integral of divergence of geopotential flux +'vigd' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 85 ; + } +#Vertical integral of divergence of total energy flux +'vitoed' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 86 ; + } +#Vertical integral of divergence of ozone flux +'viozd' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 87 ; + } +#Variance of geopotential +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 206 ; + } +#Covariance of geopotential/temperature +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 207 ; + } +#Variance of temperature +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 208 ; + } +#Covariance of geopotential/specific humidity +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 209 ; + } +#Covariance of temperature/specific humidity +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 210 ; + } +#Variance of specific humidity +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 211 ; + } +#Covariance of u component/geopotential +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 212 ; + } +#Covariance of u component/temperature +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 213 ; + } +#Covariance of u component/specific humidity +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 214 ; + } +#Variance of u component +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 215 ; +} diff --git a/definitions/grib2/localConcepts/era/units.def b/definitions/grib2/localConcepts/era/units.def new file mode 100644 index 000000000..f24cf39be --- /dev/null +++ b/definitions/grib2/localConcepts/era/units.def @@ -0,0 +1,716 @@ +# Automatically generated by ./create_def.pl, do not edit +#Geopotential +'m**2 s**-2' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Temperature +'K' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific humidity +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Vertical velocity +'Pa s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } +#Logarithm of surface pressure +'Numeric' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 105 ; + } +#Temperature difference +'K' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 130 ; + } +#Specific humidity difference +'kg kg**-1' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 133 ; + } +#Vorticity (relative) difference +'s**-1' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 138 ; + } +#Logarithm of surface pressure difference +'kg m**-2' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 152 ; + } +#Divergence difference +'s**-1' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 155 ; + } +#Ozone mass mixing ratio difference +'kg kg**-1' = { + discipline = 192 ; + parameterCategory = 200 ; + parameterNumber = 203 ; + } +#Snow depth +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Random pattern 1 for sppt +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 1 ; + } +#Random pattern 2 for sppt +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 2 ; + } +#Random pattern 3 for sppt +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 3 ; + } +#Random pattern 1 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 101 ; + } +#Random pattern 2 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 102 ; + } +#Random pattern 3 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 103 ; + } +#Random pattern 4 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 104 ; + } +#Random pattern 5 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 105 ; + } +#Random pattern 6 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 106 ; + } +#Random pattern 7 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 107 ; + } +#Random pattern 8 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 108 ; + } +#Random pattern 9 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 109 ; + } +#Random pattern 10 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 110 ; + } +#Random pattern 11 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 111 ; + } +#Random pattern 12 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 112 ; + } +#Random pattern 13 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 113 ; + } +#Random pattern 14 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 114 ; + } +#Random pattern 15 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 115 ; + } +#Random pattern 16 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 116 ; + } +#Random pattern 17 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 117 ; + } +#Random pattern 18 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 118 ; + } +#Random pattern 19 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 119 ; + } +#Random pattern 20 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 120 ; + } +#Random pattern 21 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 121 ; + } +#Random pattern 22 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 122 ; + } +#Random pattern 23 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 123 ; + } +#Random pattern 24 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 124 ; + } +#Random pattern 25 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 125 ; + } +#Random pattern 26 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 126 ; + } +#Random pattern 27 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 127 ; + } +#Random pattern 28 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 128 ; + } +#Random pattern 29 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 129 ; + } +#Random pattern 30 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 130 ; + } +#Random pattern 31 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 131 ; + } +#Random pattern 32 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 132 ; + } +#Random pattern 33 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 133 ; + } +#Random pattern 34 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 134 ; + } +#Random pattern 35 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 135 ; + } +#Random pattern 36 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 136 ; + } +#Random pattern 37 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 137 ; + } +#Random pattern 38 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 138 ; + } +#Random pattern 39 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 139 ; + } +#Random pattern 40 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 140 ; + } +#Random pattern 41 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 141 ; + } +#Random pattern 42 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 142 ; + } +#Random pattern 43 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 143 ; + } +#Random pattern 44 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 144 ; + } +#Random pattern 45 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 145 ; + } +#Random pattern 46 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 146 ; + } +#Random pattern 47 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 147 ; + } +#Random pattern 48 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 148 ; + } +#Random pattern 49 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 149 ; + } +#Random pattern 50 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 150 ; + } +#Random pattern 51 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 151 ; + } +#Random pattern 52 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 152 ; + } +#Random pattern 53 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 153 ; + } +#Random pattern 54 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 154 ; + } +#Random pattern 55 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 155 ; + } +#Random pattern 56 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 156 ; + } +#Random pattern 57 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 157 ; + } +#Random pattern 58 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 158 ; + } +#Random pattern 59 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 159 ; + } +#Random pattern 60 for SPP scheme +'dimensionless' = { + discipline = 192 ; + parameterCategory = 213 ; + parameterNumber = 160 ; + } +#Evaporation from the top of canopy +'m of water equivalent' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 100 ; + } +#Evaporation from bare soil +'m of water equivalent' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 101 ; + } +#Evaporation from open water surfaces excluding oceans +'m of water equivalent' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 102 ; + } +#Evaporation from vegetation transpiration +'m of water equivalent' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 103 ; + } +#Snow cover +'%' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Sea water potential temperature +'deg C' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 129 ; + } +#Sea water practical salinity +'psu' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 130 ; + } +#Upward sea water velocity +'m s**-1' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 133 ; + } +#Sea water sigma theta +'kg m**-3' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 138 ; + } +#Surface downward eastward stress +'N m**-2' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 153 ; + } +#Surface downward northward stress +'N m**-2' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 154 ; + } +#Surface geopotential +'m**2 s**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 51 ; + } +#Vertical integral of temperature +'K kg m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 54 ; + } +#Vertical integral of cloud liquid water +'kg m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 56 ; + } +#Vertical integral of cloud frozen water +'kg m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 57 ; + } +#Vertical integral of ozone +'kg m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 58 ; + } +#Vertical integral of energy conversion +'W m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 64 ; + } +#Vertical integral of eastward mass flux +'kg m**-1 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 65 ; + } +#Vertical integral of northward mass flux +'kg m**-1 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 66 ; + } +#Vertical integral of eastward kinetic energy flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 67 ; + } +#Vertical integral of northward kinetic energy flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 68 ; + } +#Vertical integral of eastward geopotential flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 73 ; + } +#Vertical integral of northward geopotential flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 74 ; + } +#Vertical integral of eastward total energy flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 75 ; + } +#Vertical integral of northward total energy flux +'W m**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 76 ; + } +#Vertical integral of eastward ozone flux +'kg m**-1 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 77 ; + } +#Vertical integral of northward ozone flux +'kg m**-1 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 78 ; + } +#Vertical integral of divergence of mass flux +'kg m**-2 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 81 ; + } +#Vertical integral of divergence of kinetic energy flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 82 ; + } +#Vertical integral of divergence of thermal energy flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 83 ; + } +#Vertical integral of divergence of geopotential flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 85 ; + } +#Vertical integral of divergence of total energy flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 86 ; + } +#Vertical integral of divergence of ozone flux +'kg m**-2 s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 87 ; + } +#Variance of geopotential +'m**4 s**-4' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 206 ; + } +#Covariance of geopotential/temperature +'m**2 K s**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 207 ; + } +#Variance of temperature +'K**2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 208 ; + } +#Covariance of geopotential/specific humidity +'m**2 s**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 209 ; + } +#Covariance of temperature/specific humidity +'K' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 210 ; + } +#Variance of specific humidity +'~' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 211 ; + } +#Covariance of u component/geopotential +'m**3 s**-3' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 212 ; + } +#Covariance of u component/temperature +'m s**-1 K' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 213 ; + } +#Covariance of u component/specific humidity +'m s**-1' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 214 ; + } +#Variance of u component +'m**2 s**-2' = { + discipline = 192 ; + parameterCategory = 162 ; + parameterNumber = 215 ; +} diff --git a/definitions/grib2/localConcepts/uerra/cfName.def b/definitions/grib2/localConcepts/uerra/cfName.def index 4d9bdee78..3e3c697fa 100644 --- a/definitions/grib2/localConcepts/uerra/cfName.def +++ b/definitions/grib2/localConcepts/uerra/cfName.def @@ -7,6 +7,20 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Geopotential +'geopotential' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Temperature +'air_temperature' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #U component of wind 'eastward_wind' = { discipline = 0 ; @@ -21,6 +35,13 @@ parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } +#Specific humidity +'specific_humidity' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Surface pressure 'surface_air_pressure' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/cfVarName.def b/definitions/grib2/localConcepts/uerra/cfVarName.def index 342088a14..2242d96a0 100644 --- a/definitions/grib2/localConcepts/uerra/cfVarName.def +++ b/definitions/grib2/localConcepts/uerra/cfVarName.def @@ -93,6 +93,20 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Geopotential +'z' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Temperature +'t' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #U component of wind 'u' = { discipline = 0 ; @@ -107,6 +121,13 @@ parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } +#Specific humidity +'q' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Surface pressure 'sp' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/name.def b/definitions/grib2/localConcepts/uerra/name.def index 05e8b9e58..59a55bdf5 100644 --- a/definitions/grib2/localConcepts/uerra/name.def +++ b/definitions/grib2/localConcepts/uerra/name.def @@ -93,6 +93,20 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Geopotential +'Geopotential' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Temperature +'Temperature' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #U component of wind 'U component of wind' = { discipline = 0 ; @@ -107,6 +121,13 @@ parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } +#Specific humidity +'Specific humidity' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Surface pressure 'Surface pressure' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/paramId.def b/definitions/grib2/localConcepts/uerra/paramId.def index 1138be8da..8db696b0d 100644 --- a/definitions/grib2/localConcepts/uerra/paramId.def +++ b/definitions/grib2/localConcepts/uerra/paramId.def @@ -93,6 +93,20 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Geopotential +'129' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Temperature +'130' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #U component of wind '131' = { discipline = 0 ; @@ -107,6 +121,13 @@ parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } +#Specific humidity +'133' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Surface pressure '134' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/shortName.def b/definitions/grib2/localConcepts/uerra/shortName.def index 63499bec2..9eefdd1fe 100644 --- a/definitions/grib2/localConcepts/uerra/shortName.def +++ b/definitions/grib2/localConcepts/uerra/shortName.def @@ -93,6 +93,20 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Geopotential +'z' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Temperature +'t' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #U component of wind 'u' = { discipline = 0 ; @@ -107,6 +121,13 @@ parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } +#Specific humidity +'q' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Surface pressure 'sp' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/units.def b/definitions/grib2/localConcepts/uerra/units.def index 353070afd..1abfdfd20 100644 --- a/definitions/grib2/localConcepts/uerra/units.def +++ b/definitions/grib2/localConcepts/uerra/units.def @@ -93,6 +93,20 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Geopotential +'m**2 s**-2' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Temperature +'K' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #U component of wind 'm s**-1' = { discipline = 0 ; @@ -107,6 +121,13 @@ parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } +#Specific humidity +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Surface pressure 'Pa' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index c246c157f..1a0196347 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -4916,6 +4916,34 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean snow depth +'Time-mean snow depth' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow cover +'Time-mean snow cover' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean geopotential +'Time-mean geopotential' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean temperature +'Time-mean temperature' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean U component of wind 'Time-mean U component of wind' = { discipline = 0 ; @@ -4930,6 +4958,13 @@ parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific humidity +'Time-mean specific humidity' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean surface pressure 'Time-mean surface pressure' = { discipline = 0 ; @@ -4938,6 +4973,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean vertical velocity +'Time-mean vertical velocity' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean total column water 'Time-mean total column water' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index eea7c712e..55cc9a44e 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -4916,6 +4916,34 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean snow depth +'235095' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow cover +'235096' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean geopotential +'235129' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean temperature +'235130' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean U component of wind '235131' = { discipline = 0 ; @@ -4930,6 +4958,13 @@ parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific humidity +'235133' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean surface pressure '235134' = { discipline = 0 ; @@ -4938,6 +4973,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean vertical velocity +'235135' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean total column water '235136' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index b36df1705..b855a6063 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -4916,6 +4916,34 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean snow depth +'msde' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow cover +'msnowc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean geopotential +'mz' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean temperature +'mt' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean U component of wind 'mu' = { discipline = 0 ; @@ -4930,6 +4958,13 @@ parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific humidity +'mq' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean surface pressure 'msp' = { discipline = 0 ; @@ -4938,6 +4973,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean vertical velocity +'mw' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean total column water 'mtcw' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 4ba290e9b..ab472b684 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -4916,6 +4916,34 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean snow depth +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow cover +'%' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean geopotential +'m**2 s**-2' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean temperature +'K' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean U component of wind 'm s**-1' = { discipline = 0 ; @@ -4930,6 +4958,13 @@ parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific humidity +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean surface pressure 'Pa' = { discipline = 0 ; @@ -4938,6 +4973,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean vertical velocity +'Pa s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean total column water 'kg m**-2' = { discipline = 0 ; diff --git a/tests/grib_cfNames.sh b/tests/grib_cfNames.sh index 369395a00..882d38139 100755 --- a/tests/grib_cfNames.sh +++ b/tests/grib_cfNames.sh @@ -49,9 +49,9 @@ ${tools_dir}/grib_set -s indicatorOfParameter=163,table2Version=151 $sample1 $te grib_check_key_equals $temp cfName depth_of_isosurface_of_sea_water_potential_temperature -${tools_dir}/grib_set -s paramId=151154 $sample1 $temp +${tools_dir}/grib_set -s paramId=181 $sample1 $temp grib_check_key_equals $temp cfName surface_downward_northward_stress -${tools_dir}/grib_set -s paramId=151154 $sample2 $temp +${tools_dir}/grib_set -s stepType=accum,paramId=181 $sample2 $temp grib_check_key_equals $temp cfName surface_downward_northward_stress ${tools_dir}/grib_set -s discipline=192,parameterCategory=151,parameterNumber=153 $sample2 $temp grib_check_key_equals $temp cfName surface_downward_eastward_stress diff --git a/tests/grib_check_param_concepts.sh b/tests/grib_check_param_concepts.sh index 4810497c1..bf67e7ab8 100755 --- a/tests/grib_check_param_concepts.sh +++ b/tests/grib_check_param_concepts.sh @@ -26,25 +26,15 @@ fi # First check the GRIB2 paramId.def and shortName.def # ---------------------------------------------------- $EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/paramId.def -$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/ecmf/paramId.def -$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/uerra/paramId.def -$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/hydro/paramId.def -$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/cerise/paramId.def -$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/tigge/paramId.def -$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/s2s/paramId.def -$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/era6/paramId.def -$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/destine/paramId.def - +datasets="ecmf uerra cerise hydro s2s tigge era6 destine era" +for a_dataset in $datasets; do + $EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/$a_dataset/paramId.def +done $EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/shortName.def -$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/ecmf/shortName.def -$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/uerra/shortName.def -$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/hydro/shortName.def -$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/cerise/shortName.def -$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/tigge/shortName.def -$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/s2s/shortName.def -$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/era6/shortName.def -$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/destine/shortName.def +for a_dataset in $datasets; do + $EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/$a_dataset/shortName.def +done # Check the group: name.def paramId.def shortName.def units.def cfVarName.def # ---------------------------------------------------------------------------- @@ -81,6 +71,7 @@ defs_dirs=" $ECCODES_DEFINITION_PATH/grib2/localConcepts/tigge $ECCODES_DEFINITION_PATH/grib2/localConcepts/s2s $ECCODES_DEFINITION_PATH/grib2/localConcepts/era6 + $ECCODES_DEFINITION_PATH/grib2/localConcepts/era $ECCODES_DEFINITION_PATH/grib2/localConcepts/destine $ECCODES_DEFINITION_PATH/grib2/localConcepts/egrr From 02f9a17b249193a9f03464161649ce51e18a5535 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 16 Apr 2024 14:40:38 +0000 Subject: [PATCH 034/196] DGOV-461: paramDB: Create pseudo-centre for ECMWF reanalyses --- definitions/grib2/section.4.def | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/definitions/grib2/section.4.def b/definitions/grib2/section.4.def index 512544da4..0c45720b1 100644 --- a/definitions/grib2/section.4.def +++ b/definitions/grib2/section.4.def @@ -39,6 +39,15 @@ concept datasetForLocal(unknown) { "uerra" = {productionStatusOfProcessedData=11;} "destine" = {productionStatusOfProcessedData=12;} # Destination Earth "destine" = {productionStatusOfProcessedData=13;} + "era" = {marsClass="e2";} + "era" = {marsClass="e4";} + "era" = {marsClass="ea";} + "era" = {marsClass="ei";} + "era" = {marsClass="em";} + "era" = {marsClass="ep";} + "era" = {marsClass="er";} + "era" = {marsClass="et";} + "era" = {marsClass="l5";} "unknown" = { dummy=1; } } From a43c798eff7b2ba40707385cdfaa08aec88e2fef Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 16 Apr 2024 16:17:08 +0000 Subject: [PATCH 035/196] C++ modernisation: Added Fortran --- fortran/CMakeLists.txt | 2 +- fortran/{grib_fortran.c => grib_fortran.cc} | 0 fortran/grib_fortran_prototypes.h | 332 ++++++++++++++++++++ 3 files changed, 333 insertions(+), 1 deletion(-) rename fortran/{grib_fortran.c => grib_fortran.cc} (100%) create mode 100644 fortran/grib_fortran_prototypes.h diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 979ad0652..66b6e598f 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -42,7 +42,7 @@ if( HAVE_FORTRAN ) # Note: $ will be present only while building (for the whole bundle), # whereas $ is only present once you install the package / bundle ecbuild_add_library( TARGET eccodes_f90 - SOURCES grib_fortran.c grib_f90.f90 eccodes_f90.f90 grib_kinds.h + SOURCES grib_fortran.cc grib_f90.f90 eccodes_f90.f90 grib_kinds.h GENERATED grib_f90.f90 eccodes_f90.f90 PUBLIC_INCLUDES $ $ diff --git a/fortran/grib_fortran.c b/fortran/grib_fortran.cc similarity index 100% rename from fortran/grib_fortran.c rename to fortran/grib_fortran.cc diff --git a/fortran/grib_fortran_prototypes.h b/fortran/grib_fortran_prototypes.h new file mode 100644 index 000000000..4eb0a313d --- /dev/null +++ b/fortran/grib_fortran_prototypes.h @@ -0,0 +1,332 @@ +/* + * Copyright 2005-2018 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. + */ + +/* grib_fortran.c */ +#ifdef __cplusplus +extern "C" { +#endif + +int grib_f_read_any_headers_only_from_file_(int *fid, char *buffer, size_t *nbytes); +int grib_f_write_file_(int* fid, void* buffer, size_t* nbytes); +int any_f_new_from_loaded_(int* msgid, int* gid); +int codes_f_bufr_copy_data_(int* gid1,int* gid2); +int grib_f_get_string_array_(int* gid, char* key, char* val,int* nvals,int* slen, int len); +int codes_f_bufr_keys_iterator_rewind_(int* kiter); +int any_f_scan_file_(int* fid, int* n); +int grib_f_new_from_message_int_(int* gid, int* buffer , size_t* bufsize); +int grib_f_copy_key_(int* gidsrc, char* key, int* giddest, int len); +int grib_f_set_samples_path_(char* path, int len); + +int grib_f_read_file(int *fid, char *buffer, size_t *nbytes); +int grib_f_open_file_(int *fid, char *name, char *op, int lname, int lop); +int grib_f_open_file__(int *fid, char *name, char *op, int lname, int lop); +int grib_f_open_file(int *fid, char *name, char *op, int lname, int lop); +int grib_f_close_file_(int *fid); +int grib_f_close_file__(int *fid); +int grib_f_close_file(int *fid); +void grib_f_write_on_fail(int *gid); +void grib_f_write_on_fail_(int* gid); +void grib_f_write_on_fail__(int* gid); +int grib_f_multi_support_on_(void); +int grib_f_multi_support_on__(void); +int grib_f_multi_support_on(void); +int grib_f_multi_support_off_(void); +int grib_f_multi_support_off__(void); +int grib_f_multi_support_off(void); +int grib_f_iterator_new_(int *gid, int *iterid, int *mode); +int grib_f_iterator_new__(int *gid, int *iterid, int *mode); +int grib_f_iterator_new(int *gid, int *iterid, int *mode); +int grib_f_iterator_next_(int *iterid, double *lat, double *lon, double *value); +int grib_f_iterator_next__(int *iterid, double *lat, double *lon, double *value); +int grib_f_iterator_next(int *iterid, double *lat, double *lon, double *value); +int grib_f_iterator_delete_(int *iterid); +int grib_f_iterator_delete__(int *iterid); +int grib_f_iterator_delete(int *iterid); +int grib_f_keys_iterator_new_(int *gid, int *iterid, char *name_space, int len); +int grib_f_keys_iterator_new__(int *gid, int *iterid, char *name_space, int len); +int grib_f_keys_iterator_new(int *gid, int *iterid, char *name_space, int len); +int grib_f_keys_iterator_next_(int *iterid); +int grib_f_keys_iterator_next__(int *iterid); +int grib_f_keys_iterator_next(int *iterid); +int grib_f_keys_iterator_delete_(int *iterid); +int grib_f_keys_iterator_delete__(int *iterid); +int grib_f_keys_iterator_delete(int *iterid); +int grib_f_gribex_mode_on_(void); +int grib_f_gribex_mode_on__(void); +int grib_f_gribex_mode_on(void); +int grib_f_gribex_mode_off_(void); +int grib_f_gribex_mode_off__(void); +int grib_f_gribex_mode_off(void); +int grib_f_skip_computed_(int *iterid); +int grib_f_skip_computed__(int *iterid); +int grib_f_skip_computed(int *iterid); +int grib_f_skip_coded_(int *iterid); +int grib_f_skip_coded__(int *iterid); +int grib_f_skip_coded(int *iterid); +int grib_f_skip_edition_specific_(int *iterid); +int grib_f_skip_edition_specific__(int *iterid); +int grib_f_skip_edition_specific(int *iterid); +int grib_f_skip_duplicates_(int *iterid); +int grib_f_skip_duplicates__(int *iterid); +int grib_f_skip_duplicates(int *iterid); +int grib_f_skip_read_only_(int *iterid); +int grib_f_skip_read_only__(int *iterid); +int grib_f_skip_read_only(int *iterid); +int grib_f_skip_function_(int *iterid); +int grib_f_skip_function__(int *iterid); +int grib_f_skip_function(int *iterid); +int grib_f_keys_iterator_get_name_(int *iterid, char *name, int len); +int grib_f_keys_iterator_get_name__(int *kiter, char *name, int len); +int grib_f_keys_iterator_get_name(int *kiter, char *name, int len); +int grib_f_keys_iterator_rewind_(int *kiter); +int grib_f_keys_iterator_rewind__(int *kiter); +int grib_f_keys_iterator_rewind(int *kiter); +int grib_f_new_from_message_(int *gid, void *buffer, size_t *bufsize); +int grib_f_new_from_message__(int *gid, void *buffer, size_t *bufsize); +int grib_f_new_from_message(int *gid, void *buffer, size_t *bufsize); +int grib_f_new_from_message_copy_(int *gid, void *buffer, size_t *bufsize); +int grib_f_new_from_message_copy__(int *gid, void *buffer, size_t *bufsize); +int grib_f_new_from_message_copy(int *gid, void *buffer, size_t *bufsize); +int grib_f_new_from_samples_(int *gid, char *name, int lname); +int grib_f_new_from_samples__(int *gid, char *name, int lname); +int grib_f_new_from_samples(int *gid, char *name, int lname); +int grib_f_new_from_template_(int *gid, char *name, int lname); +int grib_f_new_from_template__(int *gid, char *name, int lname); +int grib_f_new_from_template(int *gid, char *name, int lname); +int grib_f_clone_(int *gidsrc, int *giddest); +int grib_f_clone__(int *gidsrc, int *giddest); +int grib_f_clone(int *gidsrc, int *giddest); +int grib_f_util_sections_copy_(int *gidfrom, int *gidto, int *what, int *gidout); +int grib_f_util_sections_copy__(int *gidfrom, int *gidto, int *what, int *gidout); +int grib_f_util_sections_copy(int *gidfrom, int *gidto, int *what, int *gidout); +int grib_f_copy_namespace_(int *gidsrc, char *name, int *giddest, int len); +int grib_f_copy_namespace__(int *gidsrc, char *name, int *giddest, int len); +int grib_f_copy_namespace(int *gidsrc, char *name, int *giddest, int len); +int grib_f_count_in_file(int *fid, int *n); +int grib_f_count_in_file_(int *fid, int *n); +int grib_f_count_in_file__(int *fid, int *n); +int grib_f_new_from_file_(int *fid, int *gid); +int grib_f_new_from_file__(int *fid, int *gid); +int grib_f_new_from_file(int *fid, int *gid); +int grib_f_headers_only_new_from_file_(int *fid, int *gid); +int grib_f_headers_only_new_from_file__(int *fid, int *gid); +int grib_f_headers_only_new_from_file(int *fid, int *gid); +int grib_f_new_from_index_(int *iid, int *gid); +int grib_f_new_from_index__(int *iid, int *gid); +int grib_f_new_from_index(int *iid, int *gid); +int grib_f_index_new_from_file_(char *file, char *keys, int *gid, int lfile, int lkeys); +int grib_f_index_new_from_file__(char *file, char *keys, int *gid, int lfile, int lkeys); +int grib_f_index_new_from_file(char *file, char *keys, int *gid, int lfile, int lkeys); +int grib_f_index_add_file_(int* iid, char* file, int lfile); +int grib_f_index_add_file__(int* iid, char* file, int lfile); +int grib_f_index_add_file(int* iid, char* file, int lfile); +int grib_f_index_read_(char *file, int *gid, int lfile); +int grib_f_index_read__(char *file, int *gid, int lfile); +int grib_f_index_read(char *file, int *gid, int lfile); +int grib_f_index_write_(int *gid, char *file, int lfile); +int grib_f_index_write__(int *gid, char *file, int lfile); +int grib_f_index_write(int *gid, char *file, int lfile); +int grib_f_index_release_(int *hid); +int grib_f_index_release__(int *hid); +int grib_f_index_release(int *hid); +int grib_f_multi_handle_release_(int *hid); +int grib_f_multi_handle_release__(int *hid); +int grib_f_multi_handle_release(int *hid); +int grib_f_release_(int *hid); +int grib_f_release__(int *hid); +int grib_f_release(int *hid); +int grib_f_dump_(int *gid); +int grib_f_dump__(int *gid); +int grib_f_dump(int *gid); +int grib_f_print_(int *gid, char *key, int len); +int grib_f_print__(int *gid, char *key, int len); +int grib_f_print(int *gid, char *key, int len); +int grib_f_get_error_string_(int *err, char *buf, int len); +int grib_f_get_error_string__(int *err, char *buf, int len); +int grib_f_get_error_string(int *err, char *buf, int len); +int grib_f_get_size_int_(int *gid, char *key, int *val, int len); +int grib_f_get_size_int__(int *gid, char *key, int *val, int len); +int grib_f_get_size_int(int *gid, char *key, int *val, int len); +int grib_f_get_size_long_(int *gid, char *key, long *val, int len); +int grib_f_get_size_long__(int *gid, char *key, long *val, int len); +int grib_f_get_size_long(int *gid, char *key, long *val, int len); +int grib_f_index_get_size_int_(int *gid, char *key, int *val, int len); +int grib_f_index_get_size_int__(int *gid, char *key, int *val, int len); +int grib_f_index_get_size_int(int *gid, char *key, int *val, int len); +int grib_f_index_get_size_long_(int *gid, char *key, long *val, int len); +int grib_f_index_get_size_long__(int *gid, char *key, long *val, int len); +int grib_f_index_get_size_long(int *gid, char *key, long *val, int len); +int grib_f_get_int_(int *gid, char *key, int *val, int len); +int grib_f_get_int__(int *gid, char *key, int *val, int len); +int grib_f_get_int(int *gid, char *key, int *val, int len); +int grib_f_get_long_(int *gid, char *key, long *val, int len); +int grib_f_get_long__(int *gid, char *key, long *val, int len); +int grib_f_get_long(int *gid, char *key, long *val, int len); +int grib_f_get_int_array_(int *gid, char *key, int *val, int *size, int len); +int grib_f_get_int_array__(int *gid, char *key, int *val, int *size, int len); +int grib_f_get_int_array(int *gid, char *key, int *val, int *size, int len); +int grib_f_get_long_array_(int *gid, char *key, long *val, int *size, int len); +int grib_f_get_long_array__(int *gid, char *key, long *val, int *size, int len); +int grib_f_get_long_array(int *gid, char *key, long *val, int *size, int len); +int grib_f_get_byte_array_(int* gid, char* key, unsigned char *val, int* size, int len, int lenv); +int grib_f_get_byte_array__(int* gid, char* key, unsigned char *val, int* size, int len, int lenv); +int grib_f_get_byte_array(int* gid, char* key, unsigned char *val, int* size, int len, int lenv); +int grib_f_index_get_string_(int *gid, char *key, char *val, int *eachsize, int *size, int len); +int grib_f_index_get_string__(int *gid, char *key, char *val, int *eachsize, int *size, int len); +int grib_f_index_get_string(int *gid, char *key, char *val, int *eachsize, int *size, int len); +int grib_f_index_get_long_(int *gid, char *key, long *val, int *size, int len); +int grib_f_index_get_long__(int *gid, char *key, long *val, int *size, int len); +int grib_f_index_get_long(int *gid, char *key, long *val, int *size, int len); +int grib_f_index_get_int_(int *gid, char *key, int *val, int *size, int len); +int grib_f_index_get_int__(int *gid, char *key, int *val, int *size, int len); +int grib_f_index_get_int(int *gid, char *key, int *val, int *size, int len); +int grib_f_index_get_real8_(int *gid, char *key, double *val, int *size, int len); +int grib_f_index_get_real8__(int *gid, char *key, double *val, int *size, int len); +int grib_f_index_get_real8(int *gid, char *key, double *val, int *size, int len); +int grib_f_set_int_array_(int *gid, char *key, int *val, int *size, int len); +int grib_f_set_int_array__(int *gid, char *key, int *val, int *size, int len); +int grib_f_set_int_array(int *gid, char *key, int *val, int *size, int len); +int grib_f_set_long_array_(int *gid, char *key, long *val, int *size, int len); +int grib_f_set_long_array__(int *gid, char *key, long *val, int *size, int len); +int grib_f_set_long_array(int *gid, char *key, long *val, int *size, int len); +int grib_f_set_byte_array_(int* gid, char* key, unsigned char *val, int* size, int len, int lenv); +int grib_f_set_byte_array__(int* gid, char* key, unsigned char *val, int* size, int len, int lenv); +int grib_f_set_byte_array(int* gid, char* key, unsigned char *val, int* size, int len, int lenv); +int grib_f_set_int_(int *gid, char *key, int *val, int len); +int grib_f_set_int__(int *gid, char *key, int *val, int len); +int grib_f_set_int(int *gid, char *key, int *val, int len); +int grib_f_set_long_(int *gid, char *key, long *val, int len); +int grib_f_set_long__(int *gid, char *key, long *val, int len); +int grib_f_set_long(int *gid, char *key, long *val, int len); +int grib_f_set_missing_(int *gid, char *key, int len); +int grib_f_set_missing__(int *gid, char *key, int len); +int grib_f_set_missing(int *gid, char *key, int len); +int grib_f_is_missing_(int *gid, char *key, int *isMissing, int len); +int grib_f_is_defined_(int *gid, char *key, int *isDefined, int len); +int grib_f_is_missing__(int *gid, char *key, int *isMissing, int len); +int grib_f_is_missing(int *gid, char *key, int *isMissing, int len); +int grib_f_set_real4_(int *gid, char *key, float *val, int len); +int grib_f_set_real4__(int *gid, char *key, float *val, int len); +int grib_f_set_real4(int *gid, char *key, float *val, int len); +int grib_f_get_real4_element_(int *gid, char *key, int *index, float *val, int len); +int grib_f_get_real4_element__(int *gid, char *key, int *index, float *val, int len); +int grib_f_get_real4_element(int *gid, char *key, int *index, float *val, int len); +int grib_f_get_real4_elements_(int *gid, char *key, int *index, float *val, int *size, int len); +int grib_f_get_real4_elements__(int *gid, char *key, int *index, float *val, int *len, int size); +int grib_f_get_real4_elements(int *gid, char *key, int *index, float *val, int *len, int size); +int grib_f_get_real4_(int *gid, char *key, float *val, int len); +int grib_f_get_real4__(int *gid, char *key, float *val, int len); +int grib_f_get_real4(int *gid, char *key, float *val, int 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); +int grib_f_get_real4_array(int *gid, char *key, float *val, int *size, int len); +int grib_f_set_real4_array_(int *gid, char *key, float *val, int *size, int len); +int grib_f_set_real4_array__(int *gid, char *key, float *val, int *size, int len); +int grib_f_set_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); +int grib_f_set_force_real4_array(int *gid, char *key, float *val, int *size, int len); +int grib_f_index_select_real8_(int *gid, char *key, double *val, int len); +int grib_f_index_select_real8__(int *gid, char *key, double *val, int len); +int grib_f_index_select_real8(int *gid, char *key, double *val, int len); +int grib_f_index_select_string_(int *gid, char *key, char *val, int len, int vallen); +int grib_f_index_select_string__(int *gid, char *key, char *val, int len, int vallen); +int grib_f_index_select_string(int *gid, char *key, char *val, int len, int vallen); +int grib_f_index_select_int_(int *gid, char *key, int *val, int len); +int grib_f_index_select_int__(int *gid, char *key, int *val, int len); +int grib_f_index_select_int(int *gid, char *key, int *val, int len); +int grib_f_index_select_long_(int *gid, char *key, long *val, int len); +int grib_f_index_select_long__(int *gid, char *key, long *val, int len); +int grib_f_index_select_long(int *gid, char *key, long *val, int len); +int grib_f_set_real8_(int *gid, char *key, double *val, int len); +int grib_f_set_real8__(int *gid, char *key, double *val, int len); +int grib_f_set_real8(int *gid, char *key, double *val, int len); +int grib_f_get_real8_(int *gid, char *key, double *val, int len); +int grib_f_get_real8__(int *gid, char *key, double *val, int len); +int grib_f_get_real8(int *gid, char *key, double *val, int len); +int grib_f_get_real8_element_(int *gid, char *key, int *index, double *val, int len); +int grib_f_get_real8_element__(int *gid, char *key, int *index, double *val, int len); +int grib_f_get_real8_element(int *gid, char *key, int *index, double *val, int len); +int grib_f_get_real8_elements_(int *gid, char *key, int *index, double *val, int *size, int len); +int grib_f_get_real8_elements__(int *gid, char *key, int *index, double *val, int *len, int size); +int grib_f_get_real8_elements(int *gid, char *key, int *index, double *val, int *len, int size); +int grib_f_find_nearest_four_single_(int *gid, int *is_lsm, double *inlat, double *inlon, double *outlats, double *outlons, double *values, double *distances, int *indexes); +int grib_f_find_nearest_four_single__(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes); +int grib_f_find_nearest_four_single(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes); +int grib_f_find_nearest_single_(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes); +int grib_f_find_nearest_single__(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes); +int grib_f_find_nearest_single(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes); +int grib_f_find_nearest_multiple_(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes, int *npoints); +int grib_f_find_nearest_multiple__(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes, int *npoints); +int grib_f_find_nearest_multiple(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes, int *npoints); +int grib_f_get_real8_array_(int *gid, char *key, double *val, int *size, int len); +int grib_f_get_real8_array__(int *gid, char *key, double *val, int *size, int len); +int grib_f_get_real8_array(int *gid, char *key, double *val, int *size, int len); +int grib_f_set_real8_array_(int *gid, char *key, double *val, int *size, int len); +int grib_f_set_real8_array__(int *gid, char *key, double *val, int *size, int len); +int grib_f_set_real8_array(int *gid, char *key, double *val, int *size, int len); +int grib_f_set_force_real8_array_(int *gid, char *key, double *val, int *size, int len); +int grib_f_set_force_real8_array__(int *gid, char *key, double *val, int *size, int len); +int grib_f_set_force_real8_array(int *gid, char *key, double *val, int *size, int len); +int grib_f_get_string_(int *gid, char *key, char *val, int len, int len2); +int grib_f_get_string__(int *gid, char *key, char *val, int len, int len2); +int grib_f_get_string(int *gid, char *key, char *val, int len, int len2); +int grib_f_set_string_(int *gid, char *key, char *val, int len, int len2); +int grib_f_set_string__(int *gid, char *key, char *val, int len, int len2); +int grib_f_set_string(int *gid, char *key, char *val, int len, int len2); +int grib_f_get_data_real4_(int *gid, float *lats, float *lons, float *values, size_t *size); +int grib_f_get_data_real4__(int *gid, float *lats, float *lons, float *values, size_t *size); +int grib_f_get_data_real4(int *gid, float *lats, float *lons, float *values, size_t *size); +int grib_f_get_data_real8_(int *gid, double *lats, double *lons, double *values, size_t *size); +int grib_f_get_data_real8__(int *gid, double *lats, double *lons, double *values, size_t *size); +int grib_f_get_data_real8(int *gid, double *lats, double *lons, double *values, size_t *size); +int grib_f_get_message_size_(int *gid, size_t *len); +int grib_f_get_message_size__(int *gid, size_t *len); +int grib_f_get_message_size(int *gid, size_t *len); +int grib_f_copy_message_(int *gid, void *mess, size_t *len); +int grib_f_copy_message__(int *gid, void *mess, size_t *len); +int grib_f_copy_message(int *gid, void *mess, size_t *len); +void grib_f_check_(int *err, char *call, char *str, int lencall, int lenstr); +void grib_f_check__(int *err, char *call, char *key, int lencall, int lenkey); +void grib_f_check(int *err, char *call, char *key, int lencall, int lenkey); +int grib_f_write_(int *gid, int *fid); +int grib_f_write__(int *gid, int *fid); +int grib_f_write(int *gid, int *fid); +int grib_f_multi_write_(int *gid, int *fid); +int grib_f_multi_write__(int *gid, int *fid); +int grib_f_multi_write(int *gid, int *fid); +int grib_f_multi_append_(int *ingid, int *sec, int *mgid); +int grib_f_multi_append(int *ingid, int *sec, int *mgid); +int grib_f_multi_append__(int *ingid, int *sec, int *mgid); + +int codes_f_bufr_keys_iterator_new_(int* gid,int* iterid); +int grib_f_read_file_(int* fid, void* buffer, size_t* nbytes); +int codes_f_bufr_keys_iterator_delete_(int* iterid); +int grib_f_set_definitions_path_(char* path, int len); +int grib_f_read_any_from_file_(int* fid, void* buffer, size_t* nbytes); +int any_f_new_from_file_(int* fid, int* gid); +int grib_f_get_native_type_(int* gid, char* key, int* val, int len); +int grib_f_get_api_version_(int* apiVersion,int len); +int codes_bufr_f_new_from_samples_(int* gid, char* name, int lname); +int any_f_load_all_from_file_(int* fid, int* n); +int codes_f_bufr_multi_element_constant_arrays_on_(); +int bufr_f_new_from_file_(int* fid, int* gid); +int grib_f_julian_to_datetime_(double* jd,long* year,long* month,long* day,long *hour,long *minute,long *second); +int any_f_new_from_scanned_file_(int* fid, int* msgid, int* gid); +int codes_f_bufr_keys_iterator_next_(int* iterid); +int grib_f_datetime_to_julian_(long* year,long* month,long* day, long* hour,long* minute,long* second,double* jd); +int grib_f_set_string_array_(int* gid, char* key, char* val,int* nvals,int* slen, int len); +int codes_f_bufr_keys_iterator_get_name_(int* iterid, char* name, int len); +int codes_f_bufr_multi_element_constant_arrays_off_(); + + +#ifdef __cplusplus +} +#endif From 6f9a1b643e88982ec94763168ab24c6a3485ffe7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 16 Apr 2024 16:33:57 +0000 Subject: [PATCH 036/196] C++ modernisation: Fix Fortran --- fortran/grib_fortran.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/fortran/grib_fortran.cc b/fortran/grib_fortran.cc index ce9298348..d7f3315bf 100644 --- a/fortran/grib_fortran.cc +++ b/fortran/grib_fortran.cc @@ -9,6 +9,7 @@ */ #include "grib_api_internal.h" +#include "grib_fortran_prototypes.h" #if HAVE_SYS_TYPES_H # include From 303a8ea9a52d6732046c13543f5a6e315b330e89 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 17 Apr 2024 12:12:28 +0000 Subject: [PATCH 037/196] Filter: Allow 'size' accessor to be used in IF statements --- src/grib_expression_class_functor.cc | 13 +++++++++++ tests/CMakeLists.txt | 1 + tests/filter_size.sh | 33 ++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100755 tests/filter_size.sh diff --git a/src/grib_expression_class_functor.cc b/src/grib_expression_class_functor.cc index 4664def10..1f4a4cc75 100644 --- a/src/grib_expression_class_functor.cc +++ b/src/grib_expression_class_functor.cc @@ -92,6 +92,19 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) return ret; } + if (STR_EQUAL(e->name, "size")) { + *lres = 0; + const char* p = grib_arguments_get_name(h, e->args, 0); + if (p) { + size_t size = 0; + int err = grib_get_size(h, p, &size); + if (err) return err; + *lres = (long)size; + return GRIB_SUCCESS; + } + return GRIB_INVALID_ARGUMENT; + } + if (STR_EQUAL(e->name, "missing")) { const char* p = grib_arguments_get_name(h, e->args, 0); if (p) { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 26592f16c..d3fbc795a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -104,6 +104,7 @@ if( HAVE_BUILD_TOOLS ) grib_ifsParam grib_packing_order filter_substr + filter_size filter_is_in_list filter_transient_darray grib_uerra diff --git a/tests/filter_size.sh b/tests/filter_size.sh new file mode 100755 index 000000000..1c1b191a3 --- /dev/null +++ b/tests/filter_size.sh @@ -0,0 +1,33 @@ +#!/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="filter_size_test" +tempFilt=temp.$label.filt +tempOut=temp.$label.txt + +cat > $tempFilt < $tempOut +grep "size of pl is 64" $tempOut + +${tools_dir}/grib_filter $tempFilt $ECCODES_SAMPLES_PATH/reduced_gg_pl_64_grib2.tmpl > $tempOut +grep "size of pl is 128" $tempOut + +# Clean up +rm -f $tempFilt $tempOut From 09f7774abd2d052e7de71f861bd9a5917d9bf062 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 17 Apr 2024 15:32:58 +0100 Subject: [PATCH 038/196] Definitions: Faster to copy the concept so we evaluate it once --- definitions/grib2/template.4.horizontal.def | 3 ++- src/grib_accessor_class_concept.cc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/definitions/grib2/template.4.horizontal.def b/definitions/grib2/template.4.horizontal.def index 0c10f5fe0..2dc64c033 100644 --- a/definitions/grib2/template.4.horizontal.def +++ b/definitions/grib2/template.4.horizontal.def @@ -79,7 +79,8 @@ if (extraDim) { # ECC-1333: levtype should be read-only in GRIB2 concept mars.levtype(unknown,"marsLevtypeConcept.def",conceptsDir2,conceptsDir1):no_copy, read_only; # GRIB-372: levelist alias does not pertain to surface parameters - if (levtype is "sfc" || levtype is "o2d") { + transient tempLevtype = levtype; # Faster to copy the concept so we evaluate it once + if (tempLevtype is "sfc" || tempLevtype is "o2d") { unalias mars.levelist; } } diff --git a/src/grib_accessor_class_concept.cc b/src/grib_accessor_class_concept.cc index 6fa4122f8..efda63e55 100644 --- a/src/grib_accessor_class_concept.cc +++ b/src/grib_accessor_class_concept.cc @@ -237,6 +237,7 @@ static const char* concept_evaluate(grib_accessor* a) grib_concept_value* c = action_concept_get_concept(a); grib_handle* h = grib_handle_of_accessor(a); + // fprintf(stderr, "DEBUG: concept_evaluate: %s %s\n", a->name, c->name); while (c) { grib_concept_condition* e = c->conditions; int cnt = 0; From 4a5cc04100711fe89b5013bc9f59961da4516598 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 17 Apr 2024 15:45:53 +0000 Subject: [PATCH 039/196] ECC-1804: GRIB2: Removal of 192 encodings to avoid confusion with new time-mean parameters --- .../grib2/localConcepts/ecmf/cfVarName.def | 144 ------------------ .../localConcepts/ecmf/cfVarName.legacy.def | 144 ++++++++++++++++++ definitions/grib2/localConcepts/ecmf/name.def | 144 ------------------ .../grib2/localConcepts/ecmf/name.legacy.def | 144 ++++++++++++++++++ .../grib2/localConcepts/ecmf/paramId.def | 144 ------------------ .../localConcepts/ecmf/paramId.legacy.def | 144 ++++++++++++++++++ .../grib2/localConcepts/ecmf/shortName.def | 144 ------------------ .../localConcepts/ecmf/shortName.legacy.def | 144 ++++++++++++++++++ .../grib2/localConcepts/ecmf/units.def | 144 ------------------ .../grib2/localConcepts/ecmf/units.legacy.def | 144 ++++++++++++++++++ 10 files changed, 720 insertions(+), 720 deletions(-) diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.def b/definitions/grib2/localConcepts/ecmf/cfVarName.def index 801bd6b5d..6794b74a6 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.def @@ -224,18 +224,6 @@ typeOfStatisticalProcessing = 3 ; lengthOfTimeRange = 24 ; } -#Mean temperature at 2 metres in the last 24 hours -'mean2t24' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 55 ; - } -#Mean 2 metre dewpoint temperature in the last 24 hours -'mn2d24' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 56 ; - } #Observation count 'obct' = { discipline = 192 ; @@ -14443,18 +14431,6 @@ parameterCategory = 129 ; parameterNumber = 54 ; } -#Mean 2 metre temperature in the last 24 hours gradient -'mean2t24grd' = { - discipline = 192 ; - parameterCategory = 129 ; - parameterNumber = 55 ; - } -#Mean 2 metre dewpoint temperature in the last 24 hours gradient -'mn2d24grd' = { - discipline = 192 ; - parameterCategory = 129 ; - parameterNumber = 56 ; - } #Downward UV radiation at the surface gradient 'uvbgrd' = { discipline = 192 ; @@ -15727,12 +15703,6 @@ parameterCategory = 130 ; parameterNumber = 231 ; } -#Mean vertical velocity -'mvv' = { - discipline = 192 ; - parameterCategory = 130 ; - parameterNumber = 232 ; - } #2m temperature anomaly of at least +2K 't2ag2' = { discipline = 192 ; @@ -16631,30 +16601,6 @@ parameterCategory = 140 ; parameterNumber = 200 ; } -#Standard deviation wave height -'sdhs' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 240 ; - } -#Mean of 10 metre wind speed -'mu10' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 241 ; - } -#Mean wind direction -'mdwi' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 242 ; - } -#Standard deviation of 10 metre wind speed -'sdu' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 243 ; - } #2D wave spectra (multiple) 'd2sp' = { discipline = 192 ; @@ -18848,18 +18794,6 @@ parameterCategory = 172 ; parameterNumber = 145 ; } -#Mean surface sensible heat flux -'msshfl' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 146 ; - } -#Mean surface latent heat flux -'mslhfl' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 147 ; - } #Mean short-wave heating rate 'mswhr' = { discipline = 192 ; @@ -18872,54 +18806,6 @@ parameterCategory = 172 ; parameterNumber = 154 ; } -#Mean surface downward solar radiation flux -'msdsrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 169 ; - } -#Mean surface downward thermal radiation flux -'msdtrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 175 ; - } -#Mean surface net solar radiation flux -'msnsrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 176 ; - } -#Mean surface net thermal radiation flux -'msntrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 177 ; - } -#Mean top net solar radiation flux -'mtnsrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 178 ; - } -#Mean top net thermal radiation flux -'mtntrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 179 ; - } -#East-West surface stress rate of accumulation -'ewssra' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 180 ; - } -#North-South surface stress rate of accumulation -'nsssra' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 181 ; - } #Evaporation 'erate' = { localTablesVersion = 1 ; @@ -18962,36 +18848,6 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } -#Top net solar radiation, clear sky -'p208.172' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 208 ; - } -#Top net thermal radiation, clear sky -'p209.172' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 209 ; - } -#Surface net solar radiation, clear sky -'p210.172' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 210 ; - } -#Surface net thermal radiation, clear sky -'p211.172' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 211 ; - } -#Solar insolation rate of accumulation -'soira' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 212 ; - } #Mean total precipitation rate 'tprate' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def index 4af98e981..c1c9099b5 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def @@ -1627,3 +1627,147 @@ parameterCategory = 162 ; parameterNumber = 215 ; } +#Mean vertical velocity +'mvv' = { + discipline = 192 ; + parameterCategory = 130 ; + parameterNumber = 232 ; +} +#Mean surface sensible heat flux +'msshfl' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 146 ; +} +#Mean surface latent heat flux +'mslhfl' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 147 ; +} +#Mean temperature at 2 metres in the last 24 hours +'mean2t24' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 55 ; +} +#Mean 2 metre temperature in the last 24 hours gradient +'mean2t24grd' = { + discipline = 192 ; + parameterCategory = 129 ; + parameterNumber = 55 ; +} +#Mean 2 metre dewpoint temperature in the last 24 hours +'mn2d24' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 56 ; +} +#Mean 2 metre dewpoint temperature in the last 24 hours gradient +'mn2d24grd' = { + discipline = 192 ; + parameterCategory = 129 ; + parameterNumber = 56 ; +} +#Mean surface downward solar radiation flux +'msdsrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 169 ; +} +#Mean surface downward thermal radiation flux +'msdtrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 175 ; +} +#Mean surface net solar radiation flux +'msnsrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 176 ; +} +#Mean surface net thermal radiation flux +'msntrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 177 ; +} +#Mean top net solar radiation flux +'mtnsrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 178 ; +} +#Mean top net thermal radiation flux +'mtntrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 179 ; +} +#East-West surface stress rate of accumulation +'ewssra' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 180 ; +} +#North-South surface stress rate of accumulation +'nsssra' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 181 ; +} +#Standard deviation wave height +'sdhs' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 240 ; +} +#Mean of 10 metre wind speed +'mu10' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 241 ; +} +#Mean wind direction +'mdwi' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 242 ; +} +#Standard deviation of 10 metre wind speed +'sdu' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 243 ; +} +#Top net solar radiation, clear sky +'p208.172' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 208 ; +} +#Top net thermal radiation, clear sky +'p209.172' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 209 ; +} +#Surface net solar radiation, clear sky +'p210.172' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 210 ; +} +#Surface net thermal radiation, clear sky +'p211.172' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 211 ; +} +#Solar insolation rate of accumulation +'soira' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 212 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/name.def b/definitions/grib2/localConcepts/ecmf/name.def index d615c6e98..c5d77647c 100644 --- a/definitions/grib2/localConcepts/ecmf/name.def +++ b/definitions/grib2/localConcepts/ecmf/name.def @@ -224,18 +224,6 @@ typeOfStatisticalProcessing = 3 ; lengthOfTimeRange = 24 ; } -#Mean temperature at 2 metres in the last 24 hours -'Mean temperature at 2 metres in the last 24 hours' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 55 ; - } -#Mean 2 metre dewpoint temperature in the last 24 hours -'Mean 2 metre dewpoint temperature in the last 24 hours' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 56 ; - } #Observation count 'Observation count' = { discipline = 192 ; @@ -14443,18 +14431,6 @@ parameterCategory = 129 ; parameterNumber = 54 ; } -#Mean 2 metre temperature in the last 24 hours gradient -'Mean 2 metre temperature in the last 24 hours gradient' = { - discipline = 192 ; - parameterCategory = 129 ; - parameterNumber = 55 ; - } -#Mean 2 metre dewpoint temperature in the last 24 hours gradient -'Mean 2 metre dewpoint temperature in the last 24 hours gradient' = { - discipline = 192 ; - parameterCategory = 129 ; - parameterNumber = 56 ; - } #Downward UV radiation at the surface gradient 'Downward UV radiation at the surface gradient' = { discipline = 192 ; @@ -15727,12 +15703,6 @@ parameterCategory = 130 ; parameterNumber = 231 ; } -#Mean vertical velocity -'Mean vertical velocity' = { - discipline = 192 ; - parameterCategory = 130 ; - parameterNumber = 232 ; - } #2m temperature anomaly of at least +2K '2m temperature anomaly of at least +2K' = { discipline = 192 ; @@ -16631,30 +16601,6 @@ parameterCategory = 140 ; parameterNumber = 200 ; } -#Standard deviation wave height -'Standard deviation wave height' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 240 ; - } -#Mean of 10 metre wind speed -'Mean of 10 metre wind speed' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 241 ; - } -#Mean wind direction -'Mean wind direction' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 242 ; - } -#Standard deviation of 10 metre wind speed -'Standard deviation of 10 metre wind speed' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 243 ; - } #2D wave spectra (multiple) '2D wave spectra (multiple)' = { discipline = 192 ; @@ -18848,18 +18794,6 @@ parameterCategory = 172 ; parameterNumber = 145 ; } -#Mean surface sensible heat flux -'Mean surface sensible heat flux' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 146 ; - } -#Mean surface latent heat flux -'Mean surface latent heat flux' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 147 ; - } #Mean short-wave heating rate 'Mean short-wave heating rate' = { discipline = 192 ; @@ -18872,54 +18806,6 @@ parameterCategory = 172 ; parameterNumber = 154 ; } -#Mean surface downward solar radiation flux -'Mean surface downward solar radiation flux' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 169 ; - } -#Mean surface downward thermal radiation flux -'Mean surface downward thermal radiation flux' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 175 ; - } -#Mean surface net solar radiation flux -'Mean surface net solar radiation flux' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 176 ; - } -#Mean surface net thermal radiation flux -'Mean surface net thermal radiation flux' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 177 ; - } -#Mean top net solar radiation flux -'Mean top net solar radiation flux' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 178 ; - } -#Mean top net thermal radiation flux -'Mean top net thermal radiation flux' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 179 ; - } -#East-West surface stress rate of accumulation -'East-West surface stress rate of accumulation' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 180 ; - } -#North-South surface stress rate of accumulation -'North-South surface stress rate of accumulation' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 181 ; - } #Evaporation 'Evaporation' = { localTablesVersion = 1 ; @@ -18962,36 +18848,6 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } -#Top net solar radiation, clear sky -'Top net solar radiation, clear sky' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 208 ; - } -#Top net thermal radiation, clear sky -'Top net thermal radiation, clear sky' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 209 ; - } -#Surface net solar radiation, clear sky -'Surface net solar radiation, clear sky' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 210 ; - } -#Surface net thermal radiation, clear sky -'Surface net thermal radiation, clear sky' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 211 ; - } -#Solar insolation rate of accumulation -'Solar insolation rate of accumulation' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 212 ; - } #Mean total precipitation rate 'Mean total precipitation rate' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/ecmf/name.legacy.def b/definitions/grib2/localConcepts/ecmf/name.legacy.def index 42f558b37..7a451911c 100644 --- a/definitions/grib2/localConcepts/ecmf/name.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/name.legacy.def @@ -1627,3 +1627,147 @@ parameterCategory = 162 ; parameterNumber = 215 ; } +#Mean vertical velocity +'Mean vertical velocity' = { + discipline = 192 ; + parameterCategory = 130 ; + parameterNumber = 232 ; +} +#Mean surface sensible heat flux +'Mean surface sensible heat flux' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 146 ; +} +#Mean surface latent heat flux +'Mean surface latent heat flux' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 147 ; +} +#Mean temperature at 2 metres in the last 24 hours +'Mean temperature at 2 metres in the last 24 hours' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 55 ; +} +#Mean 2 metre temperature in the last 24 hours gradient +'Mean 2 metre temperature in the last 24 hours gradient' = { + discipline = 192 ; + parameterCategory = 129 ; + parameterNumber = 55 ; +} +#Mean 2 metre dewpoint temperature in the last 24 hours +'Mean 2 metre dewpoint temperature in the last 24 hours' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 56 ; +} +#Mean 2 metre dewpoint temperature in the last 24 hours gradient +'Mean 2 metre dewpoint temperature in the last 24 hours gradient' = { + discipline = 192 ; + parameterCategory = 129 ; + parameterNumber = 56 ; +} +#Mean surface downward solar radiation flux +'Mean surface downward solar radiation flux' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 169 ; +} +#Mean surface downward thermal radiation flux +'Mean surface downward thermal radiation flux' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 175 ; +} +#Mean surface net solar radiation flux +'Mean surface net solar radiation flux' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 176 ; +} +#Mean surface net thermal radiation flux +'Mean surface net thermal radiation flux' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 177 ; +} +#Mean top net solar radiation flux +'Mean top net solar radiation flux' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 178 ; +} +#Mean top net thermal radiation flux +'Mean top net thermal radiation flux' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 179 ; +} +#East-West surface stress rate of accumulation +'East-West surface stress rate of accumulation' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 180 ; +} +#North-South surface stress rate of accumulation +'North-South surface stress rate of accumulation' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 181 ; +} +#Standard deviation wave height +'Standard deviation wave height' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 240 ; +} +#Mean of 10 metre wind speed +'Mean of 10 metre wind speed' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 241 ; +} +#Mean wind direction +'Mean wind direction' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 242 ; +} +#Standard deviation of 10 metre wind speed +'Standard deviation of 10 metre wind speed' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 243 ; +} +#Top net solar radiation, clear sky +'Top net solar radiation, clear sky' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 208 ; +} +#Top net thermal radiation, clear sky +'Top net thermal radiation, clear sky' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 209 ; +} +#Surface net solar radiation, clear sky +'Surface net solar radiation, clear sky' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 210 ; +} +#Surface net thermal radiation, clear sky +'Surface net thermal radiation, clear sky' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 211 ; +} +#Solar insolation rate of accumulation +'Solar insolation rate of accumulation' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 212 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/paramId.def b/definitions/grib2/localConcepts/ecmf/paramId.def index 46c8cd040..12fe43ab4 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.def @@ -224,18 +224,6 @@ typeOfStatisticalProcessing = 3 ; lengthOfTimeRange = 24 ; } -#Mean temperature at 2 metres in the last 24 hours -'55' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 55 ; - } -#Mean 2 metre dewpoint temperature in the last 24 hours -'56' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 56 ; - } #Observation count '62' = { discipline = 192 ; @@ -14443,18 +14431,6 @@ parameterCategory = 129 ; parameterNumber = 54 ; } -#Mean 2 metre temperature in the last 24 hours gradient -'129055' = { - discipline = 192 ; - parameterCategory = 129 ; - parameterNumber = 55 ; - } -#Mean 2 metre dewpoint temperature in the last 24 hours gradient -'129056' = { - discipline = 192 ; - parameterCategory = 129 ; - parameterNumber = 56 ; - } #Downward UV radiation at the surface gradient '129057' = { discipline = 192 ; @@ -15727,12 +15703,6 @@ parameterCategory = 130 ; parameterNumber = 231 ; } -#Mean vertical velocity -'130232' = { - discipline = 192 ; - parameterCategory = 130 ; - parameterNumber = 232 ; - } #2m temperature anomaly of at least +2K '131001' = { discipline = 192 ; @@ -16631,30 +16601,6 @@ parameterCategory = 140 ; parameterNumber = 200 ; } -#Standard deviation wave height -'140240' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 240 ; - } -#Mean of 10 metre wind speed -'140241' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 241 ; - } -#Mean wind direction -'140242' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 242 ; - } -#Standard deviation of 10 metre wind speed -'140243' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 243 ; - } #2D wave spectra (multiple) '140250' = { discipline = 192 ; @@ -18848,18 +18794,6 @@ parameterCategory = 172 ; parameterNumber = 145 ; } -#Mean surface sensible heat flux -'172146' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 146 ; - } -#Mean surface latent heat flux -'172147' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 147 ; - } #Mean short-wave heating rate '172153' = { discipline = 192 ; @@ -18872,54 +18806,6 @@ parameterCategory = 172 ; parameterNumber = 154 ; } -#Mean surface downward solar radiation flux -'172169' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 169 ; - } -#Mean surface downward thermal radiation flux -'172175' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 175 ; - } -#Mean surface net solar radiation flux -'172176' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 176 ; - } -#Mean surface net thermal radiation flux -'172177' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 177 ; - } -#Mean top net solar radiation flux -'172178' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 178 ; - } -#Mean top net thermal radiation flux -'172179' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 179 ; - } -#East-West surface stress rate of accumulation -'172180' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 180 ; - } -#North-South surface stress rate of accumulation -'172181' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 181 ; - } #Evaporation '172182' = { localTablesVersion = 1 ; @@ -18962,36 +18848,6 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } -#Top net solar radiation, clear sky -'172208' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 208 ; - } -#Top net thermal radiation, clear sky -'172209' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 209 ; - } -#Surface net solar radiation, clear sky -'172210' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 210 ; - } -#Surface net thermal radiation, clear sky -'172211' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 211 ; - } -#Solar insolation rate of accumulation -'172212' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 212 ; - } #Mean total precipitation rate '172228' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def index 082896fc5..4413e87b9 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def @@ -1627,3 +1627,147 @@ parameterCategory = 162 ; parameterNumber = 215 ; } +#Mean vertical velocity +'130232' = { + discipline = 192 ; + parameterCategory = 130 ; + parameterNumber = 232 ; +} +#Mean surface sensible heat flux +'172146' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 146 ; +} +#Mean surface latent heat flux +'172147' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 147 ; +} +#Mean temperature at 2 metres in the last 24 hours +'55' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 55 ; +} +#Mean 2 metre temperature in the last 24 hours gradient +'129055' = { + discipline = 192 ; + parameterCategory = 129 ; + parameterNumber = 55 ; +} +#Mean 2 metre dewpoint temperature in the last 24 hours +'56' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 56 ; +} +#Mean 2 metre dewpoint temperature in the last 24 hours gradient +'129056' = { + discipline = 192 ; + parameterCategory = 129 ; + parameterNumber = 56 ; +} +#Mean surface downward solar radiation flux +'172169' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 169 ; +} +#Mean surface downward thermal radiation flux +'172175' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 175 ; +} +#Mean surface net solar radiation flux +'172176' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 176 ; +} +#Mean surface net thermal radiation flux +'172177' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 177 ; +} +#Mean top net solar radiation flux +'172178' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 178 ; +} +#Mean top net thermal radiation flux +'172179' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 179 ; +} +#East-West surface stress rate of accumulation +'172180' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 180 ; +} +#North-South surface stress rate of accumulation +'172181' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 181 ; +} +#Standard deviation wave height +'140240' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 240 ; +} +#Mean of 10 metre wind speed +'140241' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 241 ; +} +#Mean wind direction +'140242' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 242 ; +} +#Standard deviation of 10 metre wind speed +'140243' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 243 ; +} +#Top net solar radiation, clear sky +'172208' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 208 ; +} +#Top net thermal radiation, clear sky +'172209' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 209 ; +} +#Surface net solar radiation, clear sky +'172210' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 210 ; +} +#Surface net thermal radiation, clear sky +'172211' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 211 ; +} +#Solar insolation rate of accumulation +'172212' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 212 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/shortName.def b/definitions/grib2/localConcepts/ecmf/shortName.def index 563048c1b..b476da6d8 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.def @@ -224,18 +224,6 @@ typeOfStatisticalProcessing = 3 ; lengthOfTimeRange = 24 ; } -#Mean temperature at 2 metres in the last 24 hours -'mean2t24' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 55 ; - } -#Mean 2 metre dewpoint temperature in the last 24 hours -'mn2d24' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 56 ; - } #Observation count 'obct' = { discipline = 192 ; @@ -14443,18 +14431,6 @@ parameterCategory = 129 ; parameterNumber = 54 ; } -#Mean 2 metre temperature in the last 24 hours gradient -'mean2t24grd' = { - discipline = 192 ; - parameterCategory = 129 ; - parameterNumber = 55 ; - } -#Mean 2 metre dewpoint temperature in the last 24 hours gradient -'mn2d24grd' = { - discipline = 192 ; - parameterCategory = 129 ; - parameterNumber = 56 ; - } #Downward UV radiation at the surface gradient 'uvbgrd' = { discipline = 192 ; @@ -15727,12 +15703,6 @@ parameterCategory = 130 ; parameterNumber = 231 ; } -#Mean vertical velocity -'mvv' = { - discipline = 192 ; - parameterCategory = 130 ; - parameterNumber = 232 ; - } #2m temperature anomaly of at least +2K '2tag2' = { discipline = 192 ; @@ -16631,30 +16601,6 @@ parameterCategory = 140 ; parameterNumber = 200 ; } -#Standard deviation wave height -'sdhs' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 240 ; - } -#Mean of 10 metre wind speed -'mu10' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 241 ; - } -#Mean wind direction -'mdwi' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 242 ; - } -#Standard deviation of 10 metre wind speed -'sdu' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 243 ; - } #2D wave spectra (multiple) '2dsp' = { discipline = 192 ; @@ -18848,18 +18794,6 @@ parameterCategory = 172 ; parameterNumber = 145 ; } -#Mean surface sensible heat flux -'msshfl' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 146 ; - } -#Mean surface latent heat flux -'mslhfl' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 147 ; - } #Mean short-wave heating rate 'mswhr' = { discipline = 192 ; @@ -18872,54 +18806,6 @@ parameterCategory = 172 ; parameterNumber = 154 ; } -#Mean surface downward solar radiation flux -'msdsrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 169 ; - } -#Mean surface downward thermal radiation flux -'msdtrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 175 ; - } -#Mean surface net solar radiation flux -'msnsrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 176 ; - } -#Mean surface net thermal radiation flux -'msntrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 177 ; - } -#Mean top net solar radiation flux -'mtnsrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 178 ; - } -#Mean top net thermal radiation flux -'mtntrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 179 ; - } -#East-West surface stress rate of accumulation -'ewssra' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 180 ; - } -#North-South surface stress rate of accumulation -'nsssra' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 181 ; - } #Evaporation 'erate' = { localTablesVersion = 1 ; @@ -18962,36 +18848,6 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } -#Top net solar radiation, clear sky -'~' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 208 ; - } -#Top net thermal radiation, clear sky -'~' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 209 ; - } -#Surface net solar radiation, clear sky -'~' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 210 ; - } -#Surface net thermal radiation, clear sky -'~' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 211 ; - } -#Solar insolation rate of accumulation -'soira' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 212 ; - } #Mean total precipitation rate 'tprate' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def index a09f11b7f..1a5608823 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def @@ -1627,3 +1627,147 @@ parameterCategory = 162 ; parameterNumber = 215 ; } +#Mean vertical velocity +'mvv' = { + discipline = 192 ; + parameterCategory = 130 ; + parameterNumber = 232 ; +} +#Mean surface sensible heat flux +'msshfl' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 146 ; +} +#Mean surface latent heat flux +'mslhfl' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 147 ; +} +#Mean temperature at 2 metres in the last 24 hours +'mean2t24' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 55 ; +} +#Mean 2 metre temperature in the last 24 hours gradient +'mean2t24grd' = { + discipline = 192 ; + parameterCategory = 129 ; + parameterNumber = 55 ; +} +#Mean 2 metre dewpoint temperature in the last 24 hours +'mn2d24' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 56 ; +} +#Mean 2 metre dewpoint temperature in the last 24 hours gradient +'mn2d24grd' = { + discipline = 192 ; + parameterCategory = 129 ; + parameterNumber = 56 ; +} +#Mean surface downward solar radiation flux +'msdsrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 169 ; +} +#Mean surface downward thermal radiation flux +'msdtrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 175 ; +} +#Mean surface net solar radiation flux +'msnsrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 176 ; +} +#Mean surface net thermal radiation flux +'msntrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 177 ; +} +#Mean top net solar radiation flux +'mtnsrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 178 ; +} +#Mean top net thermal radiation flux +'mtntrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 179 ; +} +#East-West surface stress rate of accumulation +'ewssra' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 180 ; +} +#North-South surface stress rate of accumulation +'nsssra' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 181 ; +} +#Standard deviation wave height +'sdhs' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 240 ; +} +#Mean of 10 metre wind speed +'mu10' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 241 ; +} +#Mean wind direction +'mdwi' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 242 ; +} +#Standard deviation of 10 metre wind speed +'sdu' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 243 ; +} +#Top net solar radiation, clear sky +'~' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 208 ; +} +#Top net thermal radiation, clear sky +'~' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 209 ; +} +#Surface net solar radiation, clear sky +'~' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 210 ; +} +#Surface net thermal radiation, clear sky +'~' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 211 ; +} +#Solar insolation rate of accumulation +'soira' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 212 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/units.def b/definitions/grib2/localConcepts/ecmf/units.def index 6adc93e89..1629e52b0 100644 --- a/definitions/grib2/localConcepts/ecmf/units.def +++ b/definitions/grib2/localConcepts/ecmf/units.def @@ -224,18 +224,6 @@ typeOfStatisticalProcessing = 3 ; lengthOfTimeRange = 24 ; } -#Mean temperature at 2 metres in the last 24 hours -'K' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 55 ; - } -#Mean 2 metre dewpoint temperature in the last 24 hours -'K' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 56 ; - } #Observation count '~' = { discipline = 192 ; @@ -14443,18 +14431,6 @@ parameterCategory = 129 ; parameterNumber = 54 ; } -#Mean 2 metre temperature in the last 24 hours gradient -'K' = { - discipline = 192 ; - parameterCategory = 129 ; - parameterNumber = 55 ; - } -#Mean 2 metre dewpoint temperature in the last 24 hours gradient -'K' = { - discipline = 192 ; - parameterCategory = 129 ; - parameterNumber = 56 ; - } #Downward UV radiation at the surface gradient 'J m**-2' = { discipline = 192 ; @@ -15727,12 +15703,6 @@ parameterCategory = 130 ; parameterNumber = 231 ; } -#Mean vertical velocity -'Pa s**-1' = { - discipline = 192 ; - parameterCategory = 130 ; - parameterNumber = 232 ; - } #2m temperature anomaly of at least +2K '%' = { discipline = 192 ; @@ -16631,30 +16601,6 @@ parameterCategory = 140 ; parameterNumber = 200 ; } -#Standard deviation wave height -'m' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 240 ; - } -#Mean of 10 metre wind speed -'m s**-1' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 241 ; - } -#Mean wind direction -'degrees' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 242 ; - } -#Standard deviation of 10 metre wind speed -'m s**-1' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 243 ; - } #2D wave spectra (multiple) 'm**2 s radian**-1' = { discipline = 192 ; @@ -18848,18 +18794,6 @@ parameterCategory = 172 ; parameterNumber = 145 ; } -#Mean surface sensible heat flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 146 ; - } -#Mean surface latent heat flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 147 ; - } #Mean short-wave heating rate 'K s**-1' = { discipline = 192 ; @@ -18872,54 +18806,6 @@ parameterCategory = 172 ; parameterNumber = 154 ; } -#Mean surface downward solar radiation flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 169 ; - } -#Mean surface downward thermal radiation flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 175 ; - } -#Mean surface net solar radiation flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 176 ; - } -#Mean surface net thermal radiation flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 177 ; - } -#Mean top net solar radiation flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 178 ; - } -#Mean top net thermal radiation flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 179 ; - } -#East-West surface stress rate of accumulation -'N m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 180 ; - } -#North-South surface stress rate of accumulation -'N m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 181 ; - } #Evaporation 'm of water equivalent s**-1' = { localTablesVersion = 1 ; @@ -18962,36 +18848,6 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } -#Top net solar radiation, clear sky -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 208 ; - } -#Top net thermal radiation, clear sky -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 209 ; - } -#Surface net solar radiation, clear sky -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 210 ; - } -#Surface net thermal radiation, clear sky -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 211 ; - } -#Solar insolation rate of accumulation -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 212 ; - } #Mean total precipitation rate 'm s**-1' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/ecmf/units.legacy.def b/definitions/grib2/localConcepts/ecmf/units.legacy.def index 6094190f0..b6a28f51b 100644 --- a/definitions/grib2/localConcepts/ecmf/units.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/units.legacy.def @@ -1627,3 +1627,147 @@ parameterCategory = 162 ; parameterNumber = 215 ; } +#Mean vertical velocity +'Pa s**-1' = { + discipline = 192 ; + parameterCategory = 130 ; + parameterNumber = 232 ; +} +#Mean surface sensible heat flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 146 ; +} +#Mean surface latent heat flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 147 ; +} +#Mean temperature at 2 metres in the last 24 hours +'K' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 55 ; +} +#Mean 2 metre temperature in the last 24 hours gradient +'K' = { + discipline = 192 ; + parameterCategory = 129 ; + parameterNumber = 55 ; +} +#Mean 2 metre dewpoint temperature in the last 24 hours +'K' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 56 ; +} +#Mean 2 metre dewpoint temperature in the last 24 hours gradient +'K' = { + discipline = 192 ; + parameterCategory = 129 ; + parameterNumber = 56 ; +} +#Mean surface downward solar radiation flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 169 ; +} +#Mean surface downward thermal radiation flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 175 ; +} +#Mean surface net solar radiation flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 176 ; +} +#Mean surface net thermal radiation flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 177 ; +} +#Mean top net solar radiation flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 178 ; +} +#Mean top net thermal radiation flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 179 ; +} +#East-West surface stress rate of accumulation +'N m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 180 ; +} +#North-South surface stress rate of accumulation +'N m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 181 ; +} +#Standard deviation wave height +'m' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 240 ; +} +#Mean of 10 metre wind speed +'m s**-1' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 241 ; +} +#Mean wind direction +'degrees' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 242 ; +} +#Standard deviation of 10 metre wind speed +'m s**-1' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 243 ; +} +#Top net solar radiation, clear sky +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 208 ; +} +#Top net thermal radiation, clear sky +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 209 ; +} +#Surface net solar radiation, clear sky +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 210 ; +} +#Surface net thermal radiation, clear sky +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 211 ; +} +#Solar insolation rate of accumulation +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 212 ; +} From f13b2af3e39ad2e83ca1b70cd0d03dc95157a543 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 17 Apr 2024 21:57:12 +0100 Subject: [PATCH 040/196] Debugging: Print the handle's address (to distinguish different threads/processes) --- src/grib_value.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/grib_value.cc b/src/grib_value.cc index 1320bc9b7..f1675ccd2 100644 --- a/src/grib_value.cc +++ b/src/grib_value.cc @@ -46,7 +46,7 @@ static void print_debug_info__set_array(grib_handle* h, const char* func, const if (length <= N) N = length; - fprintf(stderr, "ECCODES DEBUG %s key=%s, %zu entries (", func, name, length); + fprintf(stderr, "ECCODES DEBUG %s h=%p key=%s, %zu entries (", func, (void*)h, name, length); for (i = 0; i < N; ++i) { if (i != 0) fprintf(stderr,", "); fprintf(stderr, "%.10g", val[i]); @@ -89,7 +89,7 @@ int grib_set_long_internal(grib_handle* h, const char* name, long val) a = grib_find_accessor(h, name); if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_long_internal %s=%ld\n", name, val); + fprintf(stderr, "ECCODES DEBUG grib_set_long_internal h=%p %s=%ld\n", (void*)h, name, val); if (a) { ret = grib_pack_long(a, &val, &l); @@ -117,9 +117,9 @@ int grib_set_long(grib_handle* h, const char* name, long val) if (a) { if (h->context->debug) { if (strcmp(name, a->name)!=0) - fprintf(stderr, "ECCODES DEBUG grib_set_long %s=%ld (a->name=%s)\n", name, val, a->name); + fprintf(stderr, "ECCODES DEBUG grib_set_long h=%p %s=%ld (a->name=%s)\n", (void*)h, name, val, a->name); else - fprintf(stderr, "ECCODES DEBUG grib_set_long %s=%ld\n", name, val); + fprintf(stderr, "ECCODES DEBUG grib_set_long h=%p %s=%ld\n", (void*)h, name, val); } if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) @@ -133,7 +133,7 @@ int grib_set_long(grib_handle* h, const char* name, long val) } if (h->context->debug) { - fprintf(stderr, "ECCODES DEBUG grib_set_long %s=%ld (Key not found)\n", name, val); + fprintf(stderr, "ECCODES DEBUG grib_set_long h=%p %s=%ld (Key not found)\n", (void*)h, name, val); } return GRIB_NOT_FOUND; @@ -148,7 +148,7 @@ int grib_set_double_internal(grib_handle* h, const char* name, double val) a = grib_find_accessor(h, name); if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_double_internal %s=%.10g\n", name, val); + fprintf(stderr, "ECCODES DEBUG grib_set_double_internal h=%p %s=%.10g\n", (void*)h, name, val); if (a) { ret = grib_pack_double(a, &val, &l); @@ -349,9 +349,9 @@ int grib_set_double(grib_handle* h, const char* name, double val) if (a) { if (h->context->debug) { if (strcmp(name, a->name)!=0) - fprintf(stderr, "ECCODES DEBUG grib_set_double %s=%.10g (a->name=%s)\n", name, val, a->name); + fprintf(stderr, "ECCODES DEBUG grib_set_double h=%p %s=%.10g (a->name=%s)\n", (void*)h, name, val, a->name); else - fprintf(stderr, "ECCODES DEBUG grib_set_double %s=%.10g\n", name, val); + fprintf(stderr, "ECCODES DEBUG grib_set_double h=%p %s=%.10g\n", (void*)h, name, val); } if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) @@ -375,7 +375,7 @@ int grib_set_string_internal(grib_handle* h, const char* name, a = grib_find_accessor(h, name); if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_string_internal %s=%s\n", name, val); + fprintf(stderr, "ECCODES DEBUG grib_set_string_internal h=%p %s=%s\n", (void*)h, name, val); if (a) { ret = grib_pack_string(a, val, length); @@ -467,9 +467,9 @@ int grib_set_string(grib_handle* h, const char* name, const char* val, size_t* l if (a) { if (h->context->debug) { if (strcmp(name, a->name)!=0) - fprintf(stderr, "ECCODES DEBUG grib_set_string %s=|%s| (a->name=%s)\n", name, val, a->name); + fprintf(stderr, "ECCODES DEBUG grib_set_string h=%p %s=|%s| (a->name=%s)\n", (void*)h, name, val, a->name); else - fprintf(stderr, "ECCODES DEBUG grib_set_string %s=|%s|\n", name, val); + fprintf(stderr, "ECCODES DEBUG grib_set_string h=%p %s=|%s|\n", (void*)h, name, val); } if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) @@ -497,7 +497,7 @@ int grib_set_string_array(grib_handle* h, const char* name, const char** val, si a = grib_find_accessor(h, name); if (h->context->debug) { - fprintf(stderr, "ECCODES DEBUG grib_set_string_array key=%s %zu values\n", name, length); + fprintf(stderr, "ECCODES DEBUG grib_set_string_array h=%p key=%s %zu values\n", (void*)h, name, length); } if (a) { @@ -579,7 +579,7 @@ int grib_set_missing(grib_handle* h, const char* name) if (grib_accessor_can_be_missing(a, &ret)) { if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_missing %s\n", name); + fprintf(stderr, "ECCODES DEBUG grib_set_missing h=%p %s\n", (void*)h, name); ret = grib_pack_missing(a); if (ret == GRIB_SUCCESS) @@ -903,7 +903,7 @@ static int _grib_set_long_array(grib_handle* h, const char* name, const long* va size_t N = 5; if (length <= N) N = length; - fprintf(stderr, "ECCODES DEBUG _grib_set_long_array key=%s %zu values (", name, length); + fprintf(stderr, "ECCODES DEBUG _grib_set_long_array h=%p key=%s %zu values (", (void*)h, name, length); for (i = 0; i < N; ++i) fprintf(stderr, " %ld,", val[i]); if (N >= length) From c31eb4931371fb22a4c5f1a9b7fae0cb8eeb86ba Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 18 Apr 2024 11:25:38 +0100 Subject: [PATCH 041/196] Expression: Print an error if functor is not implemented --- src/grib_expression_class_functor.cc | 1 + tests/grib_filter_fail.sh | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/grib_expression_class_functor.cc b/src/grib_expression_class_functor.cc index 1f4a4cc75..701c45d5d 100644 --- a/src/grib_expression_class_functor.cc +++ b/src/grib_expression_class_functor.cc @@ -174,6 +174,7 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) return GRIB_SUCCESS; } + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_expression_class_functor::%s failed for '%s'", __func__, e->name); return GRIB_NOT_IMPLEMENTED; } diff --git a/tests/grib_filter_fail.sh b/tests/grib_filter_fail.sh index cf66e7b6c..8afd89811 100755 --- a/tests/grib_filter_fail.sh +++ b/tests/grib_filter_fail.sh @@ -18,6 +18,9 @@ tempGrib="temp.$label.grib" tempOut="temp.$label.txt" tempRef="temp.$label.ref" +sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + + echo "Test with nonexistent keys. Note spelling of centre!" # --------------------------------------------------------- cat >${data_dir}/nonexkey.rules <$tempFilt < $tempOut +${tools_dir}/grib_filter $tempFilt $sample_grib2 2> $tempOut status=$? set -e [ $status -ne 0 ] @@ -66,10 +69,8 @@ grep "Assertion failure" $tempOut # Bad write # --------- -input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl - set +e -echo 'write(-10);' | ${tools_dir}/grib_filter -o $tempGrib - $input > $tempOut 2>&1 +echo 'write(-10);' | ${tools_dir}/grib_filter -o $tempGrib - $sample_grib2 > $tempOut 2>&1 status=$? set -e [ $status -ne 0 ] @@ -100,12 +101,25 @@ set -e # Non existent filter # -------------------- set +e -${tools_dir}/grib_filter a_non_existent_filter_file $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempOut 2>&1 +${tools_dir}/grib_filter a_non_existent_filter_file $sample_grib2 > $tempOut 2>&1 status=$? set -e [ $status -ne 0 ] grep -q "Cannot include file" $tempOut +# Functor not implemented +# ------------------------- +cat >$tempFilt < $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "ECCODES ERROR.*failed for 'unicorn'" $tempOut +grep -q "Function not yet implemented" $tempOut + # Clean up rm -f $tempGrib $tempFilt $tempOut $tempRef From 21fdb254ee813fcd655b5b33c377a0d6be261df0 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 18 Apr 2024 11:25:51 +0100 Subject: [PATCH 042/196] Dead code removal --- src/grib_accessor_class_optimal_step_units.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/grib_accessor_class_optimal_step_units.cc b/src/grib_accessor_class_optimal_step_units.cc index 261ff4c80..79f4c1dcf 100644 --- a/src/grib_accessor_class_optimal_step_units.cc +++ b/src/grib_accessor_class_optimal_step_units.cc @@ -171,7 +171,6 @@ static int pack_expression(grib_accessor* a, grib_expression* e) } static long staticStepUnits = eccodes::Unit{eccodes::Unit::Value::MISSING}.value(); -static long staticForceStepUnits = eccodes::Unit{eccodes::Unit::Value::MISSING}.value(); static int pack_long(grib_accessor* a, const long* val, size_t* len) { From e6e3c58f3c3bc835268d00c781d1763a2f6cd02e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 19 Apr 2024 10:44:09 +0000 Subject: [PATCH 043/196] ECC-1806: GRIB: Change of paramId in conversion from GRIB1 to GRIB2 (Try 1) --- definitions/grib1/section.1.def | 7 +++++++ definitions/grib2/boot.def | 3 +++ src/grib_accessor_class_concept.cc | 14 ++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 2bda52ec7..4136b0395 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -325,3 +325,10 @@ if (stepTypeForConversion is "accum" || stepTypeForConversion is "max" || stepTy meta md5Section1 md5(offsetSection1,section1Length); # md5(start,length,blacklisted1,blacklisted2,...); meta md5Product md5(offsetSection1,section1Length,gridDefinition,section1Flags,decimalScaleFactor); + +# ECC-1806 +concept_nofail paramIdForConversion(zero) { + 262000 = {gribTablesVersionNo=174;indicatorOfParameter=98; centre=98;} # 174098 -> 262000 + 262104 = {gribTablesVersionNo=151;indicatorOfParameter=163;centre=98;} # 151163 -> 262104 + 262124 = {gribTablesVersionNo=151;indicatorOfParameter=145;centre=98;} # 151145 -> 262124 +} : long_type; diff --git a/definitions/grib2/boot.def b/definitions/grib2/boot.def index d2c44fb74..7cba8747b 100644 --- a/definitions/grib2/boot.def +++ b/definitions/grib2/boot.def @@ -53,3 +53,6 @@ concept isTemplateDeprecated(false) { concept isTemplateExperimental(false) { 1 = { template_is_experimental = 1; } } + +# ECC-1806 +transient paramIdForConversion = 0; diff --git a/src/grib_accessor_class_concept.cc b/src/grib_accessor_class_concept.cc index efda63e55..cdfb31245 100644 --- a/src/grib_accessor_class_concept.cc +++ b/src/grib_accessor_class_concept.cc @@ -455,6 +455,20 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) //if(*len > 1) // return GRIB_NOT_IMPLEMENTED; + // ECC-1806: GRIB: Change of paramId in conversion from GRIB1 to GRIB2 + if (STR_EQUAL(a->name,"paramId")) { + grib_handle* h = grib_handle_of_accessor(a); + long edition = 0; + if (grib_get_long(h, "edition", &edition) == GRIB_SUCCESS && edition == 2) { + long newParamId = 0; + if (grib_get_long(h, "paramIdForConversion", &newParamId) == GRIB_SUCCESS) { + if (newParamId > 0) { + snprintf(buf, sizeof(buf), "%ld", newParamId); + } + } + } + } + s = strlen(buf) + 1; return pack_string(a, buf, &s); } From a39eb883cd2ebffb1b848f8064f07f6cfc516039 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 19 Apr 2024 14:07:51 +0100 Subject: [PATCH 044/196] ECC-1806: Add tests --- definitions/grib1/section.1.def | 6 ++-- src/grib_accessor_class_concept.cc | 11 ++++--- tests/CMakeLists.txt | 1 + tests/grib_ecc-1806.sh | 47 ++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 7 deletions(-) create mode 100755 tests/grib_ecc-1806.sh diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 4136b0395..9e7cc955b 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -328,7 +328,7 @@ meta md5Product md5(offsetSection1,section1Length,gridDefinition,section1Flags,d # ECC-1806 concept_nofail paramIdForConversion(zero) { - 262000 = {gribTablesVersionNo=174;indicatorOfParameter=98; centre=98;} # 174098 -> 262000 - 262104 = {gribTablesVersionNo=151;indicatorOfParameter=163;centre=98;} # 151163 -> 262104 - 262124 = {gribTablesVersionNo=151;indicatorOfParameter=145;centre=98;} # 151145 -> 262124 + 262000 = { gribTablesVersionNo=174;indicatorOfParameter=98; centre=98; } # 174098 -> 262000 + 262104 = { gribTablesVersionNo=151;indicatorOfParameter=163;centre=98; } # 151163 -> 262104 + 262124 = { gribTablesVersionNo=151;indicatorOfParameter=145;centre=98; } # 151145 -> 262124 } : long_type; diff --git a/src/grib_accessor_class_concept.cc b/src/grib_accessor_class_concept.cc index cdfb31245..56ec86e30 100644 --- a/src/grib_accessor_class_concept.cc +++ b/src/grib_accessor_class_concept.cc @@ -456,15 +456,18 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) // return GRIB_NOT_IMPLEMENTED; // ECC-1806: GRIB: Change of paramId in conversion from GRIB1 to GRIB2 - if (STR_EQUAL(a->name,"paramId")) { + if (STR_EQUAL(a->name, "paramId")) { grib_handle* h = grib_handle_of_accessor(a); long edition = 0; if (grib_get_long(h, "edition", &edition) == GRIB_SUCCESS && edition == 2) { long newParamId = 0; - if (grib_get_long(h, "paramIdForConversion", &newParamId) == GRIB_SUCCESS) { - if (newParamId > 0) { - snprintf(buf, sizeof(buf), "%ld", newParamId); + if (grib_get_long(h, "paramIdForConversion", &newParamId) == GRIB_SUCCESS && newParamId > 0) { + if (a->context->debug) { + const char* cclass_name = a->cclass->name; + fprintf(stderr, "ECCODES DEBUG %s::%s: Changing %s from %ld to %ld\n", + cclass_name, __func__, a->name, *val, newParamId); } + snprintf(buf, sizeof(buf), "%ld", newParamId); } } } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d3fbc795a..dac9083c1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -146,6 +146,7 @@ if( HAVE_BUILD_TOOLS ) grib_ecc-1708 grib_ecc-1691 grib_ecc-1766 + grib_ecc-1806 bufr_ecc-1028 bufr_ecc-1195 bufr_ecc-1259 diff --git a/tests/grib_ecc-1806.sh b/tests/grib_ecc-1806.sh new file mode 100755 index 000000000..b271285e3 --- /dev/null +++ b/tests/grib_ecc-1806.sh @@ -0,0 +1,47 @@ +#!/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 + +REDIRECT=/dev/null + +label="grib_ecc-1806_test" +tempGribA=temp.$label.1.grib +tempGribB=temp.$label.2.grib +tempFilt=temp.$label.filt +tempLog=temp.$label.log +tempRef=temp.$label.ref + +sample_grib1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + +test_conversion() +{ + param1=$1 # old paramId in GRIB1 + param2=$2 # new paramId in GRIB2 + short=$3 # new shortName + ${tools_dir}/grib_set -s paramId=$param1,edition=2 $sample_grib1 $tempGribA + grib_check_key_equals $tempGribA paramId,shortName "$param2 $short" + + # The old paramId has been removed from GRIB2 + set +e + ${tools_dir}/grib_set -s paramId=$param1 $sample_grib2 $tempGribA 2>$REDIRECT + status=$? + set -e + [ $status -ne 0 ] + +} + +test_conversion 174098 262000 sithick +test_conversion 151163 262104 t20d +test_conversion 151145 262124 zos + +# Clean up +rm -f $tempGribA $tempGribB $tempFilt $tempLog $tempRef From ce791332a5c5a340cb30a202d30ccc666397aacd Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 19 Apr 2024 18:21:30 +0100 Subject: [PATCH 045/196] ECC-1806: Further tests --- definitions/grib1/section.1.def | 17 +++++++++++--- tests/grib_ecc-1806.sh | 39 ++++++++++++++++++++++++--------- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 9e7cc955b..778910695 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -328,7 +328,18 @@ meta md5Product md5(offsetSection1,section1Length,gridDefinition,section1Flags,d # ECC-1806 concept_nofail paramIdForConversion(zero) { - 262000 = { gribTablesVersionNo=174;indicatorOfParameter=98; centre=98; } # 174098 -> 262000 - 262104 = { gribTablesVersionNo=151;indicatorOfParameter=163;centre=98; } # 151163 -> 262104 - 262124 = { gribTablesVersionNo=151;indicatorOfParameter=145;centre=98; } # 151145 -> 262124 + 228004 = { gribTablesVersionNo=128; indicatorOfParameter=55; centre=98; } # 55 -> 228004 + 235168 = { gribTablesVersionNo=128; indicatorOfParameter=56; centre=98; } # 56 -> 235168 + 235135 = { gribTablesVersionNo=130; indicatorOfParameter=232; centre=98; } # 130232 -> 235135 + 262104 = { gribTablesVersionNo=151; indicatorOfParameter=163; centre=98; } # 151163 -> 262104 + 262124 = { gribTablesVersionNo=151; indicatorOfParameter=145; centre=98; } # 151145 -> 262124 + 235033 = { gribTablesVersionNo=172; indicatorOfParameter=146; centre=98; } # 172146 -> 235033 + 235034 = { gribTablesVersionNo=172; indicatorOfParameter=147; centre=98; } # 172147 -> 235034 + 235035 = { gribTablesVersionNo=172; indicatorOfParameter=169; centre=98; } # 172169 -> 235035 + 235036 = { gribTablesVersionNo=172; indicatorOfParameter=175; centre=98; } # 172175 -> 235036 + 235037 = { gribTablesVersionNo=172; indicatorOfParameter=176; centre=98; } # 172176 -> 235037 + 235038 = { gribTablesVersionNo=172; indicatorOfParameter=177; centre=98; } # 172177 -> 235038 + 235039 = { gribTablesVersionNo=172; indicatorOfParameter=178; centre=98; } # 172178 -> 235039 + 235040 = { gribTablesVersionNo=172; indicatorOfParameter=179; centre=98; } # 172179 -> 235040 + 262000 = { gribTablesVersionNo=174; indicatorOfParameter=98; centre=98; } # 174098 -> 262000 } : long_type; diff --git a/tests/grib_ecc-1806.sh b/tests/grib_ecc-1806.sh index b271285e3..acdc49631 100755 --- a/tests/grib_ecc-1806.sh +++ b/tests/grib_ecc-1806.sh @@ -13,11 +13,9 @@ REDIRECT=/dev/null label="grib_ecc-1806_test" -tempGribA=temp.$label.1.grib -tempGribB=temp.$label.2.grib -tempFilt=temp.$label.filt +tempGrib1=temp.$label.1.grib +tempGrib2=temp.$label.2.grib tempLog=temp.$label.log -tempRef=temp.$label.ref sample_grib1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl @@ -27,21 +25,42 @@ test_conversion() param1=$1 # old paramId in GRIB1 param2=$2 # new paramId in GRIB2 short=$3 # new shortName - ${tools_dir}/grib_set -s paramId=$param1,edition=2 $sample_grib1 $tempGribA - grib_check_key_equals $tempGribA paramId,shortName "$param2 $short" - # The old paramId has been removed from GRIB2 + ${tools_dir}/grib_set -s paramId=$param1 $sample_grib1 $tempGrib1 + set +e - ${tools_dir}/grib_set -s paramId=$param1 $sample_grib2 $tempGribA 2>$REDIRECT + ${tools_dir}/grib_set -s edition=2 $tempGrib1 $tempGrib2 2>$REDIRECT status=$? set -e - [ $status -ne 0 ] + if [ $status -ne 0 ]; then + ${tools_dir}/grib_set -s stepType=avg,edition=2 $tempGrib1 $tempGrib2 + fi + grib_check_key_equals $tempGrib2 paramId,shortName "$param2 $short" + # Check the old paramId has been removed from GRIB2 + set +e + ${tools_dir}/grib_set -s paramId=$param1 $sample_grib2 $tempGrib2 >$tempLog 2>&1 + status=$? + set -e + [ $status -ne 0 ] + grep -q "no match for paramId" $tempLog } test_conversion 174098 262000 sithick test_conversion 151163 262104 t20d test_conversion 151145 262124 zos +test_conversion 130232 235135 mw +test_conversion 172146 235033 msshf +test_conversion 172147 235034 mslhf +test_conversion 55 228004 mean2t +test_conversion 56 235168 m2d +test_conversion 172169 235035 msdwswrf +test_conversion 172175 235036 msdwlwrf +test_conversion 172176 235037 msnswrf +test_conversion 172177 235038 msnlwrf +test_conversion 172178 235039 mtnswrf +test_conversion 172179 235040 mtnlwrf + # Clean up -rm -f $tempGribA $tempGribB $tempFilt $tempLog $tempRef +rm -f $tempGrib1 $tempGrib2 $tempLog From b81ab6324abf0b023a0d18d8e867135e2a7eab6d Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 19 Apr 2024 22:18:09 +0100 Subject: [PATCH 046/196] ECC-1806: Additional entries for stepType --- .../ecmf/stepTypeForConversion.def | 14 ++++++++++ definitions/grib1/section.1.def | 28 +++++++++---------- tests/grib_ecc-1806.sh | 17 ++++------- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def index e74860061..5b0733488 100644 --- a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def +++ b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def @@ -198,3 +198,17 @@ "accum"={gribTablesVersionNo=162;indicatorOfParameter=112;centre=98;} # vtpha "accum"={gribTablesVersionNo=162;indicatorOfParameter=113;centre=98;} +# mvv +"avg"={gribTablesVersionNo=130;indicatorOfParameter=232;centre=98;} +# msshfl +"avg"={gribTablesVersionNo=172; indicatorOfParameter=146;centre=98;} +# mslhfl +"avg"={gribTablesVersionNo=172;indicatorOfParameter=147;centre=98;} +"avg"={gribTablesVersionNo=128;indicatorOfParameter=55;centre=98;} +"avg"={gribTablesVersionNo=128;indicatorOfParameter=56;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=169;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=175;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=176;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=177;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=178;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=179;centre=98;} diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 778910695..566936ca7 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -328,18 +328,18 @@ meta md5Product md5(offsetSection1,section1Length,gridDefinition,section1Flags,d # ECC-1806 concept_nofail paramIdForConversion(zero) { - 228004 = { gribTablesVersionNo=128; indicatorOfParameter=55; centre=98; } # 55 -> 228004 - 235168 = { gribTablesVersionNo=128; indicatorOfParameter=56; centre=98; } # 56 -> 235168 - 235135 = { gribTablesVersionNo=130; indicatorOfParameter=232; centre=98; } # 130232 -> 235135 - 262104 = { gribTablesVersionNo=151; indicatorOfParameter=163; centre=98; } # 151163 -> 262104 - 262124 = { gribTablesVersionNo=151; indicatorOfParameter=145; centre=98; } # 151145 -> 262124 - 235033 = { gribTablesVersionNo=172; indicatorOfParameter=146; centre=98; } # 172146 -> 235033 - 235034 = { gribTablesVersionNo=172; indicatorOfParameter=147; centre=98; } # 172147 -> 235034 - 235035 = { gribTablesVersionNo=172; indicatorOfParameter=169; centre=98; } # 172169 -> 235035 - 235036 = { gribTablesVersionNo=172; indicatorOfParameter=175; centre=98; } # 172175 -> 235036 - 235037 = { gribTablesVersionNo=172; indicatorOfParameter=176; centre=98; } # 172176 -> 235037 - 235038 = { gribTablesVersionNo=172; indicatorOfParameter=177; centre=98; } # 172177 -> 235038 - 235039 = { gribTablesVersionNo=172; indicatorOfParameter=178; centre=98; } # 172178 -> 235039 - 235040 = { gribTablesVersionNo=172; indicatorOfParameter=179; centre=98; } # 172179 -> 235040 - 262000 = { gribTablesVersionNo=174; indicatorOfParameter=98; centre=98; } # 174098 -> 262000 + 228004 = { gribTablesVersionNo=128; indicatorOfParameter=55; centre=98; } # 55 -> 228004 + 235168 = { gribTablesVersionNo=128; indicatorOfParameter=56; centre=98; } # 56 -> 235168 + 235135 = { gribTablesVersionNo=130; indicatorOfParameter=232; centre=98; } # 130232 -> 235135 + 262104 = { gribTablesVersionNo=151; indicatorOfParameter=163; centre=98; } # 151163 -> 262104 + 262124 = { gribTablesVersionNo=151; indicatorOfParameter=145; centre=98; } # 151145 -> 262124 + 235033 = { gribTablesVersionNo=172; indicatorOfParameter=146; centre=98; } # 172146 -> 235033 + 235034 = { gribTablesVersionNo=172; indicatorOfParameter=147; centre=98; } # 172147 -> 235034 + 235035 = { gribTablesVersionNo=172; indicatorOfParameter=169; centre=98; } # 172169 -> 235035 + 235036 = { gribTablesVersionNo=172; indicatorOfParameter=175; centre=98; } # 172175 -> 235036 + 235037 = { gribTablesVersionNo=172; indicatorOfParameter=176; centre=98; } # 172176 -> 235037 + 235038 = { gribTablesVersionNo=172; indicatorOfParameter=177; centre=98; } # 172177 -> 235038 + 235039 = { gribTablesVersionNo=172; indicatorOfParameter=178; centre=98; } # 172178 -> 235039 + 235040 = { gribTablesVersionNo=172; indicatorOfParameter=179; centre=98; } # 172179 -> 235040 + 262000 = { gribTablesVersionNo=174; indicatorOfParameter=98; centre=98; } # 174098 -> 262000 } : long_type; diff --git a/tests/grib_ecc-1806.sh b/tests/grib_ecc-1806.sh index acdc49631..596158b8d 100755 --- a/tests/grib_ecc-1806.sh +++ b/tests/grib_ecc-1806.sh @@ -17,8 +17,8 @@ tempGrib1=temp.$label.1.grib tempGrib2=temp.$label.2.grib tempLog=temp.$label.log -sample_grib1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl -sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +sampleGrib1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +sampleGrib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl test_conversion() { @@ -26,20 +26,13 @@ test_conversion() param2=$2 # new paramId in GRIB2 short=$3 # new shortName - ${tools_dir}/grib_set -s paramId=$param1 $sample_grib1 $tempGrib1 - - set +e - ${tools_dir}/grib_set -s edition=2 $tempGrib1 $tempGrib2 2>$REDIRECT - status=$? - set -e - if [ $status -ne 0 ]; then - ${tools_dir}/grib_set -s stepType=avg,edition=2 $tempGrib1 $tempGrib2 - fi + ${tools_dir}/grib_set -s paramId=$param1 $sampleGrib1 $tempGrib1 + ${tools_dir}/grib_set -s edition=2 $tempGrib1 $tempGrib2 grib_check_key_equals $tempGrib2 paramId,shortName "$param2 $short" # Check the old paramId has been removed from GRIB2 set +e - ${tools_dir}/grib_set -s paramId=$param1 $sample_grib2 $tempGrib2 >$tempLog 2>&1 + ${tools_dir}/grib_set -s paramId=$param1 $sampleGrib2 $tempGrib2 >$tempLog 2>&1 status=$? set -e [ $status -ne 0 ] From 9dc4707525a4e22ad74e484c3dc44a8c1c062405 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 20 Apr 2024 13:01:54 +0100 Subject: [PATCH 047/196] ECC-1806: Entries for stepType --- .../localConcepts/ecmf/stepTypeForConversion.def | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def index 5b0733488..60530eddb 100644 --- a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def +++ b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def @@ -3,9 +3,9 @@ # get returns the LAST match # ECC-457: ECMWF Total Precipitation -"accum" = {timeRangeIndicator=0;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} -"accum" = {timeRangeIndicator=1;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} -"accum" = {timeRangeIndicator=10;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} +"accum"={timeRangeIndicator=0;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} +"accum"={timeRangeIndicator=1;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} +"accum"={timeRangeIndicator=10;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} # sro "accum"={gribTablesVersionNo=128;indicatorOfParameter=8;centre=98;} @@ -201,14 +201,22 @@ # mvv "avg"={gribTablesVersionNo=130;indicatorOfParameter=232;centre=98;} # msshfl -"avg"={gribTablesVersionNo=172; indicatorOfParameter=146;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=146;centre=98;} # mslhfl "avg"={gribTablesVersionNo=172;indicatorOfParameter=147;centre=98;} +# mean2t24 "avg"={gribTablesVersionNo=128;indicatorOfParameter=55;centre=98;} +# mn2d24 "avg"={gribTablesVersionNo=128;indicatorOfParameter=56;centre=98;} +# msdsrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=169;centre=98;} +# msdtrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=175;centre=98;} +# msnsrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=176;centre=98;} +# msntrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=177;centre=98;} +# mtnsrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=178;centre=98;} +# mtntrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=179;centre=98;} From 403ef585e034cc64250ab77b15029c8a3e1a6c2f Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 20 Apr 2024 13:57:17 +0100 Subject: [PATCH 048/196] ECC-1806: Move the concept into its own file --- .../ecmf/paramIdForConversion.def | 31 +++++++++++++++++++ .../ecmf/stepTypeForConversion.def | 4 +-- definitions/grib1/paramIdForConversion.def | 3 ++ definitions/grib1/section.1.def | 17 +--------- 4 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 definitions/grib1/localConcepts/ecmf/paramIdForConversion.def create mode 100644 definitions/grib1/paramIdForConversion.def diff --git a/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def b/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def new file mode 100644 index 000000000..67de48733 --- /dev/null +++ b/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def @@ -0,0 +1,31 @@ +# Concept paramIdForConversion for ECMWF +# ECC-1806 + +# 55 -> 228004 +228004 = {gribTablesVersionNo=128; indicatorOfParameter=55; centre=98;} +# 56 -> 235168 +235168 = {gribTablesVersionNo=128; indicatorOfParameter=56; centre=98;} +# 130232 -> 235135 +235135 = {gribTablesVersionNo=130; indicatorOfParameter=232; centre=98;} +# 151163 -> 262104 +262104 = {gribTablesVersionNo=151; indicatorOfParameter=163; centre=98;} +# 151145 -> 262124 +262124 = {gribTablesVersionNo=151; indicatorOfParameter=145; centre=98;} +# 172146 -> 235033 +235033 = {gribTablesVersionNo=172; indicatorOfParameter=146; centre=98;} +# 172147 -> 235034 +235034 = {gribTablesVersionNo=172; indicatorOfParameter=147; centre=98;} +# 172169 -> 235035 +235035 = {gribTablesVersionNo=172; indicatorOfParameter=169; centre=98;} +# 172175 -> 235036 +235036 = {gribTablesVersionNo=172; indicatorOfParameter=175; centre=98;} +# 172176 -> 235037 +235037 = {gribTablesVersionNo=172; indicatorOfParameter=176; centre=98;} +# 172177 -> 235038 +235038 = {gribTablesVersionNo=172; indicatorOfParameter=177; centre=98;} +# 172178 -> 235039 +235039 = {gribTablesVersionNo=172; indicatorOfParameter=178; centre=98;} +# 172179 -> 235040 +235040 = {gribTablesVersionNo=172; indicatorOfParameter=179; centre=98;} +# 174098 -> 262000 +262000 = {gribTablesVersionNo=174; indicatorOfParameter=98; centre=98;} diff --git a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def index 60530eddb..25aae31d8 100644 --- a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def +++ b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def @@ -1,8 +1,6 @@ # Concept stepTypeForConversion for ECMWF -# set uses the FIRST one -# get returns the LAST match -# ECC-457: ECMWF Total Precipitation +# ECC-457: total precipitation "accum"={timeRangeIndicator=0;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} "accum"={timeRangeIndicator=1;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} "accum"={timeRangeIndicator=10;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} diff --git a/definitions/grib1/paramIdForConversion.def b/definitions/grib1/paramIdForConversion.def new file mode 100644 index 000000000..8cd3ea212 --- /dev/null +++ b/definitions/grib1/paramIdForConversion.def @@ -0,0 +1,3 @@ +# Concept paramIdForConversion +# See ECC-1806 +0 = {dummy=0;} diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 566936ca7..d62300f27 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -327,19 +327,4 @@ meta md5Section1 md5(offsetSection1,section1Length); meta md5Product md5(offsetSection1,section1Length,gridDefinition,section1Flags,decimalScaleFactor); # ECC-1806 -concept_nofail paramIdForConversion(zero) { - 228004 = { gribTablesVersionNo=128; indicatorOfParameter=55; centre=98; } # 55 -> 228004 - 235168 = { gribTablesVersionNo=128; indicatorOfParameter=56; centre=98; } # 56 -> 235168 - 235135 = { gribTablesVersionNo=130; indicatorOfParameter=232; centre=98; } # 130232 -> 235135 - 262104 = { gribTablesVersionNo=151; indicatorOfParameter=163; centre=98; } # 151163 -> 262104 - 262124 = { gribTablesVersionNo=151; indicatorOfParameter=145; centre=98; } # 151145 -> 262124 - 235033 = { gribTablesVersionNo=172; indicatorOfParameter=146; centre=98; } # 172146 -> 235033 - 235034 = { gribTablesVersionNo=172; indicatorOfParameter=147; centre=98; } # 172147 -> 235034 - 235035 = { gribTablesVersionNo=172; indicatorOfParameter=169; centre=98; } # 172169 -> 235035 - 235036 = { gribTablesVersionNo=172; indicatorOfParameter=175; centre=98; } # 172175 -> 235036 - 235037 = { gribTablesVersionNo=172; indicatorOfParameter=176; centre=98; } # 172176 -> 235037 - 235038 = { gribTablesVersionNo=172; indicatorOfParameter=177; centre=98; } # 172177 -> 235038 - 235039 = { gribTablesVersionNo=172; indicatorOfParameter=178; centre=98; } # 172178 -> 235039 - 235040 = { gribTablesVersionNo=172; indicatorOfParameter=179; centre=98; } # 172179 -> 235040 - 262000 = { gribTablesVersionNo=174; indicatorOfParameter=98; centre=98; } # 174098 -> 262000 -} : long_type; +concept_nofail paramIdForConversion(zero, "paramIdForConversion.def", conceptsDir2, conceptsDir1) : long_type,read_only; From 19e2201d7cfeb2f170f738a06173e4e96f5a20b2 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sun, 21 Apr 2024 13:11:19 +0100 Subject: [PATCH 049/196] Initialise return values --- src/grib_accessor_class_variable.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/grib_accessor_class_variable.cc b/src/grib_accessor_class_variable.cc index 8c5bbe7b0..f47da7383 100644 --- a/src/grib_accessor_class_variable.cc +++ b/src/grib_accessor_class_variable.cc @@ -141,9 +141,9 @@ static void init(grib_accessor* a, const long length, grib_arguments* args) grib_expression* expression = grib_arguments_get_expression(hand, args, 0); const char* p = 0; size_t len = 1; - long l; + long l = 0; int ret = 0; - double d; + double d = 0; self->cname = NULL; a->length = 0; From 25bbb219501acb0d3b4a8cb175cb5c031b8a8a71 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sun, 21 Apr 2024 16:21:35 +0100 Subject: [PATCH 050/196] Add is_one_of functor --- src/grib_expression_class_functor.cc | 40 ++++++++++++++++++++++++++++ tests/CMakeLists.txt | 1 + tests/filter_is_one_of.sh | 36 +++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100755 tests/filter_is_one_of.sh diff --git a/src/grib_expression_class_functor.cc b/src/grib_expression_class_functor.cc index 701c45d5d..d15bdee23 100644 --- a/src/grib_expression_class_functor.cc +++ b/src/grib_expression_class_functor.cc @@ -169,6 +169,46 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) return GRIB_SUCCESS; } + if (STR_EQUAL(e->name, "is_one_of")) { + *lres = 0; + const char* keyName = grib_arguments_get_name(h, e->args, 0); + if (!keyName) return GRIB_INVALID_ARGUMENT; + int type = 0; + int err = grib_get_native_type(h, keyName, &type); + if (err) return err; + if (type == GRIB_TYPE_STRING) { + int n = 1; // skip the 1st argument which is the key + char keyValue[254] = {0,}; + size_t len = sizeof(keyValue); + err = grib_get_string(h, keyName, keyValue, &len); + if (err) return err; + const char* sValue = 0; + while (( sValue = grib_arguments_get_string(h, e->args, n++)) != NULL ) { + if (STR_EQUAL(keyValue, sValue)) { + *lres = 1; + return GRIB_SUCCESS; + } + } + } + else if (type == GRIB_TYPE_LONG) { + long keyValue = 0; + err = grib_get_long(h, keyName, &keyValue); + if (err) return err; + int n = grib_arguments_get_count(e->args); + for (int i = 1; i < n; ++i) { // skip 1st argument which is the key + long lValue = grib_arguments_get_long(h, e->args, i); + if (keyValue == lValue) { + *lres = 1; + return GRIB_SUCCESS; + } + } + } + else if (type == GRIB_TYPE_DOUBLE) { + return GRIB_NOT_IMPLEMENTED; + } + return GRIB_SUCCESS; + } + if (STR_EQUAL(e->name, "gribex_mode_on")) { *lres = h->context->gribex_mode_on ? 1 : 0; return GRIB_SUCCESS; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index dac9083c1..56bfa91ed 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -105,6 +105,7 @@ if( HAVE_BUILD_TOOLS ) grib_packing_order filter_substr filter_size + filter_is_one_of filter_is_in_list filter_transient_darray grib_uerra diff --git a/tests/filter_is_one_of.sh b/tests/filter_is_one_of.sh new file mode 100755 index 000000000..96099d60e --- /dev/null +++ b/tests/filter_is_one_of.sh @@ -0,0 +1,36 @@ +#!/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="filter_is_one_of_test" +tempFilt=temp.$label.filt +tempOut=temp.$label.txt + +input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +grib_check_key_equals $input "shortName,paramId,typeOfLevel" "t 130 surface" + +cat > $tempFilt < Date: Sun, 21 Apr 2024 17:53:13 +0100 Subject: [PATCH 051/196] Functor: clean up --- src/grib_expression_class_functor.cc | 32 +++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/grib_expression_class_functor.cc b/src/grib_expression_class_functor.cc index d15bdee23..530654ea2 100644 --- a/src/grib_expression_class_functor.cc +++ b/src/grib_expression_class_functor.cc @@ -94,10 +94,10 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) if (STR_EQUAL(e->name, "size")) { *lres = 0; - const char* p = grib_arguments_get_name(h, e->args, 0); - if (p) { + const char* keyName = grib_arguments_get_name(h, e->args, 0); + if (keyName) { size_t size = 0; - int err = grib_get_size(h, p, &size); + int err = grib_get_size(h, keyName, &size); if (err) return err; *lres = (long)size; return GRIB_SUCCESS; @@ -106,17 +106,17 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) } if (STR_EQUAL(e->name, "missing")) { - const char* p = grib_arguments_get_name(h, e->args, 0); - if (p) { + const char* keyName = grib_arguments_get_name(h, e->args, 0); + if (keyName) { long val = 0; int err = 0; if (h->product_kind == PRODUCT_BUFR) { - int ismiss = grib_is_missing(h, p, &err); + int ismiss = grib_is_missing(h, keyName, &err); if (err) return err; *lres = ismiss; return GRIB_SUCCESS; } - err = grib_get_long_internal(h, p, &val); + err = grib_get_long_internal(h, keyName, &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 @@ -133,11 +133,10 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) } if (STR_EQUAL(e->name, "defined")) { - const char* p = grib_arguments_get_name(h, e->args, 0); - - if (p) { - const grib_accessor* a = grib_find_accessor(h, p); - *lres = a != NULL ? 1 : 0; + const char* keyName = grib_arguments_get_name(h, e->args, 0); + if (keyName) { + const grib_accessor* a = grib_find_accessor(h, keyName); + *lres = a != NULL ? 1 : 0; return GRIB_SUCCESS; } *lres = 0; @@ -176,15 +175,15 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) int type = 0; int err = grib_get_native_type(h, keyName, &type); if (err) return err; + int n = grib_arguments_get_count(e->args); if (type == GRIB_TYPE_STRING) { - int n = 1; // skip the 1st argument which is the key char keyValue[254] = {0,}; size_t len = sizeof(keyValue); err = grib_get_string(h, keyName, keyValue, &len); if (err) return err; - const char* sValue = 0; - while (( sValue = grib_arguments_get_string(h, e->args, n++)) != NULL ) { - if (STR_EQUAL(keyValue, sValue)) { + for (int i = 1; i < n; ++i) { // skip 1st argument which is the key + const char* sValue = grib_arguments_get_string(h, e->args, i); + if (sValue && STR_EQUAL(keyValue, sValue)) { *lres = 1; return GRIB_SUCCESS; } @@ -194,7 +193,6 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) long keyValue = 0; err = grib_get_long(h, keyName, &keyValue); if (err) return err; - int n = grib_arguments_get_count(e->args); for (int i = 1; i < n; ++i) { // skip 1st argument which is the key long lValue = grib_arguments_get_long(h, e->args, i); if (keyValue == lValue) { From 8a9186a37aa3f749408b16c3aa48346201f32d51 Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 22 Apr 2024 13:35:25 +0100 Subject: [PATCH 052/196] Testing: Detect empty concept value --- definitions/check_grib_defs.pl | 1 + tests/grib_check_param_concepts.cc | 6 ++++++ tests/grib_check_param_concepts.sh | 9 ++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/definitions/check_grib_defs.pl b/definitions/check_grib_defs.pl index dba8c0e27..d011680f3 100755 --- a/definitions/check_grib_defs.pl +++ b/definitions/check_grib_defs.pl @@ -204,6 +204,7 @@ sub process { } elsif ($this =~ /'(.*)' *= *{/) { $concept = $1; + die "File: $filename, line: $lineNum: Value is empty." if ($concept eq ''); die "File: $filename, line: $lineNum: Value contains invalid characters." if (non_printable($concept)); if ($filename eq 'cfVarName.def') { #if ($concept =~ /^[0-9]/) { diff --git a/tests/grib_check_param_concepts.cc b/tests/grib_check_param_concepts.cc index 077d61e14..d6720c4c3 100644 --- a/tests/grib_check_param_concepts.cc +++ b/tests/grib_check_param_concepts.cc @@ -59,6 +59,7 @@ static int scale_factor_missing(const char* value) static int grib_check_param_concepts(const char* key, const char* filename) { int isLocal = 0; + int count = 0; grib_concept_value* concept_value = grib_parse_concept_file(NULL, filename); if (!concept_value) return GRIB_IO_PROBLEM; @@ -67,6 +68,11 @@ static int grib_check_param_concepts(const char* key, const char* filename) isLocal = 1; } while (concept_value) { + count++; + if (strlen(concept_value->name) == 0) { + fprintf(stderr, "%s %s: Empty concept value (count=%d)\n", key, concept_value->name, count); + Assert(0); + } grib_concept_condition* concept_condition = concept_value->conditions; /* Convention: * -1 key not present diff --git a/tests/grib_check_param_concepts.sh b/tests/grib_check_param_concepts.sh index bf67e7ab8..004ca49b8 100755 --- a/tests/grib_check_param_concepts.sh +++ b/tests/grib_check_param_concepts.sh @@ -36,6 +36,12 @@ for a_dataset in $datasets; do $EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/$a_dataset/shortName.def done +# Check WMO name.def etc +$EXEC ${test_dir}/grib_check_param_concepts name $ECCODES_DEFINITION_PATH/grib2/name.def +$EXEC ${test_dir}/grib_check_param_concepts units $ECCODES_DEFINITION_PATH/grib2/units.def +$EXEC ${test_dir}/grib_check_param_concepts units $ECCODES_DEFINITION_PATH/grib2/cfVarName.def + + # Check the group: name.def paramId.def shortName.def units.def cfVarName.def # ---------------------------------------------------------------------------- # Check whether the Test::More Perl module is available @@ -56,11 +62,8 @@ defs_dirs=" $ECCODES_DEFINITION_PATH/grib1/localConcepts/ecmf $ECCODES_DEFINITION_PATH/grib2/localConcepts/ecmf - $ECCODES_DEFINITION_PATH/grib1/localConcepts/ammc - $ECCODES_DEFINITION_PATH/grib1/localConcepts/eidb $ECCODES_DEFINITION_PATH/grib1/localConcepts/ekmi $ECCODES_DEFINITION_PATH/grib1/localConcepts/enmi - $ECCODES_DEFINITION_PATH/grib1/localConcepts/eswi $ECCODES_DEFINITION_PATH/grib1/localConcepts/lfpw $ECCODES_DEFINITION_PATH/grib1/localConcepts/lowm $ECCODES_DEFINITION_PATH/grib1/localConcepts/rjtd From 0411d7793b39e05513bf7c65eaba97486c7049c7 Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 22 Apr 2024 13:36:01 +0100 Subject: [PATCH 053/196] Debugging --- src/grib_loader_from_handle.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/grib_loader_from_handle.cc b/src/grib_loader_from_handle.cc index a423c31cc..765915bbd 100644 --- a/src/grib_loader_from_handle.cc +++ b/src/grib_loader_from_handle.cc @@ -10,6 +10,10 @@ #include "grib_api_internal.h" +#if defined DEBUG && ! defined GRIB_PTHREADS + #define MY_DEBUG +#endif + static int copy_values(grib_handle* h, grib_accessor* ga) { int i, j, k; @@ -62,7 +66,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ unsigned char* uval = NULL; long* lval = NULL; double* dval = NULL; -#ifdef DEBUG +#ifdef MY_DEBUG static int first = 1; static const char* missing = 0; #endif @@ -123,7 +127,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ if (ret != GRIB_SUCCESS) { name = ga->name; -#ifdef DEBUG +#ifdef MY_DEBUG if (first) { missing = codes_getenv("ECCODES_PRINT_MISSING"); first = 0; @@ -131,7 +135,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ #endif grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying [%s] failed: %s", name, grib_get_error_message(ret)); -#ifdef DEBUG +#ifdef MY_DEBUG if (missing) { fprintf(stdout, "REPARSE: no value for %s", name); if (default_value) From 9fd499d5ac21c1c032d238d16f4183535433e505 Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 22 Apr 2024 16:34:48 +0100 Subject: [PATCH 054/196] ECC-1805: GRIB2: Sub-hourly: Fix race condition --- src/grib_accessor_class_optimal_step_units.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/grib_accessor_class_optimal_step_units.cc b/src/grib_accessor_class_optimal_step_units.cc index 79f4c1dcf..494667e9a 100644 --- a/src/grib_accessor_class_optimal_step_units.cc +++ b/src/grib_accessor_class_optimal_step_units.cc @@ -25,6 +25,7 @@ MEMBERS = const char* forecast_time_unit MEMBERS = const char* time_range_value MEMBERS = const char* time_range_unit + MEMBERS = long overwriteStepUnits END_CLASS_DEF */ @@ -59,6 +60,7 @@ typedef struct grib_accessor_optimal_step_units const char* forecast_time_unit; const char* time_range_value; const char* time_range_unit; + long overwriteStepUnits; } grib_accessor_optimal_step_units; extern grib_accessor_class* grib_accessor_class_gen; @@ -127,6 +129,7 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->time_range_value = grib_arguments_get_name(hand, c, n++); self->time_range_unit = grib_arguments_get_name(hand, c, n++); a->length = 0; + self->overwriteStepUnits = eccodes::Unit{eccodes::Unit::Value::MISSING}.value(); } static void dump(grib_accessor* a, grib_dumper* dumper) @@ -170,11 +173,11 @@ static int pack_expression(grib_accessor* a, grib_expression* e) return ret; } -static long staticStepUnits = eccodes::Unit{eccodes::Unit::Value::MISSING}.value(); - static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_handle* h = grib_handle_of_accessor(a); + grib_accessor_optimal_step_units* self = (grib_accessor_optimal_step_units*)a; + auto supported_units = eccodes::Unit::list_supported_units(); try { eccodes::Unit unit{*val}; // throws if not supported @@ -196,7 +199,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } int ret; - staticStepUnits = *val; + self->overwriteStepUnits = *val; if ((ret = grib_set_long_internal(h, "forceStepUnits", *val)) != GRIB_SUCCESS) { return ret; } @@ -206,9 +209,10 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) static int unpack_long(grib_accessor* a, long* val, size_t* len) { + grib_accessor_optimal_step_units* self = (grib_accessor_optimal_step_units*)a; try { - if (eccodes::Unit{staticStepUnits} != eccodes::Unit{eccodes::Unit::Value::MISSING}) { - *val = staticStepUnits; + if (eccodes::Unit{self->overwriteStepUnits} != eccodes::Unit{eccodes::Unit::Value::MISSING}) { + *val = self->overwriteStepUnits; return GRIB_SUCCESS; } From d4464199b7543a45324a17ebacd23e1dc7fd71a6 Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 23 Apr 2024 12:17:03 +0100 Subject: [PATCH 055/196] Testing: Remove temporary files --- tests/codes_get_string.sh | 2 +- tests/grib2_version.sh | 1 - tests/grib_indexing.sh | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/codes_get_string.sh b/tests/codes_get_string.sh index 188c81a3e..98d68f671 100755 --- a/tests/codes_get_string.sh +++ b/tests/codes_get_string.sh @@ -44,4 +44,4 @@ $EXEC ${test_dir}/codes_get_string GTS "$input" theMessage 2> $tempText grep -q "Buffer too small" $tempText # Clean up -rm -f $tempText +rm -f $tempText $tempGrib diff --git a/tests/grib2_version.sh b/tests/grib2_version.sh index 6e6daef42..8b3119767 100755 --- a/tests/grib2_version.sh +++ b/tests/grib2_version.sh @@ -62,7 +62,6 @@ ${tools_dir}/grib_filter $tempFilt $sample2 > $tempText 2>&1 status=$? set -e [ $status -ne 0 ] -cat $tempText grep -q "Definition files version .* is greater than engine version" $tempText rm -f $tempFilt $temp $tempText diff --git a/tests/grib_indexing.sh b/tests/grib_indexing.sh index 5f73f7039..1e3001f16 100755 --- a/tests/grib_indexing.sh +++ b/tests/grib_indexing.sh @@ -208,5 +208,5 @@ grep -q "End of resource reached" $tempOut # Clean up -rm -f $tempOut $tempRef +rm -f $temp $tempOut $tempRef rm -f $tempIndex $tempIndex1 $tempIndex2 $tempGribFile1 $tempGribFile2 From 572cbcce54349cfd0b42cb528f4906ecada1dbda Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 23 Apr 2024 12:18:04 +0100 Subject: [PATCH 056/196] ECC-1808: GRIB2: Update tables/templates with the latest WMO V33.0.0 --- definitions/grib2/boot.def | 2 +- definitions/grib2/tables/1.0.table | 5 +- definitions/grib2/tables/33/0.0.table | 13 + definitions/grib2/tables/33/1.0.table | 38 ++ definitions/grib2/tables/33/1.1.table | 4 + definitions/grib2/tables/33/1.2.table | 10 + definitions/grib2/tables/33/1.3.table | 18 + definitions/grib2/tables/33/1.4.table | 13 + definitions/grib2/tables/33/1.5.table | 7 + definitions/grib2/tables/33/1.6.table | 8 + definitions/grib2/tables/33/3.0.table | 6 + definitions/grib2/tables/33/3.1.table | 57 ++ definitions/grib2/tables/33/3.10.table | 8 + definitions/grib2/tables/33/3.11.table | 7 + definitions/grib2/tables/33/3.12.table | 6 + definitions/grib2/tables/33/3.13.table | 8 + definitions/grib2/tables/33/3.15.table | 23 + definitions/grib2/tables/33/3.2.table | 16 + definitions/grib2/tables/33/3.20.table | 6 + definitions/grib2/tables/33/3.21.table | 8 + definitions/grib2/tables/33/3.25.table | 10 + definitions/grib2/tables/33/3.3.table | 9 + definitions/grib2/tables/33/3.4.table | 17 + definitions/grib2/tables/33/3.5.table | 5 + definitions/grib2/tables/33/3.6.table | 3 + definitions/grib2/tables/33/3.7.table | 5 + definitions/grib2/tables/33/3.8.table | 10 + definitions/grib2/tables/33/3.9.table | 4 + definitions/grib2/tables/33/4.0.table | 124 +++++ definitions/grib2/tables/33/4.1.0.table | 29 + definitions/grib2/tables/33/4.1.1.table | 7 + definitions/grib2/tables/33/4.1.10.table | 10 + definitions/grib2/tables/33/4.1.2.table | 11 + definitions/grib2/tables/33/4.1.20.table | 8 + definitions/grib2/tables/33/4.1.3.table | 11 + definitions/grib2/tables/33/4.1.4.table | 15 + definitions/grib2/tables/33/4.10.table | 22 + definitions/grib2/tables/33/4.100.table | 10 + definitions/grib2/tables/33/4.101.table | 13 + definitions/grib2/tables/33/4.102.table | 22 + definitions/grib2/tables/33/4.103.table | 9 + definitions/grib2/tables/33/4.104.table | 15 + definitions/grib2/tables/33/4.105.table | 6 + definitions/grib2/tables/33/4.11.table | 10 + definitions/grib2/tables/33/4.12.table | 7 + definitions/grib2/tables/33/4.13.table | 6 + definitions/grib2/tables/33/4.14.table | 6 + definitions/grib2/tables/33/4.15.table | 11 + definitions/grib2/tables/33/4.16.table | 10 + definitions/grib2/tables/33/4.192.table | 4 + definitions/grib2/tables/33/4.2.0.0.table | 37 ++ definitions/grib2/tables/33/4.2.0.1.table | 174 ++++++ definitions/grib2/tables/33/4.2.0.13.table | 5 + definitions/grib2/tables/33/4.2.0.14.table | 7 + definitions/grib2/tables/33/4.2.0.15.table | 21 + definitions/grib2/tables/33/4.2.0.16.table | 10 + definitions/grib2/tables/33/4.2.0.17.table | 7 + definitions/grib2/tables/33/4.2.0.18.table | 31 ++ definitions/grib2/tables/33/4.2.0.19.table | 55 ++ definitions/grib2/tables/33/4.2.0.190.table | 5 + definitions/grib2/tables/33/4.2.0.191.table | 12 + definitions/grib2/tables/33/4.2.0.2.table | 72 +++ definitions/grib2/tables/33/4.2.0.20.table | 69 +++ definitions/grib2/tables/33/4.2.0.21.table | 27 + definitions/grib2/tables/33/4.2.0.22.table | 11 + definitions/grib2/tables/33/4.2.0.3.table | 51 ++ definitions/grib2/tables/33/4.2.0.4.table | 33 ++ definitions/grib2/tables/33/4.2.0.5.table | 18 + definitions/grib2/tables/33/4.2.0.6.table | 51 ++ definitions/grib2/tables/33/4.2.0.7.table | 25 + definitions/grib2/tables/33/4.2.1.0.table | 25 + definitions/grib2/tables/33/4.2.1.1.table | 7 + definitions/grib2/tables/33/4.2.1.2.table | 28 + definitions/grib2/tables/33/4.2.10.0.table | 103 ++++ definitions/grib2/tables/33/4.2.10.1.table | 11 + definitions/grib2/tables/33/4.2.10.191.table | 9 + definitions/grib2/tables/33/4.2.10.2.table | 34 ++ definitions/grib2/tables/33/4.2.10.3.table | 26 + definitions/grib2/tables/33/4.2.10.4.table | 54 ++ definitions/grib2/tables/33/4.2.2.0.table | 68 +++ definitions/grib2/tables/33/4.2.2.3.table | 35 ++ definitions/grib2/tables/33/4.2.2.4.table | 41 ++ definitions/grib2/tables/33/4.2.2.5.table | 6 + definitions/grib2/tables/33/4.2.2.6.table | 13 + definitions/grib2/tables/33/4.2.20.0.table | 13 + definitions/grib2/tables/33/4.2.20.1.table | 14 + definitions/grib2/tables/33/4.2.20.2.table | 5 + definitions/grib2/tables/33/4.2.20.3.table | 14 + definitions/grib2/tables/33/4.2.3.0.table | 14 + definitions/grib2/tables/33/4.2.3.1.table | 38 ++ definitions/grib2/tables/33/4.2.3.2.table | 24 + definitions/grib2/tables/33/4.2.3.3.table | 4 + definitions/grib2/tables/33/4.2.3.4.table | 10 + definitions/grib2/tables/33/4.2.3.5.table | 7 + definitions/grib2/tables/33/4.2.3.6.table | 7 + definitions/grib2/tables/33/4.2.4.0.table | 10 + definitions/grib2/tables/33/4.2.4.1.table | 8 + definitions/grib2/tables/33/4.2.4.10.table | 12 + definitions/grib2/tables/33/4.2.4.2.table | 18 + definitions/grib2/tables/33/4.2.4.3.table | 12 + definitions/grib2/tables/33/4.2.4.4.table | 11 + definitions/grib2/tables/33/4.2.4.5.table | 8 + definitions/grib2/tables/33/4.2.4.6.table | 11 + definitions/grib2/tables/33/4.2.4.7.table | 8 + definitions/grib2/tables/33/4.2.4.8.table | 13 + definitions/grib2/tables/33/4.2.4.9.table | 7 + definitions/grib2/tables/33/4.201.table | 17 + definitions/grib2/tables/33/4.202.table | 4 + definitions/grib2/tables/33/4.203.table | 26 + definitions/grib2/tables/33/4.204.table | 9 + definitions/grib2/tables/33/4.205.table | 6 + definitions/grib2/tables/33/4.206.table | 6 + definitions/grib2/tables/33/4.207.table | 10 + definitions/grib2/tables/33/4.208.table | 9 + definitions/grib2/tables/33/4.209.table | 9 + definitions/grib2/tables/33/4.210.table | 6 + definitions/grib2/tables/33/4.211.table | 7 + definitions/grib2/tables/33/4.212.table | 18 + definitions/grib2/tables/33/4.213.table | 16 + definitions/grib2/tables/33/4.214.table | 11 + definitions/grib2/tables/33/4.215.table | 9 + definitions/grib2/tables/33/4.216.table | 5 + definitions/grib2/tables/33/4.217.table | 8 + definitions/grib2/tables/33/4.218.table | 46 ++ definitions/grib2/tables/33/4.219.table | 8 + definitions/grib2/tables/33/4.220.table | 6 + definitions/grib2/tables/33/4.221.table | 6 + definitions/grib2/tables/33/4.222.table | 6 + definitions/grib2/tables/33/4.223.table | 5 + definitions/grib2/tables/33/4.224.table | 18 + definitions/grib2/tables/33/4.225.table | 2 + definitions/grib2/tables/33/4.227.table | 9 + definitions/grib2/tables/33/4.228.table | 8 + definitions/grib2/tables/33/4.230.table | 534 +++++++++++++++++++ definitions/grib2/tables/33/4.233.table | 534 +++++++++++++++++++ definitions/grib2/tables/33/4.234.table | 21 + definitions/grib2/tables/33/4.236.table | 8 + definitions/grib2/tables/33/4.238.table | 34 ++ definitions/grib2/tables/33/4.239.table | 17 + definitions/grib2/tables/33/4.240.table | 13 + definitions/grib2/tables/33/4.241.table | 12 + definitions/grib2/tables/33/4.242.table | 10 + definitions/grib2/tables/33/4.243.table | 43 ++ definitions/grib2/tables/33/4.244.table | 7 + definitions/grib2/tables/33/4.246.table | 7 + definitions/grib2/tables/33/4.247.table | 7 + definitions/grib2/tables/33/4.248.table | 6 + definitions/grib2/tables/33/4.249.table | 7 + definitions/grib2/tables/33/4.250.table | 14 + definitions/grib2/tables/33/4.251.table | 7 + definitions/grib2/tables/33/4.252.table | 165 ++++++ definitions/grib2/tables/33/4.3.table | 26 + definitions/grib2/tables/33/4.333.table | 12 + definitions/grib2/tables/33/4.335.table | 7 + definitions/grib2/tables/33/4.336.table | 13 + definitions/grib2/tables/33/4.4.table | 17 + definitions/grib2/tables/33/4.5.table | 95 ++++ definitions/grib2/tables/33/4.6.table | 9 + definitions/grib2/tables/33/4.7.table | 15 + definitions/grib2/tables/33/4.8.table | 6 + definitions/grib2/tables/33/4.9.table | 14 + definitions/grib2/tables/33/4.91.table | 16 + definitions/grib2/tables/33/5.0.table | 22 + definitions/grib2/tables/33/5.1.table | 6 + definitions/grib2/tables/33/5.2.table | 8 + definitions/grib2/tables/33/5.25.table | 9 + definitions/grib2/tables/33/5.26.table | 5 + definitions/grib2/tables/33/5.3.table | 7 + definitions/grib2/tables/33/5.4.table | 6 + definitions/grib2/tables/33/5.40.table | 5 + definitions/grib2/tables/33/5.5.table | 7 + definitions/grib2/tables/33/5.6.table | 7 + definitions/grib2/tables/33/5.7.table | 7 + definitions/grib2/tables/33/6.0.table | 6 + 174 files changed, 4199 insertions(+), 3 deletions(-) create mode 100644 definitions/grib2/tables/33/0.0.table create mode 100644 definitions/grib2/tables/33/1.0.table create mode 100644 definitions/grib2/tables/33/1.1.table create mode 100644 definitions/grib2/tables/33/1.2.table create mode 100644 definitions/grib2/tables/33/1.3.table create mode 100644 definitions/grib2/tables/33/1.4.table create mode 100644 definitions/grib2/tables/33/1.5.table create mode 100644 definitions/grib2/tables/33/1.6.table create mode 100644 definitions/grib2/tables/33/3.0.table create mode 100644 definitions/grib2/tables/33/3.1.table create mode 100644 definitions/grib2/tables/33/3.10.table create mode 100644 definitions/grib2/tables/33/3.11.table create mode 100644 definitions/grib2/tables/33/3.12.table create mode 100644 definitions/grib2/tables/33/3.13.table create mode 100644 definitions/grib2/tables/33/3.15.table create mode 100644 definitions/grib2/tables/33/3.2.table create mode 100644 definitions/grib2/tables/33/3.20.table create mode 100644 definitions/grib2/tables/33/3.21.table create mode 100644 definitions/grib2/tables/33/3.25.table create mode 100644 definitions/grib2/tables/33/3.3.table create mode 100644 definitions/grib2/tables/33/3.4.table create mode 100644 definitions/grib2/tables/33/3.5.table create mode 100644 definitions/grib2/tables/33/3.6.table create mode 100644 definitions/grib2/tables/33/3.7.table create mode 100644 definitions/grib2/tables/33/3.8.table create mode 100644 definitions/grib2/tables/33/3.9.table create mode 100644 definitions/grib2/tables/33/4.0.table create mode 100644 definitions/grib2/tables/33/4.1.0.table create mode 100644 definitions/grib2/tables/33/4.1.1.table create mode 100644 definitions/grib2/tables/33/4.1.10.table create mode 100644 definitions/grib2/tables/33/4.1.2.table create mode 100644 definitions/grib2/tables/33/4.1.20.table create mode 100644 definitions/grib2/tables/33/4.1.3.table create mode 100644 definitions/grib2/tables/33/4.1.4.table create mode 100644 definitions/grib2/tables/33/4.10.table create mode 100644 definitions/grib2/tables/33/4.100.table create mode 100644 definitions/grib2/tables/33/4.101.table create mode 100644 definitions/grib2/tables/33/4.102.table create mode 100644 definitions/grib2/tables/33/4.103.table create mode 100644 definitions/grib2/tables/33/4.104.table create mode 100644 definitions/grib2/tables/33/4.105.table create mode 100644 definitions/grib2/tables/33/4.11.table create mode 100644 definitions/grib2/tables/33/4.12.table create mode 100644 definitions/grib2/tables/33/4.13.table create mode 100644 definitions/grib2/tables/33/4.14.table create mode 100644 definitions/grib2/tables/33/4.15.table create mode 100644 definitions/grib2/tables/33/4.16.table create mode 100644 definitions/grib2/tables/33/4.192.table create mode 100644 definitions/grib2/tables/33/4.2.0.0.table create mode 100644 definitions/grib2/tables/33/4.2.0.1.table create mode 100644 definitions/grib2/tables/33/4.2.0.13.table create mode 100644 definitions/grib2/tables/33/4.2.0.14.table create mode 100644 definitions/grib2/tables/33/4.2.0.15.table create mode 100644 definitions/grib2/tables/33/4.2.0.16.table create mode 100644 definitions/grib2/tables/33/4.2.0.17.table create mode 100644 definitions/grib2/tables/33/4.2.0.18.table create mode 100644 definitions/grib2/tables/33/4.2.0.19.table create mode 100644 definitions/grib2/tables/33/4.2.0.190.table create mode 100644 definitions/grib2/tables/33/4.2.0.191.table create mode 100644 definitions/grib2/tables/33/4.2.0.2.table create mode 100644 definitions/grib2/tables/33/4.2.0.20.table create mode 100644 definitions/grib2/tables/33/4.2.0.21.table create mode 100644 definitions/grib2/tables/33/4.2.0.22.table create mode 100644 definitions/grib2/tables/33/4.2.0.3.table create mode 100644 definitions/grib2/tables/33/4.2.0.4.table create mode 100644 definitions/grib2/tables/33/4.2.0.5.table create mode 100644 definitions/grib2/tables/33/4.2.0.6.table create mode 100644 definitions/grib2/tables/33/4.2.0.7.table create mode 100644 definitions/grib2/tables/33/4.2.1.0.table create mode 100644 definitions/grib2/tables/33/4.2.1.1.table create mode 100644 definitions/grib2/tables/33/4.2.1.2.table create mode 100644 definitions/grib2/tables/33/4.2.10.0.table create mode 100644 definitions/grib2/tables/33/4.2.10.1.table create mode 100644 definitions/grib2/tables/33/4.2.10.191.table create mode 100644 definitions/grib2/tables/33/4.2.10.2.table create mode 100644 definitions/grib2/tables/33/4.2.10.3.table create mode 100644 definitions/grib2/tables/33/4.2.10.4.table create mode 100644 definitions/grib2/tables/33/4.2.2.0.table create mode 100644 definitions/grib2/tables/33/4.2.2.3.table create mode 100644 definitions/grib2/tables/33/4.2.2.4.table create mode 100644 definitions/grib2/tables/33/4.2.2.5.table create mode 100644 definitions/grib2/tables/33/4.2.2.6.table create mode 100644 definitions/grib2/tables/33/4.2.20.0.table create mode 100644 definitions/grib2/tables/33/4.2.20.1.table create mode 100644 definitions/grib2/tables/33/4.2.20.2.table create mode 100644 definitions/grib2/tables/33/4.2.20.3.table create mode 100644 definitions/grib2/tables/33/4.2.3.0.table create mode 100644 definitions/grib2/tables/33/4.2.3.1.table create mode 100644 definitions/grib2/tables/33/4.2.3.2.table create mode 100644 definitions/grib2/tables/33/4.2.3.3.table create mode 100644 definitions/grib2/tables/33/4.2.3.4.table create mode 100644 definitions/grib2/tables/33/4.2.3.5.table create mode 100644 definitions/grib2/tables/33/4.2.3.6.table create mode 100644 definitions/grib2/tables/33/4.2.4.0.table create mode 100644 definitions/grib2/tables/33/4.2.4.1.table create mode 100644 definitions/grib2/tables/33/4.2.4.10.table create mode 100644 definitions/grib2/tables/33/4.2.4.2.table create mode 100644 definitions/grib2/tables/33/4.2.4.3.table create mode 100644 definitions/grib2/tables/33/4.2.4.4.table create mode 100644 definitions/grib2/tables/33/4.2.4.5.table create mode 100644 definitions/grib2/tables/33/4.2.4.6.table create mode 100644 definitions/grib2/tables/33/4.2.4.7.table create mode 100644 definitions/grib2/tables/33/4.2.4.8.table create mode 100644 definitions/grib2/tables/33/4.2.4.9.table create mode 100644 definitions/grib2/tables/33/4.201.table create mode 100644 definitions/grib2/tables/33/4.202.table create mode 100644 definitions/grib2/tables/33/4.203.table create mode 100644 definitions/grib2/tables/33/4.204.table create mode 100644 definitions/grib2/tables/33/4.205.table create mode 100644 definitions/grib2/tables/33/4.206.table create mode 100644 definitions/grib2/tables/33/4.207.table create mode 100644 definitions/grib2/tables/33/4.208.table create mode 100644 definitions/grib2/tables/33/4.209.table create mode 100644 definitions/grib2/tables/33/4.210.table create mode 100644 definitions/grib2/tables/33/4.211.table create mode 100644 definitions/grib2/tables/33/4.212.table create mode 100644 definitions/grib2/tables/33/4.213.table create mode 100644 definitions/grib2/tables/33/4.214.table create mode 100644 definitions/grib2/tables/33/4.215.table create mode 100644 definitions/grib2/tables/33/4.216.table create mode 100644 definitions/grib2/tables/33/4.217.table create mode 100644 definitions/grib2/tables/33/4.218.table create mode 100644 definitions/grib2/tables/33/4.219.table create mode 100644 definitions/grib2/tables/33/4.220.table create mode 100644 definitions/grib2/tables/33/4.221.table create mode 100644 definitions/grib2/tables/33/4.222.table create mode 100644 definitions/grib2/tables/33/4.223.table create mode 100644 definitions/grib2/tables/33/4.224.table create mode 100644 definitions/grib2/tables/33/4.225.table create mode 100644 definitions/grib2/tables/33/4.227.table create mode 100644 definitions/grib2/tables/33/4.228.table create mode 100644 definitions/grib2/tables/33/4.230.table create mode 100644 definitions/grib2/tables/33/4.233.table create mode 100644 definitions/grib2/tables/33/4.234.table create mode 100644 definitions/grib2/tables/33/4.236.table create mode 100644 definitions/grib2/tables/33/4.238.table create mode 100644 definitions/grib2/tables/33/4.239.table create mode 100644 definitions/grib2/tables/33/4.240.table create mode 100644 definitions/grib2/tables/33/4.241.table create mode 100644 definitions/grib2/tables/33/4.242.table create mode 100644 definitions/grib2/tables/33/4.243.table create mode 100644 definitions/grib2/tables/33/4.244.table create mode 100644 definitions/grib2/tables/33/4.246.table create mode 100644 definitions/grib2/tables/33/4.247.table create mode 100644 definitions/grib2/tables/33/4.248.table create mode 100644 definitions/grib2/tables/33/4.249.table create mode 100644 definitions/grib2/tables/33/4.250.table create mode 100644 definitions/grib2/tables/33/4.251.table create mode 100644 definitions/grib2/tables/33/4.252.table create mode 100644 definitions/grib2/tables/33/4.3.table create mode 100644 definitions/grib2/tables/33/4.333.table create mode 100644 definitions/grib2/tables/33/4.335.table create mode 100644 definitions/grib2/tables/33/4.336.table create mode 100644 definitions/grib2/tables/33/4.4.table create mode 100644 definitions/grib2/tables/33/4.5.table create mode 100644 definitions/grib2/tables/33/4.6.table create mode 100644 definitions/grib2/tables/33/4.7.table create mode 100644 definitions/grib2/tables/33/4.8.table create mode 100644 definitions/grib2/tables/33/4.9.table create mode 100644 definitions/grib2/tables/33/4.91.table create mode 100644 definitions/grib2/tables/33/5.0.table create mode 100644 definitions/grib2/tables/33/5.1.table create mode 100644 definitions/grib2/tables/33/5.2.table create mode 100644 definitions/grib2/tables/33/5.25.table create mode 100644 definitions/grib2/tables/33/5.26.table create mode 100644 definitions/grib2/tables/33/5.3.table create mode 100644 definitions/grib2/tables/33/5.4.table create mode 100644 definitions/grib2/tables/33/5.40.table create mode 100644 definitions/grib2/tables/33/5.5.table create mode 100644 definitions/grib2/tables/33/5.6.table create mode 100644 definitions/grib2/tables/33/5.7.table create mode 100644 definitions/grib2/tables/33/6.0.table diff --git a/definitions/grib2/boot.def b/definitions/grib2/boot.def index 7cba8747b..b92116397 100644 --- a/definitions/grib2/boot.def +++ b/definitions/grib2/boot.def @@ -11,7 +11,7 @@ # See https://community.wmo.int/activity-areas/wmo-codes/manual-codes/latest-version constant tablesVersionLatestOfficial = 32 : edition_specific; # If this is different from the official version, then it is the pre-operational version -constant tablesVersionLatest = 32 : edition_specific; +constant tablesVersionLatest = 33 : edition_specific; constant false = 0 : hidden; constant true = 1 : hidden; diff --git a/definitions/grib2/tables/1.0.table b/definitions/grib2/tables/1.0.table index 7b8026752..432c0f0e5 100644 --- a/definitions/grib2/tables/1.0.table +++ b/definitions/grib2/tables/1.0.table @@ -32,6 +32,7 @@ 30 30 Version implemented on 15 November 2022 31 31 Version implemented on 15 May 2023 32 32 Version implemented on 30 November 2023 -33 33 Pre-operational to be implemented by next amendment -# 34-254 Future versions +33 33 Version implemented on 15 May 2024 +34 34 Pre-operational to be implemented by next amendment +# 35-254 Future versions 255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. diff --git a/definitions/grib2/tables/33/0.0.table b/definitions/grib2/tables/33/0.0.table new file mode 100644 index 000000000..a8542e94f --- /dev/null +++ b/definitions/grib2/tables/33/0.0.table @@ -0,0 +1,13 @@ +# Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Satellite remote sensing products (formerly Space products) +4 4 Space weather products +# 5-9 Reserved +10 10 Oceanographic products +# 11-19 Reserved +20 20 Health and socioeconomic impacts +# 21-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/1.0.table b/definitions/grib2/tables/33/1.0.table new file mode 100644 index 000000000..841af8c85 --- /dev/null +++ b/definitions/grib2/tables/33/1.0.table @@ -0,0 +1,38 @@ +# Code table 1.0 - GRIB master tables version number +0 0 Experimental +1 1 Version implemented on 7 November 2001 +2 2 Version implemented on 4 November 2003 +3 3 Version implemented on 2 November 2005 +4 4 Version implemented on 7 November 2007 +5 5 Version implemented on 4 November 2009 +6 6 Version implemented on 15 September 2010 +7 7 Version implemented on 4 May 2011 +8 8 Version implemented on 2 November 2011 +9 9 Version implemented on 2 May 2012 +10 10 Version implemented on 7 November 2012 +11 11 Version implemented on 8 May 2013 +12 12 Version implemented on 14 November 2013 +13 13 Version implemented on 7 May 2014 +14 14 Version implemented on 5 November 2014 +15 15 Version implemented on 6 May 2015 +16 16 Version implemented on 11 November 2015 +17 17 Version implemented on 4 May 2016 +18 18 Version implemented on 2 November 2016 +19 19 Version implemented on 3 May 2017 +20 20 Version implemented on 8 November 2017 +21 21 Version implemented on 2 May 2018 +22 22 Version implemented on 7 November 2018 +23 23 Version implemented on 15 May 2019 +24 24 Version implemented on 6 November 2019 +25 25 Version implemented on 6 May 2020 +26 26 Version implemented on 16 November 2020 +27 27 Version implemented on 15 June 2021 +28 28 Version implemented on 15 November 2021 +29 29 Version implemented on 15 May 2022 +30 30 Version implemented on 15 November 2022 +31 31 Version implemented on 15 May 2023 +32 32 Version implemented on 30 November 2023 +33 33 Version implemented on 15 May 2024 +34 34 Pre-operational to be implemented by next amendment +# 35-254 Future versions +255 255 Missing diff --git a/definitions/grib2/tables/33/1.1.table b/definitions/grib2/tables/33/1.1.table new file mode 100644 index 000000000..f6d332005 --- /dev/null +++ b/definitions/grib2/tables/33/1.1.table @@ -0,0 +1,4 @@ +# Code table 1.1 - GRIB local tables version number +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/33/1.2.table b/definitions/grib2/tables/33/1.2.table new file mode 100644 index 000000000..05ec48c5d --- /dev/null +++ b/definitions/grib2/tables/33/1.2.table @@ -0,0 +1,10 @@ +# Code table 1.2 - Significance of reference time +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +4 4 Local time +5 5 Simulation start +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/1.3.table b/definitions/grib2/tables/33/1.3.table new file mode 100644 index 000000000..88c033e42 --- /dev/null +++ b/definitions/grib2/tables/33/1.3.table @@ -0,0 +1,18 @@ +# Code table 1.3 - Production status of data +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products +4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) +5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) +6 6 S2S operational products +7 7 S2S test products +8 8 Uncertainties in Ensembles of Regional ReAnalyses project (UERRA) +9 9 Uncertainties in Ensembles of Regional ReAnalyses project test (UERRA) +10 10 Copernicus regional reanalysis (CARRA/CERRA) +11 11 Copernicus regional reanalysis test (CARRA/CERRA) +12 12 Destination Earth +13 13 Destination Earth test +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/1.4.table b/definitions/grib2/tables/33/1.4.table new file mode 100644 index 000000000..877288c0e --- /dev/null +++ b/definitions/grib2/tables/33/1.4.table @@ -0,0 +1,13 @@ +# Code table 1.4 - Type of data +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/33/1.5.table b/definitions/grib2/tables/33/1.5.table new file mode 100644 index 000000000..533111959 --- /dev/null +++ b/definitions/grib2/tables/33/1.5.table @@ -0,0 +1,7 @@ +# Code table 1.5 - Identification template number +0 0 Calendar definition +1 1 Paleontological offset +2 2 Calendar definition and paleontological offset +# 3-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/33/1.6.table b/definitions/grib2/tables/33/1.6.table new file mode 100644 index 000000000..bd46899a7 --- /dev/null +++ b/definitions/grib2/tables/33/1.6.table @@ -0,0 +1,8 @@ +# Code table 1.6 - Type of calendar +0 0 Gregorian +1 1 360-day +2 2 365-day +3 3 Proleptic Gregorian +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/3.0.table b/definitions/grib2/tables/33/3.0.table new file mode 100644 index 000000000..a442a06a0 --- /dev/null +++ b/definitions/grib2/tables/33/3.0.table @@ -0,0 +1,6 @@ +# Code table 3.0 - Source of grid definition +0 0 Specified in Code table 3.1 +1 1 Predetermined grid definition (Defined by originating centre) +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/33/3.1.table b/definitions/grib2/tables/33/3.1.table new file mode 100644 index 000000000..26dc8da3f --- /dev/null +++ b/definitions/grib2/tables/33/3.1.table @@ -0,0 +1,57 @@ +# Code table 3.1 - Grid definition template number +0 0 Latitude/longitude (Also called equidistant cylindrical, or Plate Carree) +1 1 Rotated latitude/longitude +2 2 Stretched latitude/longitude +3 3 Stretched and rotated latitude/longitude +4 4 Variable resolution latitude/longitude +5 5 Variable resolution rotated latitude/longitude +# 6-9 Reserved +10 10 Mercator +# 11 Reserved +12 12 Transverse Mercator +13 13 Mercator with modelling subdomains definition +# 14-19 Reserved +20 20 Polar stereographic projection (Can be south or north) +# 21-22 Reserved +23 23 Polar stereographic with modelling subdomains definition +# 24-29 Reserved +30 30 Lambert conformal (Can be secant or tangent, conical or bipolar) +31 31 Albers equal area +# 32 Reserved +33 33 Lambert conformal with modelling subdomains definition +# 34-39 Reserved +40 40 Gaussian latitude/longitude +41 41 Rotated Gaussian latitude/longitude +42 42 Stretched Gaussian latitude/longitude +43 43 Stretched and rotated Gaussian latitude/longitude +# 44-49 Reserved +50 50 Spherical harmonic coefficients +51 51 Rotated spherical harmonic coefficients +52 52 Stretched spherical harmonic coefficients +53 53 Stretched and rotated spherical harmonic coefficients +# 54-60 Reserved +61 61 Spectral Mercator with modelling subdomains definition +62 62 Spectral polar stereographic with modelling subdomains definition +63 63 Spectral Lambert conformal with modelling subdomains definition +# 64-89 Reserved +90 90 Space view perspective or orthographic +# 91-99 Reserved +100 100 Triangular grid based on an icosahedron +101 101 General unstructured grid +# 102-109 Reserved +110 110 Equatorial azimuthal equidistant projection +# 111-119 Reserved +120 120 Azimuth-range projection +# 121-139 Reserved +140 140 Lambert azimuthal equal area projection +# 141-149 Reserved +150 150 Hierarchical Equal Area isoLatitude Pixelization grid (HEALPix) +# 151-999 Reserved +1000 1000 Cross-section grid with points equally spaced on the horizontal +# 1001-1099 Reserved +1100 1100 Hovmoller diagram grid with points equally spaced on the horizontal +# 1101-1199 Reserved +1200 1200 Time section grid +# 1201-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/33/3.10.table b/definitions/grib2/tables/33/3.10.table new file mode 100644 index 000000000..1612d05e3 --- /dev/null +++ b/definitions/grib2/tables/33/3.10.table @@ -0,0 +1,8 @@ +# Flag table 3.10 - Scanning mode for one diamond +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/33/3.11.table b/definitions/grib2/tables/33/3.11.table new file mode 100644 index 000000000..06ae10810 --- /dev/null +++ b/definitions/grib2/tables/33/3.11.table @@ -0,0 +1,7 @@ +# Code table 3.11 - Interpretation of list of numbers at end of section 3 +0 0 There is no appended list +1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows +2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row +3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/33/3.12.table b/definitions/grib2/tables/33/3.12.table new file mode 100644 index 000000000..7d4757100 --- /dev/null +++ b/definitions/grib2/tables/33/3.12.table @@ -0,0 +1,6 @@ +# Code table 3.12 - HEALPix rhomboids or points ordering +0 0 Ring ordering +1 1 Nested ordering +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/3.13.table b/definitions/grib2/tables/33/3.13.table new file mode 100644 index 000000000..aabe4fc03 --- /dev/null +++ b/definitions/grib2/tables/33/3.13.table @@ -0,0 +1,8 @@ +# Flag table 3.13 - HEALPix scanning mode +1 0 Points scan in +i (+x) direction +1 1 Points scan in -i (-x) direction +2 0 Points scan in -j (-y) direction +2 1 Points scan in +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/33/3.15.table b/definitions/grib2/tables/33/3.15.table new file mode 100644 index 000000000..43539dbfc --- /dev/null +++ b/definitions/grib2/tables/33/3.15.table @@ -0,0 +1,23 @@ +# Code table 3.15 - Physical meaning of vertical coordinate +# 0-19 Reserved +20 20 Temperature (K) +# 21-99 Reserved +100 100 Pressure (Pa) +101 101 Pressure deviation from mean sea level (Pa) +102 102 Altitude above mean sea level (m) +103 103 Height above ground (m) +104 104 Sigma coordinate +105 105 Hybrid coordinate +106 106 Depth below land surface (m) +107 pt Potential temperature (theta) (K) +108 108 Pressure deviation from ground to level (Pa) +109 pv Potential vorticity (K m2 kg-1 s-1) +110 110 Geometrical height (m) +111 111 Eta coordinate +112 112 Geopotential height (gpm) +113 113 Logarithmic hybrid coordinate +# 114-159 Reserved +160 160 Depth below sea level (m) +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/3.2.table b/definitions/grib2/tables/33/3.2.table new file mode 100644 index 000000000..13b9bf469 --- /dev/null +++ b/definitions/grib2/tables/33/3.2.table @@ -0,0 +1,16 @@ +# Code table 3.2 - Shape of the reference system +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS-84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS-84 reference frame +9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height +10 10 Earth model assumed WGS84 with corrected geomagnetic coordinates (latitude and longitude) defined by Gustafsson et al., 1992 +11 11 Sun assumed spherical with radius = 695 990 000 m (Allen, C.W., Astrophysical Quantities, 3rd ed.; Athlone: London, 1976) and Stonyhurst latitude and longitude system with origin at the intersection of the solar central meridian (as seen from Earth) and the solar equator (Thompson, W., Coordinate systems for solar image data, Astron. Astrophys. 2006, 449, 791-803) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/3.20.table b/definitions/grib2/tables/33/3.20.table new file mode 100644 index 000000000..e2bb156ee --- /dev/null +++ b/definitions/grib2/tables/33/3.20.table @@ -0,0 +1,6 @@ +# Code table 3.20 - Type of horizontal line +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/3.21.table b/definitions/grib2/tables/33/3.21.table new file mode 100644 index 000000000..e001e1c8f --- /dev/null +++ b/definitions/grib2/tables/33/3.21.table @@ -0,0 +1,8 @@ +# Code table 3.21 - Vertical dimension coordinate values definition +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/3.25.table b/definitions/grib2/tables/33/3.25.table new file mode 100644 index 000000000..e5a754994 --- /dev/null +++ b/definitions/grib2/tables/33/3.25.table @@ -0,0 +1,10 @@ +# Code table 3.25 - Type of bi-Fourier truncation +# 0-76 Reserved +77 77 Rectangular +# 78-87 Reserved +88 88 Elliptic +# 89-98 Reserved +99 99 Diamond +# 100-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/3.3.table b/definitions/grib2/tables/33/3.3.table new file mode 100644 index 000000000..25cb46a1d --- /dev/null +++ b/definitions/grib2/tables/33/3.3.table @@ -0,0 +1,9 @@ +# Flag table 3.3 - Resolution and component flags +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/33/3.4.table b/definitions/grib2/tables/33/3.4.table new file mode 100644 index 000000000..0f9d84464 --- /dev/null +++ b/definitions/grib2/tables/33/3.4.table @@ -0,0 +1,17 @@ +# Flag table 3.4 - Scanning mode +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction are consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scan in the opposite direction +5 0 Points within odd rows are not offset in i (x) direction +5 1 Points within odd rows are offset by Di/2 in i (x) direction +6 0 Points within even rows are not offset in i (x) direction +6 1 Points within even rows are offset by Di/2 in i (x) direction +7 0 Points are not offset in j (y) direction +7 1 Points are offset by Dj/2 in j (y) direction +8 0 Rows have Ni grid points and columns have Nj grid points +8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction diff --git a/definitions/grib2/tables/33/3.5.table b/definitions/grib2/tables/33/3.5.table new file mode 100644 index 000000000..2f8ec82e3 --- /dev/null +++ b/definitions/grib2/tables/33/3.5.table @@ -0,0 +1,5 @@ +# Flag table 3.5 - Projection centre +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/33/3.6.table b/definitions/grib2/tables/33/3.6.table new file mode 100644 index 000000000..5ab13aaa5 --- /dev/null +++ b/definitions/grib2/tables/33/3.6.table @@ -0,0 +1,3 @@ +# Code table 3.6 - Spectral data representation type +1 1 see separate doc or pdf file +2 2 Bi-Fourier representation diff --git a/definitions/grib2/tables/33/3.7.table b/definitions/grib2/tables/33/3.7.table new file mode 100644 index 000000000..34c0de085 --- /dev/null +++ b/definitions/grib2/tables/33/3.7.table @@ -0,0 +1,5 @@ +# Code table 3.7 - Spectral data representation mode +0 0 Reserved +1 1 see separate doc or pdf file +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/33/3.8.table b/definitions/grib2/tables/33/3.8.table new file mode 100644 index 000000000..fcd17dca8 --- /dev/null +++ b/definitions/grib2/tables/33/3.8.table @@ -0,0 +1,10 @@ +# Code table 3.8 - Grid point position +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +3 3 Grid points at shape vertices +4 4 Grid points at centre of shapes +5 5 Grid points at midpoints of shape sides +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/3.9.table b/definitions/grib2/tables/33/3.9.table new file mode 100644 index 000000000..ecd65514a --- /dev/null +++ b/definitions/grib2/tables/33/3.9.table @@ -0,0 +1,4 @@ +# Flag table 3.9 - Numbering order of diamonds as seen from the corresponding pole +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/33/4.0.table b/definitions/grib2/tables/33/4.0.table new file mode 100644 index 000000000..86399bd79 --- /dev/null +++ b/definitions/grib2/tables/33/4.0.table @@ -0,0 +1,124 @@ +# Code table 4.0 - Product definition template number +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 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 +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +35 35 Satellite product with or without associated quality values +# 36-39 Reserved +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 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 atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 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 aerosol +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +49 49 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +# 50 Reserved +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +# 52 Reserved +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time +56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (deprecated) +57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +58 58 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +59 59 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (corrected version of template 4.56) +60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +62 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 +63 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 +# 64-66 Reserved +67 67 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 atmospheric chemical constituents based on a distribution function +68 68 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function +# 69 Reserved +70 70 Post-processing analysis or forecast at a horizontal level or in a horizontal layer at a point in time +71 71 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +72 72 Post-processing 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 +73 73 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +# 74-75 Reserved +76 76 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents with source or sink +77 77 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents with source or sink +78 78 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 atmospheric chemical constituents with source or sink +79 79 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents with source or sink +80 80 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol with source or sink +81 81 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol with source or sink +82 82 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 aerosol with source or sink +83 83 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol with source or sink +84 84 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol with source or sink +85 85 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol +86 86 Quantile forecasts at a horizontal level or in a horizontal layer at a point in time +87 87 Quantile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +88 88 Analysis or forecast at a horizontal level or in a horizontal layer at a specified local time +89 89 Post-processed quantile forecasts at a horizontal level or in a horizontal layer at a point in time +90 90 Post-processed quantile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +92 92 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a specified local time +93 93 Post-processing analysis or forecast at a horizontal level or in a horizontal layer at a specified local time +94 94 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a specified local time +95 95 Average, accumulation, extreme values or other statistically processed value at a horizontal level or in a horizontal layer at a specified local time +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 99 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for wave 2D spectra with explicit list of frequencies and directions +100 100 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for wave 2D spectra with explicit list of frequencies and directions +101 101 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for wave 2D spectra with frequencies and directions defined by formulae +102 102 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for wave 2D spectra with frequencies and directions defined by formulae +103 103 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for waves selected by period range +104 104 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for waves selected by period range +105 105 Anomalies, significance and other derived products from an analysis or forecast in relation to a reference period at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +106 106 Anomalies, significance and other derived products from an individual ensemble forecast, control and perturbed in relation to a reference period at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +107 107 Anomalies, significance and other derived products from derived forecasts based on all ensemble members in relation to a reference period at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +108 108 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for generic optical products +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 products +110 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 +111 111 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for generic optical products +112 112 Anomalies, significance and other derived products as probability forecasts in relation to a reference period at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +113 113 Generalised tiles at a horizontal level or horizontal layer at a point in time +114 114 Average, accumulation, and/or extreme values or other statistically processed values on generalised tiles at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +115 115 Individual ensemble forecast, control and perturbed on generalised tiles at a horizontal level or in a horizontal layer at a point in time +116 116 Individual ensemble forecast, control and perturbed on generalised tiles at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +117 117 Individual large ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +118 118 Individual large ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +119 119 Probability forecasts from large ensembles at a horizontal level or in a horizontal layer at a point in time +120 120 Probability forecasts from large ensembles at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +121 121 Probability forecasts from large ensembles with spatiotemporal processing based on focal (moving window) statistics at a horizontal level or in a horizontal layer at a point in time +122 122 Probability forecasts from large ensembles with spatiotemporal processing based on focal (moving window) statistics at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +123 123 Probability forecasts from large ensembles with spatiotemporal processing based on focal (moving window) statistics in relation to a reference period at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +124 124 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for radionuclides +125 125 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for radionuclides +126 126 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 radionuclides +127 127 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides +# 128-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing +# 1102-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/33/4.1.0.table b/definitions/grib2/tables/33/4.1.0.table new file mode 100644 index 000000000..deb34a4e3 --- /dev/null +++ b/definitions/grib2/tables/33/4.1.0.table @@ -0,0 +1,29 @@ +# Product discipline 0 - Meteorological products +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +21 21 Thermodynamic properties +22 22 Drought indices +# 23-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.1.1.table b/definitions/grib2/tables/33/4.1.1.table new file mode 100644 index 000000000..df2c13fa8 --- /dev/null +++ b/definitions/grib2/tables/33/4.1.1.table @@ -0,0 +1,7 @@ +# Product discipline 1 - Hydrological products +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.1.10.table b/definitions/grib2/tables/33/4.1.10.table new file mode 100644 index 000000000..5a64f9652 --- /dev/null +++ b/definitions/grib2/tables/33/4.1.10.table @@ -0,0 +1,10 @@ +# Product discipline 10 - Oceanographic products +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Subsurface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.1.2.table b/definitions/grib2/tables/33/4.1.2.table new file mode 100644 index 000000000..9d6f690ac --- /dev/null +++ b/definitions/grib2/tables/33/4.1.2.table @@ -0,0 +1,11 @@ +# Product discipline 2 - Land surface products +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +5 5 Glaciers and inland ice +6 6 Urban areas +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.1.20.table b/definitions/grib2/tables/33/4.1.20.table new file mode 100644 index 000000000..e651e326f --- /dev/null +++ b/definitions/grib2/tables/33/4.1.20.table @@ -0,0 +1,8 @@ +# Product discipline 20 - Health and socioeconomic impacts +0 0 Health indicators +1 1 Epidemiology +2 2 Socioeconomic indicators +3 3 Renewable energy sector +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.1.3.table b/definitions/grib2/tables/33/4.1.3.table new file mode 100644 index 000000000..35d82f440 --- /dev/null +++ b/definitions/grib2/tables/33/4.1.3.table @@ -0,0 +1,11 @@ +# Product discipline 3 - Satellite remote sensing products (formerly Space products) +0 0 Image format products +1 1 Quantitative products +2 2 Cloud properties +3 3 Flight rule conditions +4 4 Volcanic ash +5 5 Sea-surface temperature +6 6 Solar radiation +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.1.4.table b/definitions/grib2/tables/33/4.1.4.table new file mode 100644 index 000000000..7d1378729 --- /dev/null +++ b/definitions/grib2/tables/33/4.1.4.table @@ -0,0 +1,15 @@ +# Product discipline 4 - Space weather products +0 0 Temperature +1 1 Momentum +2 2 Charged particle mass and number +3 3 Electric and magnetic fields +4 4 Energetic particles +5 5 Waves +6 6 Solar electromagnetic emissions +7 7 Terrestrial electromagnetic emissions +8 8 Imagery +9 9 Ion-neutral coupling +10 10 Space weather indices +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.10.table b/definitions/grib2/tables/33/4.10.table new file mode 100644 index 000000000..0acd9127c --- /dev/null +++ b/definitions/grib2/tables/33/4.10.table @@ -0,0 +1,22 @@ +# Code table 4.10 - Type of statistical processing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +12 12 Return period +13 13 Median +# 14-99 Reserved +100 100 Severity +101 101 Mode +102 102 Index processing +# 103-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/33/4.100.table b/definitions/grib2/tables/33/4.100.table new file mode 100644 index 000000000..a24770d68 --- /dev/null +++ b/definitions/grib2/tables/33/4.100.table @@ -0,0 +1,10 @@ +# Code table 4.100 - Type of reference dataset +0 0 Analysis +1 1 Forecast +2 2 Reforecast (Hindcast) +3 3 Reanalysis +4 4 Climate projection +5 5 Gridded observations +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.101.table b/definitions/grib2/tables/33/4.101.table new file mode 100644 index 000000000..0fcdb13d9 --- /dev/null +++ b/definitions/grib2/tables/33/4.101.table @@ -0,0 +1,13 @@ +# Code table 4.101 - Type of relationship to reference dataset +0 0 Anomaly +1 1 Standardized anomaly +2 2 Significance (Wilcoxon-Mann-Whitney) +3 3 Climatology +# 4-19 Reserved +20 20 Extreme Forecast Index (EFI) +21 21 Shift of Tails (SOT) +22 22 Anomaly of probabilities +23 23 Standardized Drought Index +# 24-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.102.table b/definitions/grib2/tables/33/4.102.table new file mode 100644 index 000000000..214844fb3 --- /dev/null +++ b/definitions/grib2/tables/33/4.102.table @@ -0,0 +1,22 @@ +# Code table 4.102 - Statistical processing of reference period +0 0 Average +1 1 Accumulation +2 2 Maximum +3 3 Minimum +4 4 Median +# 5-19 Reserved +20 20 Model Climate +21 21 Index based on normal distribution +22 22 Index based on log-normal distribution +23 23 Index based on generalised log-normal distribution +24 24 Index based on gamma distribution +25 25 Index based on logistic distribution +26 26 Index based on log-logistic distribution +27 27 Index based on generalised logistic distribution +28 28 Index based on Weibull distribution +29 29 Index based on generalised extreme value distribution +30 30 Index based on Pearson III distribution +31 31 Index based on empirical distribution +# 32-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.103.table b/definitions/grib2/tables/33/4.103.table new file mode 100644 index 000000000..5d70488ca --- /dev/null +++ b/definitions/grib2/tables/33/4.103.table @@ -0,0 +1,9 @@ +# Code table 4.103 - Spatial vicinity type +0 0 Circle [m] +1 1 Rectangle [m,m] +2 2 Square [m] +3 3 Wedge [m, degree, degree] +4 4 Span of grid boxes centered around grid box i,j [x,y] +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.104.table b/definitions/grib2/tables/33/4.104.table new file mode 100644 index 000000000..d1e417780 --- /dev/null +++ b/definitions/grib2/tables/33/4.104.table @@ -0,0 +1,15 @@ +# Code table 4.104 - Spatial and temporal vicinity processing +0 0 Average +1 1 Reserved +2 2 Maximum +3 3 Minimum +4 4 Range +5 5 Reserved +6 6 Standard deviation +# 7-10 Reserved +11 11 Sum +# 12-189 Reserved +190 190 Quantile +191 191 Categorical (boolean) +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.105.table b/definitions/grib2/tables/33/4.105.table new file mode 100644 index 000000000..f3be24ecb --- /dev/null +++ b/definitions/grib2/tables/33/4.105.table @@ -0,0 +1,6 @@ +# Code table 4.105 - Spatial and temporal vicinity missing data +0 0 Ignore missing data +1 1 No data +# 2-189 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.11.table b/definitions/grib2/tables/33/4.11.table new file mode 100644 index 000000000..01cc81303 --- /dev/null +++ b/definitions/grib2/tables/33/4.11.table @@ -0,0 +1,10 @@ +# Code table 4.11 - Type of time intervals +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.12.table b/definitions/grib2/tables/33/4.12.table new file mode 100644 index 000000000..d42b47e96 --- /dev/null +++ b/definitions/grib2/tables/33/4.12.table @@ -0,0 +1,7 @@ +# Code table 4.12 - Operating mode +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.13.table b/definitions/grib2/tables/33/4.13.table new file mode 100644 index 000000000..a0e28eac8 --- /dev/null +++ b/definitions/grib2/tables/33/4.13.table @@ -0,0 +1,6 @@ +# Code table 4.13 - Quality control indicator +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.14.table b/definitions/grib2/tables/33/4.14.table new file mode 100644 index 000000000..d525b23b3 --- /dev/null +++ b/definitions/grib2/tables/33/4.14.table @@ -0,0 +1,6 @@ +# Code table 4.14 - Clutter filter indicator +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.15.table b/definitions/grib2/tables/33/4.15.table new file mode 100644 index 000000000..7adddedb6 --- /dev/null +++ b/definitions/grib2/tables/33/4.15.table @@ -0,0 +1,11 @@ +# Code table 4.15 - Type of spatial processing used to arrive at given data value from the source data +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.16.table b/definitions/grib2/tables/33/4.16.table new file mode 100644 index 000000000..5b9f6fd73 --- /dev/null +++ b/definitions/grib2/tables/33/4.16.table @@ -0,0 +1,10 @@ +# Code table 4.16 - Quality value associated with parameter +0 0 Confidence index +1 1 Quality indicator +2 2 Correlation of product with used calibration product +3 3 Standard deviation +4 4 Random error +5 5 Probability +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.192.table b/definitions/grib2/tables/33/4.192.table new file mode 100644 index 000000000..e1fd91594 --- /dev/null +++ b/definitions/grib2/tables/33/4.192.table @@ -0,0 +1,4 @@ +1 1 first +2 2 second +3 3 third +4 4 fourth diff --git a/definitions/grib2/tables/33/4.2.0.0.table b/definitions/grib2/tables/33/4.2.0.0.table new file mode 100644 index 000000000..e4912c9d6 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.0.table @@ -0,0 +1,37 @@ +# Product discipline 0 - Meteorological products, parameter category 0: temperature +0 0 Temperature (K) +1 1 Virtual temperature (K) +2 2 Potential temperature (K) +3 3 Pseudo-adiabatic potential temperature or equivalent potential temperature (K) +4 4 Maximum temperature (K) +5 5 Minimum temperature (K) +6 6 Dewpoint temperature (K) +7 7 Dewpoint depression (or deficit) (K) +8 8 Lapse rate (K/m) +9 9 Temperature anomaly (K) +10 10 Latent heat net flux (W m-2) +11 11 Sensible heat net flux (W m-2) +12 12 Heat index (K) +13 13 Wind chill factor (K) +14 14 Minimum dewpoint depression (K) +15 15 Virtual potential temperature (K) +16 16 Snow phase change heat flux (W m-2) +17 17 Skin temperature (K) +18 18 Snow temperature (top of snow) (K) +19 19 Turbulent transfer coefficient for heat (Numeric) +20 20 Turbulent diffusion coefficient for heat (m2/s) +21 21 Apparent temperature (K) +22 22 Temperature tendency due to short-wave radiation (K s-1) +23 23 Temperature tendency due to long-wave radiation (K s-1) +24 24 Temperature tendency due to short-wave radiation, clear sky (K s-1) +25 25 Temperature tendency due to long-wave radiation, clear sky (K s-1) +26 26 Temperature tendency due to parameterization (K s-1) +27 27 Wet-bulb temperature (K) +28 28 Unbalanced component of temperature (K) +29 29 Temperature advection (K s-1) +30 30 Latent heat net flux due to evaporation (W m-2) +31 31 Latent heat net flux due to sublimation (W m-2) +32 32 Wet-bulb potential temperature (K) +# 33-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.1.table b/definitions/grib2/tables/33/4.2.0.1.table new file mode 100644 index 000000000..2405606cb --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.1.table @@ -0,0 +1,174 @@ +# Product discipline 0 - Meteorological products, parameter category 1: moisture +0 0 Specific humidity (kg/kg) +1 1 Relative humidity (%) +2 2 Humidity mixing ratio (kg/kg) +3 3 Precipitable water (kg m-2) +4 4 Vapour pressure (Pa) +5 5 Saturation deficit (Pa) +6 6 Evaporation (kg m-2) +7 7 Precipitation rate (kg m-2 s-1) +8 8 Total precipitation (kg m-2) +9 9 Large-scale precipitation (non-convective) (kg m-2) +10 10 Convective precipitation (kg m-2) +11 11 Snow depth (m) +12 12 Snowfall rate water equivalent (kg m-2 s-1) +13 13 Water equivalent of accumulated snow depth (kg m-2) +14 14 Convective snow (kg m-2) +15 15 Large-scale snow (kg m-2) +16 16 Snow melt (kg m-2) +17 17 Snow age (d) +18 18 Absolute humidity (kg m-3) +19 19 Precipitation type (Code table 4.201) +20 20 Integrated liquid water (kg m-2) +21 21 Condensate (kg/kg) +22 22 Cloud mixing ratio (kg/kg) +23 23 Ice water mixing ratio (kg/kg) +24 24 Rain mixing ratio (kg/kg) +25 25 Snow mixing ratio (kg/kg) +26 26 Horizontal moisture convergence (kg kg-1 s-1) +27 27 Maximum relative humidity (%) +28 28 Maximum absolute humidity (kg m-3) +29 29 Total snowfall (m) +30 30 Precipitable water category (Code table 4.202) +31 31 Hail (m) +32 32 Graupel (snow pellets) (kg/kg) +33 33 Categorical rain (Code table 4.222) +34 34 Categorical freezing rain (Code table 4.222) +35 35 Categorical ice pellets (Code table 4.222) +36 36 Categorical snow (Code table 4.222) +37 37 Convective precipitation rate (kg m-2 s-1) +38 38 Horizontal moisture divergence (kg kg-1 s-1) +39 39 Per cent frozen precipitation (%) +40 40 Potential evaporation (kg m-2) +41 41 Potential evaporation rate (W m-2) +42 42 Snow cover (%) +43 43 Rain fraction of total cloud water (Proportion) +44 44 Rime factor (Numeric) +45 45 Total column integrated rain (kg m-2) +46 46 Total column integrated snow (kg m-2) +47 47 Large scale water precipitation (non-convective) (kg m-2) +48 48 Convective water precipitation (kg m-2) +49 49 Total water precipitation (kg m-2) +50 50 Total snow precipitation (kg m-2) +51 51 Total column water [Vertically integrated total water=vapour + cloud water/ice] (kg m-2) +52 52 Total precipitation rate (kg m-2 s-1) +53 53 Total snowfall rate water equivalent (kg m-2 s-1) +54 54 Large scale precipitation rate (kg m-2 s-1) +55 55 Convective snowfall rate water equivalent (kg m-2 s-1) +56 56 Large scale snowfall rate water equivalent (kg m-2 s-1) +57 57 Total snowfall rate (m/s) +58 58 Convective snowfall rate (m/s) +59 59 Large scale snowfall rate (m/s) +60 60 Snow depth water equivalent (kg m-2) +61 61 Snow density (kg m-3) +62 62 Snow evaporation (kg m-2) +63 63 Reserved +64 64 Total column integrated water vapour (kg m-2) +65 65 Rain precipitation rate (kg m-2 s-1) +66 66 Snow precipitation rate (kg m-2 s-1) +67 67 Freezing rain precipitation rate (kg m-2 s-1) +68 68 Ice pellets precipitation rate (kg m-2 s-1) +69 69 Total column integrated cloud water (kg m-2) +70 70 Total column integrated cloud ice (kg m-2) +71 71 Hail mixing ratio (kg/kg) +72 72 Total column integrated hail (kg m-2) +73 73 Hail precipitation rate (kg m-2 s-1) +74 74 Total column integrated graupel (kg m-2) +75 75 Graupel (snow pellets) precipitation rate (kg m-2 s-1) +76 76 Convective rain rate (kg m-2 s-1) +77 77 Large scale rain rate (kg m-2 s-1) +78 78 Total column integrated water (all components including precipitation) (kg m-2) +79 79 Evaporation rate (kg m-2 s-1) +80 80 Total condensate (kg/kg) +81 81 Total column-integrated condensate (kg m-2) +82 82 Cloud ice mixing-ratio (kg/kg) +83 83 Specific cloud liquid water content (kg/kg) +84 84 Specific cloud ice water content (kg/kg) +85 85 Specific rainwater content (kg/kg) +86 86 Specific snow water content (kg/kg) +87 87 Stratiform precipitation rate (kg m-2 s-1) +88 88 Categorical convective precipitation (Code table 4.222) +# 89 Reserved +90 90 Total kinematic moisture flux (kg kg-1 m s-1) +91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) +92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) +93 93 Relative humidity with respect to water (%) +94 94 Relative humidity with respect to ice (%) +95 95 Freezing or frozen precipitation rate (kg m-2 s-1) +96 96 Mass density of rain (kg m-3) +97 97 Mass density of snow (kg m-3) +98 98 Mass density of graupel (kg m-3) +99 99 Mass density of hail (kg m-3) +100 100 Specific number concentration of rain (kg-1) +101 101 Specific number concentration of snow (kg-1) +102 102 Specific number concentration of graupel (kg-1) +103 103 Specific number concentration of hail (kg-1) +104 104 Number density of rain (m-3) +105 105 Number density of snow (m-3) +106 106 Number density of graupel (m-3) +107 107 Number density of hail (m-3) +108 108 Specific humidity tendency due to parameterization (kg kg-1 s-1) +109 109 Mass density of liquid water coating on hail expressed as mass of liquid water per unit volume of air (kg m-3) +110 110 Specific mass of liquid water coating on hail expressed as mass of liquid water per unit mass of moist air (kg kg-1) +111 111 Mass mixing ratio of liquid water coating on hail expressed as mass of liquid water per unit mass of dry air (kg kg-1) +112 112 Mass density of liquid water coating on graupel expressed as mass of liquid water per unit volume of air (kg m-3) +113 113 Specific mass of liquid water coating on graupel expressed as mass of liquid water per unit mass of moist air (kg kg-1) +114 114 Mass mixing ratio of liquid water coating on graupel expressed as mass of liquid water per unit mass of dry air (kg kg-1) +115 115 Mass density of liquid water coating on snow expressed as mass of liquid water per unit volume of air (kg m-3) +116 116 Specific mass of liquid water coating on snow expressed as mass of liquid water per unit mass of moist air (kg kg-1) +117 117 Mass mixing ratio of liquid water coating on snow expressed as mass of liquid water per unit mass of dry air (kg kg-1) +118 118 Unbalanced component of specific humidity (kg kg-1) +119 119 Unbalanced component of specific cloud liquid water content (kg kg-1) +120 120 Unbalanced component of specific cloud ice water content (kg kg-1) +121 121 Fraction of snow cover (Proportion) +122 122 Precipitation intensity index (Code table 4.247) +123 123 Dominant precipitation type (Code table 4.201) +124 124 Presence of showers (Code table 4.222) +125 125 Presence of blowing snow (Code table 4.222) +126 126 Presence of blizzard (Code table 4.222) +127 127 Ice pellets (non-water equivalent) precipitation rate (m/s) +128 128 Total solid precipitation rate (kg m-2 s-1) +129 129 Effective radius of cloud water (m) +130 130 Effective radius of rain (m) +131 131 Effective radius of cloud ice (m) +132 132 Effective radius of snow (m) +133 133 Effective radius of graupel (m) +134 134 Effective radius of hail (m) +135 135 Effective radius of subgrid liquid clouds (m) +136 136 Effective radius of subgrid ice clouds (m) +137 137 Effective aspect ratio of rain (-) +138 138 Effective aspect ratio of cloud ice (-) +139 139 Effective aspect ratio of snow (-) +140 140 Effective aspect ratio of graupel (-) +141 141 Effective aspect ratio of hail (-) +142 142 Effective aspect ratio of subgrid ice clouds (-) +143 143 Potential evaporation rate (kg m-2 s-1) +144 144 Specific rain water content (convective) (kg kg-1) +145 145 Specific snow water content (convective) (kg kg-1) +146 146 Cloud ice precipitation rate (kg m-2 s-1) +147 147 Character of precipitation (Code table 4.249) +148 148 Snow evaporation rate (kg m-2 s-1) +149 149 Cloud water mixing ratio (kg kg-1) +150 150 Column integrated eastward water vapour mass flux (kg m-1 s-1) +151 151 Column integrated northward water vapour mass flux (kg m-1 s-1) +152 152 Column integrated eastward cloud liquid water mass flux (kg m-1 s-1) +153 153 Column integrated northward cloud liquid water mass flux (kg m-1 s-1) +154 154 Column integrated eastward cloud ice mass flux (kg m-1 s-1) +155 155 Column integrated northward cloud ice mass flux (kg m-1 s-1) +156 156 Column integrated eastward rain mass flux (kg m-1 s-1) +157 157 Column integrated northward rain mass flux (kg m-1 s-1) +158 158 Column integrated eastward snow mass flux (kg m-1 s-1) +159 159 Column integrated northward snow mass flux (kg m-1 s-1) +160 160 Column integrated divergence of water vapour mass flux (kg m-2 s-1) +161 161 Column integrated divergence of cloud liquid water mass flux (kg m-2 s-1) +162 162 Column integrated divergence of cloud ice mass flux (kg m-2 s-1) +163 163 Column integrated divergence of rain mass flux (kg m-2 s-1) +164 164 Column integrated divergence of snow mass flux (kg m-2 s-1) +165 165 Column integrated divergence of total water mass flux (kg m-2 s-1) +166 166 Column integrated water vapour flux (kg m-2 s-1) +167 167 Total column supercooled liquid water (kg m-2) +168 168 Saturation specific humidity with respect to water (kg m-3) +169 169 Total column integrated saturation specific humidity with respect to water (kg m-2) +# 170-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.13.table b/definitions/grib2/tables/33/4.2.0.13.table new file mode 100644 index 000000000..4c1253b96 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.13.table @@ -0,0 +1,5 @@ +# Product discipline 0 - Meteorological products, parameter category 13: aerosols +0 0 Aerosol type (Code table 4.205) +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.14.table b/definitions/grib2/tables/33/4.2.0.14.table new file mode 100644 index 000000000..df0f721ea --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.14.table @@ -0,0 +1,7 @@ +# Product discipline 0 - Meteorological products, parameter category 14: trace gases +0 0 Total ozone (DU) +1 1 Ozone mixing ratio (kg/kg) +2 2 Total column integrated ozone (DU) +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.15.table b/definitions/grib2/tables/33/4.2.0.15.table new file mode 100644 index 000000000..ac49ad402 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.15.table @@ -0,0 +1,21 @@ +# Product discipline 0 - Meteorological products, parameter category 15: radar +0 0 Base spectrum width (m/s) +1 1 Base reflectivity (dB) +2 2 Base radial velocity (m/s) +3 3 Vertically integrated liquid water (VIL) (kg m-2) +4 4 Layer-maximum base reflectivity (dB) +5 5 Precipitation (kg m-2) +6 6 Radar spectra (1) (-) +7 7 Radar spectra (2) (-) +8 8 Radar spectra (3) (-) +9 9 Reflectivity of cloud droplets (dB) +10 10 Reflectivity of cloud ice (dB) +11 11 Reflectivity of snow (dB) +12 12 Reflectivity of rain (dB) +13 13 Reflectivity of graupel (dB) +14 14 Reflectivity of hail (dB) +15 15 Hybrid scan reflectivity (dB) +16 16 Hybrid scan reflectivity height (m) +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.16.table b/definitions/grib2/tables/33/4.2.0.16.table new file mode 100644 index 000000000..111e6d986 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.16.table @@ -0,0 +1,10 @@ +# Product discipline 0 - Meteorological products, parameter category 16: forecast radar imagery +0 0 Equivalent radar reflectivity factor for rain (mm6 m-3) +1 1 Equivalent radar reflectivity factor for snow (mm6 m-3) +2 2 Equivalent radar reflectivity factor for parameterized convection (mm6 m-3) +3 3 Echo top (m) +4 4 Reflectivity (dB) +5 5 Composite reflectivity (dB) +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.17.table b/definitions/grib2/tables/33/4.2.0.17.table new file mode 100644 index 000000000..90ef72d87 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.17.table @@ -0,0 +1,7 @@ +# Product discipline 0 - Meteorological products, parameter category 17: electrodynamics +0 0 Lightning strike density (m-2 s-1) +1 1 Lightning potential index (LPI) (J kg-1) +2 2 Cloud-to-ground lightning flash density (km-2 day-1) +3 3 Cloud-to-cloud lightning flash density (km-2 day-1) +4 4 Total lightning flash density (km-2 day-1) +5 5 Subgrid-scale lightning potential index (J kg-1) diff --git a/definitions/grib2/tables/33/4.2.0.18.table b/definitions/grib2/tables/33/4.2.0.18.table new file mode 100644 index 000000000..6efa6e5e0 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.18.table @@ -0,0 +1,31 @@ +# Product discipline 0 - Meteorological products, parameter category 18: nuclear/radiology +0 0 Air activity concentration of caesium 137 (Bq m-3) +1 1 Air activity concentration of iodine 131 (Bq m-3) +2 2 Air activity concentration of radioactive pollutant (Bq m-3) +3 3 Ground deposition activity of caesium 137 (Bq m-2) +4 4 Ground deposition activity of iodine 131 (Bq m-2) +5 5 Ground deposition activity of radioactive pollutant (Bq m-2) +6 6 Time-integrated air activity concentration of caesium pollutant (Bq s m-3) +7 7 Time-integrated air activity concentration of iodine pollutant (Bq s m-3) +8 8 Time-integrated air activity concentration of radioactive pollutant (Bq s m-3) +9 9 Reserved +10 10 Air activity concentration (Bq m-3) +11 11 Wet deposition activity (Bq m-2) +12 12 Dry deposition activity (Bq m-2) +13 13 Total deposition activity (wet + dry) (Bq m-2) +14 14 Specific activity concentration (Bq kg-1) +15 15 Maximum of air activity concentration in layer (Bq m-3) +16 16 Height of maximum air activity concentration (m) +17 17 Column-integrated air activity concentration (Bq m-2) +18 18 Column-averaged air activity concentration in layer (Bq m-3) +19 19 Deposition activity arrival (s) +20 20 Deposition activity ended (s) +21 21 Cloud activity arrival (s) +22 22 Cloud activity ended (s) +23 23 Effective dose rate (nSv h-1) +24 24 Thyroid dose rate (adult) (nSv h-1) +25 25 Gamma dose rate (adult) (nSv h-1) +26 26 Activity emission (Bq s-1) +# 27-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.19.table b/definitions/grib2/tables/33/4.2.0.19.table new file mode 100644 index 000000000..be45d7a0d --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.19.table @@ -0,0 +1,55 @@ +# Product discipline 0 - Meteorological products, parameter category 19: physical atmospheric properties +0 0 Visibility (m) +1 1 Albedo (%) +2 2 Thunderstorm probability (%) +3 3 Mixed layer depth (m) +4 4 Volcanic ash (Code table 4.206) +5 5 Icing top (m) +6 6 Icing base (m) +7 7 Icing (Code table 4.207) +8 8 Turbulence top (m) +9 9 Turbulence base (m) +10 10 Turbulence (Code table 4.208) +11 11 Turbulent kinetic energy (J/kg) +12 12 Planetary boundary-layer regime (Code table 4.209) +13 13 Contrail intensity (Code table 4.210) +14 14 Contrail engine type (Code table 4.211) +15 15 Contrail top (m) +16 16 Contrail base (m) +17 17 Maximum snow albedo (%) +18 18 Snow free albedo (%) +19 19 Snow albedo (%) +20 20 Icing (%) +21 21 In-cloud turbulence (%) +22 22 Clear air turbulence (CAT) (%) +23 23 Supercooled large droplet probability (%) +24 24 Convective turbulent kinetic energy (J/kg) +25 25 Weather (Code table 4.225) +26 26 Convective outlook (Code table 4.224) +27 27 Icing scenario (Code table 4.227) +28 28 Mountain wave turbulence (eddy dissipation rate) (m2/3 s-1) +29 29 Clear air turbulence (CAT) (m2/3 s-1) +30 30 Eddy dissipation parameter (m2/3 s-1) +31 31 Maximum of eddy dissipation parameter in layer (m2/3 s-1) +32 32 Highest freezing level (m) +33 33 Visibility through liquid fog (m) +34 34 Visibility through ice fog (m) +35 35 Visibility through blowing snow (m) +36 36 Presence of snow squalls (Code table 4.222) +37 37 Icing severity (Code table 4.228) +38 38 Sky transparency index (Code table 4.214) +39 39 Seeing index (Code table 4.214) +40 40 Snow level (m) +41 41 Duct base height (m) +42 42 Trapping layer base height (m) +43 43 Trapping layer top height (m) +44 44 Mean vertical gradient of refractivity inside trapping layer (m-1) +45 45 Minimum vertical gradient of refractivity inside trapping layer (m-1) +46 46 Net radiation flux (W m-2) +47 47 Global irradiance on tilted surfaces (W m-2) +48 48 Top of persistent contrails (m) +49 49 Base of persistent contrails (m) +50 50 Convectively-induced turbulence (CIT) (eddy dissipation rate) (m2/3 s-1) +# 51-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.190.table b/definitions/grib2/tables/33/4.2.0.190.table new file mode 100644 index 000000000..dfe39840d --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.190.table @@ -0,0 +1,5 @@ +# Product discipline 0 - Meteorological products, parameter category 190: CCITT IA5 string +0 0 Arbitrary text string (CCITT IA5) +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.191.table b/definitions/grib2/tables/33/4.2.0.191.table new file mode 100644 index 000000000..5fce8eab0 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.191.table @@ -0,0 +1,12 @@ +# Product discipline 0 - Meteorological products, parameter category 191: miscellaneous +0 0 Seconds prior to initial reference time (defined in Section 1) (s) +1 1 Geographical latitude (deg N) +2 2 Geographical longitude (deg E) +3 3 Days since last observation (d) +4 4 Tropical cyclone density track (Numeric) +5 5 Hurricane track in spatiotemporal vicinity (boolean) +6 6 Tropical storm track in spatiotemporal vicinity (boolean) +7 7 Tropical depression track in spatiotemporal vicinity (boolean) +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.2.table b/definitions/grib2/tables/33/4.2.0.2.table new file mode 100644 index 000000000..bd6e32851 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.2.table @@ -0,0 +1,72 @@ +# Product discipline 0 - Meteorological products, parameter category 2: momentum +0 0 Wind direction (from which blowing) (degree true) +1 1 Wind speed (m/s) +2 2 u-component of wind (m/s) +3 3 v-component of wind (m/s) +4 4 Stream function (m2/s) +5 5 Velocity potential (m2/s) +6 6 Montgomery stream function (m2 s-2) +7 7 Sigma coordinate vertical velocity (/s) +8 8 Vertical velocity (pressure) (Pa/s) +9 9 Vertical velocity (geometric) (m/s) +10 10 Absolute vorticity (/s) +11 11 Absolute divergence (/s) +12 12 Relative vorticity (/s) +13 13 Relative divergence (/s) +14 14 Potential vorticity (K m2 kg-1 s-1) +15 15 Vertical u-component shear (/s) +16 16 Vertical v-component shear (/s) +17 17 Momentum flux, u-component (N m-2) +18 18 Momentum flux, v-component (N m-2) +19 19 Wind mixing energy (J) +20 20 Boundary layer dissipation (W m-2) +21 21 Maximum wind speed (m/s) +22 22 Wind speed (gust) (m/s) +23 23 u-component of wind (gust) (m/s) +24 24 v-component of wind (gust) (m/s) +25 25 Vertical speed shear (/s) +26 26 Horizontal momentum flux (N m-2) +27 27 u-component storm motion (m/s) +28 28 v-component storm motion (m/s) +29 29 Drag coefficient (Numeric) +30 30 Frictional velocity (m/s) +31 31 Turbulent diffusion coefficient for momentum (m2/s) +32 32 Eta coordinate vertical velocity (/s) +33 33 Wind fetch (m) +34 34 Normal wind component (m/s) +35 35 Tangential wind component (m/s) +36 36 Amplitude function for Rossby wave envelope for meridional wind (m/s) +37 37 Northward turbulent surface stress (N m-2 s) +38 38 Eastward turbulent surface stress (N m-2 s) +39 39 Eastward wind tendency due to parameterization (m s-2) +40 40 Northward wind tendency due to parameterization (m s-2) +41 41 u-component of geostrophic wind (m s-1) +42 42 v-component of geostrophic wind (m s-1) +43 43 Geostrophic wind direction (degree true) +44 44 Geostrophic wind speed (m s-1) +45 45 Unbalanced component of divergence (s-1) +46 46 Vorticity advection (s-2) +47 47 Surface roughness for heat (m) +48 48 Surface roughness for moisture (m) +49 49 Wind stress (N m-2) +50 50 Eastward wind stress (N m-2) +51 51 Northward wind stress (N m-2) +52 52 u-component of wind stress (N m-2) +53 53 v-component of wind stress (N m-2) +54 54 Natural logarithm of surface roughness length for heat (Numeric) +55 55 Natural logarithm of surface roughness length for moisture (Numeric) +56 56 u-component of neutral wind (m s-1) +57 57 v-component of neutral wind (m s-1) +58 58 Magnitude of turbulent surface stress (N m-2) +59 59 Vertical divergence (s-1) +60 60 Drag thermal coefficient (Numeric) +61 61 Drag evaporation coefficient (Numeric) +62 62 Eastward turbulent surface stress (N m-2) +63 63 Northward turbulent surface stress (N m-2) +64 64 Eastward turbulent surface stress due to orographic form drag (N m-2) +65 65 Northward turbulent surface stress due to orographic form drag (N m-2) +66 66 Eastward turbulent surface stress due to surface roughness (N m-2) +67 67 Northward turbulent surface stress due to surface roughness (N m-2) +# 68-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.20.table b/definitions/grib2/tables/33/4.2.0.20.table new file mode 100644 index 000000000..7855a8618 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.20.table @@ -0,0 +1,69 @@ +# Product discipline 0 - Meteorological products, parameter category 20: atmospheric chemical constituents +0 0 Mass density (concentration) (kg m-3) +1 1 Column-integrated mass density (kg m-2) +2 2 Mass mixing ratio (mass fraction in air) (kg/kg) +3 3 Atmosphere emission mass flux (kg m-2 s-1) +4 4 Atmosphere net production mass flux (kg m-2 s-1) +5 5 Atmosphere net production and emission mass flux (kg m-2 s-1) +6 6 Surface dry deposition mass flux (kg m-2 s-1) +7 7 Surface wet deposition mass flux (kg m-2 s-1) +8 8 Atmosphere re-emission mass flux (kg m-2 s-1) +9 9 Wet deposition by large-scale precipitation mass flux (kg m-2 s-1) +10 10 Wet deposition by convective precipitation mass flux (kg m-2 s-1) +11 11 Sedimentation mass flux (kg m-2 s-1) +12 12 Dry deposition mass flux (kg m-2 s-1) +13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) +14 14 Transfer from SO2 (sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) +15 15 Dry deposition velocity (m/s) +16 16 Mass mixing ratio with respect to dry air (kg/kg) +17 17 Mass mixing ratio with respect to wet air (kg/kg) +18 18 Potential of hydrogen (pH) (pH) +# 19-49 Reserved +50 50 Amount in atmosphere (mol) +51 51 Concentration in air (mol m-3) +52 52 Volume mixing ratio (fraction in air) (mol/mol) +53 53 Chemical gross production rate of concentration (mol m-3 s-1) +54 54 Chemical gross destruction rate of concentration (mol m-3 s-1) +55 55 Surface flux (mol m-2 s-1) +56 56 Changes of amount in atmosphere (mol/s) +57 57 Total yearly average burden of the atmosphere (mol) +58 58 Total yearly averaged atmospheric loss (mol/s) +59 59 Aerosol number concentration (m-3) +60 60 Aerosol specific number concentration (kg-1) +61 61 Maximum of mass density in layer (kg m-3) +62 62 Height of maximum mass density (m) +63 63 Column-averaged mass density in layer (kg m-3) +64 64 Mole fraction with respect to dry air (mol/mol) +65 65 Mole fraction with respect to wet air (mol/mol) +66 66 Column-integrated in-cloud scavenging rate by precipitation (kg m-2 s-1) +67 67 Column-integrated below-cloud scavenging rate by precipitation (kg m-2 s-1) +68 68 Column-integrated release rate from evaporating precipitation (kg m-2 s-1) +69 69 Column-integrated in-cloud scavenging rate by large-scale precipitation (kg m-2 s-1) +70 70 Column-integrated below-cloud scavenging rate by large-scale precipitation (kg m-2 s-1) +71 71 Column-integrated release rate from evaporating large-scale precipitation (kg m-2 s-1) +72 72 Column-integrated in-cloud scavenging rate by convective precipitation (kg m-2 s-1) +73 73 Column-integrated below-cloud scavenging rate by convective precipitation (kg m-2 s-1) +74 74 Column-integrated release rate from evaporating convective precipitation (kg m-2 s-1) +75 75 Wildfire flux (kg m-2 s-1) +76 76 Emission rate (kg kg-1 s-1) +77 77 Surface emission flux (kg m-2 s-1) +78 78 Column integrated eastward mass flux (kg m-1 s-1) +79 79 Column integrated northward mass flux (kg m-1 s-1) +80 80 Column integrated divergence of mass flux (kg m-2 s-1) +81 81 Column integrated net source (kg m-2 s-1) +# 82-99 Reserved +100 100 Surface area density (aerosol) (/m) +101 101 Vertical visual range (m) +102 102 Aerosol optical thickness (Numeric) +103 103 Single scattering albedo (Numeric) +104 104 Asymmetry factor (Numeric) +105 105 Aerosol extinction coefficient (/m) +106 106 Aerosol absorption coefficient (/m) +107 107 Aerosol lidar backscatter from satellite (m-1 sr-1) +108 108 Aerosol lidar backscatter from the ground (m-1 sr-1) +109 109 Aerosol lidar extinction from satellite (/m) +110 110 Aerosol lidar extinction from the ground (/m) +111 111 Angstrom exponent (Numeric) +# 112-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.21.table b/definitions/grib2/tables/33/4.2.0.21.table new file mode 100644 index 000000000..05646e1a6 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.21.table @@ -0,0 +1,27 @@ +# Product discipline 0 - Meteorological products, parameter category 21: thermodynamic properties +0 0 Column integrated potential + internal energy (J m-2) +1 1 Column integrated kinetic energy (J m-2) +2 2 Column integrated total energy (J m-2) +3 3 Column integrated enthalpy (J m-2) +4 4 Column integrated water enthalpy (J m-2) +5 5 Column integrated eastward enthalpy flux (W m-1) +6 6 Column integrated northward enthalpy flux (W m-1) +7 7 Column integrated eastward potential energy flux (W m-1) +8 8 Column integrated northward potential energy flux (W m-1) +9 9 Column integrated eastward kinetic energy flux (W m-1) +10 10 Column integrated northward kinetic energy flux (W m-1) +11 11 Column integrated eastward total energy flux (W m-1) +12 12 Column integrated northward total energy flux (W m-1) +13 13 Divergence of column integrated enthalpy flux (W m-2) +14 14 Divergence of column integrated potential energy flux (W m-2) +15 15 Divergence of column integrated water potential energy flux (W m-2) +16 16 Divergence of column integrated kinetic energy flux (W m-2) +17 17 Divergence of column integrated total energy flux (W m-2) +18 18 Divergence of column integrated water enthalpy flux (W m-2) +19 19 Column integrated eastward heat flux (W m-1) +20 20 Column integrated northward heat flux (W m-1) +21 21 Column integrated potential+internal+latent energy (J m-2) +22 22 Eady growth rate (day-1) +# 23-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.22.table b/definitions/grib2/tables/33/4.2.0.22.table new file mode 100644 index 000000000..726bda9c0 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.22.table @@ -0,0 +1,11 @@ +# Product discipline 0 - Meteorological products, parameter category 22: drought indices +0 0 Standard Precipitation Index (SPI) (dimensionless) +1 1 Standardized Precipitation Evapotranspiration Index (SPEI) (dimensionless) +2 2 Standardized Streamflow index (SSFI) (dimensionless) +3 3 Standardized Reservoir Supply Index (SRSI) (dimensionless) +4 4 Standardized Water-level Index (SWI) (dimensionless) +5 5 Standardized Snowmelt and Rain Index (SMRI) (dimensionless) +6 6 Streamflow Drought Index (SDI) (dimensionless) +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.3.table b/definitions/grib2/tables/33/4.2.0.3.table new file mode 100644 index 000000000..d685de2ef --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.3.table @@ -0,0 +1,51 @@ +# Product discipline 0 - Meteorological products, parameter category 3: mass +0 0 Pressure (Pa) +1 1 Pressure reduced to MSL (Pa) +2 2 Pressure tendency (Pa/s) +3 3 ICAO Standard Atmosphere Reference Height (m) +4 4 Geopotential (m2 s-2) +5 5 Geopotential height (gpm) +6 6 Geometric height (m) +7 7 Standard deviation of height (m) +8 8 Pressure anomaly (Pa) +9 9 Geopotential height anomaly (gpm) +10 10 Density (kg m-3) +11 11 Altimeter setting (Pa) +12 12 Thickness (m) +13 13 Pressure altitude (m) +14 14 Density altitude (m) +15 15 5-wave geopotential height (gpm) +16 16 Zonal flux of gravity wave stress (N m-2) +17 17 Meridional flux of gravity wave stress (N m-2) +18 18 Planetary boundary layer height (m) +19 19 5-wave geopotential height anomaly (gpm) +20 20 Standard deviation of sub-grid scale orography (m) +21 21 Angle of sub-gridscale orography (rad) +22 22 Slope of sub-gridscale orography (Numeric) +23 23 Gravity wave dissipation (W m-2) +24 24 Anisotropy of sub-gridscale orography (Numeric) +25 25 Natural logarithm of pressure in Pa (Numeric) +26 26 Exner pressure (Numeric) +27 27 Updraught mass flux (kg m-2 s-1) +28 28 Downdraught mass flux (kg m-2 s-1) +29 29 Updraught detrainment rate (kg m-3 s-1) +30 30 Downdraught detrainment rate (kg m-3 s-1) +31 31 Unbalanced component of logarithm of surface pressure (-) +32 32 Saturation water vapour pressure (Pa) +33 33 Geometric altitude above mean sea level (m) +34 34 Geometric height above ground level (m) +35 35 Column integrated divergence of total mass flux (kg m-2 s-1) +36 36 Column integrated eastward total mass flux (kg m-1 s-1) +37 37 Column integrated northward total mass flux (kg m-1 s-1) +38 38 Standard deviation of filtered subgrid orography (m) +39 39 Column integrated mass of atmosphere (kg m-2) +40 40 Column integrated eastward geopotential flux (W m-1) +41 41 Column integrated northward geopotential flux (W m-1) +42 42 Column integrated divergence of water geopotential flux (W m-2) +43 43 Column integrated divergence of geopotential flux (W m-2) +44 44 Height of zero-degree wet-bulb temperature (m) +45 45 Height of one-degree wet-bulb temperature (m) +46 46 Pressure departure from hydrostatic state (Pa) +# 47-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.4.table b/definitions/grib2/tables/33/4.2.0.4.table new file mode 100644 index 000000000..88c24ae52 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.4.table @@ -0,0 +1,33 @@ +# Product discipline 0 - Meteorological products, parameter category 4: short-wave radiation +0 0 Net short-wave radiation flux (surface) (W m-2) +1 1 Net short-wave radiation flux (top of atmosphere) (W m-2) +2 2 Short-wave radiation flux (W m-2) +3 3 Global radiation flux (W m-2) +4 4 Brightness temperature (K) +5 5 Radiance (with respect to wave number) (W m-1 sr-1) +6 6 Radiance (with respect to wavelength) (W m-3 sr-1) +7 7 Downward short-wave radiation flux (W m-2) +8 8 Upward short-wave radiation flux (W m-2) +9 9 Net short wave radiation flux (W m-2) +10 10 Photosynthetically active radiation (W m-2) +11 11 Net short-wave radiation flux, clear sky (W m-2) +12 12 Downward UV radiation (W m-2) +13 13 Direct short-wave radiation flux (W m-2) +14 14 Diffuse short-wave radiation flux (W m-2) +15 15 Upward UV radiation emitted/reflected from the Earth's surface (W m-2) +# 16-49 Reserved +50 50 UV index (under clear sky) (Numeric) +51 51 UV index (Numeric) +52 52 Downward short-wave radiation flux, clear sky (W m-2) +53 53 Upward short-wave radiation flux, clear sky (W m-2) +54 54 Direct normal short-wave radiation flux (W m-2) +55 55 UV visible albedo for diffuse radiation (%) +56 56 UV visible albedo for direct radiation (%) +57 57 UV visible albedo for direct radiation, geometric component (%) +58 58 UV visible albedo for direct radiation, isotropic component (%) +59 59 UV visible albedo for direct radiation, volumetric component (%) +60 60 Photosynthetically active radiation flux, clear sky (W m-2) +61 61 Direct short-wave radiation flux, clear sky (W m-2) +# 62-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.5.table b/definitions/grib2/tables/33/4.2.0.5.table new file mode 100644 index 000000000..7065106a2 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.5.table @@ -0,0 +1,18 @@ +# Product discipline 0 - Meteorological products, parameter category 5: long-wave radiation +0 0 Net long-wave radiation flux (surface) (W m-2) +1 1 Net long-wave radiation flux (top of atmosphere) (W m-2) +2 2 Long-wave radiation flux (W m-2) +3 3 Downward long-wave radiation flux (W m-2) +4 4 Upward long-wave radiation flux (W m-2) +5 5 Net long-wave radiation flux (W m-2) +6 6 Net long-wave radiation flux, clear sky (W m-2) +7 7 Brightness temperature (K) +8 8 Downward long-wave radiation flux, clear sky (W m-2) +9 9 Near IR albedo for diffuse radiation (%) +10 10 Near IR albedo for direct radiation (%) +11 11 Near IR albedo for direct radiation, geometric component (%) +12 12 Near IR albedo for direct radiation, isotropic component (%) +13 13 Near IR albedo for direct radiation, volumetric component (%) +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.6.table b/definitions/grib2/tables/33/4.2.0.6.table new file mode 100644 index 000000000..d831f3474 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.6.table @@ -0,0 +1,51 @@ +# Product discipline 0 - Meteorological products, parameter category 6: cloud +0 0 Cloud ice (kg m-2) +1 1 Total cloud cover (%) +2 2 Convective cloud cover (%) +3 3 Low cloud cover (%) +4 4 Medium cloud cover (%) +5 5 High cloud cover (%) +6 6 Cloud water (kg m-2) +7 7 Cloud amount (%) +8 8 Cloud type (Code table 4.203) +9 9 Thunderstorm maximum tops (m) +10 10 Thunderstorm coverage (Code table 4.204) +11 11 Cloud base (m) +12 12 Cloud top (m) +13 13 Ceiling (m) +14 14 Non-convective cloud cover (%) +15 15 Cloud work function (J/kg) +16 16 Convective cloud efficiency (Proportion) +17 17 Total condensate (kg/kg) +18 18 Total column-integrated cloud water (kg m-2) +19 19 Total column-integrated cloud ice (kg m-2) +20 20 Total column-integrated condensate (kg m-2) +21 21 Ice fraction of total condensate (Proportion) +22 22 Cloud cover (%) +23 23 Cloud ice mixing ratio (kg/kg) +24 24 Sunshine (Numeric) +25 25 Horizontal extent of cumulonimbus (CB) (%) +26 26 Height of convective cloud base (m) +27 27 Height of convective cloud top (m) +28 28 Number of cloud droplets per unit mass of air (/kg) +29 29 Number of cloud ice particles per unit mass of air (/kg) +30 30 Number density of cloud droplets (m-3) +31 31 Number density of cloud ice particles (m-3) +32 32 Fraction of cloud cover (Numeric) +33 33 Sunshine duration (s) +34 34 Surface long-wave effective total cloudiness (Numeric) +35 35 Surface short-wave effective total cloudiness (Numeric) +36 36 Fraction of stratiform precipitation cover (Proportion) +37 37 Fraction of convective precipitation cover (Proportion) +38 38 Mass density of cloud droplets (kg m-3) +39 39 Mass density of cloud ice (kg m-3) +40 40 Mass density of convective cloud water droplets (kg m-3) +# 41-46 Reserved +47 47 Volume fraction of cloud water droplets (Numeric) +48 48 Volume fraction of cloud ice particles (Numeric) +49 49 Volume fraction of cloud (ice and/or water) (Numeric) +50 50 Fog (%) +51 51 Sunshine duration fraction (Proportion) +# 52-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.0.7.table b/definitions/grib2/tables/33/4.2.0.7.table new file mode 100644 index 000000000..15acb1857 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.0.7.table @@ -0,0 +1,25 @@ +# Product discipline 0 - Meteorological products, parameter category 7: thermodynamic stability indices +0 0 Parcel lifted index (to 500 hPa) (K) +1 1 Best lifted index (to 500 hPa) (K) +2 2 K index (K) +3 3 KO index (K) +4 4 Total totals index (K) +5 5 Sweat index (Numeric) +6 6 Convective available potential energy (J/kg) +7 7 Convective inhibition (J/kg) +8 8 Storm relative helicity (J/kg) +9 9 Energy helicity index (Numeric) +10 10 Surface lifted index (K) +11 11 Best (4-layer) lifted index (K) +12 12 Richardson number (Numeric) +13 13 Showalter index (K) +14 14 Reserved +15 15 Updraught helicity (m2 s-2) +16 16 Bulk Richardson number (Numeric) +17 17 Gradient Richardson number (Numeric) +18 18 Flux Richardson number (Numeric) +19 19 Convective available potential energy - shear (m2 s-2) +20 20 Thunderstorm intensity index (Code table 4.246) +# 21-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.1.0.table b/definitions/grib2/tables/33/4.2.1.0.table new file mode 100644 index 000000000..7072b3d44 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.1.0.table @@ -0,0 +1,25 @@ +# Product discipline 1 - Hydrological products, parameter category 0: hydrology basic products +0 0 Flash flood guidance (Encoded as an accumulation over a floating subinterval of time between the reference time and valid time) (kg m-2) +1 1 Flash flood runoff (Encoded as an accumulation over a floating subinterval of time) (kg m-2) +2 2 Remotely-sensed snow cover (Code table 4.215) +3 3 Elevation of snow-covered terrain (Code table 4.216) +4 4 Snow water equivalent per cent of normal (%) +5 5 Baseflow-groundwater runoff (kg m-2) +6 6 Storm surface runoff (kg m-2) +7 7 Discharge from rivers or streams (m3/s) +8 8 Groundwater upper storage (kg m-2) +9 9 Groundwater lower storage (kg m-2) +10 10 Side flow into river channel (m3 s-1 m-1) +11 11 River storage of water (m3) +12 12 Floodplain storage of water (m3) +13 13 Water on soil surface (kg m-2) +14 14 Upstream accumulated precipitation (kg m-2) +15 15 Upstream accumulated snow melt (kg m-2) +16 16 Percolation rate (kg m-2 s-1) +17 17 River outflow of water (m3 s-1) +18 18 Floodplain outflow of water (m3 s-1) +19 19 Floodpath outflow of water (m3 s-1) +20 20 Water on surface (kg m-2) +# 21-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.1.1.table b/definitions/grib2/tables/33/4.2.1.1.table new file mode 100644 index 000000000..e3931d5e6 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.1.1.table @@ -0,0 +1,7 @@ +# Product discipline 1 - Hydrological products, parameter category 1: hydrology probabilities +0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) +1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) +2 2 Probability of 0.01 inch of precipitation (POP) (%) +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.1.2.table b/definitions/grib2/tables/33/4.2.1.2.table new file mode 100644 index 000000000..2c4e0f50d --- /dev/null +++ b/definitions/grib2/tables/33/4.2.1.2.table @@ -0,0 +1,28 @@ +# Product discipline 1 - Hydrological products, parameter category 2: inland water and sediment properties +0 0 Water depth (m) +1 1 Water temperature (K) +2 2 Water fraction (Proportion) +3 3 Sediment thickness (m) +4 4 Sediment temperature (K) +5 5 Ice thickness (m) +6 6 Ice temperature (K) +7 7 Ice cover (Proportion) +8 8 Land cover (0 = water, 1 = land) (Proportion) +9 9 Shape factor with respect to salinity profile (-) +10 10 Shape factor with respect to temperature profile in thermocline (-) +11 11 Attenuation coefficient of water with respect to solar radiation (m) +12 12 Salinity (kg/kg) +13 13 Cross-sectional area of flow in channel (m2) +14 14 Snow temperature (K) +15 15 Lake depth (m) +16 16 River depth (m) +17 17 Floodplain depth (m) +18 18 Floodplain flooded fraction (proportion) +19 19 FLoodplain flooded area (m2) +20 20 River fraction (proportion) +21 21 River area (m2) +22 22 Fraction of river coverage plus river related flooding (proportion) +23 23 Area of river coverage plus river related flooding (m2) +# 24-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.10.0.table b/definitions/grib2/tables/33/4.2.10.0.table new file mode 100644 index 000000000..92b18661a --- /dev/null +++ b/definitions/grib2/tables/33/4.2.10.0.table @@ -0,0 +1,103 @@ +# Product discipline 10 - Oceanographic products, parameter category 0: waves +0 0 Wave spectra (1) (-) +1 1 Wave spectra (2) (-) +2 2 Wave spectra (3) (-) +3 3 Significant height of combined wind waves and swell (m) +4 4 Direction of wind waves (degree true) +5 5 Significant height of wind waves (m) +6 6 Mean period of wind waves (s) +7 7 Direction of swell waves (degree true) +8 8 Significant height of swell waves (m) +9 9 Mean period of swell waves (s) +10 10 Primary wave direction (degree true) +11 11 Primary wave mean period (s) +12 12 Secondary wave direction (degree true) +13 13 Secondary wave mean period (s) +14 14 Mean direction of combined wind waves and swell (degree true) +15 15 Mean period of combined wind waves and swell (s) +16 16 Coefficient of drag with waves (-) +17 17 Friction velocity (m/s) +18 18 Wave stress (N m-2) +19 19 Normalized wave stress (-) +20 20 Mean square slope of waves (-) +21 21 u-component surface Stokes drift (m/s) +22 22 v-component surface Stokes drift (m/s) +23 23 Period of maximum individual wave height (s) +24 24 Maximum individual wave height (m) +25 25 Inverse mean wave frequency (s) +26 26 Inverse mean frequency of wind waves (s) +27 27 Inverse mean frequency of total swell (s) +28 28 Mean zero-crossing wave period (s) +29 29 Mean zero-crossing period of wind waves (s) +30 30 Mean zero-crossing period of total swell (s) +31 31 Wave directional width (-) +32 32 Directional width of wind waves (-) +33 33 Directional width of total swell (-) +34 34 Peak wave period (s) +35 35 Peak period of wind waves (s) +36 36 Peak period of total swell (s) +37 37 Altimeter wave height (m) +38 38 Altimeter corrected wave height (m) +39 39 Altimeter range relative correction (-) +40 40 10-metre neutral wind speed over waves (m/s) +41 41 10-metre wind direction over waves (deg) +42 42 Wave energy spectrum (m2 s rad-1) +43 43 Kurtosis of the sea-surface elevation due to waves (-) +44 44 Benjamin-Feir index (-) +45 45 Spectral peakedness factor (/s) +46 46 Peak wave direction (deg) +47 47 Significant wave height of first swell partition (m) +48 48 Significant wave height of second swell partition (m) +49 49 Significant wave height of third swell partition (m) +50 50 Mean wave period of first swell partition (s) +51 51 Mean wave period of second swell partition (s) +52 52 Mean wave period of third swell partition (s) +53 53 Mean wave direction of first swell partition (deg) +54 54 Mean wave direction of second swell partition (deg) +55 55 Mean wave direction of third swell partition (deg) +56 56 Wave directional width of first swell partition (-) +57 57 Wave directional width of second swell partition (-) +58 58 Wave directional width of third swell partition (-) +59 59 Wave frequency width of first swell partition (-) +60 60 Wave frequency width of second swell partition (-) +61 61 Wave frequency width of third swell partition (-) +62 62 Wave frequency width (-) +63 63 Frequency width of wind waves (-) +64 64 Frequency width of total swell (-) +65 65 Peak wave period of first swell partition (s) +66 66 Peak wave period of second swell partition (s) +67 67 Peak wave period of third swell partition (s) +68 68 Peak wave direction of first swell partition (degree true) +69 69 Peak wave direction of second swell partition (degree true) +70 70 Peak wave direction of third swell partition (degree true) +71 71 Peak direction of wind waves (degree true) +72 72 Peak direction of total swell (degree true) +73 73 Whitecap fraction (fraction) +74 74 Mean direction of total swell (degree) +75 75 Mean direction of wind waves (degree) +76 76 Charnock (Numeric) +77 77 Wave Spectral Skewness (Numeric) +78 78 Wave energy flux magnitude (W m-1) +79 79 Wave energy flux mean direction (degree true) +80 80 Ratio of wave angular and frequency width (Numeric) +81 81 Free convective velocity over the oceans (m s-1) +82 82 Air density over the oceans (kg m-3) +83 83 Normalized energy flux into waves (Numeric) +84 84 Normalized stress into ocean (Numeric) +85 85 Normalized energy flux into ocean (Numeric) +86 86 Surface elevation variance due to waves (over all frequencies and directions) (m2 s rad-1) +87 87 Wave induced mean sea level correction (m) +88 88 Spectral width index (Numeric) +89 89 Number of events in freak waves statistics (Numeric) +90 90 u-component of surface momentum flux into ocean (N m-2) +91 91 v-component of surface momentum flux into ocean (N m-2) +92 92 Wave turbulent energy flux into ocean (W m-2) +93 93 Envelop maximum individual wave height (m) +94 94 Time domain maximum individual crest height (m) +95 95 Time domain maximum individual wave height (m) +96 96 Space time maximum individual crest height (m) +97 97 Space time maximum individual wave height (m) +98 98 Goda peakedness factor (Numeric) +# 99-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.10.1.table b/definitions/grib2/tables/33/4.2.10.1.table new file mode 100644 index 000000000..aeec67455 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.10.1.table @@ -0,0 +1,11 @@ +# Product discipline 10 - Oceanographic products, parameter category 1: currents +0 0 Current direction (degree true) +1 1 Current speed (m/s) +2 2 u-component of current (m/s) +3 3 v-component of current (m/s) +4 4 Rip current occurrence probability (%) +5 5 Eastward current (m s-1) +6 6 Northward current (m s-1) +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.10.191.table b/definitions/grib2/tables/33/4.2.10.191.table new file mode 100644 index 000000000..cd4d4cde7 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.10.191.table @@ -0,0 +1,9 @@ +# Product discipline 10 - Oceanographic products, parameter category 191: miscellaneous +0 0 Seconds prior to initial reference time (defined in Section 1) (s) +1 1 Meridional overturning stream function (m3/s) +2 2 Reserved +3 3 Days since last observation (d) +4 4 Barotropic stream function (m3 s-1) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.10.2.table b/definitions/grib2/tables/33/4.2.10.2.table new file mode 100644 index 000000000..0f27bd249 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.10.2.table @@ -0,0 +1,34 @@ +# Product discipline 10 - Oceanographic products, parameter category 2: ice +0 0 Ice cover (Proportion) +1 1 Ice thickness (m) +2 2 Direction of ice drift (degree true) +3 3 Speed of ice drift (m/s) +4 4 u-component of ice drift (m/s) +5 5 v-component of ice drift (m/s) +6 6 Ice growth rate (m/s) +7 7 Ice divergence (/s) +8 8 Ice temperature (K) +9 9 Module of ice internal pressure (Pa m) +10 10 Zonal vector component of vertically integrated ice internal pressure (Pa m) +11 11 Meridional vector component of vertically integrated ice internal pressure (Pa m) +12 12 Compressive ice strength (N/m) +13 13 Snow temperature (over sea ice) (K) +14 14 Albedo (Numeric) +15 15 Sea ice volume per unit area (m3 m-2) +16 16 Snow volume over sea ice per unit area (m3 m-2) +17 17 Sea ice heat content (J m-2) +18 18 Snow over sea ice heat content (J m-2) +19 19 Ice freeboard thickness (m) +20 20 Ice melt pond fraction (fraction) +21 21 Ice melt pond depth (m) +22 22 Ice melt pond volume per unit area (m3 m-2) +23 23 Sea ice fraction tendency due to parameterization (s-1) +24 24 x-component of ice drift (m s-1) +25 25 y-component of ice drift (m s-1) +26 26 Sea ice salinity (g kg-1) +27 27 Freezing/melting potential (W m-2) +28 28 Melt onset date (Numeric) +29 29 Freeze onset date (Numeric) +# 30-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.10.3.table b/definitions/grib2/tables/33/4.2.10.3.table new file mode 100644 index 000000000..6c4277c8e --- /dev/null +++ b/definitions/grib2/tables/33/4.2.10.3.table @@ -0,0 +1,26 @@ +# Product discipline 10 - Oceanographic products, parameter category 3: surface properties +0 0 Water temperature (K) +1 1 Deviation of sea level from mean (m) +2 2 Heat exchange coefficient (-) +3 3 Practical salinity (Numeric) +4 4 Downward heat flux (W m-2) +5 5 Eastward surface stress (N m-2) +6 6 Northward surface stress (N m-2) +7 7 x-component surface stress (N m-2) +8 8 y-component surface stress (N m-2) +9 9 Thermosteric change in sea surface height (m) +10 10 Halosteric change in sea surface height (m) +11 11 Steric change in sea surface height (m) +12 12 Sea salt flux (kg m-2 s-1) +13 13 Net upward water flux (kg m-2 s-1) +14 14 Eastward surface water velocity (m s-1) +15 15 Northward surface water velocity (m s-1) +16 16 x-component of surface water velocity (m s-1) +17 17 y-component of surface water velocity (m s-1) +18 18 Heat flux correction (W m-2) +19 19 Sea surface height tendency due to parameterization (m s-1) +20 20 Deviation of sea level from mean with inverse barometer correction (m) +21 21 Salinity (kg kg-1) +# 22-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.10.4.table b/definitions/grib2/tables/33/4.2.10.4.table new file mode 100644 index 000000000..0b9ef0956 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.10.4.table @@ -0,0 +1,54 @@ +# Product discipline 10 - Oceanographic products, parameter category 4: subsurface properties +0 0 Main thermocline depth (m) +1 1 Main thermocline anomaly (m) +2 2 Transient thermocline depth (m) +3 3 Salinity (kg/kg) +4 4 Ocean vertical heat diffusivity (m2/s) +5 5 Ocean vertical salt diffusivity (m2/s) +6 6 Ocean vertical momentum diffusivity (m2/s) +7 7 Bathymetry (m) +# 8-10 Reserved +11 11 Shape factor with respect to salinity profile (-) +12 12 Shape factor with respect to temperature profile in thermocline (-) +13 13 Attenuation coefficient of water with respect to solar radiation (/m) +14 14 Water depth (m) +15 15 Water temperature (K) +16 16 Water density (rho) (kg m-3) +17 17 Water density anomaly (sigma) (kg m-3) +18 18 Water potential temperature (theta) (K) +19 19 Water potential density (rho theta) (kg m-3) +20 20 Water potential density anomaly (sigma theta) (kg m-3) +21 21 Practical salinity (Numeric) +22 22 Water column-integrated heat content (J m-2) +23 23 Eastward water velocity (m s-1) +24 24 Northward water velocity (m s-1) +25 25 x-component water velocity (m s-1) +26 26 y-component water velocity (m s-1) +27 27 Upward water velocity (m s-1) +28 28 Vertical eddy diffusivity (m2 s-1) +29 29 Bottom pressure equivalent height (m) +30 30 Fresh water flux into sea water from rivers (kg m-2 s-1) +31 31 Fresh water flux correction (kg m-2 s-1) +32 32 Virtual salt flux into sea water (g kg-1 m-2 s-1) +33 33 Virtual salt flux correction (g kg-1 m-2 s-1) +34 34 Sea water temperature tendency due to Newtonian relaxation (K s-1) +35 35 Sea water salinity tendency due to Newtonian relaxation (g kg-1 s-1) +36 36 Sea water temperature tendency due to parameterization (K s-1) +37 37 Sea water salinity tendency due to parameterization (g kg-1 s-1) +38 38 Eastward sea water velocity tendency due to parameterization (m s-2) +39 39 Northward sea water velocity tendency due to parameterization (m s-2) +40 40 Sea water temperature tendency due to direct bias correction (K s-1) +41 41 Sea water salinity tendency due to direct bias correction (g kg-1 s-1) +42 42 Sea water meridional volume transport (m3 m-2 s-1) +43 43 Sea water zonal volume transport (m3 m-2 s-1) +44 44 Sea water column integrated meridional volume transport (m3 m-1 s-1) +45 45 Sea water column integrated zonal volume transport (m3 m-1 s-1) +46 46 Sea water meridional mass transport (kg m-2 s-1) +47 47 Sea water zonal mass transport (kg m-2 s-1) +48 48 Sea water column integrated meridional mass transport (kg m-1 s-1) +49 49 Sea water column integrated zonal mass transport (kg m-1 s-1) +50 50 Sea water column integrated practical salinity (g kg-1 m) +51 51 Sea water column integrated salinity (kg kg-1 m) +# 52-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.2.0.table b/definitions/grib2/tables/33/4.2.2.0.table new file mode 100644 index 000000000..8daeafd85 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.2.0.table @@ -0,0 +1,68 @@ +# Product discipline 2 - Land surface products, parameter category 0: vegetation/biomass +0 0 Land cover (0 = sea, 1 = land) (Proportion) +1 1 Surface roughness (m) +2 2 Soil temperature (K) +3 3 Soil moisture content (kg m-2) +4 4 Vegetation (%) +5 5 Water runoff (kg m-2) +6 6 Evapotranspiration (kg-2 s-1) +7 7 Model terrain height (m) +8 8 Land use (Code table 4.212) +9 9 Volumetric soil moisture content (Proportion) +10 10 Ground heat flux (W m-2) +11 11 Moisture availability (%) +12 12 Exchange coefficient (kg m-2 s-1) +13 13 Plant canopy surface water (kg m-2) +14 14 Blackadar's mixing length scale (m) +15 15 Canopy conductance (m/s) +16 16 Minimal stomatal resistance (s/m) +17 17 Wilting point (Proportion) +18 18 Solar parameter in canopy conductance (Proportion) +19 19 Temperature parameter in canopy (Proportion) +20 20 Humidity parameter in canopy conductance (Proportion) +21 21 Soil moisture parameter in canopy conductance (Proportion) +22 22 Soil moisture (kg m-3) +23 23 Column-integrated soil water (kg m-2) +24 24 Heat flux (W m-2) +25 25 Volumetric soil moisture (m3 m-3) +26 26 Wilting point (kg m-3) +27 27 Volumetric wilting point (m3 m-3) +28 28 Leaf area index (Numeric) +29 29 Evergreen forest cover (Proportion) +30 30 Deciduous forest cover (Proportion) +31 31 Normalized differential vegetation index (NDVI) (Numeric) +32 32 Root depth of vegetation (m) +33 33 Water runoff and drainage (kg m-2) +34 34 Surface water runoff (kg m-2) +35 35 Tile class (Code table 4.243) +36 36 Tile fraction (Proportion) +37 37 Tile percentage (%) +38 38 Soil volumetric ice content (water equivalent) (m3 m-3) +39 39 Evapotranspiration rate (kg m-2 s-1) +40 40 Potential evapotranspiration rate (kg m-2 s-1) +41 41 Snow melt rate (kg m-2 s-1) +42 42 Water runoff and drainage rate (kg m-2 s-1) +43 43 Drainage direction (Code table 4.250) +44 44 Upstream area (m2) +45 45 Wetland cover (Proportion) +46 46 Wetland type (Code table 4.239) +47 47 Irrigation cover (Proportion) +48 48 C4 crop cover (Proportion) +49 49 C4 grass cover (Proportion) +50 50 Skin reservoir content (kg m-2) +51 51 Surface runoff rate (kg m-2 s-1) +52 52 Subsurface runoff rate (kg m-2 s-1) +53 53 Low-vegetation cover (Proportion) +54 54 High-vegetation cover (Proportion) +55 55 Leaf area index, low-vegetation (m2 m-2) +56 56 Leaf area index, high-vegetation (m2 m-2) +57 57 Type of low-vegetation (Code table 4.234) +58 58 Type of high-vegetation (Code table 4.234) +59 59 Net ecosystem exchange flux (kg m-2 s-1) +60 60 Gross primary production flux (kg m-2 s-1) +61 61 Ecosystem respiration flux (kg m-2 s-1) +62 62 Emissivity (Proportion) +63 63 Canopy air temperature (K) +# 64-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.2.3.table b/definitions/grib2/tables/33/4.2.2.3.table new file mode 100644 index 000000000..ad6b618f2 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.2.3.table @@ -0,0 +1,35 @@ +# Product discipline 2 - Land surface products, parameter category 3: soil products +0 0 Soil type (Code table 4.213) +1 1 Upper layer soil temperature (K) +2 2 Upper layer soil moisture (kg m-3) +3 3 Lower layer soil moisture (kg m-3) +4 4 Bottom layer soil temperature (K) +5 5 Liquid volumetric soil moisture (non-frozen) (Proportion) +6 6 Number of soil layers in root zone (Numeric) +7 7 Transpiration stress-onset (soil moisture) (Proportion) +8 8 Direct evaporation cease (soil moisture) (Proportion) +9 9 Soil porosity (Proportion) +10 10 Liquid volumetric soil moisture (non-frozen) (m3 m-3) +11 11 Volumetric transpiration stress-onset (soil moisture) (m3 m-3) +12 12 Transpiration stress-onset (soil moisture) (kg m-3) +13 13 Volumetric direct evaporation cease (soil moisture) (m3 m-3) +14 14 Direct evaporation cease (soil moisture) (kg m-3) +15 15 Soil porosity (m3 m-3) +16 16 Volumetric saturation of soil moisture (m3 m-3) +17 17 Saturation of soil moisture (kg m-3) +18 18 Soil temperature (K) +19 19 Soil moisture (kg m-3) +20 20 Column-integrated soil moisture (kg m-2) +21 21 Soil ice (kg m-3) +22 22 Column-integrated soil ice (kg m-2) +23 23 Liquid water in snow pack (kg m-2) +24 24 Frost index (K day-1) +25 25 Snow depth at elevation bands (kg m-2) +26 26 Soil heat flux (W m-2) +27 27 Soil depth (m) +28 28 Snow temperature (K) +29 29 Ice temperature (K) +30 30 Soil wetness index (Numeric) +# 31-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.2.4.table b/definitions/grib2/tables/33/4.2.2.4.table new file mode 100644 index 000000000..0ea44a18c --- /dev/null +++ b/definitions/grib2/tables/33/4.2.2.4.table @@ -0,0 +1,41 @@ +# Product discipline 2 - Land surface products, parameter category 4: fire weather products +0 0 Fire outlook (Code table 4.224) +1 1 Fire outlook due to dry thunderstorm (Code table 4.224) +2 2 Haines index (Numeric) +3 3 Fire burned area (%) +4 4 Fosberg index (Numeric) +5 5 Forest Fire Weather Index (as defined by the Canadian Forest Service) (Numeric) +6 6 Fine Fuel Moisture Code (as defined by the Canadian Forest Service) (Numeric) +7 7 Duff Moisture Code (as defined by the Canadian Forest Service) (Numeric) +8 8 Drought Code (as defined by the Canadian Forest Service) (Numeric) +9 9 Initial Fire Spread Index (as defined by the Canadian Forest Service) (Numeric) +10 10 Fire Buildup Index (as defined by the Canadian Forest Service) (Numeric) +11 11 Fire Daily Severity Rating (as defined by the Canadian Forest Service) (Numeric) +12 12 Keetch-Byram drought index (Numeric) +13 13 Drought factor (as defined by the Australian forest service ) (Numeric) +14 14 Rate of spread (as defined by the Australian forest service ) (m/s) +15 15 Fire danger index (as defined by the Australian forest service ) (Numeric) +16 16 Spread component (as defined by the US Forest Service National Fire Danger Rating System) (Numeric) +17 17 Burning index (as defined by the US Forest Service National Fire Danger Rating System) (Numeric) +18 18 Ignition component (as defined by the US Forest Service National Fire Danger Rating System) (%) +19 19 Energy release component (as defined by the US Forest Service National Fire Danger Rating System) (Joule/m2) +20 20 Burning area (%) +21 21 Burnable area (%) +22 22 Unburnable area (%) +23 23 Fuel load (kg m-2) +24 24 Combustion completeness (%) +25 25 Fuel moisture content (kg kg-1) +26 26 Wildfire potential (as defined by the US NOAA Global Systems Laboratory) (Numeric) +27 27 Live leaf fuel load (kg m-2) +28 28 Live wood fuel load (kg m-2) +29 29 Dead leaf fuel load (kg m-2) +30 30 Dead wood fuel load (kg m-2) +31 31 Live fuel moisture content (kg kg-1) +32 32 Fine dead leaf moisture content (kg kg-1) +33 33 Dense dead leaf moisture content (kg kg-1) +34 34 Fine dead wood moisture content (kg kg-1) +35 35 Dense dead wood moisture content (kg kg-1) +36 36 Fire radiative power (W) +# 37-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.2.5.table b/definitions/grib2/tables/33/4.2.2.5.table new file mode 100644 index 000000000..1d08dd573 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.2.5.table @@ -0,0 +1,6 @@ +# Product discipline 2 - Land surface products, parameter category 5: glaciers and inland ice +0 0 Glacier cover (Proportion) +1 1 Glacier temperature (K) +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.2.6.table b/definitions/grib2/tables/33/4.2.2.6.table new file mode 100644 index 000000000..7a7712af0 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.2.6.table @@ -0,0 +1,13 @@ +# Product discipline 2 - Land surface products, parameter category 6: urban areas +0 0 Urban cover (Proportion) +1 1 Road cover (Proportion) +2 2 Building cover (Proportion) +3 3 Building height (m) +4 4 Vertical-to-horizontal area fraction (m2 m-2) +5 5 Standard deviation of building height (m) +6 6 Distance downward from roof surface (m) +7 7 Distance inward from outer wall surface (m) +8 8 Distance downward from road surface (m) +# 9-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.20.0.table b/definitions/grib2/tables/33/4.2.20.0.table new file mode 100644 index 000000000..a997371d9 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.20.0.table @@ -0,0 +1,13 @@ +# Product discipline 20 - Health and socioeconomic impacts, parameter category 0: health indicators +0 0 Universal thermal climate index (K) +1 1 Mean radiant temperature (K) +2 2 Wet-bulb globe temperature (K) +3 3 Globe temperature (K) +4 4 Humidex (K) +5 5 Effective temperature (K) +6 6 Normal effective temperature (K) +7 7 Standard effective temperature (K) +8 8 Physiological equivalent temperature (K) +# 9-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.20.1.table b/definitions/grib2/tables/33/4.2.20.1.table new file mode 100644 index 000000000..0712cd8d1 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.20.1.table @@ -0,0 +1,14 @@ +# Product discipline 20 - Health and socioeconomic impacts, parameter category 1: epidemiology +0 0 Malaria cases (Fraction) +1 1 Malaria circumsporozoite protein rate (Fraction) +2 2 Plasmodium falciparum entomological inoculation rate (Bites per day per person) +3 3 Human bite rate by anopheles vectors (Bites per day per person) +4 4 Malaria immunity (Fraction) +5 5 Falciparum parasite rates (Fraction) +6 6 Detectable falciparum parasite ratio (after day 10) (Fraction) +7 7 Anopheles vector to host ratio (Fraction) +8 8 Anopheles vector number (Number m-2) +9 9 Fraction of malarial vector reproductive habitat (Fraction) +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.20.2.table b/definitions/grib2/tables/33/4.2.20.2.table new file mode 100644 index 000000000..d6b9083d1 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.20.2.table @@ -0,0 +1,5 @@ +# Product discipline 20 - Health and socioeconomic impacts, parameter category 2: socioeconomic indicators +0 0 Population density (Person m-2) +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.20.3.table b/definitions/grib2/tables/33/4.2.20.3.table new file mode 100644 index 000000000..9c2f80cfa --- /dev/null +++ b/definitions/grib2/tables/33/4.2.20.3.table @@ -0,0 +1,14 @@ +# Product discipline 20 - Health and socioeconomic impacts, parameter category 3: renewable energy sector +0 0 Renewable power capacity (W) +1 1 Renewable power production rate (W) +2 2 Wind power capacity (W) +3 3 Wind power production rate (W) +4 4 Solar photovoltaic (PV) power capacity (W) +5 5 Solar photovoltaic (PV) power production rate (W) +6 6 Solar non-photovoltaic (PV) power capacity (W) +7 7 Solar non-photovoltaic (PV) power production rate (W) +8 8 Concentrated solar power (CSP) power capacity (W) +9 9 Concentrated solar power (CSP) power production rate (W) +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.3.0.table b/definitions/grib2/tables/33/4.2.3.0.table new file mode 100644 index 000000000..0bec15119 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.3.0.table @@ -0,0 +1,14 @@ +# Product discipline 3 - Space products, parameter category 0: image format products +0 0 Scaled radiance (Numeric) +1 1 Scaled albedo (Numeric) +2 2 Scaled brightness temperature (Numeric) +3 3 Scaled precipitable water (Numeric) +4 4 Scaled lifted index (Numeric) +5 5 Scaled cloud top pressure (Numeric) +6 6 Scaled skin temperature (Numeric) +7 7 Cloud mask (Code table 4.217) +8 8 Pixel scene type (Code table 4.218) +9 9 Fire detection indicator (Code table 4.223) +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.3.1.table b/definitions/grib2/tables/33/4.2.3.1.table new file mode 100644 index 000000000..2aec33b42 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.3.1.table @@ -0,0 +1,38 @@ +# Product discipline 3 - Space products, parameter category 1: quantitative products +0 0 Estimated precipitation (kg m-2) +1 1 Instantaneous rain rate (kg m-2 s-1) +2 2 Cloud top height (m) +3 3 Cloud top height quality indicator (Code table 4.219) +4 4 Estimated u-component of wind (m/s) +5 5 Estimated v-component of wind (m/s) +6 6 Number of pixel used (Numeric) +7 7 Solar zenith angle (deg) +8 8 Relative azimuth angle (deg) +9 9 Reflectance in 0.6 micron channel (%) +10 10 Reflectance in 0.8 micron channel (%) +11 11 Reflectance in 1.6 micron channel (%) +12 12 Reflectance in 3.9 micron channel (%) +13 13 Atmospheric divergence (/s) +14 14 Cloudy brightness temperature (K) +15 15 Clear-sky brightness temperature (K) +16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) +17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) +18 18 Reserved +19 19 Wind speed (m/s) +20 20 Aerosol optical thickness at 0.635 um +21 21 Aerosol optical thickness at 0.810 um +22 22 Aerosol optical thickness at 1.640 um +23 23 Angstrom coefficient +# 24-26 Reserved +27 27 Bidirectional reflectance factor (Numeric) +28 28 Brightness temperature (K) +29 29 Scaled radiance (Numeric) +30 30 Reflectance in 0.4 micron channel (%) +31 31 Cloudy reflectance (%) +32 32 Clear reflectance (%) +# 33-97 Reserved +98 98 Correlation coefficient between MPE rain-rates for the co-located IR data and the microwave data rain-rates (Numeric) +99 99 Standard deviation between MPE rain-rates for the co-located IR data and the microwave data rain-rates (kg m-2 s-1) +# 100-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.3.2.table b/definitions/grib2/tables/33/4.2.3.2.table new file mode 100644 index 000000000..a97ce4942 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.3.2.table @@ -0,0 +1,24 @@ +# Product discipline 3 - Space products, parameter category 2: cloud properties +0 0 Clear sky probability (%) +1 1 Cloud top temperature (K) +2 2 Cloud top pressure (Pa) +3 3 Cloud type (Code table 4.218) +4 4 Cloud phase (Code table 4.218) +5 5 Cloud optical depth (Numeric) +6 6 Cloud particle effective radius (m) +7 7 Cloud liquid water path (kg m-2) +8 8 Cloud ice water path (kg m-2) +9 9 Cloud albedo (Numeric) +10 10 Cloud emissivity (Numeric) +11 11 Effective absorption optical depth ratio (Numeric) +30 30 Measurement cost (Numeric) +31 31 Upper layer cloud optical depth (Numeric) +32 32 Upper layer cloud top pressure (Pa) +33 33 Upper layer cloud effective radius (m) +34 34 Error in upper layer cloud optical depth (Numeric) +35 35 Error in upper layer cloud top pressure (Pa) +36 36 Error in upper layer cloud effective radius (m) +37 37 Lower layer cloud optical depth (Numeric) +38 38 Lower layer cloud top pressure (Pa) +39 39 Error in lower layer cloud optical depth (Numeric) +40 40 Error in lower layer cloud top pressure (Pa) diff --git a/definitions/grib2/tables/33/4.2.3.3.table b/definitions/grib2/tables/33/4.2.3.3.table new file mode 100644 index 000000000..c487a578e --- /dev/null +++ b/definitions/grib2/tables/33/4.2.3.3.table @@ -0,0 +1,4 @@ +# Product discipline 3 - Space products, parameter category 3: flight rule conditions +0 0 Probability of encountering marginal visual flight rule conditions (%) +1 1 Probability of encountering low instrument flight rule conditions (%) +2 2 Probability of encountering instrument flight rule conditions (%) diff --git a/definitions/grib2/tables/33/4.2.3.4.table b/definitions/grib2/tables/33/4.2.3.4.table new file mode 100644 index 000000000..7f832ff3c --- /dev/null +++ b/definitions/grib2/tables/33/4.2.3.4.table @@ -0,0 +1,10 @@ +# Product discipline 3 - Space products, parameter category 4: volcanic ash +0 0 Volcanic ash probability (%) +1 1 Volcanic ash cloud top temperature (K) +2 2 Volcanic ash cloud top pressure (Pa) +3 3 Volcanic ash cloud top height (m) +4 4 Volcanic ash cloud emissivity (Numeric) +5 5 Volcanic ash effective absorption optical depth ratio (Numeric) +6 6 Volcanic ash cloud optical depth (Numeric) +7 7 Volcanic ash column density (kg m-2) +8 8 Volcanic ash particle effective radius (m) diff --git a/definitions/grib2/tables/33/4.2.3.5.table b/definitions/grib2/tables/33/4.2.3.5.table new file mode 100644 index 000000000..58a3f12cb --- /dev/null +++ b/definitions/grib2/tables/33/4.2.3.5.table @@ -0,0 +1,7 @@ +# Product discipline 3 - Space products, parameter category 5: sea-surface temperature +0 0 Interface sea-surface temperature (K) +1 1 Skin sea-surface temperature (K) +2 2 Sub-skin sea-surface temperature (K) +3 3 Foundation sea-surface temperature (K) +4 4 Estimated bias between sea-surface temperature and standard (K) +5 5 Estimated standard deviation between sea surface temperature and standard (K) diff --git a/definitions/grib2/tables/33/4.2.3.6.table b/definitions/grib2/tables/33/4.2.3.6.table new file mode 100644 index 000000000..62a5ba656 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.3.6.table @@ -0,0 +1,7 @@ +# Product discipline 3 - Space products, parameter category 6: solar radiation +0 0 Global solar irradiance (W m-2) +1 1 Global solar exposure (J m-2) +2 2 Direct solar irradiance (W m-2) +3 3 Direct solar exposure (J m-2) +4 4 Diffuse solar irradiance (W m-2) +5 5 Diffuse solar exposure (J m-2) diff --git a/definitions/grib2/tables/33/4.2.4.0.table b/definitions/grib2/tables/33/4.2.4.0.table new file mode 100644 index 000000000..337308305 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.4.0.table @@ -0,0 +1,10 @@ +# Product discipline 4 - Space weather products, parameter category 0: temperature +0 0 Temperature (K) +1 1 Electron temperature (K) +2 2 Proton temperature (K) +3 3 Ion temperature (K) +4 4 Parallel temperature (K) +5 5 Perpendicular temperature (K) +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.4.1.table b/definitions/grib2/tables/33/4.2.4.1.table new file mode 100644 index 000000000..9ec11160f --- /dev/null +++ b/definitions/grib2/tables/33/4.2.4.1.table @@ -0,0 +1,8 @@ +# Product discipline 4 - Space weather products, parameter category 1: momentum +0 0 Velocity magnitude (speed) (m s-1) +1 1 1st vector component of velocity (coordinate system dependent) (m s-1) +2 2 2nd vector component of velocity (coordinate system dependent) (m s-1) +3 3 3rd vector component of velocity (coordinate system dependent) (m s-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.4.10.table b/definitions/grib2/tables/33/4.2.4.10.table new file mode 100644 index 000000000..8f5b19e06 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.4.10.table @@ -0,0 +1,12 @@ +# Product discipline 4 - Space weather products, parameter category 10: space weather indices +0 0 Scintillation index (sigma phi) (rad) +1 1 Scintillation index S4 (Numeric) +2 2 Rate of change of TEC index (ROTI) (TECU/min) +3 3 Disturbance ionosphere index spatial gradient (DIXSG) (Numeric) +4 4 Along arc TEC rate (AATR) (TECU/min) +5 5 Kp (Numeric) +6 6 Equatorial disturbance storm time index (Dst) (nT) +7 7 Auroral electrojet (AE) (nT) +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.4.2.table b/definitions/grib2/tables/33/4.2.4.2.table new file mode 100644 index 000000000..b479b3361 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.4.2.table @@ -0,0 +1,18 @@ +# Product discipline 4 - Space weather products, parameter category 2: charged particle mass and number +0 0 Particle number density (m-3) +1 1 Electron density (m-3) +2 2 Proton density (m-3) +3 3 Ion density (m-3) +4 4 Vertical total electron content (TECU) +5 5 HF absorption frequency (Hz) +6 6 HF absorption (dB) +7 7 Spread F (m) +8 8 h'F (m) +9 9 Critical frequency (Hz) +10 10 Maximal usable frequency (MUF) (Hz) +11 11 Peak height (hm) (m) +12 12 Peak density (Nm) (m-3) +13 13 Equivalent slab thickness (tau) (km) +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.4.3.table b/definitions/grib2/tables/33/4.2.4.3.table new file mode 100644 index 000000000..3b752bbbc --- /dev/null +++ b/definitions/grib2/tables/33/4.2.4.3.table @@ -0,0 +1,12 @@ +# Product discipline 4 - Space weather products, parameter category 3: electric and magnetic fields +0 0 Magnetic field magnitude (T) +1 1 1st vector component of magnetic field (T) +2 2 2nd vector component of magnetic field (T) +3 3 3rd vector component of magnetic field (T) +4 4 Electric field magnitude (V m-1) +5 5 1st vector component of electric field (V m-1) +6 6 2nd vector component of electric field (V m-1) +7 7 3rd vector component of electric field (V m-1) +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.4.4.table b/definitions/grib2/tables/33/4.2.4.4.table new file mode 100644 index 000000000..694c8cacc --- /dev/null +++ b/definitions/grib2/tables/33/4.2.4.4.table @@ -0,0 +1,11 @@ +# Product discipline 4 - Space weather products, parameter category 4: energetic particles +0 0 Proton flux (differential) ((m2 s sr eV)-1) +1 1 Proton flux (integral) ((m2 s sr )-1) +2 2 Electron flux (differential) ((m2 s sr eV)-1) +3 3 Electron flux (integral) ((m2 s sr)-1) +4 4 Heavy ion flux (differential) ((m2 s sr eV/nuc)-1) +5 5 Heavy ion flux (integral) ((m2 s sr)-1) +6 6 Cosmic ray neutron flux (h-1) +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.4.5.table b/definitions/grib2/tables/33/4.2.4.5.table new file mode 100644 index 000000000..913efec6f --- /dev/null +++ b/definitions/grib2/tables/33/4.2.4.5.table @@ -0,0 +1,8 @@ +# Product discipline 4 - Space weather products, parameter category 5: waves +0 0 Amplitude (dB) +1 1 Phase (rad) +2 2 Frequency (Hz) +3 3 Wavelength (m) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.4.6.table b/definitions/grib2/tables/33/4.2.4.6.table new file mode 100644 index 000000000..6d13019a6 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.4.6.table @@ -0,0 +1,11 @@ +# Product discipline 4 - Space weather products, parameter category 6: solar electromagnetic emissions +0 0 Integrated solar irradiance (W m-2) +1 1 Solar X-ray flux (XRS long) (W m-2) +2 2 Solar X-ray flux (XRS short) (W m-2) +3 3 Solar EUV irradiance (W m-2) +4 4 Solar spectral irradiance (W m-2 nm-1) +5 5 F10.7 (W m-2 Hz-1) +6 6 Solar radio emissions (W m-2 Hz-1) +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.4.7.table b/definitions/grib2/tables/33/4.2.4.7.table new file mode 100644 index 000000000..38c2b17a8 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.4.7.table @@ -0,0 +1,8 @@ +# Product discipline 4 - Space weather products, parameter category 7: terrestrial electromagnetic emissions +0 0 Limb intensity (J m-2 s-1) +1 1 Disk intensity (J m-2 s-1) +2 2 Disk intensity day (J m-2 s-1) +3 3 Disk intensity night (J m-2 s-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.4.8.table b/definitions/grib2/tables/33/4.2.4.8.table new file mode 100644 index 000000000..f350f4807 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.4.8.table @@ -0,0 +1,13 @@ +# Product discipline 4 - Space weather products, parameter category 8: imagery +0 0 X-ray radiance (W sr-1 m-2) +1 1 EUV radiance (W sr-1 m-2) +2 2 H-alpha radiance (W sr-1 m-2) +3 3 White light radiance (W sr-1 m-2) +4 4 CaII-K radiance (W sr-1 m-2) +5 5 White light coronagraph radiance (W sr-1 m-2) +6 6 Heliospheric radiance (W sr-1 m-2) +7 7 Thematic mask (Numeric) +8 8 Solar induced chlorophyll fluorescence (W m-2 sr-1 m-1) +# 9-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.4.9.table b/definitions/grib2/tables/33/4.2.4.9.table new file mode 100644 index 000000000..0e83436e2 --- /dev/null +++ b/definitions/grib2/tables/33/4.2.4.9.table @@ -0,0 +1,7 @@ +# Product discipline 4 - Space weather products, parameter category 9: ion-neutral coupling +0 0 Pedersen conductivity (S m-1) +1 1 Hall conductivity (S m-1) +2 2 Parallel conductivity (S m-1) +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.201.table b/definitions/grib2/tables/33/4.201.table new file mode 100644 index 000000000..a725e4e65 --- /dev/null +++ b/definitions/grib2/tables/33/4.201.table @@ -0,0 +1,17 @@ +# Code table 4.201 - Precipitation type +0 0 No precipitation +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow +6 6 Wet snow +7 7 Mixture of rain and snow +8 8 Ice pellets +9 9 Graupel +10 10 Hail +11 11 Drizzle +12 12 Freezing drizzle +# 13-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.202.table b/definitions/grib2/tables/33/4.202.table new file mode 100644 index 000000000..7f3c8f6cf --- /dev/null +++ b/definitions/grib2/tables/33/4.202.table @@ -0,0 +1,4 @@ +# Code table 4.202 - Precipitable water category +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.203.table b/definitions/grib2/tables/33/4.203.table new file mode 100644 index 000000000..cf5eb6bdc --- /dev/null +++ b/definitions/grib2/tables/33/4.203.table @@ -0,0 +1,26 @@ +# Code table 4.203 - Cloud type +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.204.table b/definitions/grib2/tables/33/4.204.table new file mode 100644 index 000000000..8e0be1f8c --- /dev/null +++ b/definitions/grib2/tables/33/4.204.table @@ -0,0 +1,9 @@ +# Code table 4.204 - Thunderstorm coverage +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (6-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.205.table b/definitions/grib2/tables/33/4.205.table new file mode 100644 index 000000000..c40c7f47b --- /dev/null +++ b/definitions/grib2/tables/33/4.205.table @@ -0,0 +1,6 @@ +# Code table 4.205 - Presence of aerosol +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.206.table b/definitions/grib2/tables/33/4.206.table new file mode 100644 index 000000000..76472c261 --- /dev/null +++ b/definitions/grib2/tables/33/4.206.table @@ -0,0 +1,6 @@ +# Code table 4.206 - Volcanic ash +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.207.table b/definitions/grib2/tables/33/4.207.table new file mode 100644 index 000000000..b6392fca0 --- /dev/null +++ b/definitions/grib2/tables/33/4.207.table @@ -0,0 +1,10 @@ +# Code table 4.207 - Icing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.208.table b/definitions/grib2/tables/33/4.208.table new file mode 100644 index 000000000..4361d38c0 --- /dev/null +++ b/definitions/grib2/tables/33/4.208.table @@ -0,0 +1,9 @@ +# Code table 4.208 - Turbulence +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.209.table b/definitions/grib2/tables/33/4.209.table new file mode 100644 index 000000000..39ea549ac --- /dev/null +++ b/definitions/grib2/tables/33/4.209.table @@ -0,0 +1,9 @@ +# Code table 4.209 - Planetary boundary-layer regime +0 0 Reserved +1 1 Stable +2 2 Mechanically driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.210.table b/definitions/grib2/tables/33/4.210.table new file mode 100644 index 000000000..791878469 --- /dev/null +++ b/definitions/grib2/tables/33/4.210.table @@ -0,0 +1,6 @@ +# Code table 4.210 - Contrail intensity +0 0 Contrail not present +1 1 Contrail present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.211.table b/definitions/grib2/tables/33/4.211.table new file mode 100644 index 000000000..2a28a84d9 --- /dev/null +++ b/definitions/grib2/tables/33/4.211.table @@ -0,0 +1,7 @@ +# Code table 4.211 - Contrail engine type +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.212.table b/definitions/grib2/tables/33/4.212.table new file mode 100644 index 000000000..6a3dcf88c --- /dev/null +++ b/definitions/grib2/tables/33/4.212.table @@ -0,0 +1,18 @@ +# Code table 4.212 - Land use +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.213.table b/definitions/grib2/tables/33/4.213.table new file mode 100644 index 000000000..68d627af6 --- /dev/null +++ b/definitions/grib2/tables/33/4.213.table @@ -0,0 +1,16 @@ +# Code table 4.213 - Soil type +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.214.table b/definitions/grib2/tables/33/4.214.table new file mode 100644 index 000000000..b08860ce0 --- /dev/null +++ b/definitions/grib2/tables/33/4.214.table @@ -0,0 +1,11 @@ +# Code table 4.214 - Environmental Factor Qualifier +0 0 Worst +1 1 Very poor +2 2 Poor +3 3 Average +4 4 Good +5 5 Excellent +# 6-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.215.table b/definitions/grib2/tables/33/4.215.table new file mode 100644 index 000000000..7888772d5 --- /dev/null +++ b/definitions/grib2/tables/33/4.215.table @@ -0,0 +1,9 @@ +# Code table 4.215 - Remotely sensed snow coverage +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.216.table b/definitions/grib2/tables/33/4.216.table new file mode 100644 index 000000000..b51b358f4 --- /dev/null +++ b/definitions/grib2/tables/33/4.216.table @@ -0,0 +1,5 @@ +# Code table 4.216 - Elevation of snow-covered terrain +# 0-90 Elevation in increments of 100 m +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/33/4.217.table b/definitions/grib2/tables/33/4.217.table new file mode 100644 index 000000000..a700410d5 --- /dev/null +++ b/definitions/grib2/tables/33/4.217.table @@ -0,0 +1,8 @@ +# Code table 4.217 - Cloud mask type +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.218.table b/definitions/grib2/tables/33/4.218.table new file mode 100644 index 000000000..a13debf16 --- /dev/null +++ b/definitions/grib2/tables/33/4.218.table @@ -0,0 +1,46 @@ +# Code table 4.218 - Pixel scene type +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation/crops +15 15 Permanent snow/ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +19 19 Warm liquid water cloud +20 20 Supercooled liquid water cloud +21 21 Mixed-phase cloud +22 22 Optically thin ice cloud +23 23 Optically thick ice cloud +24 24 Multilayered cloud +# 25-96 Reserved +97 97 Snow/ice on land +98 98 Snow/ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud/fog/stratus +102 102 Low cloud/stratocumulus +103 103 Low cloud/unknown type +104 104 Medium cloud/nimbostratus +105 105 Medium cloud/altostratus +106 106 Medium cloud/unknown type +107 107 High cloud/cumulus +108 108 High cloud/cirrus +109 109 High cloud/unknown +110 110 Unknown cloud type +111 111 Single layer water cloud +112 112 Single layer ice cloud +# 113-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.219.table b/definitions/grib2/tables/33/4.219.table new file mode 100644 index 000000000..9979f50ad --- /dev/null +++ b/definitions/grib2/tables/33/4.219.table @@ -0,0 +1,8 @@ +# Code table 4.219 - Cloud top height quality indicator +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.220.table b/definitions/grib2/tables/33/4.220.table new file mode 100644 index 000000000..88e869e42 --- /dev/null +++ b/definitions/grib2/tables/33/4.220.table @@ -0,0 +1,6 @@ +# Code table 4.220 - Horizontal dimension processed +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.221.table b/definitions/grib2/tables/33/4.221.table new file mode 100644 index 000000000..011cc3518 --- /dev/null +++ b/definitions/grib2/tables/33/4.221.table @@ -0,0 +1,6 @@ +# Code table 4.221 - Treatment of missing data +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.222.table b/definitions/grib2/tables/33/4.222.table new file mode 100644 index 000000000..558d947ac --- /dev/null +++ b/definitions/grib2/tables/33/4.222.table @@ -0,0 +1,6 @@ +# Code table 4.222 - Categorical result +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.223.table b/definitions/grib2/tables/33/4.223.table new file mode 100644 index 000000000..572c4e7a8 --- /dev/null +++ b/definitions/grib2/tables/33/4.223.table @@ -0,0 +1,5 @@ +# Code table 4.223 - Fire detection indicator +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing diff --git a/definitions/grib2/tables/33/4.224.table b/definitions/grib2/tables/33/4.224.table new file mode 100644 index 000000000..014f56e23 --- /dev/null +++ b/definitions/grib2/tables/33/4.224.table @@ -0,0 +1,18 @@ +# Code table 4.224 - Categorical outlook +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/33/4.225.table b/definitions/grib2/tables/33/4.225.table new file mode 100644 index 000000000..9dc374087 --- /dev/null +++ b/definitions/grib2/tables/33/4.225.table @@ -0,0 +1,2 @@ +# Code table 4.225 - Weather (see FM 94 BUFR/FM 95 CREX Code table 0 20 003 - Present weather) +511 511 Missing value diff --git a/definitions/grib2/tables/33/4.227.table b/definitions/grib2/tables/33/4.227.table new file mode 100644 index 000000000..48c3b7633 --- /dev/null +++ b/definitions/grib2/tables/33/4.227.table @@ -0,0 +1,9 @@ +# Code table 4.227 - Icing scenario (weather/cloud classification) +0 0 None +1 1 General +2 2 Convective +3 3 Stratiform +4 4 Freezing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/33/4.228.table b/definitions/grib2/tables/33/4.228.table new file mode 100644 index 000000000..048a69f0b --- /dev/null +++ b/definitions/grib2/tables/33/4.228.table @@ -0,0 +1,8 @@ +# Code table 4.228 - Icing severity +0 0 None +1 1 Trace +2 2 Light +3 3 Moderate +4 4 Severe +# 5-254 Reserved +255 255 Missing value diff --git a/definitions/grib2/tables/33/4.230.table b/definitions/grib2/tables/33/4.230.table new file mode 100644 index 000000000..705857e5c --- /dev/null +++ b/definitions/grib2/tables/33/4.230.table @@ -0,0 +1,534 @@ +# Code table 4.230 - Atmospheric chemical constituent type +0 0 Ozone O3 +1 1 Water vapour H2O +2 2 Methane CH4 +3 3 Carbon dioxide CO2 +4 4 Carbon monoxide CO +5 5 Nitrogen dioxide NO2 +6 6 Nitrous oxide N2O +7 7 Formaldehyde HCHO +8 8 Sulphur dioxide SO2 +9 9 Ammonia NH3 +10 10 Ammonium cation NH4+ +11 11 Nitrogen monoxide NO +12 12 Atomic oxygen O +13 13 Nitrate radical NO3* +14 14 Hydroperoxyl radical HOO* +15 15 Dinitrogen pentoxide N2O5 +16 16 Nitrous acid HONO +17 17 Nitric acid HNO3 +18 18 Peroxynitric acid HO2NO2 +19 19 Hydrogen peroxide H2O2 +20 20 Dihydrogen H2 +21 21 Atomic nitrogen N +22 22 Sulphate anion SO42- +23 23 Atomic Radon Rn +24 24 Mercury vapour Hg(0) +25 25 Mercury(II) cation Hg2+ +26 26 Atomic chlorine Cl +27 27 Chlorine monoxide ClO +28 28 Dichlorine peroxide Cl2O2 +29 29 Hypochlorous acid HClO +30 30 Chlorine nitrate ClONO2 +31 31 Chlorine dioxide ClO2 +32 32 Atomic bromine Br +33 33 Bromine monoxide BrO +34 34 Bromine chloride BrCl +35 35 Hydrogen bromide HBr +36 36 Hypobromous acid HBrO +37 37 Bromine nitrate BrONO2 +38 38 Dioxygen O2 +39 39 Nitryl chloride NO2Cl +40 40 Sulphuric acid H2SO4 +41 41 Hydrogen sulphide H2S +42 42 Sulphur trioxide SO3 +43 43 Bromine Br2 +44 44 Hydrofluoric acid HF +45 45 Sulphur hexafluoride SF6 +46 46 Chlorine Cl2 +# 47-9999 Reserved +10000 10000 Hydroxyl radical HO* +10001 10001 Methyl peroxy radical CH3OO* +10002 10002 Methyl hydroperoxide CH3OOH +10004 10004 Methanol CH3OH +10005 10005 Formic acid HCOOH +10006 10006 Hydrogen cyanide HCN +10007 10007 Aceto nitrile CH3CN +10008 10008 Ethane C2H6 +10009 10009 Ethene (= Ethylene) C2H4 +10010 10010 Ethyne (= Acetylene) C2H2 +10011 10011 Ethanol C2H5OH +10012 10012 Acetic acid C2H5OOH +10013 10013 Peroxyacetyl nitrate CH3C(O)OONO2 +10014 10014 Propane C3H8 +10015 10015 Propene C3H6 +10016 10016 Butane (all isomers) C4H10 +10017 10017 Isoprene C5H10 +10018 10018 Alpha pinene C10H16 +10019 10019 Beta pinene C10H16 +10020 10020 Limonene C10H16 +10021 10021 Benzene C6H6 +10022 10022 Toluene C7H8 +10023 10023 Xylene C8H10 +10024 10024 Methanesulphonic acid CH3SO3H +10025 10025 Methylglyoxal (2-oxopropanal) CH3C(O)CHO +10026 10026 Peroxyacetyl radical CH3C(O)OO* +10027 10027 Methacrylic acid (2-methylprop-2-enoic acid) CH2C(CH3)COOH +10028 10028 Methacrolein (2-methylprop-2-enal) CH2C(CH3)CHO +10029 10029 Acetone (propan-2-one) CH3C(O)CH3 +10030 10030 Ethyl dioxidanyl radical CH3CH2OO* +10031 10031 Butadiene (buta-1,3-diene) (CH2CH)2 +10032 10032 Acetaldehyde (ethanal) CH3CHO +10033 10033 Glycolaldehyde (hydroxyethanal) HOCH2CHO +10034 10034 Cresol (methylphenol), all isomers CH3C6H4OH +10035 10035 Peracetic acid (ethaneperoxoic acid) CH3C(O)OOH +10036 10036 2-hydroxyethyl oxidanyl radical HOCH2CH2O* +10037 10037 2-hydroxyethyl dioxidanyl radical HOCH2CH2OO* +10038 10038 Glyoxal (oxaldehyde) OCHCHO +10039 10039 Isopropyl dioxidanyl radical (CH3)2CHOO* +10040 10040 Isopropyl hydroperoxide (2-hydroperoxypropane) (CH3)2CHOOH +10041 10041 Hydroxyacetone (1-hydroxypropan-2-one) CH3C(O)CH2OH +10042 10042 Peroxyacetic acid (ethaneperoxoic acid) CH3C(O)OOH +10043 10043 Methyl vinyl ketone (but-3-en-2-one) CH3C(O)CHCH2 +10044 10044 Phenoxy radical C6H5O* +10045 10045 Methyl radical CH3* +10046 10046 Carbonyl sulphide (carbon oxide sulphide) OCS +10047 10047 Dibromomethane CH2Br2 +10048 10048 Methoxy radical CH3O* +10049 10049 Tribromomethane CHBr3 +10050 10050 Formyl radical (oxomethyl radical) HOC* +10051 10051 Hydroxymethyl dioxidanyl radical HOCH2OO* +10052 10052 Ethyl hydroperoxide CH3CH2OOH +10053 10053 3-hydroxypropyl dioxidanyl radical HOCH2CH2CH2OO* +10054 10054 3-hydroxypropyl hydroperoxide HOCH2CH2CH2OOH +10055 10055 Methyl-peroxy-nitrate (nitroperoxy-methane) CH3OONO2 +10056 10056 2-lambda^1-oxidanyloxy-2-methylbut-3-en-1-ol (4-hydroxy-3-methyl-1-butene-3-ylperoxy radical) HOCH2C(CH3)(OO*)CHCH2 +10057 10057 2-lambda^1-oxidanyloxy-3-methylbut-3-en-1-ol (2-hydroxy-1-isopropenylethylperoxy radical) HOCH2CH(OO*)C(CH3)CH2 +10058 10058 (Z)-4-hydroperoxy-2-methyl-2-butenal CH2(OOH)CHC(CH3)CHO +10059 10059 (Z)-4-hydroperoxy-3-methyl-2-butenal CH2(OOH)C(CH3)CHCHO +# 10060-10499 Reserved for other simple organic molecules (e.g. higher aldehydes, alcohols, peroxides, etc.) +10500 10500 Dimethyl sulphide CH3SCH3 (DMS) +10501 10501 DMSO (dimethyl sulfoxide) (CH3)2SO +# 10502-20000 Reserved +20001 20001 Hydrogen chloride HCl +20002 20002 CFC-11 (trichlorofluoromethane) CCl3F +20003 20003 CFC-12 (dichlorodifluoromethane) CCl2F2 +20004 20004 CFC-113 (1,1,2-trichloro-1,2,2-trifluoroethane) Cl2FC-CClF2 +20005 20005 CFC-113a (1,1,1-trichloro-2,2,2-trifluoroethane) Cl3C-CF3 +20006 20006 CFC-114 (1,2-dichloro-1,1,2,2-tetrafluoroethane) ClF2C-CClF2 +20007 20007 CFC-115 (1-chloro-1,1,2,2,2-pentafluoroethane) ClF2C-CF3 +20008 20008 HCFC-22 (chlorodifluoromethane) CHClF2 +20009 20009 HCFC-141b (1,1-dichloro-1-fluoroethane) Cl2FC-CH3 +20010 20010 HCFC-142b (1-chloro-1,1-difluoroethane) ClF2C-CH3 +20011 20011 Halon-1202 (dibromodifluoromethane) CBr2F2 +20012 20012 Halon-1211 (bromochlorodifluoromethane) CBrClF2 +20013 20013 Halon-1301 (bromotrifluoromethane) CBrF3 +20014 20014 Halon-2402 (1,2-dibromo-1,1,2,2-tetrafluoroethane) BrF2C-CBrF2 +20015 20015 HCC-40 (methyl chloride) CH3Cl +20016 20016 HCC-10 (carbon tetrachloride) CCl4 +20017 20017 HCC-140a (1,1,1-trichloroethane) Cl3C-CH3 +20018 20018 HBC-40B1 (methyl bromide) CH3Br +20019 20019 HCH (hexachlorocyclohexane) all isomers C6H6Cl6 +20020 20020 alpha-HCH (alpha-hexachlorocyclohexane) both enantiomers alpha-C6H6Cl6 +20021 20021 PCB-153 (2,2',4,4',5,5'-hexachlorobiphenyl) (C6H2Cl3)2 +20022 20022 HCFC-141a (1,1-dichloro-2-fluoroethane) Cl2HC-CH2F +# 20023-29999 Reserved +30000 30000 Radioactive pollutant (tracer, defined by originating centre) +# 30001-30009 Reserved +30010 30010 Tritium (Hydrogen 3) H-3 +30011 30011 Tritium organic bounded H-3o +30012 30012 Tritium inorganic H-3a +30013 30013 Beryllium 7 Be-7 +30014 30014 Beryllium 10 Be-10 +30015 30015 Carbon 14 C-14 +30016 30016 Carbon 14 CO2 C-14CO2 +30017 30017 Carbon 14 other gases C-14og +30018 30018 Nitrogen 13 N-13 +30019 30019 Nitrogen 16 N-16 +30020 30020 Fluorine 18 F-18 +30021 30021 Sodium 22 Na-22 +30022 30022 Phosphate 32 P-32 +30023 30023 Phosphate 33 P-33 +30024 30024 Sulphur 35 S-35 +30025 30025 Chlorine 36 Cl-36 +30026 30026 Potassium 40 K-40 +30027 30027 Argon 41 Ar-41 +30028 30028 Calcium 41 Ca-41 +30029 30029 Calcium 45 Ca-45 +30030 30030 Titanium 44 Ti-44 +30031 30031 Scandium 46 Sc-46 +30032 30032 Vanadium 48 V-48 +30033 30033 Vanadium 49 V-49 +30034 30034 Chrome 51 Cr-51 +30035 30035 Manganese 52 Mn-52 +30036 30036 Manganese 54 Mn-54 +30037 30037 Iron 55 Fe-55 +30038 30038 Iron 59 Fe-59 +30039 30039 Cobalt 56 Co-56 +30040 30040 Cobalt 57 Co-57 +30041 30041 Cobalt 58 Co-58 +30042 30042 Cobalt 60 Co-60 +30043 30043 Nickel 59 Ni-59 +30044 30044 Nickel 63 Ni-63 +30045 30045 Zinc 65 Zn-65 +30046 30046 Gallium 67 Ga-67 +30047 30047 Gallium 68 Ga-68 +30048 30048 Germanium 68 Ge-68 +30049 30049 Germanium 69 Ge-69 +30050 30050 Arsenic 73 As-73 +30051 30051 Selenium 75 Se-75 +30052 30052 Selenium 79 Se-79 +30053 30053 Rubidium 81 Rb-81 +30054 30054 Rubidium 83 Rb-83 +30055 30055 Rubidium 84 Rb-84 +30056 30056 Rubidium 86 Rb-86 +30057 30057 Rubidium 87 Rb-87 +30058 30058 Rubidium 88 Rb-88 +30059 30059 Krypton 85 Kr-85 +30060 30060 Krypton 85 metastable Kr-85m +30061 30061 Krypton 87 Kr-87 +30062 30062 Krypton 88 Kr-88 +30063 30063 Krypton 89 Kr-89 +30064 30064 Strontium 85 Sr-85 +30065 30065 Strontium 89 Sr-89 +30066 30066 Strontium 89/90 Sr-8990 +30067 30067 Strontium 90 Sr-90 +30068 30068 Strontium 91 Sr-91 +30069 30069 Strontium 92 Sr-92 +30070 30070 Yttrium 87 Y-87 +30071 30071 Yttrium 88 Y-88 +30072 30072 Yttrium 90 Y-90 +30073 30073 Yttrium 91 Y-91 +30074 30074 Yttrium 91 metastable Y-91m +30075 30075 Yttrium 92 Y-92 +30076 30076 Yttrium 93 Y-93 +30077 30077 Zirconium 89 Zr-89 +30078 30078 Zirconium 93 Zr-93 +30079 30079 Zirconium 95 Zr-95 +30080 30080 Zirconium 97 Zr-97 +30081 30081 Niobium 93 metastable Nb-93m +30082 30082 Niobium 94 Nb-94 +30083 30083 Niobium 95 Nb-95 +30084 30084 Niobium 95 metastable Nb-95m +30085 30085 Niobium 97 Nb-97 +30086 30086 Niobium 97 metastable Nb-97m +30087 30087 Molybdenum 93 Mo-93 +30088 30088 Molybdenum 99 Mo-99 +30089 30089 Technetium 95 metastable Tc-95m +30090 30090 Technetium 96 Tc-96 +30091 30091 Technetium 99 Tc-99 +30092 30092 Technetium 99 metastable Tc-99m +30093 30093 Rhodium 99 Rh-99 +30094 30094 Rhodium 101 Rh-101 +30095 30095 Rhodium 102 metastable Rh-102m +30096 30096 Rhodium 103 metastable Rh-103m +30097 30097 Rhodium 105 Rh-105 +30098 30098 Rhodium 106 Rh-106 +30099 30099 Palladium 100 Pd-100 +30100 30100 Palladium 103 Pd-103 +30101 30101 Palladium 107 Pd-107 +30102 30102 Ruthenium 103 Ru-103 +30103 30103 Ruthenium 105 Ru-105 +30104 30104 Ruthenium 106 Ru-106 +30105 30105 Silver 108 metastable Ag-108m +30106 30106 Silver 110 metastable Ag-110m +30107 30107 Cadmium 109 Cd-109 +30108 30108 Cadmium 113 metastable Cd-113m +30109 30109 Cadmium 115 metastable Cd-115m +30110 30110 Indium 114 metastable In-114m +30111 30111 Tin 113 Sn-113 +30112 30112 Tin 119 metastable Sn-119m +30113 30113 Tin 121 metastable Sn-121m +30114 30114 Tin 122 Sn-122 +30115 30115 Tin 123 Sn-123 +30116 30116 Tin 126 Sn-126 +30117 30117 Antimony 124 Sb-124 +30118 30118 Antimony 125 Sb-125 +30119 30119 Antimony 126 Sb-126 +30120 30120 Antimony 127 Sb-127 +30121 30121 Antimony 129 Sb-129 +30122 30122 Tellurium 123 metastable Te-123m +30123 30123 Tellurium 125 metastable Te-125m +30124 30124 Tellurium 127 Te-127 +30125 30125 Tellurium 127 metastable Te-127m +30126 30126 Tellurium 129 Te-129 +30127 30127 Tellurium 129 metastable Te-129m +30128 30128 Tellurium 131 metastable Te-131m +30129 30129 Tellurium 132 Te-132 +30130 30130 Iodine 123 I-123 +30131 30131 Iodine 124 I-124 +30132 30132 Iodine 125 I-125 +30133 30133 Iodine 126 I-126 +30134 30134 Iodine 129 I-129 +30135 30135 Iodine 129 elementary gaseous I-129g +30136 30136 Iodine 129 organic bounded I-129o +30137 30137 Iodine 131 I-131 +30138 30138 Iodine 131 elementary gaseous I-131g +30139 30139 Iodine 131 organic bounded I-131o +30140 30140 Iodine 131 gaseous elementary and organic bounded I-131go +30141 30141 Iodine 131 aerosol I-131a +30142 30142 Iodine 132 I-132 +30143 30143 Iodine 132 elementary gaseous I-132g +30144 30144 Iodine 132 organic bounded I-132o +30145 30145 Iodine 132 gaseous elementary and organic bounded I-132go +30146 30146 Iodine 132 aerosol I-132a +30147 30147 Iodine 133 I-133 +30148 30148 Iodine 133 elementary gaseous I-133g +30149 30149 Iodine 133 organic bounded I-133o +30150 30150 Iodine 133 gaseous elementary and organic bounded I-133go +30151 30151 Iodine 133 aerosol I-133a +30152 30152 Iodine 134 I-134 +30153 30153 Iodine 134 elementary gaseous I-134g +30154 30154 Iodine 134 organic bounded I-134o +30155 30155 Iodine 135 I-135 +30156 30156 Iodine 135 elementary gaseous I-135g +30157 30157 Iodine 135 organic bounded I-135o +30158 30158 Iodine 135 gaseous elementary and organic bounded I-135go +30159 30159 Iodine 135 aerosol I-135a +30160 30160 Xenon 131 metastable Xe-131m +30161 30161 Xenon 133 Xe-133 +30162 30162 Xenon 133 metastable Xe-133m +30163 30163 Xenon 135 Xe-135 +30164 30164 Xenon 135 metastable Xe-135m +30165 30165 Xenon 137 Xe-137 +30166 30166 Xenon 138 Xe-138 +30167 30167 Xenon sum of all Xenon isotopes Xe-sum +30168 30168 Caesium 131 Cs-131 +30169 30169 Caesium 134 Cs-134 +30170 30170 Caesium 135 Cs-135 +30171 30171 Caesium 136 Cs-136 +30172 30172 Caesium 137 Cs-137 +30173 30173 Barium 133 Ba-133 +30174 30174 Barium 137 metastable Ba-137m +30175 30175 Barium 140 Ba-140 +30176 30176 Cerium 139 Ce-139 +30177 30177 Cerium 141 Ce-141 +30178 30178 Cerium 143 Ce-143 +30179 30179 Cerium 144 Ce-144 +30180 30180 Lanthanum 140 La-140 +30181 30181 Lanthanum 141 La-141 +30182 30182 Praseodymium 143 Pr-143 +30183 30183 Praseodymium 144 Pr-144 +30184 30184 Praseodymium 144 metastable Pr-144m +30185 30185 Samarium 145 Sm-145 +30186 30186 Samarium 147 Sm-147 +30187 30187 Samarium 151 Sm-151 +30188 30188 Neodymium 147 Nd-147 +30189 30189 Promethium 146 Pm-146 +30190 30190 Promethium 147 Pm-147 +30191 30191 Promethium 151 Pm-151 +30192 30192 Europium 152 Eu-152 +30193 30193 Europium 154 Eu-154 +30194 30194 Europium 155 Eu-155 +30195 30195 Gadolinium 153 Gd-153 +30196 30196 Terbium 160 Tb-160 +30197 30197 Holmium 166 metastable Ho-166m +30198 30198 Thulium 170 Tm-170 +30199 30199 Ytterbium 169 Yb-169 +30200 30200 Hafnium 175 Hf-175 +30201 30201 Hafnium 181 Hf-181 +30202 30202 Tantalum 179 Ta-179 +30203 30203 Tantalum 182 Ta-182 +30204 30204 Rhenium 184 Re-184 +30205 30205 Iridium 192 Ir-192 +30206 30206 Mercury 203 Hg-203 +30207 30207 Thallium 204 Tl-204 +30208 30208 Thallium 207 Tl-207 +30209 30209 Thallium 208 Tl-208 +30210 30210 Thallium 209 Tl-209 +30211 30211 Bismuth 205 Bi-205 +30212 30212 Bismuth 207 Bi-207 +30213 30213 Bismuth 210 Bi-210 +30214 30214 Bismuth 211 Bi-211 +30215 30215 Bismuth 212 Bi-212 +30216 30216 Bismuth 213 Bi-213 +30217 30217 Bismuth 214 Bi-214 +30218 30218 Polonium 208 Po-208 +30219 30219 Polonium 210 Po-210 +30220 30220 Polonium 212 Po-212 +30221 30221 Polonium 213 Po-213 +30222 30222 Polonium 214 Po-214 +30223 30223 Polonium 215 Po-215 +30224 30224 Polonium 216 Po-216 +30225 30225 Polonium 218 Po-218 +30226 30226 Lead 209 Pb-209 +30227 30227 Lead 210 Pb-210 +30228 30228 Lead 211 Pb-211 +30229 30229 Lead 212 Pb-212 +30230 30230 Lead 214 Pb-214 +30231 30231 Astatine 217 At-217 +30232 30232 Radon 219 Rn-219 +30233 30233 Radon 220 Rn-220 +30234 30234 Radon 222 Rn-222 +30235 30235 Francium 221 Fr-221 +30236 30236 Francium 223 Fr-223 +30237 30237 Radium 223 Ra-223 +30238 30238 Radium 224 Ra-224 +30239 30239 Radium 225 Ra-225 +30240 30240 Radium 226 Ra-226 +30241 30241 Radium 228 Ra-228 +30242 30242 Actinium 225 Ac-225 +30243 30243 Actinium 227 Ac-227 +30244 30244 Actinium 228 Ac-228 +30245 30245 Thorium 227 Th-227 +30246 30246 Thorium 228 Th-228 +30247 30247 Thorium 229 Th-229 +30248 30248 Thorium 230 Th-230 +30249 30249 Thorium 231 Th-231 +30250 30250 Thorium 232 Th-232 +30251 30251 Thorium 234 Th-234 +30252 30252 Protactinium 231 Pa-231 +30253 30253 Protactinium 233 Pa-233 +30254 30254 Protactinium 234 metastable Pa-234m +30255 30255 Uranium 232 U-232 +30256 30256 Uranium 233 U-233 +30257 30257 Uranium 234 U-234 +30258 30258 Uranium 235 U-235 +30259 30259 Uranium 236 U-236 +30260 30260 Uranium 237 U-237 +30261 30261 Uranium 238 U-238 +30262 30262 Plutonium 236 Pu-236 +30263 30263 Plutonium 238 Pu-238 +30264 30264 Plutonium 239 Pu-239 +30265 30265 Plutonium 240 Pu-240 +30266 30266 Plutonium 241 Pu-241 +30267 30267 Plutonium 242 Pu-242 +30268 30268 Plutonium 244 Pu-244 +30269 30269 Neptunium 237 Np-237 +30270 30270 Neptunium 238 Np-238 +30271 30271 Neptunium 239 Np-239 +30272 30272 Americium 241 Am-241 +30273 30273 Americium 242 Am-242 +30274 30274 Americium 242 metastable Am-242m +30275 30275 Americium 243 Am-243 +30276 30276 Curium 242 Cm-242 +30277 30277 Curium 243 Cm-243 +30278 30278 Curium 244 Cm-244 +30279 30279 Curium 245 Cm-245 +30280 30280 Curium 246 Cm-246 +30281 30281 Curium 247 Cm-247 +30282 30282 Curium 248 Cm-248 +30283 30283 Curium 243/244 Cm-243244 +30284 30284 Plutonium 238/Americium 241 Pu-238Am-241 +30285 30285 Plutonium 239/240 Pu-239240 +30286 30286 Berkelium 249 Bk-249 +30287 30287 Californium 249 Cf-249 +30288 30288 Californium 250 Cf-250 +30289 30289 Californium 252 Cf-252 +30290 30290 Sum aerosol particulates SumAer +30291 30291 Sum Iodine SumIod +30292 30292 Sum noble gas SumNG +30293 30293 Activation gas ActGas +30294 30294 Cs-137 Equivalent EquCs137 +30295 30295 Carbon-13 C-13 +30296 30296 Lead Pb +30297 30297 Tellurium 131 Te-131 +30298 30298 Neodymium 137 Nd-137 +# 30299-39999 Reserved +40000 40000 Singlet sigma oxygen (dioxygen (sigma singlet)) O2 +40001 40001 Singlet delta oxygen (dioxygen (delta singlet)) O2 +40002 40002 Singlet excited oxygen atom O(1D) +40003 40003 Triplet ground state oxygen atom O(3P) +# 40004-59999 Reserved +60000 60000 HOx radical (OH+HO2) HOx* +60001 60001 Total inorganic and organic peroxy radicals (HOO* + ROO*) ROO* +60002 60002 Passive Ozone +60003 60003 NOx expressed as nitrogen NOx +60004 60004 All nitrogen oxides (NOy) expressed as nitrogen NOy +60005 60005 Total inorganic chlorine Clx +60006 60006 Total inorganic bromine Brx +60007 60007 Total inorganic chlorine except HCl, ClONO2: ClOx +60008 60008 Total inorganic bromine except HBr, BrONO2: BrOx +60009 60009 Lumped alkanes +60010 60010 Lumped alkenes +60011 60011 Lumped aromatic compounds +60012 60012 Lumped terpenes +60013 60013 Non-methane volatile organic compounds expressed as carbon NMVOC +60014 60014 Anthropogenic non-methane volatile organic compounds expressed as carbon aNMVOC +60015 60015 Biogenic non-methane volatile organic compounds expressed as carbon bNMVOC +60016 60016 Lumped oxygenated hydrocarbons OVOC +60017 60017 NOx expressed as nitrogen dioxide (NO2) NOx +60018 60018 Organic aldehydes RCHO +60019 60019 Organic peroxides ROOH +60020 60020 Organic nitrates RNO3 +60021 60021 Ethers ROR' +60022 60022 Amines NRR'R'' +60023 60023 Ketones RC(O)R' +60024 60024 Dicarbonyls unsaturated RC(O)CH2C(O)R' +60025 60025 Hydroxy dicarbonyls unsaturated RC(O)CHOHC(O)R' +60026 60026 Hydroxy ketones RC(OH)C(O)R' +60027 60027 Oxides Ox +60028 60028 Peroxyacyl nitrates RC(O)OONO2 +60029 60029 Aromatic peroxide radical (Aryl dioxydanyl radicals) ArOO* +60030 60030 Biogenic secondary organic compound +60031 60031 Anthropogenic secondary organic compound +60032 60032 All hydroxy-peroxides products of the reaction of hydroxy-isoprene adducts with O2 ISOPOOH +60033 60033 Anthropogenic volatile organic compounds aVOC +60034 60034 Biomass burning volatile organic compounds bbVOC +# 60035-61999 Reserved +62000 62000 Total aerosol +62001 62001 Dust dry +62002 62002 Water in ambient +62003 62003 Ammonium dry +62004 62004 Nitrate dry +62005 62005 Nitric acid trihydrate +62006 62006 Sulphate dry +62007 62007 Mercury dry +62008 62008 Sea salt dry +62009 62009 Black carbon dry +62010 62010 Particulate organic matter dry +62011 62011 Primary particulate organic matter dry +62012 62012 Secondary particulate organic matter dry +62013 62013 Black carbon hydrophilic dry +62014 62014 Black carbon hydrophobic dry +62015 62015 Particulate organic matter hydrophilic dry +62016 62016 Particulate organic matter hydrophobic dry +62017 62017 Nitrate hydrophilic dry +62018 62018 Nitrate hydrophobic dry +# 62019 Reserved +62020 62020 Smoke - high absorption +62021 62021 Smoke - low absorption +62022 62022 Aerosol - high absorption +62023 62023 Aerosol - low absorption +# 62024 Reserved +62025 62025 Volcanic ash +62026 62026 Particulate matter (PM) +# 62027 Reserved +62028 62028 Total aerosol hydrophilic +62029 62029 Total aerosol hydrophobic +62030 62030 Primary particulate inorganic matter dry +62031 62031 Secondary particulate inorganic matter dry +62032 62032 Biogenic secondary organic aerosol +62033 62033 Anthropogenic secondary organic aerosol +62034 62034 Rain water H2Orain +62035 62035 Cloud water H2Ocloud +62036 62036 Brown carbon dry +# 62037-62099 Reserved +62100 62100 Alnus (alder) pollen +62101 62101 Betula (birch) pollen +62102 62102 Castanea (chestnut) pollen +62103 62103 Carpinus (hornbeam) pollen +62104 62104 Corylus (hazel) pollen +62105 62105 Fagus (beech) pollen +62106 62106 Fraxinus (ash) pollen +62107 62107 Pinus (pine) pollen +62108 62108 Platanus (plane) pollen +62109 62109 Populus (cottonwood, poplar) pollen +62110 62110 Quercus (oak) pollen +62111 62111 Salix (willow) pollen +62112 62112 Taxus (yew) pollen +62113 62113 Tilia (lime, linden) pollen +62114 62114 Ulmus (elm) pollen +62115 62115 Olea (olive) pollen +# 62116-62199 Reserved +62200 62200 Ambrosia (ragweed, burr-ragweed) pollen +62201 62201 Artemisia (sagebrush, wormwood, mugwort) pollen +62202 62202 Brassica (rape, broccoli, Brussels sprouts, cabbage, cauliflower, collards, kale, kohlrabi, mustard, rutabaga) pollen +62203 62203 Plantago (plantain) pollen +62204 62204 Rumex (dock, sorrel) pollen +62205 62205 Urtica (nettle) pollen +# 62206-62299 Reserved +62300 62300 Poaceae (grass family) pollen +# 62301-62999 Reserved +# 63000-65534 For experimental use at local level +65535 65535 Missing diff --git a/definitions/grib2/tables/33/4.233.table b/definitions/grib2/tables/33/4.233.table new file mode 100644 index 000000000..e4960cc1b --- /dev/null +++ b/definitions/grib2/tables/33/4.233.table @@ -0,0 +1,534 @@ +# Code table 4.233 - Aerosol type +0 0 Ozone O3 +1 1 Water vapour H2O +2 2 Methane CH4 +3 3 Carbon dioxide CO2 +4 4 Carbon monoxide CO +5 5 Nitrogen dioxide NO2 +6 6 Nitrous oxide N2O +7 7 Formaldehyde HCHO +8 8 Sulphur dioxide SO2 +9 9 Ammonia NH3 +10 10 Ammonium cation NH4+ +11 11 Nitrogen monoxide NO +12 12 Atomic oxygen O +13 13 Nitrate radical NO3* +14 14 Hydroperoxyl radical HOO* +15 15 Dinitrogen pentoxide N2O5 +16 16 Nitrous acid HONO +17 17 Nitric acid HNO3 +18 18 Peroxynitric acid HO2NO2 +19 19 Hydrogen peroxide H2O2 +20 20 Dihydrogen H2 +21 21 Atomic nitrogen N +22 22 Sulphate anion SO42- +23 23 Atomic Radon Rn +24 24 Mercury vapour Hg(0) +25 25 Mercury(II) cation Hg2+ +26 26 Atomic chlorine Cl +27 27 Chlorine monoxide ClO +28 28 Dichlorine peroxide Cl2O2 +29 29 Hypochlorous acid HClO +30 30 Chlorine nitrate ClONO2 +31 31 Chlorine dioxide ClO2 +32 32 Atomic bromine Br +33 33 Bromine monoxide BrO +34 34 Bromine chloride BrCl +35 35 Hydrogen bromide HBr +36 36 Hypobromous acid HBrO +37 37 Bromine nitrate BrONO2 +38 38 Dioxygen O2 +39 39 Nitryl chloride NO2Cl +40 40 Sulphuric acid H2SO4 +41 41 Hydrogen sulphide H2S +42 42 Sulphur trioxide SO3 +43 43 Bromine Br2 +44 44 Hydrofluoric acid HF +45 45 Sulphur hexafluoride SF6 +46 46 Chlorine Cl2 +# 47-9999 Reserved +10000 10000 Hydroxyl radical HO* +10001 10001 Methyl peroxy radical CH3OO* +10002 10002 Methyl hydroperoxide CH3OOH +10004 10004 Methanol CH3OH +10005 10005 Formic acid HCOOH +10006 10006 Hydrogen cyanide HCN +10007 10007 Aceto nitrile CH3CN +10008 10008 Ethane C2H6 +10009 10009 Ethene (= Ethylene) C2H4 +10010 10010 Ethyne (= Acetylene) C2H2 +10011 10011 Ethanol C2H5OH +10012 10012 Acetic acid C2H5OOH +10013 10013 Peroxyacetyl nitrate CH3C(O)OONO2 +10014 10014 Propane C3H8 +10015 10015 Propene C3H6 +10016 10016 Butane (all isomers) C4H10 +10017 10017 Isoprene C5H10 +10018 10018 Alpha pinene C10H16 +10019 10019 Beta pinene C10H16 +10020 10020 Limonene C10H16 +10021 10021 Benzene C6H6 +10022 10022 Toluene C7H8 +10023 10023 Xylene C8H10 +10024 10024 Methanesulphonic acid CH3SO3H +10025 10025 Methylglyoxal (2-oxopropanal) CH3C(O)CHO +10026 10026 Peroxyacetyl radical CH3C(O)OO* +10027 10027 Methacrylic acid (2-methylprop-2-enoic acid) CH2C(CH3)COOH +10028 10028 Methacrolein (2-methylprop-2-enal) CH2C(CH3)CHO +10029 10029 Acetone (propan-2-one) CH3C(O)CH3 +10030 10030 Ethyl dioxidanyl radical CH3CH2OO* +10031 10031 Butadiene (buta-1,3-diene) (CH2CH)2 +10032 10032 Acetaldehyde (ethanal) CH3CHO +10033 10033 Glycolaldehyde (hydroxyethanal) HOCH2CHO +10034 10034 Cresol (methylphenol), all isomers CH3C6H4OH +10035 10035 Peracetic acid (ethaneperoxoic acid) CH3C(O)OOH +10036 10036 2-hydroxyethyl oxidanyl radical HOCH2CH2O* +10037 10037 2-hydroxyethyl dioxidanyl radical HOCH2CH2OO* +10038 10038 Glyoxal (oxaldehyde) OCHCHO +10039 10039 Isopropyl dioxidanyl radical (CH3)2CHOO* +10040 10040 Isopropyl hydroperoxide (2-hydroperoxypropane) (CH3)2CHOOH +10041 10041 Hydroxyacetone (1-hydroxypropan-2-one) CH3C(O)CH2OH +10042 10042 Peroxyacetic acid (ethaneperoxoic acid) CH3C(O)OOH +10043 10043 Methyl vinyl ketone (but-3-en-2-one) CH3C(O)CHCH2 +10044 10044 Phenoxy radical C6H5O* +10045 10045 Methyl radical CH3* +10046 10046 Carbonyl sulphide (carbon oxide sulphide) OCS +10047 10047 Dibromomethane CH2Br2 +10048 10048 Methoxy radical CH3O* +10049 10049 Tribromomethane CHBr3 +10050 10050 Formyl radical (oxomethyl radical) HOC* +10051 10051 Hydroxymethyl dioxidanyl radical HOCH2OO* +10052 10052 Ethyl hydroperoxide CH3CH2OOH +10053 10053 3-hydroxypropyl dioxidanyl radical HOCH2CH2CH2OO* +10054 10054 3-hydroxypropyl hydroperoxide HOCH2CH2CH2OOH +10055 10055 Methyl-peroxy-nitrate (nitroperoxy-methane) CH3OONO2 +10056 10056 2-lambda^1-oxidanyloxy-2-methylbut-3-en-1-ol (4-hydroxy-3-methyl-1-butene-3-ylperoxy radical) HOCH2C(CH3)(OO*)CHCH2 +10057 10057 2-lambda^1-oxidanyloxy-3-methylbut-3-en-1-ol (2-hydroxy-1-isopropenylethylperoxy radical) HOCH2CH(OO*)C(CH3)CH2 +10058 10058 (Z)-4-hydroperoxy-2-methyl-2-butenal CH2(OOH)CHC(CH3)CHO +10059 10059 (Z)-4-hydroperoxy-3-methyl-2-butenal CH2(OOH)C(CH3)CHCHO +# 10060-10499 Reserved for other simple organic molecules (e.g. higher aldehydes, alcohols, peroxides, etc.) +10500 10500 Dimethyl sulphide CH3SCH3 (DMS) +10501 10501 DMSO (dimethyl sulfoxide) (CH3)2SO +# 10502-20000 Reserved +20001 20001 Hydrogen chloride HCl +20002 20002 CFC-11 (trichlorofluoromethane) CCl3F +20003 20003 CFC-12 (dichlorodifluoromethane) CCl2F2 +20004 20004 CFC-113 (1,1,2-trichloro-1,2,2-trifluoroethane) Cl2FC-CClF2 +20005 20005 CFC-113a (1,1,1-trichloro-2,2,2-trifluoroethane) Cl3C-CF3 +20006 20006 CFC-114 (1,2-dichloro-1,1,2,2-tetrafluoroethane) ClF2C-CClF2 +20007 20007 CFC-115 (1-chloro-1,1,2,2,2-pentafluoroethane) ClF2C-CF3 +20008 20008 HCFC-22 (chlorodifluoromethane) CHClF2 +20009 20009 HCFC-141b (1,1-dichloro-1-fluoroethane) Cl2FC-CH3 +20010 20010 HCFC-142b (1-chloro-1,1-difluoroethane) ClF2C-CH3 +20011 20011 Halon-1202 (dibromodifluoromethane) CBr2F2 +20012 20012 Halon-1211 (bromochlorodifluoromethane) CBrClF2 +20013 20013 Halon-1301 (bromotrifluoromethane) CBrF3 +20014 20014 Halon-2402 (1,2-dibromo-1,1,2,2-tetrafluoroethane) BrF2C-CBrF2 +20015 20015 HCC-40 (methyl chloride) CH3Cl +20016 20016 HCC-10 (carbon tetrachloride) CCl4 +20017 20017 HCC-140a (1,1,1-trichloroethane) Cl3C-CH3 +20018 20018 HBC-40B1 (methyl bromide) CH3Br +20019 20019 HCH (hexachlorocyclohexane) all isomers C6H6Cl6 +20020 20020 alpha-HCH (alpha-hexachlorocyclohexane) both enantiomers alpha-C6H6Cl6 +20021 20021 PCB-153 (2,2',4,4',5,5'-hexachlorobiphenyl) (C6H2Cl3)2 +20022 20022 HCFC-141a (1,1-dichloro-2-fluoroethane) Cl2HC-CH2F +# 20023-29999 Reserved +30000 30000 Radioactive pollutant (tracer, defined by originating centre) +# 30001-30009 Reserved +30010 30010 Tritium (Hydrogen 3) H-3 +30011 30011 Tritium organic bounded H-3o +30012 30012 Tritium inorganic H-3a +30013 30013 Beryllium 7 Be-7 +30014 30014 Beryllium 10 Be-10 +30015 30015 Carbon 14 C-14 +30016 30016 Carbon 14 CO2 C-14CO2 +30017 30017 Carbon 14 other gases C-14og +30018 30018 Nitrogen 13 N-13 +30019 30019 Nitrogen 16 N-16 +30020 30020 Fluorine 18 F-18 +30021 30021 Sodium 22 Na-22 +30022 30022 Phosphate 32 P-32 +30023 30023 Phosphate 33 P-33 +30024 30024 Sulphur 35 S-35 +30025 30025 Chlorine 36 Cl-36 +30026 30026 Potassium 40 K-40 +30027 30027 Argon 41 Ar-41 +30028 30028 Calcium 41 Ca-41 +30029 30029 Calcium 45 Ca-45 +30030 30030 Titanium 44 Ti-44 +30031 30031 Scandium 46 Sc-46 +30032 30032 Vanadium 48 V-48 +30033 30033 Vanadium 49 V-49 +30034 30034 Chrome 51 Cr-51 +30035 30035 Manganese 52 Mn-52 +30036 30036 Manganese 54 Mn-54 +30037 30037 Iron 55 Fe-55 +30038 30038 Iron 59 Fe-59 +30039 30039 Cobalt 56 Co-56 +30040 30040 Cobalt 57 Co-57 +30041 30041 Cobalt 58 Co-58 +30042 30042 Cobalt 60 Co-60 +30043 30043 Nickel 59 Ni-59 +30044 30044 Nickel 63 Ni-63 +30045 30045 Zinc 65 Zn-65 +30046 30046 Gallium 67 Ga-67 +30047 30047 Gallium 68 Ga-68 +30048 30048 Germanium 68 Ge-68 +30049 30049 Germanium 69 Ge-69 +30050 30050 Arsenic 73 As-73 +30051 30051 Selenium 75 Se-75 +30052 30052 Selenium 79 Se-79 +30053 30053 Rubidium 81 Rb-81 +30054 30054 Rubidium 83 Rb-83 +30055 30055 Rubidium 84 Rb-84 +30056 30056 Rubidium 86 Rb-86 +30057 30057 Rubidium 87 Rb-87 +30058 30058 Rubidium 88 Rb-88 +30059 30059 Krypton 85 Kr-85 +30060 30060 Krypton 85 metastable Kr-85m +30061 30061 Krypton 87 Kr-87 +30062 30062 Krypton 88 Kr-88 +30063 30063 Krypton 89 Kr-89 +30064 30064 Strontium 85 Sr-85 +30065 30065 Strontium 89 Sr-89 +30066 30066 Strontium 89/90 Sr-8990 +30067 30067 Strontium 90 Sr-90 +30068 30068 Strontium 91 Sr-91 +30069 30069 Strontium 92 Sr-92 +30070 30070 Yttrium 87 Y-87 +30071 30071 Yttrium 88 Y-88 +30072 30072 Yttrium 90 Y-90 +30073 30073 Yttrium 91 Y-91 +30074 30074 Yttrium 91 metastable Y-91m +30075 30075 Yttrium 92 Y-92 +30076 30076 Yttrium 93 Y-93 +30077 30077 Zirconium 89 Zr-89 +30078 30078 Zirconium 93 Zr-93 +30079 30079 Zirconium 95 Zr-95 +30080 30080 Zirconium 97 Zr-97 +30081 30081 Niobium 93 metastable Nb-93m +30082 30082 Niobium 94 Nb-94 +30083 30083 Niobium 95 Nb-95 +30084 30084 Niobium 95 metastable Nb-95m +30085 30085 Niobium 97 Nb-97 +30086 30086 Niobium 97 metastable Nb-97m +30087 30087 Molybdenum 93 Mo-93 +30088 30088 Molybdenum 99 Mo-99 +30089 30089 Technetium 95 metastable Tc-95m +30090 30090 Technetium 96 Tc-96 +30091 30091 Technetium 99 Tc-99 +30092 30092 Technetium 99 metastable Tc-99m +30093 30093 Rhodium 99 Rh-99 +30094 30094 Rhodium 101 Rh-101 +30095 30095 Rhodium 102 metastable Rh-102m +30096 30096 Rhodium 103 metastable Rh-103m +30097 30097 Rhodium 105 Rh-105 +30098 30098 Rhodium 106 Rh-106 +30099 30099 Palladium 100 Pd-100 +30100 30100 Palladium 103 Pd-103 +30101 30101 Palladium 107 Pd-107 +30102 30102 Ruthenium 103 Ru-103 +30103 30103 Ruthenium 105 Ru-105 +30104 30104 Ruthenium 106 Ru-106 +30105 30105 Silver 108 metastable Ag-108m +30106 30106 Silver 110 metastable Ag-110m +30107 30107 Cadmium 109 Cd-109 +30108 30108 Cadmium 113 metastable Cd-113m +30109 30109 Cadmium 115 metastable Cd-115m +30110 30110 Indium 114 metastable In-114m +30111 30111 Tin 113 Sn-113 +30112 30112 Tin 119 metastable Sn-119m +30113 30113 Tin 121 metastable Sn-121m +30114 30114 Tin 122 Sn-122 +30115 30115 Tin 123 Sn-123 +30116 30116 Tin 126 Sn-126 +30117 30117 Antimony 124 Sb-124 +30118 30118 Antimony 125 Sb-125 +30119 30119 Antimony 126 Sb-126 +30120 30120 Antimony 127 Sb-127 +30121 30121 Antimony 129 Sb-129 +30122 30122 Tellurium 123 metastable Te-123m +30123 30123 Tellurium 125 metastable Te-125m +30124 30124 Tellurium 127 Te-127 +30125 30125 Tellurium 127 metastable Te-127m +30126 30126 Tellurium 129 Te-129 +30127 30127 Tellurium 129 metastable Te-129m +30128 30128 Tellurium 131 metastable Te-131m +30129 30129 Tellurium 132 Te-132 +30130 30130 Iodine 123 I-123 +30131 30131 Iodine 124 I-124 +30132 30132 Iodine 125 I-125 +30133 30133 Iodine 126 I-126 +30134 30134 Iodine 129 I-129 +30135 30135 Iodine 129 elementary gaseous I-129g +30136 30136 Iodine 129 organic bounded I-129o +30137 30137 Iodine 131 I-131 +30138 30138 Iodine 131 elementary gaseous I-131g +30139 30139 Iodine 131 organic bounded I-131o +30140 30140 Iodine 131 gaseous elementary and organic bounded I-131go +30141 30141 Iodine 131 aerosol I-131a +30142 30142 Iodine 132 I-132 +30143 30143 Iodine 132 elementary gaseous I-132g +30144 30144 Iodine 132 organic bounded I-132o +30145 30145 Iodine 132 gaseous elementary and organic bounded I-132go +30146 30146 Iodine 132 aerosol I-132a +30147 30147 Iodine 133 I-133 +30148 30148 Iodine 133 elementary gaseous I-133g +30149 30149 Iodine 133 organic bounded I-133o +30150 30150 Iodine 133 gaseous elementary and organic bounded I-133go +30151 30151 Iodine 133 aerosol I-133a +30152 30152 Iodine 134 I-134 +30153 30153 Iodine 134 elementary gaseous I-134g +30154 30154 Iodine 134 organic bounded I-134o +30155 30155 Iodine 135 I-135 +30156 30156 Iodine 135 elementary gaseous I-135g +30157 30157 Iodine 135 organic bounded I-135o +30158 30158 Iodine 135 gaseous elementary and organic bounded I-135go +30159 30159 Iodine 135 aerosol I-135a +30160 30160 Xenon 131 metastable Xe-131m +30161 30161 Xenon 133 Xe-133 +30162 30162 Xenon 133 metastable Xe-133m +30163 30163 Xenon 135 Xe-135 +30164 30164 Xenon 135 metastable Xe-135m +30165 30165 Xenon 137 Xe-137 +30166 30166 Xenon 138 Xe-138 +30167 30167 Xenon sum of all Xenon isotopes Xe-sum +30168 30168 Caesium 131 Cs-131 +30169 30169 Caesium 134 Cs-134 +30170 30170 Caesium 135 Cs-135 +30171 30171 Caesium 136 Cs-136 +30172 30172 Caesium 137 Cs-137 +30173 30173 Barium 133 Ba-133 +30174 30174 Barium 137 metastable Ba-137m +30175 30175 Barium 140 Ba-140 +30176 30176 Cerium 139 Ce-139 +30177 30177 Cerium 141 Ce-141 +30178 30178 Cerium 143 Ce-143 +30179 30179 Cerium 144 Ce-144 +30180 30180 Lanthanum 140 La-140 +30181 30181 Lanthanum 141 La-141 +30182 30182 Praseodymium 143 Pr-143 +30183 30183 Praseodymium 144 Pr-144 +30184 30184 Praseodymium 144 metastable Pr-144m +30185 30185 Samarium 145 Sm-145 +30186 30186 Samarium 147 Sm-147 +30187 30187 Samarium 151 Sm-151 +30188 30188 Neodymium 147 Nd-147 +30189 30189 Promethium 146 Pm-146 +30190 30190 Promethium 147 Pm-147 +30191 30191 Promethium 151 Pm-151 +30192 30192 Europium 152 Eu-152 +30193 30193 Europium 154 Eu-154 +30194 30194 Europium 155 Eu-155 +30195 30195 Gadolinium 153 Gd-153 +30196 30196 Terbium 160 Tb-160 +30197 30197 Holmium 166 metastable Ho-166m +30198 30198 Thulium 170 Tm-170 +30199 30199 Ytterbium 169 Yb-169 +30200 30200 Hafnium 175 Hf-175 +30201 30201 Hafnium 181 Hf-181 +30202 30202 Tantalum 179 Ta-179 +30203 30203 Tantalum 182 Ta-182 +30204 30204 Rhenium 184 Re-184 +30205 30205 Iridium 192 Ir-192 +30206 30206 Mercury 203 Hg-203 +30207 30207 Thallium 204 Tl-204 +30208 30208 Thallium 207 Tl-207 +30209 30209 Thallium 208 Tl-208 +30210 30210 Thallium 209 Tl-209 +30211 30211 Bismuth 205 Bi-205 +30212 30212 Bismuth 207 Bi-207 +30213 30213 Bismuth 210 Bi-210 +30214 30214 Bismuth 211 Bi-211 +30215 30215 Bismuth 212 Bi-212 +30216 30216 Bismuth 213 Bi-213 +30217 30217 Bismuth 214 Bi-214 +30218 30218 Polonium 208 Po-208 +30219 30219 Polonium 210 Po-210 +30220 30220 Polonium 212 Po-212 +30221 30221 Polonium 213 Po-213 +30222 30222 Polonium 214 Po-214 +30223 30223 Polonium 215 Po-215 +30224 30224 Polonium 216 Po-216 +30225 30225 Polonium 218 Po-218 +30226 30226 Lead 209 Pb-209 +30227 30227 Lead 210 Pb-210 +30228 30228 Lead 211 Pb-211 +30229 30229 Lead 212 Pb-212 +30230 30230 Lead 214 Pb-214 +30231 30231 Astatine 217 At-217 +30232 30232 Radon 219 Rn-219 +30233 30233 Radon 220 Rn-220 +30234 30234 Radon 222 Rn-222 +30235 30235 Francium 221 Fr-221 +30236 30236 Francium 223 Fr-223 +30237 30237 Radium 223 Ra-223 +30238 30238 Radium 224 Ra-224 +30239 30239 Radium 225 Ra-225 +30240 30240 Radium 226 Ra-226 +30241 30241 Radium 228 Ra-228 +30242 30242 Actinium 225 Ac-225 +30243 30243 Actinium 227 Ac-227 +30244 30244 Actinium 228 Ac-228 +30245 30245 Thorium 227 Th-227 +30246 30246 Thorium 228 Th-228 +30247 30247 Thorium 229 Th-229 +30248 30248 Thorium 230 Th-230 +30249 30249 Thorium 231 Th-231 +30250 30250 Thorium 232 Th-232 +30251 30251 Thorium 234 Th-234 +30252 30252 Protactinium 231 Pa-231 +30253 30253 Protactinium 233 Pa-233 +30254 30254 Protactinium 234 metastable Pa-234m +30255 30255 Uranium 232 U-232 +30256 30256 Uranium 233 U-233 +30257 30257 Uranium 234 U-234 +30258 30258 Uranium 235 U-235 +30259 30259 Uranium 236 U-236 +30260 30260 Uranium 237 U-237 +30261 30261 Uranium 238 U-238 +30262 30262 Plutonium 236 Pu-236 +30263 30263 Plutonium 238 Pu-238 +30264 30264 Plutonium 239 Pu-239 +30265 30265 Plutonium 240 Pu-240 +30266 30266 Plutonium 241 Pu-241 +30267 30267 Plutonium 242 Pu-242 +30268 30268 Plutonium 244 Pu-244 +30269 30269 Neptunium 237 Np-237 +30270 30270 Neptunium 238 Np-238 +30271 30271 Neptunium 239 Np-239 +30272 30272 Americium 241 Am-241 +30273 30273 Americium 242 Am-242 +30274 30274 Americium 242 metastable Am-242m +30275 30275 Americium 243 Am-243 +30276 30276 Curium 242 Cm-242 +30277 30277 Curium 243 Cm-243 +30278 30278 Curium 244 Cm-244 +30279 30279 Curium 245 Cm-245 +30280 30280 Curium 246 Cm-246 +30281 30281 Curium 247 Cm-247 +30282 30282 Curium 248 Cm-248 +30283 30283 Curium 243/244 Cm-243244 +30284 30284 Plutonium 238/Americium 241 Pu-238Am-241 +30285 30285 Plutonium 239/240 Pu-239240 +30286 30286 Berkelium 249 Bk-249 +30287 30287 Californium 249 Cf-249 +30288 30288 Californium 250 Cf-250 +30289 30289 Californium 252 Cf-252 +30290 30290 Sum aerosol particulates SumAer +30291 30291 Sum Iodine SumIod +30292 30292 Sum noble gas SumNG +30293 30293 Activation gas ActGas +30294 30294 Cs-137 Equivalent EquCs137 +30295 30295 Carbon-13 C-13 +30296 30296 Lead Pb +30297 30297 Tellurium 131 Te-131 +30298 30298 Neodymium 137 Nd-137 +# 30299-39999 Reserved +40000 40000 Singlet sigma oxygen (dioxygen (sigma singlet)) O2 +40001 40001 Singlet delta oxygen (dioxygen (delta singlet)) O2 +40002 40002 Singlet excited oxygen atom O(1D) +40003 40003 Triplet ground state oxygen atom O(3P) +# 40004-59999 Reserved +60000 60000 HOx radical (OH+HO2) HOx* +60001 60001 Total inorganic and organic peroxy radicals (HOO* + ROO*) ROO* +60002 60002 Passive Ozone +60003 60003 NOx expressed as nitrogen NOx +60004 60004 All nitrogen oxides (NOy) expressed as nitrogen NOy +60005 60005 Total inorganic chlorine Clx +60006 60006 Total inorganic bromine Brx +60007 60007 Total inorganic chlorine except HCl, ClONO2: ClOx +60008 60008 Total inorganic bromine except HBr, BrONO2: BrOx +60009 60009 Lumped alkanes +60010 60010 Lumped alkenes +60011 60011 Lumped aromatic compounds +60012 60012 Lumped terpenes +60013 60013 Non-methane volatile organic compounds expressed as carbon NMVOC +60014 60014 Anthropogenic non-methane volatile organic compounds expressed as carbon aNMVOC +60015 60015 Biogenic non-methane volatile organic compounds expressed as carbon bNMVOC +60016 60016 Lumped oxygenated hydrocarbons OVOC +60017 60017 NOx expressed as nitrogen dioxide (NO2) NOx +60018 60018 Organic aldehydes RCHO +60019 60019 Organic peroxides ROOH +60020 60020 Organic nitrates RNO3 +60021 60021 Ethers ROR' +60022 60022 Amines NRR'R'' +60023 60023 Ketones RC(O)R' +60024 60024 Dicarbonyls unsaturated RC(O)CH2C(O)R' +60025 60025 Hydroxy dicarbonyls unsaturated RC(O)CHOHC(O)R' +60026 60026 Hydroxy ketones RC(OH)C(O)R' +60027 60027 Oxides Ox +60028 60028 Peroxyacyl nitrates RC(O)OONO2 +60029 60029 Aromatic peroxide radical (Aryl dioxydanyl radicals) ArOO* +60030 60030 Biogenic secondary organic compound +60031 60031 Anthropogenic secondary organic compound +60032 60032 All hydroxy-peroxides products of the reaction of hydroxy-isoprene adducts with O2 ISOPOOH +60033 60033 Anthropogenic volatile organic compounds aVOC +60034 60034 Biomass burning volatile organic compounds bbVOC +# 60035-61999 Reserved +62000 62000 Total aerosol +62001 62001 Dust dry +62002 62002 Water in ambient +62003 62003 Ammonium dry +62004 62004 Nitrate dry +62005 62005 Nitric acid trihydrate +62006 62006 Sulphate dry +62007 62007 Mercury dry +62008 62008 Sea salt dry +62009 62009 Black carbon dry +62010 62010 Particulate organic matter dry +62011 62011 Primary particulate organic matter dry +62012 62012 Secondary particulate organic matter dry +62013 62013 Black carbon hydrophilic dry +62014 62014 Black carbon hydrophobic dry +62015 62015 Particulate organic matter hydrophilic dry +62016 62016 Particulate organic matter hydrophobic dry +62017 62017 Nitrate hydrophilic dry +62018 62018 Nitrate hydrophobic dry +# 62019 Reserved +62020 62020 Smoke - high absorption +62021 62021 Smoke - low absorption +62022 62022 Aerosol - high absorption +62023 62023 Aerosol - low absorption +# 62024 Reserved +62025 62025 Volcanic ash +62026 62026 Particulate matter (PM) +# 62027 Reserved +62028 62028 Total aerosol hydrophilic +62029 62029 Total aerosol hydrophobic +62030 62030 Primary particulate inorganic matter dry +62031 62031 Secondary particulate inorganic matter dry +62032 62032 Biogenic secondary organic aerosol +62033 62033 Anthropogenic secondary organic aerosol +62034 62034 Rain water H2Orain +62035 62035 Cloud water H2Ocloud +62036 62036 Brown carbon dry +# 62037-62099 Reserved +62100 62100 Alnus (alder) pollen +62101 62101 Betula (birch) pollen +62102 62102 Castanea (chestnut) pollen +62103 62103 Carpinus (hornbeam) pollen +62104 62104 Corylus (hazel) pollen +62105 62105 Fagus (beech) pollen +62106 62106 Fraxinus (ash) pollen +62107 62107 Pinus (pine) pollen +62108 62108 Platanus (plane) pollen +62109 62109 Populus (cottonwood, poplar) pollen +62110 62110 Quercus (oak) pollen +62111 62111 Salix (willow) pollen +62112 62112 Taxus (yew) pollen +62113 62113 Tilia (lime, linden) pollen +62114 62114 Ulmus (elm) pollen +62115 62115 Olea (olive) pollen +# 62116-62199 Reserved +62200 62200 Ambrosia (ragweed, burr-ragweed) pollen +62201 62201 Artemisia (sagebrush, wormwood, mugwort) pollen +62202 62202 Brassica (rape, broccoli, Brussels sprouts, cabbage, cauliflower, collards, kale, kohlrabi, mustard, rutabaga) pollen +62203 62203 Plantago (plantain) pollen +62204 62204 Rumex (dock, sorrel) pollen +62205 62205 Urtica (nettle) pollen +# 62206-62299 Reserved +62300 62300 Poaceae (grass family) pollen +# 62301-62999 Reserved +# 63000-65534 For experimental use at local level +65535 65535 Missing diff --git a/definitions/grib2/tables/33/4.234.table b/definitions/grib2/tables/33/4.234.table new file mode 100644 index 000000000..3b05b4515 --- /dev/null +++ b/definitions/grib2/tables/33/4.234.table @@ -0,0 +1,21 @@ +# Code table 4.234 - Canopy cover fraction (to be used as partitioned parameter in product definition template 4.53 or 4.54) +1 1 Crops, mixed farming +2 2 Short grass +3 3 Evergreen needleleaf trees +4 4 Deciduous needleleaf trees +5 5 Deciduous broadleaf trees +6 6 Evergreen broadleaf trees +7 7 Tall grass +8 8 Desert +9 9 Tundra +10 10 Irrigated crops +11 11 Semidesert +12 12 Ice caps and glaciers +13 13 Bogs and marshes +14 14 Inland water +15 15 Ocean +16 16 Evergreen shrubs +17 17 Deciduous shrubs +18 18 Mixed forest +19 19 Interrupted forest +20 20 Water and land mixtures diff --git a/definitions/grib2/tables/33/4.236.table b/definitions/grib2/tables/33/4.236.table new file mode 100644 index 000000000..9c58b488c --- /dev/null +++ b/definitions/grib2/tables/33/4.236.table @@ -0,0 +1,8 @@ +# Code table 4.236 - Soil texture fraction (to be used as partitioned parameter in product definition template 4.53 or 4.54) +1 1 Coarse +2 2 Medium +3 3 Medium-fine +4 4 Fine +5 5 Very-fine +6 6 Organic +7 7 Tropical-organic diff --git a/definitions/grib2/tables/33/4.238.table b/definitions/grib2/tables/33/4.238.table new file mode 100644 index 000000000..cd8b5cba8 --- /dev/null +++ b/definitions/grib2/tables/33/4.238.table @@ -0,0 +1,34 @@ +# Code table 4.238 - Source or sink +0 0 Other +1 1 Aviation +2 2 Lightning +3 3 Biogenic sources +4 4 Anthropogenic sources +5 5 Wild fires +6 6 Natural sources +7 7 Volcanoes +8 8 Bio-fuel +9 9 Fossil-fuel +10 10 Wetlands +11 11 Oceans +12 12 Elevated anthropogenic sources +13 13 Surface anthropogenic sources +14 14 Agriculture livestock +15 15 Agriculture soils +16 16 Agriculture waste burning +17 17 Agriculture (all) +18 18 Residential, commercial and other combustion +19 19 Power generation +20 20 Super power stations +21 21 Fugitives +22 22 Industrial process +23 23 Solvents +24 24 Ships +25 25 Wastes (solid and water) +26 26 Road transportation +27 27 Off-road transportation +28 28 Nuclear power plant +29 29 Nuclear weapon +# 30-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.239.table b/definitions/grib2/tables/33/4.239.table new file mode 100644 index 000000000..f095b14a0 --- /dev/null +++ b/definitions/grib2/tables/33/4.239.table @@ -0,0 +1,17 @@ +# Code table 4.239 - Wetland Type +0 0 Reserved +1 1 Bog +2 2 Drained +3 3 Fen +4 4 Floodplain +5 5 Mangrove +6 6 Marsh +7 7 Rice +8 8 Riverine +9 9 Salt marsh +10 10 Swamp +11 11 Upland +12 12 Wet tundra +# 13-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.240.table b/definitions/grib2/tables/33/4.240.table new file mode 100644 index 000000000..2a31fb2ab --- /dev/null +++ b/definitions/grib2/tables/33/4.240.table @@ -0,0 +1,13 @@ +# Code table 4.240 - Type of distribution function +0 0 No specific distribution function given +1 1 Delta functions with spatially variable concentration and fixed diameters Dl (p1) in metre +2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg +3 3 Gaussian (normal) distribution with spatially variable concentration and fixed mean diameter Dl(p1) and variance(p2) +4 4 Gaussian (normal) distribution with spatially variable concentration, mean diameter and variance +5 5 Log-normal distribution with spatially variable number density, mean diameter and variance +6 6 Log-normal distribution with spatially variable number density, mean diameter and fixed variance(p1) +7 7 Log-normal distribution with spatially variable number density and mass density and fixed variance(p1) and fixed particle density(p2) +8 8 No distribution function. The encoded variable is derived from variables characterized by type of distribution function of type No. 7 (see above) with fixed variance(p1) and fixed particle density(p2) +# 9-49151 Reserved +# 49152-65534 Reserved for local use +65535 65535 Missing value diff --git a/definitions/grib2/tables/33/4.241.table b/definitions/grib2/tables/33/4.241.table new file mode 100644 index 000000000..743e5f6e2 --- /dev/null +++ b/definitions/grib2/tables/33/4.241.table @@ -0,0 +1,12 @@ +# Code table 4.241 - Coverage attributes +0 UNDEF Undefined +1 UNMOD Unmodified +2 SNOW Snow covered +3 FLOOD Flooded +4 ICE Ice covered +5 ITCW With intercepted water +6 ITCS With intercepted snow +7 AGG Aggregated +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/33/4.242.table b/definitions/grib2/tables/33/4.242.table new file mode 100644 index 000000000..9574142da --- /dev/null +++ b/definitions/grib2/tables/33/4.242.table @@ -0,0 +1,10 @@ +# Code table 4.242 - Tile classification +0 0 Reserved +1 GCV2009 Land use classes according to ESA-GlobCover GCV2009 +2 GLC2000 Land use classes according to European Commission-Global Land Cover Project GLC2000 +3 ECOCLIMAP Land use classes according to ECOCLIMAP +4 ECOCLIMAP-SG Land use classes according to ECOCLIMAP-SG +5 GLCCv2BATS Land use classes according to USGS EROS Global Land Cover Characterization (GLCC) v2.0 BATS Classification +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/33/4.243.table b/definitions/grib2/tables/33/4.243.table new file mode 100644 index 000000000..24d21b719 --- /dev/null +++ b/definitions/grib2/tables/33/4.243.table @@ -0,0 +1,43 @@ +# Code table 4.243 - Tile class +0 0 Reserved +1 1 Evergreen broadleaved forest +2 2 Deciduous broadleaved closed forest +3 3 Deciduous broadleaved open forest +4 4 Evergreen needle-leaf forest +5 5 Deciduous needle-leaf forest +6 6 Mixed leaf trees +7 7 Freshwater flooded trees +8 8 Saline water flooded trees +9 9 Mosaic tree/natural vegetation +10 10 Burnt tree cover +11 11 Evergreen shrubs closed-open +12 12 Deciduous shrubs closed-open +13 13 Herbaceous vegetation closed-open +14 14 Sparse herbaceous or grass +15 15 Flooded shrubs or herbaceous +16 16 Cultivated and managed areas +17 17 Mosaic crop/tree/natural vegetation +18 18 Mosaic crop/shrub/grass +19 19 Bare areas +20 20 Water +21 21 Snow and ice +22 22 Artificial surface +23 23 Ocean +24 24 Irrigated croplands +25 25 Rainfed croplands +26 26 Mosaic cropland (50-70%) - vegetation (20-50%) +27 27 Mosaic vegetation (50-70%) - cropland (20-50%) +28 28 Closed broadleaved evergreen forest +29 29 Closed needle-leaved evergreen forest +30 30 Open needle-leaved deciduous forest +31 31 Mixed broadleaved and needle-leaved forest +32 32 Mosaic shrubland (50-70%) - grassland (20-50%) +33 33 Mosaic grassland (50-70%) - shrubland (20-50%) +34 34 Closed to open shrubland +35 35 Sparse vegetation +36 36 Closed to open forest regularly flooded +37 37 Closed forest or shrubland permanently flooded +38 38 Closed to open grassland regularly flooded +39 39 Undefined +# 40-32767 Reserved +# 32768- Reserved for local use diff --git a/definitions/grib2/tables/33/4.244.table b/definitions/grib2/tables/33/4.244.table new file mode 100644 index 000000000..a4470cd56 --- /dev/null +++ b/definitions/grib2/tables/33/4.244.table @@ -0,0 +1,7 @@ +# Code table 4.244 - Quality indicator +0 0 No quality information available +1 1 Failed +2 2 Passed +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.246.table b/definitions/grib2/tables/33/4.246.table new file mode 100644 index 000000000..0ca9c0c98 --- /dev/null +++ b/definitions/grib2/tables/33/4.246.table @@ -0,0 +1,7 @@ +# Code table 4.246 - Thunderstorm intensity +0 0 No thunderstorm occurrence +1 1 Weak thunderstorm +2 2 Moderate thunderstorm +3 3 Severe thunderstorm +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/33/4.247.table b/definitions/grib2/tables/33/4.247.table new file mode 100644 index 000000000..6da16e396 --- /dev/null +++ b/definitions/grib2/tables/33/4.247.table @@ -0,0 +1,7 @@ +# Code table 4.247 - Precipitation intensity +0 0 No precipitation occurrence +1 1 Light precipitation +2 2 Moderate precipitation +3 3 Heavy precipitation +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/33/4.248.table b/definitions/grib2/tables/33/4.248.table new file mode 100644 index 000000000..04e365c97 --- /dev/null +++ b/definitions/grib2/tables/33/4.248.table @@ -0,0 +1,6 @@ +# Code table 4.248 - Method used to derive data values for a given local time +0 0 Nearest forecast or analysis time to specified local time +1 1 Interpolated to be valid at the specified local time +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.249.table b/definitions/grib2/tables/33/4.249.table new file mode 100644 index 000000000..bd1c944c4 --- /dev/null +++ b/definitions/grib2/tables/33/4.249.table @@ -0,0 +1,7 @@ +# Code table 4.249 - Character of precipitation +0 0 None +1 1 Showers +2 2 Intermittent +3 3 Continuous +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/33/4.250.table b/definitions/grib2/tables/33/4.250.table new file mode 100644 index 000000000..a249158ca --- /dev/null +++ b/definitions/grib2/tables/33/4.250.table @@ -0,0 +1,14 @@ +# Code table 4.250 - Drainage direction +0 0 Reserved +1 1 South-west +2 2 South +3 3 South-east +4 4 West +5 5 No direction +6 6 East +7 7 North-west +8 8 North +9 9 North-east +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.251.table b/definitions/grib2/tables/33/4.251.table new file mode 100644 index 000000000..3a78e713e --- /dev/null +++ b/definitions/grib2/tables/33/4.251.table @@ -0,0 +1,7 @@ +# Code table 4.251 - Wave direction and frequency formulae +0 0 Undefined sequence +1 1 Geometric sequence +2 2 Arithmetic sequence +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.252.table b/definitions/grib2/tables/33/4.252.table new file mode 100644 index 000000000..3baf4064c --- /dev/null +++ b/definitions/grib2/tables/33/4.252.table @@ -0,0 +1,165 @@ +# Code table 4.252 - Tile classes and groupings +0 0 Reserved +1 SEOC Seas and oceans +2 INWB Inland water bodies +3 BARE Bare areas +4 HIV High vegetation +5 LOV Low vegetation +6 URBAN Urban +# 7-1000 Reserved for intercomparison tile classes/groupings +1001 SEAO Sea and oceans +1002 LAKE Lakes +1003 RIVE Rivers +1004 NO Bare land +1005 ROCK Bare rock +1006 SNOW Permanent snow +1007 BOBD Boreal broadleaf deciduous +1008 TEBD Temperate broadleaf deciduous +1009 TRBD Tropical broadleaf deciduous +1010 TEBE Temperate broadleaf evergreen +1011 TRBE Tropical broadleaf evergreen +1012 BONE Boreal needleleaf evergreen +1013 TENE Temperate needleleaf evergreen +1014 BOND Boreal needleleaf deciduous +1015 SHRB Shrubs +1016 BOGR Boreal grassland +1017 GRAS Temperate grassland +1018 TROG Tropical grassland +1019 C3W Winter C3 crops +1020 C3S Summer C3 crops +1021 C4 C4 crops +1022 FLTR Flooded trees +1023 FLGR Flooded grassland +1024 LCZ1 Local climate zone 1: compact high-rise (buildings) +1025 LCZ2 Local climate zone 2: compact midrise (buildings) +1026 LCZ3 Local climate zone 3: compact low-rise (buildings) +1027 LCZ4 Local climate zone 4: open high-rise (buildings) +1028 LCZ5 Local climate zone 5: open midrise (buildings) +1029 LCZ6 Local climate zone 6: open low-rise (buildings) +1030 LCZ7 Local climate zone 7: lightweight low-rise (buildings) +1031 LCZ8 Local climate zone 8: large low-rise (buildings) +1032 LCZ9 Local climate zone 9: sparsely built (buildings) +1033 LCZ10 Local climate zone 10: heavy industry (buildings) +1034 TEBDU Urban temperate broadleaf deciduous +1035 TRBDU Urban tropical broadleaf deciduous +1036 TEBEU Urban temperate broadleaf evergreen +1037 TRBEU Urban tropical broadleaf evergreen +1038 BONEU Urban boreal needleleaf evergreen +1039 TENEU Urban temperate needleleaf evergreen +1040 BONDU Urban boreal needleleaf deciduous +# 1041-1500 Reserved for tile class entries for tile models using the ECOCLIMAP-SG land cover survey +# v8.1 groupings +1501 GNATU Nature grouping (NO + ROCK + SNOW + BOBD + TEBD + TRBD + TEBE + TRBE + BONE + TENE + BOND + SHRB + BOGR + GRAS + TROG + C3W + C3S + C4 + FLTR + FLGR) +1502 GNOFO Non-forest grouping (NO + ROCK + SNOW + BOGR + GRAS + TROG + C3W + C3S + C4 + FLTR + FLGR) +1503 GFORE Forest grouping (BOBD + TEBD + TRBD + TEBE + TRBE + BONE + TENE + BOND + SHRB) +1504 GNOVE Non-vegetated grouping (NO + ROCK + SNOW) +1505 GTREE Trees grouping (BOBD + TEBD + TRBD + TEBE + TRBE + BONE + TENE + BOND + SHRB + FLTR) +1506 GLVEG Low vegetation grouping (BOGR + GRAS + TROG + C3W + C3S + C4 + FLGR) +1507 GNFLV Non-flooded low vegetation grouping (BOGR + GRAS + TROG + C3W + C3S + C4) +1508 GCROP Crops grouping (C3W + C3S + C4) +1509 GGRAS Grassland grouping (BOGR + GRAS + TROG) +1510 GBARO Bare and rock grouping (NO + ROCK) +1511 GC3CR C3 crops grouping (C3W + C3S) +1512 GBFOR Broadleaf forest grouping (BOBD + TEBD + TRBD + TEBE + TRBE + SHRB) +1513 GNFOR Needleleaf forest grouping (BONE + TENE + BOND) +1514 GDBFO Deciduous broadleaf forest grouping (BOBD + TEBD + TRBD + TEBE + SHRB) +1515 GTGRA Temperate grassland grouping (BOGR + GRAS) +# v9.0 groupings +1516 GNFNF Non-forest (no FLTR) grouping (NO + ROCK + SNOW + BOGR + GRAS + TROG + C3W + C3S + C4 + FLGR) +1517 GBFFT Broadleaf forest (with FLTR) grouping (BOBD + TEBD + TRBD + TEBE + TRBE + SHRB + FLTR) +1518 GBTRE Broadleaf trees grouping (BOBD + TEBD + TRBD + TEBE + TRBE + FLTR) +1519 GCGRA C3/C4 grasslands grouping (BOGR + GRAS + FLGR) +1520 GBDTR Broadleaf deciduous trees grouping (BOBD + TEBD + TRBD + FLTR) +1521 GBETR Broadleaf evergreen trees grouping (TEBE + TRBE) +1522 GNETR Needleleaf evergreen trees grouping (BONE + TENE) +# Other groupings +1523 GLCZU LCZ or urban grouping (LCZ1 + LCZ2 + LCZ3 + LCZ4 + LCZ5 + LCZ6 + LCZ7 + LCZ8 + LCZ9 + LCZ10) +1524 GIWAT Inland water grouping (LAKE + RIVE) +1525 GPTEBD Urban parks and gardens TEBD grouping (NO + GRAS + TEBDU) +1526 GPTRBD Urban parks and gardens TRBD grouping (NO + GRAS + TRBDU) +1527 GPTEBE Urban parks and gardens TEBE grouping (NO + GRAS + TEBEU) +1528 GPTRBE Urban parks and gardens TRBE grouping (NO + GRAS + TRBEU) +1529 GPBONE Urban parks and gardens BONE grouping (NO + GRAS + BONEU) +1530 GPTENE Urban parks and gardens TENE grouping (NO + GRAS + TENEU) +1531 GPBOND Urban parks and gardens BOND grouping (NO + GRAS + BONDU) +# 1532-2000 Reserved for tile grouping entries for tile models using the ECOCLIMAP-SG land cover survey +2001 CRMF Crops, mixed farming +2002 SHGR Short grass +2003 EVNE Evergreen needleleaf trees +2004 DENE Deciduous needleleaf trees +2005 DEBR Deciduous broadleaf trees +2006 EVBR Evergreen broadleaf trees +2007 TAGR Tall grass +2008 DESE Desert +2009 TUND Tundra +2010 IRCR Irrigated crops +2011 SEDE Semidesert +2012 ICGL Ice caps and glaciers +2013 BOMA Bogs and marshes +2014 INWA Inland water +2015 OCEA Ocean +2016 EVSH Evergreen shrubs +2017 DESH Deciduous shrubs +2018 MFWO Mixed forest/woodland +2019 INFO Interrupted forest +2020 WLMI Water and land mixtures +2021 BASO Bare soil +2022 URBA Urban +2023 LORI Low-rise building +2024 HIRI High-rise building +# 2025-2500 Reserved for tile class entries for tile models using the GLCC v2.0 BATS Classification survey +2501 GLVE Low vegetation grouping (CRMF + SHGR + TAGR + TUND + IRCR + SEDE + BOMA + EVSH + DESH + WLMI) +2502 GHVE High vegetation grouping (EVNE + DENE + DEBR + EVBR + MFWO + INFO) +# 2503-3000 Reserved for tile grouping entries for tile models using the GLCC v2.0 BATS Classification survey +3001 PFIC Post-flooding or irrigated croplands +3002 RACR Rainfed croplands +3003 MCVE Mosaic cropland (50-70%) / vegetation (grassland, shrubland, forest) (20-50%) +3004 MVCR Mosaic vegetation (grassland, shrubland, forest) (50-70%) / cropland (20-50%) +3005 COBS Closed to open (>15%) broadleaved evergreen and/or semi-deciduous forest (>5m) +3006 CLBD Closed (>40%) broadleaved deciduous forest (>5m) +3007 OPBD Open (15-40%) broadleaved deciduous forest (>5m) +3008 CLNE Closed (>40%) needleleaved evergreen forest (>5m) +3009 ONDE Open (15-40%) needleleaved deciduous or evergreen forest (>5m) +3010 COBN Closed to open (>15%) mixed broadleaved and needleleaved forest (>5m) +3011 MFSG Mosaic forest/shrubland (50-70%) / grassland (20-50%) +3012 MGFS Mosaic grassland (50-70%) / forest / shrubland (20-50%) +3013 COSH Closed to open (>15%) shrubland (<5m) +3014 COHV Closed to open (>15%) herbaceous vegetation +3015 SPVE Sparse (<15%) vegetation (woody vegetation, shrubs, grassland) +3016 COBFF Closed to open (>15%) broadleaved forest regularly flooded (semi-permanently or temporarily) - fresh or brackish water +3017 CLBFF Closed (>40%) broadleaved forest or shrubland permanently flooded - saline or brackish water +3018 COVEF Closed to open (>15%) vegetation (grassland, shrubland, woody vegetation) on regularly flooded or waterlogged soil - fresh, brackish or saline water +3019 ASAA Artificial surfaces and associated areas (urban areas >50%) +3020 BAAR Bare areas +3021 WABO Water bodies +3022 PESI Permanent snow and ice +# 3023-3500 Reserved for tile class entries for tile models using the ESA-GlobCover GCV2009 survey +3501 GRDT Grouping using the dominant tiles approach (dominant tile varies per gridbox) +# 3502-4000 Reserved for tile grouping entries for tile models using the ESA-GlobCover GCV2009 survey +4001 TBECO Tree cover, broadleaved evergreen, closed to open (>15%) +4002 TBDC Tree cover, broadleaved deciduous, closed (>40%) +4003 TBDO Tree cover, broadleaved deciduous, open (15-40%) +4004 TNECO Tree cover, needleleaved evergreen, closed to open (>15%) +4005 TNDCO Tree cover, needleleaved decidous, closed to open (>15%) +4006 TMLCO Tree cover, mixed leaftype, closed to open (>15%) +4007 TCOFF Tree cover, closed to open (>15%), regularly flooded, fresh or brackish water: swamp forests +4008 TCOFS Tree cover, closed to open (>15%), regularly flooded, saline water: mangrove forests +4009 MTVG Mosaic of tree cover and other natural vegetation (crop component possible) +4010 TBURN Tree Cover, burnt (mainly boreal forests) +4011 SCOE Shrubcover, closed to open (>15%), evergreen (broadleaved or needleleaved) +4012 SCOD Shrubcover, closed to open (>15%), deciduous (broadleaved) +4013 HCCO Herbaceous cover, closed to open (>15%) +4014 SHSC Sparse herbaceous or sparse shrub cover +4015 FSHCO Regularly flooded (>2 month) shrub or herbaceous cover, closed to open +4016 CROP Cropland (upland crops or inundated/ flooded crops) +4017 MCTNV Mosaic of cropland / tree cover/ other natural vegetation +4018 MCSH Mosaic of cropland / shrub or herbaceous cover +4019 BAARE Bare areas +4020 WBNA Water bodies (natural or artificial) +4021 SINA Snow or ice (natural or artificial) +4022 URAR Urban areas +# 4023-4500 Reserved for tile class entries for tile models using the European Commission-Global Land Cover Project GLC2000 survey +# 4501-5000 Reserved for tile grouping entries for tile models using the European Commission-Global Land Cover Project GLC2000 survey +# 5001-32767 Reserved for additional land cover surveys +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/33/4.3.table b/definitions/grib2/tables/33/4.3.table new file mode 100644 index 000000000..8ae36efc3 --- /dev/null +++ b/definitions/grib2/tables/33/4.3.table @@ -0,0 +1,26 @@ +# Code table 4.3 - Type of generating process +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +12 12 Post-processed analysis +13 13 Post-processed forecast +14 14 Nowcast +15 15 Hindcast +16 16 Physical retrieval +17 17 Regression analysis +18 18 Difference between two forecasts +19 19 First guess +20 20 Analysis increment +21 21 Initialization increment for analysis +# 22-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.333.table b/definitions/grib2/tables/33/4.333.table new file mode 100644 index 000000000..1367d35c6 --- /dev/null +++ b/definitions/grib2/tables/33/4.333.table @@ -0,0 +1,12 @@ +# Code table 4.333 - Transport dispersion model +1 1 DERMA (Danish Emergency Response Model of the Atmosphere) +2 2 E-EMEP (Emergency EMEP model) +3 3 FLEXPART (Particle dispersion model) +4 4 MLDP (Modèle lagrangien de dispersion de particules) +5 5 MATCH (Multi-scale Atmospheric Transport Model) +6 6 SILAM (System for Integrated modeLling of Atmospheric composition) +7 7 SNAP (Severe Nuclear Accident Program) +8 8 WRF-Chem (Weather Research and Forecasting Chemical model) +9 9 Trajectoire (Trajectory model) +# 10-254 Reserved +255 255 Missing value diff --git a/definitions/grib2/tables/33/4.335.table b/definitions/grib2/tables/33/4.335.table new file mode 100644 index 000000000..f47807cf6 --- /dev/null +++ b/definitions/grib2/tables/33/4.335.table @@ -0,0 +1,7 @@ +# Code table 4.335 - Emission scenario origin +1 1 ARGOS (Accident Reporting and Guiding Operational System) +2 2 JRODOS (Java version of Real time Online Decision SuppOrt System) +3 3 Assimilated (Scenario retrieved from measurements) +4 4 Centre (scenario by originating centre) +# 5-254 Reserved +255 255 Missing value diff --git a/definitions/grib2/tables/33/4.336.table b/definitions/grib2/tables/33/4.336.table new file mode 100644 index 000000000..c7855abea --- /dev/null +++ b/definitions/grib2/tables/33/4.336.table @@ -0,0 +1,13 @@ +# Code table 4.336 - NWP model +1 1 AROME (Meso scale NWP, Meteo-France) +2 2 ARPEGE (Global scale NWP, Meteo-France) +3 3 GFS (Global forecast system, NCEP) +4 4 HARMONIE (HIRLAM-ALADIN Research on Mesoscale Operational NWP) +5 5 HIRLAM (HIgh resolution Limited Area Model) +6 6 IFS (Integrated Forecast System) +7 7 GEM GDPS (Canadian Global Deterministic Prediction System) +8 8 GEM RDPS (Canadian Regional Deterministic Prediction System) +9 9 GEM HRDPS (Canadian High Resolution Deterministic Prediction System) +10 10 WRF (Weather Research and Forecasting) +# 11-254 Reserved +255 255 Missing value diff --git a/definitions/grib2/tables/33/4.4.table b/definitions/grib2/tables/33/4.4.table new file mode 100644 index 000000000..6e63e069c --- /dev/null +++ b/definitions/grib2/tables/33/4.4.table @@ -0,0 +1,17 @@ +# Code table 4.4 - Indicator of unit of time range +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.5.table b/definitions/grib2/tables/33/4.5.table new file mode 100644 index 000000000..f139bc109 --- /dev/null +++ b/definitions/grib2/tables/33/4.5.table @@ -0,0 +1,95 @@ +# Code table 4.5 - Fixed surface types and units +0 0 Reserved +1 sfc Ground or water surface (-) +2 2 Cloud base level (-) +3 3 Level of cloud tops (-) +4 4 Level of 0 degree C isotherm (-) +5 5 Level of adiabatic condensation lifted from the surface (-) +6 6 Maximum wind level (-) +7 sfc Tropopause (-) +8 sfc Nominal top of the atmosphere (-) +9 9 Sea bottom (-) +10 10 Entire atmosphere (-) +11 11 Cumulonimbus (CB) base (m) +12 12 Cumulonimbus (CB) top (m) +13 13 Lowest level where vertically integrated cloud cover exceeds the specified percentage (cloud base for a given percentage cloud cover) (%) +14 14 Level of free convection (LFC) (-) +15 15 Convective condensation level (CCL) (-) +16 16 Level of neutral buoyancy or equilibrium level (LNB) (-) +17 sfc Departure level of the most unstable parcel of air (MUDL) +18 sfc Departure level of a mixed layer parcel of air with specified layer depth (Pa) +19 19 Lowest level where cloud cover exceeds the specified percentage (%) +20 20 Isothermal level (K) +21 21 Lowest level where mass density exceeds the specified value (base for a given threshold of mass density) (kg m-3) +22 22 Highest level where mass density exceeds the specified value (top for a given threshold of mass density) (kg m-3) +23 23 Lowest level where air concentration exceeds the specified value (base for a given threshold of air concentration) (Bq m-3) +24 24 Highest level where air concentration exceeds the specified value (top for a given threshold of air concentration) (Bq m-3) +25 25 Highest level where radar reflectivity exceeds the specified value (echo top for a given threshold of reflectivity) (dBZ) +26 26 Convective cloud layer base (m) +27 27 Convective cloud layer top (m) +# 28-29 Reserved +30 30 Specified radius from the centre of the Sun (m) +31 31 Solar photosphere +32 32 Ionospheric D-region level +33 33 Ionospheric E-region level +34 34 Ionospheric F1-region level +35 35 Ionospheric F2-region level +# 36-99 Reserved +100 pl Isobaric surface (Pa) +101 sfc Mean sea level +102 102 Specific altitude above mean sea level (m) +103 sfc Specified height level above ground (m) +104 104 Sigma level (sigma value) +105 ml Hybrid level (-) +106 sfc Depth below land surface (m) +107 pt Isentropic (theta) level (K) +108 108 Level at specified pressure difference from ground to level (Pa) +109 pv Potential vorticity surface (K m2 kg-1 s-1) +110 110 Reserved +111 111 Eta level (-) +112 112 Reserved +113 113 Logarithmic hybrid level +114 sol Snow level (Numeric) +115 115 Sigma height level +# 116 Reserved +117 117 Mixed layer depth (m) +118 hhl Hybrid height level (-) +119 hpl Hybrid pressure level (-) +# 120-149 Reserved +150 150 Generalized vertical height coordinate +151 sol Soil level (Numeric) +152 sol Sea-ice level (Numeric) +# 153-159 Reserved +160 160 Depth below sea level (m) +161 161 Depth below water surface (m) +162 sfc Lake or river bottom (-) +163 163 Bottom of sediment layer (-) +164 164 Bottom of thermally active sediment layer (-) +165 165 Bottom of sediment layer penetrated by thermal wave (-) +166 sfc Mixing layer (-) +167 167 Bottom of root zone (-) +168 168 Ocean model level (Numeric) +169 169 Ocean level defined by water density (sigma-theta) difference from near-surface to level (kg m-3) +170 170 Ocean level defined by water potential temperature difference from near-surface to level (K) +171 171 Ocean level defined by vertical eddy diffusivity difference from near-surface to level (m2 s-1) +172 172 Ocean level defined by water density (rho) difference from near-surface to level (m) +173 173 Top of snow over sea ice on sea, lake or river +174 sfc Top surface of ice on sea, lake or river +175 175 Top surface of ice, under snow cover, on sea, lake or river +176 176 Bottom surface (underside) ice on sea, lake or river +177 sfc Deep soil (of indefinite depth) +# 178 Reserved +179 179 Top surface of glacier ice and inland ice +180 180 Deep inland or glacier ice (of indefinite depth) +181 181 Grid tile land fraction as a model surface +182 182 Grid tile water fraction as a model surface +183 183 Grid tile ice fraction on sea, lake or river as a model surface +184 184 Grid tile glacier ice and inland ice fraction as a model surface +185 185 Roof level +186 186 Wall level +187 187 Road level +188 188 Melt pond top surface +189 189 Melt pond bottom surface +# 190-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.6.table b/definitions/grib2/tables/33/4.6.table new file mode 100644 index 000000000..ce799721d --- /dev/null +++ b/definitions/grib2/tables/33/4.6.table @@ -0,0 +1,9 @@ +# Code table 4.6 - Type of ensemble forecast +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.7.table b/definitions/grib2/tables/33/4.7.table new file mode 100644 index 000000000..128fa317f --- /dev/null +++ b/definitions/grib2/tables/33/4.7.table @@ -0,0 +1,15 @@ +# Code table 4.7 - Derived forecast +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +10 10 Variance of all ensemble members +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.8.table b/definitions/grib2/tables/33/4.8.table new file mode 100644 index 000000000..78467454a --- /dev/null +++ b/definitions/grib2/tables/33/4.8.table @@ -0,0 +1,6 @@ +# Code table 4.8 - Clustering method +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.9.table b/definitions/grib2/tables/33/4.9.table new file mode 100644 index 000000000..8e481465e --- /dev/null +++ b/definitions/grib2/tables/33/4.9.table @@ -0,0 +1,14 @@ +# Code table 4.9 - Probability type +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +5 5 Probability of event equal to lower limit +6 6 Probability of event in above normal category +7 7 Probability of event in near normal category +8 8 Probability of event in below normal category +9 9 Probability based on counts of categorical boolean +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.91.table b/definitions/grib2/tables/33/4.91.table new file mode 100644 index 000000000..1a0f215f0 --- /dev/null +++ b/definitions/grib2/tables/33/4.91.table @@ -0,0 +1,16 @@ +# Code table 4.91 - Type of Interval +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit +11 11 Equal to first limit +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/5.0.table b/definitions/grib2/tables/33/5.0.table new file mode 100644 index 000000000..5e00004b0 --- /dev/null +++ b/definitions/grib2/tables/33/5.0.table @@ -0,0 +1,22 @@ +# Code table 5.0 - Data representation template number +0 0 Grid point data - simple packing +1 1 Matrix value at grid point - simple packing +2 2 Grid point data - complex packing +3 3 Grid point data - complex packing and spatial differencing +4 4 Grid point data - IEEE floating point data +# 5-39 Reserved +40 40 Grid point data - JPEG 2000 code stream format +41 41 Grid point data - Portable Network Graphics (PNG) +42 42 Grid point data - CCSDS recommended lossless compression +# 43-49 Reserved +50 50 Spectral data - simple packing +51 51 Spherical harmonics data - complex packing +# 52 Reserved +53 53 Spectral data for limited area models - complex packing +# 54-60 Reserved +61 61 Grid point data - simple packing with logarithm pre-processing +# 62-199 Reserved +200 200 Run length packing with level values +# 201-49151 Reserved +# 49152-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/33/5.1.table b/definitions/grib2/tables/33/5.1.table new file mode 100644 index 000000000..1189b5e46 --- /dev/null +++ b/definitions/grib2/tables/33/5.1.table @@ -0,0 +1,6 @@ +# Code table 5.1 - Type of original field values +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/5.2.table b/definitions/grib2/tables/33/5.2.table new file mode 100644 index 000000000..60d557a0d --- /dev/null +++ b/definitions/grib2/tables/33/5.2.table @@ -0,0 +1,8 @@ +# Code table 5.2 - Matrix coordinate value function definition +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/5.25.table b/definitions/grib2/tables/33/5.25.table new file mode 100644 index 000000000..79e9fd69a --- /dev/null +++ b/definitions/grib2/tables/33/5.25.table @@ -0,0 +1,9 @@ +# Code table 5.25 - type of bi-Fourier subtruncation +# 0-76 Reserved +77 77 Rectangular +# 78-87 Reserved +88 88 Elliptic +# 89-98 Reserved +99 99 Diamond +# 100-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/33/5.26.table b/definitions/grib2/tables/33/5.26.table new file mode 100644 index 000000000..298f3fcd0 --- /dev/null +++ b/definitions/grib2/tables/33/5.26.table @@ -0,0 +1,5 @@ +# Code table 5.26 - packing mode for axes +0 0 Spectral coefficients for axes are packed +1 1 Spectral coefficients for axes included in the unpacked subset +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/33/5.3.table b/definitions/grib2/tables/33/5.3.table new file mode 100644 index 000000000..481331791 --- /dev/null +++ b/definitions/grib2/tables/33/5.3.table @@ -0,0 +1,7 @@ +# Code table 5.3 - Matrix coordinate parameter +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/5.4.table b/definitions/grib2/tables/33/5.4.table new file mode 100644 index 000000000..e84ab1901 --- /dev/null +++ b/definitions/grib2/tables/33/5.4.table @@ -0,0 +1,6 @@ +# Code table 5.4 - Group splitting method +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/5.40.table b/definitions/grib2/tables/33/5.40.table new file mode 100644 index 000000000..97e8880ab --- /dev/null +++ b/definitions/grib2/tables/33/5.40.table @@ -0,0 +1,5 @@ +# Code table 5.40 - Type of compression +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/33/5.5.table b/definitions/grib2/tables/33/5.5.table new file mode 100644 index 000000000..f2316975a --- /dev/null +++ b/definitions/grib2/tables/33/5.5.table @@ -0,0 +1,7 @@ +# Code table 5.5 - Missing value management for complex packing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/5.6.table b/definitions/grib2/tables/33/5.6.table new file mode 100644 index 000000000..db68ead9c --- /dev/null +++ b/definitions/grib2/tables/33/5.6.table @@ -0,0 +1,7 @@ +# Code table 5.6 - Order of spatial differencing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/5.7.table b/definitions/grib2/tables/33/5.7.table new file mode 100644 index 000000000..e54862c19 --- /dev/null +++ b/definitions/grib2/tables/33/5.7.table @@ -0,0 +1,7 @@ +# Code table 5.7 - Precision of floating-point numbers +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/33/6.0.table b/definitions/grib2/tables/33/6.0.table new file mode 100644 index 000000000..a8f30f5a4 --- /dev/null +++ b/definitions/grib2/tables/33/6.0.table @@ -0,0 +1,6 @@ +# Code table 6.0 - Bit map indicator +0 0 A bit map applies to this product and is specified in this Section +1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product From 0615275b8f0b1b8d9a360cf52b0c8ad0ce7edb59 Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 23 Apr 2024 13:14:39 +0100 Subject: [PATCH 057/196] Definitions: CCT v2024-06-28 (Release Candidate) --- definitions/grib2/tables/33/4.230.table | 69 ++++++++++++++++++++++++- definitions/grib2/tables/33/4.233.table | 69 ++++++++++++++++++++++++- 2 files changed, 136 insertions(+), 2 deletions(-) diff --git a/definitions/grib2/tables/33/4.230.table b/definitions/grib2/tables/33/4.230.table index 705857e5c..1871fb176 100644 --- a/definitions/grib2/tables/33/4.230.table +++ b/definitions/grib2/tables/33/4.230.table @@ -424,7 +424,74 @@ 30296 30296 Lead Pb 30297 30297 Tellurium 131 Te-131 30298 30298 Neodymium 137 Nd-137 -# 30299-39999 Reserved +30299 30299 Pseudo radionuclide +30300 30300 Silver 112 Ag-112 +30301 30301 Silver 115 Ag-115 +30302 30302 Barium 139 Ba-139 +30303 30303 Barium 141 Ba-141 +30304 30304 Barium 142 Ba-142 +30305 30305 Bromine 84 Br-84 +30306 30306 Cadminum 115 Cd-115 +30307 30307 Cadminum 117 Cd-117 +30308 30308 Cadminum 117 metastable Cd-117m +30309 30309 Cerium 145 Ce-145 +30310 30310 Cerium 146 Ce-146 +30311 30311 Cobalt 58 metastable Co-58m +30312 30312 Ceasium 138 Cs-138 +30313 30313 Ceasium 139 Cs-139 +30314 30314 Iodine 130 aerosol I-130a +30315 30315 Iodine 130 elementary gaseous I-130e +30316 30316 Iodine 130 organic bounded I-130o +30317 30317 Iodine 132 metastable I-132m +30318 30318 Iodine 134 metastable I-134m +30319 30319 Indium 115 metastable In-115m +30320 30320 Indium 117 metastable In-117m +30321 30321 Krypton 83 metastable Kr-83m +30322 30322 Lanthanum 142 La-142 +30323 30323 Lanthanum 143 La-143 +30324 30324 Manganese 56 Mn-56 +30325 30325 Molybdenum 101 Mo-101 +30326 30326 Molybdenum 102 Mo-102 +30327 30327 Neodymium 149 Nd-149 +30328 30328 Neodymium 151 Nd-151 +30329 30329 Palladium 109 Pd-109 +30330 30330 Palladium 112 Pd-112 +30331 30331 Praseodymium 145 Pr-145 +30332 30332 Praseodymium 146 Pr-146 +30333 30333 Praseodymium 147 Pr-147 +30334 30334 Rubidium 89 Rb-89 +30335 30335 Rubidium 90 Rb-90 +30336 30336 Rubidium 90 metastable Rb-90m +30337 30337 Rhodium 105 metastable Rh-105m +30338 30338 Rhodium 107 Rh-107 +30339 30339 Antimony 128 Sb-128 +30340 30340 Antimony 128 metastable Sb-128m +30341 30341 Antimony 129 metastable Sb-129m +30342 30342 Antimony 130 Sb-130 +30343 30343 Antimony 130 metastable Sb-130m +30344 30344 Antimony 131 Sb-131 +30345 30345 Antimony 132 Sb-132 +30346 30346 Antimony 132 metastable Sb-132m +30347 30347 Antimony 133 Sb-133 +30348 30348 Selenium 83 Se-83 +30349 30349 Tin 127 Sn-127 +30350 30350 Tin 127 metastable Sn-127m +30351 30351 Tin 128 Sn-128 +30352 30352 Tin 129 metastable Sn-129m +30353 30353 Tin 130 Sn-130 +30354 30354 Strontium 93 Sr-93 +30355 30355 Technetium 101 Tc-101 +30356 30356 Technetium 102 Tc-102 +30357 30357 Technetium 104 Tc-104 +30358 30358 Technetium 105 Tc-105 +30359 30359 Tellurium 133 Te-133 +30360 30360 Tellurium 133 metastable Te-133m +30361 30361 Tellurium 134 Te-134 +30362 30362 Yttrium 93 metastable Y-93m +30363 30363 Yttrium 94 Y-94 +30364 30364 Yttrium 95 Y-95 +30365 30365 Zirconium 96 Zr-96 +# 30366-39999 Reserved 40000 40000 Singlet sigma oxygen (dioxygen (sigma singlet)) O2 40001 40001 Singlet delta oxygen (dioxygen (delta singlet)) O2 40002 40002 Singlet excited oxygen atom O(1D) diff --git a/definitions/grib2/tables/33/4.233.table b/definitions/grib2/tables/33/4.233.table index e4960cc1b..00b837c93 100644 --- a/definitions/grib2/tables/33/4.233.table +++ b/definitions/grib2/tables/33/4.233.table @@ -424,7 +424,74 @@ 30296 30296 Lead Pb 30297 30297 Tellurium 131 Te-131 30298 30298 Neodymium 137 Nd-137 -# 30299-39999 Reserved +30299 30299 Pseudo radionuclide +30300 30300 Silver 112 Ag-112 +30301 30301 Silver 115 Ag-115 +30302 30302 Barium 139 Ba-139 +30303 30303 Barium 141 Ba-141 +30304 30304 Barium 142 Ba-142 +30305 30305 Bromine 84 Br-84 +30306 30306 Cadminum 115 Cd-115 +30307 30307 Cadminum 117 Cd-117 +30308 30308 Cadminum 117 metastable Cd-117m +30309 30309 Cerium 145 Ce-145 +30310 30310 Cerium 146 Ce-146 +30311 30311 Cobalt 58 metastable Co-58m +30312 30312 Ceasium 138 Cs-138 +30313 30313 Ceasium 139 Cs-139 +30314 30314 Iodine 130 aerosol I-130a +30315 30315 Iodine 130 elementary gaseous I-130e +30316 30316 Iodine 130 organic bounded I-130o +30317 30317 Iodine 132 metastable I-132m +30318 30318 Iodine 134 metastable I-134m +30319 30319 Indium 115 metastable In-115m +30320 30320 Indium 117 metastable In-117m +30321 30321 Krypton 83 metastable Kr-83m +30322 30322 Lanthanum 142 La-142 +30323 30323 Lanthanum 143 La-143 +30324 30324 Manganese 56 Mn-56 +30325 30325 Molybdenum 101 Mo-101 +30326 30326 Molybdenum 102 Mo-102 +30327 30327 Neodymium 149 Nd-149 +30328 30328 Neodymium 151 Nd-151 +30329 30329 Palladium 109 Pd-109 +30330 30330 Palladium 112 Pd-112 +30331 30331 Praseodymium 145 Pr-145 +30332 30332 Praseodymium 146 Pr-146 +30333 30333 Praseodymium 147 Pr-147 +30334 30334 Rubidium 89 Rb-89 +30335 30335 Rubidium 90 Rb-90 +30336 30336 Rubidium 90 metastable Rb-90m +30337 30337 Rhodium 105 metastable Rh-105m +30338 30338 Rhodium 107 Rh-107 +30339 30339 Antimony 128 Sb-128 +30340 30340 Antimony 128 metastable Sb-128m +30341 30341 Antimony 129 metastable Sb-129m +30342 30342 Antimony 130 Sb-130 +30343 30343 Antimony 130 metastable Sb-130m +30344 30344 Antimony 131 Sb-131 +30345 30345 Antimony 132 Sb-132 +30346 30346 Antimony 132 metastable Sb-132m +30347 30347 Antimony 133 Sb-133 +30348 30348 Selenium 83 Se-83 +30349 30349 Tin 127 Sn-127 +30350 30350 Tin 127 metastable Sn-127m +30351 30351 Tin 128 Sn-128 +30352 30352 Tin 129 metastable Sn-129m +30353 30353 Tin 130 Sn-130 +30354 30354 Strontium 93 Sr-93 +30355 30355 Technetium 101 Tc-101 +30356 30356 Technetium 102 Tc-102 +30357 30357 Technetium 104 Tc-104 +30358 30358 Technetium 105 Tc-105 +30359 30359 Tellurium 133 Te-133 +30360 30360 Tellurium 133 metastable Te-133m +30361 30361 Tellurium 134 Te-134 +30362 30362 Yttrium 93 metastable Y-93m +30363 30363 Yttrium 94 Y-94 +30364 30364 Yttrium 95 Y-95 +30365 30365 Zirconium 96 Zr-96 +# 30366-39999 Reserved 40000 40000 Singlet sigma oxygen (dioxygen (sigma singlet)) O2 40001 40001 Singlet delta oxygen (dioxygen (delta singlet)) O2 40002 40002 Singlet excited oxygen atom O(1D) From df968b0189ad31082345e8ea22ed1e256099f44e Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 23 Apr 2024 13:32:11 +0100 Subject: [PATCH 058/196] Definitions: Cleanup --- definitions/grib2/section.1.def | 10 +- definitions/grib2/tables/0/1.1.table | 2 +- definitions/grib2/tables/0/4.2.0.20.table | 2 +- definitions/grib2/tables/0/4.5.table | 20 +-- definitions/grib2/tables/1/1.1.table | 2 +- definitions/grib2/tables/1/4.5.table | 16 +-- definitions/grib2/tables/10/0.0.table | 18 +-- definitions/grib2/tables/10/1.1.table | 6 +- definitions/grib2/tables/10/1.2.table | 14 +- definitions/grib2/tables/10/1.3.table | 18 +-- definitions/grib2/tables/10/1.4.table | 24 ++-- definitions/grib2/tables/10/3.0.table | 8 +- definitions/grib2/tables/10/3.10.table | 14 +- definitions/grib2/tables/10/3.11.table | 2 +- definitions/grib2/tables/10/3.15.table | 18 +-- definitions/grib2/tables/10/3.2.table | 24 ++-- definitions/grib2/tables/10/3.20.table | 10 +- definitions/grib2/tables/10/3.21.table | 14 +- definitions/grib2/tables/10/3.3.table | 16 +-- definitions/grib2/tables/10/3.4.table | 18 +-- definitions/grib2/tables/10/3.5.table | 8 +- definitions/grib2/tables/10/3.7.table | 6 +- definitions/grib2/tables/10/3.8.table | 12 +- definitions/grib2/tables/10/3.9.table | 6 +- definitions/grib2/tables/10/4.0.table | 78 +++++------ definitions/grib2/tables/10/4.1.0.table | 52 ++++---- definitions/grib2/tables/10/4.1.1.table | 12 +- definitions/grib2/tables/10/4.1.10.table | 18 +-- definitions/grib2/tables/10/4.1.2.table | 16 +-- definitions/grib2/tables/10/4.1.3.table | 10 +- definitions/grib2/tables/10/4.10.table | 30 ++--- definitions/grib2/tables/10/4.11.table | 18 +-- definitions/grib2/tables/10/4.12.table | 12 +- definitions/grib2/tables/10/4.13.table | 10 +- definitions/grib2/tables/10/4.14.table | 10 +- definitions/grib2/tables/10/4.15.table | 20 +-- definitions/grib2/tables/10/4.2.0.0.table | 6 +- definitions/grib2/tables/10/4.2.0.1.table | 10 +- definitions/grib2/tables/10/4.2.0.13.table | 6 +- definitions/grib2/tables/10/4.2.0.14.table | 6 +- definitions/grib2/tables/10/4.2.0.15.table | 6 +- definitions/grib2/tables/10/4.2.0.16.table | 6 +- definitions/grib2/tables/10/4.2.0.18.table | 8 +- definitions/grib2/tables/10/4.2.0.19.table | 6 +- definitions/grib2/tables/10/4.2.0.190.table | 6 +- definitions/grib2/tables/10/4.2.0.191.table | 6 +- definitions/grib2/tables/10/4.2.0.2.table | 6 +- definitions/grib2/tables/10/4.2.0.20.table | 10 +- definitions/grib2/tables/10/4.2.0.3.table | 6 +- definitions/grib2/tables/10/4.2.0.4.table | 8 +- definitions/grib2/tables/10/4.2.0.5.table | 6 +- definitions/grib2/tables/10/4.2.0.6.table | 6 +- definitions/grib2/tables/10/4.2.0.7.table | 8 +- definitions/grib2/tables/10/4.2.1.0.table | 6 +- definitions/grib2/tables/10/4.2.1.1.table | 6 +- definitions/grib2/tables/10/4.2.10.0.table | 6 +- definitions/grib2/tables/10/4.2.10.1.table | 6 +- definitions/grib2/tables/10/4.2.10.191.table | 6 +- definitions/grib2/tables/10/4.2.10.2.table | 6 +- definitions/grib2/tables/10/4.2.10.3.table | 6 +- definitions/grib2/tables/10/4.2.10.4.table | 8 +- definitions/grib2/tables/10/4.2.2.0.table | 6 +- definitions/grib2/tables/10/4.2.2.3.table | 6 +- definitions/grib2/tables/10/4.2.2.4.table | 4 +- definitions/grib2/tables/10/4.2.3.0.table | 6 +- definitions/grib2/tables/10/4.2.3.1.table | 10 +- definitions/grib2/tables/10/4.201.table | 18 +-- definitions/grib2/tables/10/4.202.table | 6 +- definitions/grib2/tables/10/4.203.table | 50 +++---- definitions/grib2/tables/10/4.204.table | 16 +-- definitions/grib2/tables/10/4.205.table | 10 +- definitions/grib2/tables/10/4.206.table | 10 +- definitions/grib2/tables/10/4.207.table | 18 +-- definitions/grib2/tables/10/4.208.table | 16 +-- definitions/grib2/tables/10/4.209.table | 16 +-- definitions/grib2/tables/10/4.210.table | 10 +- definitions/grib2/tables/10/4.211.table | 12 +- definitions/grib2/tables/10/4.212.table | 34 ++--- definitions/grib2/tables/10/4.213.table | 30 ++--- definitions/grib2/tables/10/4.215.table | 16 +-- definitions/grib2/tables/10/4.216.table | 6 +- definitions/grib2/tables/10/4.217.table | 14 +- definitions/grib2/tables/10/4.218.table | 74 +++++------ definitions/grib2/tables/10/4.219.table | 14 +- definitions/grib2/tables/10/4.220.table | 10 +- definitions/grib2/tables/10/4.221.table | 10 +- definitions/grib2/tables/10/4.222.table | 10 +- definitions/grib2/tables/10/4.223.table | 8 +- definitions/grib2/tables/10/4.224.table | 34 ++--- definitions/grib2/tables/10/4.227.table | 2 +- definitions/grib2/tables/10/4.3.table | 30 ++--- definitions/grib2/tables/10/4.4.table | 32 ++--- definitions/grib2/tables/10/4.5.table | 18 +-- definitions/grib2/tables/10/4.6.table | 16 +-- definitions/grib2/tables/10/4.7.table | 26 ++-- definitions/grib2/tables/10/4.8.table | 10 +- definitions/grib2/tables/10/4.9.table | 16 +-- definitions/grib2/tables/10/4.91.table | 28 ++-- definitions/grib2/tables/10/5.1.table | 10 +- definitions/grib2/tables/10/5.2.table | 10 +- definitions/grib2/tables/10/5.3.table | 12 +- definitions/grib2/tables/10/5.4.table | 10 +- definitions/grib2/tables/10/5.40.table | 8 +- definitions/grib2/tables/10/5.5.table | 12 +- definitions/grib2/tables/10/5.6.table | 12 +- definitions/grib2/tables/10/5.7.table | 12 +- definitions/grib2/tables/10/6.0.table | 6 +- definitions/grib2/tables/11/0.0.table | 18 +-- definitions/grib2/tables/11/1.1.table | 6 +- definitions/grib2/tables/11/1.2.table | 14 +- definitions/grib2/tables/11/1.3.table | 14 +- definitions/grib2/tables/11/1.4.table | 24 ++-- definitions/grib2/tables/11/3.0.table | 8 +- definitions/grib2/tables/11/3.10.table | 14 +- definitions/grib2/tables/11/3.11.table | 12 +- definitions/grib2/tables/11/3.15.table | 20 +-- definitions/grib2/tables/11/3.2.table | 24 ++-- definitions/grib2/tables/11/3.20.table | 10 +- definitions/grib2/tables/11/3.21.table | 14 +- definitions/grib2/tables/11/3.3.table | 16 +-- definitions/grib2/tables/11/3.4.table | 18 +-- definitions/grib2/tables/11/3.5.table | 8 +- definitions/grib2/tables/11/3.7.table | 6 +- definitions/grib2/tables/11/3.8.table | 12 +- definitions/grib2/tables/11/3.9.table | 6 +- definitions/grib2/tables/11/4.0.table | 86 ++++++------ definitions/grib2/tables/11/4.1.0.table | 52 ++++---- definitions/grib2/tables/11/4.1.1.table | 12 +- definitions/grib2/tables/11/4.1.10.table | 18 +-- definitions/grib2/tables/11/4.1.2.table | 16 +-- definitions/grib2/tables/11/4.1.3.table | 10 +- definitions/grib2/tables/11/4.10.table | 30 ++--- definitions/grib2/tables/11/4.11.table | 18 +-- definitions/grib2/tables/11/4.12.table | 12 +- definitions/grib2/tables/11/4.13.table | 10 +- definitions/grib2/tables/11/4.14.table | 10 +- definitions/grib2/tables/11/4.15.table | 20 +-- definitions/grib2/tables/11/4.2.0.0.table | 6 +- definitions/grib2/tables/11/4.2.0.1.table | 10 +- definitions/grib2/tables/11/4.2.0.13.table | 6 +- definitions/grib2/tables/11/4.2.0.14.table | 6 +- definitions/grib2/tables/11/4.2.0.15.table | 6 +- definitions/grib2/tables/11/4.2.0.16.table | 6 +- definitions/grib2/tables/11/4.2.0.18.table | 8 +- definitions/grib2/tables/11/4.2.0.19.table | 6 +- definitions/grib2/tables/11/4.2.0.190.table | 6 +- definitions/grib2/tables/11/4.2.0.191.table | 6 +- definitions/grib2/tables/11/4.2.0.2.table | 6 +- definitions/grib2/tables/11/4.2.0.20.table | 10 +- definitions/grib2/tables/11/4.2.0.3.table | 6 +- definitions/grib2/tables/11/4.2.0.4.table | 8 +- definitions/grib2/tables/11/4.2.0.5.table | 6 +- definitions/grib2/tables/11/4.2.0.6.table | 6 +- definitions/grib2/tables/11/4.2.0.7.table | 8 +- definitions/grib2/tables/11/4.2.1.0.table | 6 +- definitions/grib2/tables/11/4.2.1.1.table | 6 +- definitions/grib2/tables/11/4.2.10.0.table | 6 +- definitions/grib2/tables/11/4.2.10.1.table | 6 +- definitions/grib2/tables/11/4.2.10.191.table | 6 +- definitions/grib2/tables/11/4.2.10.2.table | 6 +- definitions/grib2/tables/11/4.2.10.3.table | 6 +- definitions/grib2/tables/11/4.2.10.4.table | 8 +- definitions/grib2/tables/11/4.2.2.0.table | 6 +- definitions/grib2/tables/11/4.2.2.3.table | 6 +- definitions/grib2/tables/11/4.2.2.4.table | 4 +- definitions/grib2/tables/11/4.2.3.0.table | 6 +- definitions/grib2/tables/11/4.2.3.1.table | 10 +- definitions/grib2/tables/11/4.201.table | 18 +-- definitions/grib2/tables/11/4.202.table | 6 +- definitions/grib2/tables/11/4.203.table | 50 +++---- definitions/grib2/tables/11/4.204.table | 16 +-- definitions/grib2/tables/11/4.205.table | 10 +- definitions/grib2/tables/11/4.206.table | 10 +- definitions/grib2/tables/11/4.207.table | 18 +-- definitions/grib2/tables/11/4.208.table | 16 +-- definitions/grib2/tables/11/4.209.table | 16 +-- definitions/grib2/tables/11/4.210.table | 10 +- definitions/grib2/tables/11/4.211.table | 12 +- definitions/grib2/tables/11/4.212.table | 34 ++--- definitions/grib2/tables/11/4.213.table | 30 ++--- definitions/grib2/tables/11/4.215.table | 16 +-- definitions/grib2/tables/11/4.216.table | 6 +- definitions/grib2/tables/11/4.217.table | 14 +- definitions/grib2/tables/11/4.218.table | 74 +++++------ definitions/grib2/tables/11/4.219.table | 14 +- definitions/grib2/tables/11/4.220.table | 10 +- definitions/grib2/tables/11/4.221.table | 10 +- definitions/grib2/tables/11/4.222.table | 10 +- definitions/grib2/tables/11/4.223.table | 8 +- definitions/grib2/tables/11/4.224.table | 34 ++--- definitions/grib2/tables/11/4.227.table | 2 +- definitions/grib2/tables/11/4.234.table | 8 +- definitions/grib2/tables/11/4.3.table | 30 ++--- definitions/grib2/tables/11/4.4.table | 32 ++--- definitions/grib2/tables/11/4.5.table | 18 +-- definitions/grib2/tables/11/4.6.table | 16 +-- definitions/grib2/tables/11/4.7.table | 26 ++-- definitions/grib2/tables/11/4.8.table | 10 +- definitions/grib2/tables/11/4.9.table | 16 +-- definitions/grib2/tables/11/4.91.table | 28 ++-- definitions/grib2/tables/11/5.1.table | 10 +- definitions/grib2/tables/11/5.2.table | 10 +- definitions/grib2/tables/11/5.3.table | 12 +- definitions/grib2/tables/11/5.4.table | 10 +- definitions/grib2/tables/11/5.40.table | 8 +- definitions/grib2/tables/11/5.5.table | 12 +- definitions/grib2/tables/11/5.6.table | 12 +- definitions/grib2/tables/11/5.7.table | 12 +- definitions/grib2/tables/11/6.0.table | 6 +- definitions/grib2/tables/12/0.0.table | 18 +-- definitions/grib2/tables/12/1.0.table | 24 ++-- definitions/grib2/tables/12/1.1.table | 6 +- definitions/grib2/tables/12/1.2.table | 14 +- definitions/grib2/tables/12/1.3.table | 14 +- definitions/grib2/tables/12/1.4.table | 24 ++-- definitions/grib2/tables/12/1.5.table | 12 +- definitions/grib2/tables/12/1.6.table | 14 +- definitions/grib2/tables/12/3.0.table | 8 +- definitions/grib2/tables/12/3.10.table | 14 +- definitions/grib2/tables/12/3.11.table | 12 +- definitions/grib2/tables/12/3.15.table | 20 +-- definitions/grib2/tables/12/3.2.table | 26 ++-- definitions/grib2/tables/12/3.20.table | 10 +- definitions/grib2/tables/12/3.21.table | 14 +- definitions/grib2/tables/12/3.3.table | 16 +-- definitions/grib2/tables/12/3.4.table | 18 +-- definitions/grib2/tables/12/3.5.table | 8 +- definitions/grib2/tables/12/3.7.table | 6 +- definitions/grib2/tables/12/3.8.table | 12 +- definitions/grib2/tables/12/3.9.table | 6 +- definitions/grib2/tables/12/4.0.table | 106 +++++++-------- definitions/grib2/tables/12/4.1.0.table | 52 ++++---- definitions/grib2/tables/12/4.1.1.table | 12 +- definitions/grib2/tables/12/4.1.10.table | 18 +-- definitions/grib2/tables/12/4.1.2.table | 16 +-- definitions/grib2/tables/12/4.1.3.table | 10 +- definitions/grib2/tables/12/4.10.table | 30 ++--- definitions/grib2/tables/12/4.11.table | 18 +-- definitions/grib2/tables/12/4.12.table | 12 +- definitions/grib2/tables/12/4.13.table | 10 +- definitions/grib2/tables/12/4.14.table | 10 +- definitions/grib2/tables/12/4.15.table | 20 +-- definitions/grib2/tables/12/4.2.0.0.table | 6 +- definitions/grib2/tables/12/4.2.0.1.table | 10 +- definitions/grib2/tables/12/4.2.0.13.table | 6 +- definitions/grib2/tables/12/4.2.0.14.table | 6 +- definitions/grib2/tables/12/4.2.0.15.table | 6 +- definitions/grib2/tables/12/4.2.0.16.table | 6 +- definitions/grib2/tables/12/4.2.0.18.table | 8 +- definitions/grib2/tables/12/4.2.0.19.table | 6 +- definitions/grib2/tables/12/4.2.0.190.table | 6 +- definitions/grib2/tables/12/4.2.0.191.table | 6 +- definitions/grib2/tables/12/4.2.0.2.table | 6 +- definitions/grib2/tables/12/4.2.0.20.table | 10 +- definitions/grib2/tables/12/4.2.0.3.table | 6 +- definitions/grib2/tables/12/4.2.0.4.table | 8 +- definitions/grib2/tables/12/4.2.0.5.table | 6 +- definitions/grib2/tables/12/4.2.0.6.table | 6 +- definitions/grib2/tables/12/4.2.0.7.table | 8 +- definitions/grib2/tables/12/4.2.1.0.table | 6 +- definitions/grib2/tables/12/4.2.1.1.table | 6 +- definitions/grib2/tables/12/4.2.10.0.table | 6 +- definitions/grib2/tables/12/4.2.10.1.table | 6 +- definitions/grib2/tables/12/4.2.10.191.table | 6 +- definitions/grib2/tables/12/4.2.10.2.table | 6 +- definitions/grib2/tables/12/4.2.10.3.table | 6 +- definitions/grib2/tables/12/4.2.10.4.table | 8 +- definitions/grib2/tables/12/4.2.2.0.table | 6 +- definitions/grib2/tables/12/4.2.2.3.table | 6 +- definitions/grib2/tables/12/4.2.2.4.table | 6 +- definitions/grib2/tables/12/4.2.3.0.table | 6 +- definitions/grib2/tables/12/4.2.3.1.table | 10 +- definitions/grib2/tables/12/4.201.table | 6 +- definitions/grib2/tables/12/4.202.table | 6 +- definitions/grib2/tables/12/4.203.table | 50 +++---- definitions/grib2/tables/12/4.204.table | 16 +-- definitions/grib2/tables/12/4.205.table | 10 +- definitions/grib2/tables/12/4.206.table | 10 +- definitions/grib2/tables/12/4.207.table | 18 +-- definitions/grib2/tables/12/4.208.table | 16 +-- definitions/grib2/tables/12/4.209.table | 16 +-- definitions/grib2/tables/12/4.210.table | 10 +- definitions/grib2/tables/12/4.211.table | 12 +- definitions/grib2/tables/12/4.212.table | 34 ++--- definitions/grib2/tables/12/4.213.table | 30 ++--- definitions/grib2/tables/12/4.215.table | 16 +-- definitions/grib2/tables/12/4.216.table | 6 +- definitions/grib2/tables/12/4.217.table | 14 +- definitions/grib2/tables/12/4.218.table | 74 +++++------ definitions/grib2/tables/12/4.219.table | 14 +- definitions/grib2/tables/12/4.220.table | 10 +- definitions/grib2/tables/12/4.221.table | 10 +- definitions/grib2/tables/12/4.222.table | 10 +- definitions/grib2/tables/12/4.223.table | 8 +- definitions/grib2/tables/12/4.224.table | 34 ++--- definitions/grib2/tables/12/4.227.table | 16 +-- definitions/grib2/tables/12/4.234.table | 40 +++--- definitions/grib2/tables/12/4.236.table | 14 +- definitions/grib2/tables/12/4.3.table | 30 ++--- definitions/grib2/tables/12/4.4.table | 32 ++--- definitions/grib2/tables/12/4.5.table | 18 +-- definitions/grib2/tables/12/4.6.table | 16 +-- definitions/grib2/tables/12/4.7.table | 26 ++-- definitions/grib2/tables/12/4.8.table | 10 +- definitions/grib2/tables/12/4.9.table | 16 +-- definitions/grib2/tables/12/4.91.table | 28 ++-- definitions/grib2/tables/12/5.1.table | 10 +- definitions/grib2/tables/12/5.2.table | 10 +- definitions/grib2/tables/12/5.3.table | 12 +- definitions/grib2/tables/12/5.4.table | 10 +- definitions/grib2/tables/12/5.40.table | 8 +- definitions/grib2/tables/12/5.5.table | 12 +- definitions/grib2/tables/12/5.6.table | 12 +- definitions/grib2/tables/12/5.7.table | 12 +- definitions/grib2/tables/12/6.0.table | 6 +- definitions/grib2/tables/13/0.0.table | 18 +-- definitions/grib2/tables/13/1.0.table | 22 ++-- definitions/grib2/tables/13/1.1.table | 6 +- definitions/grib2/tables/13/1.2.table | 14 +- definitions/grib2/tables/13/1.3.table | 14 +- definitions/grib2/tables/13/1.4.table | 24 ++-- definitions/grib2/tables/13/1.5.table | 12 +- definitions/grib2/tables/13/1.6.table | 14 +- definitions/grib2/tables/13/3.0.table | 8 +- definitions/grib2/tables/13/3.10.table | 14 +- definitions/grib2/tables/13/3.11.table | 12 +- definitions/grib2/tables/13/3.15.table | 20 +-- definitions/grib2/tables/13/3.2.table | 26 ++-- definitions/grib2/tables/13/3.20.table | 10 +- definitions/grib2/tables/13/3.21.table | 14 +- definitions/grib2/tables/13/3.3.table | 16 +-- definitions/grib2/tables/13/3.4.table | 18 +-- definitions/grib2/tables/13/3.5.table | 8 +- definitions/grib2/tables/13/3.7.table | 6 +- definitions/grib2/tables/13/3.8.table | 12 +- definitions/grib2/tables/13/3.9.table | 6 +- definitions/grib2/tables/13/4.0.table | 108 +++++++-------- definitions/grib2/tables/13/4.1.0.table | 52 ++++---- definitions/grib2/tables/13/4.1.1.table | 12 +- definitions/grib2/tables/13/4.1.10.table | 18 +-- definitions/grib2/tables/13/4.1.2.table | 16 +-- definitions/grib2/tables/13/4.1.3.table | 10 +- definitions/grib2/tables/13/4.10.table | 30 ++--- definitions/grib2/tables/13/4.11.table | 18 +-- definitions/grib2/tables/13/4.12.table | 12 +- definitions/grib2/tables/13/4.13.table | 10 +- definitions/grib2/tables/13/4.14.table | 10 +- definitions/grib2/tables/13/4.15.table | 20 +-- definitions/grib2/tables/13/4.2.0.0.table | 4 +- definitions/grib2/tables/13/4.2.0.1.table | 10 +- definitions/grib2/tables/13/4.2.0.13.table | 6 +- definitions/grib2/tables/13/4.2.0.14.table | 6 +- definitions/grib2/tables/13/4.2.0.15.table | 6 +- definitions/grib2/tables/13/4.2.0.16.table | 6 +- definitions/grib2/tables/13/4.2.0.18.table | 8 +- definitions/grib2/tables/13/4.2.0.19.table | 6 +- definitions/grib2/tables/13/4.2.0.190.table | 6 +- definitions/grib2/tables/13/4.2.0.191.table | 6 +- definitions/grib2/tables/13/4.2.0.2.table | 6 +- definitions/grib2/tables/13/4.2.0.20.table | 10 +- definitions/grib2/tables/13/4.2.0.3.table | 6 +- definitions/grib2/tables/13/4.2.0.4.table | 8 +- definitions/grib2/tables/13/4.2.0.5.table | 6 +- definitions/grib2/tables/13/4.2.0.6.table | 6 +- definitions/grib2/tables/13/4.2.0.7.table | 8 +- definitions/grib2/tables/13/4.2.1.0.table | 6 +- definitions/grib2/tables/13/4.2.1.1.table | 6 +- definitions/grib2/tables/13/4.2.10.0.table | 6 +- definitions/grib2/tables/13/4.2.10.1.table | 6 +- definitions/grib2/tables/13/4.2.10.191.table | 6 +- definitions/grib2/tables/13/4.2.10.2.table | 6 +- definitions/grib2/tables/13/4.2.10.3.table | 6 +- definitions/grib2/tables/13/4.2.10.4.table | 8 +- definitions/grib2/tables/13/4.2.2.0.table | 6 +- definitions/grib2/tables/13/4.2.2.3.table | 6 +- definitions/grib2/tables/13/4.2.2.4.table | 6 +- definitions/grib2/tables/13/4.2.3.0.table | 6 +- definitions/grib2/tables/13/4.2.3.1.table | 10 +- definitions/grib2/tables/13/4.201.table | 6 +- definitions/grib2/tables/13/4.202.table | 6 +- definitions/grib2/tables/13/4.203.table | 50 +++---- definitions/grib2/tables/13/4.204.table | 16 +-- definitions/grib2/tables/13/4.205.table | 10 +- definitions/grib2/tables/13/4.206.table | 10 +- definitions/grib2/tables/13/4.207.table | 18 +-- definitions/grib2/tables/13/4.208.table | 16 +-- definitions/grib2/tables/13/4.209.table | 16 +-- definitions/grib2/tables/13/4.210.table | 10 +- definitions/grib2/tables/13/4.211.table | 12 +- definitions/grib2/tables/13/4.212.table | 34 ++--- definitions/grib2/tables/13/4.213.table | 30 ++--- definitions/grib2/tables/13/4.215.table | 16 +-- definitions/grib2/tables/13/4.216.table | 6 +- definitions/grib2/tables/13/4.217.table | 14 +- definitions/grib2/tables/13/4.218.table | 74 +++++------ definitions/grib2/tables/13/4.219.table | 14 +- definitions/grib2/tables/13/4.220.table | 10 +- definitions/grib2/tables/13/4.221.table | 10 +- definitions/grib2/tables/13/4.222.table | 10 +- definitions/grib2/tables/13/4.223.table | 8 +- definitions/grib2/tables/13/4.224.table | 34 ++--- definitions/grib2/tables/13/4.227.table | 16 +-- definitions/grib2/tables/13/4.234.table | 40 +++--- definitions/grib2/tables/13/4.236.table | 14 +- definitions/grib2/tables/13/4.3.table | 30 ++--- definitions/grib2/tables/13/4.4.table | 32 ++--- definitions/grib2/tables/13/4.5.table | 18 +-- definitions/grib2/tables/13/4.6.table | 16 +-- definitions/grib2/tables/13/4.7.table | 26 ++-- definitions/grib2/tables/13/4.8.table | 10 +- definitions/grib2/tables/13/4.9.table | 16 +-- definitions/grib2/tables/13/4.91.table | 28 ++-- definitions/grib2/tables/13/5.1.table | 10 +- definitions/grib2/tables/13/5.2.table | 10 +- definitions/grib2/tables/13/5.3.table | 12 +- definitions/grib2/tables/13/5.4.table | 10 +- definitions/grib2/tables/13/5.40.table | 8 +- definitions/grib2/tables/13/5.5.table | 12 +- definitions/grib2/tables/13/5.6.table | 12 +- definitions/grib2/tables/13/5.7.table | 12 +- definitions/grib2/tables/13/6.0.table | 6 +- definitions/grib2/tables/14/0.0.table | 18 +-- definitions/grib2/tables/14/1.0.table | 36 ++--- definitions/grib2/tables/14/1.1.table | 6 +- definitions/grib2/tables/14/1.2.table | 14 +- definitions/grib2/tables/14/1.3.table | 14 +- definitions/grib2/tables/14/1.4.table | 24 ++-- definitions/grib2/tables/14/1.5.table | 12 +- definitions/grib2/tables/14/1.6.table | 14 +- definitions/grib2/tables/14/3.0.table | 8 +- definitions/grib2/tables/14/3.10.table | 14 +- definitions/grib2/tables/14/3.11.table | 12 +- definitions/grib2/tables/14/3.15.table | 20 +-- definitions/grib2/tables/14/3.2.table | 26 ++-- definitions/grib2/tables/14/3.20.table | 10 +- definitions/grib2/tables/14/3.21.table | 14 +- definitions/grib2/tables/14/3.3.table | 16 +-- definitions/grib2/tables/14/3.4.table | 32 ++--- definitions/grib2/tables/14/3.5.table | 8 +- definitions/grib2/tables/14/3.7.table | 6 +- definitions/grib2/tables/14/3.8.table | 12 +- definitions/grib2/tables/14/3.9.table | 6 +- definitions/grib2/tables/14/4.0.table | 110 ++++++++-------- definitions/grib2/tables/14/4.1.0.table | 52 ++++---- definitions/grib2/tables/14/4.1.1.table | 12 +- definitions/grib2/tables/14/4.1.10.table | 18 +-- definitions/grib2/tables/14/4.1.2.table | 16 +-- definitions/grib2/tables/14/4.1.3.table | 10 +- definitions/grib2/tables/14/4.10.table | 30 ++--- definitions/grib2/tables/14/4.11.table | 18 +-- definitions/grib2/tables/14/4.12.table | 12 +- definitions/grib2/tables/14/4.13.table | 10 +- definitions/grib2/tables/14/4.14.table | 10 +- definitions/grib2/tables/14/4.15.table | 20 +-- definitions/grib2/tables/14/4.2.0.0.table | 6 +- definitions/grib2/tables/14/4.2.0.1.table | 10 +- definitions/grib2/tables/14/4.2.0.13.table | 6 +- definitions/grib2/tables/14/4.2.0.14.table | 6 +- definitions/grib2/tables/14/4.2.0.15.table | 6 +- definitions/grib2/tables/14/4.2.0.16.table | 6 +- definitions/grib2/tables/14/4.2.0.18.table | 8 +- definitions/grib2/tables/14/4.2.0.19.table | 6 +- definitions/grib2/tables/14/4.2.0.190.table | 6 +- definitions/grib2/tables/14/4.2.0.191.table | 6 +- definitions/grib2/tables/14/4.2.0.2.table | 6 +- definitions/grib2/tables/14/4.2.0.20.table | 10 +- definitions/grib2/tables/14/4.2.0.3.table | 6 +- definitions/grib2/tables/14/4.2.0.4.table | 8 +- definitions/grib2/tables/14/4.2.0.5.table | 6 +- definitions/grib2/tables/14/4.2.0.6.table | 6 +- definitions/grib2/tables/14/4.2.0.7.table | 8 +- definitions/grib2/tables/14/4.2.1.0.table | 6 +- definitions/grib2/tables/14/4.2.1.1.table | 6 +- definitions/grib2/tables/14/4.2.10.0.table | 6 +- definitions/grib2/tables/14/4.2.10.1.table | 6 +- definitions/grib2/tables/14/4.2.10.191.table | 8 +- definitions/grib2/tables/14/4.2.10.2.table | 6 +- definitions/grib2/tables/14/4.2.10.3.table | 6 +- definitions/grib2/tables/14/4.2.10.4.table | 8 +- definitions/grib2/tables/14/4.2.2.0.table | 6 +- definitions/grib2/tables/14/4.2.2.3.table | 6 +- definitions/grib2/tables/14/4.2.2.4.table | 6 +- definitions/grib2/tables/14/4.2.3.0.table | 6 +- definitions/grib2/tables/14/4.2.3.1.table | 10 +- definitions/grib2/tables/14/4.201.table | 28 ++-- definitions/grib2/tables/14/4.202.table | 6 +- definitions/grib2/tables/14/4.203.table | 50 +++---- definitions/grib2/tables/14/4.204.table | 16 +-- definitions/grib2/tables/14/4.205.table | 10 +- definitions/grib2/tables/14/4.206.table | 10 +- definitions/grib2/tables/14/4.207.table | 18 +-- definitions/grib2/tables/14/4.208.table | 16 +-- definitions/grib2/tables/14/4.209.table | 16 +-- definitions/grib2/tables/14/4.210.table | 10 +- definitions/grib2/tables/14/4.211.table | 12 +- definitions/grib2/tables/14/4.212.table | 34 ++--- definitions/grib2/tables/14/4.213.table | 30 ++--- definitions/grib2/tables/14/4.215.table | 16 +-- definitions/grib2/tables/14/4.216.table | 8 +- definitions/grib2/tables/14/4.217.table | 14 +- definitions/grib2/tables/14/4.218.table | 74 +++++------ definitions/grib2/tables/14/4.219.table | 14 +- definitions/grib2/tables/14/4.220.table | 10 +- definitions/grib2/tables/14/4.221.table | 10 +- definitions/grib2/tables/14/4.222.table | 10 +- definitions/grib2/tables/14/4.223.table | 8 +- definitions/grib2/tables/14/4.224.table | 34 ++--- definitions/grib2/tables/14/4.227.table | 16 +-- definitions/grib2/tables/14/4.234.table | 40 +++--- definitions/grib2/tables/14/4.236.table | 14 +- definitions/grib2/tables/14/4.241.table | 16 +-- definitions/grib2/tables/14/4.242.table | 12 +- definitions/grib2/tables/14/4.243.table | 84 ++++++------ definitions/grib2/tables/14/4.3.table | 38 +++--- definitions/grib2/tables/14/4.4.table | 32 ++--- definitions/grib2/tables/14/4.5.table | 26 ++-- definitions/grib2/tables/14/4.6.table | 16 +-- definitions/grib2/tables/14/4.7.table | 26 ++-- definitions/grib2/tables/14/4.8.table | 10 +- definitions/grib2/tables/14/4.9.table | 16 +-- definitions/grib2/tables/14/4.91.table | 30 ++--- definitions/grib2/tables/14/5.0.table | 34 ++--- definitions/grib2/tables/14/5.1.table | 10 +- definitions/grib2/tables/14/5.2.table | 10 +- definitions/grib2/tables/14/5.3.table | 12 +- definitions/grib2/tables/14/5.4.table | 10 +- definitions/grib2/tables/14/5.40.table | 8 +- definitions/grib2/tables/14/5.5.table | 12 +- definitions/grib2/tables/14/5.6.table | 12 +- definitions/grib2/tables/14/5.7.table | 12 +- definitions/grib2/tables/14/6.0.table | 6 +- definitions/grib2/tables/15/0.0.table | 18 +-- definitions/grib2/tables/15/1.0.table | 36 ++--- definitions/grib2/tables/15/1.1.table | 6 +- definitions/grib2/tables/15/1.2.table | 14 +- definitions/grib2/tables/15/1.3.table | 14 +- definitions/grib2/tables/15/1.4.table | 24 ++-- definitions/grib2/tables/15/1.5.table | 12 +- definitions/grib2/tables/15/1.6.table | 14 +- definitions/grib2/tables/15/3.0.table | 8 +- definitions/grib2/tables/15/3.10.table | 14 +- definitions/grib2/tables/15/3.11.table | 12 +- definitions/grib2/tables/15/3.15.table | 20 +-- definitions/grib2/tables/15/3.2.table | 26 ++-- definitions/grib2/tables/15/3.20.table | 10 +- definitions/grib2/tables/15/3.21.table | 14 +- definitions/grib2/tables/15/3.3.table | 16 +-- definitions/grib2/tables/15/3.4.table | 32 ++--- definitions/grib2/tables/15/3.5.table | 8 +- definitions/grib2/tables/15/3.7.table | 6 +- definitions/grib2/tables/15/3.8.table | 12 +- definitions/grib2/tables/15/3.9.table | 6 +- definitions/grib2/tables/15/4.0.table | 114 ++++++++-------- definitions/grib2/tables/15/4.1.0.table | 52 ++++---- definitions/grib2/tables/15/4.1.1.table | 12 +- definitions/grib2/tables/15/4.1.10.table | 18 +-- definitions/grib2/tables/15/4.1.2.table | 16 +-- definitions/grib2/tables/15/4.1.3.table | 10 +- definitions/grib2/tables/15/4.10.table | 30 ++--- definitions/grib2/tables/15/4.11.table | 18 +-- definitions/grib2/tables/15/4.12.table | 12 +- definitions/grib2/tables/15/4.13.table | 10 +- definitions/grib2/tables/15/4.14.table | 10 +- definitions/grib2/tables/15/4.15.table | 20 +-- definitions/grib2/tables/15/4.2.0.0.table | 6 +- definitions/grib2/tables/15/4.2.0.1.table | 10 +- definitions/grib2/tables/15/4.2.0.13.table | 6 +- definitions/grib2/tables/15/4.2.0.14.table | 6 +- definitions/grib2/tables/15/4.2.0.15.table | 6 +- definitions/grib2/tables/15/4.2.0.16.table | 6 +- definitions/grib2/tables/15/4.2.0.18.table | 8 +- definitions/grib2/tables/15/4.2.0.19.table | 6 +- definitions/grib2/tables/15/4.2.0.190.table | 6 +- definitions/grib2/tables/15/4.2.0.191.table | 6 +- definitions/grib2/tables/15/4.2.0.2.table | 6 +- definitions/grib2/tables/15/4.2.0.20.table | 10 +- definitions/grib2/tables/15/4.2.0.3.table | 6 +- definitions/grib2/tables/15/4.2.0.4.table | 8 +- definitions/grib2/tables/15/4.2.0.5.table | 6 +- definitions/grib2/tables/15/4.2.0.6.table | 6 +- definitions/grib2/tables/15/4.2.0.7.table | 8 +- definitions/grib2/tables/15/4.2.1.0.table | 6 +- definitions/grib2/tables/15/4.2.1.1.table | 6 +- definitions/grib2/tables/15/4.2.10.0.table | 6 +- definitions/grib2/tables/15/4.2.10.1.table | 6 +- definitions/grib2/tables/15/4.2.10.191.table | 8 +- definitions/grib2/tables/15/4.2.10.2.table | 6 +- definitions/grib2/tables/15/4.2.10.3.table | 6 +- definitions/grib2/tables/15/4.2.10.4.table | 8 +- definitions/grib2/tables/15/4.2.2.0.table | 6 +- definitions/grib2/tables/15/4.2.2.3.table | 6 +- definitions/grib2/tables/15/4.2.2.4.table | 6 +- definitions/grib2/tables/15/4.2.3.0.table | 6 +- definitions/grib2/tables/15/4.2.3.1.table | 10 +- definitions/grib2/tables/15/4.201.table | 28 ++-- definitions/grib2/tables/15/4.202.table | 6 +- definitions/grib2/tables/15/4.203.table | 50 +++---- definitions/grib2/tables/15/4.204.table | 16 +-- definitions/grib2/tables/15/4.205.table | 10 +- definitions/grib2/tables/15/4.206.table | 10 +- definitions/grib2/tables/15/4.207.table | 18 +-- definitions/grib2/tables/15/4.208.table | 16 +-- definitions/grib2/tables/15/4.209.table | 16 +-- definitions/grib2/tables/15/4.210.table | 10 +- definitions/grib2/tables/15/4.211.table | 12 +- definitions/grib2/tables/15/4.212.table | 34 ++--- definitions/grib2/tables/15/4.213.table | 30 ++--- definitions/grib2/tables/15/4.215.table | 16 +-- definitions/grib2/tables/15/4.216.table | 8 +- definitions/grib2/tables/15/4.217.table | 14 +- definitions/grib2/tables/15/4.218.table | 74 +++++------ definitions/grib2/tables/15/4.219.table | 14 +- definitions/grib2/tables/15/4.220.table | 10 +- definitions/grib2/tables/15/4.221.table | 10 +- definitions/grib2/tables/15/4.222.table | 10 +- definitions/grib2/tables/15/4.223.table | 8 +- definitions/grib2/tables/15/4.224.table | 34 ++--- definitions/grib2/tables/15/4.227.table | 16 +-- definitions/grib2/tables/15/4.234.table | 40 +++--- definitions/grib2/tables/15/4.236.table | 14 +- definitions/grib2/tables/15/4.241.table | 16 +-- definitions/grib2/tables/15/4.242.table | 12 +- definitions/grib2/tables/15/4.243.table | 84 ++++++------ definitions/grib2/tables/15/4.3.table | 38 +++--- definitions/grib2/tables/15/4.4.table | 32 ++--- definitions/grib2/tables/15/4.5.table | 50 +++---- definitions/grib2/tables/15/4.6.table | 16 +-- definitions/grib2/tables/15/4.7.table | 26 ++-- definitions/grib2/tables/15/4.8.table | 10 +- definitions/grib2/tables/15/4.9.table | 16 +-- definitions/grib2/tables/15/4.91.table | 30 ++--- definitions/grib2/tables/15/5.0.table | 34 ++--- definitions/grib2/tables/15/5.1.table | 10 +- definitions/grib2/tables/15/5.2.table | 10 +- definitions/grib2/tables/15/5.3.table | 12 +- definitions/grib2/tables/15/5.4.table | 10 +- definitions/grib2/tables/15/5.40.table | 8 +- definitions/grib2/tables/15/5.5.table | 12 +- definitions/grib2/tables/15/5.6.table | 12 +- definitions/grib2/tables/15/5.7.table | 12 +- definitions/grib2/tables/15/6.0.table | 6 +- definitions/grib2/tables/16/0.0.table | 18 +-- definitions/grib2/tables/16/1.1.table | 6 +- definitions/grib2/tables/16/1.2.table | 14 +- definitions/grib2/tables/16/1.3.table | 14 +- definitions/grib2/tables/16/1.4.table | 24 ++-- definitions/grib2/tables/16/1.5.table | 12 +- definitions/grib2/tables/16/1.6.table | 14 +- definitions/grib2/tables/16/3.0.table | 8 +- definitions/grib2/tables/16/3.10.table | 14 +- definitions/grib2/tables/16/3.11.table | 12 +- definitions/grib2/tables/16/3.15.table | 20 +-- definitions/grib2/tables/16/3.2.table | 26 ++-- definitions/grib2/tables/16/3.20.table | 10 +- definitions/grib2/tables/16/3.21.table | 14 +- definitions/grib2/tables/16/3.3.table | 16 +-- definitions/grib2/tables/16/3.4.table | 32 ++--- definitions/grib2/tables/16/3.5.table | 8 +- definitions/grib2/tables/16/3.7.table | 6 +- definitions/grib2/tables/16/3.8.table | 12 +- definitions/grib2/tables/16/3.9.table | 6 +- definitions/grib2/tables/16/4.0.table | 118 ++++++++--------- definitions/grib2/tables/16/4.1.0.table | 52 ++++---- definitions/grib2/tables/16/4.1.1.table | 12 +- definitions/grib2/tables/16/4.1.10.table | 18 +-- definitions/grib2/tables/16/4.1.2.table | 16 +-- definitions/grib2/tables/16/4.1.3.table | 20 +-- definitions/grib2/tables/16/4.10.table | 30 ++--- definitions/grib2/tables/16/4.11.table | 18 +-- definitions/grib2/tables/16/4.12.table | 12 +- definitions/grib2/tables/16/4.13.table | 10 +- definitions/grib2/tables/16/4.14.table | 10 +- definitions/grib2/tables/16/4.15.table | 20 +-- definitions/grib2/tables/16/4.2.0.0.table | 6 +- definitions/grib2/tables/16/4.2.0.1.table | 10 +- definitions/grib2/tables/16/4.2.0.13.table | 6 +- definitions/grib2/tables/16/4.2.0.14.table | 6 +- definitions/grib2/tables/16/4.2.0.15.table | 6 +- definitions/grib2/tables/16/4.2.0.16.table | 6 +- definitions/grib2/tables/16/4.2.0.18.table | 8 +- definitions/grib2/tables/16/4.2.0.19.table | 6 +- definitions/grib2/tables/16/4.2.0.190.table | 6 +- definitions/grib2/tables/16/4.2.0.191.table | 6 +- definitions/grib2/tables/16/4.2.0.2.table | 6 +- definitions/grib2/tables/16/4.2.0.20.table | 10 +- definitions/grib2/tables/16/4.2.0.3.table | 6 +- definitions/grib2/tables/16/4.2.0.4.table | 8 +- definitions/grib2/tables/16/4.2.0.5.table | 6 +- definitions/grib2/tables/16/4.2.0.6.table | 8 +- definitions/grib2/tables/16/4.2.0.7.table | 8 +- definitions/grib2/tables/16/4.2.1.0.table | 6 +- definitions/grib2/tables/16/4.2.1.1.table | 6 +- definitions/grib2/tables/16/4.2.10.0.table | 6 +- definitions/grib2/tables/16/4.2.10.1.table | 6 +- definitions/grib2/tables/16/4.2.10.191.table | 8 +- definitions/grib2/tables/16/4.2.10.2.table | 6 +- definitions/grib2/tables/16/4.2.10.3.table | 6 +- definitions/grib2/tables/16/4.2.10.4.table | 8 +- definitions/grib2/tables/16/4.2.2.0.table | 6 +- definitions/grib2/tables/16/4.2.2.3.table | 6 +- definitions/grib2/tables/16/4.2.2.4.table | 6 +- definitions/grib2/tables/16/4.2.3.0.table | 6 +- definitions/grib2/tables/16/4.2.3.1.table | 18 +-- definitions/grib2/tables/16/4.201.table | 28 ++-- definitions/grib2/tables/16/4.202.table | 6 +- definitions/grib2/tables/16/4.203.table | 50 +++---- definitions/grib2/tables/16/4.204.table | 16 +-- definitions/grib2/tables/16/4.205.table | 10 +- definitions/grib2/tables/16/4.206.table | 10 +- definitions/grib2/tables/16/4.207.table | 18 +-- definitions/grib2/tables/16/4.208.table | 16 +-- definitions/grib2/tables/16/4.209.table | 16 +-- definitions/grib2/tables/16/4.210.table | 10 +- definitions/grib2/tables/16/4.211.table | 12 +- definitions/grib2/tables/16/4.212.table | 34 ++--- definitions/grib2/tables/16/4.213.table | 30 ++--- definitions/grib2/tables/16/4.215.table | 16 +-- definitions/grib2/tables/16/4.216.table | 8 +- definitions/grib2/tables/16/4.217.table | 14 +- definitions/grib2/tables/16/4.218.table | 86 ++++++------ definitions/grib2/tables/16/4.219.table | 14 +- definitions/grib2/tables/16/4.220.table | 10 +- definitions/grib2/tables/16/4.221.table | 10 +- definitions/grib2/tables/16/4.222.table | 10 +- definitions/grib2/tables/16/4.223.table | 8 +- definitions/grib2/tables/16/4.224.table | 34 ++--- definitions/grib2/tables/16/4.227.table | 16 +-- definitions/grib2/tables/16/4.234.table | 40 +++--- definitions/grib2/tables/16/4.236.table | 14 +- definitions/grib2/tables/16/4.240.table | 18 +-- definitions/grib2/tables/16/4.241.table | 16 +-- definitions/grib2/tables/16/4.242.table | 12 +- definitions/grib2/tables/16/4.243.table | 84 ++++++------ definitions/grib2/tables/16/4.3.table | 42 +++--- definitions/grib2/tables/16/4.4.table | 32 ++--- definitions/grib2/tables/16/4.5.table | 52 ++++---- definitions/grib2/tables/16/4.6.table | 16 +-- definitions/grib2/tables/16/4.7.table | 26 ++-- definitions/grib2/tables/16/4.8.table | 10 +- definitions/grib2/tables/16/4.9.table | 16 +-- definitions/grib2/tables/16/4.91.table | 30 ++--- definitions/grib2/tables/16/5.0.table | 34 ++--- definitions/grib2/tables/16/5.1.table | 10 +- definitions/grib2/tables/16/5.2.table | 12 +- definitions/grib2/tables/16/5.3.table | 12 +- definitions/grib2/tables/16/5.4.table | 10 +- definitions/grib2/tables/16/5.40.table | 8 +- definitions/grib2/tables/16/5.5.table | 12 +- definitions/grib2/tables/16/5.6.table | 12 +- definitions/grib2/tables/16/5.7.table | 12 +- definitions/grib2/tables/16/6.0.table | 6 +- definitions/grib2/tables/17/0.0.table | 18 +-- definitions/grib2/tables/17/1.0.table | 38 +++--- definitions/grib2/tables/17/1.1.table | 6 +- definitions/grib2/tables/17/1.2.table | 14 +- definitions/grib2/tables/17/1.3.table | 20 +-- definitions/grib2/tables/17/1.4.table | 24 ++-- definitions/grib2/tables/17/1.5.table | 12 +- definitions/grib2/tables/17/1.6.table | 14 +- definitions/grib2/tables/17/3.0.table | 8 +- definitions/grib2/tables/17/3.10.table | 14 +- definitions/grib2/tables/17/3.11.table | 12 +- definitions/grib2/tables/17/3.15.table | 20 +-- definitions/grib2/tables/17/3.2.table | 26 ++-- definitions/grib2/tables/17/3.20.table | 10 +- definitions/grib2/tables/17/3.21.table | 14 +- definitions/grib2/tables/17/3.3.table | 16 +-- definitions/grib2/tables/17/3.4.table | 32 ++--- definitions/grib2/tables/17/3.5.table | 8 +- definitions/grib2/tables/17/3.7.table | 6 +- definitions/grib2/tables/17/3.8.table | 12 +- definitions/grib2/tables/17/3.9.table | 6 +- definitions/grib2/tables/17/4.0.table | 116 ++++++++-------- definitions/grib2/tables/17/4.1.0.table | 52 ++++---- definitions/grib2/tables/17/4.1.1.table | 12 +- definitions/grib2/tables/17/4.1.10.table | 18 +-- definitions/grib2/tables/17/4.1.2.table | 16 +-- definitions/grib2/tables/17/4.1.3.table | 20 +-- definitions/grib2/tables/17/4.10.table | 30 ++--- definitions/grib2/tables/17/4.11.table | 18 +-- definitions/grib2/tables/17/4.12.table | 12 +- definitions/grib2/tables/17/4.13.table | 10 +- definitions/grib2/tables/17/4.14.table | 10 +- definitions/grib2/tables/17/4.15.table | 20 +-- definitions/grib2/tables/17/4.2.0.0.table | 6 +- definitions/grib2/tables/17/4.2.0.1.table | 10 +- definitions/grib2/tables/17/4.2.0.13.table | 6 +- definitions/grib2/tables/17/4.2.0.14.table | 6 +- definitions/grib2/tables/17/4.2.0.15.table | 6 +- definitions/grib2/tables/17/4.2.0.16.table | 6 +- definitions/grib2/tables/17/4.2.0.18.table | 8 +- definitions/grib2/tables/17/4.2.0.19.table | 6 +- definitions/grib2/tables/17/4.2.0.190.table | 6 +- definitions/grib2/tables/17/4.2.0.191.table | 6 +- definitions/grib2/tables/17/4.2.0.2.table | 6 +- definitions/grib2/tables/17/4.2.0.20.table | 10 +- definitions/grib2/tables/17/4.2.0.3.table | 6 +- definitions/grib2/tables/17/4.2.0.4.table | 8 +- definitions/grib2/tables/17/4.2.0.5.table | 6 +- definitions/grib2/tables/17/4.2.0.6.table | 8 +- definitions/grib2/tables/17/4.2.0.7.table | 8 +- definitions/grib2/tables/17/4.2.1.0.table | 6 +- definitions/grib2/tables/17/4.2.1.1.table | 6 +- definitions/grib2/tables/17/4.2.10.0.table | 6 +- definitions/grib2/tables/17/4.2.10.1.table | 6 +- definitions/grib2/tables/17/4.2.10.191.table | 8 +- definitions/grib2/tables/17/4.2.10.2.table | 6 +- definitions/grib2/tables/17/4.2.10.3.table | 6 +- definitions/grib2/tables/17/4.2.10.4.table | 8 +- definitions/grib2/tables/17/4.2.2.0.table | 6 +- definitions/grib2/tables/17/4.2.2.3.table | 6 +- definitions/grib2/tables/17/4.2.2.4.table | 6 +- definitions/grib2/tables/17/4.2.3.0.table | 6 +- definitions/grib2/tables/17/4.2.3.1.table | 12 +- definitions/grib2/tables/17/4.201.table | 28 ++-- definitions/grib2/tables/17/4.202.table | 6 +- definitions/grib2/tables/17/4.203.table | 50 +++---- definitions/grib2/tables/17/4.204.table | 16 +-- definitions/grib2/tables/17/4.205.table | 10 +- definitions/grib2/tables/17/4.206.table | 10 +- definitions/grib2/tables/17/4.207.table | 18 +-- definitions/grib2/tables/17/4.208.table | 16 +-- definitions/grib2/tables/17/4.209.table | 16 +-- definitions/grib2/tables/17/4.210.table | 6 +- definitions/grib2/tables/17/4.211.table | 12 +- definitions/grib2/tables/17/4.212.table | 34 ++--- definitions/grib2/tables/17/4.213.table | 30 ++--- definitions/grib2/tables/17/4.215.table | 16 +-- definitions/grib2/tables/17/4.216.table | 8 +- definitions/grib2/tables/17/4.217.table | 14 +- definitions/grib2/tables/17/4.218.table | 86 ++++++------ definitions/grib2/tables/17/4.219.table | 14 +- definitions/grib2/tables/17/4.220.table | 10 +- definitions/grib2/tables/17/4.221.table | 10 +- definitions/grib2/tables/17/4.222.table | 10 +- definitions/grib2/tables/17/4.223.table | 8 +- definitions/grib2/tables/17/4.224.table | 34 ++--- definitions/grib2/tables/17/4.227.table | 16 +-- definitions/grib2/tables/17/4.234.table | 40 +++--- definitions/grib2/tables/17/4.236.table | 14 +- definitions/grib2/tables/17/4.240.table | 18 +-- definitions/grib2/tables/17/4.241.table | 16 +-- definitions/grib2/tables/17/4.242.table | 12 +- definitions/grib2/tables/17/4.243.table | 84 ++++++------ definitions/grib2/tables/17/4.3.table | 42 +++--- definitions/grib2/tables/17/4.4.table | 32 ++--- definitions/grib2/tables/17/4.5.table | 30 ++--- definitions/grib2/tables/17/4.6.table | 16 +-- definitions/grib2/tables/17/4.7.table | 26 ++-- definitions/grib2/tables/17/4.8.table | 10 +- definitions/grib2/tables/17/4.9.table | 16 +-- definitions/grib2/tables/17/4.91.table | 30 ++--- definitions/grib2/tables/17/5.0.table | 34 ++--- definitions/grib2/tables/17/5.1.table | 10 +- definitions/grib2/tables/17/5.2.table | 12 +- definitions/grib2/tables/17/5.3.table | 12 +- definitions/grib2/tables/17/5.4.table | 10 +- definitions/grib2/tables/17/5.40.table | 8 +- definitions/grib2/tables/17/5.5.table | 12 +- definitions/grib2/tables/17/5.6.table | 12 +- definitions/grib2/tables/17/5.7.table | 12 +- definitions/grib2/tables/17/6.0.table | 8 +- definitions/grib2/tables/18/0.0.table | 18 +-- definitions/grib2/tables/18/1.0.table | 36 ++--- definitions/grib2/tables/18/1.1.table | 6 +- definitions/grib2/tables/18/1.2.table | 14 +- definitions/grib2/tables/18/1.3.table | 20 +-- definitions/grib2/tables/18/1.4.table | 24 ++-- definitions/grib2/tables/18/1.5.table | 12 +- definitions/grib2/tables/18/1.6.table | 14 +- definitions/grib2/tables/18/3.0.table | 8 +- definitions/grib2/tables/18/3.10.table | 14 +- definitions/grib2/tables/18/3.11.table | 12 +- definitions/grib2/tables/18/3.15.table | 20 +-- definitions/grib2/tables/18/3.2.table | 26 ++-- definitions/grib2/tables/18/3.20.table | 10 +- definitions/grib2/tables/18/3.21.table | 14 +- definitions/grib2/tables/18/3.3.table | 16 +-- definitions/grib2/tables/18/3.4.table | 32 ++--- definitions/grib2/tables/18/3.5.table | 8 +- definitions/grib2/tables/18/3.7.table | 6 +- definitions/grib2/tables/18/3.8.table | 12 +- definitions/grib2/tables/18/3.9.table | 6 +- definitions/grib2/tables/18/4.0.table | 104 +++++++-------- definitions/grib2/tables/18/4.1.0.table | 52 ++++---- definitions/grib2/tables/18/4.1.1.table | 12 +- definitions/grib2/tables/18/4.1.10.table | 18 +-- definitions/grib2/tables/18/4.1.2.table | 16 +-- definitions/grib2/tables/18/4.1.3.table | 20 +-- definitions/grib2/tables/18/4.10.table | 30 ++--- definitions/grib2/tables/18/4.11.table | 18 +-- definitions/grib2/tables/18/4.12.table | 12 +- definitions/grib2/tables/18/4.13.table | 10 +- definitions/grib2/tables/18/4.14.table | 10 +- definitions/grib2/tables/18/4.15.table | 20 +-- definitions/grib2/tables/18/4.2.0.0.table | 6 +- definitions/grib2/tables/18/4.2.0.1.table | 10 +- definitions/grib2/tables/18/4.2.0.13.table | 6 +- definitions/grib2/tables/18/4.2.0.14.table | 6 +- definitions/grib2/tables/18/4.2.0.15.table | 6 +- definitions/grib2/tables/18/4.2.0.16.table | 6 +- definitions/grib2/tables/18/4.2.0.18.table | 8 +- definitions/grib2/tables/18/4.2.0.19.table | 6 +- definitions/grib2/tables/18/4.2.0.190.table | 6 +- definitions/grib2/tables/18/4.2.0.191.table | 6 +- definitions/grib2/tables/18/4.2.0.2.table | 6 +- definitions/grib2/tables/18/4.2.0.20.table | 10 +- definitions/grib2/tables/18/4.2.0.3.table | 6 +- definitions/grib2/tables/18/4.2.0.4.table | 8 +- definitions/grib2/tables/18/4.2.0.5.table | 6 +- definitions/grib2/tables/18/4.2.0.6.table | 8 +- definitions/grib2/tables/18/4.2.0.7.table | 8 +- definitions/grib2/tables/18/4.2.1.0.table | 6 +- definitions/grib2/tables/18/4.2.1.1.table | 6 +- definitions/grib2/tables/18/4.2.10.0.table | 6 +- definitions/grib2/tables/18/4.2.10.1.table | 6 +- definitions/grib2/tables/18/4.2.10.191.table | 8 +- definitions/grib2/tables/18/4.2.10.2.table | 6 +- definitions/grib2/tables/18/4.2.10.3.table | 6 +- definitions/grib2/tables/18/4.2.10.4.table | 8 +- definitions/grib2/tables/18/4.2.2.0.table | 6 +- definitions/grib2/tables/18/4.2.2.3.table | 6 +- definitions/grib2/tables/18/4.2.2.4.table | 6 +- definitions/grib2/tables/18/4.2.3.0.table | 6 +- definitions/grib2/tables/18/4.2.3.1.table | 12 +- definitions/grib2/tables/18/4.201.table | 28 ++-- definitions/grib2/tables/18/4.202.table | 6 +- definitions/grib2/tables/18/4.203.table | 50 +++---- definitions/grib2/tables/18/4.204.table | 16 +-- definitions/grib2/tables/18/4.205.table | 10 +- definitions/grib2/tables/18/4.206.table | 10 +- definitions/grib2/tables/18/4.207.table | 18 +-- definitions/grib2/tables/18/4.208.table | 16 +-- definitions/grib2/tables/18/4.209.table | 16 +-- definitions/grib2/tables/18/4.210.table | 6 +- definitions/grib2/tables/18/4.211.table | 12 +- definitions/grib2/tables/18/4.212.table | 34 ++--- definitions/grib2/tables/18/4.213.table | 30 ++--- definitions/grib2/tables/18/4.215.table | 16 +-- definitions/grib2/tables/18/4.216.table | 8 +- definitions/grib2/tables/18/4.217.table | 14 +- definitions/grib2/tables/18/4.218.table | 86 ++++++------ definitions/grib2/tables/18/4.219.table | 14 +- definitions/grib2/tables/18/4.220.table | 10 +- definitions/grib2/tables/18/4.221.table | 10 +- definitions/grib2/tables/18/4.222.table | 10 +- definitions/grib2/tables/18/4.223.table | 8 +- definitions/grib2/tables/18/4.224.table | 34 ++--- definitions/grib2/tables/18/4.227.table | 16 +-- definitions/grib2/tables/18/4.234.table | 40 +++--- definitions/grib2/tables/18/4.236.table | 14 +- definitions/grib2/tables/18/4.240.table | 20 +-- definitions/grib2/tables/18/4.241.table | 16 +-- definitions/grib2/tables/18/4.242.table | 12 +- definitions/grib2/tables/18/4.243.table | 84 ++++++------ definitions/grib2/tables/18/4.3.table | 44 +++---- definitions/grib2/tables/18/4.4.table | 32 ++--- definitions/grib2/tables/18/4.5.table | 28 ++-- definitions/grib2/tables/18/4.6.table | 16 +-- definitions/grib2/tables/18/4.7.table | 26 ++-- definitions/grib2/tables/18/4.8.table | 10 +- definitions/grib2/tables/18/4.9.table | 16 +-- definitions/grib2/tables/18/4.91.table | 30 ++--- definitions/grib2/tables/18/5.0.table | 34 ++--- definitions/grib2/tables/18/5.1.table | 10 +- definitions/grib2/tables/18/5.2.table | 12 +- definitions/grib2/tables/18/5.3.table | 12 +- definitions/grib2/tables/18/5.4.table | 10 +- definitions/grib2/tables/18/5.40.table | 8 +- definitions/grib2/tables/18/5.5.table | 12 +- definitions/grib2/tables/18/5.6.table | 12 +- definitions/grib2/tables/18/5.7.table | 12 +- definitions/grib2/tables/18/6.0.table | 8 +- definitions/grib2/tables/19/0.0.table | 18 +-- definitions/grib2/tables/19/1.0.table | 36 ++--- definitions/grib2/tables/19/1.1.table | 6 +- definitions/grib2/tables/19/1.2.table | 14 +- definitions/grib2/tables/19/1.3.table | 20 +-- definitions/grib2/tables/19/1.4.table | 24 ++-- definitions/grib2/tables/19/1.5.table | 12 +- definitions/grib2/tables/19/1.6.table | 14 +- definitions/grib2/tables/19/3.0.table | 8 +- definitions/grib2/tables/19/3.10.table | 14 +- definitions/grib2/tables/19/3.11.table | 12 +- definitions/grib2/tables/19/3.15.table | 20 +-- definitions/grib2/tables/19/3.2.table | 26 ++-- definitions/grib2/tables/19/3.20.table | 10 +- definitions/grib2/tables/19/3.21.table | 14 +- definitions/grib2/tables/19/3.3.table | 16 +-- definitions/grib2/tables/19/3.4.table | 32 ++--- definitions/grib2/tables/19/3.5.table | 8 +- definitions/grib2/tables/19/3.7.table | 6 +- definitions/grib2/tables/19/3.8.table | 12 +- definitions/grib2/tables/19/3.9.table | 6 +- definitions/grib2/tables/19/4.0.table | 132 +++++++++---------- definitions/grib2/tables/19/4.1.0.table | 52 ++++---- definitions/grib2/tables/19/4.1.1.table | 12 +- definitions/grib2/tables/19/4.1.10.table | 18 +-- definitions/grib2/tables/19/4.1.2.table | 16 +-- definitions/grib2/tables/19/4.1.3.table | 20 +-- definitions/grib2/tables/19/4.10.table | 30 ++--- definitions/grib2/tables/19/4.11.table | 18 +-- definitions/grib2/tables/19/4.12.table | 12 +- definitions/grib2/tables/19/4.13.table | 10 +- definitions/grib2/tables/19/4.14.table | 10 +- definitions/grib2/tables/19/4.15.table | 20 +-- definitions/grib2/tables/19/4.2.0.0.table | 6 +- definitions/grib2/tables/19/4.2.0.1.table | 10 +- definitions/grib2/tables/19/4.2.0.13.table | 6 +- definitions/grib2/tables/19/4.2.0.14.table | 6 +- definitions/grib2/tables/19/4.2.0.15.table | 6 +- definitions/grib2/tables/19/4.2.0.16.table | 6 +- definitions/grib2/tables/19/4.2.0.18.table | 8 +- definitions/grib2/tables/19/4.2.0.19.table | 6 +- definitions/grib2/tables/19/4.2.0.190.table | 6 +- definitions/grib2/tables/19/4.2.0.191.table | 6 +- definitions/grib2/tables/19/4.2.0.2.table | 6 +- definitions/grib2/tables/19/4.2.0.20.table | 10 +- definitions/grib2/tables/19/4.2.0.3.table | 6 +- definitions/grib2/tables/19/4.2.0.4.table | 8 +- definitions/grib2/tables/19/4.2.0.5.table | 6 +- definitions/grib2/tables/19/4.2.0.6.table | 8 +- definitions/grib2/tables/19/4.2.0.7.table | 8 +- definitions/grib2/tables/19/4.2.1.0.table | 6 +- definitions/grib2/tables/19/4.2.1.1.table | 6 +- definitions/grib2/tables/19/4.2.10.0.table | 6 +- definitions/grib2/tables/19/4.2.10.1.table | 6 +- definitions/grib2/tables/19/4.2.10.191.table | 8 +- definitions/grib2/tables/19/4.2.10.2.table | 6 +- definitions/grib2/tables/19/4.2.10.3.table | 6 +- definitions/grib2/tables/19/4.2.10.4.table | 8 +- definitions/grib2/tables/19/4.2.2.0.table | 6 +- definitions/grib2/tables/19/4.2.2.3.table | 6 +- definitions/grib2/tables/19/4.2.2.4.table | 6 +- definitions/grib2/tables/19/4.2.3.0.table | 6 +- definitions/grib2/tables/19/4.2.3.1.table | 12 +- definitions/grib2/tables/19/4.201.table | 28 ++-- definitions/grib2/tables/19/4.202.table | 6 +- definitions/grib2/tables/19/4.203.table | 50 +++---- definitions/grib2/tables/19/4.204.table | 16 +-- definitions/grib2/tables/19/4.205.table | 10 +- definitions/grib2/tables/19/4.206.table | 10 +- definitions/grib2/tables/19/4.207.table | 18 +-- definitions/grib2/tables/19/4.208.table | 16 +-- definitions/grib2/tables/19/4.209.table | 16 +-- definitions/grib2/tables/19/4.210.table | 2 +- definitions/grib2/tables/19/4.211.table | 12 +- definitions/grib2/tables/19/4.212.table | 34 ++--- definitions/grib2/tables/19/4.213.table | 30 ++--- definitions/grib2/tables/19/4.215.table | 16 +-- definitions/grib2/tables/19/4.216.table | 8 +- definitions/grib2/tables/19/4.217.table | 14 +- definitions/grib2/tables/19/4.218.table | 86 ++++++------ definitions/grib2/tables/19/4.219.table | 14 +- definitions/grib2/tables/19/4.220.table | 10 +- definitions/grib2/tables/19/4.221.table | 10 +- definitions/grib2/tables/19/4.222.table | 10 +- definitions/grib2/tables/19/4.223.table | 8 +- definitions/grib2/tables/19/4.224.table | 34 ++--- definitions/grib2/tables/19/4.227.table | 16 +-- definitions/grib2/tables/19/4.234.table | 40 +++--- definitions/grib2/tables/19/4.236.table | 14 +- definitions/grib2/tables/19/4.240.table | 20 +-- definitions/grib2/tables/19/4.241.table | 16 +-- definitions/grib2/tables/19/4.242.table | 12 +- definitions/grib2/tables/19/4.243.table | 84 ++++++------ definitions/grib2/tables/19/4.3.table | 44 +++---- definitions/grib2/tables/19/4.4.table | 32 ++--- definitions/grib2/tables/19/4.5.table | 28 ++-- definitions/grib2/tables/19/4.6.table | 16 +-- definitions/grib2/tables/19/4.7.table | 26 ++-- definitions/grib2/tables/19/4.8.table | 10 +- definitions/grib2/tables/19/4.9.table | 16 +-- definitions/grib2/tables/19/4.91.table | 30 ++--- definitions/grib2/tables/19/5.0.table | 34 ++--- definitions/grib2/tables/19/5.1.table | 10 +- definitions/grib2/tables/19/5.2.table | 12 +- definitions/grib2/tables/19/5.3.table | 12 +- definitions/grib2/tables/19/5.4.table | 10 +- definitions/grib2/tables/19/5.40.table | 8 +- definitions/grib2/tables/19/5.5.table | 12 +- definitions/grib2/tables/19/5.6.table | 12 +- definitions/grib2/tables/19/5.7.table | 12 +- definitions/grib2/tables/19/6.0.table | 8 +- definitions/grib2/tables/32/4.252.table | 4 +- definitions/grib2/tables/6/1.1.table | 2 +- definitions/grib2/tables/6/4.5.table | 14 +- definitions/grib2/tables/7/1.1.table | 2 +- definitions/grib2/tables/7/3.10.table | 2 +- definitions/grib2/tables/7/3.4.table | 2 +- definitions/grib2/tables/7/3.9.table | 2 +- definitions/grib2/tables/7/4.5.table | 14 +- definitions/grib2/tables/8/0.0.table | 18 +-- definitions/grib2/tables/8/1.0.table | 22 ++-- definitions/grib2/tables/8/1.1.table | 6 +- definitions/grib2/tables/8/1.2.table | 14 +- definitions/grib2/tables/8/1.3.table | 18 +-- definitions/grib2/tables/8/1.4.table | 24 ++-- definitions/grib2/tables/8/3.0.table | 8 +- definitions/grib2/tables/8/3.10.table | 14 +- definitions/grib2/tables/8/3.11.table | 2 +- definitions/grib2/tables/8/3.15.table | 18 +-- definitions/grib2/tables/8/3.2.table | 24 ++-- definitions/grib2/tables/8/3.20.table | 10 +- definitions/grib2/tables/8/3.21.table | 14 +- definitions/grib2/tables/8/3.3.table | 16 +-- definitions/grib2/tables/8/3.4.table | 18 +-- definitions/grib2/tables/8/3.5.table | 8 +- definitions/grib2/tables/8/3.7.table | 2 +- definitions/grib2/tables/8/3.8.table | 12 +- definitions/grib2/tables/8/3.9.table | 6 +- definitions/grib2/tables/8/4.0.table | 76 +++++------ definitions/grib2/tables/8/4.1.0.table | 52 ++++---- definitions/grib2/tables/8/4.1.1.table | 12 +- definitions/grib2/tables/8/4.1.10.table | 18 +-- definitions/grib2/tables/8/4.1.2.table | 16 +-- definitions/grib2/tables/8/4.1.3.table | 10 +- definitions/grib2/tables/8/4.10.table | 28 ++-- definitions/grib2/tables/8/4.11.table | 18 +-- definitions/grib2/tables/8/4.12.table | 12 +- definitions/grib2/tables/8/4.13.table | 10 +- definitions/grib2/tables/8/4.14.table | 6 +- definitions/grib2/tables/8/4.15.table | 20 +-- definitions/grib2/tables/8/4.2.0.0.table | 6 +- definitions/grib2/tables/8/4.2.0.1.table | 10 +- definitions/grib2/tables/8/4.2.0.13.table | 6 +- definitions/grib2/tables/8/4.2.0.14.table | 6 +- definitions/grib2/tables/8/4.2.0.15.table | 6 +- definitions/grib2/tables/8/4.2.0.16.table | 6 +- definitions/grib2/tables/8/4.2.0.18.table | 8 +- definitions/grib2/tables/8/4.2.0.19.table | 6 +- definitions/grib2/tables/8/4.2.0.190.table | 6 +- definitions/grib2/tables/8/4.2.0.191.table | 6 +- definitions/grib2/tables/8/4.2.0.2.table | 6 +- definitions/grib2/tables/8/4.2.0.20.table | 10 +- definitions/grib2/tables/8/4.2.0.3.table | 6 +- definitions/grib2/tables/8/4.2.0.4.table | 8 +- definitions/grib2/tables/8/4.2.0.5.table | 6 +- definitions/grib2/tables/8/4.2.0.6.table | 6 +- definitions/grib2/tables/8/4.2.0.7.table | 8 +- definitions/grib2/tables/8/4.2.1.0.table | 6 +- definitions/grib2/tables/8/4.2.1.1.table | 6 +- definitions/grib2/tables/8/4.2.10.0.table | 6 +- definitions/grib2/tables/8/4.2.10.1.table | 6 +- definitions/grib2/tables/8/4.2.10.191.table | 6 +- definitions/grib2/tables/8/4.2.10.2.table | 6 +- definitions/grib2/tables/8/4.2.10.3.table | 6 +- definitions/grib2/tables/8/4.2.10.4.table | 8 +- definitions/grib2/tables/8/4.2.2.0.table | 6 +- definitions/grib2/tables/8/4.2.2.3.table | 6 +- definitions/grib2/tables/8/4.2.3.0.table | 6 +- definitions/grib2/tables/8/4.2.3.1.table | 10 +- definitions/grib2/tables/8/4.201.table | 18 +-- definitions/grib2/tables/8/4.202.table | 6 +- definitions/grib2/tables/8/4.203.table | 50 +++---- definitions/grib2/tables/8/4.205.table | 10 +- definitions/grib2/tables/8/4.206.table | 10 +- definitions/grib2/tables/8/4.207.table | 18 +-- definitions/grib2/tables/8/4.208.table | 16 +-- definitions/grib2/tables/8/4.209.table | 16 +-- definitions/grib2/tables/8/4.210.table | 10 +- definitions/grib2/tables/8/4.211.table | 12 +- definitions/grib2/tables/8/4.212.table | 34 ++--- definitions/grib2/tables/8/4.213.table | 40 +++--- definitions/grib2/tables/8/4.215.table | 16 +-- definitions/grib2/tables/8/4.216.table | 6 +- definitions/grib2/tables/8/4.217.table | 14 +- definitions/grib2/tables/8/4.218.table | 74 +++++------ definitions/grib2/tables/8/4.219.table | 14 +- definitions/grib2/tables/8/4.220.table | 10 +- definitions/grib2/tables/8/4.221.table | 10 +- definitions/grib2/tables/8/4.222.table | 10 +- definitions/grib2/tables/8/4.223.table | 8 +- definitions/grib2/tables/8/4.224.table | 34 ++--- definitions/grib2/tables/8/4.3.table | 30 ++--- definitions/grib2/tables/8/4.4.table | 32 ++--- definitions/grib2/tables/8/4.5.table | 20 +-- definitions/grib2/tables/8/4.6.table | 16 +-- definitions/grib2/tables/8/4.7.table | 26 ++-- definitions/grib2/tables/8/4.8.table | 10 +- definitions/grib2/tables/8/4.9.table | 16 +-- definitions/grib2/tables/8/4.91.table | 30 ++--- definitions/grib2/tables/8/5.1.table | 10 +- definitions/grib2/tables/8/5.2.table | 10 +- definitions/grib2/tables/8/5.3.table | 12 +- definitions/grib2/tables/8/5.4.table | 10 +- definitions/grib2/tables/8/5.40.table | 8 +- definitions/grib2/tables/8/5.5.table | 12 +- definitions/grib2/tables/8/5.6.table | 12 +- definitions/grib2/tables/8/5.7.table | 12 +- definitions/grib2/tables/8/6.0.table | 6 +- definitions/grib2/tables/9/0.0.table | 18 +-- definitions/grib2/tables/9/1.0.table | 14 +- definitions/grib2/tables/9/1.1.table | 6 +- definitions/grib2/tables/9/1.2.table | 14 +- definitions/grib2/tables/9/1.3.table | 18 +-- definitions/grib2/tables/9/1.4.table | 24 ++-- definitions/grib2/tables/9/3.0.table | 8 +- definitions/grib2/tables/9/3.10.table | 14 +- definitions/grib2/tables/9/3.11.table | 2 +- definitions/grib2/tables/9/3.15.table | 18 +-- definitions/grib2/tables/9/3.2.table | 24 ++-- definitions/grib2/tables/9/3.20.table | 10 +- definitions/grib2/tables/9/3.21.table | 14 +- definitions/grib2/tables/9/3.3.table | 16 +-- definitions/grib2/tables/9/3.4.table | 18 +-- definitions/grib2/tables/9/3.5.table | 8 +- definitions/grib2/tables/9/3.7.table | 4 +- definitions/grib2/tables/9/3.8.table | 12 +- definitions/grib2/tables/9/3.9.table | 6 +- definitions/grib2/tables/9/4.0.table | 76 +++++------ definitions/grib2/tables/9/4.1.0.table | 52 ++++---- definitions/grib2/tables/9/4.1.1.table | 12 +- definitions/grib2/tables/9/4.1.10.table | 18 +-- definitions/grib2/tables/9/4.1.2.table | 16 +-- definitions/grib2/tables/9/4.1.3.table | 10 +- definitions/grib2/tables/9/4.10.table | 28 ++-- definitions/grib2/tables/9/4.11.table | 18 +-- definitions/grib2/tables/9/4.12.table | 8 +- definitions/grib2/tables/9/4.13.table | 6 +- definitions/grib2/tables/9/4.14.table | 6 +- definitions/grib2/tables/9/4.15.table | 16 +-- definitions/grib2/tables/9/4.2.0.0.table | 6 +- definitions/grib2/tables/9/4.2.0.1.table | 10 +- definitions/grib2/tables/9/4.2.0.13.table | 6 +- definitions/grib2/tables/9/4.2.0.14.table | 6 +- definitions/grib2/tables/9/4.2.0.15.table | 6 +- definitions/grib2/tables/9/4.2.0.16.table | 6 +- definitions/grib2/tables/9/4.2.0.18.table | 8 +- definitions/grib2/tables/9/4.2.0.19.table | 6 +- definitions/grib2/tables/9/4.2.0.190.table | 6 +- definitions/grib2/tables/9/4.2.0.191.table | 6 +- definitions/grib2/tables/9/4.2.0.2.table | 6 +- definitions/grib2/tables/9/4.2.0.20.table | 10 +- definitions/grib2/tables/9/4.2.0.3.table | 6 +- definitions/grib2/tables/9/4.2.0.4.table | 8 +- definitions/grib2/tables/9/4.2.0.5.table | 6 +- definitions/grib2/tables/9/4.2.0.6.table | 6 +- definitions/grib2/tables/9/4.2.0.7.table | 8 +- definitions/grib2/tables/9/4.2.1.0.table | 6 +- definitions/grib2/tables/9/4.2.1.1.table | 6 +- definitions/grib2/tables/9/4.2.10.0.table | 6 +- definitions/grib2/tables/9/4.2.10.1.table | 6 +- definitions/grib2/tables/9/4.2.10.191.table | 6 +- definitions/grib2/tables/9/4.2.10.2.table | 6 +- definitions/grib2/tables/9/4.2.10.3.table | 6 +- definitions/grib2/tables/9/4.2.10.4.table | 8 +- definitions/grib2/tables/9/4.2.2.0.table | 6 +- definitions/grib2/tables/9/4.2.2.3.table | 6 +- definitions/grib2/tables/9/4.2.3.0.table | 6 +- definitions/grib2/tables/9/4.2.3.1.table | 10 +- definitions/grib2/tables/9/4.201.table | 14 +- definitions/grib2/tables/9/4.203.table | 50 +++---- definitions/grib2/tables/9/4.204.table | 10 +- definitions/grib2/tables/9/4.205.table | 10 +- definitions/grib2/tables/9/4.206.table | 10 +- definitions/grib2/tables/9/4.207.table | 18 +-- definitions/grib2/tables/9/4.208.table | 16 +-- definitions/grib2/tables/9/4.209.table | 16 +-- definitions/grib2/tables/9/4.210.table | 10 +- definitions/grib2/tables/9/4.211.table | 12 +- definitions/grib2/tables/9/4.212.table | 34 ++--- definitions/grib2/tables/9/4.213.table | 40 +++--- definitions/grib2/tables/9/4.215.table | 16 +-- definitions/grib2/tables/9/4.216.table | 6 +- definitions/grib2/tables/9/4.217.table | 14 +- definitions/grib2/tables/9/4.218.table | 74 +++++------ definitions/grib2/tables/9/4.219.table | 14 +- definitions/grib2/tables/9/4.220.table | 10 +- definitions/grib2/tables/9/4.221.table | 10 +- definitions/grib2/tables/9/4.222.table | 10 +- definitions/grib2/tables/9/4.223.table | 8 +- definitions/grib2/tables/9/4.224.table | 34 ++--- definitions/grib2/tables/9/4.227.table | 2 +- definitions/grib2/tables/9/4.3.table | 30 ++--- definitions/grib2/tables/9/4.4.table | 32 ++--- definitions/grib2/tables/9/4.5.table | 20 +-- definitions/grib2/tables/9/4.6.table | 16 +-- definitions/grib2/tables/9/4.7.table | 26 ++-- definitions/grib2/tables/9/4.8.table | 10 +- definitions/grib2/tables/9/4.9.table | 16 +-- definitions/grib2/tables/9/4.91.table | 26 ++-- definitions/grib2/tables/9/5.1.table | 10 +- definitions/grib2/tables/9/5.2.table | 10 +- definitions/grib2/tables/9/5.3.table | 12 +- definitions/grib2/tables/9/5.4.table | 10 +- definitions/grib2/tables/9/5.40.table | 8 +- definitions/grib2/tables/9/5.5.table | 12 +- definitions/grib2/tables/9/5.6.table | 10 +- definitions/grib2/tables/9/5.7.table | 12 +- definitions/grib2/tables/9/6.0.table | 6 +- 1291 files changed, 10025 insertions(+), 10025 deletions(-) diff --git a/definitions/grib2/section.1.def b/definitions/grib2/section.1.def index 88fd55b80..c4e3c21f1 100644 --- a/definitions/grib2/section.1.def +++ b/definitions/grib2/section.1.def @@ -6,7 +6,7 @@ meta section1Pointer section_pointer(offsetSection1,section1Length,1); unsigned[1] numberOfSection = 1 :read_only; -codetable[2] centre 'common/c-11.table' : dump,string_type; +codetable[2] centre 'common/c-11.table' : dump,string_type; alias identificationOfOriginatingGeneratingCentre=centre; meta centreDescription codetable_title(centre); @@ -14,7 +14,7 @@ alias parameter.centre=centre; alias ls.centre=centre; alias originatingCentre=centre; -unsigned[2] subCentre : dump; +unsigned[2] subCentre : dump; _if (subCentre==98 ) { alias centreForLocal=subCentre; @@ -54,20 +54,20 @@ unsigned[1] hour; unsigned[1] minute; unsigned[1] second; -meta dataDate g2date(year,month,day) : dump; +meta dataDate g2date(year,month,day) : dump; alias mars.date = dataDate; alias ls.date = dataDate; meta julianDay julian_day(dataDate,hour,minute,second) : edition_specific; -meta dataTime time(hour,minute,second) : dump; +meta dataTime time(hour,minute,second) : dump; alias mars.time = dataTime; # Production status of processed data in this GRIB message codetable[1] productionStatusOfProcessedData ('1.3.table',masterDir,localDir) : dump; # Type of processed data in this GRIB message -codetable[1] typeOfProcessedData ('1.4.table',masterDir,localDir) = 255 : dump,string_type,no_fail; +codetable[1] typeOfProcessedData ('1.4.table',masterDir,localDir) = 255 : dump,string_type,no_fail; alias ls.dataType=typeOfProcessedData; diff --git a/definitions/grib2/tables/0/1.1.table b/definitions/grib2/tables/0/1.1.table index a3c2fdc79..a0502880b 100644 --- a/definitions/grib2/tables/0/1.1.table +++ b/definitions/grib2/tables/0/1.1.table @@ -1,2 +1,2 @@ -0 0 Local tables not used +0 0 Local tables not used 255 255 Missing diff --git a/definitions/grib2/tables/0/4.2.0.20.table b/definitions/grib2/tables/0/4.2.0.20.table index 2a66a0fe3..ffdfd8cbf 100644 --- a/definitions/grib2/tables/0/4.2.0.20.table +++ b/definitions/grib2/tables/0/4.2.0.20.table @@ -18,5 +18,5 @@ 58 58 Total yearly averaged atmospheric loss (see Note 1) mol s-1 100 100 Surface area density (aerosol) m-1 101 101 Atmosphere optical thickness m -255 255 Missing +255 255 Missing diff --git a/definitions/grib2/tables/0/4.5.table b/definitions/grib2/tables/0/4.5.table index 984d7a3a0..1c82cabbc 100644 --- a/definitions/grib2/tables/0/4.5.table +++ b/definitions/grib2/tables/0/4.5.table @@ -1,26 +1,26 @@ 0 0 Reserved -1 sfc Ground or water surface -2 2 Cloud base level -3 3 Level of cloud tops -4 4 Level of 0o C isotherm +1 sfc Ground or water surface +2 2 Cloud base level +3 3 Level of cloud tops +4 4 Level of 0o C isotherm 5 5 Level of adiabatic condensation lifted from the surface -6 6 Maximum wind level -7 sfc Tropopause -8 sfc Nominal top of the atmosphere -9 9 Sea bottom +6 6 Maximum wind level +7 sfc Tropopause +8 sfc Nominal top of the atmosphere +9 9 Sea bottom 20 20 Isothermal level (K) 100 pl Isobaric surface (Pa) 101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) -105 105 Hybrid level +105 105 Hybrid level 106 sfc Depth below land surface (m) 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) 110 110 Reserved -111 ml Eta level +111 ml Eta level 117 117 Mixed layer depth (m) 160 160 Depth below sea level (m) 255 255 Missing diff --git a/definitions/grib2/tables/1/1.1.table b/definitions/grib2/tables/1/1.1.table index a3c2fdc79..a0502880b 100644 --- a/definitions/grib2/tables/1/1.1.table +++ b/definitions/grib2/tables/1/1.1.table @@ -1,2 +1,2 @@ -0 0 Local tables not used +0 0 Local tables not used 255 255 Missing diff --git a/definitions/grib2/tables/1/4.5.table b/definitions/grib2/tables/1/4.5.table index 3b3039f7a..7c581e5ff 100644 --- a/definitions/grib2/tables/1/4.5.table +++ b/definitions/grib2/tables/1/4.5.table @@ -1,13 +1,13 @@ 0 0 Reserved -1 sfc Ground or water surface -2 2 Cloud base level -3 3 Level of cloud tops -4 4 Level of 0o C isotherm +1 sfc Ground or water surface +2 2 Cloud base level +3 3 Level of cloud tops +4 4 Level of 0o C isotherm 5 5 Level of adiabatic condensation lifted from the surface -6 6 Maximum wind level -7 sfc Tropopause -8 sfc Nominal top of the atmosphere -9 9 Sea bottom +6 6 Maximum wind level +7 sfc Tropopause +8 sfc Nominal top of the atmosphere +9 9 Sea bottom 20 20 Isothermal level (K) 100 pl Isobaric surface (Pa) 101 sfc Mean sea level diff --git a/definitions/grib2/tables/10/0.0.table b/definitions/grib2/tables/10/0.0.table index 1d3a90b49..88d8b2cb3 100644 --- a/definitions/grib2/tables/10/0.0.table +++ b/definitions/grib2/tables/10/0.0.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/1.1.table b/definitions/grib2/tables/10/1.1.table index 91ef66244..55fa1eb63 100644 --- a/definitions/grib2/tables/10/1.1.table +++ b/definitions/grib2/tables/10/1.1.table @@ -1,4 +1,4 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/10/1.2.table b/definitions/grib2/tables/10/1.2.table index d90ad0109..606bf8300 100644 --- a/definitions/grib2/tables/10/1.2.table +++ b/definitions/grib2/tables/10/1.2.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/1.3.table b/definitions/grib2/tables/10/1.3.table index 35cd6a636..712bb2ba8 100644 --- a/definitions/grib2/tables/10/1.3.table +++ b/definitions/grib2/tables/10/1.3.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products -4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) -5 5 THORPEX Interactive Grand Global Ensemble (TIGGE) test -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products +4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) +5 5 THORPEX Interactive Grand Global Ensemble (TIGGE) test +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/1.4.table b/definitions/grib2/tables/10/1.4.table index d11a335a7..7f47afd96 100644 --- a/definitions/grib2/tables/10/1.4.table +++ b/definitions/grib2/tables/10/1.4.table @@ -1,13 +1,13 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/10/3.0.table b/definitions/grib2/tables/10/3.0.table index 4baed0aab..4269b25ad 100644 --- a/definitions/grib2/tables/10/3.0.table +++ b/definitions/grib2/tables/10/3.0.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/10/3.10.table b/definitions/grib2/tables/10/3.10.table index 23c1cdd36..da36dc664 100644 --- a/definitions/grib2/tables/10/3.10.table +++ b/definitions/grib2/tables/10/3.10.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/10/3.11.table b/definitions/grib2/tables/10/3.11.table index 560318d1b..0a299af98 100644 --- a/definitions/grib2/tables/10/3.11.table +++ b/definitions/grib2/tables/10/3.11.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 There is no appended list +0 0 There is no appended list 1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows 2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row 3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) diff --git a/definitions/grib2/tables/10/3.15.table b/definitions/grib2/tables/10/3.15.table index 2394a293f..6087902a3 100644 --- a/definitions/grib2/tables/10/3.15.table +++ b/definitions/grib2/tables/10/3.15.table @@ -1,23 +1,23 @@ # Code table 3.15 - Physical meaning of vertical coordinate -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) 113 113 Logarithmic hybrid coordinate -# 114-159 Reserved +# 114-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/3.2.table b/definitions/grib2/tables/10/3.2.table index 1a3d03bbc..58a2a548b 100644 --- a/definitions/grib2/tables/10/3.2.table +++ b/definitions/grib2/tables/10/3.2.table @@ -1,14 +1,14 @@ # Code table 3.2 - Shape of the Earth -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame 9 9 Earth represented by the OSGB 1936 Datum, using the Airy_1830 Spheroid, the Greenwich meridian as 0 longitude, the Newlyn datum as mean sea level, 0 height -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/3.20.table b/definitions/grib2/tables/10/3.20.table index 3f7ab4cc4..63de6b1a9 100644 --- a/definitions/grib2/tables/10/3.20.table +++ b/definitions/grib2/tables/10/3.20.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/3.21.table b/definitions/grib2/tables/10/3.21.table index 88dbb9019..e001e1c8f 100644 --- a/definitions/grib2/tables/10/3.21.table +++ b/definitions/grib2/tables/10/3.21.table @@ -1,8 +1,8 @@ # Code table 3.21 - Vertical dimension coordinate values definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/3.3.table b/definitions/grib2/tables/10/3.3.table index 5167ed6b7..bd47e2509 100644 --- a/definitions/grib2/tables/10/3.3.table +++ b/definitions/grib2/tables/10/3.3.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/10/3.4.table b/definitions/grib2/tables/10/3.4.table index 63c8adaaa..ea9cbe829 100644 --- a/definitions/grib2/tables/10/3.4.table +++ b/definitions/grib2/tables/10/3.4.table @@ -1,10 +1,10 @@ # Flag table 3.4 - Scanning mode -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -# 5-8 Reserved +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +# 5-8 Reserved diff --git a/definitions/grib2/tables/10/3.5.table b/definitions/grib2/tables/10/3.5.table index 8ccf0f13b..6d3ec036e 100644 --- a/definitions/grib2/tables/10/3.5.table +++ b/definitions/grib2/tables/10/3.5.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/10/3.7.table b/definitions/grib2/tables/10/3.7.table index e2dc660dd..2d01b8d52 100644 --- a/definitions/grib2/tables/10/3.7.table +++ b/definitions/grib2/tables/10/3.7.table @@ -1,5 +1,5 @@ # Code table 3.7 - Spectral data representation mode -0 0 Reserved +0 0 Reserved 1 1 The complex numbers Fnm. See separate doc or pdf file -# 2-254 Reserved -255 255 Missing +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/10/3.8.table b/definitions/grib2/tables/10/3.8.table index 4e811917b..6df554ae9 100644 --- a/definitions/grib2/tables/10/3.8.table +++ b/definitions/grib2/tables/10/3.8.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/3.9.table b/definitions/grib2/tables/10/3.9.table index f35b7ca53..530d1dee0 100644 --- a/definitions/grib2/tables/10/3.9.table +++ b/definitions/grib2/tables/10/3.9.table @@ -1,4 +1,4 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/10/4.0.table b/definitions/grib2/tables/10/4.0.table index 5f405bed8..28733d42d 100644 --- a/definitions/grib2/tables/10/4.0.table +++ b/definitions/grib2/tables/10/4.0.table @@ -1,52 +1,52 @@ # Code table 4.0 - Product definition template number -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time 8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data # 33-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents 42 42 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 atmospheric chemical constituents 43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol 46 46 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 aerosol 47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol -48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time -# 52-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +# 52-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved +# 1102-32767 Reserved # 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data diff --git a/definitions/grib2/tables/10/4.1.0.table b/definitions/grib2/tables/10/4.1.0.table index 361108860..3413dbad5 100644 --- a/definitions/grib2/tables/10/4.1.0.table +++ b/definitions/grib2/tables/10/4.1.0.table @@ -1,27 +1,27 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.1.1.table b/definitions/grib2/tables/10/4.1.1.table index 29f1dec79..dea5bc49e 100644 --- a/definitions/grib2/tables/10/4.1.1.table +++ b/definitions/grib2/tables/10/4.1.1.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.1.10.table b/definitions/grib2/tables/10/4.1.10.table index 9c8c92b12..e6ce6faf7 100644 --- a/definitions/grib2/tables/10/4.1.10.table +++ b/definitions/grib2/tables/10/4.1.10.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Sub-surface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Sub-surface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.1.2.table b/definitions/grib2/tables/10/4.1.2.table index b90201c63..805836998 100644 --- a/definitions/grib2/tables/10/4.1.2.table +++ b/definitions/grib2/tables/10/4.1.2.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.1.3.table b/definitions/grib2/tables/10/4.1.3.table index fe1d8ae5a..adcbfb051 100644 --- a/definitions/grib2/tables/10/4.1.3.table +++ b/definitions/grib2/tables/10/4.1.3.table @@ -1,8 +1,8 @@ # Code table 4.1 - Parameter category by product discipline. Product discipline 3 - Space products -0 0 Image format products -1 1 Quantitative products -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.10.table b/definitions/grib2/tables/10/4.10.table index 1a92baaf6..8a390e4be 100644 --- a/definitions/grib2/tables/10/4.10.table +++ b/definitions/grib2/tables/10/4.10.table @@ -1,16 +1,16 @@ # Code table 4.10 - Type of statistical processing -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -11 11 Summation -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/10/4.11.table b/definitions/grib2/tables/10/4.11.table index 1257d1b09..af9ff29ad 100644 --- a/definitions/grib2/tables/10/4.11.table +++ b/definitions/grib2/tables/10/4.11.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.12.table b/definitions/grib2/tables/10/4.12.table index e06a3be5b..6cab67bf5 100644 --- a/definitions/grib2/tables/10/4.12.table +++ b/definitions/grib2/tables/10/4.12.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.13.table b/definitions/grib2/tables/10/4.13.table index 107ace60c..f090fb9ae 100644 --- a/definitions/grib2/tables/10/4.13.table +++ b/definitions/grib2/tables/10/4.13.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No quality control applied -1 1 Quality control applied -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.14.table b/definitions/grib2/tables/10/4.14.table index 24a228921..bcb04f328 100644 --- a/definitions/grib2/tables/10/4.14.table +++ b/definitions/grib2/tables/10/4.14.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No clutter filter used -1 1 Clutter filter used -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.15.table b/definitions/grib2/tables/10/4.15.table index 97cdcd2ee..6e1ef5745 100644 --- a/definitions/grib2/tables/10/4.15.table +++ b/definitions/grib2/tables/10/4.15.table @@ -1,11 +1,11 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.0.table b/definitions/grib2/tables/10/4.2.0.0.table index debc0a6f4..8656f8974 100644 --- a/definitions/grib2/tables/10/4.2.0.0.table +++ b/definitions/grib2/tables/10/4.2.0.0.table @@ -20,6 +20,6 @@ 18 18 Snow temperature (top of snow) (K) 19 19 Turbulent transfer coefficient for heat (Numeric) 20 20 Turbulent diffusion coefficient for heat (m2/s) -# 21-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 21-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.1.table b/definitions/grib2/tables/10/4.2.0.1.table index b95e8699d..3d68fbe86 100644 --- a/definitions/grib2/tables/10/4.2.0.1.table +++ b/definitions/grib2/tables/10/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,10 +86,10 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rainwater content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) -# 93-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 93-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.13.table b/definitions/grib2/tables/10/4.2.0.13.table index b9979f0d3..90ab7d1b9 100644 --- a/definitions/grib2/tables/10/4.2.0.13.table +++ b/definitions/grib2/tables/10/4.2.0.13.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.14.table b/definitions/grib2/tables/10/4.2.0.14.table index 4a2a4e128..fca42ccc7 100644 --- a/definitions/grib2/tables/10/4.2.0.14.table +++ b/definitions/grib2/tables/10/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.15.table b/definitions/grib2/tables/10/4.2.0.15.table index 895892f86..66ccff19d 100644 --- a/definitions/grib2/tables/10/4.2.0.15.table +++ b/definitions/grib2/tables/10/4.2.0.15.table @@ -14,6 +14,6 @@ 12 12 Reflectivity of rain (dB) 13 13 Reflectivity of graupel (dB) 14 14 Reflectivity of hail (dB) -# 15-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 15-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.16.table b/definitions/grib2/tables/10/4.2.0.16.table index 39215ab20..18dedb7c0 100644 --- a/definitions/grib2/tables/10/4.2.0.16.table +++ b/definitions/grib2/tables/10/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.18.table b/definitions/grib2/tables/10/4.2.0.18.table index 30060fd2d..165aa6008 100644 --- a/definitions/grib2/tables/10/4.2.0.18.table +++ b/definitions/grib2/tables/10/4.2.0.18.table @@ -8,11 +8,11 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) 13 13 Total deposition (wet + dry) (Bq m-2) -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.19.table b/definitions/grib2/tables/10/4.2.0.19.table index 2aa34464a..90003262e 100644 --- a/definitions/grib2/tables/10/4.2.0.19.table +++ b/definitions/grib2/tables/10/4.2.0.19.table @@ -27,6 +27,6 @@ 25 25 Weather (Code table 4.225) 26 26 Convective outlook (Code table 4.224) 27 27 Icing scenario (Code table 4.227) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.190.table b/definitions/grib2/tables/10/4.2.0.190.table index 39fb55746..3d9d5ff85 100644 --- a/definitions/grib2/tables/10/4.2.0.190.table +++ b/definitions/grib2/tables/10/4.2.0.190.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.191.table b/definitions/grib2/tables/10/4.2.0.191.table index 81230c0e0..4ff12e532 100644 --- a/definitions/grib2/tables/10/4.2.0.191.table +++ b/definitions/grib2/tables/10/4.2.0.191.table @@ -2,6 +2,6 @@ 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/10/4.2.0.2.table b/definitions/grib2/tables/10/4.2.0.2.table index a3b08a8f0..6fcd262b0 100644 --- a/definitions/grib2/tables/10/4.2.0.2.table +++ b/definitions/grib2/tables/10/4.2.0.2.table @@ -35,6 +35,6 @@ 33 33 Wind fetch (m) 34 34 Normal wind component (m/s) 35 35 Tangential wind component (m/s) -# 36-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 36-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.20.table b/definitions/grib2/tables/10/4.2.0.20.table index cc2dbcc52..898a774eb 100644 --- a/definitions/grib2/tables/10/4.2.0.20.table +++ b/definitions/grib2/tables/10/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (Sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -25,7 +25,7 @@ 57 57 Total yearly average burden of the atmosphere (mol) 58 58 Total yearly averaged atmospheric loss (mol/s) 59 59 Aerosol number concentration (m-3) -# 60-99 Reserved +# 60-99 Reserved 100 100 Surface area density (aerosol) (/m) 101 101 Vertical visual range (m) 102 102 Aerosol optical thickness (Numeric) @@ -37,6 +37,6 @@ 108 108 Aerosol lidar backscatter from the ground (m-1 sr-1) 109 109 Aerosol lidar extinction from satellite (m-1) 110 110 Aerosol lidar extinction from the ground (m-1) -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.3.table b/definitions/grib2/tables/10/4.2.0.3.table index f718c6ea9..08c1c7bc3 100644 --- a/definitions/grib2/tables/10/4.2.0.3.table +++ b/definitions/grib2/tables/10/4.2.0.3.table @@ -26,6 +26,6 @@ 24 24 Anisotropy of sub-gridscale orography (Numeric) 25 25 Natural logarithm of pressure in Pa (Numeric) 26 26 Exner pressure (Numeric) -# 27-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 27-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.4.table b/definitions/grib2/tables/10/4.2.0.4.table index fea4cafc3..336fdb421 100644 --- a/definitions/grib2/tables/10/4.2.0.4.table +++ b/definitions/grib2/tables/10/4.2.0.4.table @@ -12,9 +12,9 @@ 10 10 Photosynthetically active radiation (W m-2) 11 11 Net short-wave radiation flux, clear sky (W m-2) 12 12 Downward UV radiation (W m-2) -# 13-49 Reserved +# 13-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) -# 52-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 52-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.5.table b/definitions/grib2/tables/10/4.2.0.5.table index b0c93dd3a..86a199ace 100644 --- a/definitions/grib2/tables/10/4.2.0.5.table +++ b/definitions/grib2/tables/10/4.2.0.5.table @@ -6,6 +6,6 @@ 4 4 Upward long-wave radiation flux (W m-2) 5 5 Net long-wave radiation flux (W m-2) 6 6 Net long-wave radiation flux, clear sky (W m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.6.table b/definitions/grib2/tables/10/4.2.0.6.table index fd4b23014..fb935344e 100644 --- a/definitions/grib2/tables/10/4.2.0.6.table +++ b/definitions/grib2/tables/10/4.2.0.6.table @@ -35,6 +35,6 @@ 33 33 Sunshine duration (s) 34 34 Surface long wave effective total cloudiness (Numeric) 35 35 Surface short wave effective total cloudiness (Numeric) -# 36-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 36-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.0.7.table b/definitions/grib2/tables/10/4.2.0.7.table index 7a7d2008b..6c1794c73 100644 --- a/definitions/grib2/tables/10/4.2.0.7.table +++ b/definitions/grib2/tables/10/4.2.0.7.table @@ -13,8 +13,8 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraft helicity (m2 s-2) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.1.0.table b/definitions/grib2/tables/10/4.2.1.0.table index bf1e3e93f..9c4d129da 100644 --- a/definitions/grib2/tables/10/4.2.1.0.table +++ b/definitions/grib2/tables/10/4.2.1.0.table @@ -6,6 +6,6 @@ 4 4 Snow water equivalent per cent of normal (%) 5 5 Baseflow-groundwater runoff (kg m-2) 6 6 Storm surface runoff (kg m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.1.1.table b/definitions/grib2/tables/10/4.2.1.1.table index cb5117dc8..aa560e479 100644 --- a/definitions/grib2/tables/10/4.2.1.1.table +++ b/definitions/grib2/tables/10/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.10.0.table b/definitions/grib2/tables/10/4.2.10.0.table index a620c36ba..78d3bdef4 100644 --- a/definitions/grib2/tables/10/4.2.10.0.table +++ b/definitions/grib2/tables/10/4.2.10.0.table @@ -45,6 +45,6 @@ 43 43 Kurtosis of the sea surface elevation due to waves (-) 44 44 Benjamin-Feir index (-) 45 45 Spectral peakedness factor (s-1) -# 46-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 46-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.10.1.table b/definitions/grib2/tables/10/4.2.10.1.table index ae52b0c26..de6b562b8 100644 --- a/definitions/grib2/tables/10/4.2.10.1.table +++ b/definitions/grib2/tables/10/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.10.191.table b/definitions/grib2/tables/10/4.2.10.191.table index 14085ac9a..6cafbd3d4 100644 --- a/definitions/grib2/tables/10/4.2.10.191.table +++ b/definitions/grib2/tables/10/4.2.10.191.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Meridional overturning stream function (m3/s) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.10.2.table b/definitions/grib2/tables/10/4.2.10.2.table index a6d9dd0c8..258aeef18 100644 --- a/definitions/grib2/tables/10/4.2.10.2.table +++ b/definitions/grib2/tables/10/4.2.10.2.table @@ -9,6 +9,6 @@ 7 7 Ice divergence (/s) 8 8 Ice temperature (K) 9 9 Ice internal pressure (Pa m) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.10.3.table b/definitions/grib2/tables/10/4.2.10.3.table index 112af09d5..3b9a2df46 100644 --- a/definitions/grib2/tables/10/4.2.10.3.table +++ b/definitions/grib2/tables/10/4.2.10.3.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.10.4.table b/definitions/grib2/tables/10/4.2.10.4.table index d80a32780..91ffb2b29 100644 --- a/definitions/grib2/tables/10/4.2.10.4.table +++ b/definitions/grib2/tables/10/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2 s-1) 6 6 Ocean vertical momentum diffusivity (m2 s-1) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (m-1) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.2.0.table b/definitions/grib2/tables/10/4.2.2.0.table index 9a426a5c2..0632ff414 100644 --- a/definitions/grib2/tables/10/4.2.2.0.table +++ b/definitions/grib2/tables/10/4.2.2.0.table @@ -32,6 +32,6 @@ 30 30 Deciduous forest cover (Proportion) 31 31 Normalized differential vegetation index (NDVI) (Numeric) 32 32 Root depth of vegetation (m) -# 33-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 33-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.2.3.table b/definitions/grib2/tables/10/4.2.2.3.table index e985e41aa..d7db59d5e 100644 --- a/definitions/grib2/tables/10/4.2.2.3.table +++ b/definitions/grib2/tables/10/4.2.2.3.table @@ -22,6 +22,6 @@ 20 20 Column-integrated soil moisture (kg m-2) 21 21 Soil ice (kg m-3) 22 22 Column-integrated soil ice (kg m-2) -# 23-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 23-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.2.4.table b/definitions/grib2/tables/10/4.2.2.4.table index a5f0a3c5c..0992f59db 100644 --- a/definitions/grib2/tables/10/4.2.2.4.table +++ b/definitions/grib2/tables/10/4.2.2.4.table @@ -4,5 +4,5 @@ 2 2 Haines Index (Numeric) 3 3 Fire burned area (%) # 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.3.0.table b/definitions/grib2/tables/10/4.2.3.0.table index 254e56bc8..8c19d43b2 100644 --- a/definitions/grib2/tables/10/4.2.3.0.table +++ b/definitions/grib2/tables/10/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.2.3.1.table b/definitions/grib2/tables/10/4.2.3.1.table index 176ac35fb..af1896b14 100644 --- a/definitions/grib2/tables/10/4.2.3.1.table +++ b/definitions/grib2/tables/10/4.2.3.1.table @@ -17,12 +17,12 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) 20 20 Aerosol optical thickness at 0.635 um 21 21 Aerosol optical thickness at 0.810 um 22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +23 23 Angstrom coefficient +# 24-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.201.table b/definitions/grib2/tables/10/4.201.table index ebb698b38..e16d5d808 100644 --- a/definitions/grib2/tables/10/4.201.table +++ b/definitions/grib2/tables/10/4.201.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Rain -2 2 Thunderstorm -3 3 Freezing rain -4 4 Mixed/ice -5 5 Snow -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.202.table b/definitions/grib2/tables/10/4.202.table index 943c03f6f..aa93458f1 100644 --- a/definitions/grib2/tables/10/4.202.table +++ b/definitions/grib2/tables/10/4.202.table @@ -1,4 +1,4 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -# 0-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.203.table b/definitions/grib2/tables/10/4.203.table index 9736c1ab3..b8c37f87f 100644 --- a/definitions/grib2/tables/10/4.203.table +++ b/definitions/grib2/tables/10/4.203.table @@ -1,26 +1,26 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.204.table b/definitions/grib2/tables/10/4.204.table index 51d1cecce..8d8bca9b2 100644 --- a/definitions/grib2/tables/10/4.204.table +++ b/definitions/grib2/tables/10/4.204.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 None -1 1 Isolated (1-2%) -2 2 Few (3-5%) -3 3 Scattered (16-45%) -4 4 Numerous (> 45%) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (16-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.205.table b/definitions/grib2/tables/10/4.205.table index 8d425ab9d..3fadf7d80 100644 --- a/definitions/grib2/tables/10/4.205.table +++ b/definitions/grib2/tables/10/4.205.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.206.table b/definitions/grib2/tables/10/4.206.table index 0be7fd4f8..43b0ba137 100644 --- a/definitions/grib2/tables/10/4.206.table +++ b/definitions/grib2/tables/10/4.206.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.207.table b/definitions/grib2/tables/10/4.207.table index fde9eb477..815a5777e 100644 --- a/definitions/grib2/tables/10/4.207.table +++ b/definitions/grib2/tables/10/4.207.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.208.table b/definitions/grib2/tables/10/4.208.table index 196becaaf..23ea97317 100644 --- a/definitions/grib2/tables/10/4.208.table +++ b/definitions/grib2/tables/10/4.208.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.209.table b/definitions/grib2/tables/10/4.209.table index 351c0f431..53c6c5eba 100644 --- a/definitions/grib2/tables/10/4.209.table +++ b/definitions/grib2/tables/10/4.209.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Stable -2 2 Mechanically-driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically-driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.210.table b/definitions/grib2/tables/10/4.210.table index 1c00b8c6f..149b2ba06 100644 --- a/definitions/grib2/tables/10/4.210.table +++ b/definitions/grib2/tables/10/4.210.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Contrail not present -1 1 Contrail present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Contrail not present +1 1 Contrail present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.211.table b/definitions/grib2/tables/10/4.211.table index 66ef656f6..b5753f19f 100644 --- a/definitions/grib2/tables/10/4.211.table +++ b/definitions/grib2/tables/10/4.211.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.212.table b/definitions/grib2/tables/10/4.212.table index c59bd24e8..738c45d2c 100644 --- a/definitions/grib2/tables/10/4.212.table +++ b/definitions/grib2/tables/10/4.212.table @@ -1,18 +1,18 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.213.table b/definitions/grib2/tables/10/4.213.table index c65784a00..68d627af6 100644 --- a/definitions/grib2/tables/10/4.213.table +++ b/definitions/grib2/tables/10/4.213.table @@ -1,16 +1,16 @@ # Code table 4.213 - Soil type -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.215.table b/definitions/grib2/tables/10/4.215.table index 460888217..5ed37c034 100644 --- a/definitions/grib2/tables/10/4.215.table +++ b/definitions/grib2/tables/10/4.215.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.216.table b/definitions/grib2/tables/10/4.216.table index 4d9a70f86..b51b358f4 100644 --- a/definitions/grib2/tables/10/4.216.table +++ b/definitions/grib2/tables/10/4.216.table @@ -1,5 +1,5 @@ # Code table 4.216 - Elevation of snow-covered terrain # 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/10/4.217.table b/definitions/grib2/tables/10/4.217.table index 51a263a99..6a014c9c3 100644 --- a/definitions/grib2/tables/10/4.217.table +++ b/definitions/grib2/tables/10/4.217.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.218.table b/definitions/grib2/tables/10/4.218.table index d4b2ab843..b6087448f 100644 --- a/definitions/grib2/tables/10/4.218.table +++ b/definitions/grib2/tables/10/4.218.table @@ -1,38 +1,38 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation / crops -15 15 Permanent snow / ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -# 19-96 Reserved -97 97 Snow / ice on land -98 98 Snow / ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud / fog / Stratus -102 102 Low cloud / Stratocumulus -103 103 Low cloud / unknown type -104 104 Medium cloud / Nimbostratus -105 105 Medium cloud / Altostratus -106 106 Medium cloud / unknown type -107 107 High cloud / Cumulus -108 108 High cloud / Cirrus -109 109 High cloud / unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation / crops +15 15 Permanent snow / ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +# 19-96 Reserved +97 97 Snow / ice on land +98 98 Snow / ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud / fog / Stratus +102 102 Low cloud / Stratocumulus +103 103 Low cloud / unknown type +104 104 Medium cloud / Nimbostratus +105 105 Medium cloud / Altostratus +106 106 Medium cloud / unknown type +107 107 High cloud / Cumulus +108 108 High cloud / Cirrus +109 109 High cloud / unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.219.table b/definitions/grib2/tables/10/4.219.table index f10ce468e..a02452fc4 100644 --- a/definitions/grib2/tables/10/4.219.table +++ b/definitions/grib2/tables/10/4.219.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.220.table b/definitions/grib2/tables/10/4.220.table index 9c957eb01..7a18fa1fd 100644 --- a/definitions/grib2/tables/10/4.220.table +++ b/definitions/grib2/tables/10/4.220.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.221.table b/definitions/grib2/tables/10/4.221.table index 5466929c7..eb0b64502 100644 --- a/definitions/grib2/tables/10/4.221.table +++ b/definitions/grib2/tables/10/4.221.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.222.table b/definitions/grib2/tables/10/4.222.table index c54194e29..f554a7f3d 100644 --- a/definitions/grib2/tables/10/4.222.table +++ b/definitions/grib2/tables/10/4.222.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.223.table b/definitions/grib2/tables/10/4.223.table index b6a9be136..706abab78 100644 --- a/definitions/grib2/tables/10/4.223.table +++ b/definitions/grib2/tables/10/4.223.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing value +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing value diff --git a/definitions/grib2/tables/10/4.224.table b/definitions/grib2/tables/10/4.224.table index af846f841..cf67496b8 100644 --- a/definitions/grib2/tables/10/4.224.table +++ b/definitions/grib2/tables/10/4.224.table @@ -1,18 +1,18 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/10/4.227.table b/definitions/grib2/tables/10/4.227.table index 6a98d49d0..7676664e4 100644 --- a/definitions/grib2/tables/10/4.227.table +++ b/definitions/grib2/tables/10/4.227.table @@ -4,6 +4,6 @@ 2 2 Convective 3 3 Stratiform 4 4 Freezing -# 5-191 Reserved +# 5-191 Reserved # 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/10/4.3.table b/definitions/grib2/tables/10/4.3.table index 68e2cc83f..8a4e919c9 100644 --- a/definitions/grib2/tables/10/4.3.table +++ b/definitions/grib2/tables/10/4.3.table @@ -1,16 +1,16 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.4.table b/definitions/grib2/tables/10/4.4.table index 7087ebddb..6e63e069c 100644 --- a/definitions/grib2/tables/10/4.4.table +++ b/definitions/grib2/tables/10/4.4.table @@ -1,17 +1,17 @@ # Code table 4.4 - Indicator of unit of time range -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.5.table b/definitions/grib2/tables/10/4.5.table index 1ada3eb23..c3b8aec5d 100644 --- a/definitions/grib2/tables/10/4.5.table +++ b/definitions/grib2/tables/10/4.5.table @@ -1,5 +1,5 @@ # Code table 4.5 - Fixed surface types and units -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface 2 2 Cloud base level 3 3 Level of cloud tops @@ -12,11 +12,11 @@ 10 10 Entire atmosphere 11 11 Cumulonimbus (CB) base (m) 12 12 Cumulonimbus (CB) top (m) -# 13-19 Reserved +# 13-19 Reserved 20 20 Isothermal level (K) -# 21-99 Reserved +# 21-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -25,7 +25,7 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level 112 112 Reserved 113 113 Logarithmic hybrid level @@ -36,7 +36,7 @@ 119 hpl Hybrid pressure level # 120-149 Reserved 150 150 Generalized vertical height coordinate -# 151-159 Reserved +# 151-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 sfc Lake or river bottom @@ -44,6 +44,6 @@ 164 164 Bottom of thermally active sediment layer 165 165 Bottom of sediment layer penetrated by thermal wave 166 sfc Mixing layer -# 167-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 167-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.6.table b/definitions/grib2/tables/10/4.6.table index 54f2993c3..eaa5c4362 100644 --- a/definitions/grib2/tables/10/4.6.table +++ b/definitions/grib2/tables/10/4.6.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.7.table b/definitions/grib2/tables/10/4.7.table index 23e0d457e..e6d887bdb 100644 --- a/definitions/grib2/tables/10/4.7.table +++ b/definitions/grib2/tables/10/4.7.table @@ -1,14 +1,14 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.8.table b/definitions/grib2/tables/10/4.8.table index 37a6cf767..d06153079 100644 --- a/definitions/grib2/tables/10/4.8.table +++ b/definitions/grib2/tables/10/4.8.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.9.table b/definitions/grib2/tables/10/4.9.table index 19e64a3d2..5243e58dd 100644 --- a/definitions/grib2/tables/10/4.9.table +++ b/definitions/grib2/tables/10/4.9.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/4.91.table b/definitions/grib2/tables/10/4.91.table index 97b1c70ad..ae31ed61c 100644 --- a/definitions/grib2/tables/10/4.91.table +++ b/definitions/grib2/tables/10/4.91.table @@ -1,16 +1,16 @@ # Code table 4.91 - Type of Interval -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit 11 11 Equal to first limit -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/10/5.1.table b/definitions/grib2/tables/10/5.1.table index 100d4106d..158a35850 100644 --- a/definitions/grib2/tables/10/5.1.table +++ b/definitions/grib2/tables/10/5.1.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/5.2.table b/definitions/grib2/tables/10/5.2.table index 7a4500ecd..d12b46fbd 100644 --- a/definitions/grib2/tables/10/5.2.table +++ b/definitions/grib2/tables/10/5.2.table @@ -1,8 +1,8 @@ # Code table 5.2 - Matrix coordinate value function definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use +# 12-191 Reserved +# 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/10/5.3.table b/definitions/grib2/tables/10/5.3.table index 705fa6524..6f228aeec 100644 --- a/definitions/grib2/tables/10/5.3.table +++ b/definitions/grib2/tables/10/5.3.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/5.4.table b/definitions/grib2/tables/10/5.4.table index 8133367a5..f844f557e 100644 --- a/definitions/grib2/tables/10/5.4.table +++ b/definitions/grib2/tables/10/5.4.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/5.40.table b/definitions/grib2/tables/10/5.40.table index 0d56ad0e0..2431eb547 100644 --- a/definitions/grib2/tables/10/5.40.table +++ b/definitions/grib2/tables/10/5.40.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/10/5.5.table b/definitions/grib2/tables/10/5.5.table index 5d625dbda..f2216e273 100644 --- a/definitions/grib2/tables/10/5.5.table +++ b/definitions/grib2/tables/10/5.5.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/5.6.table b/definitions/grib2/tables/10/5.6.table index 5838e994d..3b0892d37 100644 --- a/definitions/grib2/tables/10/5.6.table +++ b/definitions/grib2/tables/10/5.6.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/10/5.7.table b/definitions/grib2/tables/10/5.7.table index b93aa8130..f056d3059 100644 --- a/definitions/grib2/tables/10/5.7.table +++ b/definitions/grib2/tables/10/5.7.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/10/6.0.table b/definitions/grib2/tables/10/6.0.table index f539b26d7..a8f30f5a4 100644 --- a/definitions/grib2/tables/10/6.0.table +++ b/definitions/grib2/tables/10/6.0.table @@ -1,6 +1,6 @@ # Code table 6.0 - Bit map indicator 0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/11/0.0.table b/definitions/grib2/tables/11/0.0.table index b24c50564..2c5afceb4 100644 --- a/definitions/grib2/tables/11/0.0.table +++ b/definitions/grib2/tables/11/0.0.table @@ -1,10 +1,10 @@ # Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/1.1.table b/definitions/grib2/tables/11/1.1.table index d50f8fd72..f6d332005 100644 --- a/definitions/grib2/tables/11/1.1.table +++ b/definitions/grib2/tables/11/1.1.table @@ -1,4 +1,4 @@ # Code table 1.1 - GRIB local tables version number -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/11/1.2.table b/definitions/grib2/tables/11/1.2.table index 934b70455..638f1efbb 100644 --- a/definitions/grib2/tables/11/1.2.table +++ b/definitions/grib2/tables/11/1.2.table @@ -1,8 +1,8 @@ # Code table 1.2 - Significance of reference time -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/1.3.table b/definitions/grib2/tables/11/1.3.table index e8c38878d..34ace7fda 100644 --- a/definitions/grib2/tables/11/1.3.table +++ b/definitions/grib2/tables/11/1.3.table @@ -1,12 +1,12 @@ # Code table 1.3 - Production status of data -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products 4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) 5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) 6 6 Sub-seasonal to seasonal prediction project (S2S) 7 7 Sub-seasonal to seasonal prediction project test (S2S) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/1.4.table b/definitions/grib2/tables/11/1.4.table index 03203d874..877288c0e 100644 --- a/definitions/grib2/tables/11/1.4.table +++ b/definitions/grib2/tables/11/1.4.table @@ -1,13 +1,13 @@ # Code table 1.4 - Type of data -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/11/3.0.table b/definitions/grib2/tables/11/3.0.table index 45187b80d..a442a06a0 100644 --- a/definitions/grib2/tables/11/3.0.table +++ b/definitions/grib2/tables/11/3.0.table @@ -1,6 +1,6 @@ # Code table 3.0 - Source of grid definition -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/11/3.10.table b/definitions/grib2/tables/11/3.10.table index afa8843a7..1612d05e3 100644 --- a/definitions/grib2/tables/11/3.10.table +++ b/definitions/grib2/tables/11/3.10.table @@ -1,8 +1,8 @@ # Flag table 3.10 - Scanning mode for one diamond -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/11/3.11.table b/definitions/grib2/tables/11/3.11.table index e516a2ab9..06ae10810 100644 --- a/definitions/grib2/tables/11/3.11.table +++ b/definitions/grib2/tables/11/3.11.table @@ -1,7 +1,7 @@ # Code table 3.11 - Interpretation of list of numbers at end of section 3 -0 0 There is no appended list -1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows -2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row -3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) -# 4-254 Reserved -255 255 Missing +0 0 There is no appended list +1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows +2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row +3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/11/3.15.table b/definitions/grib2/tables/11/3.15.table index 331217ebe..6087902a3 100644 --- a/definitions/grib2/tables/11/3.15.table +++ b/definitions/grib2/tables/11/3.15.table @@ -1,23 +1,23 @@ # Code table 3.15 - Physical meaning of vertical coordinate -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) -113 113 Logarithmic hybrid coordinate -# 114-159 Reserved +113 113 Logarithmic hybrid coordinate +# 114-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/3.2.table b/definitions/grib2/tables/11/3.2.table index a2107f6e9..b9574a424 100644 --- a/definitions/grib2/tables/11/3.2.table +++ b/definitions/grib2/tables/11/3.2.table @@ -1,14 +1,14 @@ # Code table 3.2 - Shape of the Earth -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame 9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/3.20.table b/definitions/grib2/tables/11/3.20.table index efbf08d19..e2bb156ee 100644 --- a/definitions/grib2/tables/11/3.20.table +++ b/definitions/grib2/tables/11/3.20.table @@ -1,6 +1,6 @@ # Code table 3.20 - Type of horizontal line -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/3.21.table b/definitions/grib2/tables/11/3.21.table index 88dbb9019..e001e1c8f 100644 --- a/definitions/grib2/tables/11/3.21.table +++ b/definitions/grib2/tables/11/3.21.table @@ -1,8 +1,8 @@ # Code table 3.21 - Vertical dimension coordinate values definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/3.3.table b/definitions/grib2/tables/11/3.3.table index 5dd7c7001..25cb46a1d 100644 --- a/definitions/grib2/tables/11/3.3.table +++ b/definitions/grib2/tables/11/3.3.table @@ -1,9 +1,9 @@ # Flag table 3.3 - Resolution and component flags -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/11/3.4.table b/definitions/grib2/tables/11/3.4.table index 63c8adaaa..ea9cbe829 100644 --- a/definitions/grib2/tables/11/3.4.table +++ b/definitions/grib2/tables/11/3.4.table @@ -1,10 +1,10 @@ # Flag table 3.4 - Scanning mode -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -# 5-8 Reserved +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +# 5-8 Reserved diff --git a/definitions/grib2/tables/11/3.5.table b/definitions/grib2/tables/11/3.5.table index eabdde896..2f8ec82e3 100644 --- a/definitions/grib2/tables/11/3.5.table +++ b/definitions/grib2/tables/11/3.5.table @@ -1,5 +1,5 @@ # Flag table 3.5 - Projection centre -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/11/3.7.table b/definitions/grib2/tables/11/3.7.table index e2dc660dd..2d01b8d52 100644 --- a/definitions/grib2/tables/11/3.7.table +++ b/definitions/grib2/tables/11/3.7.table @@ -1,5 +1,5 @@ # Code table 3.7 - Spectral data representation mode -0 0 Reserved +0 0 Reserved 1 1 The complex numbers Fnm. See separate doc or pdf file -# 2-254 Reserved -255 255 Missing +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/11/3.8.table b/definitions/grib2/tables/11/3.8.table index 844e74235..578fab37f 100644 --- a/definitions/grib2/tables/11/3.8.table +++ b/definitions/grib2/tables/11/3.8.table @@ -1,7 +1,7 @@ # Code table 3.8 - Grid point position -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/3.9.table b/definitions/grib2/tables/11/3.9.table index fd730bc64..ecd65514a 100644 --- a/definitions/grib2/tables/11/3.9.table +++ b/definitions/grib2/tables/11/3.9.table @@ -1,4 +1,4 @@ # Flag table 3.9 - Numbering order of diamonds as seen from the corresponding pole -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/11/4.0.table b/definitions/grib2/tables/11/4.0.table index 1c1fe09ab..51b3ccfa7 100644 --- a/definitions/grib2/tables/11/4.0.table +++ b/definitions/grib2/tables/11/4.0.table @@ -1,59 +1,59 @@ # Code table 4.0 - Product definition template number -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time 8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval 15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -# 35-39 Reserved +# 35-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents 42 42 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 atmospheric chemical constituents -43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol 46 46 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 aerosol -47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol -48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time 53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time 54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters 60 60 Individual ensemble re-forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time 61 61 Individual ensemble re-forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 55-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +# 55-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved -# 32768-65534 Reserved for local use +# 1102-32767 Reserved +# 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/11/4.1.0.table b/definitions/grib2/tables/11/4.1.0.table index 361108860..3413dbad5 100644 --- a/definitions/grib2/tables/11/4.1.0.table +++ b/definitions/grib2/tables/11/4.1.0.table @@ -1,27 +1,27 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.1.1.table b/definitions/grib2/tables/11/4.1.1.table index 29f1dec79..dea5bc49e 100644 --- a/definitions/grib2/tables/11/4.1.1.table +++ b/definitions/grib2/tables/11/4.1.1.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.1.10.table b/definitions/grib2/tables/11/4.1.10.table index 9c8c92b12..e6ce6faf7 100644 --- a/definitions/grib2/tables/11/4.1.10.table +++ b/definitions/grib2/tables/11/4.1.10.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Sub-surface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Sub-surface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.1.2.table b/definitions/grib2/tables/11/4.1.2.table index b90201c63..805836998 100644 --- a/definitions/grib2/tables/11/4.1.2.table +++ b/definitions/grib2/tables/11/4.1.2.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.1.3.table b/definitions/grib2/tables/11/4.1.3.table index fe1d8ae5a..adcbfb051 100644 --- a/definitions/grib2/tables/11/4.1.3.table +++ b/definitions/grib2/tables/11/4.1.3.table @@ -1,8 +1,8 @@ # Code table 4.1 - Parameter category by product discipline. Product discipline 3 - Space products -0 0 Image format products -1 1 Quantitative products -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.10.table b/definitions/grib2/tables/11/4.10.table index 1a92baaf6..8a390e4be 100644 --- a/definitions/grib2/tables/11/4.10.table +++ b/definitions/grib2/tables/11/4.10.table @@ -1,16 +1,16 @@ # Code table 4.10 - Type of statistical processing -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -11 11 Summation -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/11/4.11.table b/definitions/grib2/tables/11/4.11.table index 7f404c849..01cc81303 100644 --- a/definitions/grib2/tables/11/4.11.table +++ b/definitions/grib2/tables/11/4.11.table @@ -1,10 +1,10 @@ # Code table 4.11 - Type of time intervals -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.12.table b/definitions/grib2/tables/11/4.12.table index 03fd89b36..d42b47e96 100644 --- a/definitions/grib2/tables/11/4.12.table +++ b/definitions/grib2/tables/11/4.12.table @@ -1,7 +1,7 @@ # Code table 4.12 - Operating mode -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.13.table b/definitions/grib2/tables/11/4.13.table index c92854eec..a0e28eac8 100644 --- a/definitions/grib2/tables/11/4.13.table +++ b/definitions/grib2/tables/11/4.13.table @@ -1,6 +1,6 @@ # Code table 4.13 - Quality control indicator -0 0 No quality control applied -1 1 Quality control applied -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.14.table b/definitions/grib2/tables/11/4.14.table index a88cb93fa..d525b23b3 100644 --- a/definitions/grib2/tables/11/4.14.table +++ b/definitions/grib2/tables/11/4.14.table @@ -1,6 +1,6 @@ # Code table 4.14 - Clutter filter indicator -0 0 No clutter filter used -1 1 Clutter filter used -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.15.table b/definitions/grib2/tables/11/4.15.table index 2e5f3dea3..7adddedb6 100644 --- a/definitions/grib2/tables/11/4.15.table +++ b/definitions/grib2/tables/11/4.15.table @@ -1,11 +1,11 @@ # Code table 4.15 - Type of spatial processing used to arrive at given data value from the source data -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.0.table b/definitions/grib2/tables/11/4.2.0.0.table index f7784cc33..e69e087c9 100644 --- a/definitions/grib2/tables/11/4.2.0.0.table +++ b/definitions/grib2/tables/11/4.2.0.0.table @@ -20,6 +20,6 @@ 18 18 Snow temperature (top of snow) (K) 19 19 Turbulent transfer coefficient for heat (Numeric) 20 20 Turbulent diffusion coefficient for heat (m2/s) -# 21-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 21-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.1.table b/definitions/grib2/tables/11/4.2.0.1.table index 827ba1dcf..256732de0 100644 --- a/definitions/grib2/tables/11/4.2.0.1.table +++ b/definitions/grib2/tables/11/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,10 +86,10 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rainwater content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) -# 93-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 93-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.13.table b/definitions/grib2/tables/11/4.2.0.13.table index b9979f0d3..90ab7d1b9 100644 --- a/definitions/grib2/tables/11/4.2.0.13.table +++ b/definitions/grib2/tables/11/4.2.0.13.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.14.table b/definitions/grib2/tables/11/4.2.0.14.table index 4a2a4e128..fca42ccc7 100644 --- a/definitions/grib2/tables/11/4.2.0.14.table +++ b/definitions/grib2/tables/11/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.15.table b/definitions/grib2/tables/11/4.2.0.15.table index 9a178ceb7..5a599a98e 100644 --- a/definitions/grib2/tables/11/4.2.0.15.table +++ b/definitions/grib2/tables/11/4.2.0.15.table @@ -14,6 +14,6 @@ 12 12 Reflectivity of rain (dB) 13 13 Reflectivity of graupel (dB) 14 14 Reflectivity of hail (dB) -# 15-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 15-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.16.table b/definitions/grib2/tables/11/4.2.0.16.table index 39215ab20..18dedb7c0 100644 --- a/definitions/grib2/tables/11/4.2.0.16.table +++ b/definitions/grib2/tables/11/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.18.table b/definitions/grib2/tables/11/4.2.0.18.table index 82fd13da1..fe06e9ea6 100644 --- a/definitions/grib2/tables/11/4.2.0.18.table +++ b/definitions/grib2/tables/11/4.2.0.18.table @@ -8,11 +8,11 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) 13 13 Total deposition (wet + dry) (Bq m-2) -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.19.table b/definitions/grib2/tables/11/4.2.0.19.table index 2aa34464a..90003262e 100644 --- a/definitions/grib2/tables/11/4.2.0.19.table +++ b/definitions/grib2/tables/11/4.2.0.19.table @@ -27,6 +27,6 @@ 25 25 Weather (Code table 4.225) 26 26 Convective outlook (Code table 4.224) 27 27 Icing scenario (Code table 4.227) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.190.table b/definitions/grib2/tables/11/4.2.0.190.table index 39fb55746..3d9d5ff85 100644 --- a/definitions/grib2/tables/11/4.2.0.190.table +++ b/definitions/grib2/tables/11/4.2.0.190.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.191.table b/definitions/grib2/tables/11/4.2.0.191.table index 81230c0e0..4ff12e532 100644 --- a/definitions/grib2/tables/11/4.2.0.191.table +++ b/definitions/grib2/tables/11/4.2.0.191.table @@ -2,6 +2,6 @@ 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/11/4.2.0.2.table b/definitions/grib2/tables/11/4.2.0.2.table index d587f84e9..f0570417b 100644 --- a/definitions/grib2/tables/11/4.2.0.2.table +++ b/definitions/grib2/tables/11/4.2.0.2.table @@ -35,6 +35,6 @@ 33 33 Wind fetch (m) 34 34 Normal wind component (m s-1) 35 35 Tangential wind component (m s-1) -# 36-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 36-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.20.table b/definitions/grib2/tables/11/4.2.0.20.table index 22cea6061..ca90179fe 100644 --- a/definitions/grib2/tables/11/4.2.0.20.table +++ b/definitions/grib2/tables/11/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -25,7 +25,7 @@ 57 57 Total yearly average burden of the atmosphere (mol) 58 58 Total yearly averaged atmospheric loss (mol/s) 59 59 Aerosol number concentration (m-3) -# 60-99 Reserved +# 60-99 Reserved 100 100 Surface area density (aerosol) (/m) 101 101 Vertical visual range (m) 102 102 Aerosol optical thickness (Numeric) @@ -37,6 +37,6 @@ 108 108 Aerosol lidar backscatter from the ground (m-1 sr-1) 109 109 Aerosol lidar extinction from satellite (m-1) 110 110 Aerosol lidar extinction from the ground (m-1) -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.3.table b/definitions/grib2/tables/11/4.2.0.3.table index f718c6ea9..08c1c7bc3 100644 --- a/definitions/grib2/tables/11/4.2.0.3.table +++ b/definitions/grib2/tables/11/4.2.0.3.table @@ -26,6 +26,6 @@ 24 24 Anisotropy of sub-gridscale orography (Numeric) 25 25 Natural logarithm of pressure in Pa (Numeric) 26 26 Exner pressure (Numeric) -# 27-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 27-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.4.table b/definitions/grib2/tables/11/4.2.0.4.table index fea4cafc3..336fdb421 100644 --- a/definitions/grib2/tables/11/4.2.0.4.table +++ b/definitions/grib2/tables/11/4.2.0.4.table @@ -12,9 +12,9 @@ 10 10 Photosynthetically active radiation (W m-2) 11 11 Net short-wave radiation flux, clear sky (W m-2) 12 12 Downward UV radiation (W m-2) -# 13-49 Reserved +# 13-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) -# 52-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 52-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.5.table b/definitions/grib2/tables/11/4.2.0.5.table index b0c93dd3a..86a199ace 100644 --- a/definitions/grib2/tables/11/4.2.0.5.table +++ b/definitions/grib2/tables/11/4.2.0.5.table @@ -6,6 +6,6 @@ 4 4 Upward long-wave radiation flux (W m-2) 5 5 Net long-wave radiation flux (W m-2) 6 6 Net long-wave radiation flux, clear sky (W m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.6.table b/definitions/grib2/tables/11/4.2.0.6.table index a06f4292f..2d088e5fc 100644 --- a/definitions/grib2/tables/11/4.2.0.6.table +++ b/definitions/grib2/tables/11/4.2.0.6.table @@ -35,6 +35,6 @@ 33 33 Sunshine duration (s) 34 34 Surface long-wave effective total cloudiness (Numeric) 35 35 Surface short-wave effective total cloudiness (Numeric) -# 36-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 36-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.0.7.table b/definitions/grib2/tables/11/4.2.0.7.table index 7a7d2008b..6c1794c73 100644 --- a/definitions/grib2/tables/11/4.2.0.7.table +++ b/definitions/grib2/tables/11/4.2.0.7.table @@ -13,8 +13,8 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraft helicity (m2 s-2) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.1.0.table b/definitions/grib2/tables/11/4.2.1.0.table index bf1e3e93f..9c4d129da 100644 --- a/definitions/grib2/tables/11/4.2.1.0.table +++ b/definitions/grib2/tables/11/4.2.1.0.table @@ -6,6 +6,6 @@ 4 4 Snow water equivalent per cent of normal (%) 5 5 Baseflow-groundwater runoff (kg m-2) 6 6 Storm surface runoff (kg m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.1.1.table b/definitions/grib2/tables/11/4.2.1.1.table index cb5117dc8..aa560e479 100644 --- a/definitions/grib2/tables/11/4.2.1.1.table +++ b/definitions/grib2/tables/11/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.10.0.table b/definitions/grib2/tables/11/4.2.10.0.table index b820364fa..43643d405 100644 --- a/definitions/grib2/tables/11/4.2.10.0.table +++ b/definitions/grib2/tables/11/4.2.10.0.table @@ -45,6 +45,6 @@ 43 43 Kurtosis of the sea-surface elevation due to waves (-) 44 44 Benjamin-Feir index (-) 45 45 Spectral peakedness factor (s-1) -# 46-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 46-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.10.1.table b/definitions/grib2/tables/11/4.2.10.1.table index ae52b0c26..de6b562b8 100644 --- a/definitions/grib2/tables/11/4.2.10.1.table +++ b/definitions/grib2/tables/11/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.10.191.table b/definitions/grib2/tables/11/4.2.10.191.table index 14085ac9a..6cafbd3d4 100644 --- a/definitions/grib2/tables/11/4.2.10.191.table +++ b/definitions/grib2/tables/11/4.2.10.191.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Meridional overturning stream function (m3/s) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.10.2.table b/definitions/grib2/tables/11/4.2.10.2.table index a6d9dd0c8..258aeef18 100644 --- a/definitions/grib2/tables/11/4.2.10.2.table +++ b/definitions/grib2/tables/11/4.2.10.2.table @@ -9,6 +9,6 @@ 7 7 Ice divergence (/s) 8 8 Ice temperature (K) 9 9 Ice internal pressure (Pa m) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.10.3.table b/definitions/grib2/tables/11/4.2.10.3.table index 112af09d5..3b9a2df46 100644 --- a/definitions/grib2/tables/11/4.2.10.3.table +++ b/definitions/grib2/tables/11/4.2.10.3.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.10.4.table b/definitions/grib2/tables/11/4.2.10.4.table index d80a32780..91ffb2b29 100644 --- a/definitions/grib2/tables/11/4.2.10.4.table +++ b/definitions/grib2/tables/11/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2 s-1) 6 6 Ocean vertical momentum diffusivity (m2 s-1) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (m-1) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.2.0.table b/definitions/grib2/tables/11/4.2.2.0.table index 9a426a5c2..0632ff414 100644 --- a/definitions/grib2/tables/11/4.2.2.0.table +++ b/definitions/grib2/tables/11/4.2.2.0.table @@ -32,6 +32,6 @@ 30 30 Deciduous forest cover (Proportion) 31 31 Normalized differential vegetation index (NDVI) (Numeric) 32 32 Root depth of vegetation (m) -# 33-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 33-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.2.3.table b/definitions/grib2/tables/11/4.2.2.3.table index e985e41aa..d7db59d5e 100644 --- a/definitions/grib2/tables/11/4.2.2.3.table +++ b/definitions/grib2/tables/11/4.2.2.3.table @@ -22,6 +22,6 @@ 20 20 Column-integrated soil moisture (kg m-2) 21 21 Soil ice (kg m-3) 22 22 Column-integrated soil ice (kg m-2) -# 23-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 23-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.2.4.table b/definitions/grib2/tables/11/4.2.2.4.table index a5f0a3c5c..0992f59db 100644 --- a/definitions/grib2/tables/11/4.2.2.4.table +++ b/definitions/grib2/tables/11/4.2.2.4.table @@ -4,5 +4,5 @@ 2 2 Haines Index (Numeric) 3 3 Fire burned area (%) # 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.3.0.table b/definitions/grib2/tables/11/4.2.3.0.table index 254e56bc8..8c19d43b2 100644 --- a/definitions/grib2/tables/11/4.2.3.0.table +++ b/definitions/grib2/tables/11/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.2.3.1.table b/definitions/grib2/tables/11/4.2.3.1.table index 176ac35fb..af1896b14 100644 --- a/definitions/grib2/tables/11/4.2.3.1.table +++ b/definitions/grib2/tables/11/4.2.3.1.table @@ -17,12 +17,12 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) 20 20 Aerosol optical thickness at 0.635 um 21 21 Aerosol optical thickness at 0.810 um 22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +23 23 Angstrom coefficient +# 24-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.201.table b/definitions/grib2/tables/11/4.201.table index dc3926b3f..b9711f69c 100644 --- a/definitions/grib2/tables/11/4.201.table +++ b/definitions/grib2/tables/11/4.201.table @@ -1,10 +1,10 @@ # Code table 4.201 - Precipitation type -0 0 Reserved -1 1 Rain -2 2 Thunderstorm -3 3 Freezing rain -4 4 Mixed/ice -5 5 Snow -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.202.table b/definitions/grib2/tables/11/4.202.table index 438502ff9..7f3c8f6cf 100644 --- a/definitions/grib2/tables/11/4.202.table +++ b/definitions/grib2/tables/11/4.202.table @@ -1,4 +1,4 @@ # Code table 4.202 - Precipitable water category -# 0-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.203.table b/definitions/grib2/tables/11/4.203.table index 8a9aedf7a..cf5eb6bdc 100644 --- a/definitions/grib2/tables/11/4.203.table +++ b/definitions/grib2/tables/11/4.203.table @@ -1,26 +1,26 @@ # Code table 4.203 - Cloud type -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.204.table b/definitions/grib2/tables/11/4.204.table index 91bcf1814..ffbd89502 100644 --- a/definitions/grib2/tables/11/4.204.table +++ b/definitions/grib2/tables/11/4.204.table @@ -1,9 +1,9 @@ # Code table 4.204 - Thunderstorm coverage -0 0 None -1 1 Isolated (1-2%) -2 2 Few (3-5%) -3 3 Scattered (16-45%) -4 4 Numerous (> 45%) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (16-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.205.table b/definitions/grib2/tables/11/4.205.table index 5b4484dfd..c40c7f47b 100644 --- a/definitions/grib2/tables/11/4.205.table +++ b/definitions/grib2/tables/11/4.205.table @@ -1,6 +1,6 @@ # Code table 4.205 - Presence of aerosol -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.206.table b/definitions/grib2/tables/11/4.206.table index 02c3dfdf9..76472c261 100644 --- a/definitions/grib2/tables/11/4.206.table +++ b/definitions/grib2/tables/11/4.206.table @@ -1,6 +1,6 @@ # Code table 4.206 - Volcanic ash -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.207.table b/definitions/grib2/tables/11/4.207.table index 8ddb2e048..b6392fca0 100644 --- a/definitions/grib2/tables/11/4.207.table +++ b/definitions/grib2/tables/11/4.207.table @@ -1,10 +1,10 @@ # Code table 4.207 - Icing -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.208.table b/definitions/grib2/tables/11/4.208.table index b83685a1a..4361d38c0 100644 --- a/definitions/grib2/tables/11/4.208.table +++ b/definitions/grib2/tables/11/4.208.table @@ -1,9 +1,9 @@ # Code table 4.208 - Turbulence -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.209.table b/definitions/grib2/tables/11/4.209.table index cb7617071..39ea549ac 100644 --- a/definitions/grib2/tables/11/4.209.table +++ b/definitions/grib2/tables/11/4.209.table @@ -1,9 +1,9 @@ # Code table 4.209 - Planetary boundary-layer regime -0 0 Reserved -1 1 Stable -2 2 Mechanically driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.210.table b/definitions/grib2/tables/11/4.210.table index 524a6ca73..791878469 100644 --- a/definitions/grib2/tables/11/4.210.table +++ b/definitions/grib2/tables/11/4.210.table @@ -1,6 +1,6 @@ # Code table 4.210 - Contrail intensity -0 0 Contrail not present -1 1 Contrail present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Contrail not present +1 1 Contrail present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.211.table b/definitions/grib2/tables/11/4.211.table index 098eb2d43..2a28a84d9 100644 --- a/definitions/grib2/tables/11/4.211.table +++ b/definitions/grib2/tables/11/4.211.table @@ -1,7 +1,7 @@ # Code table 4.211 - Contrail engine type -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.212.table b/definitions/grib2/tables/11/4.212.table index 1a085b88d..6a3dcf88c 100644 --- a/definitions/grib2/tables/11/4.212.table +++ b/definitions/grib2/tables/11/4.212.table @@ -1,18 +1,18 @@ # Code table 4.212 - Land use -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.213.table b/definitions/grib2/tables/11/4.213.table index c65784a00..68d627af6 100644 --- a/definitions/grib2/tables/11/4.213.table +++ b/definitions/grib2/tables/11/4.213.table @@ -1,16 +1,16 @@ # Code table 4.213 - Soil type -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.215.table b/definitions/grib2/tables/11/4.215.table index 88fda8b8c..c264c6722 100644 --- a/definitions/grib2/tables/11/4.215.table +++ b/definitions/grib2/tables/11/4.215.table @@ -1,9 +1,9 @@ # Code table 4.215 - Remotely-sensed snow coverage -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.216.table b/definitions/grib2/tables/11/4.216.table index 4d9a70f86..b51b358f4 100644 --- a/definitions/grib2/tables/11/4.216.table +++ b/definitions/grib2/tables/11/4.216.table @@ -1,5 +1,5 @@ # Code table 4.216 - Elevation of snow-covered terrain # 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/11/4.217.table b/definitions/grib2/tables/11/4.217.table index a4452182c..a700410d5 100644 --- a/definitions/grib2/tables/11/4.217.table +++ b/definitions/grib2/tables/11/4.217.table @@ -1,8 +1,8 @@ # Code table 4.217 - Cloud mask type -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.218.table b/definitions/grib2/tables/11/4.218.table index 6940a0e41..acf069c32 100644 --- a/definitions/grib2/tables/11/4.218.table +++ b/definitions/grib2/tables/11/4.218.table @@ -1,38 +1,38 @@ # Code table 4.218 - Pixel scene type -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation / crops -15 15 Permanent snow / ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -# 19-96 Reserved -97 97 Snow / ice on land -98 98 Snow / ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud / fog / Stratus -102 102 Low cloud / Stratocumulus -103 103 Low cloud / unknown type -104 104 Medium cloud / Nimbostratus -105 105 Medium cloud / Altostratus -106 106 Medium cloud / unknown type -107 107 High cloud / Cumulus -108 108 High cloud / Cirrus -109 109 High cloud / unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation / crops +15 15 Permanent snow / ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +# 19-96 Reserved +97 97 Snow / ice on land +98 98 Snow / ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud / fog / Stratus +102 102 Low cloud / Stratocumulus +103 103 Low cloud / unknown type +104 104 Medium cloud / Nimbostratus +105 105 Medium cloud / Altostratus +106 106 Medium cloud / unknown type +107 107 High cloud / Cumulus +108 108 High cloud / Cirrus +109 109 High cloud / unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.219.table b/definitions/grib2/tables/11/4.219.table index 86df0522e..9979f50ad 100644 --- a/definitions/grib2/tables/11/4.219.table +++ b/definitions/grib2/tables/11/4.219.table @@ -1,8 +1,8 @@ # Code table 4.219 - Cloud top height quality indicator -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.220.table b/definitions/grib2/tables/11/4.220.table index 93e841f8b..88e869e42 100644 --- a/definitions/grib2/tables/11/4.220.table +++ b/definitions/grib2/tables/11/4.220.table @@ -1,6 +1,6 @@ # Code table 4.220 - Horizontal dimension processed -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.221.table b/definitions/grib2/tables/11/4.221.table index 8448533d7..011cc3518 100644 --- a/definitions/grib2/tables/11/4.221.table +++ b/definitions/grib2/tables/11/4.221.table @@ -1,6 +1,6 @@ # Code table 4.221 - Treatment of missing data -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.222.table b/definitions/grib2/tables/11/4.222.table index 57f113014..558d947ac 100644 --- a/definitions/grib2/tables/11/4.222.table +++ b/definitions/grib2/tables/11/4.222.table @@ -1,6 +1,6 @@ # Code table 4.222 - Categorical result -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.223.table b/definitions/grib2/tables/11/4.223.table index e54719f86..11f629ef5 100644 --- a/definitions/grib2/tables/11/4.223.table +++ b/definitions/grib2/tables/11/4.223.table @@ -1,5 +1,5 @@ # Code table 4.223 - Fire detection indicator -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing value +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing value diff --git a/definitions/grib2/tables/11/4.224.table b/definitions/grib2/tables/11/4.224.table index e87cde4bb..014f56e23 100644 --- a/definitions/grib2/tables/11/4.224.table +++ b/definitions/grib2/tables/11/4.224.table @@ -1,18 +1,18 @@ # Code table 4.224 - Categorical outlook -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/11/4.227.table b/definitions/grib2/tables/11/4.227.table index 6a98d49d0..7676664e4 100644 --- a/definitions/grib2/tables/11/4.227.table +++ b/definitions/grib2/tables/11/4.227.table @@ -4,6 +4,6 @@ 2 2 Convective 3 3 Stratiform 4 4 Freezing -# 5-191 Reserved +# 5-191 Reserved # 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/11/4.234.table b/definitions/grib2/tables/11/4.234.table index 78d8fff12..9628e618e 100644 --- a/definitions/grib2/tables/11/4.234.table +++ b/definitions/grib2/tables/11/4.234.table @@ -6,14 +6,14 @@ 5 5 Deciduous broadleaf trees 6 6 Evergreen broadleaf trees 7 7 Tall grass -8 8 Desert -9 9 Tundra +8 8 Desert +9 9 Tundra 10 10 Irrigated crops -11 11 Semidesert +11 11 Semidesert 12 12 Ice caps and glaciers 13 13 Bogs and marshes 14 14 Inland water -15 15 Ocean +15 15 Ocean 16 16 Evergreen shrubs 17 17 Deciduous shrubs 18 18 Mixed forest diff --git a/definitions/grib2/tables/11/4.3.table b/definitions/grib2/tables/11/4.3.table index 8f7d20be3..1681cfc93 100644 --- a/definitions/grib2/tables/11/4.3.table +++ b/definitions/grib2/tables/11/4.3.table @@ -1,16 +1,16 @@ # Code table 4.3 - Type of generating process -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.4.table b/definitions/grib2/tables/11/4.4.table index 7087ebddb..6e63e069c 100644 --- a/definitions/grib2/tables/11/4.4.table +++ b/definitions/grib2/tables/11/4.4.table @@ -1,17 +1,17 @@ # Code table 4.4 - Indicator of unit of time range -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.5.table b/definitions/grib2/tables/11/4.5.table index 1ada3eb23..c3b8aec5d 100644 --- a/definitions/grib2/tables/11/4.5.table +++ b/definitions/grib2/tables/11/4.5.table @@ -1,5 +1,5 @@ # Code table 4.5 - Fixed surface types and units -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface 2 2 Cloud base level 3 3 Level of cloud tops @@ -12,11 +12,11 @@ 10 10 Entire atmosphere 11 11 Cumulonimbus (CB) base (m) 12 12 Cumulonimbus (CB) top (m) -# 13-19 Reserved +# 13-19 Reserved 20 20 Isothermal level (K) -# 21-99 Reserved +# 21-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -25,7 +25,7 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level 112 112 Reserved 113 113 Logarithmic hybrid level @@ -36,7 +36,7 @@ 119 hpl Hybrid pressure level # 120-149 Reserved 150 150 Generalized vertical height coordinate -# 151-159 Reserved +# 151-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 sfc Lake or river bottom @@ -44,6 +44,6 @@ 164 164 Bottom of thermally active sediment layer 165 165 Bottom of sediment layer penetrated by thermal wave 166 sfc Mixing layer -# 167-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 167-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.6.table b/definitions/grib2/tables/11/4.6.table index b2dfeb498..ce799721d 100644 --- a/definitions/grib2/tables/11/4.6.table +++ b/definitions/grib2/tables/11/4.6.table @@ -1,9 +1,9 @@ # Code table 4.6 - Type of ensemble forecast -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.7.table b/definitions/grib2/tables/11/4.7.table index e0de0e1b2..69b2b4d77 100644 --- a/definitions/grib2/tables/11/4.7.table +++ b/definitions/grib2/tables/11/4.7.table @@ -1,14 +1,14 @@ # Code table 4.7 - Derived forecast -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.8.table b/definitions/grib2/tables/11/4.8.table index ad883039c..78467454a 100644 --- a/definitions/grib2/tables/11/4.8.table +++ b/definitions/grib2/tables/11/4.8.table @@ -1,6 +1,6 @@ # Code table 4.8 - Clustering method -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.9.table b/definitions/grib2/tables/11/4.9.table index 5878b5ad3..0ce312dd1 100644 --- a/definitions/grib2/tables/11/4.9.table +++ b/definitions/grib2/tables/11/4.9.table @@ -1,9 +1,9 @@ # Code table 4.9 - Probability type -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/4.91.table b/definitions/grib2/tables/11/4.91.table index 97b1c70ad..ae31ed61c 100644 --- a/definitions/grib2/tables/11/4.91.table +++ b/definitions/grib2/tables/11/4.91.table @@ -1,16 +1,16 @@ # Code table 4.91 - Type of Interval -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit 11 11 Equal to first limit -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/11/5.1.table b/definitions/grib2/tables/11/5.1.table index 854330c74..1189b5e46 100644 --- a/definitions/grib2/tables/11/5.1.table +++ b/definitions/grib2/tables/11/5.1.table @@ -1,6 +1,6 @@ # Code table 5.1 - Type of original field values -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/5.2.table b/definitions/grib2/tables/11/5.2.table index 7a4500ecd..d12b46fbd 100644 --- a/definitions/grib2/tables/11/5.2.table +++ b/definitions/grib2/tables/11/5.2.table @@ -1,8 +1,8 @@ # Code table 5.2 - Matrix coordinate value function definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use +# 12-191 Reserved +# 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/11/5.3.table b/definitions/grib2/tables/11/5.3.table index c3b7b30fe..481331791 100644 --- a/definitions/grib2/tables/11/5.3.table +++ b/definitions/grib2/tables/11/5.3.table @@ -1,7 +1,7 @@ # Code table 5.3 - Matrix coordinate parameter -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/5.4.table b/definitions/grib2/tables/11/5.4.table index 8121c1819..e84ab1901 100644 --- a/definitions/grib2/tables/11/5.4.table +++ b/definitions/grib2/tables/11/5.4.table @@ -1,6 +1,6 @@ # Code table 5.4 - Group splitting method -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/5.40.table b/definitions/grib2/tables/11/5.40.table index b9bad2c39..97e8880ab 100644 --- a/definitions/grib2/tables/11/5.40.table +++ b/definitions/grib2/tables/11/5.40.table @@ -1,5 +1,5 @@ # Code table 5.40 - Type of compression -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/11/5.5.table b/definitions/grib2/tables/11/5.5.table index 3ef3eb070..f2316975a 100644 --- a/definitions/grib2/tables/11/5.5.table +++ b/definitions/grib2/tables/11/5.5.table @@ -1,7 +1,7 @@ # Code table 5.5 - Missing value management for complex packing -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/5.6.table b/definitions/grib2/tables/11/5.6.table index 6d5177877..db68ead9c 100644 --- a/definitions/grib2/tables/11/5.6.table +++ b/definitions/grib2/tables/11/5.6.table @@ -1,7 +1,7 @@ # Code table 5.6 - Order of spatial differencing -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/11/5.7.table b/definitions/grib2/tables/11/5.7.table index 5ab780056..e54862c19 100644 --- a/definitions/grib2/tables/11/5.7.table +++ b/definitions/grib2/tables/11/5.7.table @@ -1,7 +1,7 @@ # Code table 5.7 - Precision of floating-point numbers -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/11/6.0.table b/definitions/grib2/tables/11/6.0.table index f539b26d7..a8f30f5a4 100644 --- a/definitions/grib2/tables/11/6.0.table +++ b/definitions/grib2/tables/11/6.0.table @@ -1,6 +1,6 @@ # Code table 6.0 - Bit map indicator 0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/12/0.0.table b/definitions/grib2/tables/12/0.0.table index b24c50564..2c5afceb4 100644 --- a/definitions/grib2/tables/12/0.0.table +++ b/definitions/grib2/tables/12/0.0.table @@ -1,10 +1,10 @@ # Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/1.0.table b/definitions/grib2/tables/12/1.0.table index 84ec19886..b21d01815 100644 --- a/definitions/grib2/tables/12/1.0.table +++ b/definitions/grib2/tables/12/1.0.table @@ -1,17 +1,17 @@ # Code table 1.0 - GRIB master tables version number -0 0 Experimental -1 1 Version implemented on 7 November 2001 -2 2 Version implemented on 4 November 2003 -3 3 Version implemented on 2 November 2005 -4 4 Version implemented on 7 November 2007 -5 5 Version implemented on 4 November 2009 -6 6 Version implemented on 15 September 2010 -7 7 Version implemented on 4 May 2011 -8 8 Version implemented on 2 November 2011 -9 9 Version implemented on 2 May 2012 +0 0 Experimental +1 1 Version implemented on 7 November 2001 +2 2 Version implemented on 4 November 2003 +3 3 Version implemented on 2 November 2005 +4 4 Version implemented on 7 November 2007 +5 5 Version implemented on 4 November 2009 +6 6 Version implemented on 15 September 2010 +7 7 Version implemented on 4 May 2011 +8 8 Version implemented on 2 November 2011 +9 9 Version implemented on 2 May 2012 10 10 Version implemented on 7 November 2012 11 11 Version implemented on 8 May 2013 12 12 Version implemented on 14 November 2013 13 13 Pre-operational to be implemented by next amendment -# 14-254 Future versions -255 255 Missing +# 14-254 Future versions +255 255 Missing diff --git a/definitions/grib2/tables/12/1.1.table b/definitions/grib2/tables/12/1.1.table index d50f8fd72..f6d332005 100644 --- a/definitions/grib2/tables/12/1.1.table +++ b/definitions/grib2/tables/12/1.1.table @@ -1,4 +1,4 @@ # Code table 1.1 - GRIB local tables version number -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/12/1.2.table b/definitions/grib2/tables/12/1.2.table index 934b70455..638f1efbb 100644 --- a/definitions/grib2/tables/12/1.2.table +++ b/definitions/grib2/tables/12/1.2.table @@ -1,8 +1,8 @@ # Code table 1.2 - Significance of reference time -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/1.3.table b/definitions/grib2/tables/12/1.3.table index e8c38878d..34ace7fda 100644 --- a/definitions/grib2/tables/12/1.3.table +++ b/definitions/grib2/tables/12/1.3.table @@ -1,12 +1,12 @@ # Code table 1.3 - Production status of data -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products 4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) 5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) 6 6 Sub-seasonal to seasonal prediction project (S2S) 7 7 Sub-seasonal to seasonal prediction project test (S2S) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/1.4.table b/definitions/grib2/tables/12/1.4.table index 03203d874..877288c0e 100644 --- a/definitions/grib2/tables/12/1.4.table +++ b/definitions/grib2/tables/12/1.4.table @@ -1,13 +1,13 @@ # Code table 1.4 - Type of data -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/12/1.5.table b/definitions/grib2/tables/12/1.5.table index b2cf9f087..533111959 100644 --- a/definitions/grib2/tables/12/1.5.table +++ b/definitions/grib2/tables/12/1.5.table @@ -1,7 +1,7 @@ # Code table 1.5 - Identification template number -0 0 Calendar definition -1 1 Paleontological offset -2 2 Calendar definition and paleontological offset -# 3-32767 Reserved -# 32768-65534 Reserved for local use -65535 65535 Missing +0 0 Calendar definition +1 1 Paleontological offset +2 2 Calendar definition and paleontological offset +# 3-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/12/1.6.table b/definitions/grib2/tables/12/1.6.table index 5db921990..bd46899a7 100644 --- a/definitions/grib2/tables/12/1.6.table +++ b/definitions/grib2/tables/12/1.6.table @@ -1,8 +1,8 @@ # Code table 1.6 - Type of calendar -0 0 Gregorian -1 1 360-day -2 2 365-day -3 3 Proleptic Gregorian -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Gregorian +1 1 360-day +2 2 365-day +3 3 Proleptic Gregorian +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/3.0.table b/definitions/grib2/tables/12/3.0.table index 45187b80d..a442a06a0 100644 --- a/definitions/grib2/tables/12/3.0.table +++ b/definitions/grib2/tables/12/3.0.table @@ -1,6 +1,6 @@ # Code table 3.0 - Source of grid definition -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/12/3.10.table b/definitions/grib2/tables/12/3.10.table index afa8843a7..1612d05e3 100644 --- a/definitions/grib2/tables/12/3.10.table +++ b/definitions/grib2/tables/12/3.10.table @@ -1,8 +1,8 @@ # Flag table 3.10 - Scanning mode for one diamond -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/12/3.11.table b/definitions/grib2/tables/12/3.11.table index e516a2ab9..06ae10810 100644 --- a/definitions/grib2/tables/12/3.11.table +++ b/definitions/grib2/tables/12/3.11.table @@ -1,7 +1,7 @@ # Code table 3.11 - Interpretation of list of numbers at end of section 3 -0 0 There is no appended list -1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows -2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row -3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) -# 4-254 Reserved -255 255 Missing +0 0 There is no appended list +1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows +2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row +3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/12/3.15.table b/definitions/grib2/tables/12/3.15.table index 331217ebe..6087902a3 100644 --- a/definitions/grib2/tables/12/3.15.table +++ b/definitions/grib2/tables/12/3.15.table @@ -1,23 +1,23 @@ # Code table 3.15 - Physical meaning of vertical coordinate -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) -113 113 Logarithmic hybrid coordinate -# 114-159 Reserved +113 113 Logarithmic hybrid coordinate +# 114-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/3.2.table b/definitions/grib2/tables/12/3.2.table index 9238dc2a7..b9574a424 100644 --- a/definitions/grib2/tables/12/3.2.table +++ b/definitions/grib2/tables/12/3.2.table @@ -1,14 +1,14 @@ # Code table 3.2 - Shape of the Earth -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame -9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame +9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/3.20.table b/definitions/grib2/tables/12/3.20.table index efbf08d19..e2bb156ee 100644 --- a/definitions/grib2/tables/12/3.20.table +++ b/definitions/grib2/tables/12/3.20.table @@ -1,6 +1,6 @@ # Code table 3.20 - Type of horizontal line -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/3.21.table b/definitions/grib2/tables/12/3.21.table index 88dbb9019..e001e1c8f 100644 --- a/definitions/grib2/tables/12/3.21.table +++ b/definitions/grib2/tables/12/3.21.table @@ -1,8 +1,8 @@ # Code table 3.21 - Vertical dimension coordinate values definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/3.3.table b/definitions/grib2/tables/12/3.3.table index 5dd7c7001..25cb46a1d 100644 --- a/definitions/grib2/tables/12/3.3.table +++ b/definitions/grib2/tables/12/3.3.table @@ -1,9 +1,9 @@ # Flag table 3.3 - Resolution and component flags -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/12/3.4.table b/definitions/grib2/tables/12/3.4.table index 63c8adaaa..ea9cbe829 100644 --- a/definitions/grib2/tables/12/3.4.table +++ b/definitions/grib2/tables/12/3.4.table @@ -1,10 +1,10 @@ # Flag table 3.4 - Scanning mode -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -# 5-8 Reserved +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +# 5-8 Reserved diff --git a/definitions/grib2/tables/12/3.5.table b/definitions/grib2/tables/12/3.5.table index eabdde896..2f8ec82e3 100644 --- a/definitions/grib2/tables/12/3.5.table +++ b/definitions/grib2/tables/12/3.5.table @@ -1,5 +1,5 @@ # Flag table 3.5 - Projection centre -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/12/3.7.table b/definitions/grib2/tables/12/3.7.table index 0a7d6efde..34c0de085 100644 --- a/definitions/grib2/tables/12/3.7.table +++ b/definitions/grib2/tables/12/3.7.table @@ -1,5 +1,5 @@ # Code table 3.7 - Spectral data representation mode -0 0 Reserved +0 0 Reserved 1 1 see separate doc or pdf file -# 2-254 Reserved -255 255 Missing +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/12/3.8.table b/definitions/grib2/tables/12/3.8.table index 844e74235..578fab37f 100644 --- a/definitions/grib2/tables/12/3.8.table +++ b/definitions/grib2/tables/12/3.8.table @@ -1,7 +1,7 @@ # Code table 3.8 - Grid point position -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/3.9.table b/definitions/grib2/tables/12/3.9.table index fd730bc64..ecd65514a 100644 --- a/definitions/grib2/tables/12/3.9.table +++ b/definitions/grib2/tables/12/3.9.table @@ -1,4 +1,4 @@ # Flag table 3.9 - Numbering order of diamonds as seen from the corresponding pole -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/12/4.0.table b/definitions/grib2/tables/12/4.0.table index b77e3f323..8608d20f9 100644 --- a/definitions/grib2/tables/12/4.0.table +++ b/definitions/grib2/tables/12/4.0.table @@ -1,61 +1,61 @@ # Code table 4.0 - Product definition template number -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time -8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -# 35-39 Reserved +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 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 +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +# 35-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -42 42 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 atmospheric chemical constituents -43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol -46 46 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 aerosol -47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol -48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -# 49-50 Reserved -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time -52 52 Reserved -53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time -54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 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 atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 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 aerosol +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +# 49-50 Reserved +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +52 52 Reserved +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters 60 60 Individual ensemble re-forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time 61 61 Individual ensemble re-forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 55-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +# 55-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved -# 32768-65534 Reserved for local use +# 1102-32767 Reserved +# 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/12/4.1.0.table b/definitions/grib2/tables/12/4.1.0.table index 04cfd7802..df58636d6 100644 --- a/definitions/grib2/tables/12/4.1.0.table +++ b/definitions/grib2/tables/12/4.1.0.table @@ -1,27 +1,27 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.1.1.table b/definitions/grib2/tables/12/4.1.1.table index 7b22b6fed..05a854da0 100644 --- a/definitions/grib2/tables/12/4.1.1.table +++ b/definitions/grib2/tables/12/4.1.1.table @@ -1,7 +1,7 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.1.10.table b/definitions/grib2/tables/12/4.1.10.table index b97dcd355..e9663f391 100644 --- a/definitions/grib2/tables/12/4.1.10.table +++ b/definitions/grib2/tables/12/4.1.10.table @@ -1,10 +1,10 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Sub-surface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Sub-surface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.1.2.table b/definitions/grib2/tables/12/4.1.2.table index 5b488fe9e..e74126645 100644 --- a/definitions/grib2/tables/12/4.1.2.table +++ b/definitions/grib2/tables/12/4.1.2.table @@ -1,9 +1,9 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.1.3.table b/definitions/grib2/tables/12/4.1.3.table index 5096a166e..c1a1e267a 100644 --- a/definitions/grib2/tables/12/4.1.3.table +++ b/definitions/grib2/tables/12/4.1.3.table @@ -1,6 +1,6 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Image format products -1 1 Quantitative products -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.10.table b/definitions/grib2/tables/12/4.10.table index 1a92baaf6..8a390e4be 100644 --- a/definitions/grib2/tables/12/4.10.table +++ b/definitions/grib2/tables/12/4.10.table @@ -1,16 +1,16 @@ # Code table 4.10 - Type of statistical processing -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -11 11 Summation -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/12/4.11.table b/definitions/grib2/tables/12/4.11.table index 7f404c849..01cc81303 100644 --- a/definitions/grib2/tables/12/4.11.table +++ b/definitions/grib2/tables/12/4.11.table @@ -1,10 +1,10 @@ # Code table 4.11 - Type of time intervals -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.12.table b/definitions/grib2/tables/12/4.12.table index 03fd89b36..d42b47e96 100644 --- a/definitions/grib2/tables/12/4.12.table +++ b/definitions/grib2/tables/12/4.12.table @@ -1,7 +1,7 @@ # Code table 4.12 - Operating mode -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.13.table b/definitions/grib2/tables/12/4.13.table index c92854eec..a0e28eac8 100644 --- a/definitions/grib2/tables/12/4.13.table +++ b/definitions/grib2/tables/12/4.13.table @@ -1,6 +1,6 @@ # Code table 4.13 - Quality control indicator -0 0 No quality control applied -1 1 Quality control applied -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.14.table b/definitions/grib2/tables/12/4.14.table index a88cb93fa..d525b23b3 100644 --- a/definitions/grib2/tables/12/4.14.table +++ b/definitions/grib2/tables/12/4.14.table @@ -1,6 +1,6 @@ # Code table 4.14 - Clutter filter indicator -0 0 No clutter filter used -1 1 Clutter filter used -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.15.table b/definitions/grib2/tables/12/4.15.table index 2e5f3dea3..7adddedb6 100644 --- a/definitions/grib2/tables/12/4.15.table +++ b/definitions/grib2/tables/12/4.15.table @@ -1,11 +1,11 @@ # Code table 4.15 - Type of spatial processing used to arrive at given data value from the source data -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.0.table b/definitions/grib2/tables/12/4.2.0.0.table index ce91fe429..f5841e889 100644 --- a/definitions/grib2/tables/12/4.2.0.0.table +++ b/definitions/grib2/tables/12/4.2.0.0.table @@ -20,6 +20,6 @@ 18 18 Snow temperature (top of snow) (K) 19 19 Turbulent transfer coefficient for heat (Numeric) 20 20 Turbulent diffusion coefficient for heat (m2/s) -# 21-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 21-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.1.table b/definitions/grib2/tables/12/4.2.0.1.table index d1d1704df..fb7c3d776 100644 --- a/definitions/grib2/tables/12/4.2.0.1.table +++ b/definitions/grib2/tables/12/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,10 +86,10 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rainwater content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) -# 93-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 93-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.13.table b/definitions/grib2/tables/12/4.2.0.13.table index 5086101ad..3f5c30675 100644 --- a/definitions/grib2/tables/12/4.2.0.13.table +++ b/definitions/grib2/tables/12/4.2.0.13.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.14.table b/definitions/grib2/tables/12/4.2.0.14.table index 215884737..97fb38c8b 100644 --- a/definitions/grib2/tables/12/4.2.0.14.table +++ b/definitions/grib2/tables/12/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.15.table b/definitions/grib2/tables/12/4.2.0.15.table index d74fa7234..bb0b9ab46 100644 --- a/definitions/grib2/tables/12/4.2.0.15.table +++ b/definitions/grib2/tables/12/4.2.0.15.table @@ -14,6 +14,6 @@ 12 12 Reflectivity of rain (dB) 13 13 Reflectivity of graupel (dB) 14 14 Reflectivity of hail (dB) -# 15-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 15-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.16.table b/definitions/grib2/tables/12/4.2.0.16.table index 0c240a853..9499d9333 100644 --- a/definitions/grib2/tables/12/4.2.0.16.table +++ b/definitions/grib2/tables/12/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.18.table b/definitions/grib2/tables/12/4.2.0.18.table index 18c41aa48..7e0a736eb 100644 --- a/definitions/grib2/tables/12/4.2.0.18.table +++ b/definitions/grib2/tables/12/4.2.0.18.table @@ -8,11 +8,11 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) 13 13 Total deposition (wet + dry) (Bq m-2) -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.19.table b/definitions/grib2/tables/12/4.2.0.19.table index 75101bd37..d2beef083 100644 --- a/definitions/grib2/tables/12/4.2.0.19.table +++ b/definitions/grib2/tables/12/4.2.0.19.table @@ -27,6 +27,6 @@ 25 25 Weather (Code table 4.225) 26 26 Convective outlook (Code table 4.224) 27 27 Icing scenario (Code table 4.227) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.190.table b/definitions/grib2/tables/12/4.2.0.190.table index de621a924..a0d6ba0ac 100644 --- a/definitions/grib2/tables/12/4.2.0.190.table +++ b/definitions/grib2/tables/12/4.2.0.190.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.191.table b/definitions/grib2/tables/12/4.2.0.191.table index 1f949f149..2e82e01da 100644 --- a/definitions/grib2/tables/12/4.2.0.191.table +++ b/definitions/grib2/tables/12/4.2.0.191.table @@ -2,6 +2,6 @@ 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.2.table b/definitions/grib2/tables/12/4.2.0.2.table index 84882e8b8..ad1d84f52 100644 --- a/definitions/grib2/tables/12/4.2.0.2.table +++ b/definitions/grib2/tables/12/4.2.0.2.table @@ -35,6 +35,6 @@ 33 33 Wind fetch (m) 34 34 Normal wind component (m s-1) 35 35 Tangential wind component (m s-1) -# 36-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 36-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.20.table b/definitions/grib2/tables/12/4.2.0.20.table index ac97b0b39..a0eb7724a 100644 --- a/definitions/grib2/tables/12/4.2.0.20.table +++ b/definitions/grib2/tables/12/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -25,7 +25,7 @@ 57 57 Total yearly average burden of the atmosphere (mol) 58 58 Total yearly averaged atmospheric loss (mol/s) 59 59 Aerosol number concentration (m-3) -# 60-99 Reserved +# 60-99 Reserved 100 100 Surface area density (aerosol) (/m) 101 101 Vertical visual range (m) 102 102 Aerosol optical thickness (Numeric) @@ -37,6 +37,6 @@ 108 108 Aerosol lidar backscatter from the ground (m-1 sr-1) 109 109 Aerosol lidar extinction from satellite (m-1) 110 110 Aerosol lidar extinction from the ground (m-1) -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.3.table b/definitions/grib2/tables/12/4.2.0.3.table index 9a88e0027..e1a68bfc5 100644 --- a/definitions/grib2/tables/12/4.2.0.3.table +++ b/definitions/grib2/tables/12/4.2.0.3.table @@ -26,6 +26,6 @@ 24 24 Anisotropy of sub-gridscale orography (Numeric) 25 25 Natural logarithm of pressure in Pa (Numeric) 26 26 Exner pressure (Numeric) -# 27-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 27-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.4.table b/definitions/grib2/tables/12/4.2.0.4.table index dbfcbddb7..03b5cea38 100644 --- a/definitions/grib2/tables/12/4.2.0.4.table +++ b/definitions/grib2/tables/12/4.2.0.4.table @@ -12,9 +12,9 @@ 10 10 Photosynthetically active radiation (W m-2) 11 11 Net short-wave radiation flux, clear sky (W m-2) 12 12 Downward UV radiation (W m-2) -# 13-49 Reserved +# 13-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) -# 52-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 52-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.5.table b/definitions/grib2/tables/12/4.2.0.5.table index f1c04650d..1bdd6ebee 100644 --- a/definitions/grib2/tables/12/4.2.0.5.table +++ b/definitions/grib2/tables/12/4.2.0.5.table @@ -6,6 +6,6 @@ 4 4 Upward long-wave radiation flux (W m-2) 5 5 Net long-wave radiation flux (W m-2) 6 6 Net long-wave radiation flux, clear sky (W m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.6.table b/definitions/grib2/tables/12/4.2.0.6.table index 9ee97b73f..89da06eec 100644 --- a/definitions/grib2/tables/12/4.2.0.6.table +++ b/definitions/grib2/tables/12/4.2.0.6.table @@ -35,6 +35,6 @@ 33 33 Sunshine duration (s) 34 34 Surface long-wave effective total cloudiness (Numeric) 35 35 Surface short-wave effective total cloudiness (Numeric) -# 36-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 36-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.0.7.table b/definitions/grib2/tables/12/4.2.0.7.table index db47d0113..8a2b85fb9 100644 --- a/definitions/grib2/tables/12/4.2.0.7.table +++ b/definitions/grib2/tables/12/4.2.0.7.table @@ -13,8 +13,8 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraft helicity (m2 s-2) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.1.0.table b/definitions/grib2/tables/12/4.2.1.0.table index e93f0a332..b6c648f00 100644 --- a/definitions/grib2/tables/12/4.2.1.0.table +++ b/definitions/grib2/tables/12/4.2.1.0.table @@ -6,6 +6,6 @@ 4 4 Snow water equivalent per cent of normal (%) 5 5 Baseflow-groundwater runoff (kg m-2) 6 6 Storm surface runoff (kg m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.1.1.table b/definitions/grib2/tables/12/4.2.1.1.table index b488eb0bd..171da3958 100644 --- a/definitions/grib2/tables/12/4.2.1.1.table +++ b/definitions/grib2/tables/12/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.10.0.table b/definitions/grib2/tables/12/4.2.10.0.table index 761b6395c..76b3da22c 100644 --- a/definitions/grib2/tables/12/4.2.10.0.table +++ b/definitions/grib2/tables/12/4.2.10.0.table @@ -45,6 +45,6 @@ 43 43 Kurtosis of the sea-surface elevation due to waves (-) 44 44 Benjamin-Feir index (-) 45 45 Spectral peakedness factor (s-1) -# 46-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 46-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.10.1.table b/definitions/grib2/tables/12/4.2.10.1.table index 5959bfa28..f0a073c00 100644 --- a/definitions/grib2/tables/12/4.2.10.1.table +++ b/definitions/grib2/tables/12/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.10.191.table b/definitions/grib2/tables/12/4.2.10.191.table index 18e56f930..6b9eee36e 100644 --- a/definitions/grib2/tables/12/4.2.10.191.table +++ b/definitions/grib2/tables/12/4.2.10.191.table @@ -1,6 +1,6 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Meridional overturning stream function (m3/s) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.10.2.table b/definitions/grib2/tables/12/4.2.10.2.table index 6f0664420..24458b91f 100644 --- a/definitions/grib2/tables/12/4.2.10.2.table +++ b/definitions/grib2/tables/12/4.2.10.2.table @@ -9,6 +9,6 @@ 7 7 Ice divergence (/s) 8 8 Ice temperature (K) 9 9 Ice internal pressure (Pa m) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.10.3.table b/definitions/grib2/tables/12/4.2.10.3.table index f951bbe78..937720c93 100644 --- a/definitions/grib2/tables/12/4.2.10.3.table +++ b/definitions/grib2/tables/12/4.2.10.3.table @@ -1,6 +1,6 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.10.4.table b/definitions/grib2/tables/12/4.2.10.4.table index 450320ca1..e20a49470 100644 --- a/definitions/grib2/tables/12/4.2.10.4.table +++ b/definitions/grib2/tables/12/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2 s-1) 6 6 Ocean vertical momentum diffusivity (m2 s-1) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (m-1) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.2.0.table b/definitions/grib2/tables/12/4.2.2.0.table index 95b696a37..98eae911a 100644 --- a/definitions/grib2/tables/12/4.2.2.0.table +++ b/definitions/grib2/tables/12/4.2.2.0.table @@ -32,6 +32,6 @@ 30 30 Deciduous forest cover (Proportion) 31 31 Normalized differential vegetation index (NDVI) (Numeric) 32 32 Root depth of vegetation (m) -# 33-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 33-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.2.3.table b/definitions/grib2/tables/12/4.2.2.3.table index 2f6291077..3d3298c8a 100644 --- a/definitions/grib2/tables/12/4.2.2.3.table +++ b/definitions/grib2/tables/12/4.2.2.3.table @@ -22,6 +22,6 @@ 20 20 Column-integrated soil moisture (kg m-2) 21 21 Soil ice (kg m-3) 22 22 Column-integrated soil ice (kg m-2) -# 23-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 23-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.2.4.table b/definitions/grib2/tables/12/4.2.2.4.table index cf91e8b7a..30865c1b8 100644 --- a/definitions/grib2/tables/12/4.2.2.4.table +++ b/definitions/grib2/tables/12/4.2.2.4.table @@ -3,6 +3,6 @@ 1 1 Fire outlook due to dry thunderstorm (Code table 4.224) 2 2 Haines Index (Numeric) 3 3 Fire burned area (%) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.3.0.table b/definitions/grib2/tables/12/4.2.3.0.table index c0ffa29f5..80a829673 100644 --- a/definitions/grib2/tables/12/4.2.3.0.table +++ b/definitions/grib2/tables/12/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.2.3.1.table b/definitions/grib2/tables/12/4.2.3.1.table index 0c0fc8d37..bc16d8855 100644 --- a/definitions/grib2/tables/12/4.2.3.1.table +++ b/definitions/grib2/tables/12/4.2.3.1.table @@ -17,12 +17,12 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) 20 20 Aerosol optical thickness at 0.635 um 21 21 Aerosol optical thickness at 0.810 um 22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +23 23 Angstrom coefficient +# 24-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.201.table b/definitions/grib2/tables/12/4.201.table index 2510f2ef7..fa173c4e0 100644 --- a/definitions/grib2/tables/12/4.201.table +++ b/definitions/grib2/tables/12/4.201.table @@ -10,6 +10,6 @@ 8 8 Ice pellets 9 9 Graupel 10 10 Hail -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.202.table b/definitions/grib2/tables/12/4.202.table index 438502ff9..7f3c8f6cf 100644 --- a/definitions/grib2/tables/12/4.202.table +++ b/definitions/grib2/tables/12/4.202.table @@ -1,4 +1,4 @@ # Code table 4.202 - Precipitable water category -# 0-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.203.table b/definitions/grib2/tables/12/4.203.table index 8a9aedf7a..cf5eb6bdc 100644 --- a/definitions/grib2/tables/12/4.203.table +++ b/definitions/grib2/tables/12/4.203.table @@ -1,26 +1,26 @@ # Code table 4.203 - Cloud type -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.204.table b/definitions/grib2/tables/12/4.204.table index 91bcf1814..ffbd89502 100644 --- a/definitions/grib2/tables/12/4.204.table +++ b/definitions/grib2/tables/12/4.204.table @@ -1,9 +1,9 @@ # Code table 4.204 - Thunderstorm coverage -0 0 None -1 1 Isolated (1-2%) -2 2 Few (3-5%) -3 3 Scattered (16-45%) -4 4 Numerous (> 45%) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (16-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.205.table b/definitions/grib2/tables/12/4.205.table index 5b4484dfd..c40c7f47b 100644 --- a/definitions/grib2/tables/12/4.205.table +++ b/definitions/grib2/tables/12/4.205.table @@ -1,6 +1,6 @@ # Code table 4.205 - Presence of aerosol -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.206.table b/definitions/grib2/tables/12/4.206.table index 02c3dfdf9..76472c261 100644 --- a/definitions/grib2/tables/12/4.206.table +++ b/definitions/grib2/tables/12/4.206.table @@ -1,6 +1,6 @@ # Code table 4.206 - Volcanic ash -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.207.table b/definitions/grib2/tables/12/4.207.table index 8ddb2e048..b6392fca0 100644 --- a/definitions/grib2/tables/12/4.207.table +++ b/definitions/grib2/tables/12/4.207.table @@ -1,10 +1,10 @@ # Code table 4.207 - Icing -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.208.table b/definitions/grib2/tables/12/4.208.table index b83685a1a..4361d38c0 100644 --- a/definitions/grib2/tables/12/4.208.table +++ b/definitions/grib2/tables/12/4.208.table @@ -1,9 +1,9 @@ # Code table 4.208 - Turbulence -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.209.table b/definitions/grib2/tables/12/4.209.table index cb7617071..39ea549ac 100644 --- a/definitions/grib2/tables/12/4.209.table +++ b/definitions/grib2/tables/12/4.209.table @@ -1,9 +1,9 @@ # Code table 4.209 - Planetary boundary-layer regime -0 0 Reserved -1 1 Stable -2 2 Mechanically driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.210.table b/definitions/grib2/tables/12/4.210.table index 524a6ca73..791878469 100644 --- a/definitions/grib2/tables/12/4.210.table +++ b/definitions/grib2/tables/12/4.210.table @@ -1,6 +1,6 @@ # Code table 4.210 - Contrail intensity -0 0 Contrail not present -1 1 Contrail present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Contrail not present +1 1 Contrail present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.211.table b/definitions/grib2/tables/12/4.211.table index 098eb2d43..2a28a84d9 100644 --- a/definitions/grib2/tables/12/4.211.table +++ b/definitions/grib2/tables/12/4.211.table @@ -1,7 +1,7 @@ # Code table 4.211 - Contrail engine type -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.212.table b/definitions/grib2/tables/12/4.212.table index 1a085b88d..6a3dcf88c 100644 --- a/definitions/grib2/tables/12/4.212.table +++ b/definitions/grib2/tables/12/4.212.table @@ -1,18 +1,18 @@ # Code table 4.212 - Land use -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.213.table b/definitions/grib2/tables/12/4.213.table index c65784a00..68d627af6 100644 --- a/definitions/grib2/tables/12/4.213.table +++ b/definitions/grib2/tables/12/4.213.table @@ -1,16 +1,16 @@ # Code table 4.213 - Soil type -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.215.table b/definitions/grib2/tables/12/4.215.table index 88fda8b8c..c264c6722 100644 --- a/definitions/grib2/tables/12/4.215.table +++ b/definitions/grib2/tables/12/4.215.table @@ -1,9 +1,9 @@ # Code table 4.215 - Remotely-sensed snow coverage -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.216.table b/definitions/grib2/tables/12/4.216.table index 4d9a70f86..b51b358f4 100644 --- a/definitions/grib2/tables/12/4.216.table +++ b/definitions/grib2/tables/12/4.216.table @@ -1,5 +1,5 @@ # Code table 4.216 - Elevation of snow-covered terrain # 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/12/4.217.table b/definitions/grib2/tables/12/4.217.table index a4452182c..a700410d5 100644 --- a/definitions/grib2/tables/12/4.217.table +++ b/definitions/grib2/tables/12/4.217.table @@ -1,8 +1,8 @@ # Code table 4.217 - Cloud mask type -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.218.table b/definitions/grib2/tables/12/4.218.table index 6940a0e41..acf069c32 100644 --- a/definitions/grib2/tables/12/4.218.table +++ b/definitions/grib2/tables/12/4.218.table @@ -1,38 +1,38 @@ # Code table 4.218 - Pixel scene type -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation / crops -15 15 Permanent snow / ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -# 19-96 Reserved -97 97 Snow / ice on land -98 98 Snow / ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud / fog / Stratus -102 102 Low cloud / Stratocumulus -103 103 Low cloud / unknown type -104 104 Medium cloud / Nimbostratus -105 105 Medium cloud / Altostratus -106 106 Medium cloud / unknown type -107 107 High cloud / Cumulus -108 108 High cloud / Cirrus -109 109 High cloud / unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation / crops +15 15 Permanent snow / ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +# 19-96 Reserved +97 97 Snow / ice on land +98 98 Snow / ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud / fog / Stratus +102 102 Low cloud / Stratocumulus +103 103 Low cloud / unknown type +104 104 Medium cloud / Nimbostratus +105 105 Medium cloud / Altostratus +106 106 Medium cloud / unknown type +107 107 High cloud / Cumulus +108 108 High cloud / Cirrus +109 109 High cloud / unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.219.table b/definitions/grib2/tables/12/4.219.table index 86df0522e..9979f50ad 100644 --- a/definitions/grib2/tables/12/4.219.table +++ b/definitions/grib2/tables/12/4.219.table @@ -1,8 +1,8 @@ # Code table 4.219 - Cloud top height quality indicator -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.220.table b/definitions/grib2/tables/12/4.220.table index 93e841f8b..88e869e42 100644 --- a/definitions/grib2/tables/12/4.220.table +++ b/definitions/grib2/tables/12/4.220.table @@ -1,6 +1,6 @@ # Code table 4.220 - Horizontal dimension processed -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.221.table b/definitions/grib2/tables/12/4.221.table index 8448533d7..011cc3518 100644 --- a/definitions/grib2/tables/12/4.221.table +++ b/definitions/grib2/tables/12/4.221.table @@ -1,6 +1,6 @@ # Code table 4.221 - Treatment of missing data -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.222.table b/definitions/grib2/tables/12/4.222.table index 57f113014..558d947ac 100644 --- a/definitions/grib2/tables/12/4.222.table +++ b/definitions/grib2/tables/12/4.222.table @@ -1,6 +1,6 @@ # Code table 4.222 - Categorical result -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.223.table b/definitions/grib2/tables/12/4.223.table index f0deb076a..572c4e7a8 100644 --- a/definitions/grib2/tables/12/4.223.table +++ b/definitions/grib2/tables/12/4.223.table @@ -1,5 +1,5 @@ # Code table 4.223 - Fire detection indicator -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing diff --git a/definitions/grib2/tables/12/4.224.table b/definitions/grib2/tables/12/4.224.table index e87cde4bb..014f56e23 100644 --- a/definitions/grib2/tables/12/4.224.table +++ b/definitions/grib2/tables/12/4.224.table @@ -1,18 +1,18 @@ # Code table 4.224 - Categorical outlook -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/12/4.227.table b/definitions/grib2/tables/12/4.227.table index 27c76553d..48c3b7633 100644 --- a/definitions/grib2/tables/12/4.227.table +++ b/definitions/grib2/tables/12/4.227.table @@ -1,9 +1,9 @@ # Code table 4.227 - Icing scenario (weather/cloud classification) -0 0 None -1 1 General -2 2 Convective -3 3 Stratiform -4 4 Freezing -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 None +1 1 General +2 2 Convective +3 3 Stratiform +4 4 Freezing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/12/4.234.table b/definitions/grib2/tables/12/4.234.table index 9844a91d2..d8b3715b3 100644 --- a/definitions/grib2/tables/12/4.234.table +++ b/definitions/grib2/tables/12/4.234.table @@ -1,21 +1,21 @@ # Code table 4.234 - Canopy cover fraction (to be used as partitioned parameter in PDT 4.53 or 4.54) -1 1 Crops, mixed farming -2 2 Short grass -3 3 Evergreen needleleaf trees -4 4 Deciduous needleleaf trees -5 5 Deciduous broadleaf trees -6 6 Evergreen broadleaf trees -7 7 Tall grass -8 8 Desert -9 9 Tundra -10 10 Irrigated crops -11 11 Semidesert -12 12 Ice caps and glaciers -13 13 Bogs and marshes -14 14 Inland water -15 15 Ocean -16 16 Evergreen shrubs -17 17 Deciduous shrubs -18 18 Mixed forest -19 19 Interrupted forest -20 20 Water and land mixtures +1 1 Crops, mixed farming +2 2 Short grass +3 3 Evergreen needleleaf trees +4 4 Deciduous needleleaf trees +5 5 Deciduous broadleaf trees +6 6 Evergreen broadleaf trees +7 7 Tall grass +8 8 Desert +9 9 Tundra +10 10 Irrigated crops +11 11 Semidesert +12 12 Ice caps and glaciers +13 13 Bogs and marshes +14 14 Inland water +15 15 Ocean +16 16 Evergreen shrubs +17 17 Deciduous shrubs +18 18 Mixed forest +19 19 Interrupted forest +20 20 Water and land mixtures diff --git a/definitions/grib2/tables/12/4.236.table b/definitions/grib2/tables/12/4.236.table index 08c7f8d56..b667b65fc 100644 --- a/definitions/grib2/tables/12/4.236.table +++ b/definitions/grib2/tables/12/4.236.table @@ -1,8 +1,8 @@ # Code table 4.236 - Soil texture fraction (to be used as partitioned parameter in PDT 4.53 or 4.54) -1 1 Coarse -2 2 Medium -3 3 Medium-fine -4 4 Fine -5 5 Very-fine -6 6 Organic -7 7 Tropical-organic +1 1 Coarse +2 2 Medium +3 3 Medium-fine +4 4 Fine +5 5 Very-fine +6 6 Organic +7 7 Tropical-organic diff --git a/definitions/grib2/tables/12/4.3.table b/definitions/grib2/tables/12/4.3.table index 8f7d20be3..1681cfc93 100644 --- a/definitions/grib2/tables/12/4.3.table +++ b/definitions/grib2/tables/12/4.3.table @@ -1,16 +1,16 @@ # Code table 4.3 - Type of generating process -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.4.table b/definitions/grib2/tables/12/4.4.table index 7087ebddb..6e63e069c 100644 --- a/definitions/grib2/tables/12/4.4.table +++ b/definitions/grib2/tables/12/4.4.table @@ -1,17 +1,17 @@ # Code table 4.4 - Indicator of unit of time range -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.5.table b/definitions/grib2/tables/12/4.5.table index 1ada3eb23..c3b8aec5d 100644 --- a/definitions/grib2/tables/12/4.5.table +++ b/definitions/grib2/tables/12/4.5.table @@ -1,5 +1,5 @@ # Code table 4.5 - Fixed surface types and units -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface 2 2 Cloud base level 3 3 Level of cloud tops @@ -12,11 +12,11 @@ 10 10 Entire atmosphere 11 11 Cumulonimbus (CB) base (m) 12 12 Cumulonimbus (CB) top (m) -# 13-19 Reserved +# 13-19 Reserved 20 20 Isothermal level (K) -# 21-99 Reserved +# 21-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -25,7 +25,7 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level 112 112 Reserved 113 113 Logarithmic hybrid level @@ -36,7 +36,7 @@ 119 hpl Hybrid pressure level # 120-149 Reserved 150 150 Generalized vertical height coordinate -# 151-159 Reserved +# 151-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 sfc Lake or river bottom @@ -44,6 +44,6 @@ 164 164 Bottom of thermally active sediment layer 165 165 Bottom of sediment layer penetrated by thermal wave 166 sfc Mixing layer -# 167-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 167-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.6.table b/definitions/grib2/tables/12/4.6.table index b2dfeb498..ce799721d 100644 --- a/definitions/grib2/tables/12/4.6.table +++ b/definitions/grib2/tables/12/4.6.table @@ -1,9 +1,9 @@ # Code table 4.6 - Type of ensemble forecast -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.7.table b/definitions/grib2/tables/12/4.7.table index e0de0e1b2..69b2b4d77 100644 --- a/definitions/grib2/tables/12/4.7.table +++ b/definitions/grib2/tables/12/4.7.table @@ -1,14 +1,14 @@ # Code table 4.7 - Derived forecast -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.8.table b/definitions/grib2/tables/12/4.8.table index ad883039c..78467454a 100644 --- a/definitions/grib2/tables/12/4.8.table +++ b/definitions/grib2/tables/12/4.8.table @@ -1,6 +1,6 @@ # Code table 4.8 - Clustering method -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.9.table b/definitions/grib2/tables/12/4.9.table index 5878b5ad3..0ce312dd1 100644 --- a/definitions/grib2/tables/12/4.9.table +++ b/definitions/grib2/tables/12/4.9.table @@ -1,9 +1,9 @@ # Code table 4.9 - Probability type -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/4.91.table b/definitions/grib2/tables/12/4.91.table index 97b1c70ad..ae31ed61c 100644 --- a/definitions/grib2/tables/12/4.91.table +++ b/definitions/grib2/tables/12/4.91.table @@ -1,16 +1,16 @@ # Code table 4.91 - Type of Interval -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit 11 11 Equal to first limit -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/12/5.1.table b/definitions/grib2/tables/12/5.1.table index 854330c74..1189b5e46 100644 --- a/definitions/grib2/tables/12/5.1.table +++ b/definitions/grib2/tables/12/5.1.table @@ -1,6 +1,6 @@ # Code table 5.1 - Type of original field values -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/5.2.table b/definitions/grib2/tables/12/5.2.table index 7a4500ecd..d12b46fbd 100644 --- a/definitions/grib2/tables/12/5.2.table +++ b/definitions/grib2/tables/12/5.2.table @@ -1,8 +1,8 @@ # Code table 5.2 - Matrix coordinate value function definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use +# 12-191 Reserved +# 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/12/5.3.table b/definitions/grib2/tables/12/5.3.table index c3b7b30fe..481331791 100644 --- a/definitions/grib2/tables/12/5.3.table +++ b/definitions/grib2/tables/12/5.3.table @@ -1,7 +1,7 @@ # Code table 5.3 - Matrix coordinate parameter -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/5.4.table b/definitions/grib2/tables/12/5.4.table index 8121c1819..e84ab1901 100644 --- a/definitions/grib2/tables/12/5.4.table +++ b/definitions/grib2/tables/12/5.4.table @@ -1,6 +1,6 @@ # Code table 5.4 - Group splitting method -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/5.40.table b/definitions/grib2/tables/12/5.40.table index b9bad2c39..97e8880ab 100644 --- a/definitions/grib2/tables/12/5.40.table +++ b/definitions/grib2/tables/12/5.40.table @@ -1,5 +1,5 @@ # Code table 5.40 - Type of compression -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/12/5.5.table b/definitions/grib2/tables/12/5.5.table index 3ef3eb070..f2316975a 100644 --- a/definitions/grib2/tables/12/5.5.table +++ b/definitions/grib2/tables/12/5.5.table @@ -1,7 +1,7 @@ # Code table 5.5 - Missing value management for complex packing -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/5.6.table b/definitions/grib2/tables/12/5.6.table index 6d5177877..db68ead9c 100644 --- a/definitions/grib2/tables/12/5.6.table +++ b/definitions/grib2/tables/12/5.6.table @@ -1,7 +1,7 @@ # Code table 5.6 - Order of spatial differencing -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/12/5.7.table b/definitions/grib2/tables/12/5.7.table index 5ab780056..e54862c19 100644 --- a/definitions/grib2/tables/12/5.7.table +++ b/definitions/grib2/tables/12/5.7.table @@ -1,7 +1,7 @@ # Code table 5.7 - Precision of floating-point numbers -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/12/6.0.table b/definitions/grib2/tables/12/6.0.table index f539b26d7..a8f30f5a4 100644 --- a/definitions/grib2/tables/12/6.0.table +++ b/definitions/grib2/tables/12/6.0.table @@ -1,6 +1,6 @@ # Code table 6.0 - Bit map indicator 0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/13/0.0.table b/definitions/grib2/tables/13/0.0.table index b24c50564..2c5afceb4 100644 --- a/definitions/grib2/tables/13/0.0.table +++ b/definitions/grib2/tables/13/0.0.table @@ -1,10 +1,10 @@ # Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/1.0.table b/definitions/grib2/tables/13/1.0.table index dfca4d4c1..b90cc628e 100644 --- a/definitions/grib2/tables/13/1.0.table +++ b/definitions/grib2/tables/13/1.0.table @@ -1,18 +1,18 @@ # Code table 1.0 - GRIB master tables version number -0 0 Experimental -1 1 Version implemented on 7 November 2001 -2 2 Version implemented on 4 November 2003 -3 3 Version implemented on 2 November 2005 -4 4 Version implemented on 7 November 2007 -5 5 Version implemented on 4 November 2009 -6 6 Version implemented on 15 September 2010 -7 7 Version implemented on 4 May 2011 -8 8 Version implemented on 2 November 2011 -9 9 Version implemented on 2 May 2012 +0 0 Experimental +1 1 Version implemented on 7 November 2001 +2 2 Version implemented on 4 November 2003 +3 3 Version implemented on 2 November 2005 +4 4 Version implemented on 7 November 2007 +5 5 Version implemented on 4 November 2009 +6 6 Version implemented on 15 September 2010 +7 7 Version implemented on 4 May 2011 +8 8 Version implemented on 2 November 2011 +9 9 Version implemented on 2 May 2012 10 10 Version implemented on 7 November 2012 11 11 Version implemented on 8 May 2013 12 12 Version implemented on 14 November 2013 13 13 Version implemented on 7 May 2014 14 14 Pre-operational to be implemented by next amendment # 15-254 Future versions -255 255 Missing +255 255 Missing diff --git a/definitions/grib2/tables/13/1.1.table b/definitions/grib2/tables/13/1.1.table index d50f8fd72..f6d332005 100644 --- a/definitions/grib2/tables/13/1.1.table +++ b/definitions/grib2/tables/13/1.1.table @@ -1,4 +1,4 @@ # Code table 1.1 - GRIB local tables version number -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/13/1.2.table b/definitions/grib2/tables/13/1.2.table index 934b70455..638f1efbb 100644 --- a/definitions/grib2/tables/13/1.2.table +++ b/definitions/grib2/tables/13/1.2.table @@ -1,8 +1,8 @@ # Code table 1.2 - Significance of reference time -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/1.3.table b/definitions/grib2/tables/13/1.3.table index 9b37611b0..c3b924d9d 100644 --- a/definitions/grib2/tables/13/1.3.table +++ b/definitions/grib2/tables/13/1.3.table @@ -1,12 +1,12 @@ # Code table 1.3 - Production status of data -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products 4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) 5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) 6 6 S2S operational products 7 7 S2S test products -# 8-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/1.4.table b/definitions/grib2/tables/13/1.4.table index 03203d874..877288c0e 100644 --- a/definitions/grib2/tables/13/1.4.table +++ b/definitions/grib2/tables/13/1.4.table @@ -1,13 +1,13 @@ # Code table 1.4 - Type of data -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/13/1.5.table b/definitions/grib2/tables/13/1.5.table index b2cf9f087..533111959 100644 --- a/definitions/grib2/tables/13/1.5.table +++ b/definitions/grib2/tables/13/1.5.table @@ -1,7 +1,7 @@ # Code table 1.5 - Identification template number -0 0 Calendar definition -1 1 Paleontological offset -2 2 Calendar definition and paleontological offset -# 3-32767 Reserved -# 32768-65534 Reserved for local use -65535 65535 Missing +0 0 Calendar definition +1 1 Paleontological offset +2 2 Calendar definition and paleontological offset +# 3-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/13/1.6.table b/definitions/grib2/tables/13/1.6.table index 5db921990..bd46899a7 100644 --- a/definitions/grib2/tables/13/1.6.table +++ b/definitions/grib2/tables/13/1.6.table @@ -1,8 +1,8 @@ # Code table 1.6 - Type of calendar -0 0 Gregorian -1 1 360-day -2 2 365-day -3 3 Proleptic Gregorian -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Gregorian +1 1 360-day +2 2 365-day +3 3 Proleptic Gregorian +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/3.0.table b/definitions/grib2/tables/13/3.0.table index 45187b80d..a442a06a0 100644 --- a/definitions/grib2/tables/13/3.0.table +++ b/definitions/grib2/tables/13/3.0.table @@ -1,6 +1,6 @@ # Code table 3.0 - Source of grid definition -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/13/3.10.table b/definitions/grib2/tables/13/3.10.table index afa8843a7..1612d05e3 100644 --- a/definitions/grib2/tables/13/3.10.table +++ b/definitions/grib2/tables/13/3.10.table @@ -1,8 +1,8 @@ # Flag table 3.10 - Scanning mode for one diamond -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/13/3.11.table b/definitions/grib2/tables/13/3.11.table index e516a2ab9..06ae10810 100644 --- a/definitions/grib2/tables/13/3.11.table +++ b/definitions/grib2/tables/13/3.11.table @@ -1,7 +1,7 @@ # Code table 3.11 - Interpretation of list of numbers at end of section 3 -0 0 There is no appended list -1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows -2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row -3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) -# 4-254 Reserved -255 255 Missing +0 0 There is no appended list +1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows +2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row +3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/13/3.15.table b/definitions/grib2/tables/13/3.15.table index 331217ebe..6087902a3 100644 --- a/definitions/grib2/tables/13/3.15.table +++ b/definitions/grib2/tables/13/3.15.table @@ -1,23 +1,23 @@ # Code table 3.15 - Physical meaning of vertical coordinate -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) -113 113 Logarithmic hybrid coordinate -# 114-159 Reserved +113 113 Logarithmic hybrid coordinate +# 114-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/3.2.table b/definitions/grib2/tables/13/3.2.table index 9238dc2a7..b9574a424 100644 --- a/definitions/grib2/tables/13/3.2.table +++ b/definitions/grib2/tables/13/3.2.table @@ -1,14 +1,14 @@ # Code table 3.2 - Shape of the Earth -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame -9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame +9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/3.20.table b/definitions/grib2/tables/13/3.20.table index efbf08d19..e2bb156ee 100644 --- a/definitions/grib2/tables/13/3.20.table +++ b/definitions/grib2/tables/13/3.20.table @@ -1,6 +1,6 @@ # Code table 3.20 - Type of horizontal line -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/3.21.table b/definitions/grib2/tables/13/3.21.table index 88dbb9019..e001e1c8f 100644 --- a/definitions/grib2/tables/13/3.21.table +++ b/definitions/grib2/tables/13/3.21.table @@ -1,8 +1,8 @@ # Code table 3.21 - Vertical dimension coordinate values definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/3.3.table b/definitions/grib2/tables/13/3.3.table index 5dd7c7001..25cb46a1d 100644 --- a/definitions/grib2/tables/13/3.3.table +++ b/definitions/grib2/tables/13/3.3.table @@ -1,9 +1,9 @@ # Flag table 3.3 - Resolution and component flags -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/13/3.4.table b/definitions/grib2/tables/13/3.4.table index 63c8adaaa..ea9cbe829 100644 --- a/definitions/grib2/tables/13/3.4.table +++ b/definitions/grib2/tables/13/3.4.table @@ -1,10 +1,10 @@ # Flag table 3.4 - Scanning mode -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -# 5-8 Reserved +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +# 5-8 Reserved diff --git a/definitions/grib2/tables/13/3.5.table b/definitions/grib2/tables/13/3.5.table index eabdde896..2f8ec82e3 100644 --- a/definitions/grib2/tables/13/3.5.table +++ b/definitions/grib2/tables/13/3.5.table @@ -1,5 +1,5 @@ # Flag table 3.5 - Projection centre -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/13/3.7.table b/definitions/grib2/tables/13/3.7.table index 0a7d6efde..34c0de085 100644 --- a/definitions/grib2/tables/13/3.7.table +++ b/definitions/grib2/tables/13/3.7.table @@ -1,5 +1,5 @@ # Code table 3.7 - Spectral data representation mode -0 0 Reserved +0 0 Reserved 1 1 see separate doc or pdf file -# 2-254 Reserved -255 255 Missing +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/13/3.8.table b/definitions/grib2/tables/13/3.8.table index 844e74235..578fab37f 100644 --- a/definitions/grib2/tables/13/3.8.table +++ b/definitions/grib2/tables/13/3.8.table @@ -1,7 +1,7 @@ # Code table 3.8 - Grid point position -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/3.9.table b/definitions/grib2/tables/13/3.9.table index fd730bc64..ecd65514a 100644 --- a/definitions/grib2/tables/13/3.9.table +++ b/definitions/grib2/tables/13/3.9.table @@ -1,4 +1,4 @@ # Flag table 3.9 - Numbering order of diamonds as seen from the corresponding pole -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/13/4.0.table b/definitions/grib2/tables/13/4.0.table index 89cf92c44..7627a2a3d 100644 --- a/definitions/grib2/tables/13/4.0.table +++ b/definitions/grib2/tables/13/4.0.table @@ -1,62 +1,62 @@ # Code table 4.0 - Product definition template number -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time -8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -# 35-39 Reserved +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 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 +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +# 35-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -42 42 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 atmospheric chemical constituents -43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol -46 46 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 aerosol -47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol -48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -# 49-50 Reserved -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time -52 52 Reserved -53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time -54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters -# 55-59 Reserved +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 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 atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 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 aerosol +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +# 49-50 Reserved +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +52 52 Reserved +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +# 55-59 Reserved 60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time 61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 62-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +# 62-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved -# 32768-65534 Reserved for local use +# 1102-32767 Reserved +# 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/13/4.1.0.table b/definitions/grib2/tables/13/4.1.0.table index 04cfd7802..df58636d6 100644 --- a/definitions/grib2/tables/13/4.1.0.table +++ b/definitions/grib2/tables/13/4.1.0.table @@ -1,27 +1,27 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.1.1.table b/definitions/grib2/tables/13/4.1.1.table index 7b22b6fed..05a854da0 100644 --- a/definitions/grib2/tables/13/4.1.1.table +++ b/definitions/grib2/tables/13/4.1.1.table @@ -1,7 +1,7 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.1.10.table b/definitions/grib2/tables/13/4.1.10.table index b97dcd355..e9663f391 100644 --- a/definitions/grib2/tables/13/4.1.10.table +++ b/definitions/grib2/tables/13/4.1.10.table @@ -1,10 +1,10 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Sub-surface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Sub-surface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.1.2.table b/definitions/grib2/tables/13/4.1.2.table index 5b488fe9e..e74126645 100644 --- a/definitions/grib2/tables/13/4.1.2.table +++ b/definitions/grib2/tables/13/4.1.2.table @@ -1,9 +1,9 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.1.3.table b/definitions/grib2/tables/13/4.1.3.table index 5096a166e..c1a1e267a 100644 --- a/definitions/grib2/tables/13/4.1.3.table +++ b/definitions/grib2/tables/13/4.1.3.table @@ -1,6 +1,6 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Image format products -1 1 Quantitative products -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.10.table b/definitions/grib2/tables/13/4.10.table index 1a92baaf6..8a390e4be 100644 --- a/definitions/grib2/tables/13/4.10.table +++ b/definitions/grib2/tables/13/4.10.table @@ -1,16 +1,16 @@ # Code table 4.10 - Type of statistical processing -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -11 11 Summation -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/13/4.11.table b/definitions/grib2/tables/13/4.11.table index 7f404c849..01cc81303 100644 --- a/definitions/grib2/tables/13/4.11.table +++ b/definitions/grib2/tables/13/4.11.table @@ -1,10 +1,10 @@ # Code table 4.11 - Type of time intervals -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.12.table b/definitions/grib2/tables/13/4.12.table index 03fd89b36..d42b47e96 100644 --- a/definitions/grib2/tables/13/4.12.table +++ b/definitions/grib2/tables/13/4.12.table @@ -1,7 +1,7 @@ # Code table 4.12 - Operating mode -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.13.table b/definitions/grib2/tables/13/4.13.table index c92854eec..a0e28eac8 100644 --- a/definitions/grib2/tables/13/4.13.table +++ b/definitions/grib2/tables/13/4.13.table @@ -1,6 +1,6 @@ # Code table 4.13 - Quality control indicator -0 0 No quality control applied -1 1 Quality control applied -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.14.table b/definitions/grib2/tables/13/4.14.table index a88cb93fa..d525b23b3 100644 --- a/definitions/grib2/tables/13/4.14.table +++ b/definitions/grib2/tables/13/4.14.table @@ -1,6 +1,6 @@ # Code table 4.14 - Clutter filter indicator -0 0 No clutter filter used -1 1 Clutter filter used -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.15.table b/definitions/grib2/tables/13/4.15.table index 2e5f3dea3..7adddedb6 100644 --- a/definitions/grib2/tables/13/4.15.table +++ b/definitions/grib2/tables/13/4.15.table @@ -1,11 +1,11 @@ # Code table 4.15 - Type of spatial processing used to arrive at given data value from the source data -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.0.table b/definitions/grib2/tables/13/4.2.0.0.table index 6de8a23c8..24d21959d 100644 --- a/definitions/grib2/tables/13/4.2.0.0.table +++ b/definitions/grib2/tables/13/4.2.0.0.table @@ -21,6 +21,6 @@ 19 19 Turbulent transfer coefficient for heat (Numeric) 20 20 Turbulent diffusion coefficient for heat (m2/s) 21 21 Apparent temperature (K) -# 22-191 Reserved +# 22-191 Reserved # 192-254 Reserved for local use -255 255 Missing +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.1.table b/definitions/grib2/tables/13/4.2.0.1.table index d1d1704df..fb7c3d776 100644 --- a/definitions/grib2/tables/13/4.2.0.1.table +++ b/definitions/grib2/tables/13/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,10 +86,10 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rainwater content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) -# 93-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 93-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.13.table b/definitions/grib2/tables/13/4.2.0.13.table index 5086101ad..3f5c30675 100644 --- a/definitions/grib2/tables/13/4.2.0.13.table +++ b/definitions/grib2/tables/13/4.2.0.13.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.14.table b/definitions/grib2/tables/13/4.2.0.14.table index 215884737..97fb38c8b 100644 --- a/definitions/grib2/tables/13/4.2.0.14.table +++ b/definitions/grib2/tables/13/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.15.table b/definitions/grib2/tables/13/4.2.0.15.table index d74fa7234..bb0b9ab46 100644 --- a/definitions/grib2/tables/13/4.2.0.15.table +++ b/definitions/grib2/tables/13/4.2.0.15.table @@ -14,6 +14,6 @@ 12 12 Reflectivity of rain (dB) 13 13 Reflectivity of graupel (dB) 14 14 Reflectivity of hail (dB) -# 15-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 15-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.16.table b/definitions/grib2/tables/13/4.2.0.16.table index 0c240a853..9499d9333 100644 --- a/definitions/grib2/tables/13/4.2.0.16.table +++ b/definitions/grib2/tables/13/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.18.table b/definitions/grib2/tables/13/4.2.0.18.table index 18c41aa48..7e0a736eb 100644 --- a/definitions/grib2/tables/13/4.2.0.18.table +++ b/definitions/grib2/tables/13/4.2.0.18.table @@ -8,11 +8,11 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) 13 13 Total deposition (wet + dry) (Bq m-2) -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.19.table b/definitions/grib2/tables/13/4.2.0.19.table index 75101bd37..d2beef083 100644 --- a/definitions/grib2/tables/13/4.2.0.19.table +++ b/definitions/grib2/tables/13/4.2.0.19.table @@ -27,6 +27,6 @@ 25 25 Weather (Code table 4.225) 26 26 Convective outlook (Code table 4.224) 27 27 Icing scenario (Code table 4.227) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.190.table b/definitions/grib2/tables/13/4.2.0.190.table index de621a924..a0d6ba0ac 100644 --- a/definitions/grib2/tables/13/4.2.0.190.table +++ b/definitions/grib2/tables/13/4.2.0.190.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.191.table b/definitions/grib2/tables/13/4.2.0.191.table index e3bba0ebe..b3a7092ea 100644 --- a/definitions/grib2/tables/13/4.2.0.191.table +++ b/definitions/grib2/tables/13/4.2.0.191.table @@ -3,6 +3,6 @@ 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.2.table b/definitions/grib2/tables/13/4.2.0.2.table index c83b07300..7bd1509f5 100644 --- a/definitions/grib2/tables/13/4.2.0.2.table +++ b/definitions/grib2/tables/13/4.2.0.2.table @@ -38,6 +38,6 @@ 36 36 Amplitude function for Rossby wave envelope for meridional wind (m/s) 37 37 Northward turbulent surface stress (N m-2 s) 38 38 Eastward turbulent surface stress (N m-2 s) -# 39-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 39-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.20.table b/definitions/grib2/tables/13/4.2.0.20.table index 9584f7c7f..df9ccc184 100644 --- a/definitions/grib2/tables/13/4.2.0.20.table +++ b/definitions/grib2/tables/13/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -25,7 +25,7 @@ 57 57 Total yearly average burden of the atmosphere (mol) 58 58 Total yearly averaged atmospheric loss (mol/s) 59 59 Aerosol number concentration (m-3) -# 60-99 Reserved +# 60-99 Reserved 100 100 Surface area density (aerosol) (/m) 101 101 Vertical visual range (m) 102 102 Aerosol optical thickness (Numeric) @@ -37,6 +37,6 @@ 108 108 Aerosol lidar backscatter from the ground (m-1 sr-1) 109 109 Aerosol lidar extinction from satellite (/m) 110 110 Aerosol lidar extinction from the ground (/m) -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.3.table b/definitions/grib2/tables/13/4.2.0.3.table index 9a88e0027..e1a68bfc5 100644 --- a/definitions/grib2/tables/13/4.2.0.3.table +++ b/definitions/grib2/tables/13/4.2.0.3.table @@ -26,6 +26,6 @@ 24 24 Anisotropy of sub-gridscale orography (Numeric) 25 25 Natural logarithm of pressure in Pa (Numeric) 26 26 Exner pressure (Numeric) -# 27-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 27-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.4.table b/definitions/grib2/tables/13/4.2.0.4.table index dbfcbddb7..03b5cea38 100644 --- a/definitions/grib2/tables/13/4.2.0.4.table +++ b/definitions/grib2/tables/13/4.2.0.4.table @@ -12,9 +12,9 @@ 10 10 Photosynthetically active radiation (W m-2) 11 11 Net short-wave radiation flux, clear sky (W m-2) 12 12 Downward UV radiation (W m-2) -# 13-49 Reserved +# 13-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) -# 52-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 52-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.5.table b/definitions/grib2/tables/13/4.2.0.5.table index f1c04650d..1bdd6ebee 100644 --- a/definitions/grib2/tables/13/4.2.0.5.table +++ b/definitions/grib2/tables/13/4.2.0.5.table @@ -6,6 +6,6 @@ 4 4 Upward long-wave radiation flux (W m-2) 5 5 Net long-wave radiation flux (W m-2) 6 6 Net long-wave radiation flux, clear sky (W m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.6.table b/definitions/grib2/tables/13/4.2.0.6.table index 9ee97b73f..89da06eec 100644 --- a/definitions/grib2/tables/13/4.2.0.6.table +++ b/definitions/grib2/tables/13/4.2.0.6.table @@ -35,6 +35,6 @@ 33 33 Sunshine duration (s) 34 34 Surface long-wave effective total cloudiness (Numeric) 35 35 Surface short-wave effective total cloudiness (Numeric) -# 36-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 36-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.0.7.table b/definitions/grib2/tables/13/4.2.0.7.table index db47d0113..8a2b85fb9 100644 --- a/definitions/grib2/tables/13/4.2.0.7.table +++ b/definitions/grib2/tables/13/4.2.0.7.table @@ -13,8 +13,8 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraft helicity (m2 s-2) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.1.0.table b/definitions/grib2/tables/13/4.2.1.0.table index cf56b08ee..f455c3365 100644 --- a/definitions/grib2/tables/13/4.2.1.0.table +++ b/definitions/grib2/tables/13/4.2.1.0.table @@ -7,6 +7,6 @@ 5 5 Baseflow-groundwater runoff (kg m-2) 6 6 Storm surface runoff (kg m-2) 7 7 Discharge from rivers or streams (m3/s) -# 8-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.1.1.table b/definitions/grib2/tables/13/4.2.1.1.table index b488eb0bd..171da3958 100644 --- a/definitions/grib2/tables/13/4.2.1.1.table +++ b/definitions/grib2/tables/13/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.10.0.table b/definitions/grib2/tables/13/4.2.10.0.table index 095f51bdf..3611abd9a 100644 --- a/definitions/grib2/tables/13/4.2.10.0.table +++ b/definitions/grib2/tables/13/4.2.10.0.table @@ -45,6 +45,6 @@ 43 43 Kurtosis of the sea-surface elevation due to waves (-) 44 44 Benjamin-Feir index (-) 45 45 Spectral peakedness factor (/s) -# 46-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 46-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.10.1.table b/definitions/grib2/tables/13/4.2.10.1.table index 5959bfa28..f0a073c00 100644 --- a/definitions/grib2/tables/13/4.2.10.1.table +++ b/definitions/grib2/tables/13/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.10.191.table b/definitions/grib2/tables/13/4.2.10.191.table index dc0e23d7b..1ebf85006 100644 --- a/definitions/grib2/tables/13/4.2.10.191.table +++ b/definitions/grib2/tables/13/4.2.10.191.table @@ -3,6 +3,6 @@ 1 1 Meridional overturning stream function (m3/s) 2 2 Reserved 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.10.2.table b/definitions/grib2/tables/13/4.2.10.2.table index 157a9af65..0caeacba7 100644 --- a/definitions/grib2/tables/13/4.2.10.2.table +++ b/definitions/grib2/tables/13/4.2.10.2.table @@ -12,6 +12,6 @@ 10 10 Zonal vector component of vertically integrated ice internal pressure (Pa m) 11 11 Meridional vector component of vertically integrated ice internal pressure (Pa m) 12 12 Compressive ice strength (N/m) -# 13-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 13-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.10.3.table b/definitions/grib2/tables/13/4.2.10.3.table index f951bbe78..937720c93 100644 --- a/definitions/grib2/tables/13/4.2.10.3.table +++ b/definitions/grib2/tables/13/4.2.10.3.table @@ -1,6 +1,6 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.10.4.table b/definitions/grib2/tables/13/4.2.10.4.table index 54774f1b7..d5615ae26 100644 --- a/definitions/grib2/tables/13/4.2.10.4.table +++ b/definitions/grib2/tables/13/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2/s) 6 6 Ocean vertical momentum diffusivity (m2/s) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (/m) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.2.0.table b/definitions/grib2/tables/13/4.2.2.0.table index 93135b854..00342a32b 100644 --- a/definitions/grib2/tables/13/4.2.2.0.table +++ b/definitions/grib2/tables/13/4.2.2.0.table @@ -34,6 +34,6 @@ 32 32 Root depth of vegetation (m) 33 33 Water runoff and drainage (kg m-2) 34 34 Surface water runoff (kg m-2) -# 35-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 35-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.2.3.table b/definitions/grib2/tables/13/4.2.2.3.table index 2f6291077..3d3298c8a 100644 --- a/definitions/grib2/tables/13/4.2.2.3.table +++ b/definitions/grib2/tables/13/4.2.2.3.table @@ -22,6 +22,6 @@ 20 20 Column-integrated soil moisture (kg m-2) 21 21 Soil ice (kg m-3) 22 22 Column-integrated soil ice (kg m-2) -# 23-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 23-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.2.4.table b/definitions/grib2/tables/13/4.2.2.4.table index d4ede2f70..c8b877df6 100644 --- a/definitions/grib2/tables/13/4.2.2.4.table +++ b/definitions/grib2/tables/13/4.2.2.4.table @@ -4,6 +4,6 @@ 2 2 Haines Index (Numeric) 3 3 Fire burned area (%) 4 4 Fosberg index (Numeric) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.3.0.table b/definitions/grib2/tables/13/4.2.3.0.table index c0ffa29f5..80a829673 100644 --- a/definitions/grib2/tables/13/4.2.3.0.table +++ b/definitions/grib2/tables/13/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.2.3.1.table b/definitions/grib2/tables/13/4.2.3.1.table index 0c0fc8d37..bc16d8855 100644 --- a/definitions/grib2/tables/13/4.2.3.1.table +++ b/definitions/grib2/tables/13/4.2.3.1.table @@ -17,12 +17,12 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) 20 20 Aerosol optical thickness at 0.635 um 21 21 Aerosol optical thickness at 0.810 um 22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +23 23 Angstrom coefficient +# 24-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.201.table b/definitions/grib2/tables/13/4.201.table index 2510f2ef7..fa173c4e0 100644 --- a/definitions/grib2/tables/13/4.201.table +++ b/definitions/grib2/tables/13/4.201.table @@ -10,6 +10,6 @@ 8 8 Ice pellets 9 9 Graupel 10 10 Hail -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.202.table b/definitions/grib2/tables/13/4.202.table index 438502ff9..7f3c8f6cf 100644 --- a/definitions/grib2/tables/13/4.202.table +++ b/definitions/grib2/tables/13/4.202.table @@ -1,4 +1,4 @@ # Code table 4.202 - Precipitable water category -# 0-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.203.table b/definitions/grib2/tables/13/4.203.table index 8a9aedf7a..cf5eb6bdc 100644 --- a/definitions/grib2/tables/13/4.203.table +++ b/definitions/grib2/tables/13/4.203.table @@ -1,26 +1,26 @@ # Code table 4.203 - Cloud type -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.204.table b/definitions/grib2/tables/13/4.204.table index 91bcf1814..ffbd89502 100644 --- a/definitions/grib2/tables/13/4.204.table +++ b/definitions/grib2/tables/13/4.204.table @@ -1,9 +1,9 @@ # Code table 4.204 - Thunderstorm coverage -0 0 None -1 1 Isolated (1-2%) -2 2 Few (3-5%) -3 3 Scattered (16-45%) -4 4 Numerous (> 45%) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (16-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.205.table b/definitions/grib2/tables/13/4.205.table index 5b4484dfd..c40c7f47b 100644 --- a/definitions/grib2/tables/13/4.205.table +++ b/definitions/grib2/tables/13/4.205.table @@ -1,6 +1,6 @@ # Code table 4.205 - Presence of aerosol -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.206.table b/definitions/grib2/tables/13/4.206.table index 02c3dfdf9..76472c261 100644 --- a/definitions/grib2/tables/13/4.206.table +++ b/definitions/grib2/tables/13/4.206.table @@ -1,6 +1,6 @@ # Code table 4.206 - Volcanic ash -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.207.table b/definitions/grib2/tables/13/4.207.table index 8ddb2e048..b6392fca0 100644 --- a/definitions/grib2/tables/13/4.207.table +++ b/definitions/grib2/tables/13/4.207.table @@ -1,10 +1,10 @@ # Code table 4.207 - Icing -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.208.table b/definitions/grib2/tables/13/4.208.table index b83685a1a..4361d38c0 100644 --- a/definitions/grib2/tables/13/4.208.table +++ b/definitions/grib2/tables/13/4.208.table @@ -1,9 +1,9 @@ # Code table 4.208 - Turbulence -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.209.table b/definitions/grib2/tables/13/4.209.table index cb7617071..39ea549ac 100644 --- a/definitions/grib2/tables/13/4.209.table +++ b/definitions/grib2/tables/13/4.209.table @@ -1,9 +1,9 @@ # Code table 4.209 - Planetary boundary-layer regime -0 0 Reserved -1 1 Stable -2 2 Mechanically driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.210.table b/definitions/grib2/tables/13/4.210.table index 524a6ca73..791878469 100644 --- a/definitions/grib2/tables/13/4.210.table +++ b/definitions/grib2/tables/13/4.210.table @@ -1,6 +1,6 @@ # Code table 4.210 - Contrail intensity -0 0 Contrail not present -1 1 Contrail present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Contrail not present +1 1 Contrail present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.211.table b/definitions/grib2/tables/13/4.211.table index 098eb2d43..2a28a84d9 100644 --- a/definitions/grib2/tables/13/4.211.table +++ b/definitions/grib2/tables/13/4.211.table @@ -1,7 +1,7 @@ # Code table 4.211 - Contrail engine type -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.212.table b/definitions/grib2/tables/13/4.212.table index 1a085b88d..6a3dcf88c 100644 --- a/definitions/grib2/tables/13/4.212.table +++ b/definitions/grib2/tables/13/4.212.table @@ -1,18 +1,18 @@ # Code table 4.212 - Land use -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.213.table b/definitions/grib2/tables/13/4.213.table index c65784a00..68d627af6 100644 --- a/definitions/grib2/tables/13/4.213.table +++ b/definitions/grib2/tables/13/4.213.table @@ -1,16 +1,16 @@ # Code table 4.213 - Soil type -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.215.table b/definitions/grib2/tables/13/4.215.table index 88fda8b8c..c264c6722 100644 --- a/definitions/grib2/tables/13/4.215.table +++ b/definitions/grib2/tables/13/4.215.table @@ -1,9 +1,9 @@ # Code table 4.215 - Remotely-sensed snow coverage -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.216.table b/definitions/grib2/tables/13/4.216.table index 4d9a70f86..b51b358f4 100644 --- a/definitions/grib2/tables/13/4.216.table +++ b/definitions/grib2/tables/13/4.216.table @@ -1,5 +1,5 @@ # Code table 4.216 - Elevation of snow-covered terrain # 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/13/4.217.table b/definitions/grib2/tables/13/4.217.table index a4452182c..a700410d5 100644 --- a/definitions/grib2/tables/13/4.217.table +++ b/definitions/grib2/tables/13/4.217.table @@ -1,8 +1,8 @@ # Code table 4.217 - Cloud mask type -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.218.table b/definitions/grib2/tables/13/4.218.table index 6940a0e41..acf069c32 100644 --- a/definitions/grib2/tables/13/4.218.table +++ b/definitions/grib2/tables/13/4.218.table @@ -1,38 +1,38 @@ # Code table 4.218 - Pixel scene type -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation / crops -15 15 Permanent snow / ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -# 19-96 Reserved -97 97 Snow / ice on land -98 98 Snow / ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud / fog / Stratus -102 102 Low cloud / Stratocumulus -103 103 Low cloud / unknown type -104 104 Medium cloud / Nimbostratus -105 105 Medium cloud / Altostratus -106 106 Medium cloud / unknown type -107 107 High cloud / Cumulus -108 108 High cloud / Cirrus -109 109 High cloud / unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation / crops +15 15 Permanent snow / ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +# 19-96 Reserved +97 97 Snow / ice on land +98 98 Snow / ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud / fog / Stratus +102 102 Low cloud / Stratocumulus +103 103 Low cloud / unknown type +104 104 Medium cloud / Nimbostratus +105 105 Medium cloud / Altostratus +106 106 Medium cloud / unknown type +107 107 High cloud / Cumulus +108 108 High cloud / Cirrus +109 109 High cloud / unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.219.table b/definitions/grib2/tables/13/4.219.table index 86df0522e..9979f50ad 100644 --- a/definitions/grib2/tables/13/4.219.table +++ b/definitions/grib2/tables/13/4.219.table @@ -1,8 +1,8 @@ # Code table 4.219 - Cloud top height quality indicator -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.220.table b/definitions/grib2/tables/13/4.220.table index 93e841f8b..88e869e42 100644 --- a/definitions/grib2/tables/13/4.220.table +++ b/definitions/grib2/tables/13/4.220.table @@ -1,6 +1,6 @@ # Code table 4.220 - Horizontal dimension processed -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.221.table b/definitions/grib2/tables/13/4.221.table index 8448533d7..011cc3518 100644 --- a/definitions/grib2/tables/13/4.221.table +++ b/definitions/grib2/tables/13/4.221.table @@ -1,6 +1,6 @@ # Code table 4.221 - Treatment of missing data -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.222.table b/definitions/grib2/tables/13/4.222.table index 57f113014..558d947ac 100644 --- a/definitions/grib2/tables/13/4.222.table +++ b/definitions/grib2/tables/13/4.222.table @@ -1,6 +1,6 @@ # Code table 4.222 - Categorical result -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.223.table b/definitions/grib2/tables/13/4.223.table index f0deb076a..572c4e7a8 100644 --- a/definitions/grib2/tables/13/4.223.table +++ b/definitions/grib2/tables/13/4.223.table @@ -1,5 +1,5 @@ # Code table 4.223 - Fire detection indicator -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing diff --git a/definitions/grib2/tables/13/4.224.table b/definitions/grib2/tables/13/4.224.table index e87cde4bb..014f56e23 100644 --- a/definitions/grib2/tables/13/4.224.table +++ b/definitions/grib2/tables/13/4.224.table @@ -1,18 +1,18 @@ # Code table 4.224 - Categorical outlook -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/13/4.227.table b/definitions/grib2/tables/13/4.227.table index 27c76553d..48c3b7633 100644 --- a/definitions/grib2/tables/13/4.227.table +++ b/definitions/grib2/tables/13/4.227.table @@ -1,9 +1,9 @@ # Code table 4.227 - Icing scenario (weather/cloud classification) -0 0 None -1 1 General -2 2 Convective -3 3 Stratiform -4 4 Freezing -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 None +1 1 General +2 2 Convective +3 3 Stratiform +4 4 Freezing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/13/4.234.table b/definitions/grib2/tables/13/4.234.table index 9844a91d2..d8b3715b3 100644 --- a/definitions/grib2/tables/13/4.234.table +++ b/definitions/grib2/tables/13/4.234.table @@ -1,21 +1,21 @@ # Code table 4.234 - Canopy cover fraction (to be used as partitioned parameter in PDT 4.53 or 4.54) -1 1 Crops, mixed farming -2 2 Short grass -3 3 Evergreen needleleaf trees -4 4 Deciduous needleleaf trees -5 5 Deciduous broadleaf trees -6 6 Evergreen broadleaf trees -7 7 Tall grass -8 8 Desert -9 9 Tundra -10 10 Irrigated crops -11 11 Semidesert -12 12 Ice caps and glaciers -13 13 Bogs and marshes -14 14 Inland water -15 15 Ocean -16 16 Evergreen shrubs -17 17 Deciduous shrubs -18 18 Mixed forest -19 19 Interrupted forest -20 20 Water and land mixtures +1 1 Crops, mixed farming +2 2 Short grass +3 3 Evergreen needleleaf trees +4 4 Deciduous needleleaf trees +5 5 Deciduous broadleaf trees +6 6 Evergreen broadleaf trees +7 7 Tall grass +8 8 Desert +9 9 Tundra +10 10 Irrigated crops +11 11 Semidesert +12 12 Ice caps and glaciers +13 13 Bogs and marshes +14 14 Inland water +15 15 Ocean +16 16 Evergreen shrubs +17 17 Deciduous shrubs +18 18 Mixed forest +19 19 Interrupted forest +20 20 Water and land mixtures diff --git a/definitions/grib2/tables/13/4.236.table b/definitions/grib2/tables/13/4.236.table index 08c7f8d56..b667b65fc 100644 --- a/definitions/grib2/tables/13/4.236.table +++ b/definitions/grib2/tables/13/4.236.table @@ -1,8 +1,8 @@ # Code table 4.236 - Soil texture fraction (to be used as partitioned parameter in PDT 4.53 or 4.54) -1 1 Coarse -2 2 Medium -3 3 Medium-fine -4 4 Fine -5 5 Very-fine -6 6 Organic -7 7 Tropical-organic +1 1 Coarse +2 2 Medium +3 3 Medium-fine +4 4 Fine +5 5 Very-fine +6 6 Organic +7 7 Tropical-organic diff --git a/definitions/grib2/tables/13/4.3.table b/definitions/grib2/tables/13/4.3.table index 1a9d59dd1..2b775c807 100644 --- a/definitions/grib2/tables/13/4.3.table +++ b/definitions/grib2/tables/13/4.3.table @@ -1,18 +1,18 @@ # Code table 4.3 - Type of generating process -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast 12 12 Post-processed analysis 13 13 Post-processed forecast -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.4.table b/definitions/grib2/tables/13/4.4.table index 7087ebddb..6e63e069c 100644 --- a/definitions/grib2/tables/13/4.4.table +++ b/definitions/grib2/tables/13/4.4.table @@ -1,17 +1,17 @@ # Code table 4.4 - Indicator of unit of time range -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.5.table b/definitions/grib2/tables/13/4.5.table index ddab1d723..d61b61c9f 100644 --- a/definitions/grib2/tables/13/4.5.table +++ b/definitions/grib2/tables/13/4.5.table @@ -1,5 +1,5 @@ # Code table 4.5 - Fixed surface types and units -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface 2 2 Cloud base level 3 3 Level of cloud tops @@ -12,11 +12,11 @@ 10 10 Entire atmosphere 11 11 Cumulonimbus (CB) base (m) 12 12 Cumulonimbus (CB) top (m) -# 13-19 Reserved +# 13-19 Reserved 20 20 Isothermal level (K) -# 21-99 Reserved +# 21-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -25,7 +25,7 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level 112 112 Reserved 113 113 Logarithmic hybrid level @@ -36,7 +36,7 @@ 119 hpl Hybrid pressure level # 120-149 Reserved 150 150 Generalized vertical height coordinate -# 151-159 Reserved +# 151-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 sfc Lake or river bottom @@ -45,6 +45,6 @@ 165 165 Bottom of sediment layer penetrated by thermal wave 166 sfc Mixing layer 167 167 Bottom of root zone -# 168-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 168-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.6.table b/definitions/grib2/tables/13/4.6.table index b2dfeb498..ce799721d 100644 --- a/definitions/grib2/tables/13/4.6.table +++ b/definitions/grib2/tables/13/4.6.table @@ -1,9 +1,9 @@ # Code table 4.6 - Type of ensemble forecast -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.7.table b/definitions/grib2/tables/13/4.7.table index e0de0e1b2..69b2b4d77 100644 --- a/definitions/grib2/tables/13/4.7.table +++ b/definitions/grib2/tables/13/4.7.table @@ -1,14 +1,14 @@ # Code table 4.7 - Derived forecast -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.8.table b/definitions/grib2/tables/13/4.8.table index ad883039c..78467454a 100644 --- a/definitions/grib2/tables/13/4.8.table +++ b/definitions/grib2/tables/13/4.8.table @@ -1,6 +1,6 @@ # Code table 4.8 - Clustering method -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.9.table b/definitions/grib2/tables/13/4.9.table index 5878b5ad3..0ce312dd1 100644 --- a/definitions/grib2/tables/13/4.9.table +++ b/definitions/grib2/tables/13/4.9.table @@ -1,9 +1,9 @@ # Code table 4.9 - Probability type -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/4.91.table b/definitions/grib2/tables/13/4.91.table index 97b1c70ad..ae31ed61c 100644 --- a/definitions/grib2/tables/13/4.91.table +++ b/definitions/grib2/tables/13/4.91.table @@ -1,16 +1,16 @@ # Code table 4.91 - Type of Interval -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit 11 11 Equal to first limit -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/13/5.1.table b/definitions/grib2/tables/13/5.1.table index 854330c74..1189b5e46 100644 --- a/definitions/grib2/tables/13/5.1.table +++ b/definitions/grib2/tables/13/5.1.table @@ -1,6 +1,6 @@ # Code table 5.1 - Type of original field values -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/5.2.table b/definitions/grib2/tables/13/5.2.table index 7a4500ecd..d12b46fbd 100644 --- a/definitions/grib2/tables/13/5.2.table +++ b/definitions/grib2/tables/13/5.2.table @@ -1,8 +1,8 @@ # Code table 5.2 - Matrix coordinate value function definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use +# 12-191 Reserved +# 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/13/5.3.table b/definitions/grib2/tables/13/5.3.table index c3b7b30fe..481331791 100644 --- a/definitions/grib2/tables/13/5.3.table +++ b/definitions/grib2/tables/13/5.3.table @@ -1,7 +1,7 @@ # Code table 5.3 - Matrix coordinate parameter -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/5.4.table b/definitions/grib2/tables/13/5.4.table index 8121c1819..e84ab1901 100644 --- a/definitions/grib2/tables/13/5.4.table +++ b/definitions/grib2/tables/13/5.4.table @@ -1,6 +1,6 @@ # Code table 5.4 - Group splitting method -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/5.40.table b/definitions/grib2/tables/13/5.40.table index b9bad2c39..97e8880ab 100644 --- a/definitions/grib2/tables/13/5.40.table +++ b/definitions/grib2/tables/13/5.40.table @@ -1,5 +1,5 @@ # Code table 5.40 - Type of compression -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/13/5.5.table b/definitions/grib2/tables/13/5.5.table index 3ef3eb070..f2316975a 100644 --- a/definitions/grib2/tables/13/5.5.table +++ b/definitions/grib2/tables/13/5.5.table @@ -1,7 +1,7 @@ # Code table 5.5 - Missing value management for complex packing -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/5.6.table b/definitions/grib2/tables/13/5.6.table index 6d5177877..db68ead9c 100644 --- a/definitions/grib2/tables/13/5.6.table +++ b/definitions/grib2/tables/13/5.6.table @@ -1,7 +1,7 @@ # Code table 5.6 - Order of spatial differencing -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/13/5.7.table b/definitions/grib2/tables/13/5.7.table index 5ab780056..e54862c19 100644 --- a/definitions/grib2/tables/13/5.7.table +++ b/definitions/grib2/tables/13/5.7.table @@ -1,7 +1,7 @@ # Code table 5.7 - Precision of floating-point numbers -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/13/6.0.table b/definitions/grib2/tables/13/6.0.table index f539b26d7..a8f30f5a4 100644 --- a/definitions/grib2/tables/13/6.0.table +++ b/definitions/grib2/tables/13/6.0.table @@ -1,6 +1,6 @@ # Code table 6.0 - Bit map indicator 0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/14/0.0.table b/definitions/grib2/tables/14/0.0.table index b24c50564..2c5afceb4 100644 --- a/definitions/grib2/tables/14/0.0.table +++ b/definitions/grib2/tables/14/0.0.table @@ -1,10 +1,10 @@ # Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/1.0.table b/definitions/grib2/tables/14/1.0.table index 4dafc79fb..a004eadb3 100644 --- a/definitions/grib2/tables/14/1.0.table +++ b/definitions/grib2/tables/14/1.0.table @@ -1,19 +1,19 @@ # Code table 1.0 - GRIB master tables version number -0 0 Experimental -1 1 Version implemented on 7 November 2001 -2 2 Version implemented on 4 November 2003 -3 3 Version implemented on 2 November 2005 -4 4 Version implemented on 7 November 2007 -5 5 Version implemented on 4 November 2009 -6 6 Version implemented on 15 September 2010 -7 7 Version implemented on 4 May 2011 -8 8 Version implemented on 2 November 2011 -9 9 Version implemented on 2 May 2012 -10 10 Version implemented on 7 November 2012 -11 11 Version implemented on 8 May 2013 -12 12 Version implemented on 14 November 2013 -13 13 Version implemented on 7 May 2014 -14 14 Version implemented on 5 November 2014 -15 15 Pre-operational to be implemented by next amendment -# 16-254 Future versions -255 255 Missing +0 0 Experimental +1 1 Version implemented on 7 November 2001 +2 2 Version implemented on 4 November 2003 +3 3 Version implemented on 2 November 2005 +4 4 Version implemented on 7 November 2007 +5 5 Version implemented on 4 November 2009 +6 6 Version implemented on 15 September 2010 +7 7 Version implemented on 4 May 2011 +8 8 Version implemented on 2 November 2011 +9 9 Version implemented on 2 May 2012 +10 10 Version implemented on 7 November 2012 +11 11 Version implemented on 8 May 2013 +12 12 Version implemented on 14 November 2013 +13 13 Version implemented on 7 May 2014 +14 14 Version implemented on 5 November 2014 +15 15 Pre-operational to be implemented by next amendment +# 16-254 Future versions +255 255 Missing diff --git a/definitions/grib2/tables/14/1.1.table b/definitions/grib2/tables/14/1.1.table index d50f8fd72..f6d332005 100644 --- a/definitions/grib2/tables/14/1.1.table +++ b/definitions/grib2/tables/14/1.1.table @@ -1,4 +1,4 @@ # Code table 1.1 - GRIB local tables version number -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/14/1.2.table b/definitions/grib2/tables/14/1.2.table index 934b70455..638f1efbb 100644 --- a/definitions/grib2/tables/14/1.2.table +++ b/definitions/grib2/tables/14/1.2.table @@ -1,8 +1,8 @@ # Code table 1.2 - Significance of reference time -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/1.3.table b/definitions/grib2/tables/14/1.3.table index ea01c001c..eb3a79f9b 100644 --- a/definitions/grib2/tables/14/1.3.table +++ b/definitions/grib2/tables/14/1.3.table @@ -1,14 +1,14 @@ # Code table 1.3 - Production status of data -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products 4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) 5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) 6 6 S2S operational products 7 7 S2S test products 8 8 Uncertainties in ensembles of regional re-analysis project (UERRA) 9 9 Uncertainties in ensembles of regional re-analysis project test (UERRA) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/1.4.table b/definitions/grib2/tables/14/1.4.table index 03203d874..877288c0e 100644 --- a/definitions/grib2/tables/14/1.4.table +++ b/definitions/grib2/tables/14/1.4.table @@ -1,13 +1,13 @@ # Code table 1.4 - Type of data -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/14/1.5.table b/definitions/grib2/tables/14/1.5.table index b2cf9f087..533111959 100644 --- a/definitions/grib2/tables/14/1.5.table +++ b/definitions/grib2/tables/14/1.5.table @@ -1,7 +1,7 @@ # Code table 1.5 - Identification template number -0 0 Calendar definition -1 1 Paleontological offset -2 2 Calendar definition and paleontological offset -# 3-32767 Reserved -# 32768-65534 Reserved for local use -65535 65535 Missing +0 0 Calendar definition +1 1 Paleontological offset +2 2 Calendar definition and paleontological offset +# 3-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/14/1.6.table b/definitions/grib2/tables/14/1.6.table index 5db921990..bd46899a7 100644 --- a/definitions/grib2/tables/14/1.6.table +++ b/definitions/grib2/tables/14/1.6.table @@ -1,8 +1,8 @@ # Code table 1.6 - Type of calendar -0 0 Gregorian -1 1 360-day -2 2 365-day -3 3 Proleptic Gregorian -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Gregorian +1 1 360-day +2 2 365-day +3 3 Proleptic Gregorian +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/3.0.table b/definitions/grib2/tables/14/3.0.table index 45187b80d..a442a06a0 100644 --- a/definitions/grib2/tables/14/3.0.table +++ b/definitions/grib2/tables/14/3.0.table @@ -1,6 +1,6 @@ # Code table 3.0 - Source of grid definition -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/14/3.10.table b/definitions/grib2/tables/14/3.10.table index afa8843a7..1612d05e3 100644 --- a/definitions/grib2/tables/14/3.10.table +++ b/definitions/grib2/tables/14/3.10.table @@ -1,8 +1,8 @@ # Flag table 3.10 - Scanning mode for one diamond -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/14/3.11.table b/definitions/grib2/tables/14/3.11.table index e516a2ab9..06ae10810 100644 --- a/definitions/grib2/tables/14/3.11.table +++ b/definitions/grib2/tables/14/3.11.table @@ -1,7 +1,7 @@ # Code table 3.11 - Interpretation of list of numbers at end of section 3 -0 0 There is no appended list -1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows -2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row -3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) -# 4-254 Reserved -255 255 Missing +0 0 There is no appended list +1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows +2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row +3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/14/3.15.table b/definitions/grib2/tables/14/3.15.table index 331217ebe..6087902a3 100644 --- a/definitions/grib2/tables/14/3.15.table +++ b/definitions/grib2/tables/14/3.15.table @@ -1,23 +1,23 @@ # Code table 3.15 - Physical meaning of vertical coordinate -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) -113 113 Logarithmic hybrid coordinate -# 114-159 Reserved +113 113 Logarithmic hybrid coordinate +# 114-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/3.2.table b/definitions/grib2/tables/14/3.2.table index 9238dc2a7..b9574a424 100644 --- a/definitions/grib2/tables/14/3.2.table +++ b/definitions/grib2/tables/14/3.2.table @@ -1,14 +1,14 @@ # Code table 3.2 - Shape of the Earth -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame -9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame +9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/3.20.table b/definitions/grib2/tables/14/3.20.table index efbf08d19..e2bb156ee 100644 --- a/definitions/grib2/tables/14/3.20.table +++ b/definitions/grib2/tables/14/3.20.table @@ -1,6 +1,6 @@ # Code table 3.20 - Type of horizontal line -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/3.21.table b/definitions/grib2/tables/14/3.21.table index 88dbb9019..e001e1c8f 100644 --- a/definitions/grib2/tables/14/3.21.table +++ b/definitions/grib2/tables/14/3.21.table @@ -1,8 +1,8 @@ # Code table 3.21 - Vertical dimension coordinate values definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/3.3.table b/definitions/grib2/tables/14/3.3.table index 5dd7c7001..25cb46a1d 100644 --- a/definitions/grib2/tables/14/3.3.table +++ b/definitions/grib2/tables/14/3.3.table @@ -1,9 +1,9 @@ # Flag table 3.3 - Resolution and component flags -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/14/3.4.table b/definitions/grib2/tables/14/3.4.table index 897b813d7..43835c014 100644 --- a/definitions/grib2/tables/14/3.4.table +++ b/definitions/grib2/tables/14/3.4.table @@ -1,17 +1,17 @@ # Flag table 3.4 - Scanning mode -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -5 0 Points within odd rows are not offset in i (x) direction -5 1 Points within odd rows are offset by Di/2 in i (x) direction -6 0 Points within even rows are not offset in i (x) direction -6 1 Points within even rows are offset by Di/2 in i (x) direction -7 0 Points are not offset in j (y) direction -7 1 Points are offset by Dj/2 in j (y) direction -8 0 Rows have Ni grid points and columns have Nj grid points -8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +5 0 Points within odd rows are not offset in i (x) direction +5 1 Points within odd rows are offset by Di/2 in i (x) direction +6 0 Points within even rows are not offset in i (x) direction +6 1 Points within even rows are offset by Di/2 in i (x) direction +7 0 Points are not offset in j (y) direction +7 1 Points are offset by Dj/2 in j (y) direction +8 0 Rows have Ni grid points and columns have Nj grid points +8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction diff --git a/definitions/grib2/tables/14/3.5.table b/definitions/grib2/tables/14/3.5.table index eabdde896..2f8ec82e3 100644 --- a/definitions/grib2/tables/14/3.5.table +++ b/definitions/grib2/tables/14/3.5.table @@ -1,5 +1,5 @@ # Flag table 3.5 - Projection centre -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/14/3.7.table b/definitions/grib2/tables/14/3.7.table index 0a7d6efde..34c0de085 100644 --- a/definitions/grib2/tables/14/3.7.table +++ b/definitions/grib2/tables/14/3.7.table @@ -1,5 +1,5 @@ # Code table 3.7 - Spectral data representation mode -0 0 Reserved +0 0 Reserved 1 1 see separate doc or pdf file -# 2-254 Reserved -255 255 Missing +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/14/3.8.table b/definitions/grib2/tables/14/3.8.table index 844e74235..578fab37f 100644 --- a/definitions/grib2/tables/14/3.8.table +++ b/definitions/grib2/tables/14/3.8.table @@ -1,7 +1,7 @@ # Code table 3.8 - Grid point position -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/3.9.table b/definitions/grib2/tables/14/3.9.table index fd730bc64..ecd65514a 100644 --- a/definitions/grib2/tables/14/3.9.table +++ b/definitions/grib2/tables/14/3.9.table @@ -1,4 +1,4 @@ # Flag table 3.9 - Numbering order of diamonds as seen from the corresponding pole -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/14/4.0.table b/definitions/grib2/tables/14/4.0.table index b24b6fb11..7627a2a3d 100644 --- a/definitions/grib2/tables/14/4.0.table +++ b/definitions/grib2/tables/14/4.0.table @@ -1,62 +1,62 @@ # Code table 4.0 - Product definition template number -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time -8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -# 35-39 Reserved +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 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 +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +# 35-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -42 42 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 atmospheric chemical constituents -43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol -46 46 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 aerosol -47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol -48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -# 49-50 Reserved -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time -52 52 Reserved -53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time -54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters -# 55-59 Reserved -60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 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 atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 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 aerosol +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +# 49-50 Reserved +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +52 52 Reserved +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +# 55-59 Reserved +60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time 61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 62-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +# 62-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved -# 32768-65534 Reserved for local use +# 1102-32767 Reserved +# 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/14/4.1.0.table b/definitions/grib2/tables/14/4.1.0.table index 04cfd7802..df58636d6 100644 --- a/definitions/grib2/tables/14/4.1.0.table +++ b/definitions/grib2/tables/14/4.1.0.table @@ -1,27 +1,27 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.1.1.table b/definitions/grib2/tables/14/4.1.1.table index 7b22b6fed..05a854da0 100644 --- a/definitions/grib2/tables/14/4.1.1.table +++ b/definitions/grib2/tables/14/4.1.1.table @@ -1,7 +1,7 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.1.10.table b/definitions/grib2/tables/14/4.1.10.table index b97dcd355..e9663f391 100644 --- a/definitions/grib2/tables/14/4.1.10.table +++ b/definitions/grib2/tables/14/4.1.10.table @@ -1,10 +1,10 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Sub-surface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Sub-surface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.1.2.table b/definitions/grib2/tables/14/4.1.2.table index 5b488fe9e..e74126645 100644 --- a/definitions/grib2/tables/14/4.1.2.table +++ b/definitions/grib2/tables/14/4.1.2.table @@ -1,9 +1,9 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.1.3.table b/definitions/grib2/tables/14/4.1.3.table index 5096a166e..c1a1e267a 100644 --- a/definitions/grib2/tables/14/4.1.3.table +++ b/definitions/grib2/tables/14/4.1.3.table @@ -1,6 +1,6 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Image format products -1 1 Quantitative products -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.10.table b/definitions/grib2/tables/14/4.10.table index 1a92baaf6..8a390e4be 100644 --- a/definitions/grib2/tables/14/4.10.table +++ b/definitions/grib2/tables/14/4.10.table @@ -1,16 +1,16 @@ # Code table 4.10 - Type of statistical processing -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -11 11 Summation -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/14/4.11.table b/definitions/grib2/tables/14/4.11.table index 7f404c849..01cc81303 100644 --- a/definitions/grib2/tables/14/4.11.table +++ b/definitions/grib2/tables/14/4.11.table @@ -1,10 +1,10 @@ # Code table 4.11 - Type of time intervals -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.12.table b/definitions/grib2/tables/14/4.12.table index 03fd89b36..d42b47e96 100644 --- a/definitions/grib2/tables/14/4.12.table +++ b/definitions/grib2/tables/14/4.12.table @@ -1,7 +1,7 @@ # Code table 4.12 - Operating mode -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.13.table b/definitions/grib2/tables/14/4.13.table index c92854eec..a0e28eac8 100644 --- a/definitions/grib2/tables/14/4.13.table +++ b/definitions/grib2/tables/14/4.13.table @@ -1,6 +1,6 @@ # Code table 4.13 - Quality control indicator -0 0 No quality control applied -1 1 Quality control applied -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.14.table b/definitions/grib2/tables/14/4.14.table index a88cb93fa..d525b23b3 100644 --- a/definitions/grib2/tables/14/4.14.table +++ b/definitions/grib2/tables/14/4.14.table @@ -1,6 +1,6 @@ # Code table 4.14 - Clutter filter indicator -0 0 No clutter filter used -1 1 Clutter filter used -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.15.table b/definitions/grib2/tables/14/4.15.table index 2e5f3dea3..7adddedb6 100644 --- a/definitions/grib2/tables/14/4.15.table +++ b/definitions/grib2/tables/14/4.15.table @@ -1,11 +1,11 @@ # Code table 4.15 - Type of spatial processing used to arrive at given data value from the source data -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.0.table b/definitions/grib2/tables/14/4.2.0.0.table index 41e5291a9..24d21959d 100644 --- a/definitions/grib2/tables/14/4.2.0.0.table +++ b/definitions/grib2/tables/14/4.2.0.0.table @@ -21,6 +21,6 @@ 19 19 Turbulent transfer coefficient for heat (Numeric) 20 20 Turbulent diffusion coefficient for heat (m2/s) 21 21 Apparent temperature (K) -# 22-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 22-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.1.table b/definitions/grib2/tables/14/4.2.0.1.table index 4c624e74a..bd0214c77 100644 --- a/definitions/grib2/tables/14/4.2.0.1.table +++ b/definitions/grib2/tables/14/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,12 +86,12 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rainwater content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) 93 93 Relative humidity with respect to water (%) 94 94 Relative humidity with respect to ice (%) -# 95-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 95-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.13.table b/definitions/grib2/tables/14/4.2.0.13.table index 5086101ad..3f5c30675 100644 --- a/definitions/grib2/tables/14/4.2.0.13.table +++ b/definitions/grib2/tables/14/4.2.0.13.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.14.table b/definitions/grib2/tables/14/4.2.0.14.table index 215884737..97fb38c8b 100644 --- a/definitions/grib2/tables/14/4.2.0.14.table +++ b/definitions/grib2/tables/14/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.15.table b/definitions/grib2/tables/14/4.2.0.15.table index d74fa7234..bb0b9ab46 100644 --- a/definitions/grib2/tables/14/4.2.0.15.table +++ b/definitions/grib2/tables/14/4.2.0.15.table @@ -14,6 +14,6 @@ 12 12 Reflectivity of rain (dB) 13 13 Reflectivity of graupel (dB) 14 14 Reflectivity of hail (dB) -# 15-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 15-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.16.table b/definitions/grib2/tables/14/4.2.0.16.table index 0c240a853..9499d9333 100644 --- a/definitions/grib2/tables/14/4.2.0.16.table +++ b/definitions/grib2/tables/14/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.18.table b/definitions/grib2/tables/14/4.2.0.18.table index 18c41aa48..7e0a736eb 100644 --- a/definitions/grib2/tables/14/4.2.0.18.table +++ b/definitions/grib2/tables/14/4.2.0.18.table @@ -8,11 +8,11 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) 13 13 Total deposition (wet + dry) (Bq m-2) -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.19.table b/definitions/grib2/tables/14/4.2.0.19.table index 75101bd37..d2beef083 100644 --- a/definitions/grib2/tables/14/4.2.0.19.table +++ b/definitions/grib2/tables/14/4.2.0.19.table @@ -27,6 +27,6 @@ 25 25 Weather (Code table 4.225) 26 26 Convective outlook (Code table 4.224) 27 27 Icing scenario (Code table 4.227) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.190.table b/definitions/grib2/tables/14/4.2.0.190.table index de621a924..a0d6ba0ac 100644 --- a/definitions/grib2/tables/14/4.2.0.190.table +++ b/definitions/grib2/tables/14/4.2.0.190.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.191.table b/definitions/grib2/tables/14/4.2.0.191.table index e3bba0ebe..b3a7092ea 100644 --- a/definitions/grib2/tables/14/4.2.0.191.table +++ b/definitions/grib2/tables/14/4.2.0.191.table @@ -3,6 +3,6 @@ 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.2.table b/definitions/grib2/tables/14/4.2.0.2.table index c83b07300..7bd1509f5 100644 --- a/definitions/grib2/tables/14/4.2.0.2.table +++ b/definitions/grib2/tables/14/4.2.0.2.table @@ -38,6 +38,6 @@ 36 36 Amplitude function for Rossby wave envelope for meridional wind (m/s) 37 37 Northward turbulent surface stress (N m-2 s) 38 38 Eastward turbulent surface stress (N m-2 s) -# 39-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 39-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.20.table b/definitions/grib2/tables/14/4.2.0.20.table index 9584f7c7f..df9ccc184 100644 --- a/definitions/grib2/tables/14/4.2.0.20.table +++ b/definitions/grib2/tables/14/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -25,7 +25,7 @@ 57 57 Total yearly average burden of the atmosphere (mol) 58 58 Total yearly averaged atmospheric loss (mol/s) 59 59 Aerosol number concentration (m-3) -# 60-99 Reserved +# 60-99 Reserved 100 100 Surface area density (aerosol) (/m) 101 101 Vertical visual range (m) 102 102 Aerosol optical thickness (Numeric) @@ -37,6 +37,6 @@ 108 108 Aerosol lidar backscatter from the ground (m-1 sr-1) 109 109 Aerosol lidar extinction from satellite (/m) 110 110 Aerosol lidar extinction from the ground (/m) -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.3.table b/definitions/grib2/tables/14/4.2.0.3.table index 9a88e0027..e1a68bfc5 100644 --- a/definitions/grib2/tables/14/4.2.0.3.table +++ b/definitions/grib2/tables/14/4.2.0.3.table @@ -26,6 +26,6 @@ 24 24 Anisotropy of sub-gridscale orography (Numeric) 25 25 Natural logarithm of pressure in Pa (Numeric) 26 26 Exner pressure (Numeric) -# 27-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 27-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.4.table b/definitions/grib2/tables/14/4.2.0.4.table index dbfcbddb7..03b5cea38 100644 --- a/definitions/grib2/tables/14/4.2.0.4.table +++ b/definitions/grib2/tables/14/4.2.0.4.table @@ -12,9 +12,9 @@ 10 10 Photosynthetically active radiation (W m-2) 11 11 Net short-wave radiation flux, clear sky (W m-2) 12 12 Downward UV radiation (W m-2) -# 13-49 Reserved +# 13-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) -# 52-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 52-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.5.table b/definitions/grib2/tables/14/4.2.0.5.table index f1c04650d..1bdd6ebee 100644 --- a/definitions/grib2/tables/14/4.2.0.5.table +++ b/definitions/grib2/tables/14/4.2.0.5.table @@ -6,6 +6,6 @@ 4 4 Upward long-wave radiation flux (W m-2) 5 5 Net long-wave radiation flux (W m-2) 6 6 Net long-wave radiation flux, clear sky (W m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.6.table b/definitions/grib2/tables/14/4.2.0.6.table index 702152741..427240b70 100644 --- a/definitions/grib2/tables/14/4.2.0.6.table +++ b/definitions/grib2/tables/14/4.2.0.6.table @@ -37,6 +37,6 @@ 35 35 Surface short-wave effective total cloudiness (Numeric) 36 36 Fraction of stratiform precipitation cover (Proportion) 37 37 Fraction of convective precipitation cover (Proportion) -# 38-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 38-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.0.7.table b/definitions/grib2/tables/14/4.2.0.7.table index db47d0113..8a2b85fb9 100644 --- a/definitions/grib2/tables/14/4.2.0.7.table +++ b/definitions/grib2/tables/14/4.2.0.7.table @@ -13,8 +13,8 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraft helicity (m2 s-2) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.1.0.table b/definitions/grib2/tables/14/4.2.1.0.table index cf56b08ee..f455c3365 100644 --- a/definitions/grib2/tables/14/4.2.1.0.table +++ b/definitions/grib2/tables/14/4.2.1.0.table @@ -7,6 +7,6 @@ 5 5 Baseflow-groundwater runoff (kg m-2) 6 6 Storm surface runoff (kg m-2) 7 7 Discharge from rivers or streams (m3/s) -# 8-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.1.1.table b/definitions/grib2/tables/14/4.2.1.1.table index b488eb0bd..171da3958 100644 --- a/definitions/grib2/tables/14/4.2.1.1.table +++ b/definitions/grib2/tables/14/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.10.0.table b/definitions/grib2/tables/14/4.2.10.0.table index 095f51bdf..3611abd9a 100644 --- a/definitions/grib2/tables/14/4.2.10.0.table +++ b/definitions/grib2/tables/14/4.2.10.0.table @@ -45,6 +45,6 @@ 43 43 Kurtosis of the sea-surface elevation due to waves (-) 44 44 Benjamin-Feir index (-) 45 45 Spectral peakedness factor (/s) -# 46-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 46-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.10.1.table b/definitions/grib2/tables/14/4.2.10.1.table index 5959bfa28..f0a073c00 100644 --- a/definitions/grib2/tables/14/4.2.10.1.table +++ b/definitions/grib2/tables/14/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.10.191.table b/definitions/grib2/tables/14/4.2.10.191.table index 524929e78..1ebf85006 100644 --- a/definitions/grib2/tables/14/4.2.10.191.table +++ b/definitions/grib2/tables/14/4.2.10.191.table @@ -1,8 +1,8 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Meridional overturning stream function (m3/s) -2 2 Reserved +2 2 Reserved 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.10.2.table b/definitions/grib2/tables/14/4.2.10.2.table index 6797062ac..4633bad4f 100644 --- a/definitions/grib2/tables/14/4.2.10.2.table +++ b/definitions/grib2/tables/14/4.2.10.2.table @@ -12,6 +12,6 @@ 10 10 Zonal vector component of vertically integrated ice internal pressure (Pa m) 11 11 Meridional vector component of vertically integrated ice internal pressure (Pa m) 12 12 Compressive ice strength (N/m) -# 13-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 13-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.10.3.table b/definitions/grib2/tables/14/4.2.10.3.table index f951bbe78..937720c93 100644 --- a/definitions/grib2/tables/14/4.2.10.3.table +++ b/definitions/grib2/tables/14/4.2.10.3.table @@ -1,6 +1,6 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.10.4.table b/definitions/grib2/tables/14/4.2.10.4.table index 54774f1b7..d5615ae26 100644 --- a/definitions/grib2/tables/14/4.2.10.4.table +++ b/definitions/grib2/tables/14/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2/s) 6 6 Ocean vertical momentum diffusivity (m2/s) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (/m) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.2.0.table b/definitions/grib2/tables/14/4.2.2.0.table index 1853aa0fc..d61dd05fc 100644 --- a/definitions/grib2/tables/14/4.2.2.0.table +++ b/definitions/grib2/tables/14/4.2.2.0.table @@ -37,6 +37,6 @@ 35 35 Tile class (Code table 4.243) 36 36 Tile fraction (Proportion) 37 37 Tile percentage (%) -# 38-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 38-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.2.3.table b/definitions/grib2/tables/14/4.2.2.3.table index 2f6291077..3d3298c8a 100644 --- a/definitions/grib2/tables/14/4.2.2.3.table +++ b/definitions/grib2/tables/14/4.2.2.3.table @@ -22,6 +22,6 @@ 20 20 Column-integrated soil moisture (kg m-2) 21 21 Soil ice (kg m-3) 22 22 Column-integrated soil ice (kg m-2) -# 23-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 23-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.2.4.table b/definitions/grib2/tables/14/4.2.2.4.table index d4ede2f70..c8b877df6 100644 --- a/definitions/grib2/tables/14/4.2.2.4.table +++ b/definitions/grib2/tables/14/4.2.2.4.table @@ -4,6 +4,6 @@ 2 2 Haines Index (Numeric) 3 3 Fire burned area (%) 4 4 Fosberg index (Numeric) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.3.0.table b/definitions/grib2/tables/14/4.2.3.0.table index c0ffa29f5..80a829673 100644 --- a/definitions/grib2/tables/14/4.2.3.0.table +++ b/definitions/grib2/tables/14/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.2.3.1.table b/definitions/grib2/tables/14/4.2.3.1.table index 0c0fc8d37..bc16d8855 100644 --- a/definitions/grib2/tables/14/4.2.3.1.table +++ b/definitions/grib2/tables/14/4.2.3.1.table @@ -17,12 +17,12 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) 20 20 Aerosol optical thickness at 0.635 um 21 21 Aerosol optical thickness at 0.810 um 22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +23 23 Angstrom coefficient +# 24-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.201.table b/definitions/grib2/tables/14/4.201.table index 47f1b486f..fa173c4e0 100644 --- a/definitions/grib2/tables/14/4.201.table +++ b/definitions/grib2/tables/14/4.201.table @@ -1,15 +1,15 @@ # Code table 4.201 - Precipitation type -0 0 Reserved -1 1 Rain -2 2 Thunderstorm -3 3 Freezing rain -4 4 Mixed/ice -5 5 Snow -6 6 Wet snow -7 7 Mixture of rain and snow -8 8 Ice pellets -9 9 Graupel -10 10 Hail -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow +6 6 Wet snow +7 7 Mixture of rain and snow +8 8 Ice pellets +9 9 Graupel +10 10 Hail +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.202.table b/definitions/grib2/tables/14/4.202.table index 438502ff9..7f3c8f6cf 100644 --- a/definitions/grib2/tables/14/4.202.table +++ b/definitions/grib2/tables/14/4.202.table @@ -1,4 +1,4 @@ # Code table 4.202 - Precipitable water category -# 0-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.203.table b/definitions/grib2/tables/14/4.203.table index 8a9aedf7a..cf5eb6bdc 100644 --- a/definitions/grib2/tables/14/4.203.table +++ b/definitions/grib2/tables/14/4.203.table @@ -1,26 +1,26 @@ # Code table 4.203 - Cloud type -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.204.table b/definitions/grib2/tables/14/4.204.table index 91bcf1814..ffbd89502 100644 --- a/definitions/grib2/tables/14/4.204.table +++ b/definitions/grib2/tables/14/4.204.table @@ -1,9 +1,9 @@ # Code table 4.204 - Thunderstorm coverage -0 0 None -1 1 Isolated (1-2%) -2 2 Few (3-5%) -3 3 Scattered (16-45%) -4 4 Numerous (> 45%) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (16-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.205.table b/definitions/grib2/tables/14/4.205.table index 5b4484dfd..c40c7f47b 100644 --- a/definitions/grib2/tables/14/4.205.table +++ b/definitions/grib2/tables/14/4.205.table @@ -1,6 +1,6 @@ # Code table 4.205 - Presence of aerosol -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.206.table b/definitions/grib2/tables/14/4.206.table index 02c3dfdf9..76472c261 100644 --- a/definitions/grib2/tables/14/4.206.table +++ b/definitions/grib2/tables/14/4.206.table @@ -1,6 +1,6 @@ # Code table 4.206 - Volcanic ash -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.207.table b/definitions/grib2/tables/14/4.207.table index 8ddb2e048..b6392fca0 100644 --- a/definitions/grib2/tables/14/4.207.table +++ b/definitions/grib2/tables/14/4.207.table @@ -1,10 +1,10 @@ # Code table 4.207 - Icing -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.208.table b/definitions/grib2/tables/14/4.208.table index b83685a1a..4361d38c0 100644 --- a/definitions/grib2/tables/14/4.208.table +++ b/definitions/grib2/tables/14/4.208.table @@ -1,9 +1,9 @@ # Code table 4.208 - Turbulence -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.209.table b/definitions/grib2/tables/14/4.209.table index cb7617071..39ea549ac 100644 --- a/definitions/grib2/tables/14/4.209.table +++ b/definitions/grib2/tables/14/4.209.table @@ -1,9 +1,9 @@ # Code table 4.209 - Planetary boundary-layer regime -0 0 Reserved -1 1 Stable -2 2 Mechanically driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.210.table b/definitions/grib2/tables/14/4.210.table index 524a6ca73..791878469 100644 --- a/definitions/grib2/tables/14/4.210.table +++ b/definitions/grib2/tables/14/4.210.table @@ -1,6 +1,6 @@ # Code table 4.210 - Contrail intensity -0 0 Contrail not present -1 1 Contrail present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Contrail not present +1 1 Contrail present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.211.table b/definitions/grib2/tables/14/4.211.table index 098eb2d43..2a28a84d9 100644 --- a/definitions/grib2/tables/14/4.211.table +++ b/definitions/grib2/tables/14/4.211.table @@ -1,7 +1,7 @@ # Code table 4.211 - Contrail engine type -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.212.table b/definitions/grib2/tables/14/4.212.table index 1a085b88d..6a3dcf88c 100644 --- a/definitions/grib2/tables/14/4.212.table +++ b/definitions/grib2/tables/14/4.212.table @@ -1,18 +1,18 @@ # Code table 4.212 - Land use -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.213.table b/definitions/grib2/tables/14/4.213.table index c65784a00..68d627af6 100644 --- a/definitions/grib2/tables/14/4.213.table +++ b/definitions/grib2/tables/14/4.213.table @@ -1,16 +1,16 @@ # Code table 4.213 - Soil type -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.215.table b/definitions/grib2/tables/14/4.215.table index 88fda8b8c..c264c6722 100644 --- a/definitions/grib2/tables/14/4.215.table +++ b/definitions/grib2/tables/14/4.215.table @@ -1,9 +1,9 @@ # Code table 4.215 - Remotely-sensed snow coverage -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.216.table b/definitions/grib2/tables/14/4.216.table index 5d1460cef..b51b358f4 100644 --- a/definitions/grib2/tables/14/4.216.table +++ b/definitions/grib2/tables/14/4.216.table @@ -1,5 +1,5 @@ # Code table 4.216 - Elevation of snow-covered terrain -# 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 0-90 Elevation in increments of 100 m +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/14/4.217.table b/definitions/grib2/tables/14/4.217.table index a4452182c..a700410d5 100644 --- a/definitions/grib2/tables/14/4.217.table +++ b/definitions/grib2/tables/14/4.217.table @@ -1,8 +1,8 @@ # Code table 4.217 - Cloud mask type -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.218.table b/definitions/grib2/tables/14/4.218.table index 6940a0e41..acf069c32 100644 --- a/definitions/grib2/tables/14/4.218.table +++ b/definitions/grib2/tables/14/4.218.table @@ -1,38 +1,38 @@ # Code table 4.218 - Pixel scene type -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation / crops -15 15 Permanent snow / ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -# 19-96 Reserved -97 97 Snow / ice on land -98 98 Snow / ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud / fog / Stratus -102 102 Low cloud / Stratocumulus -103 103 Low cloud / unknown type -104 104 Medium cloud / Nimbostratus -105 105 Medium cloud / Altostratus -106 106 Medium cloud / unknown type -107 107 High cloud / Cumulus -108 108 High cloud / Cirrus -109 109 High cloud / unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation / crops +15 15 Permanent snow / ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +# 19-96 Reserved +97 97 Snow / ice on land +98 98 Snow / ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud / fog / Stratus +102 102 Low cloud / Stratocumulus +103 103 Low cloud / unknown type +104 104 Medium cloud / Nimbostratus +105 105 Medium cloud / Altostratus +106 106 Medium cloud / unknown type +107 107 High cloud / Cumulus +108 108 High cloud / Cirrus +109 109 High cloud / unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.219.table b/definitions/grib2/tables/14/4.219.table index 86df0522e..9979f50ad 100644 --- a/definitions/grib2/tables/14/4.219.table +++ b/definitions/grib2/tables/14/4.219.table @@ -1,8 +1,8 @@ # Code table 4.219 - Cloud top height quality indicator -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.220.table b/definitions/grib2/tables/14/4.220.table index 93e841f8b..88e869e42 100644 --- a/definitions/grib2/tables/14/4.220.table +++ b/definitions/grib2/tables/14/4.220.table @@ -1,6 +1,6 @@ # Code table 4.220 - Horizontal dimension processed -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.221.table b/definitions/grib2/tables/14/4.221.table index 8448533d7..011cc3518 100644 --- a/definitions/grib2/tables/14/4.221.table +++ b/definitions/grib2/tables/14/4.221.table @@ -1,6 +1,6 @@ # Code table 4.221 - Treatment of missing data -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.222.table b/definitions/grib2/tables/14/4.222.table index 57f113014..558d947ac 100644 --- a/definitions/grib2/tables/14/4.222.table +++ b/definitions/grib2/tables/14/4.222.table @@ -1,6 +1,6 @@ # Code table 4.222 - Categorical result -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.223.table b/definitions/grib2/tables/14/4.223.table index f0deb076a..572c4e7a8 100644 --- a/definitions/grib2/tables/14/4.223.table +++ b/definitions/grib2/tables/14/4.223.table @@ -1,5 +1,5 @@ # Code table 4.223 - Fire detection indicator -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing diff --git a/definitions/grib2/tables/14/4.224.table b/definitions/grib2/tables/14/4.224.table index e87cde4bb..014f56e23 100644 --- a/definitions/grib2/tables/14/4.224.table +++ b/definitions/grib2/tables/14/4.224.table @@ -1,18 +1,18 @@ # Code table 4.224 - Categorical outlook -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/14/4.227.table b/definitions/grib2/tables/14/4.227.table index 27c76553d..48c3b7633 100644 --- a/definitions/grib2/tables/14/4.227.table +++ b/definitions/grib2/tables/14/4.227.table @@ -1,9 +1,9 @@ # Code table 4.227 - Icing scenario (weather/cloud classification) -0 0 None -1 1 General -2 2 Convective -3 3 Stratiform -4 4 Freezing -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 None +1 1 General +2 2 Convective +3 3 Stratiform +4 4 Freezing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/14/4.234.table b/definitions/grib2/tables/14/4.234.table index 9844a91d2..d8b3715b3 100644 --- a/definitions/grib2/tables/14/4.234.table +++ b/definitions/grib2/tables/14/4.234.table @@ -1,21 +1,21 @@ # Code table 4.234 - Canopy cover fraction (to be used as partitioned parameter in PDT 4.53 or 4.54) -1 1 Crops, mixed farming -2 2 Short grass -3 3 Evergreen needleleaf trees -4 4 Deciduous needleleaf trees -5 5 Deciduous broadleaf trees -6 6 Evergreen broadleaf trees -7 7 Tall grass -8 8 Desert -9 9 Tundra -10 10 Irrigated crops -11 11 Semidesert -12 12 Ice caps and glaciers -13 13 Bogs and marshes -14 14 Inland water -15 15 Ocean -16 16 Evergreen shrubs -17 17 Deciduous shrubs -18 18 Mixed forest -19 19 Interrupted forest -20 20 Water and land mixtures +1 1 Crops, mixed farming +2 2 Short grass +3 3 Evergreen needleleaf trees +4 4 Deciduous needleleaf trees +5 5 Deciduous broadleaf trees +6 6 Evergreen broadleaf trees +7 7 Tall grass +8 8 Desert +9 9 Tundra +10 10 Irrigated crops +11 11 Semidesert +12 12 Ice caps and glaciers +13 13 Bogs and marshes +14 14 Inland water +15 15 Ocean +16 16 Evergreen shrubs +17 17 Deciduous shrubs +18 18 Mixed forest +19 19 Interrupted forest +20 20 Water and land mixtures diff --git a/definitions/grib2/tables/14/4.236.table b/definitions/grib2/tables/14/4.236.table index 08c7f8d56..b667b65fc 100644 --- a/definitions/grib2/tables/14/4.236.table +++ b/definitions/grib2/tables/14/4.236.table @@ -1,8 +1,8 @@ # Code table 4.236 - Soil texture fraction (to be used as partitioned parameter in PDT 4.53 or 4.54) -1 1 Coarse -2 2 Medium -3 3 Medium-fine -4 4 Fine -5 5 Very-fine -6 6 Organic -7 7 Tropical-organic +1 1 Coarse +2 2 Medium +3 3 Medium-fine +4 4 Fine +5 5 Very-fine +6 6 Organic +7 7 Tropical-organic diff --git a/definitions/grib2/tables/14/4.241.table b/definitions/grib2/tables/14/4.241.table index 21b8b207b..ce6a15f3c 100644 --- a/definitions/grib2/tables/14/4.241.table +++ b/definitions/grib2/tables/14/4.241.table @@ -1,9 +1,9 @@ # Code table 4.241 - Coverage attributes -0 0 Undefined -1 1 Unmodified -2 2 Snow-covered -3 3 Flooded -4 4 Ice covered -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Undefined +1 1 Unmodified +2 2 Snow-covered +3 3 Flooded +4 4 Ice covered +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.242.table b/definitions/grib2/tables/14/4.242.table index 012655df6..ca852339d 100644 --- a/definitions/grib2/tables/14/4.242.table +++ b/definitions/grib2/tables/14/4.242.table @@ -1,7 +1,7 @@ # Code table 4.242 - Tile classification -0 0 Reserved -1 1 Land use classes according to ESA-GLOBCOVER GCV2009 -2 2 Land use classes according to European Commission - Global Land Cover Project GLC2000 -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Land use classes according to ESA-GLOBCOVER GCV2009 +2 2 Land use classes according to European Commission - Global Land Cover Project GLC2000 +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.243.table b/definitions/grib2/tables/14/4.243.table index 9f047be33..8677e6819 100644 --- a/definitions/grib2/tables/14/4.243.table +++ b/definitions/grib2/tables/14/4.243.table @@ -1,43 +1,43 @@ # Code table 4.243 - Tile class -0 0 Reserved -1 1 Evergreen broadleaved forest -2 2 Deciduous broadleaved closed forest -3 3 Deciduous broadleaved open forest -4 4 Evergreen needle-leaf forest -5 5 Deciduous needle-leaf forest -6 6 Mixed leaf trees -7 7 Fresh water flooded trees -8 8 Saline water flooded trees -9 9 Mosaic tree/natural vegetation -10 10 Burnt tree cover -11 11 Evergreen shrubs closed-open -12 12 Deciduous shrubs closed-open -13 13 Herbaceous vegetation closed-open -14 14 Sparse herbaceous or grass -15 15 Flooded shrubs or herbaceous -16 16 Cultivated and managed areas -17 17 Mosaic crop/tree/natural vegetation -18 18 Mosaic crop/shrub/grass -19 19 Bare areas -20 20 Water -21 21 Snow and ice -22 22 Artificial surface -23 23 Ocean -24 24 Irrigated croplands -25 25 Rain fed croplands -26 26 Mosaic cropland (50-70%) - vegetation (20-50%) -27 27 Mosaic vegetation (50-70%) - cropland (20-50%) -28 28 Closed broadleaved evergreen forest -29 29 Closed needle-leaved evergreen forest -30 30 Open needle-leaved deciduous forest -31 31 Mixed broadleaved and needle-leaved forest -32 32 Mosaic shrubland (50-70%) - grassland (20-50%) -33 33 Mosaic grassland (50-70%) - shrubland (20-50%) -34 34 Closed to open shrubland -35 35 Sparse vegetation -36 36 Closed to open forest regularly flooded -37 37 Closed forest or shrubland permanently flooded -38 38 Closed to open grassland regularly flooded -39 39 Undefined -# 40-32767 Reserved -# 32768- Reserved for local use +0 0 Reserved +1 1 Evergreen broadleaved forest +2 2 Deciduous broadleaved closed forest +3 3 Deciduous broadleaved open forest +4 4 Evergreen needle-leaf forest +5 5 Deciduous needle-leaf forest +6 6 Mixed leaf trees +7 7 Fresh water flooded trees +8 8 Saline water flooded trees +9 9 Mosaic tree/natural vegetation +10 10 Burnt tree cover +11 11 Evergreen shrubs closed-open +12 12 Deciduous shrubs closed-open +13 13 Herbaceous vegetation closed-open +14 14 Sparse herbaceous or grass +15 15 Flooded shrubs or herbaceous +16 16 Cultivated and managed areas +17 17 Mosaic crop/tree/natural vegetation +18 18 Mosaic crop/shrub/grass +19 19 Bare areas +20 20 Water +21 21 Snow and ice +22 22 Artificial surface +23 23 Ocean +24 24 Irrigated croplands +25 25 Rain fed croplands +26 26 Mosaic cropland (50-70%) - vegetation (20-50%) +27 27 Mosaic vegetation (50-70%) - cropland (20-50%) +28 28 Closed broadleaved evergreen forest +29 29 Closed needle-leaved evergreen forest +30 30 Open needle-leaved deciduous forest +31 31 Mixed broadleaved and needle-leaved forest +32 32 Mosaic shrubland (50-70%) - grassland (20-50%) +33 33 Mosaic grassland (50-70%) - shrubland (20-50%) +34 34 Closed to open shrubland +35 35 Sparse vegetation +36 36 Closed to open forest regularly flooded +37 37 Closed forest or shrubland permanently flooded +38 38 Closed to open grassland regularly flooded +39 39 Undefined +# 40-32767 Reserved +# 32768- Reserved for local use diff --git a/definitions/grib2/tables/14/4.3.table b/definitions/grib2/tables/14/4.3.table index f423af2bf..46e498c5f 100644 --- a/definitions/grib2/tables/14/4.3.table +++ b/definitions/grib2/tables/14/4.3.table @@ -1,20 +1,20 @@ # Code table 4.3 - Type of generating process -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast -12 12 Post-processed analysis -13 13 Post-processed forecast -14 14 Nowcast -15 15 Hindcast -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +12 12 Post-processed analysis +13 13 Post-processed forecast +14 14 Nowcast +15 15 Hindcast +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.4.table b/definitions/grib2/tables/14/4.4.table index 7087ebddb..6e63e069c 100644 --- a/definitions/grib2/tables/14/4.4.table +++ b/definitions/grib2/tables/14/4.4.table @@ -1,17 +1,17 @@ # Code table 4.4 - Indicator of unit of time range -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.5.table b/definitions/grib2/tables/14/4.5.table index e6d6d424c..d61b61c9f 100644 --- a/definitions/grib2/tables/14/4.5.table +++ b/definitions/grib2/tables/14/4.5.table @@ -1,5 +1,5 @@ # Code table 4.5 - Fixed surface types and units -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface 2 2 Cloud base level 3 3 Level of cloud tops @@ -12,11 +12,11 @@ 10 10 Entire atmosphere 11 11 Cumulonimbus (CB) base (m) 12 12 Cumulonimbus (CB) top (m) -# 13-19 Reserved +# 13-19 Reserved 20 20 Isothermal level (K) -# 21-99 Reserved +# 21-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -25,18 +25,18 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level -112 112 Reserved +112 112 Reserved 113 113 Logarithmic hybrid level 114 114 Snow level (Numeric) -# 115-116 Reserved +# 115-116 Reserved 117 117 Mixed layer depth (m) 118 hhl Hybrid height level 119 hpl Hybrid pressure level -# 120-149 Reserved -150 150 Generalized vertical height coordinate -# 151-159 Reserved +# 120-149 Reserved +150 150 Generalized vertical height coordinate +# 151-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 sfc Lake or river bottom @@ -45,6 +45,6 @@ 165 165 Bottom of sediment layer penetrated by thermal wave 166 sfc Mixing layer 167 167 Bottom of root zone -# 168-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 168-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.6.table b/definitions/grib2/tables/14/4.6.table index b2dfeb498..ce799721d 100644 --- a/definitions/grib2/tables/14/4.6.table +++ b/definitions/grib2/tables/14/4.6.table @@ -1,9 +1,9 @@ # Code table 4.6 - Type of ensemble forecast -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.7.table b/definitions/grib2/tables/14/4.7.table index e0de0e1b2..69b2b4d77 100644 --- a/definitions/grib2/tables/14/4.7.table +++ b/definitions/grib2/tables/14/4.7.table @@ -1,14 +1,14 @@ # Code table 4.7 - Derived forecast -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.8.table b/definitions/grib2/tables/14/4.8.table index ad883039c..78467454a 100644 --- a/definitions/grib2/tables/14/4.8.table +++ b/definitions/grib2/tables/14/4.8.table @@ -1,6 +1,6 @@ # Code table 4.8 - Clustering method -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.9.table b/definitions/grib2/tables/14/4.9.table index 5878b5ad3..0ce312dd1 100644 --- a/definitions/grib2/tables/14/4.9.table +++ b/definitions/grib2/tables/14/4.9.table @@ -1,9 +1,9 @@ # Code table 4.9 - Probability type -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/4.91.table b/definitions/grib2/tables/14/4.91.table index 44cf25f44..ae31ed61c 100644 --- a/definitions/grib2/tables/14/4.91.table +++ b/definitions/grib2/tables/14/4.91.table @@ -1,16 +1,16 @@ # Code table 4.91 - Type of Interval -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit -11 11 Equal to first limit -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit +11 11 Equal to first limit +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/14/5.0.table b/definitions/grib2/tables/14/5.0.table index 5ec77ed0f..2795336df 100644 --- a/definitions/grib2/tables/14/5.0.table +++ b/definitions/grib2/tables/14/5.0.table @@ -1,23 +1,23 @@ # Code table 5.0 - Data representation template number -0 0 Grid point data - simple packing -1 1 Matrix value at grid point - simple packing -2 2 Grid point data - complex packing -3 3 Grid point data - complex packing and spatial differencing -4 4 Grid point data - IEEE floating point data -40 40 Grid point data - JPEG 2000 code stream format -41 41 Grid point data - Portable Network Graphics (PNG) -# 42-49 Reserved -50 50 Spectral data - simple packing -51 51 Spherical harmonics data - complex packing -# 52-60 Reserved -61 61 Grid point data - simple packing with logarithm pre-processing -# 62-199 Reserved -200 200 Run length packing with level values -# 201-49151 Reserved -# 49152-65534 Reserved for local use +0 0 Grid point data - simple packing +1 1 Matrix value at grid point - simple packing +2 2 Grid point data - complex packing +3 3 Grid point data - complex packing and spatial differencing +4 4 Grid point data - IEEE floating point data +40 40 Grid point data - JPEG 2000 code stream format +41 41 Grid point data - Portable Network Graphics (PNG) +# 42-49 Reserved +50 50 Spectral data - simple packing +51 51 Spherical harmonics data - complex packing +# 52-60 Reserved +61 61 Grid point data - simple packing with logarithm pre-processing +# 62-199 Reserved +200 200 Run length packing with level values +# 201-49151 Reserved +# 49152-65534 Reserved for local use 40000 40000 JPEG2000 Packing 40010 40010 PNG pacling 50000 50000 Sperical harmonics ieee packing 50001 50001 Second order packing 50002 50002 Second order packing -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/14/5.1.table b/definitions/grib2/tables/14/5.1.table index 854330c74..1189b5e46 100644 --- a/definitions/grib2/tables/14/5.1.table +++ b/definitions/grib2/tables/14/5.1.table @@ -1,6 +1,6 @@ # Code table 5.1 - Type of original field values -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/5.2.table b/definitions/grib2/tables/14/5.2.table index 7a4500ecd..d12b46fbd 100644 --- a/definitions/grib2/tables/14/5.2.table +++ b/definitions/grib2/tables/14/5.2.table @@ -1,8 +1,8 @@ # Code table 5.2 - Matrix coordinate value function definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use +# 12-191 Reserved +# 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/14/5.3.table b/definitions/grib2/tables/14/5.3.table index c3b7b30fe..481331791 100644 --- a/definitions/grib2/tables/14/5.3.table +++ b/definitions/grib2/tables/14/5.3.table @@ -1,7 +1,7 @@ # Code table 5.3 - Matrix coordinate parameter -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/5.4.table b/definitions/grib2/tables/14/5.4.table index 8121c1819..e84ab1901 100644 --- a/definitions/grib2/tables/14/5.4.table +++ b/definitions/grib2/tables/14/5.4.table @@ -1,6 +1,6 @@ # Code table 5.4 - Group splitting method -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/5.40.table b/definitions/grib2/tables/14/5.40.table index b9bad2c39..97e8880ab 100644 --- a/definitions/grib2/tables/14/5.40.table +++ b/definitions/grib2/tables/14/5.40.table @@ -1,5 +1,5 @@ # Code table 5.40 - Type of compression -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/14/5.5.table b/definitions/grib2/tables/14/5.5.table index 3ef3eb070..f2316975a 100644 --- a/definitions/grib2/tables/14/5.5.table +++ b/definitions/grib2/tables/14/5.5.table @@ -1,7 +1,7 @@ # Code table 5.5 - Missing value management for complex packing -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/5.6.table b/definitions/grib2/tables/14/5.6.table index 6d5177877..db68ead9c 100644 --- a/definitions/grib2/tables/14/5.6.table +++ b/definitions/grib2/tables/14/5.6.table @@ -1,7 +1,7 @@ # Code table 5.6 - Order of spatial differencing -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/14/5.7.table b/definitions/grib2/tables/14/5.7.table index 5ab780056..e54862c19 100644 --- a/definitions/grib2/tables/14/5.7.table +++ b/definitions/grib2/tables/14/5.7.table @@ -1,7 +1,7 @@ # Code table 5.7 - Precision of floating-point numbers -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/14/6.0.table b/definitions/grib2/tables/14/6.0.table index f539b26d7..a8f30f5a4 100644 --- a/definitions/grib2/tables/14/6.0.table +++ b/definitions/grib2/tables/14/6.0.table @@ -1,6 +1,6 @@ # Code table 6.0 - Bit map indicator 0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/15/0.0.table b/definitions/grib2/tables/15/0.0.table index b24c50564..2c5afceb4 100644 --- a/definitions/grib2/tables/15/0.0.table +++ b/definitions/grib2/tables/15/0.0.table @@ -1,10 +1,10 @@ # Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/1.0.table b/definitions/grib2/tables/15/1.0.table index 1d1bde1dc..9c3abfc0a 100644 --- a/definitions/grib2/tables/15/1.0.table +++ b/definitions/grib2/tables/15/1.0.table @@ -1,20 +1,20 @@ # Code table 1.0 - GRIB master tables version number -0 0 Experimental -1 1 Version implemented on 7 November 2001 -2 2 Version implemented on 4 November 2003 -3 3 Version implemented on 2 November 2005 -4 4 Version implemented on 7 November 2007 -5 5 Version implemented on 4 November 2009 -6 6 Version implemented on 15 September 2010 -7 7 Version implemented on 4 May 2011 -8 8 Version implemented on 2 November 2011 -9 9 Version implemented on 2 May 2012 -10 10 Version implemented on 7 November 2012 -11 11 Version implemented on 8 May 2013 -12 12 Version implemented on 14 November 2013 -13 13 Version implemented on 7 May 2014 -14 14 Version implemented on 5 November 2014 +0 0 Experimental +1 1 Version implemented on 7 November 2001 +2 2 Version implemented on 4 November 2003 +3 3 Version implemented on 2 November 2005 +4 4 Version implemented on 7 November 2007 +5 5 Version implemented on 4 November 2009 +6 6 Version implemented on 15 September 2010 +7 7 Version implemented on 4 May 2011 +8 8 Version implemented on 2 November 2011 +9 9 Version implemented on 2 May 2012 +10 10 Version implemented on 7 November 2012 +11 11 Version implemented on 8 May 2013 +12 12 Version implemented on 14 November 2013 +13 13 Version implemented on 7 May 2014 +14 14 Version implemented on 5 November 2014 15 15 Version implemented on 6 May 2015 -16 16 Pre-operational to be implemented by next amendment -# 17-254 Future versions -255 255 Missing +16 16 Pre-operational to be implemented by next amendment +# 17-254 Future versions +255 255 Missing diff --git a/definitions/grib2/tables/15/1.1.table b/definitions/grib2/tables/15/1.1.table index d50f8fd72..f6d332005 100644 --- a/definitions/grib2/tables/15/1.1.table +++ b/definitions/grib2/tables/15/1.1.table @@ -1,4 +1,4 @@ # Code table 1.1 - GRIB local tables version number -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/15/1.2.table b/definitions/grib2/tables/15/1.2.table index 934b70455..638f1efbb 100644 --- a/definitions/grib2/tables/15/1.2.table +++ b/definitions/grib2/tables/15/1.2.table @@ -1,8 +1,8 @@ # Code table 1.2 - Significance of reference time -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/1.3.table b/definitions/grib2/tables/15/1.3.table index 6f061bf42..e7197fcb2 100644 --- a/definitions/grib2/tables/15/1.3.table +++ b/definitions/grib2/tables/15/1.3.table @@ -1,14 +1,14 @@ # Code table 1.3 - Production status of data -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products 4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) 5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) 6 6 S2S operational products 7 7 S2S test products 8 8 Uncertainties in ensembles of regional reanalysis project (UERRA) 9 9 Uncertainties in ensembles of regional reanalysis project test (UERRA) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/1.4.table b/definitions/grib2/tables/15/1.4.table index 03203d874..877288c0e 100644 --- a/definitions/grib2/tables/15/1.4.table +++ b/definitions/grib2/tables/15/1.4.table @@ -1,13 +1,13 @@ # Code table 1.4 - Type of data -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/15/1.5.table b/definitions/grib2/tables/15/1.5.table index b2cf9f087..533111959 100644 --- a/definitions/grib2/tables/15/1.5.table +++ b/definitions/grib2/tables/15/1.5.table @@ -1,7 +1,7 @@ # Code table 1.5 - Identification template number -0 0 Calendar definition -1 1 Paleontological offset -2 2 Calendar definition and paleontological offset -# 3-32767 Reserved -# 32768-65534 Reserved for local use -65535 65535 Missing +0 0 Calendar definition +1 1 Paleontological offset +2 2 Calendar definition and paleontological offset +# 3-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/15/1.6.table b/definitions/grib2/tables/15/1.6.table index 5db921990..bd46899a7 100644 --- a/definitions/grib2/tables/15/1.6.table +++ b/definitions/grib2/tables/15/1.6.table @@ -1,8 +1,8 @@ # Code table 1.6 - Type of calendar -0 0 Gregorian -1 1 360-day -2 2 365-day -3 3 Proleptic Gregorian -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Gregorian +1 1 360-day +2 2 365-day +3 3 Proleptic Gregorian +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/3.0.table b/definitions/grib2/tables/15/3.0.table index 45187b80d..a442a06a0 100644 --- a/definitions/grib2/tables/15/3.0.table +++ b/definitions/grib2/tables/15/3.0.table @@ -1,6 +1,6 @@ # Code table 3.0 - Source of grid definition -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/15/3.10.table b/definitions/grib2/tables/15/3.10.table index afa8843a7..1612d05e3 100644 --- a/definitions/grib2/tables/15/3.10.table +++ b/definitions/grib2/tables/15/3.10.table @@ -1,8 +1,8 @@ # Flag table 3.10 - Scanning mode for one diamond -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/15/3.11.table b/definitions/grib2/tables/15/3.11.table index e516a2ab9..06ae10810 100644 --- a/definitions/grib2/tables/15/3.11.table +++ b/definitions/grib2/tables/15/3.11.table @@ -1,7 +1,7 @@ # Code table 3.11 - Interpretation of list of numbers at end of section 3 -0 0 There is no appended list -1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows -2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row -3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) -# 4-254 Reserved -255 255 Missing +0 0 There is no appended list +1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows +2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row +3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/15/3.15.table b/definitions/grib2/tables/15/3.15.table index 331217ebe..6087902a3 100644 --- a/definitions/grib2/tables/15/3.15.table +++ b/definitions/grib2/tables/15/3.15.table @@ -1,23 +1,23 @@ # Code table 3.15 - Physical meaning of vertical coordinate -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) -113 113 Logarithmic hybrid coordinate -# 114-159 Reserved +113 113 Logarithmic hybrid coordinate +# 114-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/3.2.table b/definitions/grib2/tables/15/3.2.table index 9238dc2a7..b9574a424 100644 --- a/definitions/grib2/tables/15/3.2.table +++ b/definitions/grib2/tables/15/3.2.table @@ -1,14 +1,14 @@ # Code table 3.2 - Shape of the Earth -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame -9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame +9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/3.20.table b/definitions/grib2/tables/15/3.20.table index efbf08d19..e2bb156ee 100644 --- a/definitions/grib2/tables/15/3.20.table +++ b/definitions/grib2/tables/15/3.20.table @@ -1,6 +1,6 @@ # Code table 3.20 - Type of horizontal line -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/3.21.table b/definitions/grib2/tables/15/3.21.table index 88dbb9019..e001e1c8f 100644 --- a/definitions/grib2/tables/15/3.21.table +++ b/definitions/grib2/tables/15/3.21.table @@ -1,8 +1,8 @@ # Code table 3.21 - Vertical dimension coordinate values definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/3.3.table b/definitions/grib2/tables/15/3.3.table index 5dd7c7001..25cb46a1d 100644 --- a/definitions/grib2/tables/15/3.3.table +++ b/definitions/grib2/tables/15/3.3.table @@ -1,9 +1,9 @@ # Flag table 3.3 - Resolution and component flags -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/15/3.4.table b/definitions/grib2/tables/15/3.4.table index 897b813d7..43835c014 100644 --- a/definitions/grib2/tables/15/3.4.table +++ b/definitions/grib2/tables/15/3.4.table @@ -1,17 +1,17 @@ # Flag table 3.4 - Scanning mode -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -5 0 Points within odd rows are not offset in i (x) direction -5 1 Points within odd rows are offset by Di/2 in i (x) direction -6 0 Points within even rows are not offset in i (x) direction -6 1 Points within even rows are offset by Di/2 in i (x) direction -7 0 Points are not offset in j (y) direction -7 1 Points are offset by Dj/2 in j (y) direction -8 0 Rows have Ni grid points and columns have Nj grid points -8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +5 0 Points within odd rows are not offset in i (x) direction +5 1 Points within odd rows are offset by Di/2 in i (x) direction +6 0 Points within even rows are not offset in i (x) direction +6 1 Points within even rows are offset by Di/2 in i (x) direction +7 0 Points are not offset in j (y) direction +7 1 Points are offset by Dj/2 in j (y) direction +8 0 Rows have Ni grid points and columns have Nj grid points +8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction diff --git a/definitions/grib2/tables/15/3.5.table b/definitions/grib2/tables/15/3.5.table index eabdde896..2f8ec82e3 100644 --- a/definitions/grib2/tables/15/3.5.table +++ b/definitions/grib2/tables/15/3.5.table @@ -1,5 +1,5 @@ # Flag table 3.5 - Projection centre -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/15/3.7.table b/definitions/grib2/tables/15/3.7.table index 0a7d6efde..34c0de085 100644 --- a/definitions/grib2/tables/15/3.7.table +++ b/definitions/grib2/tables/15/3.7.table @@ -1,5 +1,5 @@ # Code table 3.7 - Spectral data representation mode -0 0 Reserved +0 0 Reserved 1 1 see separate doc or pdf file -# 2-254 Reserved -255 255 Missing +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/15/3.8.table b/definitions/grib2/tables/15/3.8.table index 844e74235..578fab37f 100644 --- a/definitions/grib2/tables/15/3.8.table +++ b/definitions/grib2/tables/15/3.8.table @@ -1,7 +1,7 @@ # Code table 3.8 - Grid point position -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/3.9.table b/definitions/grib2/tables/15/3.9.table index fd730bc64..ecd65514a 100644 --- a/definitions/grib2/tables/15/3.9.table +++ b/definitions/grib2/tables/15/3.9.table @@ -1,4 +1,4 @@ # Flag table 3.9 - Numbering order of diamonds as seen from the corresponding pole -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/15/4.0.table b/definitions/grib2/tables/15/4.0.table index b4eff0769..b05d7ef13 100644 --- a/definitions/grib2/tables/15/4.0.table +++ b/definitions/grib2/tables/15/4.0.table @@ -1,64 +1,64 @@ # Code table 4.0 - Product definition template number -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time -8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -# 35-39 Reserved +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 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 +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +# 35-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -42 42 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 atmospheric chemical constituents -43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol -46 46 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 aerosol -47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol -48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -# 49-50 Reserved -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time -52 52 Reserved -53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time -54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters -# 55-56 Reserved -57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function -# 58-59 Reserved -60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 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 atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 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 aerosol +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +# 49-50 Reserved +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +52 52 Reserved +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +# 55-56 Reserved +57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +# 58-59 Reserved +60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time 61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 62-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +# 62-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved -# 32768-65534 Reserved for local use +# 1102-32767 Reserved +# 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/15/4.1.0.table b/definitions/grib2/tables/15/4.1.0.table index 04cfd7802..df58636d6 100644 --- a/definitions/grib2/tables/15/4.1.0.table +++ b/definitions/grib2/tables/15/4.1.0.table @@ -1,27 +1,27 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.1.1.table b/definitions/grib2/tables/15/4.1.1.table index 7b22b6fed..05a854da0 100644 --- a/definitions/grib2/tables/15/4.1.1.table +++ b/definitions/grib2/tables/15/4.1.1.table @@ -1,7 +1,7 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.1.10.table b/definitions/grib2/tables/15/4.1.10.table index a9b20eb9c..88d3c8743 100644 --- a/definitions/grib2/tables/15/4.1.10.table +++ b/definitions/grib2/tables/15/4.1.10.table @@ -1,10 +1,10 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Subsurface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Subsurface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.1.2.table b/definitions/grib2/tables/15/4.1.2.table index 5b488fe9e..e74126645 100644 --- a/definitions/grib2/tables/15/4.1.2.table +++ b/definitions/grib2/tables/15/4.1.2.table @@ -1,9 +1,9 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.1.3.table b/definitions/grib2/tables/15/4.1.3.table index 5096a166e..c1a1e267a 100644 --- a/definitions/grib2/tables/15/4.1.3.table +++ b/definitions/grib2/tables/15/4.1.3.table @@ -1,6 +1,6 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Image format products -1 1 Quantitative products -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.10.table b/definitions/grib2/tables/15/4.10.table index 1a92baaf6..8a390e4be 100644 --- a/definitions/grib2/tables/15/4.10.table +++ b/definitions/grib2/tables/15/4.10.table @@ -1,16 +1,16 @@ # Code table 4.10 - Type of statistical processing -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -11 11 Summation -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/15/4.11.table b/definitions/grib2/tables/15/4.11.table index 7f404c849..01cc81303 100644 --- a/definitions/grib2/tables/15/4.11.table +++ b/definitions/grib2/tables/15/4.11.table @@ -1,10 +1,10 @@ # Code table 4.11 - Type of time intervals -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.12.table b/definitions/grib2/tables/15/4.12.table index 03fd89b36..d42b47e96 100644 --- a/definitions/grib2/tables/15/4.12.table +++ b/definitions/grib2/tables/15/4.12.table @@ -1,7 +1,7 @@ # Code table 4.12 - Operating mode -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.13.table b/definitions/grib2/tables/15/4.13.table index c92854eec..a0e28eac8 100644 --- a/definitions/grib2/tables/15/4.13.table +++ b/definitions/grib2/tables/15/4.13.table @@ -1,6 +1,6 @@ # Code table 4.13 - Quality control indicator -0 0 No quality control applied -1 1 Quality control applied -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.14.table b/definitions/grib2/tables/15/4.14.table index a88cb93fa..d525b23b3 100644 --- a/definitions/grib2/tables/15/4.14.table +++ b/definitions/grib2/tables/15/4.14.table @@ -1,6 +1,6 @@ # Code table 4.14 - Clutter filter indicator -0 0 No clutter filter used -1 1 Clutter filter used -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.15.table b/definitions/grib2/tables/15/4.15.table index 2e5f3dea3..7adddedb6 100644 --- a/definitions/grib2/tables/15/4.15.table +++ b/definitions/grib2/tables/15/4.15.table @@ -1,11 +1,11 @@ # Code table 4.15 - Type of spatial processing used to arrive at given data value from the source data -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.0.table b/definitions/grib2/tables/15/4.2.0.0.table index 41e5291a9..24d21959d 100644 --- a/definitions/grib2/tables/15/4.2.0.0.table +++ b/definitions/grib2/tables/15/4.2.0.0.table @@ -21,6 +21,6 @@ 19 19 Turbulent transfer coefficient for heat (Numeric) 20 20 Turbulent diffusion coefficient for heat (m2/s) 21 21 Apparent temperature (K) -# 22-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 22-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.1.table b/definitions/grib2/tables/15/4.2.0.1.table index f2fdd3026..69386bbe2 100644 --- a/definitions/grib2/tables/15/4.2.0.1.table +++ b/definitions/grib2/tables/15/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,7 +86,7 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rainwater content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) @@ -105,6 +105,6 @@ 105 105 Number density of snow (m-3) 106 106 Number density of graupel (m-3) 107 107 Number density of hail (m-3) -# 108-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 108-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.13.table b/definitions/grib2/tables/15/4.2.0.13.table index 5086101ad..3f5c30675 100644 --- a/definitions/grib2/tables/15/4.2.0.13.table +++ b/definitions/grib2/tables/15/4.2.0.13.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.14.table b/definitions/grib2/tables/15/4.2.0.14.table index 215884737..97fb38c8b 100644 --- a/definitions/grib2/tables/15/4.2.0.14.table +++ b/definitions/grib2/tables/15/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.15.table b/definitions/grib2/tables/15/4.2.0.15.table index dfbc4d12f..8df082466 100644 --- a/definitions/grib2/tables/15/4.2.0.15.table +++ b/definitions/grib2/tables/15/4.2.0.15.table @@ -16,6 +16,6 @@ 14 14 Reflectivity of hail (dB) 15 15 Hybrid scan reflectivity (dB) 16 16 Hybrid scan reflectivity height (m) -# 17-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.16.table b/definitions/grib2/tables/15/4.2.0.16.table index 0c240a853..9499d9333 100644 --- a/definitions/grib2/tables/15/4.2.0.16.table +++ b/definitions/grib2/tables/15/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.18.table b/definitions/grib2/tables/15/4.2.0.18.table index 18c41aa48..7e0a736eb 100644 --- a/definitions/grib2/tables/15/4.2.0.18.table +++ b/definitions/grib2/tables/15/4.2.0.18.table @@ -8,11 +8,11 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) 13 13 Total deposition (wet + dry) (Bq m-2) -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.19.table b/definitions/grib2/tables/15/4.2.0.19.table index 75101bd37..d2beef083 100644 --- a/definitions/grib2/tables/15/4.2.0.19.table +++ b/definitions/grib2/tables/15/4.2.0.19.table @@ -27,6 +27,6 @@ 25 25 Weather (Code table 4.225) 26 26 Convective outlook (Code table 4.224) 27 27 Icing scenario (Code table 4.227) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.190.table b/definitions/grib2/tables/15/4.2.0.190.table index de621a924..a0d6ba0ac 100644 --- a/definitions/grib2/tables/15/4.2.0.190.table +++ b/definitions/grib2/tables/15/4.2.0.190.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.191.table b/definitions/grib2/tables/15/4.2.0.191.table index e3bba0ebe..b3a7092ea 100644 --- a/definitions/grib2/tables/15/4.2.0.191.table +++ b/definitions/grib2/tables/15/4.2.0.191.table @@ -3,6 +3,6 @@ 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.2.table b/definitions/grib2/tables/15/4.2.0.2.table index c83b07300..7bd1509f5 100644 --- a/definitions/grib2/tables/15/4.2.0.2.table +++ b/definitions/grib2/tables/15/4.2.0.2.table @@ -38,6 +38,6 @@ 36 36 Amplitude function for Rossby wave envelope for meridional wind (m/s) 37 37 Northward turbulent surface stress (N m-2 s) 38 38 Eastward turbulent surface stress (N m-2 s) -# 39-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 39-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.20.table b/definitions/grib2/tables/15/4.2.0.20.table index 9584f7c7f..df9ccc184 100644 --- a/definitions/grib2/tables/15/4.2.0.20.table +++ b/definitions/grib2/tables/15/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -25,7 +25,7 @@ 57 57 Total yearly average burden of the atmosphere (mol) 58 58 Total yearly averaged atmospheric loss (mol/s) 59 59 Aerosol number concentration (m-3) -# 60-99 Reserved +# 60-99 Reserved 100 100 Surface area density (aerosol) (/m) 101 101 Vertical visual range (m) 102 102 Aerosol optical thickness (Numeric) @@ -37,6 +37,6 @@ 108 108 Aerosol lidar backscatter from the ground (m-1 sr-1) 109 109 Aerosol lidar extinction from satellite (/m) 110 110 Aerosol lidar extinction from the ground (/m) -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.3.table b/definitions/grib2/tables/15/4.2.0.3.table index 9a88e0027..e1a68bfc5 100644 --- a/definitions/grib2/tables/15/4.2.0.3.table +++ b/definitions/grib2/tables/15/4.2.0.3.table @@ -26,6 +26,6 @@ 24 24 Anisotropy of sub-gridscale orography (Numeric) 25 25 Natural logarithm of pressure in Pa (Numeric) 26 26 Exner pressure (Numeric) -# 27-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 27-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.4.table b/definitions/grib2/tables/15/4.2.0.4.table index dbfcbddb7..03b5cea38 100644 --- a/definitions/grib2/tables/15/4.2.0.4.table +++ b/definitions/grib2/tables/15/4.2.0.4.table @@ -12,9 +12,9 @@ 10 10 Photosynthetically active radiation (W m-2) 11 11 Net short-wave radiation flux, clear sky (W m-2) 12 12 Downward UV radiation (W m-2) -# 13-49 Reserved +# 13-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) -# 52-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 52-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.5.table b/definitions/grib2/tables/15/4.2.0.5.table index 932a12fbd..b9084509a 100644 --- a/definitions/grib2/tables/15/4.2.0.5.table +++ b/definitions/grib2/tables/15/4.2.0.5.table @@ -7,6 +7,6 @@ 5 5 Net long-wave radiation flux (W m-2) 6 6 Net long-wave radiation flux, clear sky (W m-2) 7 7 Brightness temperature (K) -# 8-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.6.table b/definitions/grib2/tables/15/4.2.0.6.table index e28d8e4db..8f1574d46 100644 --- a/definitions/grib2/tables/15/4.2.0.6.table +++ b/definitions/grib2/tables/15/4.2.0.6.table @@ -39,6 +39,6 @@ 37 37 Fraction of convective precipitation cover (Proportion) 38 38 Mass density of cloud droplets (kg m-3) 39 39 Mass density of cloud ice (kg m-3) -# 40-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 40-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.0.7.table b/definitions/grib2/tables/15/4.2.0.7.table index db47d0113..8a2b85fb9 100644 --- a/definitions/grib2/tables/15/4.2.0.7.table +++ b/definitions/grib2/tables/15/4.2.0.7.table @@ -13,8 +13,8 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraft helicity (m2 s-2) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.1.0.table b/definitions/grib2/tables/15/4.2.1.0.table index cf56b08ee..f455c3365 100644 --- a/definitions/grib2/tables/15/4.2.1.0.table +++ b/definitions/grib2/tables/15/4.2.1.0.table @@ -7,6 +7,6 @@ 5 5 Baseflow-groundwater runoff (kg m-2) 6 6 Storm surface runoff (kg m-2) 7 7 Discharge from rivers or streams (m3/s) -# 8-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.1.1.table b/definitions/grib2/tables/15/4.2.1.1.table index b488eb0bd..171da3958 100644 --- a/definitions/grib2/tables/15/4.2.1.1.table +++ b/definitions/grib2/tables/15/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.10.0.table b/definitions/grib2/tables/15/4.2.10.0.table index 095f51bdf..3611abd9a 100644 --- a/definitions/grib2/tables/15/4.2.10.0.table +++ b/definitions/grib2/tables/15/4.2.10.0.table @@ -45,6 +45,6 @@ 43 43 Kurtosis of the sea-surface elevation due to waves (-) 44 44 Benjamin-Feir index (-) 45 45 Spectral peakedness factor (/s) -# 46-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 46-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.10.1.table b/definitions/grib2/tables/15/4.2.10.1.table index 5959bfa28..f0a073c00 100644 --- a/definitions/grib2/tables/15/4.2.10.1.table +++ b/definitions/grib2/tables/15/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.10.191.table b/definitions/grib2/tables/15/4.2.10.191.table index 524929e78..1ebf85006 100644 --- a/definitions/grib2/tables/15/4.2.10.191.table +++ b/definitions/grib2/tables/15/4.2.10.191.table @@ -1,8 +1,8 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Meridional overturning stream function (m3/s) -2 2 Reserved +2 2 Reserved 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.10.2.table b/definitions/grib2/tables/15/4.2.10.2.table index 6797062ac..4633bad4f 100644 --- a/definitions/grib2/tables/15/4.2.10.2.table +++ b/definitions/grib2/tables/15/4.2.10.2.table @@ -12,6 +12,6 @@ 10 10 Zonal vector component of vertically integrated ice internal pressure (Pa m) 11 11 Meridional vector component of vertically integrated ice internal pressure (Pa m) 12 12 Compressive ice strength (N/m) -# 13-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 13-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.10.3.table b/definitions/grib2/tables/15/4.2.10.3.table index f951bbe78..937720c93 100644 --- a/definitions/grib2/tables/15/4.2.10.3.table +++ b/definitions/grib2/tables/15/4.2.10.3.table @@ -1,6 +1,6 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.10.4.table b/definitions/grib2/tables/15/4.2.10.4.table index 54774f1b7..d5615ae26 100644 --- a/definitions/grib2/tables/15/4.2.10.4.table +++ b/definitions/grib2/tables/15/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2/s) 6 6 Ocean vertical momentum diffusivity (m2/s) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (/m) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.2.0.table b/definitions/grib2/tables/15/4.2.2.0.table index 81548840c..b253cac22 100644 --- a/definitions/grib2/tables/15/4.2.2.0.table +++ b/definitions/grib2/tables/15/4.2.2.0.table @@ -38,6 +38,6 @@ 36 36 Tile fraction (Proportion) 37 37 Tile percentage (%) 38 38 Soil volumetric ice content (water equivalent) (m3 m-3) -# 39-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 39-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.2.3.table b/definitions/grib2/tables/15/4.2.2.3.table index 08ac880fe..2b1d0ac38 100644 --- a/definitions/grib2/tables/15/4.2.2.3.table +++ b/definitions/grib2/tables/15/4.2.2.3.table @@ -23,6 +23,6 @@ 21 21 Soil ice (kg m-3) 22 22 Column-integrated soil ice (kg m-2) 23 23 Liquid water in snow pack (kg m-2) -# 24-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 24-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.2.4.table b/definitions/grib2/tables/15/4.2.2.4.table index d4ede2f70..c8b877df6 100644 --- a/definitions/grib2/tables/15/4.2.2.4.table +++ b/definitions/grib2/tables/15/4.2.2.4.table @@ -4,6 +4,6 @@ 2 2 Haines Index (Numeric) 3 3 Fire burned area (%) 4 4 Fosberg index (Numeric) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.3.0.table b/definitions/grib2/tables/15/4.2.3.0.table index c0ffa29f5..80a829673 100644 --- a/definitions/grib2/tables/15/4.2.3.0.table +++ b/definitions/grib2/tables/15/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.2.3.1.table b/definitions/grib2/tables/15/4.2.3.1.table index 0bda53063..bc9eaab0d 100644 --- a/definitions/grib2/tables/15/4.2.3.1.table +++ b/definitions/grib2/tables/15/4.2.3.1.table @@ -17,12 +17,12 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) 20 20 Aerosol optical thickness at 0.635 um 21 21 Aerosol optical thickness at 0.810 um 22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +23 23 Angstrom coefficient +# 24-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.201.table b/definitions/grib2/tables/15/4.201.table index 47f1b486f..fa173c4e0 100644 --- a/definitions/grib2/tables/15/4.201.table +++ b/definitions/grib2/tables/15/4.201.table @@ -1,15 +1,15 @@ # Code table 4.201 - Precipitation type -0 0 Reserved -1 1 Rain -2 2 Thunderstorm -3 3 Freezing rain -4 4 Mixed/ice -5 5 Snow -6 6 Wet snow -7 7 Mixture of rain and snow -8 8 Ice pellets -9 9 Graupel -10 10 Hail -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow +6 6 Wet snow +7 7 Mixture of rain and snow +8 8 Ice pellets +9 9 Graupel +10 10 Hail +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.202.table b/definitions/grib2/tables/15/4.202.table index 438502ff9..7f3c8f6cf 100644 --- a/definitions/grib2/tables/15/4.202.table +++ b/definitions/grib2/tables/15/4.202.table @@ -1,4 +1,4 @@ # Code table 4.202 - Precipitable water category -# 0-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.203.table b/definitions/grib2/tables/15/4.203.table index 8a9aedf7a..cf5eb6bdc 100644 --- a/definitions/grib2/tables/15/4.203.table +++ b/definitions/grib2/tables/15/4.203.table @@ -1,26 +1,26 @@ # Code table 4.203 - Cloud type -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.204.table b/definitions/grib2/tables/15/4.204.table index 91bcf1814..ffbd89502 100644 --- a/definitions/grib2/tables/15/4.204.table +++ b/definitions/grib2/tables/15/4.204.table @@ -1,9 +1,9 @@ # Code table 4.204 - Thunderstorm coverage -0 0 None -1 1 Isolated (1-2%) -2 2 Few (3-5%) -3 3 Scattered (16-45%) -4 4 Numerous (> 45%) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (16-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.205.table b/definitions/grib2/tables/15/4.205.table index 5b4484dfd..c40c7f47b 100644 --- a/definitions/grib2/tables/15/4.205.table +++ b/definitions/grib2/tables/15/4.205.table @@ -1,6 +1,6 @@ # Code table 4.205 - Presence of aerosol -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.206.table b/definitions/grib2/tables/15/4.206.table index 02c3dfdf9..76472c261 100644 --- a/definitions/grib2/tables/15/4.206.table +++ b/definitions/grib2/tables/15/4.206.table @@ -1,6 +1,6 @@ # Code table 4.206 - Volcanic ash -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.207.table b/definitions/grib2/tables/15/4.207.table index 8ddb2e048..b6392fca0 100644 --- a/definitions/grib2/tables/15/4.207.table +++ b/definitions/grib2/tables/15/4.207.table @@ -1,10 +1,10 @@ # Code table 4.207 - Icing -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.208.table b/definitions/grib2/tables/15/4.208.table index b83685a1a..4361d38c0 100644 --- a/definitions/grib2/tables/15/4.208.table +++ b/definitions/grib2/tables/15/4.208.table @@ -1,9 +1,9 @@ # Code table 4.208 - Turbulence -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.209.table b/definitions/grib2/tables/15/4.209.table index cb7617071..39ea549ac 100644 --- a/definitions/grib2/tables/15/4.209.table +++ b/definitions/grib2/tables/15/4.209.table @@ -1,9 +1,9 @@ # Code table 4.209 - Planetary boundary-layer regime -0 0 Reserved -1 1 Stable -2 2 Mechanically driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.210.table b/definitions/grib2/tables/15/4.210.table index 524a6ca73..791878469 100644 --- a/definitions/grib2/tables/15/4.210.table +++ b/definitions/grib2/tables/15/4.210.table @@ -1,6 +1,6 @@ # Code table 4.210 - Contrail intensity -0 0 Contrail not present -1 1 Contrail present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Contrail not present +1 1 Contrail present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.211.table b/definitions/grib2/tables/15/4.211.table index 098eb2d43..2a28a84d9 100644 --- a/definitions/grib2/tables/15/4.211.table +++ b/definitions/grib2/tables/15/4.211.table @@ -1,7 +1,7 @@ # Code table 4.211 - Contrail engine type -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.212.table b/definitions/grib2/tables/15/4.212.table index 1a085b88d..6a3dcf88c 100644 --- a/definitions/grib2/tables/15/4.212.table +++ b/definitions/grib2/tables/15/4.212.table @@ -1,18 +1,18 @@ # Code table 4.212 - Land use -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.213.table b/definitions/grib2/tables/15/4.213.table index c65784a00..68d627af6 100644 --- a/definitions/grib2/tables/15/4.213.table +++ b/definitions/grib2/tables/15/4.213.table @@ -1,16 +1,16 @@ # Code table 4.213 - Soil type -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.215.table b/definitions/grib2/tables/15/4.215.table index 034db72be..7888772d5 100644 --- a/definitions/grib2/tables/15/4.215.table +++ b/definitions/grib2/tables/15/4.215.table @@ -1,9 +1,9 @@ # Code table 4.215 - Remotely sensed snow coverage -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.216.table b/definitions/grib2/tables/15/4.216.table index 5d1460cef..b51b358f4 100644 --- a/definitions/grib2/tables/15/4.216.table +++ b/definitions/grib2/tables/15/4.216.table @@ -1,5 +1,5 @@ # Code table 4.216 - Elevation of snow-covered terrain -# 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 0-90 Elevation in increments of 100 m +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/15/4.217.table b/definitions/grib2/tables/15/4.217.table index a4452182c..a700410d5 100644 --- a/definitions/grib2/tables/15/4.217.table +++ b/definitions/grib2/tables/15/4.217.table @@ -1,8 +1,8 @@ # Code table 4.217 - Cloud mask type -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.218.table b/definitions/grib2/tables/15/4.218.table index bfca92f95..fdaa3ea31 100644 --- a/definitions/grib2/tables/15/4.218.table +++ b/definitions/grib2/tables/15/4.218.table @@ -1,38 +1,38 @@ # Code table 4.218 - Pixel scene type -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation/crops -15 15 Permanent snow/ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -# 19-96 Reserved -97 97 Snow/ice on land -98 98 Snow/ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud/fog/Stratus -102 102 Low cloud/Stratocumulus -103 103 Low cloud/unknown type -104 104 Medium cloud/Nimbostratus -105 105 Medium cloud/Altostratus -106 106 Medium cloud/unknown type -107 107 High cloud/Cumulus -108 108 High cloud/Cirrus -109 109 High cloud/unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation/crops +15 15 Permanent snow/ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +# 19-96 Reserved +97 97 Snow/ice on land +98 98 Snow/ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud/fog/Stratus +102 102 Low cloud/Stratocumulus +103 103 Low cloud/unknown type +104 104 Medium cloud/Nimbostratus +105 105 Medium cloud/Altostratus +106 106 Medium cloud/unknown type +107 107 High cloud/Cumulus +108 108 High cloud/Cirrus +109 109 High cloud/unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.219.table b/definitions/grib2/tables/15/4.219.table index 86df0522e..9979f50ad 100644 --- a/definitions/grib2/tables/15/4.219.table +++ b/definitions/grib2/tables/15/4.219.table @@ -1,8 +1,8 @@ # Code table 4.219 - Cloud top height quality indicator -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.220.table b/definitions/grib2/tables/15/4.220.table index 93e841f8b..88e869e42 100644 --- a/definitions/grib2/tables/15/4.220.table +++ b/definitions/grib2/tables/15/4.220.table @@ -1,6 +1,6 @@ # Code table 4.220 - Horizontal dimension processed -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.221.table b/definitions/grib2/tables/15/4.221.table index 8448533d7..011cc3518 100644 --- a/definitions/grib2/tables/15/4.221.table +++ b/definitions/grib2/tables/15/4.221.table @@ -1,6 +1,6 @@ # Code table 4.221 - Treatment of missing data -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.222.table b/definitions/grib2/tables/15/4.222.table index 57f113014..558d947ac 100644 --- a/definitions/grib2/tables/15/4.222.table +++ b/definitions/grib2/tables/15/4.222.table @@ -1,6 +1,6 @@ # Code table 4.222 - Categorical result -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.223.table b/definitions/grib2/tables/15/4.223.table index f0deb076a..572c4e7a8 100644 --- a/definitions/grib2/tables/15/4.223.table +++ b/definitions/grib2/tables/15/4.223.table @@ -1,5 +1,5 @@ # Code table 4.223 - Fire detection indicator -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing diff --git a/definitions/grib2/tables/15/4.224.table b/definitions/grib2/tables/15/4.224.table index e87cde4bb..014f56e23 100644 --- a/definitions/grib2/tables/15/4.224.table +++ b/definitions/grib2/tables/15/4.224.table @@ -1,18 +1,18 @@ # Code table 4.224 - Categorical outlook -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/15/4.227.table b/definitions/grib2/tables/15/4.227.table index 27c76553d..48c3b7633 100644 --- a/definitions/grib2/tables/15/4.227.table +++ b/definitions/grib2/tables/15/4.227.table @@ -1,9 +1,9 @@ # Code table 4.227 - Icing scenario (weather/cloud classification) -0 0 None -1 1 General -2 2 Convective -3 3 Stratiform -4 4 Freezing -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 None +1 1 General +2 2 Convective +3 3 Stratiform +4 4 Freezing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/15/4.234.table b/definitions/grib2/tables/15/4.234.table index 9844a91d2..d8b3715b3 100644 --- a/definitions/grib2/tables/15/4.234.table +++ b/definitions/grib2/tables/15/4.234.table @@ -1,21 +1,21 @@ # Code table 4.234 - Canopy cover fraction (to be used as partitioned parameter in PDT 4.53 or 4.54) -1 1 Crops, mixed farming -2 2 Short grass -3 3 Evergreen needleleaf trees -4 4 Deciduous needleleaf trees -5 5 Deciduous broadleaf trees -6 6 Evergreen broadleaf trees -7 7 Tall grass -8 8 Desert -9 9 Tundra -10 10 Irrigated crops -11 11 Semidesert -12 12 Ice caps and glaciers -13 13 Bogs and marshes -14 14 Inland water -15 15 Ocean -16 16 Evergreen shrubs -17 17 Deciduous shrubs -18 18 Mixed forest -19 19 Interrupted forest -20 20 Water and land mixtures +1 1 Crops, mixed farming +2 2 Short grass +3 3 Evergreen needleleaf trees +4 4 Deciduous needleleaf trees +5 5 Deciduous broadleaf trees +6 6 Evergreen broadleaf trees +7 7 Tall grass +8 8 Desert +9 9 Tundra +10 10 Irrigated crops +11 11 Semidesert +12 12 Ice caps and glaciers +13 13 Bogs and marshes +14 14 Inland water +15 15 Ocean +16 16 Evergreen shrubs +17 17 Deciduous shrubs +18 18 Mixed forest +19 19 Interrupted forest +20 20 Water and land mixtures diff --git a/definitions/grib2/tables/15/4.236.table b/definitions/grib2/tables/15/4.236.table index 08c7f8d56..b667b65fc 100644 --- a/definitions/grib2/tables/15/4.236.table +++ b/definitions/grib2/tables/15/4.236.table @@ -1,8 +1,8 @@ # Code table 4.236 - Soil texture fraction (to be used as partitioned parameter in PDT 4.53 or 4.54) -1 1 Coarse -2 2 Medium -3 3 Medium-fine -4 4 Fine -5 5 Very-fine -6 6 Organic -7 7 Tropical-organic +1 1 Coarse +2 2 Medium +3 3 Medium-fine +4 4 Fine +5 5 Very-fine +6 6 Organic +7 7 Tropical-organic diff --git a/definitions/grib2/tables/15/4.241.table b/definitions/grib2/tables/15/4.241.table index c0bd3e99e..6ce0a5ea7 100644 --- a/definitions/grib2/tables/15/4.241.table +++ b/definitions/grib2/tables/15/4.241.table @@ -1,9 +1,9 @@ # Code table 4.241 - Coverage attributes -0 0 Undefined -1 1 Unmodified -2 2 Snow covered -3 3 Flooded -4 4 Ice covered -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Undefined +1 1 Unmodified +2 2 Snow covered +3 3 Flooded +4 4 Ice covered +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.242.table b/definitions/grib2/tables/15/4.242.table index 083f88c29..f6865957c 100644 --- a/definitions/grib2/tables/15/4.242.table +++ b/definitions/grib2/tables/15/4.242.table @@ -1,7 +1,7 @@ # Code table 4.242 - Tile classification -0 0 Reserved -1 1 Land use classes according to ESA-GlobCover GCV2009 -2 2 Land use classes according to European Commission-Global Land Cover Project GLC2000 -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 Reserved +1 1 Land use classes according to ESA-GlobCover GCV2009 +2 2 Land use classes according to European Commission-Global Land Cover Project GLC2000 +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/15/4.243.table b/definitions/grib2/tables/15/4.243.table index b39053311..24d21b719 100644 --- a/definitions/grib2/tables/15/4.243.table +++ b/definitions/grib2/tables/15/4.243.table @@ -1,43 +1,43 @@ # Code table 4.243 - Tile class -0 0 Reserved -1 1 Evergreen broadleaved forest -2 2 Deciduous broadleaved closed forest -3 3 Deciduous broadleaved open forest -4 4 Evergreen needle-leaf forest -5 5 Deciduous needle-leaf forest -6 6 Mixed leaf trees -7 7 Freshwater flooded trees -8 8 Saline water flooded trees -9 9 Mosaic tree/natural vegetation -10 10 Burnt tree cover -11 11 Evergreen shrubs closed-open -12 12 Deciduous shrubs closed-open -13 13 Herbaceous vegetation closed-open -14 14 Sparse herbaceous or grass -15 15 Flooded shrubs or herbaceous -16 16 Cultivated and managed areas -17 17 Mosaic crop/tree/natural vegetation -18 18 Mosaic crop/shrub/grass -19 19 Bare areas -20 20 Water -21 21 Snow and ice -22 22 Artificial surface -23 23 Ocean -24 24 Irrigated croplands -25 25 Rainfed croplands -26 26 Mosaic cropland (50-70%) - vegetation (20-50%) -27 27 Mosaic vegetation (50-70%) - cropland (20-50%) -28 28 Closed broadleaved evergreen forest -29 29 Closed needle-leaved evergreen forest -30 30 Open needle-leaved deciduous forest -31 31 Mixed broadleaved and needle-leaved forest -32 32 Mosaic shrubland (50-70%) - grassland (20-50%) -33 33 Mosaic grassland (50-70%) - shrubland (20-50%) -34 34 Closed to open shrubland -35 35 Sparse vegetation -36 36 Closed to open forest regularly flooded -37 37 Closed forest or shrubland permanently flooded -38 38 Closed to open grassland regularly flooded -39 39 Undefined -# 40-32767 Reserved -# 32768- Reserved for local use +0 0 Reserved +1 1 Evergreen broadleaved forest +2 2 Deciduous broadleaved closed forest +3 3 Deciduous broadleaved open forest +4 4 Evergreen needle-leaf forest +5 5 Deciduous needle-leaf forest +6 6 Mixed leaf trees +7 7 Freshwater flooded trees +8 8 Saline water flooded trees +9 9 Mosaic tree/natural vegetation +10 10 Burnt tree cover +11 11 Evergreen shrubs closed-open +12 12 Deciduous shrubs closed-open +13 13 Herbaceous vegetation closed-open +14 14 Sparse herbaceous or grass +15 15 Flooded shrubs or herbaceous +16 16 Cultivated and managed areas +17 17 Mosaic crop/tree/natural vegetation +18 18 Mosaic crop/shrub/grass +19 19 Bare areas +20 20 Water +21 21 Snow and ice +22 22 Artificial surface +23 23 Ocean +24 24 Irrigated croplands +25 25 Rainfed croplands +26 26 Mosaic cropland (50-70%) - vegetation (20-50%) +27 27 Mosaic vegetation (50-70%) - cropland (20-50%) +28 28 Closed broadleaved evergreen forest +29 29 Closed needle-leaved evergreen forest +30 30 Open needle-leaved deciduous forest +31 31 Mixed broadleaved and needle-leaved forest +32 32 Mosaic shrubland (50-70%) - grassland (20-50%) +33 33 Mosaic grassland (50-70%) - shrubland (20-50%) +34 34 Closed to open shrubland +35 35 Sparse vegetation +36 36 Closed to open forest regularly flooded +37 37 Closed forest or shrubland permanently flooded +38 38 Closed to open grassland regularly flooded +39 39 Undefined +# 40-32767 Reserved +# 32768- Reserved for local use diff --git a/definitions/grib2/tables/15/4.3.table b/definitions/grib2/tables/15/4.3.table index f423af2bf..46e498c5f 100644 --- a/definitions/grib2/tables/15/4.3.table +++ b/definitions/grib2/tables/15/4.3.table @@ -1,20 +1,20 @@ # Code table 4.3 - Type of generating process -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast -12 12 Post-processed analysis -13 13 Post-processed forecast -14 14 Nowcast -15 15 Hindcast -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +12 12 Post-processed analysis +13 13 Post-processed forecast +14 14 Nowcast +15 15 Hindcast +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.4.table b/definitions/grib2/tables/15/4.4.table index 7087ebddb..6e63e069c 100644 --- a/definitions/grib2/tables/15/4.4.table +++ b/definitions/grib2/tables/15/4.4.table @@ -1,17 +1,17 @@ # Code table 4.4 - Indicator of unit of time range -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.5.table b/definitions/grib2/tables/15/4.5.table index f73733e88..d1a76825a 100644 --- a/definitions/grib2/tables/15/4.5.table +++ b/definitions/grib2/tables/15/4.5.table @@ -1,5 +1,5 @@ # Code table 4.5 - Fixed surface types and units -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface 2 2 Cloud base level 3 3 Level of cloud tops @@ -12,11 +12,11 @@ 10 10 Entire atmosphere 11 11 Cumulonimbus (CB) base (m) 12 12 Cumulonimbus (CB) top (m) -# 13-19 Reserved +# 13-19 Reserved 20 20 Isothermal level (K) -# 21-99 Reserved +# 21-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -25,18 +25,18 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level -112 112 Reserved -113 113 Logarithmic hybrid level +112 112 Reserved +113 113 Logarithmic hybrid level 114 114 Snow level (Numeric) -# 115-116 Reserved +# 115-116 Reserved 117 117 Mixed layer depth (m) 118 hhl Hybrid height level 119 hpl Hybrid pressure level -# 120-149 Reserved -150 150 Generalized vertical height coordinate -# 151-159 Reserved +# 120-149 Reserved +150 150 Generalized vertical height coordinate +# 151-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 sfc Lake or river bottom @@ -47,17 +47,17 @@ 167 167 Bottom of root zone # 168-173 Reserved # 168-169 Reserved -174 sfc Top surface of ice on sea, lake or river -175 175 Top surface of ice, under snow cover, on sea, lake or river -176 176 Bottom surface (underside) ice on sea, lake or river -177 sfc Deep soil (of indefinite depth) -178 178 Reserved -179 179 Top surface of glacier ice and inland ice -180 180 Deep inland or glacier ice (of indefinite depth) -181 181 Grid tile land fraction as a model surface -182 182 Grid tile water fraction as a model surface -183 183 Grid tile ice fraction on sea, lake or river as a model surface -184 184 Grid tile glacier ice and inland ice fraction as a model surface -# 185-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +174 sfc Top surface of ice on sea, lake or river +175 175 Top surface of ice, under snow cover, on sea, lake or river +176 176 Bottom surface (underside) ice on sea, lake or river +177 sfc Deep soil (of indefinite depth) +178 178 Reserved +179 179 Top surface of glacier ice and inland ice +180 180 Deep inland or glacier ice (of indefinite depth) +181 181 Grid tile land fraction as a model surface +182 182 Grid tile water fraction as a model surface +183 183 Grid tile ice fraction on sea, lake or river as a model surface +184 184 Grid tile glacier ice and inland ice fraction as a model surface +# 185-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.6.table b/definitions/grib2/tables/15/4.6.table index b2dfeb498..ce799721d 100644 --- a/definitions/grib2/tables/15/4.6.table +++ b/definitions/grib2/tables/15/4.6.table @@ -1,9 +1,9 @@ # Code table 4.6 - Type of ensemble forecast -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.7.table b/definitions/grib2/tables/15/4.7.table index e0de0e1b2..69b2b4d77 100644 --- a/definitions/grib2/tables/15/4.7.table +++ b/definitions/grib2/tables/15/4.7.table @@ -1,14 +1,14 @@ # Code table 4.7 - Derived forecast -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.8.table b/definitions/grib2/tables/15/4.8.table index ad883039c..78467454a 100644 --- a/definitions/grib2/tables/15/4.8.table +++ b/definitions/grib2/tables/15/4.8.table @@ -1,6 +1,6 @@ # Code table 4.8 - Clustering method -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.9.table b/definitions/grib2/tables/15/4.9.table index 5878b5ad3..0ce312dd1 100644 --- a/definitions/grib2/tables/15/4.9.table +++ b/definitions/grib2/tables/15/4.9.table @@ -1,9 +1,9 @@ # Code table 4.9 - Probability type -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/4.91.table b/definitions/grib2/tables/15/4.91.table index 44cf25f44..ae31ed61c 100644 --- a/definitions/grib2/tables/15/4.91.table +++ b/definitions/grib2/tables/15/4.91.table @@ -1,16 +1,16 @@ # Code table 4.91 - Type of Interval -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit -11 11 Equal to first limit -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit +11 11 Equal to first limit +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/15/5.0.table b/definitions/grib2/tables/15/5.0.table index 5ec77ed0f..2795336df 100644 --- a/definitions/grib2/tables/15/5.0.table +++ b/definitions/grib2/tables/15/5.0.table @@ -1,23 +1,23 @@ # Code table 5.0 - Data representation template number -0 0 Grid point data - simple packing -1 1 Matrix value at grid point - simple packing -2 2 Grid point data - complex packing -3 3 Grid point data - complex packing and spatial differencing -4 4 Grid point data - IEEE floating point data -40 40 Grid point data - JPEG 2000 code stream format -41 41 Grid point data - Portable Network Graphics (PNG) -# 42-49 Reserved -50 50 Spectral data - simple packing -51 51 Spherical harmonics data - complex packing -# 52-60 Reserved -61 61 Grid point data - simple packing with logarithm pre-processing -# 62-199 Reserved -200 200 Run length packing with level values -# 201-49151 Reserved -# 49152-65534 Reserved for local use +0 0 Grid point data - simple packing +1 1 Matrix value at grid point - simple packing +2 2 Grid point data - complex packing +3 3 Grid point data - complex packing and spatial differencing +4 4 Grid point data - IEEE floating point data +40 40 Grid point data - JPEG 2000 code stream format +41 41 Grid point data - Portable Network Graphics (PNG) +# 42-49 Reserved +50 50 Spectral data - simple packing +51 51 Spherical harmonics data - complex packing +# 52-60 Reserved +61 61 Grid point data - simple packing with logarithm pre-processing +# 62-199 Reserved +200 200 Run length packing with level values +# 201-49151 Reserved +# 49152-65534 Reserved for local use 40000 40000 JPEG2000 Packing 40010 40010 PNG pacling 50000 50000 Sperical harmonics ieee packing 50001 50001 Second order packing 50002 50002 Second order packing -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/15/5.1.table b/definitions/grib2/tables/15/5.1.table index 854330c74..1189b5e46 100644 --- a/definitions/grib2/tables/15/5.1.table +++ b/definitions/grib2/tables/15/5.1.table @@ -1,6 +1,6 @@ # Code table 5.1 - Type of original field values -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/5.2.table b/definitions/grib2/tables/15/5.2.table index 7a4500ecd..d12b46fbd 100644 --- a/definitions/grib2/tables/15/5.2.table +++ b/definitions/grib2/tables/15/5.2.table @@ -1,8 +1,8 @@ # Code table 5.2 - Matrix coordinate value function definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use +# 12-191 Reserved +# 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/15/5.3.table b/definitions/grib2/tables/15/5.3.table index c3b7b30fe..481331791 100644 --- a/definitions/grib2/tables/15/5.3.table +++ b/definitions/grib2/tables/15/5.3.table @@ -1,7 +1,7 @@ # Code table 5.3 - Matrix coordinate parameter -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/5.4.table b/definitions/grib2/tables/15/5.4.table index 8121c1819..e84ab1901 100644 --- a/definitions/grib2/tables/15/5.4.table +++ b/definitions/grib2/tables/15/5.4.table @@ -1,6 +1,6 @@ # Code table 5.4 - Group splitting method -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/5.40.table b/definitions/grib2/tables/15/5.40.table index b9bad2c39..97e8880ab 100644 --- a/definitions/grib2/tables/15/5.40.table +++ b/definitions/grib2/tables/15/5.40.table @@ -1,5 +1,5 @@ # Code table 5.40 - Type of compression -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/15/5.5.table b/definitions/grib2/tables/15/5.5.table index 3ef3eb070..f2316975a 100644 --- a/definitions/grib2/tables/15/5.5.table +++ b/definitions/grib2/tables/15/5.5.table @@ -1,7 +1,7 @@ # Code table 5.5 - Missing value management for complex packing -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/5.6.table b/definitions/grib2/tables/15/5.6.table index 6d5177877..db68ead9c 100644 --- a/definitions/grib2/tables/15/5.6.table +++ b/definitions/grib2/tables/15/5.6.table @@ -1,7 +1,7 @@ # Code table 5.6 - Order of spatial differencing -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/15/5.7.table b/definitions/grib2/tables/15/5.7.table index 5ab780056..e54862c19 100644 --- a/definitions/grib2/tables/15/5.7.table +++ b/definitions/grib2/tables/15/5.7.table @@ -1,7 +1,7 @@ # Code table 5.7 - Precision of floating-point numbers -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/15/6.0.table b/definitions/grib2/tables/15/6.0.table index f539b26d7..a8f30f5a4 100644 --- a/definitions/grib2/tables/15/6.0.table +++ b/definitions/grib2/tables/15/6.0.table @@ -1,6 +1,6 @@ # Code table 6.0 - Bit map indicator 0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/16/0.0.table b/definitions/grib2/tables/16/0.0.table index b24c50564..2c5afceb4 100644 --- a/definitions/grib2/tables/16/0.0.table +++ b/definitions/grib2/tables/16/0.0.table @@ -1,10 +1,10 @@ # Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/1.1.table b/definitions/grib2/tables/16/1.1.table index d50f8fd72..f6d332005 100644 --- a/definitions/grib2/tables/16/1.1.table +++ b/definitions/grib2/tables/16/1.1.table @@ -1,4 +1,4 @@ # Code table 1.1 - GRIB local tables version number -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/16/1.2.table b/definitions/grib2/tables/16/1.2.table index 934b70455..638f1efbb 100644 --- a/definitions/grib2/tables/16/1.2.table +++ b/definitions/grib2/tables/16/1.2.table @@ -1,8 +1,8 @@ # Code table 1.2 - Significance of reference time -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/1.3.table b/definitions/grib2/tables/16/1.3.table index 6f061bf42..e7197fcb2 100644 --- a/definitions/grib2/tables/16/1.3.table +++ b/definitions/grib2/tables/16/1.3.table @@ -1,14 +1,14 @@ # Code table 1.3 - Production status of data -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products 4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) 5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) 6 6 S2S operational products 7 7 S2S test products 8 8 Uncertainties in ensembles of regional reanalysis project (UERRA) 9 9 Uncertainties in ensembles of regional reanalysis project test (UERRA) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/1.4.table b/definitions/grib2/tables/16/1.4.table index 03203d874..877288c0e 100644 --- a/definitions/grib2/tables/16/1.4.table +++ b/definitions/grib2/tables/16/1.4.table @@ -1,13 +1,13 @@ # Code table 1.4 - Type of data -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/16/1.5.table b/definitions/grib2/tables/16/1.5.table index b2cf9f087..533111959 100644 --- a/definitions/grib2/tables/16/1.5.table +++ b/definitions/grib2/tables/16/1.5.table @@ -1,7 +1,7 @@ # Code table 1.5 - Identification template number -0 0 Calendar definition -1 1 Paleontological offset -2 2 Calendar definition and paleontological offset -# 3-32767 Reserved -# 32768-65534 Reserved for local use -65535 65535 Missing +0 0 Calendar definition +1 1 Paleontological offset +2 2 Calendar definition and paleontological offset +# 3-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/16/1.6.table b/definitions/grib2/tables/16/1.6.table index 5db921990..bd46899a7 100644 --- a/definitions/grib2/tables/16/1.6.table +++ b/definitions/grib2/tables/16/1.6.table @@ -1,8 +1,8 @@ # Code table 1.6 - Type of calendar -0 0 Gregorian -1 1 360-day -2 2 365-day -3 3 Proleptic Gregorian -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Gregorian +1 1 360-day +2 2 365-day +3 3 Proleptic Gregorian +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/3.0.table b/definitions/grib2/tables/16/3.0.table index 45187b80d..a442a06a0 100644 --- a/definitions/grib2/tables/16/3.0.table +++ b/definitions/grib2/tables/16/3.0.table @@ -1,6 +1,6 @@ # Code table 3.0 - Source of grid definition -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/16/3.10.table b/definitions/grib2/tables/16/3.10.table index afa8843a7..1612d05e3 100644 --- a/definitions/grib2/tables/16/3.10.table +++ b/definitions/grib2/tables/16/3.10.table @@ -1,8 +1,8 @@ # Flag table 3.10 - Scanning mode for one diamond -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/16/3.11.table b/definitions/grib2/tables/16/3.11.table index e516a2ab9..06ae10810 100644 --- a/definitions/grib2/tables/16/3.11.table +++ b/definitions/grib2/tables/16/3.11.table @@ -1,7 +1,7 @@ # Code table 3.11 - Interpretation of list of numbers at end of section 3 -0 0 There is no appended list -1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows -2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row -3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) -# 4-254 Reserved -255 255 Missing +0 0 There is no appended list +1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows +2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row +3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/16/3.15.table b/definitions/grib2/tables/16/3.15.table index 331217ebe..6087902a3 100644 --- a/definitions/grib2/tables/16/3.15.table +++ b/definitions/grib2/tables/16/3.15.table @@ -1,23 +1,23 @@ # Code table 3.15 - Physical meaning of vertical coordinate -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) -113 113 Logarithmic hybrid coordinate -# 114-159 Reserved +113 113 Logarithmic hybrid coordinate +# 114-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/3.2.table b/definitions/grib2/tables/16/3.2.table index 9238dc2a7..b9574a424 100644 --- a/definitions/grib2/tables/16/3.2.table +++ b/definitions/grib2/tables/16/3.2.table @@ -1,14 +1,14 @@ # Code table 3.2 - Shape of the Earth -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame -9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame +9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/3.20.table b/definitions/grib2/tables/16/3.20.table index efbf08d19..e2bb156ee 100644 --- a/definitions/grib2/tables/16/3.20.table +++ b/definitions/grib2/tables/16/3.20.table @@ -1,6 +1,6 @@ # Code table 3.20 - Type of horizontal line -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/3.21.table b/definitions/grib2/tables/16/3.21.table index 88dbb9019..e001e1c8f 100644 --- a/definitions/grib2/tables/16/3.21.table +++ b/definitions/grib2/tables/16/3.21.table @@ -1,8 +1,8 @@ # Code table 3.21 - Vertical dimension coordinate values definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/3.3.table b/definitions/grib2/tables/16/3.3.table index 5dd7c7001..25cb46a1d 100644 --- a/definitions/grib2/tables/16/3.3.table +++ b/definitions/grib2/tables/16/3.3.table @@ -1,9 +1,9 @@ # Flag table 3.3 - Resolution and component flags -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/16/3.4.table b/definitions/grib2/tables/16/3.4.table index 897b813d7..43835c014 100644 --- a/definitions/grib2/tables/16/3.4.table +++ b/definitions/grib2/tables/16/3.4.table @@ -1,17 +1,17 @@ # Flag table 3.4 - Scanning mode -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -5 0 Points within odd rows are not offset in i (x) direction -5 1 Points within odd rows are offset by Di/2 in i (x) direction -6 0 Points within even rows are not offset in i (x) direction -6 1 Points within even rows are offset by Di/2 in i (x) direction -7 0 Points are not offset in j (y) direction -7 1 Points are offset by Dj/2 in j (y) direction -8 0 Rows have Ni grid points and columns have Nj grid points -8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +5 0 Points within odd rows are not offset in i (x) direction +5 1 Points within odd rows are offset by Di/2 in i (x) direction +6 0 Points within even rows are not offset in i (x) direction +6 1 Points within even rows are offset by Di/2 in i (x) direction +7 0 Points are not offset in j (y) direction +7 1 Points are offset by Dj/2 in j (y) direction +8 0 Rows have Ni grid points and columns have Nj grid points +8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction diff --git a/definitions/grib2/tables/16/3.5.table b/definitions/grib2/tables/16/3.5.table index eabdde896..2f8ec82e3 100644 --- a/definitions/grib2/tables/16/3.5.table +++ b/definitions/grib2/tables/16/3.5.table @@ -1,5 +1,5 @@ # Flag table 3.5 - Projection centre -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/16/3.7.table b/definitions/grib2/tables/16/3.7.table index 0a7d6efde..34c0de085 100644 --- a/definitions/grib2/tables/16/3.7.table +++ b/definitions/grib2/tables/16/3.7.table @@ -1,5 +1,5 @@ # Code table 3.7 - Spectral data representation mode -0 0 Reserved +0 0 Reserved 1 1 see separate doc or pdf file -# 2-254 Reserved -255 255 Missing +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/16/3.8.table b/definitions/grib2/tables/16/3.8.table index 844e74235..578fab37f 100644 --- a/definitions/grib2/tables/16/3.8.table +++ b/definitions/grib2/tables/16/3.8.table @@ -1,7 +1,7 @@ # Code table 3.8 - Grid point position -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/3.9.table b/definitions/grib2/tables/16/3.9.table index fd730bc64..ecd65514a 100644 --- a/definitions/grib2/tables/16/3.9.table +++ b/definitions/grib2/tables/16/3.9.table @@ -1,4 +1,4 @@ # Flag table 3.9 - Numbering order of diamonds as seen from the corresponding pole -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/16/4.0.table b/definitions/grib2/tables/16/4.0.table index 05bf24330..eef83c7c3 100644 --- a/definitions/grib2/tables/16/4.0.table +++ b/definitions/grib2/tables/16/4.0.table @@ -1,65 +1,65 @@ # Code table 4.0 - Product definition template number -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time -8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -# 35-39 Reserved +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 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 +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +# 35-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -42 42 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 atmospheric chemical constituents -43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol -46 46 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 aerosol -47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol -48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -# 49-50 Reserved -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time -52 52 Reserved -53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time -54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters -55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time -56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters -57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function -# 58-59 Reserved -60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval -# 62-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 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 atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 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 aerosol +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +# 49-50 Reserved +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +52 52 Reserved +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time +56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters +57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +# 58-59 Reserved +60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +# 62-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved -# 32768-65534 Reserved for local use +# 1102-32767 Reserved +# 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/16/4.1.0.table b/definitions/grib2/tables/16/4.1.0.table index 04cfd7802..df58636d6 100644 --- a/definitions/grib2/tables/16/4.1.0.table +++ b/definitions/grib2/tables/16/4.1.0.table @@ -1,27 +1,27 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.1.1.table b/definitions/grib2/tables/16/4.1.1.table index 7b22b6fed..05a854da0 100644 --- a/definitions/grib2/tables/16/4.1.1.table +++ b/definitions/grib2/tables/16/4.1.1.table @@ -1,7 +1,7 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.1.10.table b/definitions/grib2/tables/16/4.1.10.table index a9b20eb9c..88d3c8743 100644 --- a/definitions/grib2/tables/16/4.1.10.table +++ b/definitions/grib2/tables/16/4.1.10.table @@ -1,10 +1,10 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Subsurface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Subsurface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.1.2.table b/definitions/grib2/tables/16/4.1.2.table index 5b488fe9e..e74126645 100644 --- a/definitions/grib2/tables/16/4.1.2.table +++ b/definitions/grib2/tables/16/4.1.2.table @@ -1,9 +1,9 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.1.3.table b/definitions/grib2/tables/16/4.1.3.table index d2baa1362..210b39fd5 100644 --- a/definitions/grib2/tables/16/4.1.3.table +++ b/definitions/grib2/tables/16/4.1.3.table @@ -1,11 +1,11 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Image format products -1 1 Quantitative products -2 2 Cloud properties -3 3 Flight rules conditions -4 4 Volcanic ash -5 5 Sea surface temperature -6 6 Solar radiation -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +2 2 Cloud properties +3 3 Flight rules conditions +4 4 Volcanic ash +5 5 Sea surface temperature +6 6 Solar radiation +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.10.table b/definitions/grib2/tables/16/4.10.table index 1a92baaf6..8a390e4be 100644 --- a/definitions/grib2/tables/16/4.10.table +++ b/definitions/grib2/tables/16/4.10.table @@ -1,16 +1,16 @@ # Code table 4.10 - Type of statistical processing -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -11 11 Summation -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/16/4.11.table b/definitions/grib2/tables/16/4.11.table index 7f404c849..01cc81303 100644 --- a/definitions/grib2/tables/16/4.11.table +++ b/definitions/grib2/tables/16/4.11.table @@ -1,10 +1,10 @@ # Code table 4.11 - Type of time intervals -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.12.table b/definitions/grib2/tables/16/4.12.table index 03fd89b36..d42b47e96 100644 --- a/definitions/grib2/tables/16/4.12.table +++ b/definitions/grib2/tables/16/4.12.table @@ -1,7 +1,7 @@ # Code table 4.12 - Operating mode -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.13.table b/definitions/grib2/tables/16/4.13.table index c92854eec..a0e28eac8 100644 --- a/definitions/grib2/tables/16/4.13.table +++ b/definitions/grib2/tables/16/4.13.table @@ -1,6 +1,6 @@ # Code table 4.13 - Quality control indicator -0 0 No quality control applied -1 1 Quality control applied -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.14.table b/definitions/grib2/tables/16/4.14.table index a88cb93fa..d525b23b3 100644 --- a/definitions/grib2/tables/16/4.14.table +++ b/definitions/grib2/tables/16/4.14.table @@ -1,6 +1,6 @@ # Code table 4.14 - Clutter filter indicator -0 0 No clutter filter used -1 1 Clutter filter used -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.15.table b/definitions/grib2/tables/16/4.15.table index 2e5f3dea3..7adddedb6 100644 --- a/definitions/grib2/tables/16/4.15.table +++ b/definitions/grib2/tables/16/4.15.table @@ -1,11 +1,11 @@ # Code table 4.15 - Type of spatial processing used to arrive at given data value from the source data -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.0.table b/definitions/grib2/tables/16/4.2.0.0.table index cfadd2d07..3a285255f 100644 --- a/definitions/grib2/tables/16/4.2.0.0.table +++ b/definitions/grib2/tables/16/4.2.0.0.table @@ -27,6 +27,6 @@ 25 25 Temperature tendency due to long-wave radiation, clear sky (K s-1) 26 26 Temperature tendency due to parameterizations (K s-1) 27 27 Wet bulb temperature (K) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.1.table b/definitions/grib2/tables/16/4.2.0.1.table index 775cfe54f..1ecbf240a 100644 --- a/definitions/grib2/tables/16/4.2.0.1.table +++ b/definitions/grib2/tables/16/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,7 +86,7 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rainwater content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) @@ -106,6 +106,6 @@ 106 106 Number density of graupel (m-3) 107 107 Number density of hail (m-3) 108 108 Specific humidity tendency due to parameterizations (kg kg-1 s-1) -# 109-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 109-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.13.table b/definitions/grib2/tables/16/4.2.0.13.table index 5086101ad..3f5c30675 100644 --- a/definitions/grib2/tables/16/4.2.0.13.table +++ b/definitions/grib2/tables/16/4.2.0.13.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.14.table b/definitions/grib2/tables/16/4.2.0.14.table index 215884737..97fb38c8b 100644 --- a/definitions/grib2/tables/16/4.2.0.14.table +++ b/definitions/grib2/tables/16/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.15.table b/definitions/grib2/tables/16/4.2.0.15.table index dfbc4d12f..8df082466 100644 --- a/definitions/grib2/tables/16/4.2.0.15.table +++ b/definitions/grib2/tables/16/4.2.0.15.table @@ -16,6 +16,6 @@ 14 14 Reflectivity of hail (dB) 15 15 Hybrid scan reflectivity (dB) 16 16 Hybrid scan reflectivity height (m) -# 17-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.16.table b/definitions/grib2/tables/16/4.2.0.16.table index 0c240a853..9499d9333 100644 --- a/definitions/grib2/tables/16/4.2.0.16.table +++ b/definitions/grib2/tables/16/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.18.table b/definitions/grib2/tables/16/4.2.0.18.table index 18c41aa48..7e0a736eb 100644 --- a/definitions/grib2/tables/16/4.2.0.18.table +++ b/definitions/grib2/tables/16/4.2.0.18.table @@ -8,11 +8,11 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) 13 13 Total deposition (wet + dry) (Bq m-2) -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.19.table b/definitions/grib2/tables/16/4.2.0.19.table index ec2b9823d..e51b670a0 100644 --- a/definitions/grib2/tables/16/4.2.0.19.table +++ b/definitions/grib2/tables/16/4.2.0.19.table @@ -28,6 +28,6 @@ 26 26 Convective outlook (Code table 4.224) 27 27 Icing scenario (Code table 4.227) 28 28 Mountain wave turbulence (eddy dissipation rate) (m2/3 s-1) -# 29-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 29-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.190.table b/definitions/grib2/tables/16/4.2.0.190.table index de621a924..a0d6ba0ac 100644 --- a/definitions/grib2/tables/16/4.2.0.190.table +++ b/definitions/grib2/tables/16/4.2.0.190.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.191.table b/definitions/grib2/tables/16/4.2.0.191.table index e3bba0ebe..b3a7092ea 100644 --- a/definitions/grib2/tables/16/4.2.0.191.table +++ b/definitions/grib2/tables/16/4.2.0.191.table @@ -3,6 +3,6 @@ 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.2.table b/definitions/grib2/tables/16/4.2.0.2.table index 46b0774aa..906cf6205 100644 --- a/definitions/grib2/tables/16/4.2.0.2.table +++ b/definitions/grib2/tables/16/4.2.0.2.table @@ -44,6 +44,6 @@ 42 42 v-component of geostrophic wind (m s-1) 43 43 Geostrophic wind direction (degree true) 44 44 Geostrophic wind speed (m s-1) -# 45-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 45-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.20.table b/definitions/grib2/tables/16/4.2.0.20.table index 9584f7c7f..df9ccc184 100644 --- a/definitions/grib2/tables/16/4.2.0.20.table +++ b/definitions/grib2/tables/16/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -25,7 +25,7 @@ 57 57 Total yearly average burden of the atmosphere (mol) 58 58 Total yearly averaged atmospheric loss (mol/s) 59 59 Aerosol number concentration (m-3) -# 60-99 Reserved +# 60-99 Reserved 100 100 Surface area density (aerosol) (/m) 101 101 Vertical visual range (m) 102 102 Aerosol optical thickness (Numeric) @@ -37,6 +37,6 @@ 108 108 Aerosol lidar backscatter from the ground (m-1 sr-1) 109 109 Aerosol lidar extinction from satellite (/m) 110 110 Aerosol lidar extinction from the ground (/m) -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.3.table b/definitions/grib2/tables/16/4.2.0.3.table index c7c6359d4..17e7f204f 100644 --- a/definitions/grib2/tables/16/4.2.0.3.table +++ b/definitions/grib2/tables/16/4.2.0.3.table @@ -30,6 +30,6 @@ 28 28 Downdraught mass flux (kg m-2 s-1) 29 29 Updraught detrainment rate (kg m-3 s-1) 30 30 Downdraught detrainment rate (kg m-3 s-1) -# 31-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 31-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.4.table b/definitions/grib2/tables/16/4.2.0.4.table index bd37ea3f5..da327a450 100644 --- a/definitions/grib2/tables/16/4.2.0.4.table +++ b/definitions/grib2/tables/16/4.2.0.4.table @@ -14,9 +14,9 @@ 12 12 Downward UV radiation (W m-2) 13 13 Direct short wave radiation flux (W m-2) 14 14 Diffuse short wave radiation flux (W m-2) -# 15-49 Reserved +# 15-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) -# 52-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 52-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.5.table b/definitions/grib2/tables/16/4.2.0.5.table index 932a12fbd..b9084509a 100644 --- a/definitions/grib2/tables/16/4.2.0.5.table +++ b/definitions/grib2/tables/16/4.2.0.5.table @@ -7,6 +7,6 @@ 5 5 Net long-wave radiation flux (W m-2) 6 6 Net long-wave radiation flux, clear sky (W m-2) 7 7 Brightness temperature (K) -# 8-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.6.table b/definitions/grib2/tables/16/4.2.0.6.table index 4cec0c8aa..0450ec194 100644 --- a/definitions/grib2/tables/16/4.2.0.6.table +++ b/definitions/grib2/tables/16/4.2.0.6.table @@ -40,10 +40,10 @@ 38 38 Mass density of cloud droplets (kg m-3) 39 39 Mass density of cloud ice (kg m-3) 40 40 Mass density of convective cloud water droplets (kg m-3) -# 41-46 Reserved +# 41-46 Reserved 47 47 Volume fraction of cloud water droplets (Numeric) 48 48 Volume fraction of cloud ice particles (Numeric) 49 49 Volume fraction of cloud (ice and/or water) (Numeric) -# 50-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 50-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.0.7.table b/definitions/grib2/tables/16/4.2.0.7.table index 23a1a82da..2bf21255d 100644 --- a/definitions/grib2/tables/16/4.2.0.7.table +++ b/definitions/grib2/tables/16/4.2.0.7.table @@ -13,11 +13,11 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraft helicity (m2 s-2) 16 16 Bulk Richardson number (Numeric) 17 17 Gradient Richardson number (Numeric) 18 18 Flux Richardson number (Numeric) -# 19-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 19-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.1.0.table b/definitions/grib2/tables/16/4.2.1.0.table index 74c95f57b..e6f23655a 100644 --- a/definitions/grib2/tables/16/4.2.1.0.table +++ b/definitions/grib2/tables/16/4.2.1.0.table @@ -15,6 +15,6 @@ 13 13 Depth of water on soil surface (kg m-2) 14 14 Upstream accumulated precipitation (kg m-2) 15 15 Upstream accumulated snow melt (kg m-2) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.1.1.table b/definitions/grib2/tables/16/4.2.1.1.table index b488eb0bd..171da3958 100644 --- a/definitions/grib2/tables/16/4.2.1.1.table +++ b/definitions/grib2/tables/16/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.10.0.table b/definitions/grib2/tables/16/4.2.10.0.table index 095f51bdf..3611abd9a 100644 --- a/definitions/grib2/tables/16/4.2.10.0.table +++ b/definitions/grib2/tables/16/4.2.10.0.table @@ -45,6 +45,6 @@ 43 43 Kurtosis of the sea-surface elevation due to waves (-) 44 44 Benjamin-Feir index (-) 45 45 Spectral peakedness factor (/s) -# 46-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 46-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.10.1.table b/definitions/grib2/tables/16/4.2.10.1.table index 5959bfa28..f0a073c00 100644 --- a/definitions/grib2/tables/16/4.2.10.1.table +++ b/definitions/grib2/tables/16/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.10.191.table b/definitions/grib2/tables/16/4.2.10.191.table index 524929e78..1ebf85006 100644 --- a/definitions/grib2/tables/16/4.2.10.191.table +++ b/definitions/grib2/tables/16/4.2.10.191.table @@ -1,8 +1,8 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Meridional overturning stream function (m3/s) -2 2 Reserved +2 2 Reserved 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.10.2.table b/definitions/grib2/tables/16/4.2.10.2.table index 6797062ac..4633bad4f 100644 --- a/definitions/grib2/tables/16/4.2.10.2.table +++ b/definitions/grib2/tables/16/4.2.10.2.table @@ -12,6 +12,6 @@ 10 10 Zonal vector component of vertically integrated ice internal pressure (Pa m) 11 11 Meridional vector component of vertically integrated ice internal pressure (Pa m) 12 12 Compressive ice strength (N/m) -# 13-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 13-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.10.3.table b/definitions/grib2/tables/16/4.2.10.3.table index f951bbe78..937720c93 100644 --- a/definitions/grib2/tables/16/4.2.10.3.table +++ b/definitions/grib2/tables/16/4.2.10.3.table @@ -1,6 +1,6 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.10.4.table b/definitions/grib2/tables/16/4.2.10.4.table index 54774f1b7..d5615ae26 100644 --- a/definitions/grib2/tables/16/4.2.10.4.table +++ b/definitions/grib2/tables/16/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2/s) 6 6 Ocean vertical momentum diffusivity (m2/s) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (/m) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.2.0.table b/definitions/grib2/tables/16/4.2.2.0.table index 81548840c..b253cac22 100644 --- a/definitions/grib2/tables/16/4.2.2.0.table +++ b/definitions/grib2/tables/16/4.2.2.0.table @@ -38,6 +38,6 @@ 36 36 Tile fraction (Proportion) 37 37 Tile percentage (%) 38 38 Soil volumetric ice content (water equivalent) (m3 m-3) -# 39-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 39-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.2.3.table b/definitions/grib2/tables/16/4.2.2.3.table index dff2f7953..6cb8eb7af 100644 --- a/definitions/grib2/tables/16/4.2.2.3.table +++ b/definitions/grib2/tables/16/4.2.2.3.table @@ -25,6 +25,6 @@ 23 23 Liquid water in snow pack (kg m-2) 24 24 Frost index (K day-1) 25 25 Snow depth at elevation bands (kg m-2) -# 26-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 26-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.2.4.table b/definitions/grib2/tables/16/4.2.2.4.table index b9383fe10..cb3db6f78 100644 --- a/definitions/grib2/tables/16/4.2.2.4.table +++ b/definitions/grib2/tables/16/4.2.2.4.table @@ -11,6 +11,6 @@ 9 9 Initial fire spread index (Canadian forest service) (Numeric) 10 10 Fire build up index (Canadian forest service) (Numeric) 11 11 Fire daily severity rating (Canadian forest service) (Numeric) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.3.0.table b/definitions/grib2/tables/16/4.2.3.0.table index c0ffa29f5..80a829673 100644 --- a/definitions/grib2/tables/16/4.2.3.0.table +++ b/definitions/grib2/tables/16/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.2.3.1.table b/definitions/grib2/tables/16/4.2.3.1.table index 75911ee32..04cdde1f1 100644 --- a/definitions/grib2/tables/16/4.2.3.1.table +++ b/definitions/grib2/tables/16/4.2.3.1.table @@ -17,16 +17,16 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) -20 20 Aerosol optical thickness at 0.635 um -21 21 Aerosol optical thickness at 0.810 um -22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-26 Reserved +20 20 Aerosol optical thickness at 0.635 um +21 21 Aerosol optical thickness at 0.810 um +22 22 Aerosol optical thickness at 1.640 um +23 23 Angstrom coefficient +# 24-26 Reserved 27 27 Bidirectional reflectance factor (Numeric) 28 28 Brightness temperature (K) 29 29 Scaled radiance (Numeric) -# 30-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 30-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.201.table b/definitions/grib2/tables/16/4.201.table index 47f1b486f..fa173c4e0 100644 --- a/definitions/grib2/tables/16/4.201.table +++ b/definitions/grib2/tables/16/4.201.table @@ -1,15 +1,15 @@ # Code table 4.201 - Precipitation type -0 0 Reserved -1 1 Rain -2 2 Thunderstorm -3 3 Freezing rain -4 4 Mixed/ice -5 5 Snow -6 6 Wet snow -7 7 Mixture of rain and snow -8 8 Ice pellets -9 9 Graupel -10 10 Hail -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow +6 6 Wet snow +7 7 Mixture of rain and snow +8 8 Ice pellets +9 9 Graupel +10 10 Hail +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.202.table b/definitions/grib2/tables/16/4.202.table index 438502ff9..7f3c8f6cf 100644 --- a/definitions/grib2/tables/16/4.202.table +++ b/definitions/grib2/tables/16/4.202.table @@ -1,4 +1,4 @@ # Code table 4.202 - Precipitable water category -# 0-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.203.table b/definitions/grib2/tables/16/4.203.table index 8a9aedf7a..cf5eb6bdc 100644 --- a/definitions/grib2/tables/16/4.203.table +++ b/definitions/grib2/tables/16/4.203.table @@ -1,26 +1,26 @@ # Code table 4.203 - Cloud type -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.204.table b/definitions/grib2/tables/16/4.204.table index 91bcf1814..ffbd89502 100644 --- a/definitions/grib2/tables/16/4.204.table +++ b/definitions/grib2/tables/16/4.204.table @@ -1,9 +1,9 @@ # Code table 4.204 - Thunderstorm coverage -0 0 None -1 1 Isolated (1-2%) -2 2 Few (3-5%) -3 3 Scattered (16-45%) -4 4 Numerous (> 45%) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (16-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.205.table b/definitions/grib2/tables/16/4.205.table index 5b4484dfd..c40c7f47b 100644 --- a/definitions/grib2/tables/16/4.205.table +++ b/definitions/grib2/tables/16/4.205.table @@ -1,6 +1,6 @@ # Code table 4.205 - Presence of aerosol -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.206.table b/definitions/grib2/tables/16/4.206.table index 02c3dfdf9..76472c261 100644 --- a/definitions/grib2/tables/16/4.206.table +++ b/definitions/grib2/tables/16/4.206.table @@ -1,6 +1,6 @@ # Code table 4.206 - Volcanic ash -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.207.table b/definitions/grib2/tables/16/4.207.table index 8ddb2e048..b6392fca0 100644 --- a/definitions/grib2/tables/16/4.207.table +++ b/definitions/grib2/tables/16/4.207.table @@ -1,10 +1,10 @@ # Code table 4.207 - Icing -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.208.table b/definitions/grib2/tables/16/4.208.table index b83685a1a..4361d38c0 100644 --- a/definitions/grib2/tables/16/4.208.table +++ b/definitions/grib2/tables/16/4.208.table @@ -1,9 +1,9 @@ # Code table 4.208 - Turbulence -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.209.table b/definitions/grib2/tables/16/4.209.table index cb7617071..39ea549ac 100644 --- a/definitions/grib2/tables/16/4.209.table +++ b/definitions/grib2/tables/16/4.209.table @@ -1,9 +1,9 @@ # Code table 4.209 - Planetary boundary-layer regime -0 0 Reserved -1 1 Stable -2 2 Mechanically driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.210.table b/definitions/grib2/tables/16/4.210.table index 524a6ca73..791878469 100644 --- a/definitions/grib2/tables/16/4.210.table +++ b/definitions/grib2/tables/16/4.210.table @@ -1,6 +1,6 @@ # Code table 4.210 - Contrail intensity -0 0 Contrail not present -1 1 Contrail present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Contrail not present +1 1 Contrail present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.211.table b/definitions/grib2/tables/16/4.211.table index 098eb2d43..2a28a84d9 100644 --- a/definitions/grib2/tables/16/4.211.table +++ b/definitions/grib2/tables/16/4.211.table @@ -1,7 +1,7 @@ # Code table 4.211 - Contrail engine type -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.212.table b/definitions/grib2/tables/16/4.212.table index 1a085b88d..6a3dcf88c 100644 --- a/definitions/grib2/tables/16/4.212.table +++ b/definitions/grib2/tables/16/4.212.table @@ -1,18 +1,18 @@ # Code table 4.212 - Land use -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.213.table b/definitions/grib2/tables/16/4.213.table index c65784a00..68d627af6 100644 --- a/definitions/grib2/tables/16/4.213.table +++ b/definitions/grib2/tables/16/4.213.table @@ -1,16 +1,16 @@ # Code table 4.213 - Soil type -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.215.table b/definitions/grib2/tables/16/4.215.table index 034db72be..7888772d5 100644 --- a/definitions/grib2/tables/16/4.215.table +++ b/definitions/grib2/tables/16/4.215.table @@ -1,9 +1,9 @@ # Code table 4.215 - Remotely sensed snow coverage -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.216.table b/definitions/grib2/tables/16/4.216.table index 5d1460cef..b51b358f4 100644 --- a/definitions/grib2/tables/16/4.216.table +++ b/definitions/grib2/tables/16/4.216.table @@ -1,5 +1,5 @@ # Code table 4.216 - Elevation of snow-covered terrain -# 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 0-90 Elevation in increments of 100 m +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/16/4.217.table b/definitions/grib2/tables/16/4.217.table index a4452182c..a700410d5 100644 --- a/definitions/grib2/tables/16/4.217.table +++ b/definitions/grib2/tables/16/4.217.table @@ -1,8 +1,8 @@ # Code table 4.217 - Cloud mask type -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.218.table b/definitions/grib2/tables/16/4.218.table index c585bed96..0ad5f49ee 100644 --- a/definitions/grib2/tables/16/4.218.table +++ b/definitions/grib2/tables/16/4.218.table @@ -1,44 +1,44 @@ # Code table 4.218 - Pixel scene type -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation/crops -15 15 Permanent snow/ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -19 19 Warm liquid water cloud -20 20 Supercooled liquid water cloud -21 21 Mixed phase cloud -22 22 Optically thin ice cloud -23 23 Optically thick ice cloud -24 24 Multi-layered cloud -# 25-96 Reserved -97 97 Snow/ice on land -98 98 Snow/ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud/fog/Stratus -102 102 Low cloud/Stratocumulus -103 103 Low cloud/unknown type -104 104 Medium cloud/Nimbostratus -105 105 Medium cloud/Altostratus -106 106 Medium cloud/unknown type -107 107 High cloud/Cumulus -108 108 High cloud/Cirrus -109 109 High cloud/unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation/crops +15 15 Permanent snow/ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +19 19 Warm liquid water cloud +20 20 Supercooled liquid water cloud +21 21 Mixed phase cloud +22 22 Optically thin ice cloud +23 23 Optically thick ice cloud +24 24 Multi-layered cloud +# 25-96 Reserved +97 97 Snow/ice on land +98 98 Snow/ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud/fog/Stratus +102 102 Low cloud/Stratocumulus +103 103 Low cloud/unknown type +104 104 Medium cloud/Nimbostratus +105 105 Medium cloud/Altostratus +106 106 Medium cloud/unknown type +107 107 High cloud/Cumulus +108 108 High cloud/Cirrus +109 109 High cloud/unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.219.table b/definitions/grib2/tables/16/4.219.table index 86df0522e..9979f50ad 100644 --- a/definitions/grib2/tables/16/4.219.table +++ b/definitions/grib2/tables/16/4.219.table @@ -1,8 +1,8 @@ # Code table 4.219 - Cloud top height quality indicator -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.220.table b/definitions/grib2/tables/16/4.220.table index 93e841f8b..88e869e42 100644 --- a/definitions/grib2/tables/16/4.220.table +++ b/definitions/grib2/tables/16/4.220.table @@ -1,6 +1,6 @@ # Code table 4.220 - Horizontal dimension processed -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.221.table b/definitions/grib2/tables/16/4.221.table index 8448533d7..011cc3518 100644 --- a/definitions/grib2/tables/16/4.221.table +++ b/definitions/grib2/tables/16/4.221.table @@ -1,6 +1,6 @@ # Code table 4.221 - Treatment of missing data -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.222.table b/definitions/grib2/tables/16/4.222.table index 57f113014..558d947ac 100644 --- a/definitions/grib2/tables/16/4.222.table +++ b/definitions/grib2/tables/16/4.222.table @@ -1,6 +1,6 @@ # Code table 4.222 - Categorical result -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.223.table b/definitions/grib2/tables/16/4.223.table index f0deb076a..572c4e7a8 100644 --- a/definitions/grib2/tables/16/4.223.table +++ b/definitions/grib2/tables/16/4.223.table @@ -1,5 +1,5 @@ # Code table 4.223 - Fire detection indicator -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing diff --git a/definitions/grib2/tables/16/4.224.table b/definitions/grib2/tables/16/4.224.table index e87cde4bb..014f56e23 100644 --- a/definitions/grib2/tables/16/4.224.table +++ b/definitions/grib2/tables/16/4.224.table @@ -1,18 +1,18 @@ # Code table 4.224 - Categorical outlook -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/16/4.227.table b/definitions/grib2/tables/16/4.227.table index 27c76553d..48c3b7633 100644 --- a/definitions/grib2/tables/16/4.227.table +++ b/definitions/grib2/tables/16/4.227.table @@ -1,9 +1,9 @@ # Code table 4.227 - Icing scenario (weather/cloud classification) -0 0 None -1 1 General -2 2 Convective -3 3 Stratiform -4 4 Freezing -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 None +1 1 General +2 2 Convective +3 3 Stratiform +4 4 Freezing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/16/4.234.table b/definitions/grib2/tables/16/4.234.table index 9844a91d2..d8b3715b3 100644 --- a/definitions/grib2/tables/16/4.234.table +++ b/definitions/grib2/tables/16/4.234.table @@ -1,21 +1,21 @@ # Code table 4.234 - Canopy cover fraction (to be used as partitioned parameter in PDT 4.53 or 4.54) -1 1 Crops, mixed farming -2 2 Short grass -3 3 Evergreen needleleaf trees -4 4 Deciduous needleleaf trees -5 5 Deciduous broadleaf trees -6 6 Evergreen broadleaf trees -7 7 Tall grass -8 8 Desert -9 9 Tundra -10 10 Irrigated crops -11 11 Semidesert -12 12 Ice caps and glaciers -13 13 Bogs and marshes -14 14 Inland water -15 15 Ocean -16 16 Evergreen shrubs -17 17 Deciduous shrubs -18 18 Mixed forest -19 19 Interrupted forest -20 20 Water and land mixtures +1 1 Crops, mixed farming +2 2 Short grass +3 3 Evergreen needleleaf trees +4 4 Deciduous needleleaf trees +5 5 Deciduous broadleaf trees +6 6 Evergreen broadleaf trees +7 7 Tall grass +8 8 Desert +9 9 Tundra +10 10 Irrigated crops +11 11 Semidesert +12 12 Ice caps and glaciers +13 13 Bogs and marshes +14 14 Inland water +15 15 Ocean +16 16 Evergreen shrubs +17 17 Deciduous shrubs +18 18 Mixed forest +19 19 Interrupted forest +20 20 Water and land mixtures diff --git a/definitions/grib2/tables/16/4.236.table b/definitions/grib2/tables/16/4.236.table index 08c7f8d56..b667b65fc 100644 --- a/definitions/grib2/tables/16/4.236.table +++ b/definitions/grib2/tables/16/4.236.table @@ -1,8 +1,8 @@ # Code table 4.236 - Soil texture fraction (to be used as partitioned parameter in PDT 4.53 or 4.54) -1 1 Coarse -2 2 Medium -3 3 Medium-fine -4 4 Fine -5 5 Very-fine -6 6 Organic -7 7 Tropical-organic +1 1 Coarse +2 2 Medium +3 3 Medium-fine +4 4 Fine +5 5 Very-fine +6 6 Organic +7 7 Tropical-organic diff --git a/definitions/grib2/tables/16/4.240.table b/definitions/grib2/tables/16/4.240.table index c12ebbb77..1838acfc0 100644 --- a/definitions/grib2/tables/16/4.240.table +++ b/definitions/grib2/tables/16/4.240.table @@ -1,12 +1,12 @@ # Code table 4.240 - Type of distribution function -0 0 No specific distribution function given -1 1 Delta functions with spatially variable concentration and fixed diameters Dl (p1) in meter -2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg -3 3 Gaussian (Normal) distribution with spatially variable concentration and fixed mean diameter Dl(p1) and variance(p2) -4 4 Gaussian (Normal) distribution with spatially variable concentration, mean diameter and variance -5 5 Log-normal distribution with spatially variable number density, mean diameter and variance +0 0 No specific distribution function given +1 1 Delta functions with spatially variable concentration and fixed diameters Dl (p1) in meter +2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg +3 3 Gaussian (Normal) distribution with spatially variable concentration and fixed mean diameter Dl(p1) and variance(p2) +4 4 Gaussian (Normal) distribution with spatially variable concentration, mean diameter and variance +5 5 Log-normal distribution with spatially variable number density, mean diameter and variance 6 6 Log-normal distribution with spatially variable number density, mean diameter and fixed variance(p1) 7 7 Log-normal distribution with spatially variable number density and mass density and fixed variance(p1) and fixed particle density(p2) -# 8-49151 Reserved -# 49152-65534 Reserved for local use -65535 65535 Missing value +# 8-49151 Reserved +# 49152-65534 Reserved for local use +65535 65535 Missing value diff --git a/definitions/grib2/tables/16/4.241.table b/definitions/grib2/tables/16/4.241.table index a037b4ba5..5ea7f775a 100644 --- a/definitions/grib2/tables/16/4.241.table +++ b/definitions/grib2/tables/16/4.241.table @@ -1,9 +1,9 @@ # Code table 4.241 - Coverage attributes -0 0 Undefined -1 1 Unmodified -2 2 Snow covered -3 3 Flooded -4 4 Ice covered -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 Undefined +1 1 Unmodified +2 2 Snow covered +3 3 Flooded +4 4 Ice covered +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/16/4.242.table b/definitions/grib2/tables/16/4.242.table index 083f88c29..f6865957c 100644 --- a/definitions/grib2/tables/16/4.242.table +++ b/definitions/grib2/tables/16/4.242.table @@ -1,7 +1,7 @@ # Code table 4.242 - Tile classification -0 0 Reserved -1 1 Land use classes according to ESA-GlobCover GCV2009 -2 2 Land use classes according to European Commission-Global Land Cover Project GLC2000 -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 Reserved +1 1 Land use classes according to ESA-GlobCover GCV2009 +2 2 Land use classes according to European Commission-Global Land Cover Project GLC2000 +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/16/4.243.table b/definitions/grib2/tables/16/4.243.table index b39053311..24d21b719 100644 --- a/definitions/grib2/tables/16/4.243.table +++ b/definitions/grib2/tables/16/4.243.table @@ -1,43 +1,43 @@ # Code table 4.243 - Tile class -0 0 Reserved -1 1 Evergreen broadleaved forest -2 2 Deciduous broadleaved closed forest -3 3 Deciduous broadleaved open forest -4 4 Evergreen needle-leaf forest -5 5 Deciduous needle-leaf forest -6 6 Mixed leaf trees -7 7 Freshwater flooded trees -8 8 Saline water flooded trees -9 9 Mosaic tree/natural vegetation -10 10 Burnt tree cover -11 11 Evergreen shrubs closed-open -12 12 Deciduous shrubs closed-open -13 13 Herbaceous vegetation closed-open -14 14 Sparse herbaceous or grass -15 15 Flooded shrubs or herbaceous -16 16 Cultivated and managed areas -17 17 Mosaic crop/tree/natural vegetation -18 18 Mosaic crop/shrub/grass -19 19 Bare areas -20 20 Water -21 21 Snow and ice -22 22 Artificial surface -23 23 Ocean -24 24 Irrigated croplands -25 25 Rainfed croplands -26 26 Mosaic cropland (50-70%) - vegetation (20-50%) -27 27 Mosaic vegetation (50-70%) - cropland (20-50%) -28 28 Closed broadleaved evergreen forest -29 29 Closed needle-leaved evergreen forest -30 30 Open needle-leaved deciduous forest -31 31 Mixed broadleaved and needle-leaved forest -32 32 Mosaic shrubland (50-70%) - grassland (20-50%) -33 33 Mosaic grassland (50-70%) - shrubland (20-50%) -34 34 Closed to open shrubland -35 35 Sparse vegetation -36 36 Closed to open forest regularly flooded -37 37 Closed forest or shrubland permanently flooded -38 38 Closed to open grassland regularly flooded -39 39 Undefined -# 40-32767 Reserved -# 32768- Reserved for local use +0 0 Reserved +1 1 Evergreen broadleaved forest +2 2 Deciduous broadleaved closed forest +3 3 Deciduous broadleaved open forest +4 4 Evergreen needle-leaf forest +5 5 Deciduous needle-leaf forest +6 6 Mixed leaf trees +7 7 Freshwater flooded trees +8 8 Saline water flooded trees +9 9 Mosaic tree/natural vegetation +10 10 Burnt tree cover +11 11 Evergreen shrubs closed-open +12 12 Deciduous shrubs closed-open +13 13 Herbaceous vegetation closed-open +14 14 Sparse herbaceous or grass +15 15 Flooded shrubs or herbaceous +16 16 Cultivated and managed areas +17 17 Mosaic crop/tree/natural vegetation +18 18 Mosaic crop/shrub/grass +19 19 Bare areas +20 20 Water +21 21 Snow and ice +22 22 Artificial surface +23 23 Ocean +24 24 Irrigated croplands +25 25 Rainfed croplands +26 26 Mosaic cropland (50-70%) - vegetation (20-50%) +27 27 Mosaic vegetation (50-70%) - cropland (20-50%) +28 28 Closed broadleaved evergreen forest +29 29 Closed needle-leaved evergreen forest +30 30 Open needle-leaved deciduous forest +31 31 Mixed broadleaved and needle-leaved forest +32 32 Mosaic shrubland (50-70%) - grassland (20-50%) +33 33 Mosaic grassland (50-70%) - shrubland (20-50%) +34 34 Closed to open shrubland +35 35 Sparse vegetation +36 36 Closed to open forest regularly flooded +37 37 Closed forest or shrubland permanently flooded +38 38 Closed to open grassland regularly flooded +39 39 Undefined +# 40-32767 Reserved +# 32768- Reserved for local use diff --git a/definitions/grib2/tables/16/4.3.table b/definitions/grib2/tables/16/4.3.table index f205ea0c2..bcf8102a1 100644 --- a/definitions/grib2/tables/16/4.3.table +++ b/definitions/grib2/tables/16/4.3.table @@ -1,22 +1,22 @@ # Code table 4.3 - Type of generating process -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast -12 12 Post-processed analysis -13 13 Post-processed forecast -14 14 Nowcast -15 15 Hindcast -16 16 Physical retrieval -17 17 Regression analysis -# 18-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +12 12 Post-processed analysis +13 13 Post-processed forecast +14 14 Nowcast +15 15 Hindcast +16 16 Physical retrieval +17 17 Regression analysis +# 18-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.4.table b/definitions/grib2/tables/16/4.4.table index 7087ebddb..6e63e069c 100644 --- a/definitions/grib2/tables/16/4.4.table +++ b/definitions/grib2/tables/16/4.4.table @@ -1,17 +1,17 @@ # Code table 4.4 - Indicator of unit of time range -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.5.table b/definitions/grib2/tables/16/4.5.table index 73c6eb7bf..8d4ae8d1a 100644 --- a/definitions/grib2/tables/16/4.5.table +++ b/definitions/grib2/tables/16/4.5.table @@ -1,5 +1,5 @@ # Code table 4.5 - Fixed surface types and units -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface (-) 2 2 Cloud base level (-) 3 3 Level of cloud tops (-) @@ -12,11 +12,11 @@ 10 10 Entire atmosphere (-) 11 11 Cumulonimbus (CB) base (m) 12 12 Cumulonimbus (CB) top (m) -# 13-19 Reserved +# 13-19 Reserved 20 20 Isothermal level (K) -# 21-99 Reserved +# 21-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -25,18 +25,18 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level (-) -112 112 Reserved -113 113 Logarithmic hybrid level +112 112 Reserved +113 113 Logarithmic hybrid level 114 114 Snow level (Numeric) -# 115-116 Reserved +# 115-116 Reserved 117 117 Mixed layer depth (m) 118 hhl Hybrid height level (-) 119 hpl Hybrid pressure level (-) -# 120-149 Reserved -150 150 Generalized vertical height coordinate -# 151-159 Reserved +# 120-149 Reserved +150 150 Generalized vertical height coordinate +# 151-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 sfc Lake or river bottom (-) @@ -45,18 +45,18 @@ 165 165 Bottom of sediment layer penetrated by thermal wave (-) 166 sfc Mixing layer (-) 167 167 Bottom of root zone (-) -# 168-173 Reserved -174 sfc Top surface of ice on sea, lake or river -175 175 Top surface of ice, under snow cover, on sea, lake or river -176 176 Bottom surface (underside) ice on sea, lake or river -177 sfc Deep soil (of indefinite depth) -178 178 Reserved -179 179 Top surface of glacier ice and inland ice -180 180 Deep inland or glacier ice (of indefinite depth) -181 181 Grid tile land fraction as a model surface -182 182 Grid tile water fraction as a model surface -183 183 Grid tile ice fraction on sea, lake or river as a model surface -184 184 Grid tile glacier ice and inland ice fraction as a model surface -# 185-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 168-173 Reserved +174 sfc Top surface of ice on sea, lake or river +175 175 Top surface of ice, under snow cover, on sea, lake or river +176 176 Bottom surface (underside) ice on sea, lake or river +177 sfc Deep soil (of indefinite depth) +178 178 Reserved +179 179 Top surface of glacier ice and inland ice +180 180 Deep inland or glacier ice (of indefinite depth) +181 181 Grid tile land fraction as a model surface +182 182 Grid tile water fraction as a model surface +183 183 Grid tile ice fraction on sea, lake or river as a model surface +184 184 Grid tile glacier ice and inland ice fraction as a model surface +# 185-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.6.table b/definitions/grib2/tables/16/4.6.table index b2dfeb498..ce799721d 100644 --- a/definitions/grib2/tables/16/4.6.table +++ b/definitions/grib2/tables/16/4.6.table @@ -1,9 +1,9 @@ # Code table 4.6 - Type of ensemble forecast -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.7.table b/definitions/grib2/tables/16/4.7.table index e0de0e1b2..69b2b4d77 100644 --- a/definitions/grib2/tables/16/4.7.table +++ b/definitions/grib2/tables/16/4.7.table @@ -1,14 +1,14 @@ # Code table 4.7 - Derived forecast -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.8.table b/definitions/grib2/tables/16/4.8.table index ad883039c..78467454a 100644 --- a/definitions/grib2/tables/16/4.8.table +++ b/definitions/grib2/tables/16/4.8.table @@ -1,6 +1,6 @@ # Code table 4.8 - Clustering method -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.9.table b/definitions/grib2/tables/16/4.9.table index 5878b5ad3..0ce312dd1 100644 --- a/definitions/grib2/tables/16/4.9.table +++ b/definitions/grib2/tables/16/4.9.table @@ -1,9 +1,9 @@ # Code table 4.9 - Probability type -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/4.91.table b/definitions/grib2/tables/16/4.91.table index 44cf25f44..ae31ed61c 100644 --- a/definitions/grib2/tables/16/4.91.table +++ b/definitions/grib2/tables/16/4.91.table @@ -1,16 +1,16 @@ # Code table 4.91 - Type of Interval -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit -11 11 Equal to first limit -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit +11 11 Equal to first limit +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/16/5.0.table b/definitions/grib2/tables/16/5.0.table index 5ec77ed0f..2795336df 100644 --- a/definitions/grib2/tables/16/5.0.table +++ b/definitions/grib2/tables/16/5.0.table @@ -1,23 +1,23 @@ # Code table 5.0 - Data representation template number -0 0 Grid point data - simple packing -1 1 Matrix value at grid point - simple packing -2 2 Grid point data - complex packing -3 3 Grid point data - complex packing and spatial differencing -4 4 Grid point data - IEEE floating point data -40 40 Grid point data - JPEG 2000 code stream format -41 41 Grid point data - Portable Network Graphics (PNG) -# 42-49 Reserved -50 50 Spectral data - simple packing -51 51 Spherical harmonics data - complex packing -# 52-60 Reserved -61 61 Grid point data - simple packing with logarithm pre-processing -# 62-199 Reserved -200 200 Run length packing with level values -# 201-49151 Reserved -# 49152-65534 Reserved for local use +0 0 Grid point data - simple packing +1 1 Matrix value at grid point - simple packing +2 2 Grid point data - complex packing +3 3 Grid point data - complex packing and spatial differencing +4 4 Grid point data - IEEE floating point data +40 40 Grid point data - JPEG 2000 code stream format +41 41 Grid point data - Portable Network Graphics (PNG) +# 42-49 Reserved +50 50 Spectral data - simple packing +51 51 Spherical harmonics data - complex packing +# 52-60 Reserved +61 61 Grid point data - simple packing with logarithm pre-processing +# 62-199 Reserved +200 200 Run length packing with level values +# 201-49151 Reserved +# 49152-65534 Reserved for local use 40000 40000 JPEG2000 Packing 40010 40010 PNG pacling 50000 50000 Sperical harmonics ieee packing 50001 50001 Second order packing 50002 50002 Second order packing -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/16/5.1.table b/definitions/grib2/tables/16/5.1.table index 854330c74..1189b5e46 100644 --- a/definitions/grib2/tables/16/5.1.table +++ b/definitions/grib2/tables/16/5.1.table @@ -1,6 +1,6 @@ # Code table 5.1 - Type of original field values -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/5.2.table b/definitions/grib2/tables/16/5.2.table index 40586a131..d77fdf4e7 100644 --- a/definitions/grib2/tables/16/5.2.table +++ b/definitions/grib2/tables/16/5.2.table @@ -1,8 +1,8 @@ # Code table 5.2 - Matrix coordinate value function definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/5.3.table b/definitions/grib2/tables/16/5.3.table index c3b7b30fe..481331791 100644 --- a/definitions/grib2/tables/16/5.3.table +++ b/definitions/grib2/tables/16/5.3.table @@ -1,7 +1,7 @@ # Code table 5.3 - Matrix coordinate parameter -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/5.4.table b/definitions/grib2/tables/16/5.4.table index 8121c1819..e84ab1901 100644 --- a/definitions/grib2/tables/16/5.4.table +++ b/definitions/grib2/tables/16/5.4.table @@ -1,6 +1,6 @@ # Code table 5.4 - Group splitting method -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/5.40.table b/definitions/grib2/tables/16/5.40.table index b9bad2c39..97e8880ab 100644 --- a/definitions/grib2/tables/16/5.40.table +++ b/definitions/grib2/tables/16/5.40.table @@ -1,5 +1,5 @@ # Code table 5.40 - Type of compression -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/16/5.5.table b/definitions/grib2/tables/16/5.5.table index 3ef3eb070..f2316975a 100644 --- a/definitions/grib2/tables/16/5.5.table +++ b/definitions/grib2/tables/16/5.5.table @@ -1,7 +1,7 @@ # Code table 5.5 - Missing value management for complex packing -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/5.6.table b/definitions/grib2/tables/16/5.6.table index 6d5177877..db68ead9c 100644 --- a/definitions/grib2/tables/16/5.6.table +++ b/definitions/grib2/tables/16/5.6.table @@ -1,7 +1,7 @@ # Code table 5.6 - Order of spatial differencing -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/16/5.7.table b/definitions/grib2/tables/16/5.7.table index 5ab780056..e54862c19 100644 --- a/definitions/grib2/tables/16/5.7.table +++ b/definitions/grib2/tables/16/5.7.table @@ -1,7 +1,7 @@ # Code table 5.7 - Precision of floating-point numbers -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/16/6.0.table b/definitions/grib2/tables/16/6.0.table index f539b26d7..a8f30f5a4 100644 --- a/definitions/grib2/tables/16/6.0.table +++ b/definitions/grib2/tables/16/6.0.table @@ -1,6 +1,6 @@ # Code table 6.0 - Bit map indicator 0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/17/0.0.table b/definitions/grib2/tables/17/0.0.table index b24c50564..2c5afceb4 100644 --- a/definitions/grib2/tables/17/0.0.table +++ b/definitions/grib2/tables/17/0.0.table @@ -1,10 +1,10 @@ # Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/1.0.table b/definitions/grib2/tables/17/1.0.table index d1134399b..893633977 100644 --- a/definitions/grib2/tables/17/1.0.table +++ b/definitions/grib2/tables/17/1.0.table @@ -1,22 +1,22 @@ # Code table 1.0 - GRIB master tables version number -0 0 Experimental -1 1 Version implemented on 7 November 2001 -2 2 Version implemented on 4 November 2003 -3 3 Version implemented on 2 November 2005 -4 4 Version implemented on 7 November 2007 -5 5 Version implemented on 4 November 2009 -6 6 Version implemented on 15 September 2010 -7 7 Version implemented on 4 May 2011 -8 8 Version implemented on 2 November 2011 -9 9 Version implemented on 2 May 2012 -10 10 Version implemented on 7 November 2012 -11 11 Version implemented on 8 May 2013 -12 12 Version implemented on 14 November 2013 -13 13 Version implemented on 7 May 2014 -14 14 Version implemented on 5 November 2014 -15 15 Version implemented on 6 May 2015 -16 16 Version implemented on 11 November 2015 +0 0 Experimental +1 1 Version implemented on 7 November 2001 +2 2 Version implemented on 4 November 2003 +3 3 Version implemented on 2 November 2005 +4 4 Version implemented on 7 November 2007 +5 5 Version implemented on 4 November 2009 +6 6 Version implemented on 15 September 2010 +7 7 Version implemented on 4 May 2011 +8 8 Version implemented on 2 November 2011 +9 9 Version implemented on 2 May 2012 +10 10 Version implemented on 7 November 2012 +11 11 Version implemented on 8 May 2013 +12 12 Version implemented on 14 November 2013 +13 13 Version implemented on 7 May 2014 +14 14 Version implemented on 5 November 2014 +15 15 Version implemented on 6 May 2015 +16 16 Version implemented on 11 November 2015 17 17 Version implemented on 4 May 2016 18 18 Pre-operational to be implemented by next amendment -# 19-254 Future versions -255 255 Missing +# 19-254 Future versions +255 255 Missing diff --git a/definitions/grib2/tables/17/1.1.table b/definitions/grib2/tables/17/1.1.table index d50f8fd72..f6d332005 100644 --- a/definitions/grib2/tables/17/1.1.table +++ b/definitions/grib2/tables/17/1.1.table @@ -1,4 +1,4 @@ # Code table 1.1 - GRIB local tables version number -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/17/1.2.table b/definitions/grib2/tables/17/1.2.table index 934b70455..638f1efbb 100644 --- a/definitions/grib2/tables/17/1.2.table +++ b/definitions/grib2/tables/17/1.2.table @@ -1,8 +1,8 @@ # Code table 1.2 - Significance of reference time -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/1.3.table b/definitions/grib2/tables/17/1.3.table index 0c95269d5..c1a9a7b9d 100644 --- a/definitions/grib2/tables/17/1.3.table +++ b/definitions/grib2/tables/17/1.3.table @@ -1,14 +1,14 @@ # Code table 1.3 - Production status of data -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products -4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products +4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) 5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) -6 6 S2S operational products -7 7 S2S test products +6 6 S2S operational products +7 7 S2S test products 8 8 Uncertainties in Ensembles of Regional ReAnalyses project (UERRA) 9 9 Uncertainties in Ensembles of Regional ReAnalyses project test (UERRA) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/1.4.table b/definitions/grib2/tables/17/1.4.table index 03203d874..877288c0e 100644 --- a/definitions/grib2/tables/17/1.4.table +++ b/definitions/grib2/tables/17/1.4.table @@ -1,13 +1,13 @@ # Code table 1.4 - Type of data -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/17/1.5.table b/definitions/grib2/tables/17/1.5.table index b2cf9f087..533111959 100644 --- a/definitions/grib2/tables/17/1.5.table +++ b/definitions/grib2/tables/17/1.5.table @@ -1,7 +1,7 @@ # Code table 1.5 - Identification template number -0 0 Calendar definition -1 1 Paleontological offset -2 2 Calendar definition and paleontological offset -# 3-32767 Reserved -# 32768-65534 Reserved for local use -65535 65535 Missing +0 0 Calendar definition +1 1 Paleontological offset +2 2 Calendar definition and paleontological offset +# 3-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/17/1.6.table b/definitions/grib2/tables/17/1.6.table index 5db921990..bd46899a7 100644 --- a/definitions/grib2/tables/17/1.6.table +++ b/definitions/grib2/tables/17/1.6.table @@ -1,8 +1,8 @@ # Code table 1.6 - Type of calendar -0 0 Gregorian -1 1 360-day -2 2 365-day -3 3 Proleptic Gregorian -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Gregorian +1 1 360-day +2 2 365-day +3 3 Proleptic Gregorian +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/3.0.table b/definitions/grib2/tables/17/3.0.table index 45187b80d..a442a06a0 100644 --- a/definitions/grib2/tables/17/3.0.table +++ b/definitions/grib2/tables/17/3.0.table @@ -1,6 +1,6 @@ # Code table 3.0 - Source of grid definition -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/17/3.10.table b/definitions/grib2/tables/17/3.10.table index afa8843a7..1612d05e3 100644 --- a/definitions/grib2/tables/17/3.10.table +++ b/definitions/grib2/tables/17/3.10.table @@ -1,8 +1,8 @@ # Flag table 3.10 - Scanning mode for one diamond -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/17/3.11.table b/definitions/grib2/tables/17/3.11.table index e516a2ab9..06ae10810 100644 --- a/definitions/grib2/tables/17/3.11.table +++ b/definitions/grib2/tables/17/3.11.table @@ -1,7 +1,7 @@ # Code table 3.11 - Interpretation of list of numbers at end of section 3 -0 0 There is no appended list -1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows -2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row -3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) -# 4-254 Reserved -255 255 Missing +0 0 There is no appended list +1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows +2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row +3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/17/3.15.table b/definitions/grib2/tables/17/3.15.table index 331217ebe..6087902a3 100644 --- a/definitions/grib2/tables/17/3.15.table +++ b/definitions/grib2/tables/17/3.15.table @@ -1,23 +1,23 @@ # Code table 3.15 - Physical meaning of vertical coordinate -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) -113 113 Logarithmic hybrid coordinate -# 114-159 Reserved +113 113 Logarithmic hybrid coordinate +# 114-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/3.2.table b/definitions/grib2/tables/17/3.2.table index 9238dc2a7..b9574a424 100644 --- a/definitions/grib2/tables/17/3.2.table +++ b/definitions/grib2/tables/17/3.2.table @@ -1,14 +1,14 @@ # Code table 3.2 - Shape of the Earth -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame -9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame +9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/3.20.table b/definitions/grib2/tables/17/3.20.table index efbf08d19..e2bb156ee 100644 --- a/definitions/grib2/tables/17/3.20.table +++ b/definitions/grib2/tables/17/3.20.table @@ -1,6 +1,6 @@ # Code table 3.20 - Type of horizontal line -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/3.21.table b/definitions/grib2/tables/17/3.21.table index 88dbb9019..e001e1c8f 100644 --- a/definitions/grib2/tables/17/3.21.table +++ b/definitions/grib2/tables/17/3.21.table @@ -1,8 +1,8 @@ # Code table 3.21 - Vertical dimension coordinate values definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/3.3.table b/definitions/grib2/tables/17/3.3.table index 5dd7c7001..25cb46a1d 100644 --- a/definitions/grib2/tables/17/3.3.table +++ b/definitions/grib2/tables/17/3.3.table @@ -1,9 +1,9 @@ # Flag table 3.3 - Resolution and component flags -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/17/3.4.table b/definitions/grib2/tables/17/3.4.table index 897b813d7..43835c014 100644 --- a/definitions/grib2/tables/17/3.4.table +++ b/definitions/grib2/tables/17/3.4.table @@ -1,17 +1,17 @@ # Flag table 3.4 - Scanning mode -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -5 0 Points within odd rows are not offset in i (x) direction -5 1 Points within odd rows are offset by Di/2 in i (x) direction -6 0 Points within even rows are not offset in i (x) direction -6 1 Points within even rows are offset by Di/2 in i (x) direction -7 0 Points are not offset in j (y) direction -7 1 Points are offset by Dj/2 in j (y) direction -8 0 Rows have Ni grid points and columns have Nj grid points -8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +5 0 Points within odd rows are not offset in i (x) direction +5 1 Points within odd rows are offset by Di/2 in i (x) direction +6 0 Points within even rows are not offset in i (x) direction +6 1 Points within even rows are offset by Di/2 in i (x) direction +7 0 Points are not offset in j (y) direction +7 1 Points are offset by Dj/2 in j (y) direction +8 0 Rows have Ni grid points and columns have Nj grid points +8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction diff --git a/definitions/grib2/tables/17/3.5.table b/definitions/grib2/tables/17/3.5.table index eabdde896..2f8ec82e3 100644 --- a/definitions/grib2/tables/17/3.5.table +++ b/definitions/grib2/tables/17/3.5.table @@ -1,5 +1,5 @@ # Flag table 3.5 - Projection centre -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/17/3.7.table b/definitions/grib2/tables/17/3.7.table index 0a7d6efde..34c0de085 100644 --- a/definitions/grib2/tables/17/3.7.table +++ b/definitions/grib2/tables/17/3.7.table @@ -1,5 +1,5 @@ # Code table 3.7 - Spectral data representation mode -0 0 Reserved +0 0 Reserved 1 1 see separate doc or pdf file -# 2-254 Reserved -255 255 Missing +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/17/3.8.table b/definitions/grib2/tables/17/3.8.table index 844e74235..578fab37f 100644 --- a/definitions/grib2/tables/17/3.8.table +++ b/definitions/grib2/tables/17/3.8.table @@ -1,7 +1,7 @@ # Code table 3.8 - Grid point position -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/3.9.table b/definitions/grib2/tables/17/3.9.table index fd730bc64..ecd65514a 100644 --- a/definitions/grib2/tables/17/3.9.table +++ b/definitions/grib2/tables/17/3.9.table @@ -1,4 +1,4 @@ # Flag table 3.9 - Numbering order of diamonds as seen from the corresponding pole -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/17/4.0.table b/definitions/grib2/tables/17/4.0.table index 802eca6bf..ff8a54b04 100644 --- a/definitions/grib2/tables/17/4.0.table +++ b/definitions/grib2/tables/17/4.0.table @@ -1,65 +1,65 @@ # Code table 4.0 - Product definition template number -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time -8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -# 35-39 Reserved +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 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 +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +# 35-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -42 42 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 atmospheric chemical constituents -43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol -46 46 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 aerosol +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 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 atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 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 aerosol 47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol -48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -# 49-50 Reserved -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time -52 52 Reserved -53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time -54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters -55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time -56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters -57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function -# 58-59 Reserved -60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval -# 62-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +# 49-50 Reserved +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +52 52 Reserved +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time +56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters +57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +# 58-59 Reserved +60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +# 62-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved -# 32768-65534 Reserved for local use +# 1102-32767 Reserved +# 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/17/4.1.0.table b/definitions/grib2/tables/17/4.1.0.table index 04cfd7802..df58636d6 100644 --- a/definitions/grib2/tables/17/4.1.0.table +++ b/definitions/grib2/tables/17/4.1.0.table @@ -1,27 +1,27 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.1.1.table b/definitions/grib2/tables/17/4.1.1.table index 7b22b6fed..05a854da0 100644 --- a/definitions/grib2/tables/17/4.1.1.table +++ b/definitions/grib2/tables/17/4.1.1.table @@ -1,7 +1,7 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.1.10.table b/definitions/grib2/tables/17/4.1.10.table index a9b20eb9c..88d3c8743 100644 --- a/definitions/grib2/tables/17/4.1.10.table +++ b/definitions/grib2/tables/17/4.1.10.table @@ -1,10 +1,10 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Subsurface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Subsurface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.1.2.table b/definitions/grib2/tables/17/4.1.2.table index 5b488fe9e..e74126645 100644 --- a/definitions/grib2/tables/17/4.1.2.table +++ b/definitions/grib2/tables/17/4.1.2.table @@ -1,9 +1,9 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.1.3.table b/definitions/grib2/tables/17/4.1.3.table index 7bf60d4a7..ba38c9301 100644 --- a/definitions/grib2/tables/17/4.1.3.table +++ b/definitions/grib2/tables/17/4.1.3.table @@ -1,11 +1,11 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Image format products -1 1 Quantitative products -2 2 Cloud properties -3 3 Flight rule conditions -4 4 Volcanic ash -5 5 Sea-surface temperature -6 6 Solar radiation -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +2 2 Cloud properties +3 3 Flight rule conditions +4 4 Volcanic ash +5 5 Sea-surface temperature +6 6 Solar radiation +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.10.table b/definitions/grib2/tables/17/4.10.table index 1a92baaf6..8a390e4be 100644 --- a/definitions/grib2/tables/17/4.10.table +++ b/definitions/grib2/tables/17/4.10.table @@ -1,16 +1,16 @@ # Code table 4.10 - Type of statistical processing -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -11 11 Summation -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/17/4.11.table b/definitions/grib2/tables/17/4.11.table index 7f404c849..01cc81303 100644 --- a/definitions/grib2/tables/17/4.11.table +++ b/definitions/grib2/tables/17/4.11.table @@ -1,10 +1,10 @@ # Code table 4.11 - Type of time intervals -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.12.table b/definitions/grib2/tables/17/4.12.table index 03fd89b36..d42b47e96 100644 --- a/definitions/grib2/tables/17/4.12.table +++ b/definitions/grib2/tables/17/4.12.table @@ -1,7 +1,7 @@ # Code table 4.12 - Operating mode -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.13.table b/definitions/grib2/tables/17/4.13.table index c92854eec..a0e28eac8 100644 --- a/definitions/grib2/tables/17/4.13.table +++ b/definitions/grib2/tables/17/4.13.table @@ -1,6 +1,6 @@ # Code table 4.13 - Quality control indicator -0 0 No quality control applied -1 1 Quality control applied -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.14.table b/definitions/grib2/tables/17/4.14.table index a88cb93fa..d525b23b3 100644 --- a/definitions/grib2/tables/17/4.14.table +++ b/definitions/grib2/tables/17/4.14.table @@ -1,6 +1,6 @@ # Code table 4.14 - Clutter filter indicator -0 0 No clutter filter used -1 1 Clutter filter used -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.15.table b/definitions/grib2/tables/17/4.15.table index 2e5f3dea3..7adddedb6 100644 --- a/definitions/grib2/tables/17/4.15.table +++ b/definitions/grib2/tables/17/4.15.table @@ -1,11 +1,11 @@ # Code table 4.15 - Type of spatial processing used to arrive at given data value from the source data -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.0.table b/definitions/grib2/tables/17/4.2.0.0.table index f24b8832c..4e2cf578e 100644 --- a/definitions/grib2/tables/17/4.2.0.0.table +++ b/definitions/grib2/tables/17/4.2.0.0.table @@ -27,6 +27,6 @@ 25 25 Temperature tendency due to long-wave radiation, clear sky (K s-1) 26 26 Temperature tendency due to parameterization (K s-1) 27 27 Wet-bulb temperature (K) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.1.table b/definitions/grib2/tables/17/4.2.0.1.table index 70001f746..004d11d25 100644 --- a/definitions/grib2/tables/17/4.2.0.1.table +++ b/definitions/grib2/tables/17/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,7 +86,7 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rainwater content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) @@ -115,6 +115,6 @@ 115 115 Mass density of liquid water coating on snow expressed as mass of liquid water per unit volume of air (kg m-3) 116 116 Specific mass of liquid water coating on snow expressed as mass of liquid water per unit mass of moist air (kg kg-1) 117 117 Mass mixing ratio of liquid water coating on snow expressed as mass of liquid water per unit mass of dry air (kg kg-1) -# 118-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 118-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.13.table b/definitions/grib2/tables/17/4.2.0.13.table index 5086101ad..3f5c30675 100644 --- a/definitions/grib2/tables/17/4.2.0.13.table +++ b/definitions/grib2/tables/17/4.2.0.13.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.14.table b/definitions/grib2/tables/17/4.2.0.14.table index 215884737..97fb38c8b 100644 --- a/definitions/grib2/tables/17/4.2.0.14.table +++ b/definitions/grib2/tables/17/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.15.table b/definitions/grib2/tables/17/4.2.0.15.table index dfbc4d12f..8df082466 100644 --- a/definitions/grib2/tables/17/4.2.0.15.table +++ b/definitions/grib2/tables/17/4.2.0.15.table @@ -16,6 +16,6 @@ 14 14 Reflectivity of hail (dB) 15 15 Hybrid scan reflectivity (dB) 16 16 Hybrid scan reflectivity height (m) -# 17-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.16.table b/definitions/grib2/tables/17/4.2.0.16.table index 0c240a853..9499d9333 100644 --- a/definitions/grib2/tables/17/4.2.0.16.table +++ b/definitions/grib2/tables/17/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.18.table b/definitions/grib2/tables/17/4.2.0.18.table index 9ae3539ca..16cfa489d 100644 --- a/definitions/grib2/tables/17/4.2.0.18.table +++ b/definitions/grib2/tables/17/4.2.0.18.table @@ -8,7 +8,7 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) @@ -16,6 +16,6 @@ 14 14 Specific activity concentration (Bq kg-1) 15 15 Maximum of air concentration in layer (Bq m-3) 16 16 Height of maximum air concentration (m) -# 17-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.19.table b/definitions/grib2/tables/17/4.2.0.19.table index 8705082c5..e4db36249 100644 --- a/definitions/grib2/tables/17/4.2.0.19.table +++ b/definitions/grib2/tables/17/4.2.0.19.table @@ -31,6 +31,6 @@ 29 29 Clear air turbulence (CAT) (m2/3 s-1) 30 30 Eddy dissipation parameter (m2/3 s-1) 31 31 Maximum of Eddy dissipation parameter in layer (m2/3 s-1) -# 32-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 32-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.190.table b/definitions/grib2/tables/17/4.2.0.190.table index de621a924..a0d6ba0ac 100644 --- a/definitions/grib2/tables/17/4.2.0.190.table +++ b/definitions/grib2/tables/17/4.2.0.190.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.191.table b/definitions/grib2/tables/17/4.2.0.191.table index e3bba0ebe..b3a7092ea 100644 --- a/definitions/grib2/tables/17/4.2.0.191.table +++ b/definitions/grib2/tables/17/4.2.0.191.table @@ -3,6 +3,6 @@ 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.2.table b/definitions/grib2/tables/17/4.2.0.2.table index 8ebc75124..7967bf7bf 100644 --- a/definitions/grib2/tables/17/4.2.0.2.table +++ b/definitions/grib2/tables/17/4.2.0.2.table @@ -44,6 +44,6 @@ 42 42 v-component of geostrophic wind (m s-1) 43 43 Geostrophic wind direction (degree true) 44 44 Geostrophic wind speed (m s-1) -# 45-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 45-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.20.table b/definitions/grib2/tables/17/4.2.0.20.table index 983539bd2..38479b834 100644 --- a/definitions/grib2/tables/17/4.2.0.20.table +++ b/definitions/grib2/tables/17/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -28,7 +28,7 @@ 60 60 Aerosol specific number concentration (kg-1) 61 61 Maximum of mass density in layer (kg m-3) 62 62 Height of maximum mass density (m) -# 63-99 Reserved +# 63-99 Reserved 100 100 Surface area density (aerosol) (/m) 101 101 Vertical visual range (m) 102 102 Aerosol optical thickness (Numeric) @@ -41,6 +41,6 @@ 109 109 Aerosol lidar extinction from satellite (/m) 110 110 Aerosol lidar extinction from the ground (/m) 111 111 Angstrom exponent (Numeric) -# 112-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 112-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.3.table b/definitions/grib2/tables/17/4.2.0.3.table index c7c6359d4..17e7f204f 100644 --- a/definitions/grib2/tables/17/4.2.0.3.table +++ b/definitions/grib2/tables/17/4.2.0.3.table @@ -30,6 +30,6 @@ 28 28 Downdraught mass flux (kg m-2 s-1) 29 29 Updraught detrainment rate (kg m-3 s-1) 30 30 Downdraught detrainment rate (kg m-3 s-1) -# 31-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 31-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.4.table b/definitions/grib2/tables/17/4.2.0.4.table index 0a5ded2b5..f97270456 100644 --- a/definitions/grib2/tables/17/4.2.0.4.table +++ b/definitions/grib2/tables/17/4.2.0.4.table @@ -14,11 +14,11 @@ 12 12 Downward UV radiation (W m-2) 13 13 Direct short-wave radiation flux (W m-2) 14 14 Diffuse short-wave radiation flux (W m-2) -# 15-49 Reserved +# 15-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) 52 52 Downward short-wave radiation flux, clear sky (W m-2) 53 53 Upward short-wave radiation flux, clear sky (W m-2) -# 54-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 54-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.5.table b/definitions/grib2/tables/17/4.2.0.5.table index 4550220b6..ddfa634ce 100644 --- a/definitions/grib2/tables/17/4.2.0.5.table +++ b/definitions/grib2/tables/17/4.2.0.5.table @@ -8,6 +8,6 @@ 6 6 Net long-wave radiation flux, clear sky (W m-2) 7 7 Brightness temperature (K) 8 8 Downward long-wave radiation flux, clear sky (W m-2) -# 9-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 9-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.6.table b/definitions/grib2/tables/17/4.2.0.6.table index 4cec0c8aa..0450ec194 100644 --- a/definitions/grib2/tables/17/4.2.0.6.table +++ b/definitions/grib2/tables/17/4.2.0.6.table @@ -40,10 +40,10 @@ 38 38 Mass density of cloud droplets (kg m-3) 39 39 Mass density of cloud ice (kg m-3) 40 40 Mass density of convective cloud water droplets (kg m-3) -# 41-46 Reserved +# 41-46 Reserved 47 47 Volume fraction of cloud water droplets (Numeric) 48 48 Volume fraction of cloud ice particles (Numeric) 49 49 Volume fraction of cloud (ice and/or water) (Numeric) -# 50-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 50-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.0.7.table b/definitions/grib2/tables/17/4.2.0.7.table index 6d0d87a46..3e653431f 100644 --- a/definitions/grib2/tables/17/4.2.0.7.table +++ b/definitions/grib2/tables/17/4.2.0.7.table @@ -13,11 +13,11 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraught helicity (m2 s-2) 16 16 Bulk Richardson number (Numeric) 17 17 Gradient Richardson number (Numeric) 18 18 Flux Richardson number (Numeric) -# 19-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 19-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.1.0.table b/definitions/grib2/tables/17/4.2.1.0.table index bcd849c2e..a2660f4f3 100644 --- a/definitions/grib2/tables/17/4.2.1.0.table +++ b/definitions/grib2/tables/17/4.2.1.0.table @@ -16,6 +16,6 @@ 14 14 Upstream accumulated precipitation (kg m-2) 15 15 Upstream accumulated snow melt (kg m-2) 16 16 Percolation rate (kg m-2 s-1) -# 17-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.1.1.table b/definitions/grib2/tables/17/4.2.1.1.table index b488eb0bd..171da3958 100644 --- a/definitions/grib2/tables/17/4.2.1.1.table +++ b/definitions/grib2/tables/17/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.10.0.table b/definitions/grib2/tables/17/4.2.10.0.table index 095f51bdf..3611abd9a 100644 --- a/definitions/grib2/tables/17/4.2.10.0.table +++ b/definitions/grib2/tables/17/4.2.10.0.table @@ -45,6 +45,6 @@ 43 43 Kurtosis of the sea-surface elevation due to waves (-) 44 44 Benjamin-Feir index (-) 45 45 Spectral peakedness factor (/s) -# 46-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 46-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.10.1.table b/definitions/grib2/tables/17/4.2.10.1.table index 5959bfa28..f0a073c00 100644 --- a/definitions/grib2/tables/17/4.2.10.1.table +++ b/definitions/grib2/tables/17/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.10.191.table b/definitions/grib2/tables/17/4.2.10.191.table index 524929e78..1ebf85006 100644 --- a/definitions/grib2/tables/17/4.2.10.191.table +++ b/definitions/grib2/tables/17/4.2.10.191.table @@ -1,8 +1,8 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Meridional overturning stream function (m3/s) -2 2 Reserved +2 2 Reserved 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.10.2.table b/definitions/grib2/tables/17/4.2.10.2.table index 6797062ac..4633bad4f 100644 --- a/definitions/grib2/tables/17/4.2.10.2.table +++ b/definitions/grib2/tables/17/4.2.10.2.table @@ -12,6 +12,6 @@ 10 10 Zonal vector component of vertically integrated ice internal pressure (Pa m) 11 11 Meridional vector component of vertically integrated ice internal pressure (Pa m) 12 12 Compressive ice strength (N/m) -# 13-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 13-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.10.3.table b/definitions/grib2/tables/17/4.2.10.3.table index f951bbe78..937720c93 100644 --- a/definitions/grib2/tables/17/4.2.10.3.table +++ b/definitions/grib2/tables/17/4.2.10.3.table @@ -1,6 +1,6 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.10.4.table b/definitions/grib2/tables/17/4.2.10.4.table index 54774f1b7..d5615ae26 100644 --- a/definitions/grib2/tables/17/4.2.10.4.table +++ b/definitions/grib2/tables/17/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2/s) 6 6 Ocean vertical momentum diffusivity (m2/s) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (/m) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.2.0.table b/definitions/grib2/tables/17/4.2.2.0.table index 81548840c..b253cac22 100644 --- a/definitions/grib2/tables/17/4.2.2.0.table +++ b/definitions/grib2/tables/17/4.2.2.0.table @@ -38,6 +38,6 @@ 36 36 Tile fraction (Proportion) 37 37 Tile percentage (%) 38 38 Soil volumetric ice content (water equivalent) (m3 m-3) -# 39-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 39-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.2.3.table b/definitions/grib2/tables/17/4.2.2.3.table index 690fab42b..2674e9f42 100644 --- a/definitions/grib2/tables/17/4.2.2.3.table +++ b/definitions/grib2/tables/17/4.2.2.3.table @@ -27,6 +27,6 @@ 25 25 Snow depth at elevation bands (kg m-2) 26 26 Soil heat flux (W m-2) 27 27 Soil depth (m) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.2.4.table b/definitions/grib2/tables/17/4.2.2.4.table index bb54fac22..ceb761557 100644 --- a/definitions/grib2/tables/17/4.2.2.4.table +++ b/definitions/grib2/tables/17/4.2.2.4.table @@ -11,6 +11,6 @@ 9 9 Initial Fire Spread Index (Canadian Forest Service) (Numeric) 10 10 Fire Buildup Index (Canadian Forest Service) (Numeric) 11 11 Fire Daily Severity Rating (Canadian Forest Service) (Numeric) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.3.0.table b/definitions/grib2/tables/17/4.2.3.0.table index c0ffa29f5..80a829673 100644 --- a/definitions/grib2/tables/17/4.2.3.0.table +++ b/definitions/grib2/tables/17/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.2.3.1.table b/definitions/grib2/tables/17/4.2.3.1.table index 8e0793fe0..04cdde1f1 100644 --- a/definitions/grib2/tables/17/4.2.3.1.table +++ b/definitions/grib2/tables/17/4.2.3.1.table @@ -17,16 +17,16 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) 20 20 Aerosol optical thickness at 0.635 um 21 21 Aerosol optical thickness at 0.810 um 22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-26 Reserved +23 23 Angstrom coefficient +# 24-26 Reserved 27 27 Bidirectional reflectance factor (Numeric) 28 28 Brightness temperature (K) 29 29 Scaled radiance (Numeric) -# 30-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 30-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.201.table b/definitions/grib2/tables/17/4.201.table index 47f1b486f..fa173c4e0 100644 --- a/definitions/grib2/tables/17/4.201.table +++ b/definitions/grib2/tables/17/4.201.table @@ -1,15 +1,15 @@ # Code table 4.201 - Precipitation type -0 0 Reserved -1 1 Rain -2 2 Thunderstorm -3 3 Freezing rain -4 4 Mixed/ice -5 5 Snow -6 6 Wet snow -7 7 Mixture of rain and snow -8 8 Ice pellets -9 9 Graupel -10 10 Hail -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow +6 6 Wet snow +7 7 Mixture of rain and snow +8 8 Ice pellets +9 9 Graupel +10 10 Hail +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.202.table b/definitions/grib2/tables/17/4.202.table index 438502ff9..7f3c8f6cf 100644 --- a/definitions/grib2/tables/17/4.202.table +++ b/definitions/grib2/tables/17/4.202.table @@ -1,4 +1,4 @@ # Code table 4.202 - Precipitable water category -# 0-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.203.table b/definitions/grib2/tables/17/4.203.table index 8a9aedf7a..cf5eb6bdc 100644 --- a/definitions/grib2/tables/17/4.203.table +++ b/definitions/grib2/tables/17/4.203.table @@ -1,26 +1,26 @@ # Code table 4.203 - Cloud type -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.204.table b/definitions/grib2/tables/17/4.204.table index 481372936..8e0be1f8c 100644 --- a/definitions/grib2/tables/17/4.204.table +++ b/definitions/grib2/tables/17/4.204.table @@ -1,9 +1,9 @@ # Code table 4.204 - Thunderstorm coverage -0 0 None -1 1 Isolated (1-2%) -2 2 Few (3-5%) -3 3 Scattered (6-45%) -4 4 Numerous (> 45%) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (6-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.205.table b/definitions/grib2/tables/17/4.205.table index 5b4484dfd..c40c7f47b 100644 --- a/definitions/grib2/tables/17/4.205.table +++ b/definitions/grib2/tables/17/4.205.table @@ -1,6 +1,6 @@ # Code table 4.205 - Presence of aerosol -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.206.table b/definitions/grib2/tables/17/4.206.table index 02c3dfdf9..76472c261 100644 --- a/definitions/grib2/tables/17/4.206.table +++ b/definitions/grib2/tables/17/4.206.table @@ -1,6 +1,6 @@ # Code table 4.206 - Volcanic ash -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.207.table b/definitions/grib2/tables/17/4.207.table index 8ddb2e048..b6392fca0 100644 --- a/definitions/grib2/tables/17/4.207.table +++ b/definitions/grib2/tables/17/4.207.table @@ -1,10 +1,10 @@ # Code table 4.207 - Icing -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.208.table b/definitions/grib2/tables/17/4.208.table index b83685a1a..4361d38c0 100644 --- a/definitions/grib2/tables/17/4.208.table +++ b/definitions/grib2/tables/17/4.208.table @@ -1,9 +1,9 @@ # Code table 4.208 - Turbulence -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.209.table b/definitions/grib2/tables/17/4.209.table index cb7617071..39ea549ac 100644 --- a/definitions/grib2/tables/17/4.209.table +++ b/definitions/grib2/tables/17/4.209.table @@ -1,9 +1,9 @@ # Code table 4.209 - Planetary boundary-layer regime -0 0 Reserved -1 1 Stable -2 2 Mechanically driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.210.table b/definitions/grib2/tables/17/4.210.table index c01f4bcca..791878469 100644 --- a/definitions/grib2/tables/17/4.210.table +++ b/definitions/grib2/tables/17/4.210.table @@ -1,6 +1,6 @@ # Code table 4.210 - Contrail intensity 0 0 Contrail not present 1 1 Contrail present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.211.table b/definitions/grib2/tables/17/4.211.table index 098eb2d43..2a28a84d9 100644 --- a/definitions/grib2/tables/17/4.211.table +++ b/definitions/grib2/tables/17/4.211.table @@ -1,7 +1,7 @@ # Code table 4.211 - Contrail engine type -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.212.table b/definitions/grib2/tables/17/4.212.table index 1a085b88d..6a3dcf88c 100644 --- a/definitions/grib2/tables/17/4.212.table +++ b/definitions/grib2/tables/17/4.212.table @@ -1,18 +1,18 @@ # Code table 4.212 - Land use -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.213.table b/definitions/grib2/tables/17/4.213.table index c65784a00..68d627af6 100644 --- a/definitions/grib2/tables/17/4.213.table +++ b/definitions/grib2/tables/17/4.213.table @@ -1,16 +1,16 @@ # Code table 4.213 - Soil type -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.215.table b/definitions/grib2/tables/17/4.215.table index 034db72be..7888772d5 100644 --- a/definitions/grib2/tables/17/4.215.table +++ b/definitions/grib2/tables/17/4.215.table @@ -1,9 +1,9 @@ # Code table 4.215 - Remotely sensed snow coverage -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.216.table b/definitions/grib2/tables/17/4.216.table index 5d1460cef..b51b358f4 100644 --- a/definitions/grib2/tables/17/4.216.table +++ b/definitions/grib2/tables/17/4.216.table @@ -1,5 +1,5 @@ # Code table 4.216 - Elevation of snow-covered terrain -# 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 0-90 Elevation in increments of 100 m +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/17/4.217.table b/definitions/grib2/tables/17/4.217.table index a4452182c..a700410d5 100644 --- a/definitions/grib2/tables/17/4.217.table +++ b/definitions/grib2/tables/17/4.217.table @@ -1,8 +1,8 @@ # Code table 4.217 - Cloud mask type -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.218.table b/definitions/grib2/tables/17/4.218.table index 7e3a69578..b5b15150b 100644 --- a/definitions/grib2/tables/17/4.218.table +++ b/definitions/grib2/tables/17/4.218.table @@ -1,44 +1,44 @@ # Code table 4.218 - Pixel scene type -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation/crops -15 15 Permanent snow/ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -19 19 Warm liquid water cloud -20 20 Supercooled liquid water cloud -21 21 Mixed-phase cloud -22 22 Optically thin ice cloud -23 23 Optically thick ice cloud -24 24 Multilayered cloud -# 25-96 Reserved -97 97 Snow/ice on land -98 98 Snow/ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud/fog/Stratus -102 102 Low cloud/Stratocumulus -103 103 Low cloud/unknown type -104 104 Medium cloud/Nimbostratus -105 105 Medium cloud/Altostratus -106 106 Medium cloud/unknown type -107 107 High cloud/Cumulus -108 108 High cloud/Cirrus -109 109 High cloud/unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation/crops +15 15 Permanent snow/ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +19 19 Warm liquid water cloud +20 20 Supercooled liquid water cloud +21 21 Mixed-phase cloud +22 22 Optically thin ice cloud +23 23 Optically thick ice cloud +24 24 Multilayered cloud +# 25-96 Reserved +97 97 Snow/ice on land +98 98 Snow/ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud/fog/Stratus +102 102 Low cloud/Stratocumulus +103 103 Low cloud/unknown type +104 104 Medium cloud/Nimbostratus +105 105 Medium cloud/Altostratus +106 106 Medium cloud/unknown type +107 107 High cloud/Cumulus +108 108 High cloud/Cirrus +109 109 High cloud/unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.219.table b/definitions/grib2/tables/17/4.219.table index 86df0522e..9979f50ad 100644 --- a/definitions/grib2/tables/17/4.219.table +++ b/definitions/grib2/tables/17/4.219.table @@ -1,8 +1,8 @@ # Code table 4.219 - Cloud top height quality indicator -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.220.table b/definitions/grib2/tables/17/4.220.table index 93e841f8b..88e869e42 100644 --- a/definitions/grib2/tables/17/4.220.table +++ b/definitions/grib2/tables/17/4.220.table @@ -1,6 +1,6 @@ # Code table 4.220 - Horizontal dimension processed -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.221.table b/definitions/grib2/tables/17/4.221.table index 8448533d7..011cc3518 100644 --- a/definitions/grib2/tables/17/4.221.table +++ b/definitions/grib2/tables/17/4.221.table @@ -1,6 +1,6 @@ # Code table 4.221 - Treatment of missing data -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.222.table b/definitions/grib2/tables/17/4.222.table index 57f113014..558d947ac 100644 --- a/definitions/grib2/tables/17/4.222.table +++ b/definitions/grib2/tables/17/4.222.table @@ -1,6 +1,6 @@ # Code table 4.222 - Categorical result -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.223.table b/definitions/grib2/tables/17/4.223.table index f0deb076a..572c4e7a8 100644 --- a/definitions/grib2/tables/17/4.223.table +++ b/definitions/grib2/tables/17/4.223.table @@ -1,5 +1,5 @@ # Code table 4.223 - Fire detection indicator -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing diff --git a/definitions/grib2/tables/17/4.224.table b/definitions/grib2/tables/17/4.224.table index e87cde4bb..014f56e23 100644 --- a/definitions/grib2/tables/17/4.224.table +++ b/definitions/grib2/tables/17/4.224.table @@ -1,18 +1,18 @@ # Code table 4.224 - Categorical outlook -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/17/4.227.table b/definitions/grib2/tables/17/4.227.table index 27c76553d..48c3b7633 100644 --- a/definitions/grib2/tables/17/4.227.table +++ b/definitions/grib2/tables/17/4.227.table @@ -1,9 +1,9 @@ # Code table 4.227 - Icing scenario (weather/cloud classification) -0 0 None -1 1 General -2 2 Convective -3 3 Stratiform -4 4 Freezing -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 None +1 1 General +2 2 Convective +3 3 Stratiform +4 4 Freezing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/17/4.234.table b/definitions/grib2/tables/17/4.234.table index 816541ce9..3b05b4515 100644 --- a/definitions/grib2/tables/17/4.234.table +++ b/definitions/grib2/tables/17/4.234.table @@ -1,21 +1,21 @@ # Code table 4.234 - Canopy cover fraction (to be used as partitioned parameter in product definition template 4.53 or 4.54) -1 1 Crops, mixed farming -2 2 Short grass -3 3 Evergreen needleleaf trees -4 4 Deciduous needleleaf trees -5 5 Deciduous broadleaf trees -6 6 Evergreen broadleaf trees -7 7 Tall grass -8 8 Desert -9 9 Tundra -10 10 Irrigated crops -11 11 Semidesert -12 12 Ice caps and glaciers -13 13 Bogs and marshes -14 14 Inland water -15 15 Ocean -16 16 Evergreen shrubs -17 17 Deciduous shrubs -18 18 Mixed forest -19 19 Interrupted forest -20 20 Water and land mixtures +1 1 Crops, mixed farming +2 2 Short grass +3 3 Evergreen needleleaf trees +4 4 Deciduous needleleaf trees +5 5 Deciduous broadleaf trees +6 6 Evergreen broadleaf trees +7 7 Tall grass +8 8 Desert +9 9 Tundra +10 10 Irrigated crops +11 11 Semidesert +12 12 Ice caps and glaciers +13 13 Bogs and marshes +14 14 Inland water +15 15 Ocean +16 16 Evergreen shrubs +17 17 Deciduous shrubs +18 18 Mixed forest +19 19 Interrupted forest +20 20 Water and land mixtures diff --git a/definitions/grib2/tables/17/4.236.table b/definitions/grib2/tables/17/4.236.table index fbe093ce9..9c58b488c 100644 --- a/definitions/grib2/tables/17/4.236.table +++ b/definitions/grib2/tables/17/4.236.table @@ -1,8 +1,8 @@ # Code table 4.236 - Soil texture fraction (to be used as partitioned parameter in product definition template 4.53 or 4.54) -1 1 Coarse -2 2 Medium -3 3 Medium-fine -4 4 Fine -5 5 Very-fine -6 6 Organic -7 7 Tropical-organic +1 1 Coarse +2 2 Medium +3 3 Medium-fine +4 4 Fine +5 5 Very-fine +6 6 Organic +7 7 Tropical-organic diff --git a/definitions/grib2/tables/17/4.240.table b/definitions/grib2/tables/17/4.240.table index ca335fea8..986557483 100644 --- a/definitions/grib2/tables/17/4.240.table +++ b/definitions/grib2/tables/17/4.240.table @@ -1,12 +1,12 @@ # Code table 4.240 - Type of distribution function -0 0 No specific distribution function given +0 0 No specific distribution function given 1 1 Delta functions with spatially variable concentration and fixed diameters Dl (p1) in metre -2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg -3 3 Gaussian (normal) distribution with spatially variable concentration and fixed mean diameter Dl(p1) and variance(p2) -4 4 Gaussian (normal) distribution with spatially variable concentration, mean diameter and variance -5 5 Log-normal distribution with spatially variable number density, mean diameter and variance -6 6 Log-normal distribution with spatially variable number density, mean diameter and fixed variance(p1) +2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg +3 3 Gaussian (normal) distribution with spatially variable concentration and fixed mean diameter Dl(p1) and variance(p2) +4 4 Gaussian (normal) distribution with spatially variable concentration, mean diameter and variance +5 5 Log-normal distribution with spatially variable number density, mean diameter and variance +6 6 Log-normal distribution with spatially variable number density, mean diameter and fixed variance(p1) 7 7 Log-normal distribution with spatially variable number density and mass density and fixed variance(p1) and fixed particle density(p2) -# 8-49151 Reserved -# 49152-65534 Reserved for local use -65535 65535 Missing value +# 8-49151 Reserved +# 49152-65534 Reserved for local use +65535 65535 Missing value diff --git a/definitions/grib2/tables/17/4.241.table b/definitions/grib2/tables/17/4.241.table index a037b4ba5..5ea7f775a 100644 --- a/definitions/grib2/tables/17/4.241.table +++ b/definitions/grib2/tables/17/4.241.table @@ -1,9 +1,9 @@ # Code table 4.241 - Coverage attributes -0 0 Undefined -1 1 Unmodified -2 2 Snow covered -3 3 Flooded -4 4 Ice covered -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 Undefined +1 1 Unmodified +2 2 Snow covered +3 3 Flooded +4 4 Ice covered +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/17/4.242.table b/definitions/grib2/tables/17/4.242.table index 083f88c29..f6865957c 100644 --- a/definitions/grib2/tables/17/4.242.table +++ b/definitions/grib2/tables/17/4.242.table @@ -1,7 +1,7 @@ # Code table 4.242 - Tile classification -0 0 Reserved -1 1 Land use classes according to ESA-GlobCover GCV2009 -2 2 Land use classes according to European Commission-Global Land Cover Project GLC2000 -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 Reserved +1 1 Land use classes according to ESA-GlobCover GCV2009 +2 2 Land use classes according to European Commission-Global Land Cover Project GLC2000 +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/17/4.243.table b/definitions/grib2/tables/17/4.243.table index b39053311..24d21b719 100644 --- a/definitions/grib2/tables/17/4.243.table +++ b/definitions/grib2/tables/17/4.243.table @@ -1,43 +1,43 @@ # Code table 4.243 - Tile class -0 0 Reserved -1 1 Evergreen broadleaved forest -2 2 Deciduous broadleaved closed forest -3 3 Deciduous broadleaved open forest -4 4 Evergreen needle-leaf forest -5 5 Deciduous needle-leaf forest -6 6 Mixed leaf trees -7 7 Freshwater flooded trees -8 8 Saline water flooded trees -9 9 Mosaic tree/natural vegetation -10 10 Burnt tree cover -11 11 Evergreen shrubs closed-open -12 12 Deciduous shrubs closed-open -13 13 Herbaceous vegetation closed-open -14 14 Sparse herbaceous or grass -15 15 Flooded shrubs or herbaceous -16 16 Cultivated and managed areas -17 17 Mosaic crop/tree/natural vegetation -18 18 Mosaic crop/shrub/grass -19 19 Bare areas -20 20 Water -21 21 Snow and ice -22 22 Artificial surface -23 23 Ocean -24 24 Irrigated croplands -25 25 Rainfed croplands -26 26 Mosaic cropland (50-70%) - vegetation (20-50%) -27 27 Mosaic vegetation (50-70%) - cropland (20-50%) -28 28 Closed broadleaved evergreen forest -29 29 Closed needle-leaved evergreen forest -30 30 Open needle-leaved deciduous forest -31 31 Mixed broadleaved and needle-leaved forest -32 32 Mosaic shrubland (50-70%) - grassland (20-50%) -33 33 Mosaic grassland (50-70%) - shrubland (20-50%) -34 34 Closed to open shrubland -35 35 Sparse vegetation -36 36 Closed to open forest regularly flooded -37 37 Closed forest or shrubland permanently flooded -38 38 Closed to open grassland regularly flooded -39 39 Undefined -# 40-32767 Reserved -# 32768- Reserved for local use +0 0 Reserved +1 1 Evergreen broadleaved forest +2 2 Deciduous broadleaved closed forest +3 3 Deciduous broadleaved open forest +4 4 Evergreen needle-leaf forest +5 5 Deciduous needle-leaf forest +6 6 Mixed leaf trees +7 7 Freshwater flooded trees +8 8 Saline water flooded trees +9 9 Mosaic tree/natural vegetation +10 10 Burnt tree cover +11 11 Evergreen shrubs closed-open +12 12 Deciduous shrubs closed-open +13 13 Herbaceous vegetation closed-open +14 14 Sparse herbaceous or grass +15 15 Flooded shrubs or herbaceous +16 16 Cultivated and managed areas +17 17 Mosaic crop/tree/natural vegetation +18 18 Mosaic crop/shrub/grass +19 19 Bare areas +20 20 Water +21 21 Snow and ice +22 22 Artificial surface +23 23 Ocean +24 24 Irrigated croplands +25 25 Rainfed croplands +26 26 Mosaic cropland (50-70%) - vegetation (20-50%) +27 27 Mosaic vegetation (50-70%) - cropland (20-50%) +28 28 Closed broadleaved evergreen forest +29 29 Closed needle-leaved evergreen forest +30 30 Open needle-leaved deciduous forest +31 31 Mixed broadleaved and needle-leaved forest +32 32 Mosaic shrubland (50-70%) - grassland (20-50%) +33 33 Mosaic grassland (50-70%) - shrubland (20-50%) +34 34 Closed to open shrubland +35 35 Sparse vegetation +36 36 Closed to open forest regularly flooded +37 37 Closed forest or shrubland permanently flooded +38 38 Closed to open grassland regularly flooded +39 39 Undefined +# 40-32767 Reserved +# 32768- Reserved for local use diff --git a/definitions/grib2/tables/17/4.3.table b/definitions/grib2/tables/17/4.3.table index f205ea0c2..bcf8102a1 100644 --- a/definitions/grib2/tables/17/4.3.table +++ b/definitions/grib2/tables/17/4.3.table @@ -1,22 +1,22 @@ # Code table 4.3 - Type of generating process -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast -12 12 Post-processed analysis -13 13 Post-processed forecast -14 14 Nowcast -15 15 Hindcast -16 16 Physical retrieval -17 17 Regression analysis -# 18-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +12 12 Post-processed analysis +13 13 Post-processed forecast +14 14 Nowcast +15 15 Hindcast +16 16 Physical retrieval +17 17 Regression analysis +# 18-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.4.table b/definitions/grib2/tables/17/4.4.table index 7087ebddb..6e63e069c 100644 --- a/definitions/grib2/tables/17/4.4.table +++ b/definitions/grib2/tables/17/4.4.table @@ -1,17 +1,17 @@ # Code table 4.4 - Indicator of unit of time range -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.5.table b/definitions/grib2/tables/17/4.5.table index e70520c3b..c2771c9c6 100644 --- a/definitions/grib2/tables/17/4.5.table +++ b/definitions/grib2/tables/17/4.5.table @@ -1,5 +1,5 @@ # Code table 4.5 - Fixed surface types and units -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface (-) 2 2 Cloud base level (-) 3 3 Level of cloud tops (-) @@ -16,11 +16,11 @@ 14 14 Level of free convection (LFC) 15 15 Convective condensation level (CCL) 16 16 Level of neutral buoyancy or equilibrium level (LNB) -# 17-19 Reserved +# 17-19 Reserved 20 20 Isothermal level (K) -# 21-99 Reserved +# 21-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -29,19 +29,19 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level (-) -112 112 Reserved -113 113 Logarithmic hybrid level +112 112 Reserved +113 113 Logarithmic hybrid level 114 114 Snow level (Numeric) -# 115-116 Reserved +# 115-116 Reserved 117 117 Mixed layer depth (m) 118 hhl Hybrid height level (-) 119 hpl Hybrid pressure level (-) -# 120-149 Reserved -150 150 Generalized vertical height coordinate +# 120-149 Reserved +150 150 Generalized vertical height coordinate 151 sol Soil level (Numeric) -# 152-159 Reserved +# 152-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 sfc Lake or river bottom (-) @@ -50,7 +50,7 @@ 165 165 Bottom of sediment layer penetrated by thermal wave (-) 166 sfc Mixing layer (-) 167 167 Bottom of root zone (-) -# 168-173 Reserved +# 168-173 Reserved 174 sfc Top surface of ice on sea, lake or river 175 175 Top surface of ice, under snow cover, on sea, lake or river 176 176 Bottom surface (underside) ice on sea, lake or river @@ -62,6 +62,6 @@ 182 182 Grid tile water fraction as a model surface 183 183 Grid tile ice fraction on sea, lake or river as a model surface 184 184 Grid tile glacier ice and inland ice fraction as a model surface -# 185-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 185-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.6.table b/definitions/grib2/tables/17/4.6.table index b2dfeb498..ce799721d 100644 --- a/definitions/grib2/tables/17/4.6.table +++ b/definitions/grib2/tables/17/4.6.table @@ -1,9 +1,9 @@ # Code table 4.6 - Type of ensemble forecast -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.7.table b/definitions/grib2/tables/17/4.7.table index e0de0e1b2..69b2b4d77 100644 --- a/definitions/grib2/tables/17/4.7.table +++ b/definitions/grib2/tables/17/4.7.table @@ -1,14 +1,14 @@ # Code table 4.7 - Derived forecast -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.8.table b/definitions/grib2/tables/17/4.8.table index ad883039c..78467454a 100644 --- a/definitions/grib2/tables/17/4.8.table +++ b/definitions/grib2/tables/17/4.8.table @@ -1,6 +1,6 @@ # Code table 4.8 - Clustering method -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.9.table b/definitions/grib2/tables/17/4.9.table index 5878b5ad3..0ce312dd1 100644 --- a/definitions/grib2/tables/17/4.9.table +++ b/definitions/grib2/tables/17/4.9.table @@ -1,9 +1,9 @@ # Code table 4.9 - Probability type -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/4.91.table b/definitions/grib2/tables/17/4.91.table index 44cf25f44..ae31ed61c 100644 --- a/definitions/grib2/tables/17/4.91.table +++ b/definitions/grib2/tables/17/4.91.table @@ -1,16 +1,16 @@ # Code table 4.91 - Type of Interval -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit -11 11 Equal to first limit -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit +11 11 Equal to first limit +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/17/5.0.table b/definitions/grib2/tables/17/5.0.table index 5ec77ed0f..2795336df 100644 --- a/definitions/grib2/tables/17/5.0.table +++ b/definitions/grib2/tables/17/5.0.table @@ -1,23 +1,23 @@ # Code table 5.0 - Data representation template number -0 0 Grid point data - simple packing -1 1 Matrix value at grid point - simple packing -2 2 Grid point data - complex packing -3 3 Grid point data - complex packing and spatial differencing -4 4 Grid point data - IEEE floating point data -40 40 Grid point data - JPEG 2000 code stream format -41 41 Grid point data - Portable Network Graphics (PNG) -# 42-49 Reserved -50 50 Spectral data - simple packing -51 51 Spherical harmonics data - complex packing -# 52-60 Reserved -61 61 Grid point data - simple packing with logarithm pre-processing -# 62-199 Reserved -200 200 Run length packing with level values -# 201-49151 Reserved -# 49152-65534 Reserved for local use +0 0 Grid point data - simple packing +1 1 Matrix value at grid point - simple packing +2 2 Grid point data - complex packing +3 3 Grid point data - complex packing and spatial differencing +4 4 Grid point data - IEEE floating point data +40 40 Grid point data - JPEG 2000 code stream format +41 41 Grid point data - Portable Network Graphics (PNG) +# 42-49 Reserved +50 50 Spectral data - simple packing +51 51 Spherical harmonics data - complex packing +# 52-60 Reserved +61 61 Grid point data - simple packing with logarithm pre-processing +# 62-199 Reserved +200 200 Run length packing with level values +# 201-49151 Reserved +# 49152-65534 Reserved for local use 40000 40000 JPEG2000 Packing 40010 40010 PNG pacling 50000 50000 Sperical harmonics ieee packing 50001 50001 Second order packing 50002 50002 Second order packing -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/17/5.1.table b/definitions/grib2/tables/17/5.1.table index 854330c74..1189b5e46 100644 --- a/definitions/grib2/tables/17/5.1.table +++ b/definitions/grib2/tables/17/5.1.table @@ -1,6 +1,6 @@ # Code table 5.1 - Type of original field values -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/5.2.table b/definitions/grib2/tables/17/5.2.table index 40586a131..d77fdf4e7 100644 --- a/definitions/grib2/tables/17/5.2.table +++ b/definitions/grib2/tables/17/5.2.table @@ -1,8 +1,8 @@ # Code table 5.2 - Matrix coordinate value function definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/5.3.table b/definitions/grib2/tables/17/5.3.table index c3b7b30fe..481331791 100644 --- a/definitions/grib2/tables/17/5.3.table +++ b/definitions/grib2/tables/17/5.3.table @@ -1,7 +1,7 @@ # Code table 5.3 - Matrix coordinate parameter -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/5.4.table b/definitions/grib2/tables/17/5.4.table index 8121c1819..e84ab1901 100644 --- a/definitions/grib2/tables/17/5.4.table +++ b/definitions/grib2/tables/17/5.4.table @@ -1,6 +1,6 @@ # Code table 5.4 - Group splitting method -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/5.40.table b/definitions/grib2/tables/17/5.40.table index b9bad2c39..97e8880ab 100644 --- a/definitions/grib2/tables/17/5.40.table +++ b/definitions/grib2/tables/17/5.40.table @@ -1,5 +1,5 @@ # Code table 5.40 - Type of compression -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/17/5.5.table b/definitions/grib2/tables/17/5.5.table index 3ef3eb070..f2316975a 100644 --- a/definitions/grib2/tables/17/5.5.table +++ b/definitions/grib2/tables/17/5.5.table @@ -1,7 +1,7 @@ # Code table 5.5 - Missing value management for complex packing -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/5.6.table b/definitions/grib2/tables/17/5.6.table index 6d5177877..db68ead9c 100644 --- a/definitions/grib2/tables/17/5.6.table +++ b/definitions/grib2/tables/17/5.6.table @@ -1,7 +1,7 @@ # Code table 5.6 - Order of spatial differencing -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/17/5.7.table b/definitions/grib2/tables/17/5.7.table index 5ab780056..e54862c19 100644 --- a/definitions/grib2/tables/17/5.7.table +++ b/definitions/grib2/tables/17/5.7.table @@ -1,7 +1,7 @@ # Code table 5.7 - Precision of floating-point numbers -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/17/6.0.table b/definitions/grib2/tables/17/6.0.table index 2a29aa285..a8f30f5a4 100644 --- a/definitions/grib2/tables/17/6.0.table +++ b/definitions/grib2/tables/17/6.0.table @@ -1,6 +1,6 @@ # Code table 6.0 - Bit map indicator -0 0 A bit map applies to this product and is specified in this Section +0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/18/0.0.table b/definitions/grib2/tables/18/0.0.table index b24c50564..2c5afceb4 100644 --- a/definitions/grib2/tables/18/0.0.table +++ b/definitions/grib2/tables/18/0.0.table @@ -1,10 +1,10 @@ # Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/1.0.table b/definitions/grib2/tables/18/1.0.table index 8829485d9..0e6f26f8e 100644 --- a/definitions/grib2/tables/18/1.0.table +++ b/definitions/grib2/tables/18/1.0.table @@ -1,22 +1,22 @@ # Code table 1.0 - GRIB master tables version number -0 0 Experimental -1 1 Version implemented on 7 November 2001 -2 2 Version implemented on 4 November 2003 -3 3 Version implemented on 2 November 2005 -4 4 Version implemented on 7 November 2007 -5 5 Version implemented on 4 November 2009 -6 6 Version implemented on 15 September 2010 -7 7 Version implemented on 4 May 2011 -8 8 Version implemented on 2 November 2011 -9 9 Version implemented on 2 May 2012 -10 10 Version implemented on 7 November 2012 -11 11 Version implemented on 8 May 2013 -12 12 Version implemented on 14 November 2013 -13 13 Version implemented on 7 May 2014 -14 14 Version implemented on 5 November 2014 -15 15 Version implemented on 6 May 2015 -16 16 Version implemented on 11 November 2015 -17 17 Version implemented on 4 May 2016 +0 0 Experimental +1 1 Version implemented on 7 November 2001 +2 2 Version implemented on 4 November 2003 +3 3 Version implemented on 2 November 2005 +4 4 Version implemented on 7 November 2007 +5 5 Version implemented on 4 November 2009 +6 6 Version implemented on 15 September 2010 +7 7 Version implemented on 4 May 2011 +8 8 Version implemented on 2 November 2011 +9 9 Version implemented on 2 May 2012 +10 10 Version implemented on 7 November 2012 +11 11 Version implemented on 8 May 2013 +12 12 Version implemented on 14 November 2013 +13 13 Version implemented on 7 May 2014 +14 14 Version implemented on 5 November 2014 +15 15 Version implemented on 6 May 2015 +16 16 Version implemented on 11 November 2015 +17 17 Version implemented on 4 May 2016 18 18 Version implemented on 2 November 2016 19 19 Pre-operational to be implemented by next amendment # 20-254 Future versions diff --git a/definitions/grib2/tables/18/1.1.table b/definitions/grib2/tables/18/1.1.table index d50f8fd72..f6d332005 100644 --- a/definitions/grib2/tables/18/1.1.table +++ b/definitions/grib2/tables/18/1.1.table @@ -1,4 +1,4 @@ # Code table 1.1 - GRIB local tables version number -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/18/1.2.table b/definitions/grib2/tables/18/1.2.table index 934b70455..638f1efbb 100644 --- a/definitions/grib2/tables/18/1.2.table +++ b/definitions/grib2/tables/18/1.2.table @@ -1,8 +1,8 @@ # Code table 1.2 - Significance of reference time -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/1.3.table b/definitions/grib2/tables/18/1.3.table index 0c95269d5..c1a9a7b9d 100644 --- a/definitions/grib2/tables/18/1.3.table +++ b/definitions/grib2/tables/18/1.3.table @@ -1,14 +1,14 @@ # Code table 1.3 - Production status of data -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products -4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products +4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) 5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) -6 6 S2S operational products -7 7 S2S test products +6 6 S2S operational products +7 7 S2S test products 8 8 Uncertainties in Ensembles of Regional ReAnalyses project (UERRA) 9 9 Uncertainties in Ensembles of Regional ReAnalyses project test (UERRA) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/1.4.table b/definitions/grib2/tables/18/1.4.table index 03203d874..877288c0e 100644 --- a/definitions/grib2/tables/18/1.4.table +++ b/definitions/grib2/tables/18/1.4.table @@ -1,13 +1,13 @@ # Code table 1.4 - Type of data -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/18/1.5.table b/definitions/grib2/tables/18/1.5.table index b2cf9f087..533111959 100644 --- a/definitions/grib2/tables/18/1.5.table +++ b/definitions/grib2/tables/18/1.5.table @@ -1,7 +1,7 @@ # Code table 1.5 - Identification template number -0 0 Calendar definition -1 1 Paleontological offset -2 2 Calendar definition and paleontological offset -# 3-32767 Reserved -# 32768-65534 Reserved for local use -65535 65535 Missing +0 0 Calendar definition +1 1 Paleontological offset +2 2 Calendar definition and paleontological offset +# 3-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/18/1.6.table b/definitions/grib2/tables/18/1.6.table index 5db921990..bd46899a7 100644 --- a/definitions/grib2/tables/18/1.6.table +++ b/definitions/grib2/tables/18/1.6.table @@ -1,8 +1,8 @@ # Code table 1.6 - Type of calendar -0 0 Gregorian -1 1 360-day -2 2 365-day -3 3 Proleptic Gregorian -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Gregorian +1 1 360-day +2 2 365-day +3 3 Proleptic Gregorian +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/3.0.table b/definitions/grib2/tables/18/3.0.table index 45187b80d..a442a06a0 100644 --- a/definitions/grib2/tables/18/3.0.table +++ b/definitions/grib2/tables/18/3.0.table @@ -1,6 +1,6 @@ # Code table 3.0 - Source of grid definition -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/18/3.10.table b/definitions/grib2/tables/18/3.10.table index afa8843a7..1612d05e3 100644 --- a/definitions/grib2/tables/18/3.10.table +++ b/definitions/grib2/tables/18/3.10.table @@ -1,8 +1,8 @@ # Flag table 3.10 - Scanning mode for one diamond -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/18/3.11.table b/definitions/grib2/tables/18/3.11.table index e516a2ab9..06ae10810 100644 --- a/definitions/grib2/tables/18/3.11.table +++ b/definitions/grib2/tables/18/3.11.table @@ -1,7 +1,7 @@ # Code table 3.11 - Interpretation of list of numbers at end of section 3 -0 0 There is no appended list -1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows -2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row -3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) -# 4-254 Reserved -255 255 Missing +0 0 There is no appended list +1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows +2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row +3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/18/3.15.table b/definitions/grib2/tables/18/3.15.table index 331217ebe..6087902a3 100644 --- a/definitions/grib2/tables/18/3.15.table +++ b/definitions/grib2/tables/18/3.15.table @@ -1,23 +1,23 @@ # Code table 3.15 - Physical meaning of vertical coordinate -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) -113 113 Logarithmic hybrid coordinate -# 114-159 Reserved +113 113 Logarithmic hybrid coordinate +# 114-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/3.2.table b/definitions/grib2/tables/18/3.2.table index 9238dc2a7..b9574a424 100644 --- a/definitions/grib2/tables/18/3.2.table +++ b/definitions/grib2/tables/18/3.2.table @@ -1,14 +1,14 @@ # Code table 3.2 - Shape of the Earth -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame -9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame +9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/3.20.table b/definitions/grib2/tables/18/3.20.table index efbf08d19..e2bb156ee 100644 --- a/definitions/grib2/tables/18/3.20.table +++ b/definitions/grib2/tables/18/3.20.table @@ -1,6 +1,6 @@ # Code table 3.20 - Type of horizontal line -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/3.21.table b/definitions/grib2/tables/18/3.21.table index 88dbb9019..e001e1c8f 100644 --- a/definitions/grib2/tables/18/3.21.table +++ b/definitions/grib2/tables/18/3.21.table @@ -1,8 +1,8 @@ # Code table 3.21 - Vertical dimension coordinate values definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/3.3.table b/definitions/grib2/tables/18/3.3.table index 5dd7c7001..25cb46a1d 100644 --- a/definitions/grib2/tables/18/3.3.table +++ b/definitions/grib2/tables/18/3.3.table @@ -1,9 +1,9 @@ # Flag table 3.3 - Resolution and component flags -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/18/3.4.table b/definitions/grib2/tables/18/3.4.table index 897b813d7..43835c014 100644 --- a/definitions/grib2/tables/18/3.4.table +++ b/definitions/grib2/tables/18/3.4.table @@ -1,17 +1,17 @@ # Flag table 3.4 - Scanning mode -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -5 0 Points within odd rows are not offset in i (x) direction -5 1 Points within odd rows are offset by Di/2 in i (x) direction -6 0 Points within even rows are not offset in i (x) direction -6 1 Points within even rows are offset by Di/2 in i (x) direction -7 0 Points are not offset in j (y) direction -7 1 Points are offset by Dj/2 in j (y) direction -8 0 Rows have Ni grid points and columns have Nj grid points -8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +5 0 Points within odd rows are not offset in i (x) direction +5 1 Points within odd rows are offset by Di/2 in i (x) direction +6 0 Points within even rows are not offset in i (x) direction +6 1 Points within even rows are offset by Di/2 in i (x) direction +7 0 Points are not offset in j (y) direction +7 1 Points are offset by Dj/2 in j (y) direction +8 0 Rows have Ni grid points and columns have Nj grid points +8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction diff --git a/definitions/grib2/tables/18/3.5.table b/definitions/grib2/tables/18/3.5.table index eabdde896..2f8ec82e3 100644 --- a/definitions/grib2/tables/18/3.5.table +++ b/definitions/grib2/tables/18/3.5.table @@ -1,5 +1,5 @@ # Flag table 3.5 - Projection centre -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/18/3.7.table b/definitions/grib2/tables/18/3.7.table index 0a7d6efde..34c0de085 100644 --- a/definitions/grib2/tables/18/3.7.table +++ b/definitions/grib2/tables/18/3.7.table @@ -1,5 +1,5 @@ # Code table 3.7 - Spectral data representation mode -0 0 Reserved +0 0 Reserved 1 1 see separate doc or pdf file -# 2-254 Reserved -255 255 Missing +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/18/3.8.table b/definitions/grib2/tables/18/3.8.table index 844e74235..578fab37f 100644 --- a/definitions/grib2/tables/18/3.8.table +++ b/definitions/grib2/tables/18/3.8.table @@ -1,7 +1,7 @@ # Code table 3.8 - Grid point position -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/3.9.table b/definitions/grib2/tables/18/3.9.table index fd730bc64..ecd65514a 100644 --- a/definitions/grib2/tables/18/3.9.table +++ b/definitions/grib2/tables/18/3.9.table @@ -1,4 +1,4 @@ # Flag table 3.9 - Numbering order of diamonds as seen from the corresponding pole -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/18/4.0.table b/definitions/grib2/tables/18/4.0.table index 5ad2ed89a..aceff01af 100644 --- a/definitions/grib2/tables/18/4.0.table +++ b/definitions/grib2/tables/18/4.0.table @@ -1,72 +1,72 @@ # Code table 4.0 - Product definition template number -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time -8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 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 +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time # 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data # 35-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -42 42 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 atmospheric chemical constituents -43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol -46 46 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 aerosol -47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol -48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 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 atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 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 aerosol +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol 49 49 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -# 50 Reserved -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +# 50 Reserved +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time # 52 Reserved -53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time -54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters -55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time 56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (deprecated) -57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function 58 58 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function 59 59 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (corrected version of template 4.56) -60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval # 62-69 Reserved 70 70 Post-processing analysis or forecast at a horizontal level or in a horizontal layer at a point in time 71 71 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time 72 72 Post-processing 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 73 73 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval # 74-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval # 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved -# 32768-65534 Reserved for local use +# 1102-32767 Reserved +# 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/18/4.1.0.table b/definitions/grib2/tables/18/4.1.0.table index 04cfd7802..df58636d6 100644 --- a/definitions/grib2/tables/18/4.1.0.table +++ b/definitions/grib2/tables/18/4.1.0.table @@ -1,27 +1,27 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.1.1.table b/definitions/grib2/tables/18/4.1.1.table index 7b22b6fed..05a854da0 100644 --- a/definitions/grib2/tables/18/4.1.1.table +++ b/definitions/grib2/tables/18/4.1.1.table @@ -1,7 +1,7 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.1.10.table b/definitions/grib2/tables/18/4.1.10.table index a9b20eb9c..88d3c8743 100644 --- a/definitions/grib2/tables/18/4.1.10.table +++ b/definitions/grib2/tables/18/4.1.10.table @@ -1,10 +1,10 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Subsurface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Subsurface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.1.2.table b/definitions/grib2/tables/18/4.1.2.table index 5b488fe9e..e74126645 100644 --- a/definitions/grib2/tables/18/4.1.2.table +++ b/definitions/grib2/tables/18/4.1.2.table @@ -1,9 +1,9 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.1.3.table b/definitions/grib2/tables/18/4.1.3.table index 7bf60d4a7..ba38c9301 100644 --- a/definitions/grib2/tables/18/4.1.3.table +++ b/definitions/grib2/tables/18/4.1.3.table @@ -1,11 +1,11 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Image format products -1 1 Quantitative products -2 2 Cloud properties -3 3 Flight rule conditions -4 4 Volcanic ash -5 5 Sea-surface temperature -6 6 Solar radiation -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +2 2 Cloud properties +3 3 Flight rule conditions +4 4 Volcanic ash +5 5 Sea-surface temperature +6 6 Solar radiation +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.10.table b/definitions/grib2/tables/18/4.10.table index 1a92baaf6..8a390e4be 100644 --- a/definitions/grib2/tables/18/4.10.table +++ b/definitions/grib2/tables/18/4.10.table @@ -1,16 +1,16 @@ # Code table 4.10 - Type of statistical processing -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -11 11 Summation -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/18/4.11.table b/definitions/grib2/tables/18/4.11.table index 7f404c849..01cc81303 100644 --- a/definitions/grib2/tables/18/4.11.table +++ b/definitions/grib2/tables/18/4.11.table @@ -1,10 +1,10 @@ # Code table 4.11 - Type of time intervals -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.12.table b/definitions/grib2/tables/18/4.12.table index 03fd89b36..d42b47e96 100644 --- a/definitions/grib2/tables/18/4.12.table +++ b/definitions/grib2/tables/18/4.12.table @@ -1,7 +1,7 @@ # Code table 4.12 - Operating mode -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.13.table b/definitions/grib2/tables/18/4.13.table index c92854eec..a0e28eac8 100644 --- a/definitions/grib2/tables/18/4.13.table +++ b/definitions/grib2/tables/18/4.13.table @@ -1,6 +1,6 @@ # Code table 4.13 - Quality control indicator -0 0 No quality control applied -1 1 Quality control applied -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.14.table b/definitions/grib2/tables/18/4.14.table index a88cb93fa..d525b23b3 100644 --- a/definitions/grib2/tables/18/4.14.table +++ b/definitions/grib2/tables/18/4.14.table @@ -1,6 +1,6 @@ # Code table 4.14 - Clutter filter indicator -0 0 No clutter filter used -1 1 Clutter filter used -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.15.table b/definitions/grib2/tables/18/4.15.table index 2e5f3dea3..7adddedb6 100644 --- a/definitions/grib2/tables/18/4.15.table +++ b/definitions/grib2/tables/18/4.15.table @@ -1,11 +1,11 @@ # Code table 4.15 - Type of spatial processing used to arrive at given data value from the source data -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.0.table b/definitions/grib2/tables/18/4.2.0.0.table index 7201a8667..83b3e8ef1 100644 --- a/definitions/grib2/tables/18/4.2.0.0.table +++ b/definitions/grib2/tables/18/4.2.0.0.table @@ -29,6 +29,6 @@ 27 27 Wet-bulb temperature (K) 28 28 Unbalanced component of temperature (K) 29 29 Temperature advection (K s-1) -# 30-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 30-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.1.table b/definitions/grib2/tables/18/4.2.0.1.table index c38d6a053..7d43684d3 100644 --- a/definitions/grib2/tables/18/4.2.0.1.table +++ b/definitions/grib2/tables/18/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,7 +86,7 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rainwater content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) @@ -118,6 +118,6 @@ 118 118 Unbalanced component of specific humidity (kg kg-1) 119 119 Unbalanced component of specific cloud liquid water content (kg kg-1) 120 120 Unbalanced component of specific cloud ice water content (kg kg-1) -# 121-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 121-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.13.table b/definitions/grib2/tables/18/4.2.0.13.table index 5086101ad..3f5c30675 100644 --- a/definitions/grib2/tables/18/4.2.0.13.table +++ b/definitions/grib2/tables/18/4.2.0.13.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.14.table b/definitions/grib2/tables/18/4.2.0.14.table index 215884737..97fb38c8b 100644 --- a/definitions/grib2/tables/18/4.2.0.14.table +++ b/definitions/grib2/tables/18/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.15.table b/definitions/grib2/tables/18/4.2.0.15.table index dfbc4d12f..8df082466 100644 --- a/definitions/grib2/tables/18/4.2.0.15.table +++ b/definitions/grib2/tables/18/4.2.0.15.table @@ -16,6 +16,6 @@ 14 14 Reflectivity of hail (dB) 15 15 Hybrid scan reflectivity (dB) 16 16 Hybrid scan reflectivity height (m) -# 17-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.16.table b/definitions/grib2/tables/18/4.2.0.16.table index 0c240a853..9499d9333 100644 --- a/definitions/grib2/tables/18/4.2.0.16.table +++ b/definitions/grib2/tables/18/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.18.table b/definitions/grib2/tables/18/4.2.0.18.table index 9d106f419..9ca6db61e 100644 --- a/definitions/grib2/tables/18/4.2.0.18.table +++ b/definitions/grib2/tables/18/4.2.0.18.table @@ -8,7 +8,7 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) @@ -18,6 +18,6 @@ 16 16 Height of maximum air concentration (m) 17 17 Column-integrated air concentration (Bq m-2) 18 18 Column-averaged air concentration in layer (Bq m-3) -# 19-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 19-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.19.table b/definitions/grib2/tables/18/4.2.0.19.table index 8705082c5..e4db36249 100644 --- a/definitions/grib2/tables/18/4.2.0.19.table +++ b/definitions/grib2/tables/18/4.2.0.19.table @@ -31,6 +31,6 @@ 29 29 Clear air turbulence (CAT) (m2/3 s-1) 30 30 Eddy dissipation parameter (m2/3 s-1) 31 31 Maximum of Eddy dissipation parameter in layer (m2/3 s-1) -# 32-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 32-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.190.table b/definitions/grib2/tables/18/4.2.0.190.table index de621a924..a0d6ba0ac 100644 --- a/definitions/grib2/tables/18/4.2.0.190.table +++ b/definitions/grib2/tables/18/4.2.0.190.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.191.table b/definitions/grib2/tables/18/4.2.0.191.table index e3bba0ebe..b3a7092ea 100644 --- a/definitions/grib2/tables/18/4.2.0.191.table +++ b/definitions/grib2/tables/18/4.2.0.191.table @@ -3,6 +3,6 @@ 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.2.table b/definitions/grib2/tables/18/4.2.0.2.table index 5446262e6..8a70b2591 100644 --- a/definitions/grib2/tables/18/4.2.0.2.table +++ b/definitions/grib2/tables/18/4.2.0.2.table @@ -46,6 +46,6 @@ 44 44 Geostrophic wind speed (m s-1) 45 45 Unbalanced component of divergence (s-1) 46 46 Vorticity advection (s-2) -# 47-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 47-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.20.table b/definitions/grib2/tables/18/4.2.0.20.table index efc427a19..bbdeef5b1 100644 --- a/definitions/grib2/tables/18/4.2.0.20.table +++ b/definitions/grib2/tables/18/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -29,7 +29,7 @@ 61 61 Maximum of mass density in layer (kg m-3) 62 62 Height of maximum mass density (m) 63 63 Column-averaged mass density in layer (kg m-3) -# 64-99 Reserved +# 64-99 Reserved 100 100 Surface area density (aerosol) (/m) 101 101 Vertical visual range (m) 102 102 Aerosol optical thickness (Numeric) @@ -42,6 +42,6 @@ 109 109 Aerosol lidar extinction from satellite (/m) 110 110 Aerosol lidar extinction from the ground (/m) 111 111 Angstrom exponent (Numeric) -# 112-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 112-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.3.table b/definitions/grib2/tables/18/4.2.0.3.table index 34941dcab..52c421b97 100644 --- a/definitions/grib2/tables/18/4.2.0.3.table +++ b/definitions/grib2/tables/18/4.2.0.3.table @@ -31,6 +31,6 @@ 29 29 Updraught detrainment rate (kg m-3 s-1) 30 30 Downdraught detrainment rate (kg m-3 s-1) 31 31 Unbalanced component of logarithm of surface pressure (-) -# 32-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 32-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.4.table b/definitions/grib2/tables/18/4.2.0.4.table index 0a5ded2b5..f97270456 100644 --- a/definitions/grib2/tables/18/4.2.0.4.table +++ b/definitions/grib2/tables/18/4.2.0.4.table @@ -14,11 +14,11 @@ 12 12 Downward UV radiation (W m-2) 13 13 Direct short-wave radiation flux (W m-2) 14 14 Diffuse short-wave radiation flux (W m-2) -# 15-49 Reserved +# 15-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) 52 52 Downward short-wave radiation flux, clear sky (W m-2) 53 53 Upward short-wave radiation flux, clear sky (W m-2) -# 54-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 54-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.5.table b/definitions/grib2/tables/18/4.2.0.5.table index 4550220b6..ddfa634ce 100644 --- a/definitions/grib2/tables/18/4.2.0.5.table +++ b/definitions/grib2/tables/18/4.2.0.5.table @@ -8,6 +8,6 @@ 6 6 Net long-wave radiation flux, clear sky (W m-2) 7 7 Brightness temperature (K) 8 8 Downward long-wave radiation flux, clear sky (W m-2) -# 9-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 9-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.6.table b/definitions/grib2/tables/18/4.2.0.6.table index 4cec0c8aa..0450ec194 100644 --- a/definitions/grib2/tables/18/4.2.0.6.table +++ b/definitions/grib2/tables/18/4.2.0.6.table @@ -40,10 +40,10 @@ 38 38 Mass density of cloud droplets (kg m-3) 39 39 Mass density of cloud ice (kg m-3) 40 40 Mass density of convective cloud water droplets (kg m-3) -# 41-46 Reserved +# 41-46 Reserved 47 47 Volume fraction of cloud water droplets (Numeric) 48 48 Volume fraction of cloud ice particles (Numeric) 49 49 Volume fraction of cloud (ice and/or water) (Numeric) -# 50-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 50-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.0.7.table b/definitions/grib2/tables/18/4.2.0.7.table index 6d0d87a46..3e653431f 100644 --- a/definitions/grib2/tables/18/4.2.0.7.table +++ b/definitions/grib2/tables/18/4.2.0.7.table @@ -13,11 +13,11 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraught helicity (m2 s-2) 16 16 Bulk Richardson number (Numeric) 17 17 Gradient Richardson number (Numeric) 18 18 Flux Richardson number (Numeric) -# 19-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 19-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.1.0.table b/definitions/grib2/tables/18/4.2.1.0.table index bcd849c2e..a2660f4f3 100644 --- a/definitions/grib2/tables/18/4.2.1.0.table +++ b/definitions/grib2/tables/18/4.2.1.0.table @@ -16,6 +16,6 @@ 14 14 Upstream accumulated precipitation (kg m-2) 15 15 Upstream accumulated snow melt (kg m-2) 16 16 Percolation rate (kg m-2 s-1) -# 17-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.1.1.table b/definitions/grib2/tables/18/4.2.1.1.table index b488eb0bd..171da3958 100644 --- a/definitions/grib2/tables/18/4.2.1.1.table +++ b/definitions/grib2/tables/18/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.10.0.table b/definitions/grib2/tables/18/4.2.10.0.table index 095f51bdf..3611abd9a 100644 --- a/definitions/grib2/tables/18/4.2.10.0.table +++ b/definitions/grib2/tables/18/4.2.10.0.table @@ -45,6 +45,6 @@ 43 43 Kurtosis of the sea-surface elevation due to waves (-) 44 44 Benjamin-Feir index (-) 45 45 Spectral peakedness factor (/s) -# 46-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 46-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.10.1.table b/definitions/grib2/tables/18/4.2.10.1.table index 5959bfa28..f0a073c00 100644 --- a/definitions/grib2/tables/18/4.2.10.1.table +++ b/definitions/grib2/tables/18/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.10.191.table b/definitions/grib2/tables/18/4.2.10.191.table index 524929e78..1ebf85006 100644 --- a/definitions/grib2/tables/18/4.2.10.191.table +++ b/definitions/grib2/tables/18/4.2.10.191.table @@ -1,8 +1,8 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Meridional overturning stream function (m3/s) -2 2 Reserved +2 2 Reserved 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.10.2.table b/definitions/grib2/tables/18/4.2.10.2.table index 6797062ac..4633bad4f 100644 --- a/definitions/grib2/tables/18/4.2.10.2.table +++ b/definitions/grib2/tables/18/4.2.10.2.table @@ -12,6 +12,6 @@ 10 10 Zonal vector component of vertically integrated ice internal pressure (Pa m) 11 11 Meridional vector component of vertically integrated ice internal pressure (Pa m) 12 12 Compressive ice strength (N/m) -# 13-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 13-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.10.3.table b/definitions/grib2/tables/18/4.2.10.3.table index de7afd61c..b01d7ae46 100644 --- a/definitions/grib2/tables/18/4.2.10.3.table +++ b/definitions/grib2/tables/18/4.2.10.3.table @@ -2,6 +2,6 @@ 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) 2 2 Heat exchange coefficient (-) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.10.4.table b/definitions/grib2/tables/18/4.2.10.4.table index 54774f1b7..d5615ae26 100644 --- a/definitions/grib2/tables/18/4.2.10.4.table +++ b/definitions/grib2/tables/18/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2/s) 6 6 Ocean vertical momentum diffusivity (m2/s) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (/m) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.2.0.table b/definitions/grib2/tables/18/4.2.2.0.table index 81548840c..b253cac22 100644 --- a/definitions/grib2/tables/18/4.2.2.0.table +++ b/definitions/grib2/tables/18/4.2.2.0.table @@ -38,6 +38,6 @@ 36 36 Tile fraction (Proportion) 37 37 Tile percentage (%) 38 38 Soil volumetric ice content (water equivalent) (m3 m-3) -# 39-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 39-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.2.3.table b/definitions/grib2/tables/18/4.2.2.3.table index 690fab42b..2674e9f42 100644 --- a/definitions/grib2/tables/18/4.2.2.3.table +++ b/definitions/grib2/tables/18/4.2.2.3.table @@ -27,6 +27,6 @@ 25 25 Snow depth at elevation bands (kg m-2) 26 26 Soil heat flux (W m-2) 27 27 Soil depth (m) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.2.4.table b/definitions/grib2/tables/18/4.2.2.4.table index bb54fac22..ceb761557 100644 --- a/definitions/grib2/tables/18/4.2.2.4.table +++ b/definitions/grib2/tables/18/4.2.2.4.table @@ -11,6 +11,6 @@ 9 9 Initial Fire Spread Index (Canadian Forest Service) (Numeric) 10 10 Fire Buildup Index (Canadian Forest Service) (Numeric) 11 11 Fire Daily Severity Rating (Canadian Forest Service) (Numeric) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.3.0.table b/definitions/grib2/tables/18/4.2.3.0.table index c0ffa29f5..80a829673 100644 --- a/definitions/grib2/tables/18/4.2.3.0.table +++ b/definitions/grib2/tables/18/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.2.3.1.table b/definitions/grib2/tables/18/4.2.3.1.table index 8e0793fe0..04cdde1f1 100644 --- a/definitions/grib2/tables/18/4.2.3.1.table +++ b/definitions/grib2/tables/18/4.2.3.1.table @@ -17,16 +17,16 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) 20 20 Aerosol optical thickness at 0.635 um 21 21 Aerosol optical thickness at 0.810 um 22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-26 Reserved +23 23 Angstrom coefficient +# 24-26 Reserved 27 27 Bidirectional reflectance factor (Numeric) 28 28 Brightness temperature (K) 29 29 Scaled radiance (Numeric) -# 30-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 30-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.201.table b/definitions/grib2/tables/18/4.201.table index 47f1b486f..fa173c4e0 100644 --- a/definitions/grib2/tables/18/4.201.table +++ b/definitions/grib2/tables/18/4.201.table @@ -1,15 +1,15 @@ # Code table 4.201 - Precipitation type -0 0 Reserved -1 1 Rain -2 2 Thunderstorm -3 3 Freezing rain -4 4 Mixed/ice -5 5 Snow -6 6 Wet snow -7 7 Mixture of rain and snow -8 8 Ice pellets -9 9 Graupel -10 10 Hail -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow +6 6 Wet snow +7 7 Mixture of rain and snow +8 8 Ice pellets +9 9 Graupel +10 10 Hail +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.202.table b/definitions/grib2/tables/18/4.202.table index 438502ff9..7f3c8f6cf 100644 --- a/definitions/grib2/tables/18/4.202.table +++ b/definitions/grib2/tables/18/4.202.table @@ -1,4 +1,4 @@ # Code table 4.202 - Precipitable water category -# 0-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.203.table b/definitions/grib2/tables/18/4.203.table index 8a9aedf7a..cf5eb6bdc 100644 --- a/definitions/grib2/tables/18/4.203.table +++ b/definitions/grib2/tables/18/4.203.table @@ -1,26 +1,26 @@ # Code table 4.203 - Cloud type -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.204.table b/definitions/grib2/tables/18/4.204.table index 481372936..8e0be1f8c 100644 --- a/definitions/grib2/tables/18/4.204.table +++ b/definitions/grib2/tables/18/4.204.table @@ -1,9 +1,9 @@ # Code table 4.204 - Thunderstorm coverage -0 0 None -1 1 Isolated (1-2%) -2 2 Few (3-5%) -3 3 Scattered (6-45%) -4 4 Numerous (> 45%) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (6-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.205.table b/definitions/grib2/tables/18/4.205.table index 5b4484dfd..c40c7f47b 100644 --- a/definitions/grib2/tables/18/4.205.table +++ b/definitions/grib2/tables/18/4.205.table @@ -1,6 +1,6 @@ # Code table 4.205 - Presence of aerosol -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.206.table b/definitions/grib2/tables/18/4.206.table index 02c3dfdf9..76472c261 100644 --- a/definitions/grib2/tables/18/4.206.table +++ b/definitions/grib2/tables/18/4.206.table @@ -1,6 +1,6 @@ # Code table 4.206 - Volcanic ash -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.207.table b/definitions/grib2/tables/18/4.207.table index 8ddb2e048..b6392fca0 100644 --- a/definitions/grib2/tables/18/4.207.table +++ b/definitions/grib2/tables/18/4.207.table @@ -1,10 +1,10 @@ # Code table 4.207 - Icing -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.208.table b/definitions/grib2/tables/18/4.208.table index b83685a1a..4361d38c0 100644 --- a/definitions/grib2/tables/18/4.208.table +++ b/definitions/grib2/tables/18/4.208.table @@ -1,9 +1,9 @@ # Code table 4.208 - Turbulence -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.209.table b/definitions/grib2/tables/18/4.209.table index cb7617071..39ea549ac 100644 --- a/definitions/grib2/tables/18/4.209.table +++ b/definitions/grib2/tables/18/4.209.table @@ -1,9 +1,9 @@ # Code table 4.209 - Planetary boundary-layer regime -0 0 Reserved -1 1 Stable -2 2 Mechanically driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.210.table b/definitions/grib2/tables/18/4.210.table index c01f4bcca..791878469 100644 --- a/definitions/grib2/tables/18/4.210.table +++ b/definitions/grib2/tables/18/4.210.table @@ -1,6 +1,6 @@ # Code table 4.210 - Contrail intensity 0 0 Contrail not present 1 1 Contrail present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.211.table b/definitions/grib2/tables/18/4.211.table index 098eb2d43..2a28a84d9 100644 --- a/definitions/grib2/tables/18/4.211.table +++ b/definitions/grib2/tables/18/4.211.table @@ -1,7 +1,7 @@ # Code table 4.211 - Contrail engine type -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.212.table b/definitions/grib2/tables/18/4.212.table index 1a085b88d..6a3dcf88c 100644 --- a/definitions/grib2/tables/18/4.212.table +++ b/definitions/grib2/tables/18/4.212.table @@ -1,18 +1,18 @@ # Code table 4.212 - Land use -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.213.table b/definitions/grib2/tables/18/4.213.table index c65784a00..68d627af6 100644 --- a/definitions/grib2/tables/18/4.213.table +++ b/definitions/grib2/tables/18/4.213.table @@ -1,16 +1,16 @@ # Code table 4.213 - Soil type -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.215.table b/definitions/grib2/tables/18/4.215.table index 034db72be..7888772d5 100644 --- a/definitions/grib2/tables/18/4.215.table +++ b/definitions/grib2/tables/18/4.215.table @@ -1,9 +1,9 @@ # Code table 4.215 - Remotely sensed snow coverage -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.216.table b/definitions/grib2/tables/18/4.216.table index 5d1460cef..b51b358f4 100644 --- a/definitions/grib2/tables/18/4.216.table +++ b/definitions/grib2/tables/18/4.216.table @@ -1,5 +1,5 @@ # Code table 4.216 - Elevation of snow-covered terrain -# 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 0-90 Elevation in increments of 100 m +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/18/4.217.table b/definitions/grib2/tables/18/4.217.table index a4452182c..a700410d5 100644 --- a/definitions/grib2/tables/18/4.217.table +++ b/definitions/grib2/tables/18/4.217.table @@ -1,8 +1,8 @@ # Code table 4.217 - Cloud mask type -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.218.table b/definitions/grib2/tables/18/4.218.table index 7e3a69578..b5b15150b 100644 --- a/definitions/grib2/tables/18/4.218.table +++ b/definitions/grib2/tables/18/4.218.table @@ -1,44 +1,44 @@ # Code table 4.218 - Pixel scene type -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation/crops -15 15 Permanent snow/ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -19 19 Warm liquid water cloud -20 20 Supercooled liquid water cloud -21 21 Mixed-phase cloud -22 22 Optically thin ice cloud -23 23 Optically thick ice cloud -24 24 Multilayered cloud -# 25-96 Reserved -97 97 Snow/ice on land -98 98 Snow/ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud/fog/Stratus -102 102 Low cloud/Stratocumulus -103 103 Low cloud/unknown type -104 104 Medium cloud/Nimbostratus -105 105 Medium cloud/Altostratus -106 106 Medium cloud/unknown type -107 107 High cloud/Cumulus -108 108 High cloud/Cirrus -109 109 High cloud/unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation/crops +15 15 Permanent snow/ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +19 19 Warm liquid water cloud +20 20 Supercooled liquid water cloud +21 21 Mixed-phase cloud +22 22 Optically thin ice cloud +23 23 Optically thick ice cloud +24 24 Multilayered cloud +# 25-96 Reserved +97 97 Snow/ice on land +98 98 Snow/ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud/fog/Stratus +102 102 Low cloud/Stratocumulus +103 103 Low cloud/unknown type +104 104 Medium cloud/Nimbostratus +105 105 Medium cloud/Altostratus +106 106 Medium cloud/unknown type +107 107 High cloud/Cumulus +108 108 High cloud/Cirrus +109 109 High cloud/unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.219.table b/definitions/grib2/tables/18/4.219.table index 86df0522e..9979f50ad 100644 --- a/definitions/grib2/tables/18/4.219.table +++ b/definitions/grib2/tables/18/4.219.table @@ -1,8 +1,8 @@ # Code table 4.219 - Cloud top height quality indicator -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.220.table b/definitions/grib2/tables/18/4.220.table index 93e841f8b..88e869e42 100644 --- a/definitions/grib2/tables/18/4.220.table +++ b/definitions/grib2/tables/18/4.220.table @@ -1,6 +1,6 @@ # Code table 4.220 - Horizontal dimension processed -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.221.table b/definitions/grib2/tables/18/4.221.table index 8448533d7..011cc3518 100644 --- a/definitions/grib2/tables/18/4.221.table +++ b/definitions/grib2/tables/18/4.221.table @@ -1,6 +1,6 @@ # Code table 4.221 - Treatment of missing data -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.222.table b/definitions/grib2/tables/18/4.222.table index 57f113014..558d947ac 100644 --- a/definitions/grib2/tables/18/4.222.table +++ b/definitions/grib2/tables/18/4.222.table @@ -1,6 +1,6 @@ # Code table 4.222 - Categorical result -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.223.table b/definitions/grib2/tables/18/4.223.table index f0deb076a..572c4e7a8 100644 --- a/definitions/grib2/tables/18/4.223.table +++ b/definitions/grib2/tables/18/4.223.table @@ -1,5 +1,5 @@ # Code table 4.223 - Fire detection indicator -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing diff --git a/definitions/grib2/tables/18/4.224.table b/definitions/grib2/tables/18/4.224.table index e87cde4bb..014f56e23 100644 --- a/definitions/grib2/tables/18/4.224.table +++ b/definitions/grib2/tables/18/4.224.table @@ -1,18 +1,18 @@ # Code table 4.224 - Categorical outlook -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/18/4.227.table b/definitions/grib2/tables/18/4.227.table index 27c76553d..48c3b7633 100644 --- a/definitions/grib2/tables/18/4.227.table +++ b/definitions/grib2/tables/18/4.227.table @@ -1,9 +1,9 @@ # Code table 4.227 - Icing scenario (weather/cloud classification) -0 0 None -1 1 General -2 2 Convective -3 3 Stratiform -4 4 Freezing -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 None +1 1 General +2 2 Convective +3 3 Stratiform +4 4 Freezing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/18/4.234.table b/definitions/grib2/tables/18/4.234.table index 816541ce9..3b05b4515 100644 --- a/definitions/grib2/tables/18/4.234.table +++ b/definitions/grib2/tables/18/4.234.table @@ -1,21 +1,21 @@ # Code table 4.234 - Canopy cover fraction (to be used as partitioned parameter in product definition template 4.53 or 4.54) -1 1 Crops, mixed farming -2 2 Short grass -3 3 Evergreen needleleaf trees -4 4 Deciduous needleleaf trees -5 5 Deciduous broadleaf trees -6 6 Evergreen broadleaf trees -7 7 Tall grass -8 8 Desert -9 9 Tundra -10 10 Irrigated crops -11 11 Semidesert -12 12 Ice caps and glaciers -13 13 Bogs and marshes -14 14 Inland water -15 15 Ocean -16 16 Evergreen shrubs -17 17 Deciduous shrubs -18 18 Mixed forest -19 19 Interrupted forest -20 20 Water and land mixtures +1 1 Crops, mixed farming +2 2 Short grass +3 3 Evergreen needleleaf trees +4 4 Deciduous needleleaf trees +5 5 Deciduous broadleaf trees +6 6 Evergreen broadleaf trees +7 7 Tall grass +8 8 Desert +9 9 Tundra +10 10 Irrigated crops +11 11 Semidesert +12 12 Ice caps and glaciers +13 13 Bogs and marshes +14 14 Inland water +15 15 Ocean +16 16 Evergreen shrubs +17 17 Deciduous shrubs +18 18 Mixed forest +19 19 Interrupted forest +20 20 Water and land mixtures diff --git a/definitions/grib2/tables/18/4.236.table b/definitions/grib2/tables/18/4.236.table index fbe093ce9..9c58b488c 100644 --- a/definitions/grib2/tables/18/4.236.table +++ b/definitions/grib2/tables/18/4.236.table @@ -1,8 +1,8 @@ # Code table 4.236 - Soil texture fraction (to be used as partitioned parameter in product definition template 4.53 or 4.54) -1 1 Coarse -2 2 Medium -3 3 Medium-fine -4 4 Fine -5 5 Very-fine -6 6 Organic -7 7 Tropical-organic +1 1 Coarse +2 2 Medium +3 3 Medium-fine +4 4 Fine +5 5 Very-fine +6 6 Organic +7 7 Tropical-organic diff --git a/definitions/grib2/tables/18/4.240.table b/definitions/grib2/tables/18/4.240.table index 7313e6eec..986557483 100644 --- a/definitions/grib2/tables/18/4.240.table +++ b/definitions/grib2/tables/18/4.240.table @@ -1,12 +1,12 @@ # Code table 4.240 - Type of distribution function -0 0 No specific distribution function given -1 1 Delta functions with spatially variable concentration and fixed diameters Dl (p1) in metre -2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg -3 3 Gaussian (normal) distribution with spatially variable concentration and fixed mean diameter Dl(p1) and variance(p2) -4 4 Gaussian (normal) distribution with spatially variable concentration, mean diameter and variance -5 5 Log-normal distribution with spatially variable number density, mean diameter and variance -6 6 Log-normal distribution with spatially variable number density, mean diameter and fixed variance(p1) +0 0 No specific distribution function given +1 1 Delta functions with spatially variable concentration and fixed diameters Dl (p1) in metre +2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg +3 3 Gaussian (normal) distribution with spatially variable concentration and fixed mean diameter Dl(p1) and variance(p2) +4 4 Gaussian (normal) distribution with spatially variable concentration, mean diameter and variance +5 5 Log-normal distribution with spatially variable number density, mean diameter and variance +6 6 Log-normal distribution with spatially variable number density, mean diameter and fixed variance(p1) 7 7 Log-normal distribution with spatially variable number density and mass density and fixed variance(p1) and fixed particle density(p2) -# 8-49151 Reserved -# 49152-65534 Reserved for local use -65535 65535 Missing value +# 8-49151 Reserved +# 49152-65534 Reserved for local use +65535 65535 Missing value diff --git a/definitions/grib2/tables/18/4.241.table b/definitions/grib2/tables/18/4.241.table index a037b4ba5..5ea7f775a 100644 --- a/definitions/grib2/tables/18/4.241.table +++ b/definitions/grib2/tables/18/4.241.table @@ -1,9 +1,9 @@ # Code table 4.241 - Coverage attributes -0 0 Undefined -1 1 Unmodified -2 2 Snow covered -3 3 Flooded -4 4 Ice covered -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 Undefined +1 1 Unmodified +2 2 Snow covered +3 3 Flooded +4 4 Ice covered +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/18/4.242.table b/definitions/grib2/tables/18/4.242.table index 083f88c29..f6865957c 100644 --- a/definitions/grib2/tables/18/4.242.table +++ b/definitions/grib2/tables/18/4.242.table @@ -1,7 +1,7 @@ # Code table 4.242 - Tile classification -0 0 Reserved -1 1 Land use classes according to ESA-GlobCover GCV2009 -2 2 Land use classes according to European Commission-Global Land Cover Project GLC2000 -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 Reserved +1 1 Land use classes according to ESA-GlobCover GCV2009 +2 2 Land use classes according to European Commission-Global Land Cover Project GLC2000 +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/18/4.243.table b/definitions/grib2/tables/18/4.243.table index b39053311..24d21b719 100644 --- a/definitions/grib2/tables/18/4.243.table +++ b/definitions/grib2/tables/18/4.243.table @@ -1,43 +1,43 @@ # Code table 4.243 - Tile class -0 0 Reserved -1 1 Evergreen broadleaved forest -2 2 Deciduous broadleaved closed forest -3 3 Deciduous broadleaved open forest -4 4 Evergreen needle-leaf forest -5 5 Deciduous needle-leaf forest -6 6 Mixed leaf trees -7 7 Freshwater flooded trees -8 8 Saline water flooded trees -9 9 Mosaic tree/natural vegetation -10 10 Burnt tree cover -11 11 Evergreen shrubs closed-open -12 12 Deciduous shrubs closed-open -13 13 Herbaceous vegetation closed-open -14 14 Sparse herbaceous or grass -15 15 Flooded shrubs or herbaceous -16 16 Cultivated and managed areas -17 17 Mosaic crop/tree/natural vegetation -18 18 Mosaic crop/shrub/grass -19 19 Bare areas -20 20 Water -21 21 Snow and ice -22 22 Artificial surface -23 23 Ocean -24 24 Irrigated croplands -25 25 Rainfed croplands -26 26 Mosaic cropland (50-70%) - vegetation (20-50%) -27 27 Mosaic vegetation (50-70%) - cropland (20-50%) -28 28 Closed broadleaved evergreen forest -29 29 Closed needle-leaved evergreen forest -30 30 Open needle-leaved deciduous forest -31 31 Mixed broadleaved and needle-leaved forest -32 32 Mosaic shrubland (50-70%) - grassland (20-50%) -33 33 Mosaic grassland (50-70%) - shrubland (20-50%) -34 34 Closed to open shrubland -35 35 Sparse vegetation -36 36 Closed to open forest regularly flooded -37 37 Closed forest or shrubland permanently flooded -38 38 Closed to open grassland regularly flooded -39 39 Undefined -# 40-32767 Reserved -# 32768- Reserved for local use +0 0 Reserved +1 1 Evergreen broadleaved forest +2 2 Deciduous broadleaved closed forest +3 3 Deciduous broadleaved open forest +4 4 Evergreen needle-leaf forest +5 5 Deciduous needle-leaf forest +6 6 Mixed leaf trees +7 7 Freshwater flooded trees +8 8 Saline water flooded trees +9 9 Mosaic tree/natural vegetation +10 10 Burnt tree cover +11 11 Evergreen shrubs closed-open +12 12 Deciduous shrubs closed-open +13 13 Herbaceous vegetation closed-open +14 14 Sparse herbaceous or grass +15 15 Flooded shrubs or herbaceous +16 16 Cultivated and managed areas +17 17 Mosaic crop/tree/natural vegetation +18 18 Mosaic crop/shrub/grass +19 19 Bare areas +20 20 Water +21 21 Snow and ice +22 22 Artificial surface +23 23 Ocean +24 24 Irrigated croplands +25 25 Rainfed croplands +26 26 Mosaic cropland (50-70%) - vegetation (20-50%) +27 27 Mosaic vegetation (50-70%) - cropland (20-50%) +28 28 Closed broadleaved evergreen forest +29 29 Closed needle-leaved evergreen forest +30 30 Open needle-leaved deciduous forest +31 31 Mixed broadleaved and needle-leaved forest +32 32 Mosaic shrubland (50-70%) - grassland (20-50%) +33 33 Mosaic grassland (50-70%) - shrubland (20-50%) +34 34 Closed to open shrubland +35 35 Sparse vegetation +36 36 Closed to open forest regularly flooded +37 37 Closed forest or shrubland permanently flooded +38 38 Closed to open grassland regularly flooded +39 39 Undefined +# 40-32767 Reserved +# 32768- Reserved for local use diff --git a/definitions/grib2/tables/18/4.3.table b/definitions/grib2/tables/18/4.3.table index 8ba9e08ab..cea1bef4f 100644 --- a/definitions/grib2/tables/18/4.3.table +++ b/definitions/grib2/tables/18/4.3.table @@ -1,23 +1,23 @@ # Code table 4.3 - Type of generating process -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast -12 12 Post-processed analysis -13 13 Post-processed forecast -14 14 Nowcast -15 15 Hindcast -16 16 Physical retrieval -17 17 Regression analysis -18 18 Difference between two forecasts -# 19-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +12 12 Post-processed analysis +13 13 Post-processed forecast +14 14 Nowcast +15 15 Hindcast +16 16 Physical retrieval +17 17 Regression analysis +18 18 Difference between two forecasts +# 19-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.4.table b/definitions/grib2/tables/18/4.4.table index 7087ebddb..6e63e069c 100644 --- a/definitions/grib2/tables/18/4.4.table +++ b/definitions/grib2/tables/18/4.4.table @@ -1,17 +1,17 @@ # Code table 4.4 - Indicator of unit of time range -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.5.table b/definitions/grib2/tables/18/4.5.table index 2f1a8a8b7..33abd6293 100644 --- a/definitions/grib2/tables/18/4.5.table +++ b/definitions/grib2/tables/18/4.5.table @@ -1,5 +1,5 @@ # Code table 4.5 - Fixed surface types and units -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface (-) 2 2 Cloud base level (-) 3 3 Level of cloud tops (-) @@ -16,15 +16,15 @@ 14 14 Level of free convection (LFC) 15 15 Convective condensation level (CCL) 16 16 Level of neutral buoyancy or equilibrium level (LNB) -# 17-19 Reserved +# 17-19 Reserved 20 20 Isothermal level (K) 21 21 Lowest level where mass density exceeds the specified value (base for a given threshold of mass density) (kg m-3) 22 22 Highest level where mass density exceeds the specified value (top for a given threshold of mass density) (kg m-3) 23 23 Lowest level where air concentration exceeds the specified value (base for a given threshold of air concentration) (Bq m-3) 24 24 Highest level where air concentration exceeds the specified value (top for a given threshold of air concentration) (Bq m-3) -# 25-99 Reserved +# 25-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -33,20 +33,20 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level (-) -112 112 Reserved -113 113 Logarithmic hybrid level +112 112 Reserved +113 113 Logarithmic hybrid level 114 114 Snow level (Numeric) 115 115 Sigma height level # 116 Reserved 117 117 Mixed layer depth (m) 118 hhl Hybrid height level (-) 119 hpl Hybrid pressure level (-) -# 120-149 Reserved -150 150 Generalized vertical height coordinate +# 120-149 Reserved +150 150 Generalized vertical height coordinate 151 sol Soil level (Numeric) -# 152-159 Reserved +# 152-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 sfc Lake or river bottom (-) @@ -55,7 +55,7 @@ 165 165 Bottom of sediment layer penetrated by thermal wave (-) 166 sfc Mixing layer (-) 167 167 Bottom of root zone (-) -# 168-173 Reserved +# 168-173 Reserved 174 sfc Top surface of ice on sea, lake or river 175 175 Top surface of ice, under snow cover, on sea, lake or river 176 176 Bottom surface (underside) ice on sea, lake or river @@ -67,6 +67,6 @@ 182 182 Grid tile water fraction as a model surface 183 183 Grid tile ice fraction on sea, lake or river as a model surface 184 184 Grid tile glacier ice and inland ice fraction as a model surface -# 185-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 185-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.6.table b/definitions/grib2/tables/18/4.6.table index b2dfeb498..ce799721d 100644 --- a/definitions/grib2/tables/18/4.6.table +++ b/definitions/grib2/tables/18/4.6.table @@ -1,9 +1,9 @@ # Code table 4.6 - Type of ensemble forecast -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.7.table b/definitions/grib2/tables/18/4.7.table index e0de0e1b2..69b2b4d77 100644 --- a/definitions/grib2/tables/18/4.7.table +++ b/definitions/grib2/tables/18/4.7.table @@ -1,14 +1,14 @@ # Code table 4.7 - Derived forecast -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.8.table b/definitions/grib2/tables/18/4.8.table index ad883039c..78467454a 100644 --- a/definitions/grib2/tables/18/4.8.table +++ b/definitions/grib2/tables/18/4.8.table @@ -1,6 +1,6 @@ # Code table 4.8 - Clustering method -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.9.table b/definitions/grib2/tables/18/4.9.table index 5878b5ad3..0ce312dd1 100644 --- a/definitions/grib2/tables/18/4.9.table +++ b/definitions/grib2/tables/18/4.9.table @@ -1,9 +1,9 @@ # Code table 4.9 - Probability type -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/4.91.table b/definitions/grib2/tables/18/4.91.table index 44cf25f44..ae31ed61c 100644 --- a/definitions/grib2/tables/18/4.91.table +++ b/definitions/grib2/tables/18/4.91.table @@ -1,16 +1,16 @@ # Code table 4.91 - Type of Interval -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit -11 11 Equal to first limit -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit +11 11 Equal to first limit +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/18/5.0.table b/definitions/grib2/tables/18/5.0.table index 33597681b..4d6cc68c8 100644 --- a/definitions/grib2/tables/18/5.0.table +++ b/definitions/grib2/tables/18/5.0.table @@ -1,24 +1,24 @@ # Code table 5.0 - Data representation template number -0 0 Grid point data - simple packing -1 1 Matrix value at grid point - simple packing -2 2 Grid point data - complex packing -3 3 Grid point data - complex packing and spatial differencing -4 4 Grid point data - IEEE floating point data -40 40 Grid point data - JPEG 2000 code stream format -41 41 Grid point data - Portable Network Graphics (PNG) +0 0 Grid point data - simple packing +1 1 Matrix value at grid point - simple packing +2 2 Grid point data - complex packing +3 3 Grid point data - complex packing and spatial differencing +4 4 Grid point data - IEEE floating point data +40 40 Grid point data - JPEG 2000 code stream format +41 41 Grid point data - Portable Network Graphics (PNG) 42 42 Grid point data - CCSDS recommended lossless compression -# 43-49 Reserved -50 50 Spectral data - simple packing -51 51 Spherical harmonics data - complex packing -# 52-60 Reserved -61 61 Grid point data - simple packing with logarithm pre-processing -# 62-199 Reserved -200 200 Run length packing with level values -# 201-49151 Reserved -# 49152-65534 Reserved for local use +# 43-49 Reserved +50 50 Spectral data - simple packing +51 51 Spherical harmonics data - complex packing +# 52-60 Reserved +61 61 Grid point data - simple packing with logarithm pre-processing +# 62-199 Reserved +200 200 Run length packing with level values +# 201-49151 Reserved +# 49152-65534 Reserved for local use 40000 40000 JPEG2000 Packing 40010 40010 PNG pacling 50000 50000 Sperical harmonics ieee packing 50001 50001 Second order packing 50002 50002 Second order packing -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/18/5.1.table b/definitions/grib2/tables/18/5.1.table index 854330c74..1189b5e46 100644 --- a/definitions/grib2/tables/18/5.1.table +++ b/definitions/grib2/tables/18/5.1.table @@ -1,6 +1,6 @@ # Code table 5.1 - Type of original field values -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/5.2.table b/definitions/grib2/tables/18/5.2.table index 40586a131..d77fdf4e7 100644 --- a/definitions/grib2/tables/18/5.2.table +++ b/definitions/grib2/tables/18/5.2.table @@ -1,8 +1,8 @@ # Code table 5.2 - Matrix coordinate value function definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/5.3.table b/definitions/grib2/tables/18/5.3.table index c3b7b30fe..481331791 100644 --- a/definitions/grib2/tables/18/5.3.table +++ b/definitions/grib2/tables/18/5.3.table @@ -1,7 +1,7 @@ # Code table 5.3 - Matrix coordinate parameter -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/5.4.table b/definitions/grib2/tables/18/5.4.table index 8121c1819..e84ab1901 100644 --- a/definitions/grib2/tables/18/5.4.table +++ b/definitions/grib2/tables/18/5.4.table @@ -1,6 +1,6 @@ # Code table 5.4 - Group splitting method -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/5.40.table b/definitions/grib2/tables/18/5.40.table index b9bad2c39..97e8880ab 100644 --- a/definitions/grib2/tables/18/5.40.table +++ b/definitions/grib2/tables/18/5.40.table @@ -1,5 +1,5 @@ # Code table 5.40 - Type of compression -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/18/5.5.table b/definitions/grib2/tables/18/5.5.table index 3ef3eb070..f2316975a 100644 --- a/definitions/grib2/tables/18/5.5.table +++ b/definitions/grib2/tables/18/5.5.table @@ -1,7 +1,7 @@ # Code table 5.5 - Missing value management for complex packing -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/5.6.table b/definitions/grib2/tables/18/5.6.table index 6d5177877..db68ead9c 100644 --- a/definitions/grib2/tables/18/5.6.table +++ b/definitions/grib2/tables/18/5.6.table @@ -1,7 +1,7 @@ # Code table 5.6 - Order of spatial differencing -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/18/5.7.table b/definitions/grib2/tables/18/5.7.table index 5ab780056..e54862c19 100644 --- a/definitions/grib2/tables/18/5.7.table +++ b/definitions/grib2/tables/18/5.7.table @@ -1,7 +1,7 @@ # Code table 5.7 - Precision of floating-point numbers -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/18/6.0.table b/definitions/grib2/tables/18/6.0.table index 2a29aa285..a8f30f5a4 100644 --- a/definitions/grib2/tables/18/6.0.table +++ b/definitions/grib2/tables/18/6.0.table @@ -1,6 +1,6 @@ # Code table 6.0 - Bit map indicator -0 0 A bit map applies to this product and is specified in this Section +0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/19/0.0.table b/definitions/grib2/tables/19/0.0.table index b24c50564..2c5afceb4 100644 --- a/definitions/grib2/tables/19/0.0.table +++ b/definitions/grib2/tables/19/0.0.table @@ -1,10 +1,10 @@ # Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/1.0.table b/definitions/grib2/tables/19/1.0.table index bd54828ee..06710c183 100644 --- a/definitions/grib2/tables/19/1.0.table +++ b/definitions/grib2/tables/19/1.0.table @@ -1,22 +1,22 @@ # Code table 1.0 - GRIB master tables version number -0 0 Experimental -1 1 Version implemented on 7 November 2001 -2 2 Version implemented on 4 November 2003 -3 3 Version implemented on 2 November 2005 -4 4 Version implemented on 7 November 2007 -5 5 Version implemented on 4 November 2009 -6 6 Version implemented on 15 September 2010 -7 7 Version implemented on 4 May 2011 -8 8 Version implemented on 2 November 2011 -9 9 Version implemented on 2 May 2012 -10 10 Version implemented on 7 November 2012 -11 11 Version implemented on 8 May 2013 -12 12 Version implemented on 14 November 2013 -13 13 Version implemented on 7 May 2014 -14 14 Version implemented on 5 November 2014 -15 15 Version implemented on 6 May 2015 -16 16 Version implemented on 11 November 2015 -17 17 Version implemented on 4 May 2016 +0 0 Experimental +1 1 Version implemented on 7 November 2001 +2 2 Version implemented on 4 November 2003 +3 3 Version implemented on 2 November 2005 +4 4 Version implemented on 7 November 2007 +5 5 Version implemented on 4 November 2009 +6 6 Version implemented on 15 September 2010 +7 7 Version implemented on 4 May 2011 +8 8 Version implemented on 2 November 2011 +9 9 Version implemented on 2 May 2012 +10 10 Version implemented on 7 November 2012 +11 11 Version implemented on 8 May 2013 +12 12 Version implemented on 14 November 2013 +13 13 Version implemented on 7 May 2014 +14 14 Version implemented on 5 November 2014 +15 15 Version implemented on 6 May 2015 +16 16 Version implemented on 11 November 2015 +17 17 Version implemented on 4 May 2016 18 18 Version implemented on 2 November 2016 19 19 Version implemented on 3 May 2017 20 20 Pre-operational to be implemented by next amendment diff --git a/definitions/grib2/tables/19/1.1.table b/definitions/grib2/tables/19/1.1.table index d50f8fd72..f6d332005 100644 --- a/definitions/grib2/tables/19/1.1.table +++ b/definitions/grib2/tables/19/1.1.table @@ -1,4 +1,4 @@ # Code table 1.1 - GRIB local tables version number -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/19/1.2.table b/definitions/grib2/tables/19/1.2.table index 934b70455..638f1efbb 100644 --- a/definitions/grib2/tables/19/1.2.table +++ b/definitions/grib2/tables/19/1.2.table @@ -1,8 +1,8 @@ # Code table 1.2 - Significance of reference time -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/1.3.table b/definitions/grib2/tables/19/1.3.table index 0c95269d5..c1a9a7b9d 100644 --- a/definitions/grib2/tables/19/1.3.table +++ b/definitions/grib2/tables/19/1.3.table @@ -1,14 +1,14 @@ # Code table 1.3 - Production status of data -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products -4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products +4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) 5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) -6 6 S2S operational products -7 7 S2S test products +6 6 S2S operational products +7 7 S2S test products 8 8 Uncertainties in Ensembles of Regional ReAnalyses project (UERRA) 9 9 Uncertainties in Ensembles of Regional ReAnalyses project test (UERRA) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/1.4.table b/definitions/grib2/tables/19/1.4.table index 03203d874..877288c0e 100644 --- a/definitions/grib2/tables/19/1.4.table +++ b/definitions/grib2/tables/19/1.4.table @@ -1,13 +1,13 @@ # Code table 1.4 - Type of data -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/19/1.5.table b/definitions/grib2/tables/19/1.5.table index b2cf9f087..533111959 100644 --- a/definitions/grib2/tables/19/1.5.table +++ b/definitions/grib2/tables/19/1.5.table @@ -1,7 +1,7 @@ # Code table 1.5 - Identification template number -0 0 Calendar definition -1 1 Paleontological offset -2 2 Calendar definition and paleontological offset -# 3-32767 Reserved -# 32768-65534 Reserved for local use -65535 65535 Missing +0 0 Calendar definition +1 1 Paleontological offset +2 2 Calendar definition and paleontological offset +# 3-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/19/1.6.table b/definitions/grib2/tables/19/1.6.table index 5db921990..bd46899a7 100644 --- a/definitions/grib2/tables/19/1.6.table +++ b/definitions/grib2/tables/19/1.6.table @@ -1,8 +1,8 @@ # Code table 1.6 - Type of calendar -0 0 Gregorian -1 1 360-day -2 2 365-day -3 3 Proleptic Gregorian -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Gregorian +1 1 360-day +2 2 365-day +3 3 Proleptic Gregorian +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/3.0.table b/definitions/grib2/tables/19/3.0.table index 45187b80d..a442a06a0 100644 --- a/definitions/grib2/tables/19/3.0.table +++ b/definitions/grib2/tables/19/3.0.table @@ -1,6 +1,6 @@ # Code table 3.0 - Source of grid definition -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/19/3.10.table b/definitions/grib2/tables/19/3.10.table index afa8843a7..1612d05e3 100644 --- a/definitions/grib2/tables/19/3.10.table +++ b/definitions/grib2/tables/19/3.10.table @@ -1,8 +1,8 @@ # Flag table 3.10 - Scanning mode for one diamond -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/19/3.11.table b/definitions/grib2/tables/19/3.11.table index e516a2ab9..06ae10810 100644 --- a/definitions/grib2/tables/19/3.11.table +++ b/definitions/grib2/tables/19/3.11.table @@ -1,7 +1,7 @@ # Code table 3.11 - Interpretation of list of numbers at end of section 3 -0 0 There is no appended list -1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows -2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row -3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) -# 4-254 Reserved -255 255 Missing +0 0 There is no appended list +1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows +2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row +3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/19/3.15.table b/definitions/grib2/tables/19/3.15.table index 331217ebe..6087902a3 100644 --- a/definitions/grib2/tables/19/3.15.table +++ b/definitions/grib2/tables/19/3.15.table @@ -1,23 +1,23 @@ # Code table 3.15 - Physical meaning of vertical coordinate -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) -113 113 Logarithmic hybrid coordinate -# 114-159 Reserved +113 113 Logarithmic hybrid coordinate +# 114-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/3.2.table b/definitions/grib2/tables/19/3.2.table index 1b5c8241d..56ffdc08e 100644 --- a/definitions/grib2/tables/19/3.2.table +++ b/definitions/grib2/tables/19/3.2.table @@ -1,14 +1,14 @@ # Code table 3.2 - Shape of the Earth -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS-84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS-84 reference frame -9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS-84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS-84 reference frame +9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/3.20.table b/definitions/grib2/tables/19/3.20.table index efbf08d19..e2bb156ee 100644 --- a/definitions/grib2/tables/19/3.20.table +++ b/definitions/grib2/tables/19/3.20.table @@ -1,6 +1,6 @@ # Code table 3.20 - Type of horizontal line -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/3.21.table b/definitions/grib2/tables/19/3.21.table index 88dbb9019..e001e1c8f 100644 --- a/definitions/grib2/tables/19/3.21.table +++ b/definitions/grib2/tables/19/3.21.table @@ -1,8 +1,8 @@ # Code table 3.21 - Vertical dimension coordinate values definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/3.3.table b/definitions/grib2/tables/19/3.3.table index 5dd7c7001..25cb46a1d 100644 --- a/definitions/grib2/tables/19/3.3.table +++ b/definitions/grib2/tables/19/3.3.table @@ -1,9 +1,9 @@ # Flag table 3.3 - Resolution and component flags -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/19/3.4.table b/definitions/grib2/tables/19/3.4.table index 897b813d7..43835c014 100644 --- a/definitions/grib2/tables/19/3.4.table +++ b/definitions/grib2/tables/19/3.4.table @@ -1,17 +1,17 @@ # Flag table 3.4 - Scanning mode -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -5 0 Points within odd rows are not offset in i (x) direction -5 1 Points within odd rows are offset by Di/2 in i (x) direction -6 0 Points within even rows are not offset in i (x) direction -6 1 Points within even rows are offset by Di/2 in i (x) direction -7 0 Points are not offset in j (y) direction -7 1 Points are offset by Dj/2 in j (y) direction -8 0 Rows have Ni grid points and columns have Nj grid points -8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +5 0 Points within odd rows are not offset in i (x) direction +5 1 Points within odd rows are offset by Di/2 in i (x) direction +6 0 Points within even rows are not offset in i (x) direction +6 1 Points within even rows are offset by Di/2 in i (x) direction +7 0 Points are not offset in j (y) direction +7 1 Points are offset by Dj/2 in j (y) direction +8 0 Rows have Ni grid points and columns have Nj grid points +8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction diff --git a/definitions/grib2/tables/19/3.5.table b/definitions/grib2/tables/19/3.5.table index eabdde896..2f8ec82e3 100644 --- a/definitions/grib2/tables/19/3.5.table +++ b/definitions/grib2/tables/19/3.5.table @@ -1,5 +1,5 @@ # Flag table 3.5 - Projection centre -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/19/3.7.table b/definitions/grib2/tables/19/3.7.table index 0a7d6efde..34c0de085 100644 --- a/definitions/grib2/tables/19/3.7.table +++ b/definitions/grib2/tables/19/3.7.table @@ -1,5 +1,5 @@ # Code table 3.7 - Spectral data representation mode -0 0 Reserved +0 0 Reserved 1 1 see separate doc or pdf file -# 2-254 Reserved -255 255 Missing +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/19/3.8.table b/definitions/grib2/tables/19/3.8.table index 844e74235..578fab37f 100644 --- a/definitions/grib2/tables/19/3.8.table +++ b/definitions/grib2/tables/19/3.8.table @@ -1,7 +1,7 @@ # Code table 3.8 - Grid point position -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/3.9.table b/definitions/grib2/tables/19/3.9.table index fd730bc64..ecd65514a 100644 --- a/definitions/grib2/tables/19/3.9.table +++ b/definitions/grib2/tables/19/3.9.table @@ -1,4 +1,4 @@ # Flag table 3.9 - Numbering order of diamonds as seen from the corresponding pole -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/19/4.0.table b/definitions/grib2/tables/19/4.0.table index 906bf12d3..a37b59d09 100644 --- a/definitions/grib2/tables/19/4.0.table +++ b/definitions/grib2/tables/19/4.0.table @@ -1,75 +1,75 @@ # Code table 4.0 - Product definition template number -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time -8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -# 35-39 Reserved +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 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 +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +# 35-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -42 42 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 atmospheric chemical constituents -43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol -46 46 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 aerosol -47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol -48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -49 49 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -# 50 Reserved -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 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 atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 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 aerosol +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +49 49 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +# 50 Reserved +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time # 52 Reserved -53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time -54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters -55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time -56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (deprecated) -57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function -58 58 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function -59 59 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (corrected version of template 4.56) -60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval -# 62-66 Reserved -67 67 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 atmospheric chemical constituents based on a distribution function -68 68 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time +56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (deprecated) +57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +58 58 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +59 59 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (corrected version of template 4.56) +60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +# 62-66 Reserved +67 67 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 atmospheric chemical constituents based on a distribution function +68 68 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function # 69 Reserved 70 70 Post-processing analysis or forecast at a horizontal level or in a horizontal layer at a point in time -71 71 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -72 72 Post-processing 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 -73 73 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval -# 74-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +71 71 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +72 72 Post-processing 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 +73 73 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +# 74-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved -# 32768-65534 Reserved for local use +# 1102-32767 Reserved +# 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/19/4.1.0.table b/definitions/grib2/tables/19/4.1.0.table index 04cfd7802..df58636d6 100644 --- a/definitions/grib2/tables/19/4.1.0.table +++ b/definitions/grib2/tables/19/4.1.0.table @@ -1,27 +1,27 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.1.1.table b/definitions/grib2/tables/19/4.1.1.table index 7b22b6fed..05a854da0 100644 --- a/definitions/grib2/tables/19/4.1.1.table +++ b/definitions/grib2/tables/19/4.1.1.table @@ -1,7 +1,7 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.1.10.table b/definitions/grib2/tables/19/4.1.10.table index a9b20eb9c..88d3c8743 100644 --- a/definitions/grib2/tables/19/4.1.10.table +++ b/definitions/grib2/tables/19/4.1.10.table @@ -1,10 +1,10 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Subsurface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Subsurface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.1.2.table b/definitions/grib2/tables/19/4.1.2.table index 5b488fe9e..e74126645 100644 --- a/definitions/grib2/tables/19/4.1.2.table +++ b/definitions/grib2/tables/19/4.1.2.table @@ -1,9 +1,9 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.1.3.table b/definitions/grib2/tables/19/4.1.3.table index 7bf60d4a7..ba38c9301 100644 --- a/definitions/grib2/tables/19/4.1.3.table +++ b/definitions/grib2/tables/19/4.1.3.table @@ -1,11 +1,11 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Image format products -1 1 Quantitative products -2 2 Cloud properties -3 3 Flight rule conditions -4 4 Volcanic ash -5 5 Sea-surface temperature -6 6 Solar radiation -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +2 2 Cloud properties +3 3 Flight rule conditions +4 4 Volcanic ash +5 5 Sea-surface temperature +6 6 Solar radiation +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.10.table b/definitions/grib2/tables/19/4.10.table index 1a92baaf6..8a390e4be 100644 --- a/definitions/grib2/tables/19/4.10.table +++ b/definitions/grib2/tables/19/4.10.table @@ -1,16 +1,16 @@ # Code table 4.10 - Type of statistical processing -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -11 11 Summation -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/19/4.11.table b/definitions/grib2/tables/19/4.11.table index 7f404c849..01cc81303 100644 --- a/definitions/grib2/tables/19/4.11.table +++ b/definitions/grib2/tables/19/4.11.table @@ -1,10 +1,10 @@ # Code table 4.11 - Type of time intervals -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.12.table b/definitions/grib2/tables/19/4.12.table index 03fd89b36..d42b47e96 100644 --- a/definitions/grib2/tables/19/4.12.table +++ b/definitions/grib2/tables/19/4.12.table @@ -1,7 +1,7 @@ # Code table 4.12 - Operating mode -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.13.table b/definitions/grib2/tables/19/4.13.table index c92854eec..a0e28eac8 100644 --- a/definitions/grib2/tables/19/4.13.table +++ b/definitions/grib2/tables/19/4.13.table @@ -1,6 +1,6 @@ # Code table 4.13 - Quality control indicator -0 0 No quality control applied -1 1 Quality control applied -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.14.table b/definitions/grib2/tables/19/4.14.table index a88cb93fa..d525b23b3 100644 --- a/definitions/grib2/tables/19/4.14.table +++ b/definitions/grib2/tables/19/4.14.table @@ -1,6 +1,6 @@ # Code table 4.14 - Clutter filter indicator -0 0 No clutter filter used -1 1 Clutter filter used -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.15.table b/definitions/grib2/tables/19/4.15.table index 2e5f3dea3..7adddedb6 100644 --- a/definitions/grib2/tables/19/4.15.table +++ b/definitions/grib2/tables/19/4.15.table @@ -1,11 +1,11 @@ # Code table 4.15 - Type of spatial processing used to arrive at given data value from the source data -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.0.table b/definitions/grib2/tables/19/4.2.0.0.table index 7201a8667..83b3e8ef1 100644 --- a/definitions/grib2/tables/19/4.2.0.0.table +++ b/definitions/grib2/tables/19/4.2.0.0.table @@ -29,6 +29,6 @@ 27 27 Wet-bulb temperature (K) 28 28 Unbalanced component of temperature (K) 29 29 Temperature advection (K s-1) -# 30-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 30-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.1.table b/definitions/grib2/tables/19/4.2.0.1.table index c38d6a053..7d43684d3 100644 --- a/definitions/grib2/tables/19/4.2.0.1.table +++ b/definitions/grib2/tables/19/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,7 +86,7 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rainwater content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) @@ -118,6 +118,6 @@ 118 118 Unbalanced component of specific humidity (kg kg-1) 119 119 Unbalanced component of specific cloud liquid water content (kg kg-1) 120 120 Unbalanced component of specific cloud ice water content (kg kg-1) -# 121-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 121-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.13.table b/definitions/grib2/tables/19/4.2.0.13.table index 5086101ad..3f5c30675 100644 --- a/definitions/grib2/tables/19/4.2.0.13.table +++ b/definitions/grib2/tables/19/4.2.0.13.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.14.table b/definitions/grib2/tables/19/4.2.0.14.table index 215884737..97fb38c8b 100644 --- a/definitions/grib2/tables/19/4.2.0.14.table +++ b/definitions/grib2/tables/19/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.15.table b/definitions/grib2/tables/19/4.2.0.15.table index dfbc4d12f..8df082466 100644 --- a/definitions/grib2/tables/19/4.2.0.15.table +++ b/definitions/grib2/tables/19/4.2.0.15.table @@ -16,6 +16,6 @@ 14 14 Reflectivity of hail (dB) 15 15 Hybrid scan reflectivity (dB) 16 16 Hybrid scan reflectivity height (m) -# 17-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.16.table b/definitions/grib2/tables/19/4.2.0.16.table index 0c240a853..9499d9333 100644 --- a/definitions/grib2/tables/19/4.2.0.16.table +++ b/definitions/grib2/tables/19/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.18.table b/definitions/grib2/tables/19/4.2.0.18.table index 9d106f419..9ca6db61e 100644 --- a/definitions/grib2/tables/19/4.2.0.18.table +++ b/definitions/grib2/tables/19/4.2.0.18.table @@ -8,7 +8,7 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) @@ -18,6 +18,6 @@ 16 16 Height of maximum air concentration (m) 17 17 Column-integrated air concentration (Bq m-2) 18 18 Column-averaged air concentration in layer (Bq m-3) -# 19-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 19-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.19.table b/definitions/grib2/tables/19/4.2.0.19.table index 1d7b4da91..b27eb2dbe 100644 --- a/definitions/grib2/tables/19/4.2.0.19.table +++ b/definitions/grib2/tables/19/4.2.0.19.table @@ -31,6 +31,6 @@ 29 29 Clear air turbulence (CAT) (m2/3 s-1) 30 30 Eddy dissipation parameter (m2/3 s-1) 31 31 Maximum of eddy dissipation parameter in layer (m2/3 s-1) -# 32-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 32-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.190.table b/definitions/grib2/tables/19/4.2.0.190.table index de621a924..a0d6ba0ac 100644 --- a/definitions/grib2/tables/19/4.2.0.190.table +++ b/definitions/grib2/tables/19/4.2.0.190.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.191.table b/definitions/grib2/tables/19/4.2.0.191.table index e3bba0ebe..b3a7092ea 100644 --- a/definitions/grib2/tables/19/4.2.0.191.table +++ b/definitions/grib2/tables/19/4.2.0.191.table @@ -3,6 +3,6 @@ 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.2.table b/definitions/grib2/tables/19/4.2.0.2.table index 5446262e6..8a70b2591 100644 --- a/definitions/grib2/tables/19/4.2.0.2.table +++ b/definitions/grib2/tables/19/4.2.0.2.table @@ -46,6 +46,6 @@ 44 44 Geostrophic wind speed (m s-1) 45 45 Unbalanced component of divergence (s-1) 46 46 Vorticity advection (s-2) -# 47-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 47-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.20.table b/definitions/grib2/tables/19/4.2.0.20.table index 3278506dd..0f95689f8 100644 --- a/definitions/grib2/tables/19/4.2.0.20.table +++ b/definitions/grib2/tables/19/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -29,7 +29,7 @@ 61 61 Maximum of mass density in layer (kg m-3) 62 62 Height of maximum mass density (m) 63 63 Column-averaged mass density in layer (kg m-3) -# 64-99 Reserved +# 64-99 Reserved 100 100 Surface area density (aerosol) (m-1) 101 101 Vertical visual range (m) 102 102 Aerosol optical thickness (Numeric) @@ -42,6 +42,6 @@ 109 109 Aerosol lidar extinction from satellite (m-1) 110 110 Aerosol lidar extinction from the ground (m-1) 111 111 Angstrom exponent (Numeric) -# 112-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 112-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.3.table b/definitions/grib2/tables/19/4.2.0.3.table index 34941dcab..52c421b97 100644 --- a/definitions/grib2/tables/19/4.2.0.3.table +++ b/definitions/grib2/tables/19/4.2.0.3.table @@ -31,6 +31,6 @@ 29 29 Updraught detrainment rate (kg m-3 s-1) 30 30 Downdraught detrainment rate (kg m-3 s-1) 31 31 Unbalanced component of logarithm of surface pressure (-) -# 32-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 32-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.4.table b/definitions/grib2/tables/19/4.2.0.4.table index 0a5ded2b5..f97270456 100644 --- a/definitions/grib2/tables/19/4.2.0.4.table +++ b/definitions/grib2/tables/19/4.2.0.4.table @@ -14,11 +14,11 @@ 12 12 Downward UV radiation (W m-2) 13 13 Direct short-wave radiation flux (W m-2) 14 14 Diffuse short-wave radiation flux (W m-2) -# 15-49 Reserved +# 15-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) 52 52 Downward short-wave radiation flux, clear sky (W m-2) 53 53 Upward short-wave radiation flux, clear sky (W m-2) -# 54-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 54-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.5.table b/definitions/grib2/tables/19/4.2.0.5.table index 4550220b6..ddfa634ce 100644 --- a/definitions/grib2/tables/19/4.2.0.5.table +++ b/definitions/grib2/tables/19/4.2.0.5.table @@ -8,6 +8,6 @@ 6 6 Net long-wave radiation flux, clear sky (W m-2) 7 7 Brightness temperature (K) 8 8 Downward long-wave radiation flux, clear sky (W m-2) -# 9-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 9-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.6.table b/definitions/grib2/tables/19/4.2.0.6.table index 4cec0c8aa..0450ec194 100644 --- a/definitions/grib2/tables/19/4.2.0.6.table +++ b/definitions/grib2/tables/19/4.2.0.6.table @@ -40,10 +40,10 @@ 38 38 Mass density of cloud droplets (kg m-3) 39 39 Mass density of cloud ice (kg m-3) 40 40 Mass density of convective cloud water droplets (kg m-3) -# 41-46 Reserved +# 41-46 Reserved 47 47 Volume fraction of cloud water droplets (Numeric) 48 48 Volume fraction of cloud ice particles (Numeric) 49 49 Volume fraction of cloud (ice and/or water) (Numeric) -# 50-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 50-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.0.7.table b/definitions/grib2/tables/19/4.2.0.7.table index aff6a6516..6289d8b20 100644 --- a/definitions/grib2/tables/19/4.2.0.7.table +++ b/definitions/grib2/tables/19/4.2.0.7.table @@ -13,12 +13,12 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraught helicity (m2 s-2) 16 16 Bulk Richardson number (Numeric) 17 17 Gradient Richardson number (Numeric) 18 18 Flux Richardson number (Numeric) 19 19 Convective available potential energy - shear (m2 s-2) -# 20-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 20-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.1.0.table b/definitions/grib2/tables/19/4.2.1.0.table index bcd849c2e..a2660f4f3 100644 --- a/definitions/grib2/tables/19/4.2.1.0.table +++ b/definitions/grib2/tables/19/4.2.1.0.table @@ -16,6 +16,6 @@ 14 14 Upstream accumulated precipitation (kg m-2) 15 15 Upstream accumulated snow melt (kg m-2) 16 16 Percolation rate (kg m-2 s-1) -# 17-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.1.1.table b/definitions/grib2/tables/19/4.2.1.1.table index b488eb0bd..171da3958 100644 --- a/definitions/grib2/tables/19/4.2.1.1.table +++ b/definitions/grib2/tables/19/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.10.0.table b/definitions/grib2/tables/19/4.2.10.0.table index 095f51bdf..3611abd9a 100644 --- a/definitions/grib2/tables/19/4.2.10.0.table +++ b/definitions/grib2/tables/19/4.2.10.0.table @@ -45,6 +45,6 @@ 43 43 Kurtosis of the sea-surface elevation due to waves (-) 44 44 Benjamin-Feir index (-) 45 45 Spectral peakedness factor (/s) -# 46-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 46-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.10.1.table b/definitions/grib2/tables/19/4.2.10.1.table index 5959bfa28..f0a073c00 100644 --- a/definitions/grib2/tables/19/4.2.10.1.table +++ b/definitions/grib2/tables/19/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.10.191.table b/definitions/grib2/tables/19/4.2.10.191.table index 524929e78..1ebf85006 100644 --- a/definitions/grib2/tables/19/4.2.10.191.table +++ b/definitions/grib2/tables/19/4.2.10.191.table @@ -1,8 +1,8 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Meridional overturning stream function (m3/s) -2 2 Reserved +2 2 Reserved 3 3 Days since last observation (d) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.10.2.table b/definitions/grib2/tables/19/4.2.10.2.table index 6797062ac..4633bad4f 100644 --- a/definitions/grib2/tables/19/4.2.10.2.table +++ b/definitions/grib2/tables/19/4.2.10.2.table @@ -12,6 +12,6 @@ 10 10 Zonal vector component of vertically integrated ice internal pressure (Pa m) 11 11 Meridional vector component of vertically integrated ice internal pressure (Pa m) 12 12 Compressive ice strength (N/m) -# 13-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 13-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.10.3.table b/definitions/grib2/tables/19/4.2.10.3.table index de7afd61c..b01d7ae46 100644 --- a/definitions/grib2/tables/19/4.2.10.3.table +++ b/definitions/grib2/tables/19/4.2.10.3.table @@ -2,6 +2,6 @@ 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) 2 2 Heat exchange coefficient (-) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.10.4.table b/definitions/grib2/tables/19/4.2.10.4.table index 54774f1b7..d5615ae26 100644 --- a/definitions/grib2/tables/19/4.2.10.4.table +++ b/definitions/grib2/tables/19/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2/s) 6 6 Ocean vertical momentum diffusivity (m2/s) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (/m) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.2.0.table b/definitions/grib2/tables/19/4.2.2.0.table index 81548840c..b253cac22 100644 --- a/definitions/grib2/tables/19/4.2.2.0.table +++ b/definitions/grib2/tables/19/4.2.2.0.table @@ -38,6 +38,6 @@ 36 36 Tile fraction (Proportion) 37 37 Tile percentage (%) 38 38 Soil volumetric ice content (water equivalent) (m3 m-3) -# 39-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 39-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.2.3.table b/definitions/grib2/tables/19/4.2.2.3.table index 690fab42b..2674e9f42 100644 --- a/definitions/grib2/tables/19/4.2.2.3.table +++ b/definitions/grib2/tables/19/4.2.2.3.table @@ -27,6 +27,6 @@ 25 25 Snow depth at elevation bands (kg m-2) 26 26 Soil heat flux (W m-2) 27 27 Soil depth (m) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.2.4.table b/definitions/grib2/tables/19/4.2.2.4.table index bb54fac22..ceb761557 100644 --- a/definitions/grib2/tables/19/4.2.2.4.table +++ b/definitions/grib2/tables/19/4.2.2.4.table @@ -11,6 +11,6 @@ 9 9 Initial Fire Spread Index (Canadian Forest Service) (Numeric) 10 10 Fire Buildup Index (Canadian Forest Service) (Numeric) 11 11 Fire Daily Severity Rating (Canadian Forest Service) (Numeric) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.3.0.table b/definitions/grib2/tables/19/4.2.3.0.table index c0ffa29f5..80a829673 100644 --- a/definitions/grib2/tables/19/4.2.3.0.table +++ b/definitions/grib2/tables/19/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.2.3.1.table b/definitions/grib2/tables/19/4.2.3.1.table index 8e0793fe0..04cdde1f1 100644 --- a/definitions/grib2/tables/19/4.2.3.1.table +++ b/definitions/grib2/tables/19/4.2.3.1.table @@ -17,16 +17,16 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) 20 20 Aerosol optical thickness at 0.635 um 21 21 Aerosol optical thickness at 0.810 um 22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-26 Reserved +23 23 Angstrom coefficient +# 24-26 Reserved 27 27 Bidirectional reflectance factor (Numeric) 28 28 Brightness temperature (K) 29 29 Scaled radiance (Numeric) -# 30-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 30-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.201.table b/definitions/grib2/tables/19/4.201.table index 47f1b486f..fa173c4e0 100644 --- a/definitions/grib2/tables/19/4.201.table +++ b/definitions/grib2/tables/19/4.201.table @@ -1,15 +1,15 @@ # Code table 4.201 - Precipitation type -0 0 Reserved -1 1 Rain -2 2 Thunderstorm -3 3 Freezing rain -4 4 Mixed/ice -5 5 Snow -6 6 Wet snow -7 7 Mixture of rain and snow -8 8 Ice pellets -9 9 Graupel -10 10 Hail -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow +6 6 Wet snow +7 7 Mixture of rain and snow +8 8 Ice pellets +9 9 Graupel +10 10 Hail +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.202.table b/definitions/grib2/tables/19/4.202.table index 438502ff9..7f3c8f6cf 100644 --- a/definitions/grib2/tables/19/4.202.table +++ b/definitions/grib2/tables/19/4.202.table @@ -1,4 +1,4 @@ # Code table 4.202 - Precipitable water category -# 0-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.203.table b/definitions/grib2/tables/19/4.203.table index 8a9aedf7a..cf5eb6bdc 100644 --- a/definitions/grib2/tables/19/4.203.table +++ b/definitions/grib2/tables/19/4.203.table @@ -1,26 +1,26 @@ # Code table 4.203 - Cloud type -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.204.table b/definitions/grib2/tables/19/4.204.table index 481372936..8e0be1f8c 100644 --- a/definitions/grib2/tables/19/4.204.table +++ b/definitions/grib2/tables/19/4.204.table @@ -1,9 +1,9 @@ # Code table 4.204 - Thunderstorm coverage -0 0 None -1 1 Isolated (1-2%) -2 2 Few (3-5%) -3 3 Scattered (6-45%) -4 4 Numerous (> 45%) -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (6-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.205.table b/definitions/grib2/tables/19/4.205.table index 5b4484dfd..c40c7f47b 100644 --- a/definitions/grib2/tables/19/4.205.table +++ b/definitions/grib2/tables/19/4.205.table @@ -1,6 +1,6 @@ # Code table 4.205 - Presence of aerosol -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.206.table b/definitions/grib2/tables/19/4.206.table index 02c3dfdf9..76472c261 100644 --- a/definitions/grib2/tables/19/4.206.table +++ b/definitions/grib2/tables/19/4.206.table @@ -1,6 +1,6 @@ # Code table 4.206 - Volcanic ash -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.207.table b/definitions/grib2/tables/19/4.207.table index 8ddb2e048..b6392fca0 100644 --- a/definitions/grib2/tables/19/4.207.table +++ b/definitions/grib2/tables/19/4.207.table @@ -1,10 +1,10 @@ # Code table 4.207 - Icing -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.208.table b/definitions/grib2/tables/19/4.208.table index b83685a1a..4361d38c0 100644 --- a/definitions/grib2/tables/19/4.208.table +++ b/definitions/grib2/tables/19/4.208.table @@ -1,9 +1,9 @@ # Code table 4.208 - Turbulence -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.209.table b/definitions/grib2/tables/19/4.209.table index cb7617071..39ea549ac 100644 --- a/definitions/grib2/tables/19/4.209.table +++ b/definitions/grib2/tables/19/4.209.table @@ -1,9 +1,9 @@ # Code table 4.209 - Planetary boundary-layer regime -0 0 Reserved -1 1 Stable -2 2 Mechanically driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.210.table b/definitions/grib2/tables/19/4.210.table index ae569a8ba..791878469 100644 --- a/definitions/grib2/tables/19/4.210.table +++ b/definitions/grib2/tables/19/4.210.table @@ -3,4 +3,4 @@ 1 1 Contrail present # 2-191 Reserved # 192-254 Reserved for local use -255 255 Missing +255 255 Missing diff --git a/definitions/grib2/tables/19/4.211.table b/definitions/grib2/tables/19/4.211.table index 098eb2d43..2a28a84d9 100644 --- a/definitions/grib2/tables/19/4.211.table +++ b/definitions/grib2/tables/19/4.211.table @@ -1,7 +1,7 @@ # Code table 4.211 - Contrail engine type -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.212.table b/definitions/grib2/tables/19/4.212.table index 1a085b88d..6a3dcf88c 100644 --- a/definitions/grib2/tables/19/4.212.table +++ b/definitions/grib2/tables/19/4.212.table @@ -1,18 +1,18 @@ # Code table 4.212 - Land use -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.213.table b/definitions/grib2/tables/19/4.213.table index c65784a00..68d627af6 100644 --- a/definitions/grib2/tables/19/4.213.table +++ b/definitions/grib2/tables/19/4.213.table @@ -1,16 +1,16 @@ # Code table 4.213 - Soil type -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.215.table b/definitions/grib2/tables/19/4.215.table index 034db72be..7888772d5 100644 --- a/definitions/grib2/tables/19/4.215.table +++ b/definitions/grib2/tables/19/4.215.table @@ -1,9 +1,9 @@ # Code table 4.215 - Remotely sensed snow coverage -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.216.table b/definitions/grib2/tables/19/4.216.table index 5d1460cef..b51b358f4 100644 --- a/definitions/grib2/tables/19/4.216.table +++ b/definitions/grib2/tables/19/4.216.table @@ -1,5 +1,5 @@ # Code table 4.216 - Elevation of snow-covered terrain -# 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 0-90 Elevation in increments of 100 m +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/19/4.217.table b/definitions/grib2/tables/19/4.217.table index a4452182c..a700410d5 100644 --- a/definitions/grib2/tables/19/4.217.table +++ b/definitions/grib2/tables/19/4.217.table @@ -1,8 +1,8 @@ # Code table 4.217 - Cloud mask type -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.218.table b/definitions/grib2/tables/19/4.218.table index 7e3a69578..b5b15150b 100644 --- a/definitions/grib2/tables/19/4.218.table +++ b/definitions/grib2/tables/19/4.218.table @@ -1,44 +1,44 @@ # Code table 4.218 - Pixel scene type -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation/crops -15 15 Permanent snow/ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -19 19 Warm liquid water cloud -20 20 Supercooled liquid water cloud -21 21 Mixed-phase cloud -22 22 Optically thin ice cloud -23 23 Optically thick ice cloud -24 24 Multilayered cloud -# 25-96 Reserved -97 97 Snow/ice on land -98 98 Snow/ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud/fog/Stratus -102 102 Low cloud/Stratocumulus -103 103 Low cloud/unknown type -104 104 Medium cloud/Nimbostratus -105 105 Medium cloud/Altostratus -106 106 Medium cloud/unknown type -107 107 High cloud/Cumulus -108 108 High cloud/Cirrus -109 109 High cloud/unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation/crops +15 15 Permanent snow/ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +19 19 Warm liquid water cloud +20 20 Supercooled liquid water cloud +21 21 Mixed-phase cloud +22 22 Optically thin ice cloud +23 23 Optically thick ice cloud +24 24 Multilayered cloud +# 25-96 Reserved +97 97 Snow/ice on land +98 98 Snow/ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud/fog/Stratus +102 102 Low cloud/Stratocumulus +103 103 Low cloud/unknown type +104 104 Medium cloud/Nimbostratus +105 105 Medium cloud/Altostratus +106 106 Medium cloud/unknown type +107 107 High cloud/Cumulus +108 108 High cloud/Cirrus +109 109 High cloud/unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.219.table b/definitions/grib2/tables/19/4.219.table index 86df0522e..9979f50ad 100644 --- a/definitions/grib2/tables/19/4.219.table +++ b/definitions/grib2/tables/19/4.219.table @@ -1,8 +1,8 @@ # Code table 4.219 - Cloud top height quality indicator -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.220.table b/definitions/grib2/tables/19/4.220.table index 93e841f8b..88e869e42 100644 --- a/definitions/grib2/tables/19/4.220.table +++ b/definitions/grib2/tables/19/4.220.table @@ -1,6 +1,6 @@ # Code table 4.220 - Horizontal dimension processed -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.221.table b/definitions/grib2/tables/19/4.221.table index 8448533d7..011cc3518 100644 --- a/definitions/grib2/tables/19/4.221.table +++ b/definitions/grib2/tables/19/4.221.table @@ -1,6 +1,6 @@ # Code table 4.221 - Treatment of missing data -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.222.table b/definitions/grib2/tables/19/4.222.table index 57f113014..558d947ac 100644 --- a/definitions/grib2/tables/19/4.222.table +++ b/definitions/grib2/tables/19/4.222.table @@ -1,6 +1,6 @@ # Code table 4.222 - Categorical result -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.223.table b/definitions/grib2/tables/19/4.223.table index f0deb076a..572c4e7a8 100644 --- a/definitions/grib2/tables/19/4.223.table +++ b/definitions/grib2/tables/19/4.223.table @@ -1,5 +1,5 @@ # Code table 4.223 - Fire detection indicator -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing diff --git a/definitions/grib2/tables/19/4.224.table b/definitions/grib2/tables/19/4.224.table index e87cde4bb..014f56e23 100644 --- a/definitions/grib2/tables/19/4.224.table +++ b/definitions/grib2/tables/19/4.224.table @@ -1,18 +1,18 @@ # Code table 4.224 - Categorical outlook -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/19/4.227.table b/definitions/grib2/tables/19/4.227.table index 27c76553d..48c3b7633 100644 --- a/definitions/grib2/tables/19/4.227.table +++ b/definitions/grib2/tables/19/4.227.table @@ -1,9 +1,9 @@ # Code table 4.227 - Icing scenario (weather/cloud classification) -0 0 None -1 1 General -2 2 Convective -3 3 Stratiform -4 4 Freezing -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 None +1 1 General +2 2 Convective +3 3 Stratiform +4 4 Freezing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/19/4.234.table b/definitions/grib2/tables/19/4.234.table index 816541ce9..3b05b4515 100644 --- a/definitions/grib2/tables/19/4.234.table +++ b/definitions/grib2/tables/19/4.234.table @@ -1,21 +1,21 @@ # Code table 4.234 - Canopy cover fraction (to be used as partitioned parameter in product definition template 4.53 or 4.54) -1 1 Crops, mixed farming -2 2 Short grass -3 3 Evergreen needleleaf trees -4 4 Deciduous needleleaf trees -5 5 Deciduous broadleaf trees -6 6 Evergreen broadleaf trees -7 7 Tall grass -8 8 Desert -9 9 Tundra -10 10 Irrigated crops -11 11 Semidesert -12 12 Ice caps and glaciers -13 13 Bogs and marshes -14 14 Inland water -15 15 Ocean -16 16 Evergreen shrubs -17 17 Deciduous shrubs -18 18 Mixed forest -19 19 Interrupted forest -20 20 Water and land mixtures +1 1 Crops, mixed farming +2 2 Short grass +3 3 Evergreen needleleaf trees +4 4 Deciduous needleleaf trees +5 5 Deciduous broadleaf trees +6 6 Evergreen broadleaf trees +7 7 Tall grass +8 8 Desert +9 9 Tundra +10 10 Irrigated crops +11 11 Semidesert +12 12 Ice caps and glaciers +13 13 Bogs and marshes +14 14 Inland water +15 15 Ocean +16 16 Evergreen shrubs +17 17 Deciduous shrubs +18 18 Mixed forest +19 19 Interrupted forest +20 20 Water and land mixtures diff --git a/definitions/grib2/tables/19/4.236.table b/definitions/grib2/tables/19/4.236.table index fbe093ce9..9c58b488c 100644 --- a/definitions/grib2/tables/19/4.236.table +++ b/definitions/grib2/tables/19/4.236.table @@ -1,8 +1,8 @@ # Code table 4.236 - Soil texture fraction (to be used as partitioned parameter in product definition template 4.53 or 4.54) -1 1 Coarse -2 2 Medium -3 3 Medium-fine -4 4 Fine -5 5 Very-fine -6 6 Organic -7 7 Tropical-organic +1 1 Coarse +2 2 Medium +3 3 Medium-fine +4 4 Fine +5 5 Very-fine +6 6 Organic +7 7 Tropical-organic diff --git a/definitions/grib2/tables/19/4.240.table b/definitions/grib2/tables/19/4.240.table index 35e363211..400a13e26 100644 --- a/definitions/grib2/tables/19/4.240.table +++ b/definitions/grib2/tables/19/4.240.table @@ -1,13 +1,13 @@ # Code table 4.240 - Type of distribution function -0 0 No specific distribution function given -1 1 Delta functions with spatially variable concentration and fixed diameters Dl (p1) in metre -2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg -3 3 Gaussian (normal) distribution with spatially variable concentration and fixed mean diameter Dl(p1) and variance(p2) -4 4 Gaussian (normal) distribution with spatially variable concentration, mean diameter and variance -5 5 Log-normal distribution with spatially variable number density, mean diameter and variance -6 6 Log-normal distribution with spatially variable number density, mean diameter and fixed variance(p1) +0 0 No specific distribution function given +1 1 Delta functions with spatially variable concentration and fixed diameters Dl (p1) in metre +2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg +3 3 Gaussian (normal) distribution with spatially variable concentration and fixed mean diameter Dl(p1) and variance(p2) +4 4 Gaussian (normal) distribution with spatially variable concentration, mean diameter and variance +5 5 Log-normal distribution with spatially variable number density, mean diameter and variance +6 6 Log-normal distribution with spatially variable number density, mean diameter and fixed variance(p1) 7 7 Log-normal distribution with spatially variable number density and mass density and fixed variance(p1) and fixed particle density(p2) 8 8 No distribution function. The encoded variable is derived from variables characterized by type of distribution function of type no. 7 (see above) with fixed variance(p1) and fixed particle density(p2) -# 9-49151 Reserved -# 49152-65534 Reserved for local use -65535 65535 Missing value +# 9-49151 Reserved +# 49152-65534 Reserved for local use +65535 65535 Missing value diff --git a/definitions/grib2/tables/19/4.241.table b/definitions/grib2/tables/19/4.241.table index a037b4ba5..5ea7f775a 100644 --- a/definitions/grib2/tables/19/4.241.table +++ b/definitions/grib2/tables/19/4.241.table @@ -1,9 +1,9 @@ # Code table 4.241 - Coverage attributes -0 0 Undefined -1 1 Unmodified -2 2 Snow covered -3 3 Flooded -4 4 Ice covered -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 Undefined +1 1 Unmodified +2 2 Snow covered +3 3 Flooded +4 4 Ice covered +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/19/4.242.table b/definitions/grib2/tables/19/4.242.table index 083f88c29..f6865957c 100644 --- a/definitions/grib2/tables/19/4.242.table +++ b/definitions/grib2/tables/19/4.242.table @@ -1,7 +1,7 @@ # Code table 4.242 - Tile classification -0 0 Reserved -1 1 Land use classes according to ESA-GlobCover GCV2009 -2 2 Land use classes according to European Commission-Global Land Cover Project GLC2000 -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +0 0 Reserved +1 1 Land use classes according to ESA-GlobCover GCV2009 +2 2 Land use classes according to European Commission-Global Land Cover Project GLC2000 +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/19/4.243.table b/definitions/grib2/tables/19/4.243.table index b39053311..24d21b719 100644 --- a/definitions/grib2/tables/19/4.243.table +++ b/definitions/grib2/tables/19/4.243.table @@ -1,43 +1,43 @@ # Code table 4.243 - Tile class -0 0 Reserved -1 1 Evergreen broadleaved forest -2 2 Deciduous broadleaved closed forest -3 3 Deciduous broadleaved open forest -4 4 Evergreen needle-leaf forest -5 5 Deciduous needle-leaf forest -6 6 Mixed leaf trees -7 7 Freshwater flooded trees -8 8 Saline water flooded trees -9 9 Mosaic tree/natural vegetation -10 10 Burnt tree cover -11 11 Evergreen shrubs closed-open -12 12 Deciduous shrubs closed-open -13 13 Herbaceous vegetation closed-open -14 14 Sparse herbaceous or grass -15 15 Flooded shrubs or herbaceous -16 16 Cultivated and managed areas -17 17 Mosaic crop/tree/natural vegetation -18 18 Mosaic crop/shrub/grass -19 19 Bare areas -20 20 Water -21 21 Snow and ice -22 22 Artificial surface -23 23 Ocean -24 24 Irrigated croplands -25 25 Rainfed croplands -26 26 Mosaic cropland (50-70%) - vegetation (20-50%) -27 27 Mosaic vegetation (50-70%) - cropland (20-50%) -28 28 Closed broadleaved evergreen forest -29 29 Closed needle-leaved evergreen forest -30 30 Open needle-leaved deciduous forest -31 31 Mixed broadleaved and needle-leaved forest -32 32 Mosaic shrubland (50-70%) - grassland (20-50%) -33 33 Mosaic grassland (50-70%) - shrubland (20-50%) -34 34 Closed to open shrubland -35 35 Sparse vegetation -36 36 Closed to open forest regularly flooded -37 37 Closed forest or shrubland permanently flooded -38 38 Closed to open grassland regularly flooded -39 39 Undefined -# 40-32767 Reserved -# 32768- Reserved for local use +0 0 Reserved +1 1 Evergreen broadleaved forest +2 2 Deciduous broadleaved closed forest +3 3 Deciduous broadleaved open forest +4 4 Evergreen needle-leaf forest +5 5 Deciduous needle-leaf forest +6 6 Mixed leaf trees +7 7 Freshwater flooded trees +8 8 Saline water flooded trees +9 9 Mosaic tree/natural vegetation +10 10 Burnt tree cover +11 11 Evergreen shrubs closed-open +12 12 Deciduous shrubs closed-open +13 13 Herbaceous vegetation closed-open +14 14 Sparse herbaceous or grass +15 15 Flooded shrubs or herbaceous +16 16 Cultivated and managed areas +17 17 Mosaic crop/tree/natural vegetation +18 18 Mosaic crop/shrub/grass +19 19 Bare areas +20 20 Water +21 21 Snow and ice +22 22 Artificial surface +23 23 Ocean +24 24 Irrigated croplands +25 25 Rainfed croplands +26 26 Mosaic cropland (50-70%) - vegetation (20-50%) +27 27 Mosaic vegetation (50-70%) - cropland (20-50%) +28 28 Closed broadleaved evergreen forest +29 29 Closed needle-leaved evergreen forest +30 30 Open needle-leaved deciduous forest +31 31 Mixed broadleaved and needle-leaved forest +32 32 Mosaic shrubland (50-70%) - grassland (20-50%) +33 33 Mosaic grassland (50-70%) - shrubland (20-50%) +34 34 Closed to open shrubland +35 35 Sparse vegetation +36 36 Closed to open forest regularly flooded +37 37 Closed forest or shrubland permanently flooded +38 38 Closed to open grassland regularly flooded +39 39 Undefined +# 40-32767 Reserved +# 32768- Reserved for local use diff --git a/definitions/grib2/tables/19/4.3.table b/definitions/grib2/tables/19/4.3.table index 8ba9e08ab..cea1bef4f 100644 --- a/definitions/grib2/tables/19/4.3.table +++ b/definitions/grib2/tables/19/4.3.table @@ -1,23 +1,23 @@ # Code table 4.3 - Type of generating process -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast -12 12 Post-processed analysis -13 13 Post-processed forecast -14 14 Nowcast -15 15 Hindcast -16 16 Physical retrieval -17 17 Regression analysis -18 18 Difference between two forecasts -# 19-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +12 12 Post-processed analysis +13 13 Post-processed forecast +14 14 Nowcast +15 15 Hindcast +16 16 Physical retrieval +17 17 Regression analysis +18 18 Difference between two forecasts +# 19-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.4.table b/definitions/grib2/tables/19/4.4.table index 7087ebddb..6e63e069c 100644 --- a/definitions/grib2/tables/19/4.4.table +++ b/definitions/grib2/tables/19/4.4.table @@ -1,17 +1,17 @@ # Code table 4.4 - Indicator of unit of time range -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.5.table b/definitions/grib2/tables/19/4.5.table index 2f1a8a8b7..33abd6293 100644 --- a/definitions/grib2/tables/19/4.5.table +++ b/definitions/grib2/tables/19/4.5.table @@ -1,5 +1,5 @@ # Code table 4.5 - Fixed surface types and units -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface (-) 2 2 Cloud base level (-) 3 3 Level of cloud tops (-) @@ -16,15 +16,15 @@ 14 14 Level of free convection (LFC) 15 15 Convective condensation level (CCL) 16 16 Level of neutral buoyancy or equilibrium level (LNB) -# 17-19 Reserved +# 17-19 Reserved 20 20 Isothermal level (K) 21 21 Lowest level where mass density exceeds the specified value (base for a given threshold of mass density) (kg m-3) 22 22 Highest level where mass density exceeds the specified value (top for a given threshold of mass density) (kg m-3) 23 23 Lowest level where air concentration exceeds the specified value (base for a given threshold of air concentration) (Bq m-3) 24 24 Highest level where air concentration exceeds the specified value (top for a given threshold of air concentration) (Bq m-3) -# 25-99 Reserved +# 25-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -33,20 +33,20 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level (-) -112 112 Reserved -113 113 Logarithmic hybrid level +112 112 Reserved +113 113 Logarithmic hybrid level 114 114 Snow level (Numeric) 115 115 Sigma height level # 116 Reserved 117 117 Mixed layer depth (m) 118 hhl Hybrid height level (-) 119 hpl Hybrid pressure level (-) -# 120-149 Reserved -150 150 Generalized vertical height coordinate +# 120-149 Reserved +150 150 Generalized vertical height coordinate 151 sol Soil level (Numeric) -# 152-159 Reserved +# 152-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 sfc Lake or river bottom (-) @@ -55,7 +55,7 @@ 165 165 Bottom of sediment layer penetrated by thermal wave (-) 166 sfc Mixing layer (-) 167 167 Bottom of root zone (-) -# 168-173 Reserved +# 168-173 Reserved 174 sfc Top surface of ice on sea, lake or river 175 175 Top surface of ice, under snow cover, on sea, lake or river 176 176 Bottom surface (underside) ice on sea, lake or river @@ -67,6 +67,6 @@ 182 182 Grid tile water fraction as a model surface 183 183 Grid tile ice fraction on sea, lake or river as a model surface 184 184 Grid tile glacier ice and inland ice fraction as a model surface -# 185-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 185-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.6.table b/definitions/grib2/tables/19/4.6.table index b2dfeb498..ce799721d 100644 --- a/definitions/grib2/tables/19/4.6.table +++ b/definitions/grib2/tables/19/4.6.table @@ -1,9 +1,9 @@ # Code table 4.6 - Type of ensemble forecast -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.7.table b/definitions/grib2/tables/19/4.7.table index e0de0e1b2..69b2b4d77 100644 --- a/definitions/grib2/tables/19/4.7.table +++ b/definitions/grib2/tables/19/4.7.table @@ -1,14 +1,14 @@ # Code table 4.7 - Derived forecast -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.8.table b/definitions/grib2/tables/19/4.8.table index ad883039c..78467454a 100644 --- a/definitions/grib2/tables/19/4.8.table +++ b/definitions/grib2/tables/19/4.8.table @@ -1,6 +1,6 @@ # Code table 4.8 - Clustering method -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.9.table b/definitions/grib2/tables/19/4.9.table index 5878b5ad3..0ce312dd1 100644 --- a/definitions/grib2/tables/19/4.9.table +++ b/definitions/grib2/tables/19/4.9.table @@ -1,9 +1,9 @@ # Code table 4.9 - Probability type -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/4.91.table b/definitions/grib2/tables/19/4.91.table index 44cf25f44..ae31ed61c 100644 --- a/definitions/grib2/tables/19/4.91.table +++ b/definitions/grib2/tables/19/4.91.table @@ -1,16 +1,16 @@ # Code table 4.91 - Type of Interval -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit -11 11 Equal to first limit -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit +11 11 Equal to first limit +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/19/5.0.table b/definitions/grib2/tables/19/5.0.table index 33597681b..4d6cc68c8 100644 --- a/definitions/grib2/tables/19/5.0.table +++ b/definitions/grib2/tables/19/5.0.table @@ -1,24 +1,24 @@ # Code table 5.0 - Data representation template number -0 0 Grid point data - simple packing -1 1 Matrix value at grid point - simple packing -2 2 Grid point data - complex packing -3 3 Grid point data - complex packing and spatial differencing -4 4 Grid point data - IEEE floating point data -40 40 Grid point data - JPEG 2000 code stream format -41 41 Grid point data - Portable Network Graphics (PNG) +0 0 Grid point data - simple packing +1 1 Matrix value at grid point - simple packing +2 2 Grid point data - complex packing +3 3 Grid point data - complex packing and spatial differencing +4 4 Grid point data - IEEE floating point data +40 40 Grid point data - JPEG 2000 code stream format +41 41 Grid point data - Portable Network Graphics (PNG) 42 42 Grid point data - CCSDS recommended lossless compression -# 43-49 Reserved -50 50 Spectral data - simple packing -51 51 Spherical harmonics data - complex packing -# 52-60 Reserved -61 61 Grid point data - simple packing with logarithm pre-processing -# 62-199 Reserved -200 200 Run length packing with level values -# 201-49151 Reserved -# 49152-65534 Reserved for local use +# 43-49 Reserved +50 50 Spectral data - simple packing +51 51 Spherical harmonics data - complex packing +# 52-60 Reserved +61 61 Grid point data - simple packing with logarithm pre-processing +# 62-199 Reserved +200 200 Run length packing with level values +# 201-49151 Reserved +# 49152-65534 Reserved for local use 40000 40000 JPEG2000 Packing 40010 40010 PNG pacling 50000 50000 Sperical harmonics ieee packing 50001 50001 Second order packing 50002 50002 Second order packing -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/19/5.1.table b/definitions/grib2/tables/19/5.1.table index 854330c74..1189b5e46 100644 --- a/definitions/grib2/tables/19/5.1.table +++ b/definitions/grib2/tables/19/5.1.table @@ -1,6 +1,6 @@ # Code table 5.1 - Type of original field values -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/5.2.table b/definitions/grib2/tables/19/5.2.table index 40586a131..d77fdf4e7 100644 --- a/definitions/grib2/tables/19/5.2.table +++ b/definitions/grib2/tables/19/5.2.table @@ -1,8 +1,8 @@ # Code table 5.2 - Matrix coordinate value function definition -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/5.3.table b/definitions/grib2/tables/19/5.3.table index c3b7b30fe..481331791 100644 --- a/definitions/grib2/tables/19/5.3.table +++ b/definitions/grib2/tables/19/5.3.table @@ -1,7 +1,7 @@ # Code table 5.3 - Matrix coordinate parameter -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/5.4.table b/definitions/grib2/tables/19/5.4.table index 8121c1819..e84ab1901 100644 --- a/definitions/grib2/tables/19/5.4.table +++ b/definitions/grib2/tables/19/5.4.table @@ -1,6 +1,6 @@ # Code table 5.4 - Group splitting method -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/5.40.table b/definitions/grib2/tables/19/5.40.table index b9bad2c39..97e8880ab 100644 --- a/definitions/grib2/tables/19/5.40.table +++ b/definitions/grib2/tables/19/5.40.table @@ -1,5 +1,5 @@ # Code table 5.40 - Type of compression -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/19/5.5.table b/definitions/grib2/tables/19/5.5.table index 3ef3eb070..f2316975a 100644 --- a/definitions/grib2/tables/19/5.5.table +++ b/definitions/grib2/tables/19/5.5.table @@ -1,7 +1,7 @@ # Code table 5.5 - Missing value management for complex packing -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/5.6.table b/definitions/grib2/tables/19/5.6.table index 6d5177877..db68ead9c 100644 --- a/definitions/grib2/tables/19/5.6.table +++ b/definitions/grib2/tables/19/5.6.table @@ -1,7 +1,7 @@ # Code table 5.6 - Order of spatial differencing -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/19/5.7.table b/definitions/grib2/tables/19/5.7.table index 5ab780056..e54862c19 100644 --- a/definitions/grib2/tables/19/5.7.table +++ b/definitions/grib2/tables/19/5.7.table @@ -1,7 +1,7 @@ # Code table 5.7 - Precision of floating-point numbers -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/19/6.0.table b/definitions/grib2/tables/19/6.0.table index 2a29aa285..a8f30f5a4 100644 --- a/definitions/grib2/tables/19/6.0.table +++ b/definitions/grib2/tables/19/6.0.table @@ -1,6 +1,6 @@ # Code table 6.0 - Bit map indicator -0 0 A bit map applies to this product and is specified in this Section +0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/32/4.252.table b/definitions/grib2/tables/32/4.252.table index f13d72689..961928cd4 100644 --- a/definitions/grib2/tables/32/4.252.table +++ b/definitions/grib2/tables/32/4.252.table @@ -161,5 +161,5 @@ # 4023-4500 Reserved for tile class entries for tile models using the European Commission-Global Land Cover Project GLC2000 survey # 4501-5000 Reserved for tile grouping entries for tile models using the European Commission-Global Land Cover Project GLC2000 survey # 5001-32767 Reserved for additional land cover surveys -# 32768-65534 Reserved for local use -65535 65535 Missing \ No newline at end of file +# 32768-65534 Reserved for local use +65535 65535 Missing \ No newline at end of file diff --git a/definitions/grib2/tables/6/1.1.table b/definitions/grib2/tables/6/1.1.table index 6c5a60361..6ccac21de 100644 --- a/definitions/grib2/tables/6/1.1.table +++ b/definitions/grib2/tables/6/1.1.table @@ -1,5 +1,5 @@ # Code Table 1.1 GRIB Local Tables Version Number -0 0 Local tables not used +0 0 Local tables not used # . Only table entries and templates from the current Master table are valid. # 1-254 Number of local tables version used 255 255 Missing diff --git a/definitions/grib2/tables/6/4.5.table b/definitions/grib2/tables/6/4.5.table index 9be96e9da..5b80a90fc 100644 --- a/definitions/grib2/tables/6/4.5.table +++ b/definitions/grib2/tables/6/4.5.table @@ -1,13 +1,13 @@ #Code table 4.5: Fixed surface types and units 0 0 Reserved -1 sfc Ground or water surface -2 2 Cloud base level -3 3 Level of cloud tops -4 4 Level of 0 degree C isotherm +1 sfc Ground or water surface +2 2 Cloud base level +3 3 Level of cloud tops +4 4 Level of 0 degree C isotherm 5 5 Level of adiabatic condensation lifted from the surface -6 6 Maximum wind level -7 sfc Tropopause -8 sfc Nominal top of the atmosphere +6 6 Maximum wind level +7 sfc Tropopause +8 sfc Nominal top of the atmosphere 9 9 Sea bottom 10 10 Entire atmosphere 11 11 Cumulonimbus (CB) base (m) diff --git a/definitions/grib2/tables/7/1.1.table b/definitions/grib2/tables/7/1.1.table index 6c5a60361..6ccac21de 100644 --- a/definitions/grib2/tables/7/1.1.table +++ b/definitions/grib2/tables/7/1.1.table @@ -1,5 +1,5 @@ # Code Table 1.1 GRIB Local Tables Version Number -0 0 Local tables not used +0 0 Local tables not used # . Only table entries and templates from the current Master table are valid. # 1-254 Number of local tables version used 255 255 Missing diff --git a/definitions/grib2/tables/7/3.10.table b/definitions/grib2/tables/7/3.10.table index e4a446b9a..04686d32e 100644 --- a/definitions/grib2/tables/7/3.10.table +++ b/definitions/grib2/tables/7/3.10.table @@ -5,4 +5,4 @@ 2 1 Points scan in -j direction, i.e. from east to west 3 0 Adjacent points in i direction are consecutive 3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +# 4-8 Reserved diff --git a/definitions/grib2/tables/7/3.4.table b/definitions/grib2/tables/7/3.4.table index 72e3343b7..d3cad225c 100644 --- a/definitions/grib2/tables/7/3.4.table +++ b/definitions/grib2/tables/7/3.4.table @@ -7,4 +7,4 @@ 3 1 Adjacent points in j (y) direction is consecutive 4 0 All rows scan in the same direction 4 1 Adjacent rows scans in the opposite direction -# 5-8 Reserved +# 5-8 Reserved diff --git a/definitions/grib2/tables/7/3.9.table b/definitions/grib2/tables/7/3.9.table index 5edac03a5..cc2e6104b 100644 --- a/definitions/grib2/tables/7/3.9.table +++ b/definitions/grib2/tables/7/3.9.table @@ -1,4 +1,4 @@ # FLAG TABLE 3.9, Numbering order of diamonds as seen from the corresponding pole 1 0 Clockwise orientation 1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +# 2-8 Reserved diff --git a/definitions/grib2/tables/7/4.5.table b/definitions/grib2/tables/7/4.5.table index 9be96e9da..5b80a90fc 100644 --- a/definitions/grib2/tables/7/4.5.table +++ b/definitions/grib2/tables/7/4.5.table @@ -1,13 +1,13 @@ #Code table 4.5: Fixed surface types and units 0 0 Reserved -1 sfc Ground or water surface -2 2 Cloud base level -3 3 Level of cloud tops -4 4 Level of 0 degree C isotherm +1 sfc Ground or water surface +2 2 Cloud base level +3 3 Level of cloud tops +4 4 Level of 0 degree C isotherm 5 5 Level of adiabatic condensation lifted from the surface -6 6 Maximum wind level -7 sfc Tropopause -8 sfc Nominal top of the atmosphere +6 6 Maximum wind level +7 sfc Tropopause +8 sfc Nominal top of the atmosphere 9 9 Sea bottom 10 10 Entire atmosphere 11 11 Cumulonimbus (CB) base (m) diff --git a/definitions/grib2/tables/8/0.0.table b/definitions/grib2/tables/8/0.0.table index 1d3a90b49..88d8b2cb3 100644 --- a/definitions/grib2/tables/8/0.0.table +++ b/definitions/grib2/tables/8/0.0.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/1.0.table b/definitions/grib2/tables/8/1.0.table index dc3fcebf0..9f43a852b 100644 --- a/definitions/grib2/tables/8/1.0.table +++ b/definitions/grib2/tables/8/1.0.table @@ -1,13 +1,13 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Experimental -1 1 Version implemented on 7 November 2001 -2 2 Version implemented on 4 November 2003 -3 3 Version implemented on 2 November 2005 -4 4 Version implemented on 7 November 2007 -5 5 Version implemented on 4 November 2009 -6 6 Version implemented on 15 September 2010 -7 7 Version implemented on 4 May 2011 -8 8 Version implemented on 2 November 2011 -9 9 Pre-operational to be implemented by next amendment -# 10-254 Future versions +0 0 Experimental +1 1 Version implemented on 7 November 2001 +2 2 Version implemented on 4 November 2003 +3 3 Version implemented on 2 November 2005 +4 4 Version implemented on 7 November 2007 +5 5 Version implemented on 4 November 2009 +6 6 Version implemented on 15 September 2010 +7 7 Version implemented on 4 May 2011 +8 8 Version implemented on 2 November 2011 +9 9 Pre-operational to be implemented by next amendment +# 10-254 Future versions 255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. diff --git a/definitions/grib2/tables/8/1.1.table b/definitions/grib2/tables/8/1.1.table index 91ef66244..55fa1eb63 100644 --- a/definitions/grib2/tables/8/1.1.table +++ b/definitions/grib2/tables/8/1.1.table @@ -1,4 +1,4 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/8/1.2.table b/definitions/grib2/tables/8/1.2.table index d90ad0109..606bf8300 100644 --- a/definitions/grib2/tables/8/1.2.table +++ b/definitions/grib2/tables/8/1.2.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/1.3.table b/definitions/grib2/tables/8/1.3.table index 35cd6a636..712bb2ba8 100644 --- a/definitions/grib2/tables/8/1.3.table +++ b/definitions/grib2/tables/8/1.3.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products -4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) -5 5 THORPEX Interactive Grand Global Ensemble (TIGGE) test -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products +4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) +5 5 THORPEX Interactive Grand Global Ensemble (TIGGE) test +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/1.4.table b/definitions/grib2/tables/8/1.4.table index d11a335a7..7f47afd96 100644 --- a/definitions/grib2/tables/8/1.4.table +++ b/definitions/grib2/tables/8/1.4.table @@ -1,13 +1,13 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/8/3.0.table b/definitions/grib2/tables/8/3.0.table index 4baed0aab..4269b25ad 100644 --- a/definitions/grib2/tables/8/3.0.table +++ b/definitions/grib2/tables/8/3.0.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/8/3.10.table b/definitions/grib2/tables/8/3.10.table index 23c1cdd36..da36dc664 100644 --- a/definitions/grib2/tables/8/3.10.table +++ b/definitions/grib2/tables/8/3.10.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/8/3.11.table b/definitions/grib2/tables/8/3.11.table index 560318d1b..0a299af98 100644 --- a/definitions/grib2/tables/8/3.11.table +++ b/definitions/grib2/tables/8/3.11.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 There is no appended list +0 0 There is no appended list 1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows 2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row 3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) diff --git a/definitions/grib2/tables/8/3.15.table b/definitions/grib2/tables/8/3.15.table index 55ca1688a..976862747 100644 --- a/definitions/grib2/tables/8/3.15.table +++ b/definitions/grib2/tables/8/3.15.table @@ -1,22 +1,22 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) -# 113-159 Reserved +# 113-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/3.2.table b/definitions/grib2/tables/8/3.2.table index 3d7a4f1fc..563efbdb5 100644 --- a/definitions/grib2/tables/8/3.2.table +++ b/definitions/grib2/tables/8/3.2.table @@ -1,13 +1,13 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame -# 9-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame +# 9-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/3.20.table b/definitions/grib2/tables/8/3.20.table index 3f7ab4cc4..63de6b1a9 100644 --- a/definitions/grib2/tables/8/3.20.table +++ b/definitions/grib2/tables/8/3.20.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/3.21.table b/definitions/grib2/tables/8/3.21.table index b0c77d135..2bc46aae9 100644 --- a/definitions/grib2/tables/8/3.21.table +++ b/definitions/grib2/tables/8/3.21.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/3.3.table b/definitions/grib2/tables/8/3.3.table index 5167ed6b7..bd47e2509 100644 --- a/definitions/grib2/tables/8/3.3.table +++ b/definitions/grib2/tables/8/3.3.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/8/3.4.table b/definitions/grib2/tables/8/3.4.table index 6253896b1..752c70757 100644 --- a/definitions/grib2/tables/8/3.4.table +++ b/definitions/grib2/tables/8/3.4.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -# 5-8 Reserved +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +# 5-8 Reserved diff --git a/definitions/grib2/tables/8/3.5.table b/definitions/grib2/tables/8/3.5.table index 8ccf0f13b..6d3ec036e 100644 --- a/definitions/grib2/tables/8/3.5.table +++ b/definitions/grib2/tables/8/3.5.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/8/3.7.table b/definitions/grib2/tables/8/3.7.table index 41bba8329..4b2e684d3 100644 --- a/definitions/grib2/tables/8/3.7.table +++ b/definitions/grib2/tables/8/3.7.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Reserved 1 1 The complex numbers Fnm (see code figure 1 in Code Table 3.6 above) are stored for m>=0 as pairs of real numbers Re(Fnm), Im(Fnm) ordered with n increasing from m to N(m), first for m=0 and then for m=1, 2, ... M. (see Note 1) -# 2-254 Reserved +# 2-254 Reserved 255 255 Missing diff --git a/definitions/grib2/tables/8/3.8.table b/definitions/grib2/tables/8/3.8.table index 4e811917b..6df554ae9 100644 --- a/definitions/grib2/tables/8/3.8.table +++ b/definitions/grib2/tables/8/3.8.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/3.9.table b/definitions/grib2/tables/8/3.9.table index f35b7ca53..530d1dee0 100644 --- a/definitions/grib2/tables/8/3.9.table +++ b/definitions/grib2/tables/8/3.9.table @@ -1,4 +1,4 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/8/4.0.table b/definitions/grib2/tables/8/4.0.table index faa4f59df..0852d9f0d 100644 --- a/definitions/grib2/tables/8/4.0.table +++ b/definitions/grib2/tables/8/4.0.table @@ -1,52 +1,52 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time 8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically-processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically-processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data # 33-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents 42 42 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 atmospheric chemical constituents 43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol 46 46 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 aerosol 47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non continuous time interval for aerosol 48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of atmospheric aerosol -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time -# 52-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +# 52-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved +# 1102-32767 Reserved # 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data diff --git a/definitions/grib2/tables/8/4.1.0.table b/definitions/grib2/tables/8/4.1.0.table index 361108860..3413dbad5 100644 --- a/definitions/grib2/tables/8/4.1.0.table +++ b/definitions/grib2/tables/8/4.1.0.table @@ -1,27 +1,27 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.1.1.table b/definitions/grib2/tables/8/4.1.1.table index 29f1dec79..dea5bc49e 100644 --- a/definitions/grib2/tables/8/4.1.1.table +++ b/definitions/grib2/tables/8/4.1.1.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.1.10.table b/definitions/grib2/tables/8/4.1.10.table index 9c8c92b12..e6ce6faf7 100644 --- a/definitions/grib2/tables/8/4.1.10.table +++ b/definitions/grib2/tables/8/4.1.10.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Sub-surface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Sub-surface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.1.2.table b/definitions/grib2/tables/8/4.1.2.table index b90201c63..805836998 100644 --- a/definitions/grib2/tables/8/4.1.2.table +++ b/definitions/grib2/tables/8/4.1.2.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.1.3.table b/definitions/grib2/tables/8/4.1.3.table index 3c947b136..c96617665 100644 --- a/definitions/grib2/tables/8/4.1.3.table +++ b/definitions/grib2/tables/8/4.1.3.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Image format products -1 1 Quantitative products -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.10.table b/definitions/grib2/tables/8/4.10.table index 0e5170876..a13fb00b4 100644 --- a/definitions/grib2/tables/8/4.10.table +++ b/definitions/grib2/tables/8/4.10.table @@ -1,15 +1,15 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -# 11-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +# 11-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/8/4.11.table b/definitions/grib2/tables/8/4.11.table index 1257d1b09..af9ff29ad 100644 --- a/definitions/grib2/tables/8/4.11.table +++ b/definitions/grib2/tables/8/4.11.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.12.table b/definitions/grib2/tables/8/4.12.table index e06a3be5b..6cab67bf5 100644 --- a/definitions/grib2/tables/8/4.12.table +++ b/definitions/grib2/tables/8/4.12.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.13.table b/definitions/grib2/tables/8/4.13.table index 107ace60c..f090fb9ae 100644 --- a/definitions/grib2/tables/8/4.13.table +++ b/definitions/grib2/tables/8/4.13.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No quality control applied -1 1 Quality control applied -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.14.table b/definitions/grib2/tables/8/4.14.table index 9ed9078a8..bcb04f328 100644 --- a/definitions/grib2/tables/8/4.14.table +++ b/definitions/grib2/tables/8/4.14.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No clutter filter used -1 1 Clutter filter used +0 0 No clutter filter used +1 1 Clutter filter used # 2-191 Reserved # 192-254 Reserved for local use -255 255 Missing +255 255 Missing diff --git a/definitions/grib2/tables/8/4.15.table b/definitions/grib2/tables/8/4.15.table index 97cdcd2ee..6e1ef5745 100644 --- a/definitions/grib2/tables/8/4.15.table +++ b/definitions/grib2/tables/8/4.15.table @@ -1,11 +1,11 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.0.table b/definitions/grib2/tables/8/4.2.0.0.table index debc0a6f4..8656f8974 100644 --- a/definitions/grib2/tables/8/4.2.0.0.table +++ b/definitions/grib2/tables/8/4.2.0.0.table @@ -20,6 +20,6 @@ 18 18 Snow temperature (top of snow) (K) 19 19 Turbulent transfer coefficient for heat (Numeric) 20 20 Turbulent diffusion coefficient for heat (m2/s) -# 21-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 21-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.1.table b/definitions/grib2/tables/8/4.2.0.1.table index 1922792a6..8ee93e99b 100644 --- a/definitions/grib2/tables/8/4.2.0.1.table +++ b/definitions/grib2/tables/8/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,10 +86,10 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rain water content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) -# 93-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 93-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.13.table b/definitions/grib2/tables/8/4.2.0.13.table index b9979f0d3..90ab7d1b9 100644 --- a/definitions/grib2/tables/8/4.2.0.13.table +++ b/definitions/grib2/tables/8/4.2.0.13.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.14.table b/definitions/grib2/tables/8/4.2.0.14.table index 4a2a4e128..fca42ccc7 100644 --- a/definitions/grib2/tables/8/4.2.0.14.table +++ b/definitions/grib2/tables/8/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.15.table b/definitions/grib2/tables/8/4.2.0.15.table index a7fa034b0..c89ecd203 100644 --- a/definitions/grib2/tables/8/4.2.0.15.table +++ b/definitions/grib2/tables/8/4.2.0.15.table @@ -14,6 +14,6 @@ 12 12 Reflectivity of rain (dB) 13 13 Reflectivity of graupel (dB) 14 14 Reflectivity of hail (dB) -# 15-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 15-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.16.table b/definitions/grib2/tables/8/4.2.0.16.table index 39215ab20..18dedb7c0 100644 --- a/definitions/grib2/tables/8/4.2.0.16.table +++ b/definitions/grib2/tables/8/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.18.table b/definitions/grib2/tables/8/4.2.0.18.table index 30060fd2d..165aa6008 100644 --- a/definitions/grib2/tables/8/4.2.0.18.table +++ b/definitions/grib2/tables/8/4.2.0.18.table @@ -8,11 +8,11 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) 13 13 Total deposition (wet + dry) (Bq m-2) -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.19.table b/definitions/grib2/tables/8/4.2.0.19.table index 1bbbd4243..1a2f91974 100644 --- a/definitions/grib2/tables/8/4.2.0.19.table +++ b/definitions/grib2/tables/8/4.2.0.19.table @@ -26,6 +26,6 @@ 24 24 Convective turbulent kinetic energy (J/kg) 25 25 Weather Interpretation ww (WMO) (-) 26 26 Convective outlook (Code table 4.224) -# 27-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 27-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.190.table b/definitions/grib2/tables/8/4.2.0.190.table index 39fb55746..3d9d5ff85 100644 --- a/definitions/grib2/tables/8/4.2.0.190.table +++ b/definitions/grib2/tables/8/4.2.0.190.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.191.table b/definitions/grib2/tables/8/4.2.0.191.table index 81230c0e0..4ff12e532 100644 --- a/definitions/grib2/tables/8/4.2.0.191.table +++ b/definitions/grib2/tables/8/4.2.0.191.table @@ -2,6 +2,6 @@ 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/8/4.2.0.2.table b/definitions/grib2/tables/8/4.2.0.2.table index 58428f66a..f93074e5e 100644 --- a/definitions/grib2/tables/8/4.2.0.2.table +++ b/definitions/grib2/tables/8/4.2.0.2.table @@ -33,6 +33,6 @@ 31 31 Turbulent diffusion coefficient for momentum (m2/s) 32 32 Eta coordinate vertical velocity (/s) 33 33 Wind fetch (m) -# 34-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 34-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.20.table b/definitions/grib2/tables/8/4.2.0.20.table index d0ef4b3a0..2bee70352 100644 --- a/definitions/grib2/tables/8/4.2.0.20.table +++ b/definitions/grib2/tables/8/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (Sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -25,7 +25,7 @@ 57 57 Total yearly average burden of the atmosphere (mol) 58 58 Total yearly averaged atmospheric loss (mol/s) 59 59 Aerosol number concentration (m-3) -# 60-99 Reserved +# 60-99 Reserved 100 100 Surface area density (aerosol) (/m) 101 101 Atmosphere optical thickness (m) 102 102 Aerosol optical thickness (Numeric) @@ -37,6 +37,6 @@ 108 108 Aerosol lidar backscatter from the ground (m-1 sr-1) 109 109 Aerosol lidar extinction from satellite (m-1) 110 110 Aerosol lidar extinction from the ground (m-1) -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.3.table b/definitions/grib2/tables/8/4.2.0.3.table index b337cbd06..18c33fdf8 100644 --- a/definitions/grib2/tables/8/4.2.0.3.table +++ b/definitions/grib2/tables/8/4.2.0.3.table @@ -25,6 +25,6 @@ 23 23 Gravity wave dissipation (W m-2) 24 24 Anisotropy of sub-gridscale orography (Numeric) 25 25 Natural logarithm of pressure in Pa (Numeric) -# 26-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 26-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.4.table b/definitions/grib2/tables/8/4.2.0.4.table index fea4cafc3..336fdb421 100644 --- a/definitions/grib2/tables/8/4.2.0.4.table +++ b/definitions/grib2/tables/8/4.2.0.4.table @@ -12,9 +12,9 @@ 10 10 Photosynthetically active radiation (W m-2) 11 11 Net short-wave radiation flux, clear sky (W m-2) 12 12 Downward UV radiation (W m-2) -# 13-49 Reserved +# 13-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) -# 52-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 52-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.5.table b/definitions/grib2/tables/8/4.2.0.5.table index aae853bf9..607235064 100644 --- a/definitions/grib2/tables/8/4.2.0.5.table +++ b/definitions/grib2/tables/8/4.2.0.5.table @@ -6,6 +6,6 @@ 4 4 Upward long-wave radiation flux (W m-2) 5 5 Net long wave radiation flux (W m-2) 6 6 Net long-wave radiation flux, clear sky (W m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.6.table b/definitions/grib2/tables/8/4.2.0.6.table index 462727d0b..747fd8088 100644 --- a/definitions/grib2/tables/8/4.2.0.6.table +++ b/definitions/grib2/tables/8/4.2.0.6.table @@ -33,6 +33,6 @@ 31 31 Number density of cloud ice (m-3) 32 32 Fraction of cloud cover (Numeric) 33 33 Sunshine duration (s) -# 34-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 34-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.0.7.table b/definitions/grib2/tables/8/4.2.0.7.table index 7a7d2008b..6c1794c73 100644 --- a/definitions/grib2/tables/8/4.2.0.7.table +++ b/definitions/grib2/tables/8/4.2.0.7.table @@ -13,8 +13,8 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraft helicity (m2 s-2) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.1.0.table b/definitions/grib2/tables/8/4.2.1.0.table index bf1e3e93f..9c4d129da 100644 --- a/definitions/grib2/tables/8/4.2.1.0.table +++ b/definitions/grib2/tables/8/4.2.1.0.table @@ -6,6 +6,6 @@ 4 4 Snow water equivalent per cent of normal (%) 5 5 Baseflow-groundwater runoff (kg m-2) 6 6 Storm surface runoff (kg m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.1.1.table b/definitions/grib2/tables/8/4.2.1.1.table index cb5117dc8..aa560e479 100644 --- a/definitions/grib2/tables/8/4.2.1.1.table +++ b/definitions/grib2/tables/8/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.10.0.table b/definitions/grib2/tables/8/4.2.10.0.table index eb9d1fa65..c00ce058f 100644 --- a/definitions/grib2/tables/8/4.2.10.0.table +++ b/definitions/grib2/tables/8/4.2.10.0.table @@ -48,6 +48,6 @@ 46 46 2-dim spectral energy density (m2 s) 47 47 Frequency spectral energy density (m2 s) 48 48 Directional spectral energy density -# 49-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 49-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.10.1.table b/definitions/grib2/tables/8/4.2.10.1.table index 5a33bac5d..a076fb07c 100644 --- a/definitions/grib2/tables/8/4.2.10.1.table +++ b/definitions/grib2/tables/8/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.10.191.table b/definitions/grib2/tables/8/4.2.10.191.table index 14085ac9a..6cafbd3d4 100644 --- a/definitions/grib2/tables/8/4.2.10.191.table +++ b/definitions/grib2/tables/8/4.2.10.191.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Meridional overturning stream function (m3/s) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.10.2.table b/definitions/grib2/tables/8/4.2.10.2.table index a69b2622c..80fe973be 100644 --- a/definitions/grib2/tables/8/4.2.10.2.table +++ b/definitions/grib2/tables/8/4.2.10.2.table @@ -9,6 +9,6 @@ 7 7 Ice divergence (/s) 8 8 Ice temperature (K) 9 9 Ice internal pressure (Pa m) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.10.3.table b/definitions/grib2/tables/8/4.2.10.3.table index 112af09d5..3b9a2df46 100644 --- a/definitions/grib2/tables/8/4.2.10.3.table +++ b/definitions/grib2/tables/8/4.2.10.3.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.10.4.table b/definitions/grib2/tables/8/4.2.10.4.table index d80a32780..91ffb2b29 100644 --- a/definitions/grib2/tables/8/4.2.10.4.table +++ b/definitions/grib2/tables/8/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2 s-1) 6 6 Ocean vertical momentum diffusivity (m2 s-1) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (m-1) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.2.0.table b/definitions/grib2/tables/8/4.2.2.0.table index b440b9426..083fc5913 100644 --- a/definitions/grib2/tables/8/4.2.2.0.table +++ b/definitions/grib2/tables/8/4.2.2.0.table @@ -32,6 +32,6 @@ 30 30 Deciduous forest (Numeric) 31 31 Normalized differential vegetation index (NDVI) (Numeric) 32 32 Root depth of vegetation (m) -# 33-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 33-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.2.3.table b/definitions/grib2/tables/8/4.2.2.3.table index 80113a4bd..a9ec602e6 100644 --- a/definitions/grib2/tables/8/4.2.2.3.table +++ b/definitions/grib2/tables/8/4.2.2.3.table @@ -22,6 +22,6 @@ 20 20 Column-integrated soil moisture (kg m-2) 21 21 Soil ice (kg m-3) 22 22 Column-integrated soil ice (kg m-2) -# 23-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 23-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.3.0.table b/definitions/grib2/tables/8/4.2.3.0.table index 254e56bc8..8c19d43b2 100644 --- a/definitions/grib2/tables/8/4.2.3.0.table +++ b/definitions/grib2/tables/8/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.2.3.1.table b/definitions/grib2/tables/8/4.2.3.1.table index 16eee69c4..d199aff60 100644 --- a/definitions/grib2/tables/8/4.2.3.1.table +++ b/definitions/grib2/tables/8/4.2.3.1.table @@ -17,12 +17,12 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) 20 20 Aerosol optical thickness at 0.635 um 21 21 Aerosol optical thickness at 0.810 um 22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +23 23 Angstrom coefficient +# 24-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.201.table b/definitions/grib2/tables/8/4.201.table index ebb698b38..e16d5d808 100644 --- a/definitions/grib2/tables/8/4.201.table +++ b/definitions/grib2/tables/8/4.201.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Rain -2 2 Thunderstorm -3 3 Freezing rain -4 4 Mixed/ice -5 5 Snow -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.202.table b/definitions/grib2/tables/8/4.202.table index 943c03f6f..aa93458f1 100644 --- a/definitions/grib2/tables/8/4.202.table +++ b/definitions/grib2/tables/8/4.202.table @@ -1,4 +1,4 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -# 0-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.203.table b/definitions/grib2/tables/8/4.203.table index fce5a15b1..9a8d29e01 100644 --- a/definitions/grib2/tables/8/4.203.table +++ b/definitions/grib2/tables/8/4.203.table @@ -1,25 +1,25 @@ -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.205.table b/definitions/grib2/tables/8/4.205.table index 8d425ab9d..3fadf7d80 100644 --- a/definitions/grib2/tables/8/4.205.table +++ b/definitions/grib2/tables/8/4.205.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.206.table b/definitions/grib2/tables/8/4.206.table index 0be7fd4f8..43b0ba137 100644 --- a/definitions/grib2/tables/8/4.206.table +++ b/definitions/grib2/tables/8/4.206.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.207.table b/definitions/grib2/tables/8/4.207.table index fde9eb477..815a5777e 100644 --- a/definitions/grib2/tables/8/4.207.table +++ b/definitions/grib2/tables/8/4.207.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.208.table b/definitions/grib2/tables/8/4.208.table index 196becaaf..23ea97317 100644 --- a/definitions/grib2/tables/8/4.208.table +++ b/definitions/grib2/tables/8/4.208.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.209.table b/definitions/grib2/tables/8/4.209.table index 351c0f431..53c6c5eba 100644 --- a/definitions/grib2/tables/8/4.209.table +++ b/definitions/grib2/tables/8/4.209.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Stable -2 2 Mechanically-driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically-driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.210.table b/definitions/grib2/tables/8/4.210.table index 1c00b8c6f..149b2ba06 100644 --- a/definitions/grib2/tables/8/4.210.table +++ b/definitions/grib2/tables/8/4.210.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Contrail not present -1 1 Contrail present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Contrail not present +1 1 Contrail present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.211.table b/definitions/grib2/tables/8/4.211.table index 66ef656f6..b5753f19f 100644 --- a/definitions/grib2/tables/8/4.211.table +++ b/definitions/grib2/tables/8/4.211.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.212.table b/definitions/grib2/tables/8/4.212.table index c59bd24e8..738c45d2c 100644 --- a/definitions/grib2/tables/8/4.212.table +++ b/definitions/grib2/tables/8/4.212.table @@ -1,18 +1,18 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.213.table b/definitions/grib2/tables/8/4.213.table index 0f5de0104..5cee0b798 100644 --- a/definitions/grib2/tables/8/4.213.table +++ b/definitions/grib2/tables/8/4.213.table @@ -1,21 +1,21 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -12 12 Loam -13 13 Peat -14 14 Rock -15 15 Ice -16 16 Water -# 17-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +12 12 Loam +13 13 Peat +14 14 Rock +15 15 Ice +16 16 Water +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.215.table b/definitions/grib2/tables/8/4.215.table index 460888217..5ed37c034 100644 --- a/definitions/grib2/tables/8/4.215.table +++ b/definitions/grib2/tables/8/4.215.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.216.table b/definitions/grib2/tables/8/4.216.table index cc62ca5e3..2fd143724 100644 --- a/definitions/grib2/tables/8/4.216.table +++ b/definitions/grib2/tables/8/4.216.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit # 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/8/4.217.table b/definitions/grib2/tables/8/4.217.table index 51a263a99..6a014c9c3 100644 --- a/definitions/grib2/tables/8/4.217.table +++ b/definitions/grib2/tables/8/4.217.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.218.table b/definitions/grib2/tables/8/4.218.table index d4b2ab843..b6087448f 100644 --- a/definitions/grib2/tables/8/4.218.table +++ b/definitions/grib2/tables/8/4.218.table @@ -1,38 +1,38 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation / crops -15 15 Permanent snow / ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -# 19-96 Reserved -97 97 Snow / ice on land -98 98 Snow / ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud / fog / Stratus -102 102 Low cloud / Stratocumulus -103 103 Low cloud / unknown type -104 104 Medium cloud / Nimbostratus -105 105 Medium cloud / Altostratus -106 106 Medium cloud / unknown type -107 107 High cloud / Cumulus -108 108 High cloud / Cirrus -109 109 High cloud / unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation / crops +15 15 Permanent snow / ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +# 19-96 Reserved +97 97 Snow / ice on land +98 98 Snow / ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud / fog / Stratus +102 102 Low cloud / Stratocumulus +103 103 Low cloud / unknown type +104 104 Medium cloud / Nimbostratus +105 105 Medium cloud / Altostratus +106 106 Medium cloud / unknown type +107 107 High cloud / Cumulus +108 108 High cloud / Cirrus +109 109 High cloud / unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.219.table b/definitions/grib2/tables/8/4.219.table index f10ce468e..a02452fc4 100644 --- a/definitions/grib2/tables/8/4.219.table +++ b/definitions/grib2/tables/8/4.219.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.220.table b/definitions/grib2/tables/8/4.220.table index 9c957eb01..7a18fa1fd 100644 --- a/definitions/grib2/tables/8/4.220.table +++ b/definitions/grib2/tables/8/4.220.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.221.table b/definitions/grib2/tables/8/4.221.table index 5466929c7..eb0b64502 100644 --- a/definitions/grib2/tables/8/4.221.table +++ b/definitions/grib2/tables/8/4.221.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.222.table b/definitions/grib2/tables/8/4.222.table index c54194e29..f554a7f3d 100644 --- a/definitions/grib2/tables/8/4.222.table +++ b/definitions/grib2/tables/8/4.222.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.223.table b/definitions/grib2/tables/8/4.223.table index b6a9be136..706abab78 100644 --- a/definitions/grib2/tables/8/4.223.table +++ b/definitions/grib2/tables/8/4.223.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing value +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing value diff --git a/definitions/grib2/tables/8/4.224.table b/definitions/grib2/tables/8/4.224.table index af846f841..cf67496b8 100644 --- a/definitions/grib2/tables/8/4.224.table +++ b/definitions/grib2/tables/8/4.224.table @@ -1,18 +1,18 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/8/4.3.table b/definitions/grib2/tables/8/4.3.table index 68e2cc83f..8a4e919c9 100644 --- a/definitions/grib2/tables/8/4.3.table +++ b/definitions/grib2/tables/8/4.3.table @@ -1,16 +1,16 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.4.table b/definitions/grib2/tables/8/4.4.table index df5272d2f..511c76aa9 100644 --- a/definitions/grib2/tables/8/4.4.table +++ b/definitions/grib2/tables/8/4.4.table @@ -1,17 +1,17 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.5.table b/definitions/grib2/tables/8/4.5.table index 4f36494e9..dfba82870 100644 --- a/definitions/grib2/tables/8/4.5.table +++ b/definitions/grib2/tables/8/4.5.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface 2 2 Cloud base level 3 3 Level of cloud tops @@ -12,11 +12,11 @@ 10 10 Entire atmosphere 11 11 Cumulonimbus (CB) base (m) 12 12 Cumulonimbus (CB) top (m) -# 13-19 Reserved +# 13-19 Reserved 20 20 Isothermal level (K) -# 21-99 Reserved +# 21-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -25,7 +25,7 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level 112 112 Reserved 113 113 Logarithmic hybrid coordinate @@ -35,14 +35,14 @@ 119 hpl Hybrid pressure level # 120-149 Reserved 150 150 Generalized vertical height coordinate -# 151-159 Reserved -160 160 Depth below sea level m +# 151-159 Reserved +160 160 Depth below sea level m 161 161 Depth below water surface (m) 162 sfc Lake or river bottom 163 163 Bottom of sediment layer 164 164 Bottom of thermally active sediment layer 165 165 Bottom of sediment layer penetrated by thermal wave 166 sfc Mixing layer -# 167-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 167-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.6.table b/definitions/grib2/tables/8/4.6.table index 54f2993c3..eaa5c4362 100644 --- a/definitions/grib2/tables/8/4.6.table +++ b/definitions/grib2/tables/8/4.6.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.7.table b/definitions/grib2/tables/8/4.7.table index 23e0d457e..e6d887bdb 100644 --- a/definitions/grib2/tables/8/4.7.table +++ b/definitions/grib2/tables/8/4.7.table @@ -1,14 +1,14 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.8.table b/definitions/grib2/tables/8/4.8.table index 37a6cf767..d06153079 100644 --- a/definitions/grib2/tables/8/4.8.table +++ b/definitions/grib2/tables/8/4.8.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.9.table b/definitions/grib2/tables/8/4.9.table index 19e64a3d2..5243e58dd 100644 --- a/definitions/grib2/tables/8/4.9.table +++ b/definitions/grib2/tables/8/4.9.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/4.91.table b/definitions/grib2/tables/8/4.91.table index 05c4579bd..cea421695 100644 --- a/definitions/grib2/tables/8/4.91.table +++ b/definitions/grib2/tables/8/4.91.table @@ -1,16 +1,16 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit -11 11 Equal to first limit. -# 12-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit +11 11 Equal to first limit. +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/8/5.1.table b/definitions/grib2/tables/8/5.1.table index 100d4106d..158a35850 100644 --- a/definitions/grib2/tables/8/5.1.table +++ b/definitions/grib2/tables/8/5.1.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/5.2.table b/definitions/grib2/tables/8/5.2.table index 4d0808be6..d9896e11f 100644 --- a/definitions/grib2/tables/8/5.2.table +++ b/definitions/grib2/tables/8/5.2.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use +# 12-191 Reserved +# 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/8/5.3.table b/definitions/grib2/tables/8/5.3.table index 705fa6524..6f228aeec 100644 --- a/definitions/grib2/tables/8/5.3.table +++ b/definitions/grib2/tables/8/5.3.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/5.4.table b/definitions/grib2/tables/8/5.4.table index 8133367a5..f844f557e 100644 --- a/definitions/grib2/tables/8/5.4.table +++ b/definitions/grib2/tables/8/5.4.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/5.40.table b/definitions/grib2/tables/8/5.40.table index 0d56ad0e0..2431eb547 100644 --- a/definitions/grib2/tables/8/5.40.table +++ b/definitions/grib2/tables/8/5.40.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/8/5.5.table b/definitions/grib2/tables/8/5.5.table index 5d625dbda..f2216e273 100644 --- a/definitions/grib2/tables/8/5.5.table +++ b/definitions/grib2/tables/8/5.5.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/5.6.table b/definitions/grib2/tables/8/5.6.table index 5838e994d..3b0892d37 100644 --- a/definitions/grib2/tables/8/5.6.table +++ b/definitions/grib2/tables/8/5.6.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/8/5.7.table b/definitions/grib2/tables/8/5.7.table index b93aa8130..f056d3059 100644 --- a/definitions/grib2/tables/8/5.7.table +++ b/definitions/grib2/tables/8/5.7.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/8/6.0.table b/definitions/grib2/tables/8/6.0.table index aecdc6e5e..9c9dba372 100644 --- a/definitions/grib2/tables/8/6.0.table +++ b/definitions/grib2/tables/8/6.0.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating Centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating Centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating Centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/9/0.0.table b/definitions/grib2/tables/9/0.0.table index 1d3a90b49..88d8b2cb3 100644 --- a/definitions/grib2/tables/9/0.0.table +++ b/definitions/grib2/tables/9/0.0.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Space products -# 4-9 Reserved -10 10 Oceanographic products -# 11-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Space products +# 4-9 Reserved +10 10 Oceanographic products +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/1.0.table b/definitions/grib2/tables/9/1.0.table index 045af30c3..4b1406c7e 100644 --- a/definitions/grib2/tables/9/1.0.table +++ b/definitions/grib2/tables/9/1.0.table @@ -1,14 +1,14 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Experimental -1 1 Version implemented on 7 November 2001 -2 2 Version implemented on 4 November 2003 -3 3 Version implemented on 2 November 2005 -4 4 Version implemented on 7 November 2007 -5 5 Version implemented on 4 November 2009 +0 0 Experimental +1 1 Version implemented on 7 November 2001 +2 2 Version implemented on 4 November 2003 +3 3 Version implemented on 2 November 2005 +4 4 Version implemented on 7 November 2007 +5 5 Version implemented on 4 November 2009 6 6 Version implemented on 15 September 2010 7 7 Version implemented on 4 May 2011 8 8 Version implemented on 2 November 2011 9 9 Version implemented on 2 May 2012 10 10 Pre-operational to be implemented by next amendment -# 11-254 Future versions +# 11-254 Future versions 255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. diff --git a/definitions/grib2/tables/9/1.1.table b/definitions/grib2/tables/9/1.1.table index 91ef66244..55fa1eb63 100644 --- a/definitions/grib2/tables/9/1.1.table +++ b/definitions/grib2/tables/9/1.1.table @@ -1,4 +1,4 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Local tables not used. Only table entries and templates from the current master table are valid -# 1-254 Number of local tables version used -255 255 Missing +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/9/1.2.table b/definitions/grib2/tables/9/1.2.table index d90ad0109..606bf8300 100644 --- a/definitions/grib2/tables/9/1.2.table +++ b/definitions/grib2/tables/9/1.2.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Analysis -1 1 Start of forecast -2 2 Verifying time of forecast -3 3 Observation time -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/1.3.table b/definitions/grib2/tables/9/1.3.table index 35cd6a636..712bb2ba8 100644 --- a/definitions/grib2/tables/9/1.3.table +++ b/definitions/grib2/tables/9/1.3.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products -4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) -5 5 THORPEX Interactive Grand Global Ensemble (TIGGE) test -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products +4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) +5 5 THORPEX Interactive Grand Global Ensemble (TIGGE) test +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/1.4.table b/definitions/grib2/tables/9/1.4.table index d11a335a7..7f47afd96 100644 --- a/definitions/grib2/tables/9/1.4.table +++ b/definitions/grib2/tables/9/1.4.table @@ -1,13 +1,13 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 an Analysis products -1 fc Forecast products -2 af Analysis and forecast products -3 cf Control forecast products -4 pf Perturbed forecast products -5 cp Control and perturbed forecast products -6 sa Processed satellite observations -7 ra Processed radar observations -8 ep Event probability -# 9-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/9/3.0.table b/definitions/grib2/tables/9/3.0.table index 4baed0aab..4269b25ad 100644 --- a/definitions/grib2/tables/9/3.0.table +++ b/definitions/grib2/tables/9/3.0.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Specified in Code table 3.1 +0 0 Specified in Code table 3.1 1 1 Predetermined grid definition (Defined by originating centre) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 A grid definition does not apply to this product +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/9/3.10.table b/definitions/grib2/tables/9/3.10.table index 23c1cdd36..da36dc664 100644 --- a/definitions/grib2/tables/9/3.10.table +++ b/definitions/grib2/tables/9/3.10.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 0 Points scan in +i direction, i.e. from pole to Equator -1 1 Points scan in -i direction, i.e. from Equator to pole -2 0 Points scan in +j direction, i.e. from west to east -2 1 Points scan in -j direction, i.e. from east to west -3 0 Adjacent points in i direction are consecutive -3 1 Adjacent points in j direction are consecutive -# 4-8 Reserved +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/9/3.11.table b/definitions/grib2/tables/9/3.11.table index 560318d1b..0a299af98 100644 --- a/definitions/grib2/tables/9/3.11.table +++ b/definitions/grib2/tables/9/3.11.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 There is no appended list +0 0 There is no appended list 1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows 2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row 3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) diff --git a/definitions/grib2/tables/9/3.15.table b/definitions/grib2/tables/9/3.15.table index 94f6c8e04..44e7a0983 100644 --- a/definitions/grib2/tables/9/3.15.table +++ b/definitions/grib2/tables/9/3.15.table @@ -1,23 +1,23 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -# 0-19 Reserved +# 0-19 Reserved 20 20 Temperature (K) -# 21-99 Reserved +# 21-99 Reserved 100 100 Pressure (Pa) 101 101 Pressure deviation from mean sea level (Pa) 102 102 Altitude above mean sea level (m) 103 103 Height above ground (m) -104 104 Sigma coordinate -105 105 Hybrid coordinate +104 104 Sigma coordinate +105 105 Hybrid coordinate 106 106 Depth below land surface (m) 107 pt Potential temperature (theta) (K) 108 108 Pressure deviation from ground to level (Pa) 109 pv Potential vorticity (K m-2 kg-1 s-1) 110 110 Geometrical height (m) -111 111 Eta coordinate +111 111 Eta coordinate 112 112 Geopotential height (gpm) 113 113 Logarithmic hybrid coordinate -# 114-159 Reserved +# 114-159 Reserved 160 160 Depth below sea level (m) -# 161-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/3.2.table b/definitions/grib2/tables/9/3.2.table index 3d7a4f1fc..563efbdb5 100644 --- a/definitions/grib2/tables/9/3.2.table +++ b/definitions/grib2/tables/9/3.2.table @@ -1,13 +1,13 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Earth assumed spherical with radius = 6 367 470.0 m -1 1 Earth assumed spherical with radius specified (in m) by data producer -2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) -3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer -4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) -5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) -6 6 Earth assumed spherical with radius of 6 371 229.0 m -7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer -8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame -# 9-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS84 reference frame +# 9-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/3.20.table b/definitions/grib2/tables/9/3.20.table index 3f7ab4cc4..63de6b1a9 100644 --- a/definitions/grib2/tables/9/3.20.table +++ b/definitions/grib2/tables/9/3.20.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Rhumb -1 1 Great circle -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/3.21.table b/definitions/grib2/tables/9/3.21.table index b0c77d135..2bc46aae9 100644 --- a/definitions/grib2/tables/9/3.21.table +++ b/definitions/grib2/tables/9/3.21.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 -# 2-10 Reserved -11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/3.3.table b/definitions/grib2/tables/9/3.3.table index 5167ed6b7..bd47e2509 100644 --- a/definitions/grib2/tables/9/3.3.table +++ b/definitions/grib2/tables/9/3.3.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -# 1-2 Reserved -3 0 i direction increments not given -3 1 i direction increments given -4 0 j direction increments not given -4 1 j direction increments given -5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions -5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively -# 6-8 Reserved - set to zero +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/9/3.4.table b/definitions/grib2/tables/9/3.4.table index 6253896b1..752c70757 100644 --- a/definitions/grib2/tables/9/3.4.table +++ b/definitions/grib2/tables/9/3.4.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 0 Points of first row or column scan in the +i (+x) direction -1 1 Points of first row or column scan in the -i (-x) direction -2 0 Points of first row or column scan in the -j (-y) direction -2 1 Points of first row or column scan in the +j (+y) direction -3 0 Adjacent points in i (x) direction are consecutive -3 1 Adjacent points in j (y) direction is consecutive -4 0 All rows scan in the same direction -4 1 Adjacent rows scans in the opposite direction -# 5-8 Reserved +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +# 5-8 Reserved diff --git a/definitions/grib2/tables/9/3.5.table b/definitions/grib2/tables/9/3.5.table index 8ccf0f13b..6d3ec036e 100644 --- a/definitions/grib2/tables/9/3.5.table +++ b/definitions/grib2/tables/9/3.5.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 0 North Pole is on the projection plane -1 1 South Pole is on the projection plane -2 0 Only one projection centre is used -2 1 Projection is bipolar and symmetric +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/9/3.7.table b/definitions/grib2/tables/9/3.7.table index 65693989a..4b2e684d3 100644 --- a/definitions/grib2/tables/9/3.7.table +++ b/definitions/grib2/tables/9/3.7.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved +0 0 Reserved 1 1 The complex numbers Fnm (see code figure 1 in Code Table 3.6 above) are stored for m>=0 as pairs of real numbers Re(Fnm), Im(Fnm) ordered with n increasing from m to N(m), first for m=0 and then for m=1, 2, ... M. (see Note 1) -# 2-254 Reserved +# 2-254 Reserved 255 255 Missing diff --git a/definitions/grib2/tables/9/3.8.table b/definitions/grib2/tables/9/3.8.table index 4e811917b..6df554ae9 100644 --- a/definitions/grib2/tables/9/3.8.table +++ b/definitions/grib2/tables/9/3.8.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Grid points at triangle vertices -1 1 Grid points at centres of triangles -2 2 Grid points at midpoints of triangle sides -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/3.9.table b/definitions/grib2/tables/9/3.9.table index f35b7ca53..530d1dee0 100644 --- a/definitions/grib2/tables/9/3.9.table +++ b/definitions/grib2/tables/9/3.9.table @@ -1,4 +1,4 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 0 Clockwise orientation -1 1 Anti-clockwise (i.e. counter-clockwise) orientation -# 2-8 Reserved +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/9/4.0.table b/definitions/grib2/tables/9/4.0.table index faa4f59df..0852d9f0d 100644 --- a/definitions/grib2/tables/9/4.0.table +++ b/definitions/grib2/tables/9/4.0.table @@ -1,52 +1,52 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time 8 8 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 -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically-processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically-processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data # 33-39 Reserved 311 311 Satellite product auxiliary information -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents 42 42 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 atmospheric chemical constituents 43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol 46 46 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 aerosol 47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non continuous time interval for aerosol 48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of atmospheric aerosol -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time -# 52-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +# 52-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved +# 1102-32767 Reserved # 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data diff --git a/definitions/grib2/tables/9/4.1.0.table b/definitions/grib2/tables/9/4.1.0.table index 361108860..3413dbad5 100644 --- a/definitions/grib2/tables/9/4.1.0.table +++ b/definitions/grib2/tables/9/4.1.0.table @@ -1,27 +1,27 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Temperature -1 1 Moisture -2 2 Momentum -3 3 Mass -4 4 Short-wave radiation -5 5 Long-wave radiation -6 6 Cloud -7 7 Thermodynamic stability indices -8 8 Kinematic stability indices -9 9 Temperature probabilities -10 10 Moisture probabilities -11 11 Momentum probabilities -12 12 Mass probabilities -13 13 Aerosols -14 14 Trace gases (e.g. ozone, CO2) -15 15 Radar -16 16 Forecast radar imagery -17 17 Electrodynamics -18 18 Nuclear/radiology -19 19 Physical atmospheric properties -20 20 Atmospheric chemical constituents -# 21-189 Reserved -190 190 CCITT IA5 string -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.1.1.table b/definitions/grib2/tables/9/4.1.1.table index 29f1dec79..dea5bc49e 100644 --- a/definitions/grib2/tables/9/4.1.1.table +++ b/definitions/grib2/tables/9/4.1.1.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Hydrology basic products -1 1 Hydrology probabilities -2 2 Inland water and sediment properties -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.1.10.table b/definitions/grib2/tables/9/4.1.10.table index 9c8c92b12..e6ce6faf7 100644 --- a/definitions/grib2/tables/9/4.1.10.table +++ b/definitions/grib2/tables/9/4.1.10.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Waves -1 1 Currents -2 2 Ice -3 3 Surface properties -4 4 Sub-surface properties -# 5-190 Reserved -191 191 Miscellaneous -# 192-254 Reserved for local use -255 255 Missing +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Sub-surface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.1.2.table b/definitions/grib2/tables/9/4.1.2.table index b90201c63..805836998 100644 --- a/definitions/grib2/tables/9/4.1.2.table +++ b/definitions/grib2/tables/9/4.1.2.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Vegetation/biomass -1 1 Agri-/aquacultural special products -2 2 Transportation-related products -3 3 Soil products -4 4 Fire weather products -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.1.3.table b/definitions/grib2/tables/9/4.1.3.table index 3c947b136..c96617665 100644 --- a/definitions/grib2/tables/9/4.1.3.table +++ b/definitions/grib2/tables/9/4.1.3.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Image format products -1 1 Quantitative products -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Image format products +1 1 Quantitative products +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.10.table b/definitions/grib2/tables/9/4.10.table index 0e5170876..a13fb00b4 100644 --- a/definitions/grib2/tables/9/4.10.table +++ b/definitions/grib2/tables/9/4.10.table @@ -1,15 +1,15 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 avg Average -1 accum Accumulation -2 max Maximum -3 min Minimum -4 diff Difference (value at the end of time range minus value at the beginning) -5 rms Root mean square -6 sd Standard deviation -7 cov Covariance (temporal variance) -8 8 Difference (value at the start of time range minus value at the end) -9 ratio Ratio -10 10 Standardized anomaly -# 11-191 Reserved -# 192-254 Reserved for local use -255 missing Missing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +# 11-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/9/4.11.table b/definitions/grib2/tables/9/4.11.table index 1257d1b09..af9ff29ad 100644 --- a/definitions/grib2/tables/9/4.11.table +++ b/definitions/grib2/tables/9/4.11.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Successive times processed have same forecast time, start time of forecast is incremented -2 2 Successive times processed have same start time of forecast, forecast time is incremented -3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant -4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant -5 5 Floating subinterval of time between forecast time and end of overall time interval -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.12.table b/definitions/grib2/tables/9/4.12.table index 680b6456d..6cab67bf5 100644 --- a/definitions/grib2/tables/9/4.12.table +++ b/definitions/grib2/tables/9/4.12.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Maintenance mode -1 1 Clear air -2 2 Precipitation +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation # 3-191 Reserved # 192-254 Reserved for local use -255 255 Missing +255 255 Missing diff --git a/definitions/grib2/tables/9/4.13.table b/definitions/grib2/tables/9/4.13.table index 0d0474d69..f090fb9ae 100644 --- a/definitions/grib2/tables/9/4.13.table +++ b/definitions/grib2/tables/9/4.13.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No quality control applied -1 1 Quality control applied +0 0 No quality control applied +1 1 Quality control applied # 2-191 Reserved # 192-254 Reserved for local use -255 255 Missing +255 255 Missing diff --git a/definitions/grib2/tables/9/4.14.table b/definitions/grib2/tables/9/4.14.table index 9ed9078a8..bcb04f328 100644 --- a/definitions/grib2/tables/9/4.14.table +++ b/definitions/grib2/tables/9/4.14.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No clutter filter used -1 1 Clutter filter used +0 0 No clutter filter used +1 1 Clutter filter used # 2-191 Reserved # 192-254 Reserved for local use -255 255 Missing +255 255 Missing diff --git a/definitions/grib2/tables/9/4.15.table b/definitions/grib2/tables/9/4.15.table index 4c8a88401..6e1ef5745 100644 --- a/definitions/grib2/tables/9/4.15.table +++ b/definitions/grib2/tables/9/4.15.table @@ -1,11 +1,11 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Data is calculated directly from the source grid with no interpolation -1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point -4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point -6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point # 7-191 Reserved # 192-254 Reserved for local use -255 255 Missing +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.0.table b/definitions/grib2/tables/9/4.2.0.0.table index debc0a6f4..8656f8974 100644 --- a/definitions/grib2/tables/9/4.2.0.0.table +++ b/definitions/grib2/tables/9/4.2.0.0.table @@ -20,6 +20,6 @@ 18 18 Snow temperature (top of snow) (K) 19 19 Turbulent transfer coefficient for heat (Numeric) 20 20 Turbulent diffusion coefficient for heat (m2/s) -# 21-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 21-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.1.table b/definitions/grib2/tables/9/4.2.0.1.table index 1922792a6..8ee93e99b 100644 --- a/definitions/grib2/tables/9/4.2.0.1.table +++ b/definitions/grib2/tables/9/4.2.0.1.table @@ -62,7 +62,7 @@ 60 60 Snow depth water equivalent (kg m-2) 61 61 Snow density (kg m-3) 62 62 Snow evaporation (kg m-2) -63 63 Reserved +63 63 Reserved 64 64 Total column integrated water vapour (kg m-2) 65 65 Rain precipitation rate (kg m-2 s-1) 66 66 Snow precipitation rate (kg m-2 s-1) @@ -86,10 +86,10 @@ 84 84 Specific cloud ice water content (kg/kg) 85 85 Specific rain water content (kg/kg) 86 86 Specific snow water content (kg/kg) -# 87-89 Reserved +# 87-89 Reserved 90 90 Total kinematic moisture flux (kg kg-1 m s-1) 91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) 92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) -# 93-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 93-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.13.table b/definitions/grib2/tables/9/4.2.0.13.table index b9979f0d3..90ab7d1b9 100644 --- a/definitions/grib2/tables/9/4.2.0.13.table +++ b/definitions/grib2/tables/9/4.2.0.13.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Aerosol type (Code table 4.205) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.14.table b/definitions/grib2/tables/9/4.2.0.14.table index 4a2a4e128..fca42ccc7 100644 --- a/definitions/grib2/tables/9/4.2.0.14.table +++ b/definitions/grib2/tables/9/4.2.0.14.table @@ -2,6 +2,6 @@ 0 0 Total ozone (DU) 1 1 Ozone mixing ratio (kg/kg) 2 2 Total column integrated ozone (DU) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.15.table b/definitions/grib2/tables/9/4.2.0.15.table index 895892f86..66ccff19d 100644 --- a/definitions/grib2/tables/9/4.2.0.15.table +++ b/definitions/grib2/tables/9/4.2.0.15.table @@ -14,6 +14,6 @@ 12 12 Reflectivity of rain (dB) 13 13 Reflectivity of graupel (dB) 14 14 Reflectivity of hail (dB) -# 15-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 15-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.16.table b/definitions/grib2/tables/9/4.2.0.16.table index 39215ab20..18dedb7c0 100644 --- a/definitions/grib2/tables/9/4.2.0.16.table +++ b/definitions/grib2/tables/9/4.2.0.16.table @@ -5,6 +5,6 @@ 3 3 Echo top (m) 4 4 Reflectivity (dB) 5 5 Composite reflectivity (dB) -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.18.table b/definitions/grib2/tables/9/4.2.0.18.table index 30060fd2d..165aa6008 100644 --- a/definitions/grib2/tables/9/4.2.0.18.table +++ b/definitions/grib2/tables/9/4.2.0.18.table @@ -8,11 +8,11 @@ 6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) 7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) 8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) -9 9 Reserved +9 9 Reserved 10 10 Air concentration (Bq m-3) 11 11 Wet deposition (Bq m-2) 12 12 Dry deposition (Bq m-2) 13 13 Total deposition (wet + dry) (Bq m-2) -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.19.table b/definitions/grib2/tables/9/4.2.0.19.table index 5831b567c..cbce2f76c 100644 --- a/definitions/grib2/tables/9/4.2.0.19.table +++ b/definitions/grib2/tables/9/4.2.0.19.table @@ -27,6 +27,6 @@ 25 25 Weather (Code table 4.225) 26 26 Convective outlook (Code table 4.224) 27 27 Icing scenario (Code table 4.227) -# 28-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.190.table b/definitions/grib2/tables/9/4.2.0.190.table index 39fb55746..3d9d5ff85 100644 --- a/definitions/grib2/tables/9/4.2.0.190.table +++ b/definitions/grib2/tables/9/4.2.0.190.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Arbitrary text string (CCITT IA5) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.191.table b/definitions/grib2/tables/9/4.2.0.191.table index 81230c0e0..4ff12e532 100644 --- a/definitions/grib2/tables/9/4.2.0.191.table +++ b/definitions/grib2/tables/9/4.2.0.191.table @@ -2,6 +2,6 @@ 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Geographical latitude (deg N) 2 2 Geographical longitude (deg E) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing value +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/9/4.2.0.2.table b/definitions/grib2/tables/9/4.2.0.2.table index e8b59a998..68aa47ba6 100644 --- a/definitions/grib2/tables/9/4.2.0.2.table +++ b/definitions/grib2/tables/9/4.2.0.2.table @@ -35,6 +35,6 @@ 33 33 Wind fetch (m) 34 34 Normal wind component (m/s) 35 35 Tangential wind component (m/s) -# 36-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 36-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.20.table b/definitions/grib2/tables/9/4.2.0.20.table index cc2dbcc52..898a774eb 100644 --- a/definitions/grib2/tables/9/4.2.0.20.table +++ b/definitions/grib2/tables/9/4.2.0.20.table @@ -14,7 +14,7 @@ 12 12 Dry deposition mass flux (kg m-2 s-1) 13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) 14 14 Transfer from SO2 (Sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) -# 15-49 Reserved +# 15-49 Reserved 50 50 Amount in atmosphere (mol) 51 51 Concentration in air (mol m-3) 52 52 Volume mixing ratio (fraction in air) (mol/mol) @@ -25,7 +25,7 @@ 57 57 Total yearly average burden of the atmosphere (mol) 58 58 Total yearly averaged atmospheric loss (mol/s) 59 59 Aerosol number concentration (m-3) -# 60-99 Reserved +# 60-99 Reserved 100 100 Surface area density (aerosol) (/m) 101 101 Vertical visual range (m) 102 102 Aerosol optical thickness (Numeric) @@ -37,6 +37,6 @@ 108 108 Aerosol lidar backscatter from the ground (m-1 sr-1) 109 109 Aerosol lidar extinction from satellite (m-1) 110 110 Aerosol lidar extinction from the ground (m-1) -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.3.table b/definitions/grib2/tables/9/4.2.0.3.table index f718c6ea9..08c1c7bc3 100644 --- a/definitions/grib2/tables/9/4.2.0.3.table +++ b/definitions/grib2/tables/9/4.2.0.3.table @@ -26,6 +26,6 @@ 24 24 Anisotropy of sub-gridscale orography (Numeric) 25 25 Natural logarithm of pressure in Pa (Numeric) 26 26 Exner pressure (Numeric) -# 27-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 27-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.4.table b/definitions/grib2/tables/9/4.2.0.4.table index fea4cafc3..336fdb421 100644 --- a/definitions/grib2/tables/9/4.2.0.4.table +++ b/definitions/grib2/tables/9/4.2.0.4.table @@ -12,9 +12,9 @@ 10 10 Photosynthetically active radiation (W m-2) 11 11 Net short-wave radiation flux, clear sky (W m-2) 12 12 Downward UV radiation (W m-2) -# 13-49 Reserved +# 13-49 Reserved 50 50 UV index (under clear sky) (Numeric) 51 51 UV index (Numeric) -# 52-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 52-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.5.table b/definitions/grib2/tables/9/4.2.0.5.table index aae853bf9..607235064 100644 --- a/definitions/grib2/tables/9/4.2.0.5.table +++ b/definitions/grib2/tables/9/4.2.0.5.table @@ -6,6 +6,6 @@ 4 4 Upward long-wave radiation flux (W m-2) 5 5 Net long wave radiation flux (W m-2) 6 6 Net long-wave radiation flux, clear sky (W m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.6.table b/definitions/grib2/tables/9/4.2.0.6.table index fd4b23014..fb935344e 100644 --- a/definitions/grib2/tables/9/4.2.0.6.table +++ b/definitions/grib2/tables/9/4.2.0.6.table @@ -35,6 +35,6 @@ 33 33 Sunshine duration (s) 34 34 Surface long wave effective total cloudiness (Numeric) 35 35 Surface short wave effective total cloudiness (Numeric) -# 36-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 36-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.0.7.table b/definitions/grib2/tables/9/4.2.0.7.table index 7a7d2008b..6c1794c73 100644 --- a/definitions/grib2/tables/9/4.2.0.7.table +++ b/definitions/grib2/tables/9/4.2.0.7.table @@ -13,8 +13,8 @@ 11 11 Best (4-layer) lifted index (K) 12 12 Richardson number (Numeric) 13 13 Showalter index (K) -14 14 Reserved +14 14 Reserved 15 15 Updraft helicity (m2 s-2) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.1.0.table b/definitions/grib2/tables/9/4.2.1.0.table index bf1e3e93f..9c4d129da 100644 --- a/definitions/grib2/tables/9/4.2.1.0.table +++ b/definitions/grib2/tables/9/4.2.1.0.table @@ -6,6 +6,6 @@ 4 4 Snow water equivalent per cent of normal (%) 5 5 Baseflow-groundwater runoff (kg m-2) 6 6 Storm surface runoff (kg m-2) -# 7-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.1.1.table b/definitions/grib2/tables/9/4.2.1.1.table index cb5117dc8..aa560e479 100644 --- a/definitions/grib2/tables/9/4.2.1.1.table +++ b/definitions/grib2/tables/9/4.2.1.1.table @@ -2,6 +2,6 @@ 0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) 1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) 2 2 Probability of 0.01 inch of precipitation (POP) (%) -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.10.0.table b/definitions/grib2/tables/9/4.2.10.0.table index d4321d955..8bba32cf5 100644 --- a/definitions/grib2/tables/9/4.2.10.0.table +++ b/definitions/grib2/tables/9/4.2.10.0.table @@ -45,6 +45,6 @@ 43 43 Kurtosis of the sea surface elevation due to waves (-) 44 44 Benjamin-Feir index (-) 45 45 Spectral peakedness factor (s-1) -# 46-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 46-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.10.1.table b/definitions/grib2/tables/9/4.2.10.1.table index 5a33bac5d..a076fb07c 100644 --- a/definitions/grib2/tables/9/4.2.10.1.table +++ b/definitions/grib2/tables/9/4.2.10.1.table @@ -3,6 +3,6 @@ 1 1 Current speed (m/s) 2 2 u-component of current (m/s) 3 3 v-component of current (m/s) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.10.191.table b/definitions/grib2/tables/9/4.2.10.191.table index 14085ac9a..6cafbd3d4 100644 --- a/definitions/grib2/tables/9/4.2.10.191.table +++ b/definitions/grib2/tables/9/4.2.10.191.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Seconds prior to initial reference time (defined in Section 1) (s) 1 1 Meridional overturning stream function (m3/s) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.10.2.table b/definitions/grib2/tables/9/4.2.10.2.table index a69b2622c..80fe973be 100644 --- a/definitions/grib2/tables/9/4.2.10.2.table +++ b/definitions/grib2/tables/9/4.2.10.2.table @@ -9,6 +9,6 @@ 7 7 Ice divergence (/s) 8 8 Ice temperature (K) 9 9 Ice internal pressure (Pa m) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.10.3.table b/definitions/grib2/tables/9/4.2.10.3.table index 112af09d5..3b9a2df46 100644 --- a/definitions/grib2/tables/9/4.2.10.3.table +++ b/definitions/grib2/tables/9/4.2.10.3.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 Water temperature (K) 1 1 Deviation of sea level from mean (m) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.10.4.table b/definitions/grib2/tables/9/4.2.10.4.table index d80a32780..91ffb2b29 100644 --- a/definitions/grib2/tables/9/4.2.10.4.table +++ b/definitions/grib2/tables/9/4.2.10.4.table @@ -7,12 +7,12 @@ 5 5 Ocean vertical salt diffusivity (m2 s-1) 6 6 Ocean vertical momentum diffusivity (m2 s-1) 7 7 Bathymetry (m) -# 8-10 Reserved +# 8-10 Reserved 11 11 Shape factor with respect to salinity profile (-) 12 12 Shape factor with respect to temperature profile in thermocline (-) 13 13 Attenuation coefficient of water with respect to solar radiation (m-1) 14 14 Water depth (m) 15 15 Water temperature (K) -# 16-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 16-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.2.0.table b/definitions/grib2/tables/9/4.2.2.0.table index ed4a85093..bbd328f0a 100644 --- a/definitions/grib2/tables/9/4.2.2.0.table +++ b/definitions/grib2/tables/9/4.2.2.0.table @@ -32,6 +32,6 @@ 30 30 Deciduous forest cover (Proportion) 31 31 Normalized differential vegetation index (NDVI) (Numeric) 32 32 Root depth of vegetation (m) -# 33-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 33-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.2.3.table b/definitions/grib2/tables/9/4.2.2.3.table index 80113a4bd..a9ec602e6 100644 --- a/definitions/grib2/tables/9/4.2.2.3.table +++ b/definitions/grib2/tables/9/4.2.2.3.table @@ -22,6 +22,6 @@ 20 20 Column-integrated soil moisture (kg m-2) 21 21 Soil ice (kg m-3) 22 22 Column-integrated soil ice (kg m-2) -# 23-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 23-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.3.0.table b/definitions/grib2/tables/9/4.2.3.0.table index 254e56bc8..8c19d43b2 100644 --- a/definitions/grib2/tables/9/4.2.3.0.table +++ b/definitions/grib2/tables/9/4.2.3.0.table @@ -9,6 +9,6 @@ 7 7 Cloud mask (Code table 4.217) 8 8 Pixel scene type (Code table 4.218) 9 9 Fire detection indicator (Code table 4.223) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.2.3.1.table b/definitions/grib2/tables/9/4.2.3.1.table index 16eee69c4..d199aff60 100644 --- a/definitions/grib2/tables/9/4.2.3.1.table +++ b/definitions/grib2/tables/9/4.2.3.1.table @@ -17,12 +17,12 @@ 15 15 Clear-sky brightness temperature (K) 16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) 17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) -18 18 Reserved +18 18 Reserved 19 19 Wind speed (m/s) 20 20 Aerosol optical thickness at 0.635 um 21 21 Aerosol optical thickness at 0.810 um 22 22 Aerosol optical thickness at 1.640 um -23 23 Angstrom coefficient -# 24-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +23 23 Angstrom coefficient +# 24-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.201.table b/definitions/grib2/tables/9/4.201.table index d1aa3491d..e16d5d808 100644 --- a/definitions/grib2/tables/9/4.201.table +++ b/definitions/grib2/tables/9/4.201.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Rain -2 2 Thunderstorm -3 3 Freezing rain -4 4 Mixed/ice -5 5 Snow +0 0 Reserved +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow # 6-191 Reserved # 192-254 Reserved for local use -255 255 Missing +255 255 Missing diff --git a/definitions/grib2/tables/9/4.203.table b/definitions/grib2/tables/9/4.203.table index fce5a15b1..9a8d29e01 100644 --- a/definitions/grib2/tables/9/4.203.table +++ b/definitions/grib2/tables/9/4.203.table @@ -1,25 +1,25 @@ -0 0 Clear -1 1 Cumulonimbus -2 2 Stratus -3 3 Stratocumulus -4 4 Cumulus -5 5 Altostratus -6 6 Nimbostratus -7 7 Altocumulus -8 8 Cirrostratus -9 9 Cirrocumulus -10 10 Cirrus -11 11 Cumulonimbus - ground-based fog beneath the lowest layer -12 12 Stratus - ground-based fog beneath the lowest layer -13 13 Stratocumulus - ground-based fog beneath the lowest layer -14 14 Cumulus - ground-based fog beneath the lowest layer -15 15 Altostratus - ground-based fog beneath the lowest layer -16 16 Nimbostratus - ground-based fog beneath the lowest layer -17 17 Altocumulus - ground-based fog beneath the lowest layer -18 18 Cirrostratus - ground-based fog beneath the lowest layer -19 19 Cirrocumulus - ground-based fog beneath the lowest layer -20 20 Cirrus - ground-based fog beneath the lowest layer -# 21-190 Reserved -191 191 Unknown -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.204.table b/definitions/grib2/tables/9/4.204.table index a1bdcdf05..8d8bca9b2 100644 --- a/definitions/grib2/tables/9/4.204.table +++ b/definitions/grib2/tables/9/4.204.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 None -1 1 Isolated (1-2%) -2 2 Few (3-5%) -3 3 Scattered (16-45%) -4 4 Numerous (> 45%) +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (16-45%) +4 4 Numerous (> 45%) # 5-191 Reserved # 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/9/4.205.table b/definitions/grib2/tables/9/4.205.table index 8d425ab9d..3fadf7d80 100644 --- a/definitions/grib2/tables/9/4.205.table +++ b/definitions/grib2/tables/9/4.205.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Aerosol not present -1 1 Aerosol present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.206.table b/definitions/grib2/tables/9/4.206.table index 0be7fd4f8..43b0ba137 100644 --- a/definitions/grib2/tables/9/4.206.table +++ b/definitions/grib2/tables/9/4.206.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Not present -1 1 Present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.207.table b/definitions/grib2/tables/9/4.207.table index fde9eb477..815a5777e 100644 --- a/definitions/grib2/tables/9/4.207.table +++ b/definitions/grib2/tables/9/4.207.table @@ -1,10 +1,10 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 None -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Trace -5 5 Heavy -# 6-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.208.table b/definitions/grib2/tables/9/4.208.table index 196becaaf..23ea97317 100644 --- a/definitions/grib2/tables/9/4.208.table +++ b/definitions/grib2/tables/9/4.208.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 None (smooth) -1 1 Light -2 2 Moderate -3 3 Severe -4 4 Extreme -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.209.table b/definitions/grib2/tables/9/4.209.table index 351c0f431..53c6c5eba 100644 --- a/definitions/grib2/tables/9/4.209.table +++ b/definitions/grib2/tables/9/4.209.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Stable -2 2 Mechanically-driven turbulence -3 3 Forced convection -4 4 Free convection -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Stable +2 2 Mechanically-driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.210.table b/definitions/grib2/tables/9/4.210.table index 1c00b8c6f..149b2ba06 100644 --- a/definitions/grib2/tables/9/4.210.table +++ b/definitions/grib2/tables/9/4.210.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Contrail not present -1 1 Contrail present -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Contrail not present +1 1 Contrail present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.211.table b/definitions/grib2/tables/9/4.211.table index 66ef656f6..b5753f19f 100644 --- a/definitions/grib2/tables/9/4.211.table +++ b/definitions/grib2/tables/9/4.211.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Low bypass -1 1 High bypass -2 2 Non-bypass -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.212.table b/definitions/grib2/tables/9/4.212.table index c59bd24e8..738c45d2c 100644 --- a/definitions/grib2/tables/9/4.212.table +++ b/definitions/grib2/tables/9/4.212.table @@ -1,18 +1,18 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Urban land -2 2 Agriculture -3 3 Range land -4 4 Deciduous forest -5 5 Coniferous forest -6 6 Forest/wetland -7 7 Water -8 8 Wetlands -9 9 Desert -10 10 Tundra -11 11 Ice -12 12 Tropical forest -13 13 Savannah -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.213.table b/definitions/grib2/tables/9/4.213.table index 0f5de0104..5cee0b798 100644 --- a/definitions/grib2/tables/9/4.213.table +++ b/definitions/grib2/tables/9/4.213.table @@ -1,21 +1,21 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 Sand -2 2 Loamy sand -3 3 Sandy loam -4 4 Silt loam -5 5 Organic (redefined) -6 6 Sandy clay loam -7 7 Silt clay loam -8 8 Clay loam -9 9 Sandy clay -10 10 Silty clay -11 11 Clay -12 12 Loam -13 13 Peat -14 14 Rock -15 15 Ice -16 16 Water -# 17-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +12 12 Loam +13 13 Peat +14 14 Rock +15 15 Ice +16 16 Water +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.215.table b/definitions/grib2/tables/9/4.215.table index 460888217..5ed37c034 100644 --- a/definitions/grib2/tables/9/4.215.table +++ b/definitions/grib2/tables/9/4.215.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -# 0-49 Reserved -50 50 No-snow/no-cloud -# 51-99 Reserved -100 100 Clouds -# 101-249 Reserved -250 250 Snow -# 251-254 Reserved for local use -255 255 Missing +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.216.table b/definitions/grib2/tables/9/4.216.table index cc62ca5e3..2fd143724 100644 --- a/definitions/grib2/tables/9/4.216.table +++ b/definitions/grib2/tables/9/4.216.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit # 0-90 Elevation in increments of 100 m -# 91-253 Reserved -254 254 Clouds -255 255 Missing +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/9/4.217.table b/definitions/grib2/tables/9/4.217.table index 51a263a99..6a014c9c3 100644 --- a/definitions/grib2/tables/9/4.217.table +++ b/definitions/grib2/tables/9/4.217.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Clear over water -1 1 Clear over land -2 2 Cloud -3 3 No data -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.218.table b/definitions/grib2/tables/9/4.218.table index d4b2ab843..b6087448f 100644 --- a/definitions/grib2/tables/9/4.218.table +++ b/definitions/grib2/tables/9/4.218.table @@ -1,38 +1,38 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No scene identified -1 1 Green needle-leafed forest -2 2 Green broad-leafed forest -3 3 Deciduous needle-leafed forest -4 4 Deciduous broad-leafed forest -5 5 Deciduous mixed forest -6 6 Closed shrub-land -7 7 Open shrub-land -8 8 Woody savannah -9 9 Savannah -10 10 Grassland -11 11 Permanent wetland -12 12 Cropland -13 13 Urban -14 14 Vegetation / crops -15 15 Permanent snow / ice -16 16 Barren desert -17 17 Water bodies -18 18 Tundra -# 19-96 Reserved -97 97 Snow / ice on land -98 98 Snow / ice on water -99 99 Sun-glint -100 100 General cloud -101 101 Low cloud / fog / Stratus -102 102 Low cloud / Stratocumulus -103 103 Low cloud / unknown type -104 104 Medium cloud / Nimbostratus -105 105 Medium cloud / Altostratus -106 106 Medium cloud / unknown type -107 107 High cloud / Cumulus -108 108 High cloud / Cirrus -109 109 High cloud / unknown -110 110 Unknown cloud type -# 111-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation / crops +15 15 Permanent snow / ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +# 19-96 Reserved +97 97 Snow / ice on land +98 98 Snow / ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud / fog / Stratus +102 102 Low cloud / Stratocumulus +103 103 Low cloud / unknown type +104 104 Medium cloud / Nimbostratus +105 105 Medium cloud / Altostratus +106 106 Medium cloud / unknown type +107 107 High cloud / Cumulus +108 108 High cloud / Cirrus +109 109 High cloud / unknown +110 110 Unknown cloud type +# 111-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.219.table b/definitions/grib2/tables/9/4.219.table index f10ce468e..a02452fc4 100644 --- a/definitions/grib2/tables/9/4.219.table +++ b/definitions/grib2/tables/9/4.219.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Nominal cloud top height quality -1 1 Fog in segment -2 2 Poor quality height estimation -3 3 Fog in segment and poor quality height estimation -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.220.table b/definitions/grib2/tables/9/4.220.table index 9c957eb01..7a18fa1fd 100644 --- a/definitions/grib2/tables/9/4.220.table +++ b/definitions/grib2/tables/9/4.220.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Latitude -1 1 Longitude -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.221.table b/definitions/grib2/tables/9/4.221.table index 5466929c7..eb0b64502 100644 --- a/definitions/grib2/tables/9/4.221.table +++ b/definitions/grib2/tables/9/4.221.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Not included -1 1 Extrapolated -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.222.table b/definitions/grib2/tables/9/4.222.table index c54194e29..f554a7f3d 100644 --- a/definitions/grib2/tables/9/4.222.table +++ b/definitions/grib2/tables/9/4.222.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No -1 1 Yes -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.223.table b/definitions/grib2/tables/9/4.223.table index b6a9be136..706abab78 100644 --- a/definitions/grib2/tables/9/4.223.table +++ b/definitions/grib2/tables/9/4.223.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No fire detected -1 1 Possible fire detected -2 2 Probable fire detected -3 3 Missing value +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing value diff --git a/definitions/grib2/tables/9/4.224.table b/definitions/grib2/tables/9/4.224.table index af846f841..cf67496b8 100644 --- a/definitions/grib2/tables/9/4.224.table +++ b/definitions/grib2/tables/9/4.224.table @@ -1,18 +1,18 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No risk area -1 1 Reserved -2 2 General thunderstorm risk area -3 3 Reserved -4 4 Slight risk area -5 5 Reserved -6 6 Moderate risk area -7 7 Reserved -8 8 High risk area -# 9-10 Reserved -11 11 Dry thunderstorm (dry lightning) risk area -# 12-13 Reserved -14 14 Critical risk area -# 15-17 Reserved -18 18 Extremely critical risk area -# 19-254 Reserved -255 255 Missing +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/9/4.227.table b/definitions/grib2/tables/9/4.227.table index 56fa0e752..5a0771c0f 100644 --- a/definitions/grib2/tables/9/4.227.table +++ b/definitions/grib2/tables/9/4.227.table @@ -5,6 +5,6 @@ 2 2 Convective 3 3 Stratiform 4 4 Freezing -# 5-191 Reserved +# 5-191 Reserved # 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/9/4.3.table b/definitions/grib2/tables/9/4.3.table index 68e2cc83f..8a4e919c9 100644 --- a/definitions/grib2/tables/9/4.3.table +++ b/definitions/grib2/tables/9/4.3.table @@ -1,16 +1,16 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Analysis -1 1 Initialization -2 2 Forecast -3 3 Bias corrected forecast -4 4 Ensemble forecast -5 5 Probability forecast -6 6 Forecast error -7 7 Analysis error -8 8 Observation -9 9 Climatological -10 10 Probability-weighted forecast -11 11 Bias-corrected ensemble forecast -# 12-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.4.table b/definitions/grib2/tables/9/4.4.table index df5272d2f..511c76aa9 100644 --- a/definitions/grib2/tables/9/4.4.table +++ b/definitions/grib2/tables/9/4.4.table @@ -1,17 +1,17 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 m Minute -1 h Hour -2 D Day -3 M Month -4 Y Year -5 10Y Decade (10 years) -6 30Y Normal (30 years) -7 C Century (100 years) -# 8-9 Reserved -10 3h 3 hours -11 6h 6 hours -12 12h 12 hours -13 s Second -# 14-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.5.table b/definitions/grib2/tables/9/4.5.table index 9a46a3aa0..d07c799a8 100644 --- a/definitions/grib2/tables/9/4.5.table +++ b/definitions/grib2/tables/9/4.5.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface 2 2 Cloud base level 3 3 Level of cloud tops @@ -12,11 +12,11 @@ 10 10 Entire atmosphere 11 11 Cumulonimbus (CB) base (m) 12 12 Cumulonimbus (CB) top (m) -# 13-19 Reserved +# 13-19 Reserved 20 20 Isothermal level (K) -# 21-99 Reserved +# 21-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -25,7 +25,7 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level 112 112 Reserved 113 113 Logarithmic hybrid level @@ -35,14 +35,14 @@ 119 hpl Hybrid pressure level # 120-149 Reserved 150 150 Generalized vertical height coordinate -# 151-159 Reserved -160 160 Depth below sea level m +# 151-159 Reserved +160 160 Depth below sea level m 161 161 Depth below water surface (m) 162 sfc Lake or river bottom 163 163 Bottom of sediment layer 164 164 Bottom of thermally active sediment layer 165 165 Bottom of sediment layer penetrated by thermal wave 166 sfc Mixing layer -# 167-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 167-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.6.table b/definitions/grib2/tables/9/4.6.table index 54f2993c3..eaa5c4362 100644 --- a/definitions/grib2/tables/9/4.6.table +++ b/definitions/grib2/tables/9/4.6.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Unperturbed high-resolution control forecast -1 1 Unperturbed low-resolution control forecast -2 2 Negatively perturbed forecast -3 3 Positively perturbed forecast -4 4 Multi-model forecast -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.7.table b/definitions/grib2/tables/9/4.7.table index 23e0d457e..e6d887bdb 100644 --- a/definitions/grib2/tables/9/4.7.table +++ b/definitions/grib2/tables/9/4.7.table @@ -1,14 +1,14 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Unweighted mean of all members -1 1 Weighted mean of all members -2 2 Standard deviation with respect to cluster mean -3 3 Standard deviation with respect to cluster mean, normalized -4 4 Spread of all members -5 5 Large anomaly index of all members -6 6 Unweighted mean of the cluster members -7 7 Interquartile range (range between the 25th and 75th quantile) -8 8 Minimum of all ensemble members -9 9 Maximum of all ensemble members -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.8.table b/definitions/grib2/tables/9/4.8.table index 37a6cf767..d06153079 100644 --- a/definitions/grib2/tables/9/4.8.table +++ b/definitions/grib2/tables/9/4.8.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Anomaly correlation -1 1 Root mean square -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.9.table b/definitions/grib2/tables/9/4.9.table index 19e64a3d2..5243e58dd 100644 --- a/definitions/grib2/tables/9/4.9.table +++ b/definitions/grib2/tables/9/4.9.table @@ -1,9 +1,9 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Probability of event below lower limit -1 1 Probability of event above upper limit -2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) -3 3 Probability of event above lower limit -4 4 Probability of event below upper limit -# 5-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/4.91.table b/definitions/grib2/tables/9/4.91.table index 5d975ad8e..cea421695 100644 --- a/definitions/grib2/tables/9/4.91.table +++ b/definitions/grib2/tables/9/4.91.table @@ -1,16 +1,16 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Smaller than first limit -1 1 Greater than second limit -2 2 Between first and second limit. The range includes the first limit but not the second limit -3 3 Greater than first limit -4 4 Smaller than second limit -5 5 Smaller or equal first limit -6 6 Greater or equal second limit -7 7 Between first and second. The range includes the first limit and the second limit -8 8 Greater or equal first limit -9 9 Smaller or equal second limit -10 10 Between first and second limit. The range includes the second limit but not the first limit -11 11 Equal to first limit. +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit +11 11 Equal to first limit. # 12-191 Reserved # 192-254 Reserved for local use -255 missing Missing +255 missing Missing diff --git a/definitions/grib2/tables/9/5.1.table b/definitions/grib2/tables/9/5.1.table index 100d4106d..158a35850 100644 --- a/definitions/grib2/tables/9/5.1.table +++ b/definitions/grib2/tables/9/5.1.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Floating point -1 1 Integer -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/5.2.table b/definitions/grib2/tables/9/5.2.table index 4d0808be6..d9896e11f 100644 --- a/definitions/grib2/tables/9/5.2.table +++ b/definitions/grib2/tables/9/5.2.table @@ -1,8 +1,8 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Explicit coordinate values set -1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 -# 2-10 Reserved +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1)=C1, f(n)=f(n-1)+C2 +# 2-10 Reserved 11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) -# 12-191 Reserved -# 192-254 Reserved for local use +# 12-191 Reserved +# 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/9/5.3.table b/definitions/grib2/tables/9/5.3.table index 705fa6524..6f228aeec 100644 --- a/definitions/grib2/tables/9/5.3.table +++ b/definitions/grib2/tables/9/5.3.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -1 1 Direction degrees true -2 2 Frequency (s-1) -3 3 Radial number (2pi/lambda) (m-1) -# 4-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/5.4.table b/definitions/grib2/tables/9/5.4.table index 8133367a5..f844f557e 100644 --- a/definitions/grib2/tables/9/5.4.table +++ b/definitions/grib2/tables/9/5.4.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Row by row splitting -1 1 General group splitting -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/5.40.table b/definitions/grib2/tables/9/5.40.table index 0d56ad0e0..2431eb547 100644 --- a/definitions/grib2/tables/9/5.40.table +++ b/definitions/grib2/tables/9/5.40.table @@ -1,5 +1,5 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Lossless -1 1 Lossy -# 2-254 Reserved -255 255 Missing +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/9/5.5.table b/definitions/grib2/tables/9/5.5.table index 5d625dbda..f2216e273 100644 --- a/definitions/grib2/tables/9/5.5.table +++ b/definitions/grib2/tables/9/5.5.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 No explicit missing values included within data values -1 1 Primary missing values included within data values -2 2 Primary and secondary missing values included within data values -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/9/5.6.table b/definitions/grib2/tables/9/5.6.table index 16f4c25f3..3b0892d37 100644 --- a/definitions/grib2/tables/9/5.6.table +++ b/definitions/grib2/tables/9/5.6.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 First-order spatial differencing -2 2 Second-order spatial differencing -# 3-191 Reserved +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved # 192-254 Reserved for local use -255 255 Missing +255 255 Missing diff --git a/definitions/grib2/tables/9/5.7.table b/definitions/grib2/tables/9/5.7.table index b93aa8130..f056d3059 100644 --- a/definitions/grib2/tables/9/5.7.table +++ b/definitions/grib2/tables/9/5.7.table @@ -1,7 +1,7 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit -0 0 Reserved -1 1 IEEE 32-bit (I=4 in section 7) -2 2 IEEE 64-bit (I=8 in section 7) -3 3 IEEE 128-bit (I=16 in section 7) -# 4-254 Reserved -255 255 Missing +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/9/6.0.table b/definitions/grib2/tables/9/6.0.table index aecdc6e5e..9c9dba372 100644 --- a/definitions/grib2/tables/9/6.0.table +++ b/definitions/grib2/tables/9/6.0.table @@ -1,6 +1,6 @@ # Automatically generated by ./create_tables.pl from database fm92_grib2@grib-param-db-prod.ecmwf.int, do not edit 0 0 A bit map applies to this product and is specified in this Section 1 1 A bit map pre-determined by the originating/generating Centre applies to this product and is not specified in this Section -# 1-253 A bit map predetermined by the originating/generating Centre applies to this product and is not specified in this Section -254 254 A bit map defined previously in the same GRIB message applies to this product -255 255 A bit map does not apply to this product +# 1-253 A bit map predetermined by the originating/generating Centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product From 26d3e99dbf228a37ba4b6a5ec163362c95a5fbb7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 23 Apr 2024 15:16:09 +0000 Subject: [PATCH 059/196] ECC-1811: GRIB: Practical salinity encodings --- definitions/grib1/localConcepts/ecmf/cfVarName.def | 2 +- definitions/grib1/localConcepts/ecmf/name.def | 4 ++-- definitions/grib1/localConcepts/ecmf/paramId.def | 2 +- definitions/grib1/localConcepts/ecmf/shortName.def | 2 +- definitions/grib1/localConcepts/ecmf/units.def | 2 +- definitions/grib2/localConcepts/s2s/cfVarName.def | 2 +- definitions/grib2/localConcepts/s2s/name.def | 4 ++-- definitions/grib2/localConcepts/s2s/paramId.def | 2 +- definitions/grib2/localConcepts/s2s/shortName.def | 2 +- definitions/grib2/localConcepts/s2s/units.def | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/cfVarName.def b/definitions/grib1/localConcepts/ecmf/cfVarName.def index f652e0ac8..f1e0a847a 100644 --- a/definitions/grib1/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib1/localConcepts/ecmf/cfVarName.def @@ -13244,7 +13244,7 @@ table2Version = 151 ; indicatorOfParameter = 174 ; } -#Average salinity in the upper 300m +#Average sea water practical salinity in the upper 300m 'sav300' = { table2Version = 151 ; indicatorOfParameter = 175 ; diff --git a/definitions/grib1/localConcepts/ecmf/name.def b/definitions/grib1/localConcepts/ecmf/name.def index c6600060a..822393940 100644 --- a/definitions/grib1/localConcepts/ecmf/name.def +++ b/definitions/grib1/localConcepts/ecmf/name.def @@ -13244,8 +13244,8 @@ table2Version = 151 ; indicatorOfParameter = 174 ; } -#Average salinity in the upper 300m -'Average salinity in the upper 300m' = { +#Average sea water practical salinity in the upper 300m +'Average sea water practical salinity in the upper 300m' = { table2Version = 151 ; indicatorOfParameter = 175 ; } diff --git a/definitions/grib1/localConcepts/ecmf/paramId.def b/definitions/grib1/localConcepts/ecmf/paramId.def index 25b2986ec..d70774a03 100644 --- a/definitions/grib1/localConcepts/ecmf/paramId.def +++ b/definitions/grib1/localConcepts/ecmf/paramId.def @@ -13244,7 +13244,7 @@ table2Version = 151 ; indicatorOfParameter = 174 ; } -#Average salinity in the upper 300m +#Average sea water practical salinity in the upper 300m '151175' = { table2Version = 151 ; indicatorOfParameter = 175 ; diff --git a/definitions/grib1/localConcepts/ecmf/shortName.def b/definitions/grib1/localConcepts/ecmf/shortName.def index 70ccd9973..456286de5 100644 --- a/definitions/grib1/localConcepts/ecmf/shortName.def +++ b/definitions/grib1/localConcepts/ecmf/shortName.def @@ -13244,7 +13244,7 @@ table2Version = 151 ; indicatorOfParameter = 174 ; } -#Average salinity in the upper 300m +#Average sea water practical salinity in the upper 300m 'sav300' = { table2Version = 151 ; indicatorOfParameter = 175 ; diff --git a/definitions/grib1/localConcepts/ecmf/units.def b/definitions/grib1/localConcepts/ecmf/units.def index 7fe4b06ee..799ca28a7 100644 --- a/definitions/grib1/localConcepts/ecmf/units.def +++ b/definitions/grib1/localConcepts/ecmf/units.def @@ -13244,7 +13244,7 @@ table2Version = 151 ; indicatorOfParameter = 174 ; } -#Average salinity in the upper 300m +#Average sea water practical salinity in the upper 300m 'psu' = { table2Version = 151 ; indicatorOfParameter = 175 ; diff --git a/definitions/grib2/localConcepts/s2s/cfVarName.def b/definitions/grib2/localConcepts/s2s/cfVarName.def index 7b1815490..3839fd01a 100644 --- a/definitions/grib2/localConcepts/s2s/cfVarName.def +++ b/definitions/grib2/localConcepts/s2s/cfVarName.def @@ -199,7 +199,7 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Average salinity in the upper 300m +#Average sea water practical salinity in the upper 300m 'sav300' = { discipline = 10 ; parameterCategory = 4 ; diff --git a/definitions/grib2/localConcepts/s2s/name.def b/definitions/grib2/localConcepts/s2s/name.def index 8f16d165e..8705ee5a4 100644 --- a/definitions/grib2/localConcepts/s2s/name.def +++ b/definitions/grib2/localConcepts/s2s/name.def @@ -199,8 +199,8 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Average salinity in the upper 300m -'Average salinity in the upper 300m' = { +#Average sea water practical salinity in the upper 300m +'Average sea water practical salinity in the upper 300m' = { discipline = 10 ; parameterCategory = 4 ; parameterNumber = 21 ; diff --git a/definitions/grib2/localConcepts/s2s/paramId.def b/definitions/grib2/localConcepts/s2s/paramId.def index 9443ada3a..89416c6bb 100644 --- a/definitions/grib2/localConcepts/s2s/paramId.def +++ b/definitions/grib2/localConcepts/s2s/paramId.def @@ -199,7 +199,7 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Average salinity in the upper 300m +#Average sea water practical salinity in the upper 300m '151175' = { discipline = 10 ; parameterCategory = 4 ; diff --git a/definitions/grib2/localConcepts/s2s/shortName.def b/definitions/grib2/localConcepts/s2s/shortName.def index 4722e59a4..232411ae6 100644 --- a/definitions/grib2/localConcepts/s2s/shortName.def +++ b/definitions/grib2/localConcepts/s2s/shortName.def @@ -199,7 +199,7 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Average salinity in the upper 300m +#Average sea water practical salinity in the upper 300m 'sav300' = { discipline = 10 ; parameterCategory = 4 ; diff --git a/definitions/grib2/localConcepts/s2s/units.def b/definitions/grib2/localConcepts/s2s/units.def index a2bd46e5d..e1b6ecd4e 100644 --- a/definitions/grib2/localConcepts/s2s/units.def +++ b/definitions/grib2/localConcepts/s2s/units.def @@ -199,7 +199,7 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Average salinity in the upper 300m +#Average sea water practical salinity in the upper 300m 'psu' = { discipline = 10 ; parameterCategory = 4 ; From 58124eedac104eeaaf445f934f4f4ea8a0865723 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 23 Apr 2024 15:26:47 +0000 Subject: [PATCH 060/196] ECC-1811: paramId for conversion + test --- definitions/grib1/localConcepts/ecmf/paramIdForConversion.def | 2 ++ tests/grib_ecc-1806.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def b/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def index 67de48733..8f8c9d1c6 100644 --- a/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def +++ b/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def @@ -29,3 +29,5 @@ 235040 = {gribTablesVersionNo=172; indicatorOfParameter=179; centre=98;} # 174098 -> 262000 262000 = {gribTablesVersionNo=174; indicatorOfParameter=98; centre=98;} +# 151175 -> 262118 +262118 = {gribTablesVersionNo=151; indicatorOfParameter=175; centre=98;} diff --git a/tests/grib_ecc-1806.sh b/tests/grib_ecc-1806.sh index 596158b8d..fcd4684f2 100755 --- a/tests/grib_ecc-1806.sh +++ b/tests/grib_ecc-1806.sh @@ -53,7 +53,7 @@ test_conversion 172176 235037 msnswrf test_conversion 172177 235038 msnlwrf test_conversion 172178 235039 mtnswrf test_conversion 172179 235040 mtnlwrf - +test_conversion 151175 262118 sc300m # Clean up rm -f $tempGrib1 $tempGrib2 $tempLog From 453122aee8e81d6232a2fb65d6353cc7b50fc2ad Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 23 Apr 2024 16:35:52 +0000 Subject: [PATCH 061/196] ECC-1810: GRIB: Surface sea water velocity encodings --- .../grib1/localConcepts/ecmf/cfName.def | 4 ++-- .../grib1/localConcepts/ecmf/cfVarName.def | 4 ++-- definitions/grib1/localConcepts/ecmf/name.def | 8 ++++---- .../grib1/localConcepts/ecmf/paramId.def | 4 ++-- .../grib1/localConcepts/ecmf/shortName.def | 4 ++-- definitions/grib1/localConcepts/ecmf/units.def | 4 ++-- definitions/grib2/cfName.def | 14 -------------- definitions/grib2/cfVarName.def | 14 -------------- definitions/grib2/localConcepts/s2s/cfName.def | 16 ++++++++++++++++ .../grib2/localConcepts/s2s/cfVarName.def | 16 ++++++++++++++++ definitions/grib2/localConcepts/s2s/name.def | 16 ++++++++++++++++ .../grib2/localConcepts/s2s/paramId.def | 16 ++++++++++++++++ .../grib2/localConcepts/s2s/shortName.def | 16 ++++++++++++++++ definitions/grib2/localConcepts/s2s/units.def | 16 ++++++++++++++++ definitions/grib2/name.def | 14 -------------- definitions/grib2/paramId.def | 14 -------------- definitions/grib2/shortName.def | 14 -------------- definitions/grib2/units.def | 14 -------------- definitions/param_limits.def | 2 ++ tests/grib_data_quality_checks.sh | 18 +----------------- 20 files changed, 113 insertions(+), 115 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/cfName.def b/definitions/grib1/localConcepts/ecmf/cfName.def index 48b023899..f1377da79 100644 --- a/definitions/grib1/localConcepts/ecmf/cfName.def +++ b/definitions/grib1/localConcepts/ecmf/cfName.def @@ -909,12 +909,12 @@ table2Version = 151 ; indicatorOfParameter = 130 ; } -#Eastward sea water velocity +#Eastward surface sea water velocity 'eastward_sea_water_velocity' = { table2Version = 151 ; indicatorOfParameter = 131 ; } -#Northward sea water velocity +#Northward surface sea water velocity 'northward_sea_water_velocity' = { table2Version = 151 ; indicatorOfParameter = 132 ; diff --git a/definitions/grib1/localConcepts/ecmf/cfVarName.def b/definitions/grib1/localConcepts/ecmf/cfVarName.def index f1e0a847a..e3d757597 100644 --- a/definitions/grib1/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib1/localConcepts/ecmf/cfVarName.def @@ -13024,12 +13024,12 @@ table2Version = 151 ; indicatorOfParameter = 130 ; } -#Eastward sea water velocity +#Eastward surface sea water velocity 'uoe' = { table2Version = 151 ; indicatorOfParameter = 131 ; } -#Northward sea water velocity +#Northward surface sea water velocity 'von' = { table2Version = 151 ; indicatorOfParameter = 132 ; diff --git a/definitions/grib1/localConcepts/ecmf/name.def b/definitions/grib1/localConcepts/ecmf/name.def index 822393940..77d5535a7 100644 --- a/definitions/grib1/localConcepts/ecmf/name.def +++ b/definitions/grib1/localConcepts/ecmf/name.def @@ -13024,13 +13024,13 @@ table2Version = 151 ; indicatorOfParameter = 130 ; } -#Eastward sea water velocity -'Eastward sea water velocity' = { +#Eastward surface sea water velocity +'Eastward surface sea water velocity' = { table2Version = 151 ; indicatorOfParameter = 131 ; } -#Northward sea water velocity -'Northward sea water velocity' = { +#Northward surface sea water velocity +'Northward surface sea water velocity' = { table2Version = 151 ; indicatorOfParameter = 132 ; } diff --git a/definitions/grib1/localConcepts/ecmf/paramId.def b/definitions/grib1/localConcepts/ecmf/paramId.def index d70774a03..0ea5b7ea3 100644 --- a/definitions/grib1/localConcepts/ecmf/paramId.def +++ b/definitions/grib1/localConcepts/ecmf/paramId.def @@ -13024,12 +13024,12 @@ table2Version = 151 ; indicatorOfParameter = 130 ; } -#Eastward sea water velocity +#Eastward surface sea water velocity '151131' = { table2Version = 151 ; indicatorOfParameter = 131 ; } -#Northward sea water velocity +#Northward surface sea water velocity '151132' = { table2Version = 151 ; indicatorOfParameter = 132 ; diff --git a/definitions/grib1/localConcepts/ecmf/shortName.def b/definitions/grib1/localConcepts/ecmf/shortName.def index 456286de5..4eb5e6f67 100644 --- a/definitions/grib1/localConcepts/ecmf/shortName.def +++ b/definitions/grib1/localConcepts/ecmf/shortName.def @@ -13024,12 +13024,12 @@ table2Version = 151 ; indicatorOfParameter = 130 ; } -#Eastward sea water velocity +#Eastward surface sea water velocity 'ocu' = { table2Version = 151 ; indicatorOfParameter = 131 ; } -#Northward sea water velocity +#Northward surface sea water velocity 'ocv' = { table2Version = 151 ; indicatorOfParameter = 132 ; diff --git a/definitions/grib1/localConcepts/ecmf/units.def b/definitions/grib1/localConcepts/ecmf/units.def index 799ca28a7..193a0e3c6 100644 --- a/definitions/grib1/localConcepts/ecmf/units.def +++ b/definitions/grib1/localConcepts/ecmf/units.def @@ -13024,12 +13024,12 @@ table2Version = 151 ; indicatorOfParameter = 130 ; } -#Eastward sea water velocity +#Eastward surface sea water velocity 'm s**-1' = { table2Version = 151 ; indicatorOfParameter = 131 ; } -#Northward sea water velocity +#Northward surface sea water velocity 'm s**-1' = { table2Version = 151 ; indicatorOfParameter = 132 ; diff --git a/definitions/grib2/cfName.def b/definitions/grib2/cfName.def index 3ff5e57ac..a3105477e 100644 --- a/definitions/grib2/cfName.def +++ b/definitions/grib2/cfName.def @@ -343,20 +343,6 @@ parameterCategory = 1 ; parameterNumber = 10 ; } -#Eastward sea water velocity -'eastward_sea_water_velocity' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 2 ; - typeOfFirstFixedSurface = 160 ; - } -#Northward sea water velocity -'northward_sea_water_velocity' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - } #Nitrogen dioxide mass mixing ratio 'mass_fraction_of_nitrogen_dioxide_in_air' = { discipline = 0 ; diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 510e4b2af..12861730d 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -10565,20 +10565,6 @@ parameterCategory = 0 ; parameterNumber = 44 ; } -#Eastward sea water velocity -'uoe' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 2 ; - typeOfFirstFixedSurface = 160 ; - } -#Northward sea water velocity -'von' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - } #Skin reservoir content 'srcrea' = { discipline = 2 ; diff --git a/definitions/grib2/localConcepts/s2s/cfName.def b/definitions/grib2/localConcepts/s2s/cfName.def index bcf3dbc72..76e473557 100644 --- a/definitions/grib2/localConcepts/s2s/cfName.def +++ b/definitions/grib2/localConcepts/s2s/cfName.def @@ -56,6 +56,22 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Eastward surface sea water velocity +'eastward_sea_water_velocity' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } +#Northward surface sea water velocity +'northward_sea_water_velocity' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } #Sea surface height 'sea_surface_height_above_geoid' = { discipline = 10 ; diff --git a/definitions/grib2/localConcepts/s2s/cfVarName.def b/definitions/grib2/localConcepts/s2s/cfVarName.def index 3839fd01a..551609168 100644 --- a/definitions/grib2/localConcepts/s2s/cfVarName.def +++ b/definitions/grib2/localConcepts/s2s/cfVarName.def @@ -173,6 +173,22 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Eastward surface sea water velocity +'ocu' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } +#Northward surface sea water velocity +'ocv' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } #Sea surface height 'zos' = { discipline = 10 ; diff --git a/definitions/grib2/localConcepts/s2s/name.def b/definitions/grib2/localConcepts/s2s/name.def index 8705ee5a4..cf970208c 100644 --- a/definitions/grib2/localConcepts/s2s/name.def +++ b/definitions/grib2/localConcepts/s2s/name.def @@ -173,6 +173,22 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Eastward surface sea water velocity +'Eastward surface sea water velocity' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } +#Northward surface sea water velocity +'Northward surface sea water velocity' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } #Sea surface height 'Sea surface height' = { discipline = 10 ; diff --git a/definitions/grib2/localConcepts/s2s/paramId.def b/definitions/grib2/localConcepts/s2s/paramId.def index 89416c6bb..bfc1c9ee1 100644 --- a/definitions/grib2/localConcepts/s2s/paramId.def +++ b/definitions/grib2/localConcepts/s2s/paramId.def @@ -173,6 +173,22 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Eastward surface sea water velocity +'151131' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } +#Northward surface sea water velocity +'151132' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } #Sea surface height '151145' = { discipline = 10 ; diff --git a/definitions/grib2/localConcepts/s2s/shortName.def b/definitions/grib2/localConcepts/s2s/shortName.def index 232411ae6..135b5992a 100644 --- a/definitions/grib2/localConcepts/s2s/shortName.def +++ b/definitions/grib2/localConcepts/s2s/shortName.def @@ -173,6 +173,22 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Eastward surface sea water velocity +'ocu' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } +#Northward surface sea water velocity +'ocv' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } #Sea surface height 'zos' = { discipline = 10 ; diff --git a/definitions/grib2/localConcepts/s2s/units.def b/definitions/grib2/localConcepts/s2s/units.def index e1b6ecd4e..a37997b56 100644 --- a/definitions/grib2/localConcepts/s2s/units.def +++ b/definitions/grib2/localConcepts/s2s/units.def @@ -173,6 +173,22 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Eastward surface sea water velocity +'m s**-1' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } +#Northward surface sea water velocity +'m s**-1' = { + discipline = 10 ; + parameterCategory = 1 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 160 ; + typeOfStatisticalProcessing = 0 ; + } #Sea surface height 'm' = { discipline = 10 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 1a0196347..c849348ab 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -10565,20 +10565,6 @@ parameterCategory = 0 ; parameterNumber = 44 ; } -#Eastward sea water velocity -'Eastward sea water velocity' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 2 ; - typeOfFirstFixedSurface = 160 ; - } -#Northward sea water velocity -'Northward sea water velocity' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - } #Skin reservoir content 'Skin reservoir content' = { discipline = 2 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 55cc9a44e..5e9b0a30c 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -10565,20 +10565,6 @@ parameterCategory = 0 ; parameterNumber = 44 ; } -#Eastward sea water velocity -'151131' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 2 ; - typeOfFirstFixedSurface = 160 ; - } -#Northward sea water velocity -'151132' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - } #Skin reservoir content '160198' = { discipline = 2 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index b855a6063..08c54e9f9 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -10565,20 +10565,6 @@ parameterCategory = 0 ; parameterNumber = 44 ; } -#Eastward sea water velocity -'ocu' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 2 ; - typeOfFirstFixedSurface = 160 ; - } -#Northward sea water velocity -'ocv' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - } #Skin reservoir content 'srcrea' = { discipline = 2 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index ab472b684..7966dd8f0 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -10565,20 +10565,6 @@ parameterCategory = 0 ; parameterNumber = 44 ; } -#Eastward sea water velocity -'m s**-1' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 2 ; - typeOfFirstFixedSurface = 160 ; - } -#Northward sea water velocity -'m s**-1' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - } #Skin reservoir content 'kg m**-2' = { discipline = 2 ; diff --git a/definitions/param_limits.def b/definitions/param_limits.def index 1bbcd18d6..215cbfec0 100644 --- a/definitions/param_limits.def +++ b/definitions/param_limits.def @@ -18,6 +18,7 @@ concept param_value_min(default_min_val) { -60000 = { paramId=228001; } 0 = { paramId=151163; } -3.5 = { paramId=151131; } + -3.5 = { paramId=262140; } -10 = { paramId=260259; } -13000 = { paramId=129; } -1300 = { paramId=156; } @@ -103,6 +104,7 @@ concept param_value_max(default_max_val) { 1000 = { paramId=228001; } 1500 = { paramId=151163; } 3.5 = { paramId=151131; } + 3.5 = { paramId=262140; } 5 = { paramId=260259; } 3500000 = { paramId=129; } 35000 = { paramId=156; } diff --git a/tests/grib_data_quality_checks.sh b/tests/grib_data_quality_checks.sh index bf2fc77b2..6462a8662 100755 --- a/tests/grib_data_quality_checks.sh +++ b/tests/grib_data_quality_checks.sh @@ -88,15 +88,10 @@ grep -q 'allowable limit' $tempErr echo "Test limits which are doubles..." # ------------------------------------- -pid=151131 # has limits -3.5 and +3.5 -${tools_dir}/grib_set -s paramId=$pid $input1 $tempGrib1 +pid=262140 # has limits -3.5 and +3.5 ${tools_dir}/grib_set -s paramId=$pid $input2 $tempGrib2 -minval1=`${tools_dir}/grib_get -p param_value_min:d $tempGrib1` -maxval1=`${tools_dir}/grib_get -p param_value_max:d $tempGrib1` minval2=`${tools_dir}/grib_get -p param_value_min:d $tempGrib2` maxval2=`${tools_dir}/grib_get -p param_value_max:d $tempGrib2` -[ "$minval1" = "-3.5" ] -[ "$maxval1" = "3.5" ] [ "$minval2" = "-3.5" ] [ "$maxval2" = "3.5" ] @@ -104,16 +99,12 @@ maxval2=`${tools_dir}/grib_get -p param_value_max:d $tempGrib2` grib_check_key_equals $tempGrib2 'param_value_min:s,param_value_max:s' '-3.5 3.5' set +e -${tools_dir}/grib_set -s scaleValuesBy=1.1 $tempGrib1 $tempOut 2>$tempErr -stat1=$? ${tools_dir}/grib_set -s scaleValuesBy=1.1 $tempGrib2 $tempOut 2>$tempErr stat2=$? set -e -[ $stat1 -ne 0 ] [ $stat2 -ne 0 ] # Should succeed. Change paramId first and then scale all values down -${tools_dir}/grib_set -s paramId=$pid,scaleValuesBy=0.01 $input1 $tempOut ${tools_dir}/grib_set -s paramId=$pid,scaleValuesBy=0.01 $input2 $tempOut echo "Test close to the limit..." @@ -126,13 +117,6 @@ ${tools_dir}/grib_set -s scaleValuesBy=3.6 $tempGrib2 $tempOut set -e [ $status -ne 0 ] -${tools_dir}/grib_set -s edition=1 $tempGrib2 $tempGrib1 -${tools_dir}/grib_set -s scaleValuesBy=-3 $tempGrib1 $tempOut # OK -set +e -${tools_dir}/grib_set -s scaleValuesBy=-3.55 $tempGrib1 $tempOut -set -e -[ $status -ne 0 ] - echo "Test limits with steps..." # ----------------------------- From 2442beb5573cba99c9c2bcf85cb17a46735494e0 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 24 Apr 2024 09:40:09 +0100 Subject: [PATCH 062/196] ECC-1810: paramId for conversion --- definitions/grib1/localConcepts/ecmf/paramIdForConversion.def | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def b/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def index 8f8c9d1c6..f54df2259 100644 --- a/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def +++ b/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def @@ -31,3 +31,7 @@ 262000 = {gribTablesVersionNo=174; indicatorOfParameter=98; centre=98;} # 151175 -> 262118 262118 = {gribTablesVersionNo=151; indicatorOfParameter=175; centre=98;} +# 151132 -> 262139 +262139 = {gribTablesVersionNo=151; indicatorOfParameter=132; centre=98;} +# 151131 -> 262140 +262140 = {gribTablesVersionNo=151; indicatorOfParameter=131; centre=98;} From 4f3b631e3d61e7ded8e98912a0e87ff0fbd672d8 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 24 Apr 2024 10:35:18 +0000 Subject: [PATCH 063/196] ECC-1810: Delete params 3049 and 3050 --- definitions/grib1/cfVarName.def | 30 ------------------- .../grib1/localConcepts/rjtd/cfVarName.def | 10 ------- definitions/grib1/localConcepts/rjtd/name.def | 10 ------- .../grib1/localConcepts/rjtd/paramId.def | 10 ------- .../grib1/localConcepts/rjtd/shortName.def | 10 ------- .../grib1/localConcepts/rjtd/units.def | 10 ------- definitions/grib1/name.def | 30 ------------------- definitions/grib1/paramId.def | 30 ------------------- definitions/grib1/shortName.def | 30 ------------------- definitions/grib1/units.def | 30 ------------------- 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 -------- 15 files changed, 260 deletions(-) diff --git a/definitions/grib1/cfVarName.def b/definitions/grib1/cfVarName.def index 50489e1a6..94c685c22 100644 --- a/definitions/grib1/cfVarName.def +++ b/definitions/grib1/cfVarName.def @@ -1148,36 +1148,6 @@ table2Version = 1 ; indicatorOfParameter = 48 ; } -#U-component of current -'ucurr' = { - table2Version = 3 ; - indicatorOfParameter = 49 ; - } -#U-component of current -'ucurr' = { - table2Version = 2 ; - indicatorOfParameter = 49 ; - } -#U-component of current -'ucurr' = { - table2Version = 1 ; - indicatorOfParameter = 49 ; - } -#V-component of current -'vcurr' = { - table2Version = 3 ; - indicatorOfParameter = 50 ; - } -#V-component of current -'vcurr' = { - table2Version = 2 ; - indicatorOfParameter = 50 ; - } -#V-component of current -'vcurr' = { - table2Version = 1 ; - indicatorOfParameter = 50 ; - } #Humidity mixing ratio 'mixr' = { table2Version = 3 ; diff --git a/definitions/grib1/localConcepts/rjtd/cfVarName.def b/definitions/grib1/localConcepts/rjtd/cfVarName.def index 5b95ee846..a41399122 100644 --- a/definitions/grib1/localConcepts/rjtd/cfVarName.def +++ b/definitions/grib1/localConcepts/rjtd/cfVarName.def @@ -665,16 +665,6 @@ table2Version = 200 ; indicatorOfParameter = 48 ; } -#U-component of current -'ucurr' = { - table2Version = 200 ; - indicatorOfParameter = 49 ; - } -#V-component of current -'vcurr' = { - table2Version = 200 ; - indicatorOfParameter = 50 ; - } #Humidity mixing ratio 'mixr' = { table2Version = 200 ; diff --git a/definitions/grib1/localConcepts/rjtd/name.def b/definitions/grib1/localConcepts/rjtd/name.def index 50010a10d..d23af9d8e 100644 --- a/definitions/grib1/localConcepts/rjtd/name.def +++ b/definitions/grib1/localConcepts/rjtd/name.def @@ -665,16 +665,6 @@ table2Version = 200 ; indicatorOfParameter = 48 ; } -#U-component of current -'U-component of current' = { - table2Version = 200 ; - indicatorOfParameter = 49 ; - } -#V-component of current -'V-component of current' = { - table2Version = 200 ; - indicatorOfParameter = 50 ; - } #Humidity mixing ratio 'Humidity mixing ratio' = { table2Version = 200 ; diff --git a/definitions/grib1/localConcepts/rjtd/paramId.def b/definitions/grib1/localConcepts/rjtd/paramId.def index 589e86e05..d08f41247 100644 --- a/definitions/grib1/localConcepts/rjtd/paramId.def +++ b/definitions/grib1/localConcepts/rjtd/paramId.def @@ -665,16 +665,6 @@ table2Version = 200 ; indicatorOfParameter = 48 ; } -#U-component of current -'3049' = { - table2Version = 200 ; - indicatorOfParameter = 49 ; - } -#V-component of current -'3050' = { - table2Version = 200 ; - indicatorOfParameter = 50 ; - } #Humidity mixing ratio '3053' = { table2Version = 200 ; diff --git a/definitions/grib1/localConcepts/rjtd/shortName.def b/definitions/grib1/localConcepts/rjtd/shortName.def index 109414b94..10b57b914 100644 --- a/definitions/grib1/localConcepts/rjtd/shortName.def +++ b/definitions/grib1/localConcepts/rjtd/shortName.def @@ -665,16 +665,6 @@ table2Version = 200 ; indicatorOfParameter = 48 ; } -#U-component of current -'ucurr' = { - table2Version = 200 ; - indicatorOfParameter = 49 ; - } -#V-component of current -'vcurr' = { - table2Version = 200 ; - indicatorOfParameter = 50 ; - } #Humidity mixing ratio 'mixr' = { table2Version = 200 ; diff --git a/definitions/grib1/localConcepts/rjtd/units.def b/definitions/grib1/localConcepts/rjtd/units.def index 93e7b0e56..05a2a7758 100644 --- a/definitions/grib1/localConcepts/rjtd/units.def +++ b/definitions/grib1/localConcepts/rjtd/units.def @@ -665,16 +665,6 @@ table2Version = 200 ; indicatorOfParameter = 48 ; } -#U-component of current -'m s**-1' = { - table2Version = 200 ; - indicatorOfParameter = 49 ; - } -#V-component of current -'m s**-1' = { - table2Version = 200 ; - indicatorOfParameter = 50 ; - } #Humidity mixing ratio 'kg kg**-1' = { table2Version = 200 ; diff --git a/definitions/grib1/name.def b/definitions/grib1/name.def index 7d9a3f84b..e7352f034 100644 --- a/definitions/grib1/name.def +++ b/definitions/grib1/name.def @@ -1148,36 +1148,6 @@ table2Version = 1 ; indicatorOfParameter = 48 ; } -#U-component of current -'U-component of current' = { - table2Version = 3 ; - indicatorOfParameter = 49 ; - } -#U-component of current -'U-component of current' = { - table2Version = 2 ; - indicatorOfParameter = 49 ; - } -#U-component of current -'U-component of current' = { - table2Version = 1 ; - indicatorOfParameter = 49 ; - } -#V-component of current -'V-component of current' = { - table2Version = 3 ; - indicatorOfParameter = 50 ; - } -#V-component of current -'V-component of current' = { - table2Version = 2 ; - indicatorOfParameter = 50 ; - } -#V-component of current -'V-component of current' = { - table2Version = 1 ; - indicatorOfParameter = 50 ; - } #Humidity mixing ratio 'Humidity mixing ratio' = { table2Version = 3 ; diff --git a/definitions/grib1/paramId.def b/definitions/grib1/paramId.def index f3031f392..425fa489d 100644 --- a/definitions/grib1/paramId.def +++ b/definitions/grib1/paramId.def @@ -1148,36 +1148,6 @@ table2Version = 1 ; indicatorOfParameter = 48 ; } -#U-component of current -'3049' = { - table2Version = 3 ; - indicatorOfParameter = 49 ; - } -#U-component of current -'3049' = { - table2Version = 2 ; - indicatorOfParameter = 49 ; - } -#U-component of current -'3049' = { - table2Version = 1 ; - indicatorOfParameter = 49 ; - } -#V-component of current -'3050' = { - table2Version = 3 ; - indicatorOfParameter = 50 ; - } -#V-component of current -'3050' = { - table2Version = 2 ; - indicatorOfParameter = 50 ; - } -#V-component of current -'3050' = { - table2Version = 1 ; - indicatorOfParameter = 50 ; - } #Humidity mixing ratio '3053' = { table2Version = 3 ; diff --git a/definitions/grib1/shortName.def b/definitions/grib1/shortName.def index d78bf0d39..e2153ff94 100644 --- a/definitions/grib1/shortName.def +++ b/definitions/grib1/shortName.def @@ -1148,36 +1148,6 @@ table2Version = 1 ; indicatorOfParameter = 48 ; } -#U-component of current -'ucurr' = { - table2Version = 3 ; - indicatorOfParameter = 49 ; - } -#U-component of current -'ucurr' = { - table2Version = 2 ; - indicatorOfParameter = 49 ; - } -#U-component of current -'ucurr' = { - table2Version = 1 ; - indicatorOfParameter = 49 ; - } -#V-component of current -'vcurr' = { - table2Version = 3 ; - indicatorOfParameter = 50 ; - } -#V-component of current -'vcurr' = { - table2Version = 2 ; - indicatorOfParameter = 50 ; - } -#V-component of current -'vcurr' = { - table2Version = 1 ; - indicatorOfParameter = 50 ; - } #Humidity mixing ratio 'mixr' = { table2Version = 3 ; diff --git a/definitions/grib1/units.def b/definitions/grib1/units.def index a8a949696..4ad5faeaa 100644 --- a/definitions/grib1/units.def +++ b/definitions/grib1/units.def @@ -1148,36 +1148,6 @@ table2Version = 1 ; indicatorOfParameter = 48 ; } -#U-component of current -'m s**-1' = { - table2Version = 3 ; - indicatorOfParameter = 49 ; - } -#U-component of current -'m s**-1' = { - table2Version = 2 ; - indicatorOfParameter = 49 ; - } -#U-component of current -'m s**-1' = { - table2Version = 1 ; - indicatorOfParameter = 49 ; - } -#V-component of current -'m s**-1' = { - table2Version = 3 ; - indicatorOfParameter = 50 ; - } -#V-component of current -'m s**-1' = { - table2Version = 2 ; - indicatorOfParameter = 50 ; - } -#V-component of current -'m s**-1' = { - table2Version = 1 ; - indicatorOfParameter = 50 ; - } #Humidity mixing ratio 'kg kg**-1' = { table2Version = 3 ; diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 12861730d..e6eea311b 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -10187,18 +10187,6 @@ parameterCategory = 2 ; parameterNumber = 16 ; } -#U-component of current -'ucurr' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 2 ; - } -#V-component of current -'vcurr' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 3 ; - } #Precipitable water 'pwat' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index c849348ab..52b6e999f 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -10187,18 +10187,6 @@ parameterCategory = 2 ; parameterNumber = 16 ; } -#U-component of current -'U-component of current' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 2 ; - } -#V-component of current -'V-component of current' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 3 ; - } #Precipitable water 'Precipitable water' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 5e9b0a30c..550d5bd9a 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -10187,18 +10187,6 @@ parameterCategory = 2 ; parameterNumber = 16 ; } -#U-component of current -'3049' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 2 ; - } -#V-component of current -'3050' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 3 ; - } #Precipitable water '3054' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 08c54e9f9..a0c2cb4f6 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -10187,18 +10187,6 @@ parameterCategory = 2 ; parameterNumber = 16 ; } -#U-component of current -'ucurr' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 2 ; - } -#V-component of current -'vcurr' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 3 ; - } #Precipitable water 'pwat' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 7966dd8f0..4e2175d0f 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -10187,18 +10187,6 @@ parameterCategory = 2 ; parameterNumber = 16 ; } -#U-component of current -'m s**-1' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 2 ; - } -#V-component of current -'m s**-1' = { - discipline = 10 ; - parameterCategory = 1 ; - parameterNumber = 3 ; - } #Precipitable water 'kg m**-2' = { discipline = 0 ; From 7da792f1e70c7e2d2e7b1cdf0ee0e0f344382b3c Mon Sep 17 00:00:00 2001 From: Dusan Figala Date: Wed, 24 Apr 2024 13:45:38 +0200 Subject: [PATCH 064/196] Run codecov on self hosted runners --- .github/workflows/ci.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f11896b00..2f6528ea8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@main with: eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} + codecov_upload: true secrets: inherit # Run CI of private downstream packages on self-hosted runners @@ -74,15 +75,6 @@ jobs: event_type: downstream-ci-hpc payload: '{"eccodes": "ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }}"}' - codecov: - name: code-coverage - if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} - uses: ./.github/workflows/reusable-ci.yml - with: - eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} - codecov: true - secrets: inherit - notify: runs-on: ubuntu-latest needs: From 492fe6edad504854e203ccb84efca38200a2f09f Mon Sep 17 00:00:00 2001 From: Dusan Figala Date: Wed, 24 Apr 2024 13:48:51 +0200 Subject: [PATCH 065/196] Update notify job needs --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f6528ea8..16c400bec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,6 @@ jobs: - private-downstream-ci - downstream-ci-hpc - private-downstream-ci-hpc - - codecov if: always() && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} steps: - name: Trigger Teams notification From 3beeb90f6a6ab4db725779649840cd066cfd4c58 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 24 Apr 2024 14:00:32 +0100 Subject: [PATCH 066/196] Error messages --- src/grib_expression_class_accessor.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/grib_expression_class_accessor.cc b/src/grib_expression_class_accessor.cc index 39fe4f109..064cc2051 100644 --- a/src/grib_expression_class_accessor.cc +++ b/src/grib_expression_class_accessor.cc @@ -174,10 +174,11 @@ grib_expression* new_accessor_expression(grib_context* c, const char* name, long static int native_type(grib_expression* g, grib_handle* h) { grib_expression_accessor* e = (grib_expression_accessor*)g; - int type = 0; + int type = 0; int err; - if ((err = grib_get_native_type(h, e->name, &type)) != GRIB_SUCCESS) + if ((err = grib_get_native_type(h, e->name, &type)) != GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, - "Error in native_type %s : %s", e->name, grib_get_error_message(err)); + "Error in evaluating the type of '%s': %s", e->name, grib_get_error_message(err)); + } return type; } From 4f759768e3e308c9ce5a10f77cdb2e5cedeb8ac3 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 24 Apr 2024 14:01:12 +0100 Subject: [PATCH 067/196] Print dataset when concept match fails --- src/grib_accessor_class_concept.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/grib_accessor_class_concept.cc b/src/grib_accessor_class_concept.cc index 56ec86e30..1462afcfc 100644 --- a/src/grib_accessor_class_concept.cc +++ b/src/grib_accessor_class_concept.cc @@ -381,6 +381,11 @@ static int grib_concept_apply(grib_accessor* a, const char* name) grib_get_string(h, "centre", centre_s, ¢re_len) == GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, "concept: input handle edition=%ld, centre=%s", editionNumber, centre_s); } + char dataset_s[80]; + size_t dataset_len = sizeof(dataset_s); + if (grib_get_string(h, "datasetForLocal", dataset_s, &dataset_len) == GRIB_SUCCESS && !STR_EQUAL(dataset_s, "unknown")) { + grib_context_log(h->context, GRIB_LOG_ERROR, "concept: input handle dataset=%s", dataset_s); + } if (strcmp(act->name, "paramId") == 0) { if (string_to_long(name, &dummy, 1) == GRIB_SUCCESS) { // The paramId value is an integer. Show them the param DB From c367e7dee774cd617dbf5e9cd3e9bb96186d2454 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 24 Apr 2024 13:59:42 +0000 Subject: [PATCH 068/196] ECC-1799: Fix the keys of 152 (lnsp) --- definitions/grib2/localConcepts/era/name.def | 2 +- definitions/grib2/localConcepts/era/paramId.def | 2 +- definitions/grib2/localConcepts/era/shortName.def | 2 +- definitions/grib2/localConcepts/era/units.def | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/definitions/grib2/localConcepts/era/name.def b/definitions/grib2/localConcepts/era/name.def index 4d2ad4109..78a476de6 100644 --- a/definitions/grib2/localConcepts/era/name.def +++ b/definitions/grib2/localConcepts/era/name.def @@ -32,7 +32,7 @@ discipline = 0 ; parameterCategory = 3 ; parameterNumber = 25 ; - typeOfStatisticalProcessing = 105 ; + typeOfFirstFixedSurface = 105 ; } #Temperature difference 'Temperature difference' = { diff --git a/definitions/grib2/localConcepts/era/paramId.def b/definitions/grib2/localConcepts/era/paramId.def index 7b3a0ca44..31219cfa9 100644 --- a/definitions/grib2/localConcepts/era/paramId.def +++ b/definitions/grib2/localConcepts/era/paramId.def @@ -32,7 +32,7 @@ discipline = 0 ; parameterCategory = 3 ; parameterNumber = 25 ; - typeOfStatisticalProcessing = 105 ; + typeOfFirstFixedSurface = 105 ; } #Temperature difference '200130' = { diff --git a/definitions/grib2/localConcepts/era/shortName.def b/definitions/grib2/localConcepts/era/shortName.def index 5deb9835b..beb0f3d79 100644 --- a/definitions/grib2/localConcepts/era/shortName.def +++ b/definitions/grib2/localConcepts/era/shortName.def @@ -32,7 +32,7 @@ discipline = 0 ; parameterCategory = 3 ; parameterNumber = 25 ; - typeOfStatisticalProcessing = 105 ; + typeOfFirstFixedSurface = 105 ; } #Temperature difference 'tdiff' = { diff --git a/definitions/grib2/localConcepts/era/units.def b/definitions/grib2/localConcepts/era/units.def index f24cf39be..95c5b4af8 100644 --- a/definitions/grib2/localConcepts/era/units.def +++ b/definitions/grib2/localConcepts/era/units.def @@ -32,7 +32,7 @@ discipline = 0 ; parameterCategory = 3 ; parameterNumber = 25 ; - typeOfStatisticalProcessing = 105 ; + typeOfFirstFixedSurface = 105 ; } #Temperature difference 'K' = { From ce7301ee44a52c286fac5bcbcabef26bbffc0c33 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 24 Apr 2024 16:18:16 +0000 Subject: [PATCH 069/196] ECC-1812: GRIB2: Add time-mean version of 159; blh --- definitions/grib2/cfVarName.def | 7 +++++++ definitions/grib2/name.def | 7 +++++++ definitions/grib2/paramId.def | 7 +++++++ definitions/grib2/shortName.def | 7 +++++++ definitions/grib2/units.def | 7 +++++++ 5 files changed, 35 insertions(+) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index e6eea311b..33c22592d 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -5013,6 +5013,13 @@ parameterNumber = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean boundary layer height +'mblh' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean 10 metre U wind component 'm10u' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 52b6e999f..ad51e0531 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -5013,6 +5013,13 @@ parameterNumber = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean boundary layer height +'Time-mean boundary layer height' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean 10 metre U wind component 'Time-mean 10 metre U wind component' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 550d5bd9a..ebd8fa26b 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -5013,6 +5013,13 @@ parameterNumber = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean boundary layer height +'235159' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean 10 metre U wind component '235165' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index a0c2cb4f6..fbecc6945 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -5013,6 +5013,13 @@ parameterNumber = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean boundary layer height +'mblh' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean 10 metre U wind component 'm10u' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 4e2175d0f..e1ef35857 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -5013,6 +5013,13 @@ parameterNumber = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean boundary layer height +'m' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean 10 metre U wind component 'm s**-1' = { discipline = 0 ; From 7bf2f09ed6dccd6e400945b9ca885b98a30b7427 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 24 Apr 2024 18:17:02 +0100 Subject: [PATCH 070/196] Tools: Error checking --- tools/codes_export_resource.cc | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tools/codes_export_resource.cc b/tools/codes_export_resource.cc index 61a8b7db6..98ba7712d 100644 --- a/tools/codes_export_resource.cc +++ b/tools/codes_export_resource.cc @@ -24,6 +24,7 @@ static void usage(const char* prog) printf(" -d Extract a resource from the definitions directory\n"); printf("\n"); printf(" E.g., %s -s GRIB2.tmpl my.grib2\n", prog); + printf(" E.g., %s -d grib2/boot.def grib2_boot.txt\n", prog); exit(1); } @@ -57,7 +58,7 @@ int main(int argc, char* argv[]) resource_name = "definition"; } else { - fprintf(stderr, "Invalid option: Specify either -s or -d\n"); + fprintf(stderr, "Error: Invalid option: Specify either -s or -d\n"); return 1; } @@ -68,42 +69,49 @@ int main(int argc, char* argv[]) full_path = grib_context_full_defs_path(c, resource_path); } if (!full_path) { - fprintf(stderr, "Failed to access %s: '%s'\n", resource_name, resource_path); + fprintf(stderr, "Error: Failed to access %s file: '%s'\n", resource_name, resource_path); return 1; } fout = fopen(out_file, "wb"); if (!fout) { - fprintf(stderr, "Failed to open output file '%s'\n", out_file); + fprintf(stderr, "Error: Failed to open output file '%s'\n", out_file); perror(out_file); return 1; } fin = codes_fopen(full_path, "r"); if (!fin) { - fprintf(stderr, "Failed to open resource '%s'\n", full_path); + fprintf(stderr, "Error: Failed to open resource '%s'\n", full_path); fclose(fout); return 1; } + /* write resource bytes to fout */ + int read_count = 0; while (0 < (bytes = fread(buffer, 1, sizeof(buffer), fin))) { if (fwrite(buffer, 1, bytes, fout) != bytes) { - fprintf(stderr, "Failed to write out bytes\n"); + fprintf(stderr, "Error: Failed to write out bytes\n"); return 1; } + ++read_count; } if (fclose(fin) != 0) { - fprintf(stderr, "Call to fclose failed (input)\n"); + fprintf(stderr, "Error: Call to fclose failed (input)\n"); return 1; } if (fclose(fout) != 0) { - fprintf(stderr, "Call to fclose failed (output)\n"); + fprintf(stderr, "Error: Call to fclose failed (output)\n"); return 1; } grib_context_free(c, full_path); - printf("Resource exported to file '%s'.\n", out_file); + if (read_count == 0) { + fprintf(stderr, "Error: Number of bytes read == 0. Please check the path refers to a file.\n"); + } else { + printf("Resource exported to file '%s'.\n", out_file); + } return 0; } From dc484b82214e9cae646e8bd1339ab35c099c916c Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 24 Apr 2024 18:17:20 +0100 Subject: [PATCH 071/196] Testing: Invalid values for typeOfStatisticalProcessing --- tests/grib_check_param_concepts.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/grib_check_param_concepts.cc b/tests/grib_check_param_concepts.cc index d6720c4c3..99307fe85 100644 --- a/tests/grib_check_param_concepts.cc +++ b/tests/grib_check_param_concepts.cc @@ -52,6 +52,8 @@ static int scale_factor_missing(const char* value) return 0; } +#define STAT_PROC_MAX_VAL 103 // increase this with new Code Table 4.10 entries + /* * key = paramId or shortName * filename = paramId.def or shortName.def @@ -112,6 +114,14 @@ static int grib_check_param_concepts(const char* key, const char* filename) key, concept_value->name, filename); return GRIB_INVALID_KEY_VALUE; } + if (strcmp(condition_name, "typeOfStatisticalProcessing") == 0) { + long lValue = atol(condition_value); + if (lValue > STAT_PROC_MAX_VAL || lValue < 0) { + fprintf(stderr, "Bad value for %s in %s=%s in file %s\n", + condition_name, key, concept_value->name, filename); + return GRIB_INVALID_KEY_VALUE; + } + } if (strcmp(condition_name, "typeOfFirstFixedSurface") == 0) { type1Missing = type_of_surface_missing(condition_name, condition_value); } From 283b69596b217e6fd06d199a3c5bf15c8fa9f2e4 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 24 Apr 2024 17:17:54 +0000 Subject: [PATCH 072/196] ECC-1813: stepUnits (without step) change low_level_keys --- src/grib_accessor_class_g2end_step.cc | 21 ++++++++++- src/grib_accessor_class_optimal_step_units.cc | 36 +++++++++++++++++-- tests/grib_sub_hourly.sh | 9 +++++ 3 files changed, 62 insertions(+), 4 deletions(-) diff --git a/src/grib_accessor_class_g2end_step.cc b/src/grib_accessor_class_g2end_step.cc index a86733eb3..eed6b5d13 100644 --- a/src/grib_accessor_class_g2end_step.cc +++ b/src/grib_accessor_class_g2end_step.cc @@ -262,9 +262,13 @@ static int unpack_one_time_range_long_(grib_accessor* a, long* val, size_t* len) } if (add_time_range) { *val = start_step_value + time_range_value; + if ((err = grib_set_long_internal(h, "endStepUnit", step_units)) != GRIB_SUCCESS) + return err; } else { *val = start_step_value; + if ((err = grib_set_long_internal(h, "endStepUnit", step_units)) != GRIB_SUCCESS) + return err; } return GRIB_SUCCESS; @@ -310,9 +314,13 @@ static int unpack_one_time_range_double_(grib_accessor* a, double *val , size_t* } if (add_time_range) { *val = (start_step + time_range).value(eccodes::Unit(step_units)); + if ((err = grib_set_long_internal(h, "endStepUnit", step_units)) != GRIB_SUCCESS) + return err; } else { *val = start_step.value(eccodes::Unit(start_step_unit)); + if ((err = grib_set_long_internal(h, "endStepUnit", start_step_unit)) != GRIB_SUCCESS) + return err; } return GRIB_SUCCESS; @@ -441,14 +449,19 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) grib_handle* h = grib_handle_of_accessor(a); int ret = 0; long start_step_value; + long start_step_unit; long numberOfTimeRange; if ((ret = grib_get_long_internal(h, self->start_step_value, &start_step_value))) return ret; + if ((ret = grib_get_long_internal(h, "startStepUnit", &start_step_unit))) + return ret; /* point in time */ if (self->year == NULL) { *val = start_step_value; + if ((ret = grib_set_long_internal(h, "endStepUnit", start_step_unit))) + return ret; return 0; } @@ -479,14 +492,19 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) grib_handle* h = grib_handle_of_accessor(a); int ret = 0; long start_step_value; + long start_step_unit; long numberOfTimeRange; if ((ret = grib_get_long_internal(h, self->start_step_value, &start_step_value))) return ret; + if ((ret = grib_get_long_internal(h, "startStepUnit", &start_step_unit))) + return ret; /* point in time */ if (self->year == NULL) { *val = start_step_value; + if ((ret = grib_set_long_internal(h, "endStepUnit", start_step_unit))) + return ret; return 0; } @@ -542,7 +560,8 @@ static int pack_long_(grib_accessor* a, const long end_step_value, const long en /*point in time */ if (self->year == NULL) { - err = grib_set_long_internal(h, "startStepUnit", end_step.unit().value()); + if ((err = grib_set_long_internal(h, "startStepUnit", end_step.unit().value())) != GRIB_SUCCESS) + return err; err = grib_set_long_internal(h, self->start_step_value, end_step.value()); return err; } diff --git a/src/grib_accessor_class_optimal_step_units.cc b/src/grib_accessor_class_optimal_step_units.cc index 494667e9a..e56228764 100644 --- a/src/grib_accessor_class_optimal_step_units.cc +++ b/src/grib_accessor_class_optimal_step_units.cc @@ -178,6 +178,12 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) grib_handle* h = grib_handle_of_accessor(a); grib_accessor_optimal_step_units* self = (grib_accessor_optimal_step_units*)a; + long start_step; + long start_step_unit; + long end_step; + long end_step_unit; + int ret; + auto supported_units = eccodes::Unit::list_supported_units(); try { eccodes::Unit unit{*val}; // throws if not supported @@ -198,11 +204,35 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_INVALID_ARGUMENT; } - int ret; + self->overwriteStepUnits = *val; - if ((ret = grib_set_long_internal(h, "forceStepUnits", *val)) != GRIB_SUCCESS) { + if ((ret = grib_set_long_internal(h, "forceStepUnits", *val)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(h, "startStep", &start_step)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(h, "startStepUnit", &start_step_unit)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(h, "endStep", &end_step)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(h, "endStepUnit", &end_step_unit)) != GRIB_SUCCESS) + return ret; + + //printf("start_step: %ld, start_step_unit: %ld, end_step: %ld, end_step_unit: %ld\n", start_step, start_step_unit, end_step, end_step_unit); + + eccodes::Step start{start_step, start_step_unit}; + start = start.set_unit(*val); + eccodes::Step end{end_step, end_step_unit}; + end = end.set_unit(*val); + + if ((ret = grib_set_long_internal(h, "startStepUnit", start.unit().value())) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(h, "startStep", start.value())) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(h, "endStepUnit", end.unit().value())) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(h, "endStep", end.value())) != GRIB_SUCCESS) return ret; - } return GRIB_SUCCESS; } diff --git a/tests/grib_sub_hourly.sh b/tests/grib_sub_hourly.sh index 2f399da0f..18dab0fe1 100755 --- a/tests/grib_sub_hourly.sh +++ b/tests/grib_sub_hourly.sh @@ -62,6 +62,9 @@ fi instantaneous_field=$data_dir/reduced_gaussian_surface.grib2 accumulated_field=$data_dir/reduced_gaussian_sub_area.grib2 + + + # Check the lowercase alias 'stepunits' for a variety of step types (instant, accum etc) ${tools_dir}/grib_get -p stepunits $data_dir/tigge_cf_ecmwf.grib2 @@ -89,6 +92,12 @@ grib_check_key_equals $temp "-p $keys_step_range" "59m 59m 59 59 m" grib_check_key_equals $temp "-p $keys_start_step" "59m 59m 59 59 m" grib_check_key_equals $temp "-p $keys_end_step" "59m 59m 59 59 m" +${tools_dir}/grib_set -s stepUnits=m,step=60 $fn $temp +grib_check_key_equals $temp "-p $low_level_keys" "60 m" +${tools_dir}/grib_set -s stepUnits=s $temp $temp2 +grib_check_key_equals $temp2 "-p $low_level_keys" "3600 s" +${tools_dir}/grib_set -s stepUnits=h $temp $temp2 +grib_check_key_equals $temp2 "-p $low_level_keys" "1 h" #### stepUnits overrides the units in the low level keys # if stepUnits=UNIT is set, then set the low level keys to UNIT From 57bfc520df39e03a11fec32c490aa07617705202 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 24 Apr 2024 17:30:34 +0000 Subject: [PATCH 073/196] ECC-1813: Return error code instead of throwing an exception --- src/grib_accessor_class_optimal_step_units.cc | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/grib_accessor_class_optimal_step_units.cc b/src/grib_accessor_class_optimal_step_units.cc index e56228764..6c15ef430 100644 --- a/src/grib_accessor_class_optimal_step_units.cc +++ b/src/grib_accessor_class_optimal_step_units.cc @@ -204,7 +204,6 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_INVALID_ARGUMENT; } - self->overwriteStepUnits = *val; if ((ret = grib_set_long_internal(h, "forceStepUnits", *val)) != GRIB_SUCCESS) return ret; @@ -218,21 +217,26 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) if ((ret = grib_get_long_internal(h, "endStepUnit", &end_step_unit)) != GRIB_SUCCESS) return ret; - //printf("start_step: %ld, start_step_unit: %ld, end_step: %ld, end_step_unit: %ld\n", start_step, start_step_unit, end_step, end_step_unit); - - eccodes::Step start{start_step, start_step_unit}; - start = start.set_unit(*val); - eccodes::Step end{end_step, end_step_unit}; - end = end.set_unit(*val); + try { + eccodes::Step start{start_step, start_step_unit}; + start.set_unit(*val); + eccodes::Step end{end_step, end_step_unit}; + end.set_unit(*val); - if ((ret = grib_set_long_internal(h, "startStepUnit", start.unit().value())) != GRIB_SUCCESS) - return ret; - if ((ret = grib_set_long_internal(h, "startStep", start.value())) != GRIB_SUCCESS) - return ret; - if ((ret = grib_set_long_internal(h, "endStepUnit", end.unit().value())) != GRIB_SUCCESS) - return ret; - if ((ret = grib_set_long_internal(h, "endStep", end.value())) != GRIB_SUCCESS) - return ret; + if ((ret = grib_set_long_internal(h, "startStepUnit", start.unit().value())) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(h, "startStep", start.value())) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(h, "endStepUnit", end.unit().value())) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(h, "endStep", end.value())) != GRIB_SUCCESS) + return ret; + } + catch (std::exception& e) { + std::string msg = std::string{"Failed to convert steps to: "} + std::to_string(*val) + " (" + e.what() + ")"; + grib_context_log(a->context, GRIB_LOG_ERROR, "%s", msg.c_str()); + return GRIB_INTERNAL_ERROR; + } return GRIB_SUCCESS; } From cb4f057345a2bf1d43e58fb8ea1d779e51c34096 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 24 Apr 2024 17:34:33 +0000 Subject: [PATCH 074/196] ECC-1813: Test accumulated fields --- tests/grib_sub_hourly.sh | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/grib_sub_hourly.sh b/tests/grib_sub_hourly.sh index 18dab0fe1..5f33ad125 100755 --- a/tests/grib_sub_hourly.sh +++ b/tests/grib_sub_hourly.sh @@ -63,7 +63,23 @@ instantaneous_field=$data_dir/reduced_gaussian_surface.grib2 accumulated_field=$data_dir/reduced_gaussian_sub_area.grib2 +fn="$instantaneous_field" +low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s" +${tools_dir}/grib_set -s stepUnits=m,step=60 $fn $temp +grib_check_key_equals $temp "-p $low_level_keys" "60 m" +${tools_dir}/grib_set -s stepUnits=s $temp $temp2 +grib_check_key_equals $temp2 "-p $low_level_keys" "3600 s" +${tools_dir}/grib_set -s stepUnits=h $temp $temp2 +grib_check_key_equals $temp2 "-p $low_level_keys" "1 h" +fn="$accumulated_field" +low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" +${tools_dir}/grib_set -s stepUnits=m,stepRange=60-180 $fn $temp +grib_check_key_equals $temp "-p $low_level_keys" "60 m 120 m" +${tools_dir}/grib_set -s stepUnits=s $temp $temp2 +grib_check_key_equals $temp2 "-p $low_level_keys" "3600 s 7200 s" +${tools_dir}/grib_set -s stepUnits=h $temp $temp2 +grib_check_key_equals $temp2 "-p $low_level_keys" "1 h 2 h" # Check the lowercase alias 'stepunits' for a variety of step types (instant, accum etc) ${tools_dir}/grib_get -p stepunits $data_dir/tigge_cf_ecmwf.grib2 @@ -92,13 +108,6 @@ grib_check_key_equals $temp "-p $keys_step_range" "59m 59m 59 59 m" grib_check_key_equals $temp "-p $keys_start_step" "59m 59m 59 59 m" grib_check_key_equals $temp "-p $keys_end_step" "59m 59m 59 59 m" -${tools_dir}/grib_set -s stepUnits=m,step=60 $fn $temp -grib_check_key_equals $temp "-p $low_level_keys" "60 m" -${tools_dir}/grib_set -s stepUnits=s $temp $temp2 -grib_check_key_equals $temp2 "-p $low_level_keys" "3600 s" -${tools_dir}/grib_set -s stepUnits=h $temp $temp2 -grib_check_key_equals $temp2 "-p $low_level_keys" "1 h" - #### stepUnits overrides the units in the low level keys # if stepUnits=UNIT is set, then set the low level keys to UNIT # else optimise low level keys From 7e2ebecfe1a1c027fe1450aeb47d4832699ac238 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 24 Apr 2024 17:35:55 +0000 Subject: [PATCH 075/196] ECC-1813: Improve description --- tests/grib_sub_hourly.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/grib_sub_hourly.sh b/tests/grib_sub_hourly.sh index 5f33ad125..23c1fb9ca 100755 --- a/tests/grib_sub_hourly.sh +++ b/tests/grib_sub_hourly.sh @@ -63,6 +63,7 @@ instantaneous_field=$data_dir/reduced_gaussian_surface.grib2 accumulated_field=$data_dir/reduced_gaussian_sub_area.grib2 +# ECC-1813: Test that we can set the stepUnits without setting the step fn="$instantaneous_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s" ${tools_dir}/grib_set -s stepUnits=m,step=60 $fn $temp From 14648c67eb097b9de608dffd6e2d8306e46dbc63 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 25 Apr 2024 13:01:59 +0100 Subject: [PATCH 076/196] Print dataset when concept match fails --- src/accessor/grib_accessor_class_concept.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/accessor/grib_accessor_class_concept.cc b/src/accessor/grib_accessor_class_concept.cc index a5b9fba44..32e612546 100644 --- a/src/accessor/grib_accessor_class_concept.cc +++ b/src/accessor/grib_accessor_class_concept.cc @@ -270,6 +270,11 @@ int grib_concept_apply(grib_accessor* a, const char* name){ grib_get_string(h, "centre", centre_s, ¢re_len) == GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, "concept: input handle edition=%ld, centre=%s", editionNumber, centre_s); } + char dataset_s[80]; + size_t dataset_len = sizeof(dataset_s); + if (grib_get_string(h, "datasetForLocal", dataset_s, &dataset_len) == GRIB_SUCCESS && !STR_EQUAL(dataset_s, "unknown")) { + grib_context_log(h->context, GRIB_LOG_ERROR, "concept: input handle dataset=%s", dataset_s); + } if (strcmp(act->name, "paramId") == 0) { if (string_to_long(name, &dummy, 1) == GRIB_SUCCESS) { // The paramId value is an integer. Show them the param DB From f229bd590877e24839d038804ac0bbeab8a5bcf6 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 25 Apr 2024 13:11:05 +0100 Subject: [PATCH 077/196] Remove staticForceStepUnits --- src/accessor/grib_accessor_class_optimal_step_units.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/accessor/grib_accessor_class_optimal_step_units.cc b/src/accessor/grib_accessor_class_optimal_step_units.cc index c6d5006c5..8df1db80e 100644 --- a/src/accessor/grib_accessor_class_optimal_step_units.cc +++ b/src/accessor/grib_accessor_class_optimal_step_units.cc @@ -68,7 +68,6 @@ int grib_accessor_class_optimal_step_units_t::pack_expression(grib_accessor* a, } static long staticStepUnits = eccodes::Unit{eccodes::Unit::Value::MISSING}.value(); -static long staticForceStepUnits = eccodes::Unit{eccodes::Unit::Value::MISSING}.value(); int grib_accessor_class_optimal_step_units_t::pack_long(grib_accessor* a, const long* val, size_t* len){ grib_handle* h = grib_handle_of_accessor(a); From 5dd62ff5a52dba4fc0ee9f1515469310d9b24240 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 25 Apr 2024 13:13:45 +0100 Subject: [PATCH 078/196] Initialise return values --- src/accessor/grib_accessor_class_variable.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/accessor/grib_accessor_class_variable.cc b/src/accessor/grib_accessor_class_variable.cc index a9bd8741b..b87798663 100644 --- a/src/accessor/grib_accessor_class_variable.cc +++ b/src/accessor/grib_accessor_class_variable.cc @@ -32,9 +32,9 @@ void grib_accessor_class_variable_t::init(grib_accessor* a, const long length, g grib_expression* expression = grib_arguments_get_expression(hand, args, 0); const char* p = 0; size_t len = 1; - long l; + long l = 0; int ret = 0; - double d; + double d = 0; self->cname = NULL; a->length = 0; From 5490b247e842871b2eb9e3c93f6d27bb27857ce5 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 25 Apr 2024 15:28:08 +0100 Subject: [PATCH 079/196] Definitions: Cleanup --- .../ecmf/paramIdForConversion.def | 36 +++++++++---------- .../grib2/tables/local/ecmf/obstat.5.0.table | 14 ++++---- .../grib2/tables/local/ecmf/obstat.7.0.table | 2 +- .../grib2/tables/local/ecmf/obstat.8.0.table | 2 +- .../grib2/tables/local/ecmf/obstat.9.0.table | 15 ++++---- definitions/grib2/tables/local/era6/1.1.table | 4 +-- .../grib2/tables/local/kwbc/1/4.5.table | 22 ++++++------ 7 files changed, 47 insertions(+), 48 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def b/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def index f54df2259..07b7d5a83 100644 --- a/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def +++ b/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def @@ -1,37 +1,37 @@ # Concept paramIdForConversion for ECMWF -# ECC-1806 +# See ECC-1806 -# 55 -> 228004 +# 55 228004 = {gribTablesVersionNo=128; indicatorOfParameter=55; centre=98;} -# 56 -> 235168 +# 56 235168 = {gribTablesVersionNo=128; indicatorOfParameter=56; centre=98;} -# 130232 -> 235135 +# 130232 235135 = {gribTablesVersionNo=130; indicatorOfParameter=232; centre=98;} -# 151163 -> 262104 +# 151163 262104 = {gribTablesVersionNo=151; indicatorOfParameter=163; centre=98;} -# 151145 -> 262124 +# 151145 262124 = {gribTablesVersionNo=151; indicatorOfParameter=145; centre=98;} -# 172146 -> 235033 +# 172146 235033 = {gribTablesVersionNo=172; indicatorOfParameter=146; centre=98;} -# 172147 -> 235034 +# 172147 235034 = {gribTablesVersionNo=172; indicatorOfParameter=147; centre=98;} -# 172169 -> 235035 +# 172169 235035 = {gribTablesVersionNo=172; indicatorOfParameter=169; centre=98;} -# 172175 -> 235036 +# 172175 235036 = {gribTablesVersionNo=172; indicatorOfParameter=175; centre=98;} -# 172176 -> 235037 +# 172176 235037 = {gribTablesVersionNo=172; indicatorOfParameter=176; centre=98;} -# 172177 -> 235038 +# 172177 235038 = {gribTablesVersionNo=172; indicatorOfParameter=177; centre=98;} -# 172178 -> 235039 +# 172178 235039 = {gribTablesVersionNo=172; indicatorOfParameter=178; centre=98;} -# 172179 -> 235040 +# 172179 235040 = {gribTablesVersionNo=172; indicatorOfParameter=179; centre=98;} -# 174098 -> 262000 +# 174098 262000 = {gribTablesVersionNo=174; indicatorOfParameter=98; centre=98;} -# 151175 -> 262118 +# 151175 262118 = {gribTablesVersionNo=151; indicatorOfParameter=175; centre=98;} -# 151132 -> 262139 +# 151132 262139 = {gribTablesVersionNo=151; indicatorOfParameter=132; centre=98;} -# 151131 -> 262140 +# 151131 262140 = {gribTablesVersionNo=151; indicatorOfParameter=131; centre=98;} diff --git a/definitions/grib2/tables/local/ecmf/obstat.5.0.table b/definitions/grib2/tables/local/ecmf/obstat.5.0.table index 71a9a0e8c..ef4ea724d 100644 --- a/definitions/grib2/tables/local/ecmf/obstat.5.0.table +++ b/definitions/grib2/tables/local/ecmf/obstat.5.0.table @@ -1,13 +1,13 @@ #Code Table obstat.5.0: List of satellite instruments -0 HIRS HIRS +0 HIRS HIRS 1 MSU MSU 2 SSU SSU 3 AMSUA AMSUA 4 AMSUB AMSUB 6 SSM/I SSM/I 9 TMI TMI -10 SSMI/S SSMI/S -11 AIRS AIRS +10 SSMI/S SSMI/S +11 AIRS AIRS 15 MHS MHS 16 IASI IASI 17 AMSRE AMSR-E @@ -33,20 +33,20 @@ 516 TANSO TANSO 624 SBUV-2 SBUV-2 2000 AMV_WV_CLOUDY AMV WV cloudy -2001 AMV_IR AMV IR +2001 AMV_IR AMV IR 2002 AMV_VIS AMV VIS 2003 AMV_WVMIX AMV WVMIX 2005 AMV_WV_Clear AMV Water Vapor clear 2100 AMV_WV_6.2_cloudy AMV WV 6.2 cloudy -2101 AMV_IR_ch1 AMV IR ch1 +2101 AMV_IR_ch1 AMV IR ch1 2102 AMV_VIS_ch1 AMV VIS ch1 -2105 AMV_WV_6.2_clear AMV WV_6.2 clear +2105 AMV_WV_6.2_clear AMV WV_6.2 clear 2200 AMV_WV_7.3_cloudy AMV WV 7.3 cloudy 2201 AMV_IR_ch2 AMV IR ch2 2202 AMV_VIS-2 AMV VIS-2 2205 AMV_WV_7.3_clear AMV WV 7.3 clear 2300 AMV_WV_cloudy_ch3 AMV WV cloudy ch 3 -2301 AMV_IR-10 AMV IR-10 +2301 AMV_IR-10 AMV IR-10 2305 AMV_WV_clear_Ch3 AMV WV clear Ch3 2350 QUIKSCAT QUIKSCAT 2150 SCAT SCAT diff --git a/definitions/grib2/tables/local/ecmf/obstat.7.0.table b/definitions/grib2/tables/local/ecmf/obstat.7.0.table index fcd1c2e02..688485882 100644 --- a/definitions/grib2/tables/local/ecmf/obstat.7.0.table +++ b/definitions/grib2/tables/local/ecmf/obstat.7.0.table @@ -1,5 +1,5 @@ #Code Table obstat.7.0: Vertical coordinate types -1 1 Channel +1 1 Channel 2 2 Pressure level 3 3 Pressure layer 4 4 Surface diff --git a/definitions/grib2/tables/local/ecmf/obstat.8.0.table b/definitions/grib2/tables/local/ecmf/obstat.8.0.table index 382402473..0e167b7dd 100644 --- a/definitions/grib2/tables/local/ecmf/obstat.8.0.table +++ b/definitions/grib2/tables/local/ecmf/obstat.8.0.table @@ -2,5 +2,5 @@ 1 Land Land 2 Sea Sea 3 Sea-ice Sea-ice -4 All_surfaces All surface types combined +4 All_surfaces All surface types combined #5-255 Reserved diff --git a/definitions/grib2/tables/local/ecmf/obstat.9.0.table b/definitions/grib2/tables/local/ecmf/obstat.9.0.table index 8520066bd..38be1bfe3 100644 --- a/definitions/grib2/tables/local/ecmf/obstat.9.0.table +++ b/definitions/grib2/tables/local/ecmf/obstat.9.0.table @@ -1,14 +1,14 @@ -#Code Table obstat.9.0: Observation diagnostics -1 count data count +# Code Table obstat.9.0: Observation diagnostics +1 count data count 2 obs Average of observed values -3 obs_stdv Standard deviation of observed values -4 fgdep Average of first guess departure +3 obs_stdv Standard deviation of observed values +4 fgdep Average of first guess departure 5 fgdep_stdv Standard deviation of first guess departure 6 andep Average of analysis departure 7 andep_stdv Standard deviation of analysis departure 8 obs_error Average of observation standard error 9 obs_error_stdv Standard deviation of observation standard error -10 bkg_error Average of background standard error +10 bkg_error Average of background standard error 11 bkg_error_stdv Standard deviation of background standard error 12 lr_andep1 Average of low resolution analysis departure update 1 13 lr_andep1_stdv Standard deviation of low resolution analysis departure update 1 @@ -19,7 +19,7 @@ 18 bcor Average of Bias correction 19 bcor_stdv Standard deviation of bias correction 20 vbcor average of Variational bias correction -21 vbcor_stdv Standard deviation of variational bias correction +21 vbcor_stdv Standard deviation of variational bias correction 22 fgdep_nbcor Average of background departure without bias correction 23 fgdep_nbcor_stdv Standard deviation of background departure without bias correction 24 windspeed Average of wind speed @@ -45,8 +45,7 @@ 60 far_rate False alarm rate 62 miss_rate Miss rate 64 hit_rate hit rate -66 corr_nul correct nuls +66 corr_nul correct nuls 68 est_fg_err Estimated variance of the first guess error 70 edafgspr EDA first guess variance 72 edaanspr EDA Analysis variance -#36-255 Reserved diff --git a/definitions/grib2/tables/local/era6/1.1.table b/definitions/grib2/tables/local/era6/1.1.table index 720161860..a0c8af15c 100644 --- a/definitions/grib2/tables/local/era6/1.1.table +++ b/definitions/grib2/tables/local/era6/1.1.table @@ -1,6 +1,6 @@ # Code Table 1.1 GRIB Local Tables Version Number -0 0 Local tables not used -# . Only table entries and templates from the current Master table are valid. +0 0 Local tables not used +# Only table entries and templates from the current Master table are valid. # 1-254 Number of local tables version used 1 1 ERA6 local tables version 1 255 255 Missing diff --git a/definitions/grib2/tables/local/kwbc/1/4.5.table b/definitions/grib2/tables/local/kwbc/1/4.5.table index f1cfbfbe6..f89c21674 100644 --- a/definitions/grib2/tables/local/kwbc/1/4.5.table +++ b/definitions/grib2/tables/local/kwbc/1/4.5.table @@ -1,5 +1,5 @@ # Code table 4.5 - Fixed surface types and units -0 0 Reserved +0 0 Reserved 1 sfc Ground or water surface (-) 2 2 Cloud base level (-) 3 3 Level of cloud tops (-) @@ -16,15 +16,15 @@ 14 14 Level of free convection (LFC) 15 15 Convective condensation level (CCL) 16 16 Level of neutral buoyancy or equilibrium level (LNB) -# 17-19 Reserved +# 17-19 Reserved 20 20 Isothermal level (K) 21 21 Lowest level where mass density exceeds the specified value (base for a given threshold of mass density) (kg m-3) 22 22 Highest level where mass density exceeds the specified value (top for a given threshold of mass density) (kg m-3) 23 23 Lowest level where air concentration exceeds the specified value (base for a given threshold of air concentration) (Bq m-3) 24 24 Highest level where air concentration exceeds the specified value (top for a given threshold of air concentration) (Bq m-3) -# 25-99 Reserved +# 25-99 Reserved 100 pl Isobaric surface (Pa) -101 sfc Mean sea level +101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) 103 sfc Specified height level above ground (m) 104 104 Sigma level (sigma value) @@ -33,20 +33,20 @@ 107 pt Isentropic (theta) level (K) 108 108 Level at specified pressure difference from ground to level (Pa) 109 pv Potential vorticity surface (K m2 kg-1 s-1) -110 110 Reserved +110 110 Reserved 111 111 Eta level (-) -112 112 Reserved -113 113 Logarithmic hybrid level +112 112 Reserved +113 113 Logarithmic hybrid level 114 114 Snow level (Numeric) 115 115 Sigma height level # 116 Reserved 117 117 Mixed layer depth (m) 118 hhl Hybrid height level (-) 119 hpl Hybrid pressure level (-) -# 120-149 Reserved -150 150 Generalized vertical height coordinate +# 120-149 Reserved +150 150 Generalized vertical height coordinate 151 sol Soil level (Numeric) -# 152-159 Reserved +# 152-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 162 Lake or river bottom (-) @@ -55,7 +55,7 @@ 165 165 Bottom of sediment layer penetrated by thermal wave (-) 166 166 Mixing layer (-) 167 167 Bottom of root zone (-) -# 168-173 Reserved +# 168-173 Reserved 174 174 Top surface of ice on sea, lake or river 175 175 Top surface of ice, under snow cover, on sea, lake or river 176 176 Bottom surface (underside) ice on sea, lake or river From 88bdbd66a692a476ea01706755b9071397c3c67c Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 26 Apr 2024 11:55:08 +0100 Subject: [PATCH 080/196] Refactoring --- src/grib_accessor_class_g2grid.cc | 14 ++++++-------- src/grib_accessor_class_latitudes.cc | 28 ++++++++++++++-------------- src/grib_expression_class_binop.cc | 7 ++----- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/src/grib_accessor_class_g2grid.cc b/src/grib_accessor_class_g2grid.cc index 40aaca628..28d216b90 100644 --- a/src/grib_accessor_class_g2grid.cc +++ b/src/grib_accessor_class_g2grid.cc @@ -148,14 +148,13 @@ static int value_count(grib_accessor* a, long* count) static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_g2grid* self = (grib_accessor_g2grid*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int ret = GRIB_SUCCESS; long basic_angle = 0; long sub_division = 0; - int n = 0; + int n = 0; long v[6]; - int i; if (*len < 6) { ret = GRIB_ARRAY_TOO_SMALL; @@ -199,7 +198,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) if ((ret = grib_get_long_internal(hand, self->j_increment, &v[n++])) != GRIB_SUCCESS) return ret; } - for (i = 0; i < n; i++) + for (int i = 0; i < n; i++) if (v[i] == GRIB_MISSING_LONG) val[i] = GRIB_MISSING_DOUBLE; else @@ -282,15 +281,14 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_g2grid* self = (grib_accessor_g2grid*)a; grib_handle* hand = grib_handle_of_accessor(a); - int ret; + int ret = GRIB_SUCCESS; long v[6]; int n; long basic_angle; long sub_division; if (*len < 6) { - ret = GRIB_ARRAY_TOO_SMALL; - return ret; + return GRIB_ARRAY_TOO_SMALL; } /* printf("pack_double %g %g %g %g %g %g\n",val[0],val[1],val[2],val[3],val[4],val[5]);*/ diff --git a/src/grib_accessor_class_latitudes.cc b/src/grib_accessor_class_latitudes.cc index 555fb5b19..35c1a9049 100644 --- a/src/grib_accessor_class_latitudes.cc +++ b/src/grib_accessor_class_latitudes.cc @@ -114,16 +114,16 @@ static int get_distinct(grib_accessor* a, double** val, long* len); static int compare_doubles(const void* a, const void* b, int ascending) { - /* ascending is a boolean: 0 or 1 */ + // ascending is a boolean: 0 or 1 double* arg1 = (double*)a; double* arg2 = (double*)b; if (ascending) { if (*arg1 < *arg2) - return -1; /*Smaller values come before larger ones*/ + return -1; // Smaller values come before larger ones } else { if (*arg1 > *arg2) - return -1; /*Larger values come before smaller ones*/ + return -1; // Larger values come before smaller ones } if (*arg1 == *arg2) return 0; @@ -155,7 +155,7 @@ 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; + int ret = GRIB_SUCCESS; double* v = val; double dummyLon = 0; size_t size = 0; @@ -167,7 +167,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) if (ret) return ret; size = count; if (*len < size) { - /* self->lats are computed in value_count so must free */ + // self->lats are computed in value_count so must free if (self->lats) { grib_context_free(c, self->lats); self->lats = NULL; @@ -176,7 +176,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } self->save = 0; - /* self->lats are computed in value_count*/ + // self->lats are computed in value_count if (self->lats) { int i; *len = self->size; @@ -211,7 +211,7 @@ static int value_count(grib_accessor* a, long* len) grib_handle* h = grib_handle_of_accessor(a); grib_context* c = a->context; double* val = NULL; - int ret; + int ret = GRIB_SUCCESS; size_t size; *len = 0; @@ -251,9 +251,9 @@ static int get_distinct(grib_accessor* a, double** val, long* len) double* v = NULL; double* v1 = NULL; double dummyLon = 0; - int ret = 0; + int ret = GRIB_SUCCESS; int i; - long jScansPositively = 0; /* default: north to south */ + long jScansPositively = 0; // default: north to south size_t size = *len; grib_context* c = a->context; @@ -276,14 +276,14 @@ static int get_distinct(grib_accessor* a, double** val, long* len) grib_iterator_delete(iter); v = *val; - /* See which direction the latitudes are to be scanned */ + // See which direction the latitudes are to be scanned if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), "jScansPositively", &jScansPositively))) return ret; if (jScansPositively) { - qsort(v, *len, sizeof(double), &compare_doubles_ascending); /*South to North*/ + qsort(v, *len, sizeof(double), &compare_doubles_ascending); //South to North } else { - qsort(v, *len, sizeof(double), &compare_doubles_descending); /*North to South*/ + qsort(v, *len, sizeof(double), &compare_doubles_descending); //North to South } v1 = (double*)grib_context_malloc_clear(c, size * sizeof(double)); @@ -292,14 +292,14 @@ static int get_distinct(grib_accessor* a, double** val, long* len) return GRIB_OUT_OF_MEMORY; } - /* Construct a unique set of lats by filtering out duplicates */ + // Construct a unique set of lats by filtering out duplicates prev = v[0]; v1[0] = prev; count = 1; for (i = 1; i < *len; i++) { if (v[i] != prev) { prev = v[i]; - v1[count] = prev; /* Value different from previous so store it */ + v1[count] = prev; // Value different from previous so store it count++; } } diff --git a/src/grib_expression_class_binop.cc b/src/grib_expression_class_binop.cc index 328bb2ac4..5caefd701 100644 --- a/src/grib_expression_class_binop.cc +++ b/src/grib_expression_class_binop.cc @@ -83,7 +83,6 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { long v1 = 0; long v2 = 0; - int ret; grib_expression_binop* e = (grib_expression_binop*)g; // #if DEBUGGING @@ -100,7 +99,7 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) // printf("\n"); // } - ret = grib_expression_evaluate_long(h, e->left, &v1); + int ret = grib_expression_evaluate_long(h, e->left, &v1); if (ret != GRIB_SUCCESS) return ret; @@ -116,8 +115,6 @@ static int evaluate_double(grib_expression* g, grib_handle* h, double* dres) { double v1 = 0.0; double v2 = 0.0; - int ret; - grib_expression_binop* e = (grib_expression_binop*)g; // #if DEBUGGING @@ -134,7 +131,7 @@ static int evaluate_double(grib_expression* g, grib_handle* h, double* dres) // printf("\n"); // } - ret = grib_expression_evaluate_double(h, e->left, &v1); + int ret = grib_expression_evaluate_double(h, e->left, &v1); if (ret != GRIB_SUCCESS) return ret; From bf71d33dbc088644fe2c4d24a337139cc181bbdf Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 26 Apr 2024 13:30:50 +0100 Subject: [PATCH 081/196] ECC-1779: More deprecated templates --- definitions/grib2/template.4.30.def | 1 + definitions/grib2/template.4.47.def | 1 + definitions/grib2/template.4.56.def | 2 +- definitions/grib2/template.4.7.def | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/definitions/grib2/template.4.30.def b/definitions/grib2/template.4.30.def index eef3b680d..9416d4789 100644 --- a/definitions/grib2/template.4.30.def +++ b/definitions/grib2/template.4.30.def @@ -2,6 +2,7 @@ # TEMPLATE 4.30, Satellite Product # Note: This template is deprecated. Template 4.31 should be used instead. +transient template_is_deprecated = 1 : hidden; include "grib2/template.4.parameter.def" diff --git a/definitions/grib2/template.4.47.def b/definitions/grib2/template.4.47.def index 64c222032..892820635 100644 --- a/definitions/grib2/template.4.47.def +++ b/definitions/grib2/template.4.47.def @@ -2,6 +2,7 @@ # TEMPLATE 4.47, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval # Note: This template is deprecated. Template 4.85 should be used instead. +transient template_is_deprecated = 1 : hidden; include "grib2/template.4.parameter.def" include "grib2/template.4.aerosol.def" diff --git a/definitions/grib2/template.4.56.def b/definitions/grib2/template.4.56.def index 23735e972..9f48c957b 100644 --- a/definitions/grib2/template.4.56.def +++ b/definitions/grib2/template.4.56.def @@ -1,6 +1,6 @@ - # TEMPLATE 4.56, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters # Note: This template is deprecated. Template 4.59 should be used instead. +transient template_is_deprecated = 1 : hidden; include "grib2/template.4.parameter.def" include "grib2/template.4.tile.def" diff --git a/definitions/grib2/template.4.7.def b/definitions/grib2/template.4.7.def index fa6f007c8..7c79ced72 100644 --- a/definitions/grib2/template.4.7.def +++ b/definitions/grib2/template.4.7.def @@ -1,2 +1,4 @@ # Note: This template is deprecated. Template 4.0 should be used instead. +transient template_is_deprecated = 1 : hidden; + include "grib2/template.4.0.def" From 9fa22f73c76ee6912699b0b24bbdf668b0fafd38 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 26 Apr 2024 17:10:50 +0100 Subject: [PATCH 082/196] Testing: Exclude taf and metar (not fully supported) --- tests/definitions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/definitions.sh b/tests/definitions.sh index b841e2834..ecd5d5f4a 100755 --- a/tests/definitions.sh +++ b/tests/definitions.sh @@ -16,7 +16,7 @@ tempOut=temp.$label.txt [ -z "$ECCODES_DEFINITION_PATH" ] || ECCODES_DEFINITION_PATH=`${tools_dir}/codes_info -d` -for file in `find ${ECCODES_DEFINITION_PATH}/ -name '*.def' -print | grep -v grib3/` +for file in `find ${ECCODES_DEFINITION_PATH}/ -name '*.def' -print | grep -v grib3/ | grep -v metar/ | grep -v taf/` do ${tools_dir}/codes_parser $file > $REDIRECT done From 17e250b7d3b21532f7c66f5dfbfeae2855d6c2d1 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 27 Apr 2024 12:55:21 +0100 Subject: [PATCH 083/196] Cleanup --- ...rib_accessor_class_data_apply_boustrophedonic.cc | 11 ++++------- src/accessor/grib_accessor_class_longitudes.cc | 3 +-- src/accessor/grib_accessor_class_spd.cc | 13 +++++-------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc index 4222078fe..01783ad96 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc @@ -35,10 +35,9 @@ void grib_accessor_class_data_apply_boustrophedonic_t::dump(grib_accessor* a, gr int grib_accessor_class_data_apply_boustrophedonic_t::value_count(grib_accessor* a, long* numberOfPoints){ grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; - int ret = 0; *numberOfPoints = 0; - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints); + int ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints); return ret; } @@ -54,17 +53,16 @@ int grib_accessor_class_data_apply_boustrophedonic_t::unpack_float(grib_accessor int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ size_t size; double* values; - int err = 0; /* GRIB-564: The index idx relates to codedValues NOT values! */ - err = grib_get_size(a->parent->h, "codedValues", &size); + int err = grib_get_size(a->parent->h, "codedValues", &size); if (err) return err; if (idx > size) return GRIB_INVALID_NEAREST; values = (double*)grib_context_malloc_clear(a->parent->h->context, size * sizeof(double)); - err = grib_get_double_array(a->parent->h, "codedValues", values, &size); + err = grib_get_double_array(a->parent->h, "codedValues", values, &size); if (err) { grib_context_free(a->parent->h->context, values); return err; @@ -111,10 +109,9 @@ int grib_accessor_class_data_apply_boustrophedonic_t::pack_double(grib_accessor* double* pval = 0; size_t valuesSize = 0; long i, j; - int ret; long numberOfPoints, numberOfRows, numberOfColumns; - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints); + int ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints); if (ret) return ret; diff --git a/src/accessor/grib_accessor_class_longitudes.cc b/src/accessor/grib_accessor_class_longitudes.cc index 5b2f363b7..68b89dc23 100644 --- a/src/accessor/grib_accessor_class_longitudes.cc +++ b/src/accessor/grib_accessor_class_longitudes.cc @@ -123,7 +123,6 @@ static int get_distinct(grib_accessor* a, double** val, long* len){ double* v1 = NULL; double dummyLat = 0; int ret = 0; - int i; size_t size = *len; grib_context* c = a->context; @@ -157,7 +156,7 @@ static int get_distinct(grib_accessor* a, double** val, long* len){ prev = v[0]; v1[0] = prev; count = 1; - for (i = 1; i < *len; i++) { + for (long i = 1; i < *len; i++) { if (v[i] != prev) { prev = v[i]; v1[count] = prev; diff --git a/src/accessor/grib_accessor_class_spd.cc b/src/accessor/grib_accessor_class_spd.cc index 546007ef0..699ab6f9c 100644 --- a/src/accessor/grib_accessor_class_spd.cc +++ b/src/accessor/grib_accessor_class_spd.cc @@ -22,11 +22,10 @@ long grib_accessor_class_spd_t::byte_count(grib_accessor* a){ static long compute_byte_count(grib_accessor* a){ grib_accessor_spd_t* self = (grib_accessor_spd_t*)a; - long numberOfBits; - long numberOfElements; - int ret = 0; + long numberOfBits = 0; + long numberOfElements = 0; - ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + int ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); if (ret) { grib_context_log(a->context, GRIB_LOG_ERROR, "%s unable to get %s to compute size", a->name, self->numberOfBits); @@ -55,13 +54,11 @@ void grib_accessor_class_spd_t::init(grib_accessor* a, const long len, grib_argu int grib_accessor_class_spd_t::unpack_long(grib_accessor* a, long* val, size_t* len){ grib_accessor_spd_t* self = (grib_accessor_spd_t*)a; - int i; - int ret = 0; long pos = a->offset * 8; long rlen = 0; long numberOfBits = 0; - ret = value_count(a, &rlen); + int ret = value_count(a, &rlen); if (ret) return ret; @@ -80,7 +77,7 @@ int grib_accessor_class_spd_t::unpack_long(grib_accessor* a, long* val, size_t* return GRIB_DECODING_ERROR; } - for (i = 0; i < rlen - 1; i++) + for (long i = 0; i < rlen - 1; i++) val[i] = grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); val[rlen - 1] = grib_decode_signed_longb(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); From 82cb39cc55f8d64e86dce2fefc66012b5f95b933 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 27 Apr 2024 13:13:31 +0100 Subject: [PATCH 084/196] C++: Move function from header to local static --- ...cessor_class_data_apply_boustrophedonic.cc | 131 ++++++++++++++++-- ...ccessor_class_data_apply_boustrophedonic.h | 106 +------------- 2 files changed, 118 insertions(+), 119 deletions(-) diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc index 01783ad96..a4b020276 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc @@ -12,15 +12,16 @@ #include "grib_api_internal.h" #include "grib_accessor_class_data_apply_boustrophedonic.h" -grib_accessor_class_data_apply_boustrophedonic_t _grib_accessor_class_data_apply_boustrophedonic{"data_apply_boustrophedonic"}; +grib_accessor_class_data_apply_boustrophedonic_t _grib_accessor_class_data_apply_boustrophedonic{ "data_apply_boustrophedonic" }; grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic = &_grib_accessor_class_data_apply_boustrophedonic; -void grib_accessor_class_data_apply_boustrophedonic_t::init(grib_accessor* a, const long v, grib_arguments* args){ +void grib_accessor_class_data_apply_boustrophedonic_t::init(grib_accessor* a, const long v, grib_arguments* args) +{ grib_accessor_class_gen_t::init(a, v, args); - int n = 0; grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; + int n = 0; self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); self->numberOfRows = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); self->numberOfColumns = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); @@ -29,28 +30,127 @@ void grib_accessor_class_data_apply_boustrophedonic_t::init(grib_accessor* a, co a->length = 0; } -void grib_accessor_class_data_apply_boustrophedonic_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_data_apply_boustrophedonic_t::dump(grib_accessor* a, grib_dumper* dumper) +{ grib_dump_values(dumper, a); } -int grib_accessor_class_data_apply_boustrophedonic_t::value_count(grib_accessor* a, long* numberOfPoints){ +int grib_accessor_class_data_apply_boustrophedonic_t::value_count(grib_accessor* a, long* numberOfPoints) +{ grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; *numberOfPoints = 0; - int ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints); + return grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints); +} + +template +static int unpack(grib_accessor* a, T* val, size_t* len) +{ + grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; + + size_t plSize = 0; + long* pl = 0; + double* values = 0; + double* pvalues = 0; + T* pval = 0; + size_t valuesSize = 0; + long i, j; + int ret; + long numberOfPoints, numberOfRows, numberOfColumns; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints); + if (ret) + return ret; + + if (*len < numberOfPoints) { + *len = numberOfPoints; + return GRIB_ARRAY_TOO_SMALL; + } + + ret = grib_get_size(grib_handle_of_accessor(a), self->values, &valuesSize); + if (ret) + return ret; + + /* constant field */ + if (valuesSize == 0) + return 0; + + if (valuesSize != numberOfPoints) { + grib_context_log(a->context, GRIB_LOG_ERROR, "boustrophedonic ordering error: ( %s=%ld ) != (sizeOf(%s)=%ld)", + self->numberOfPoints, numberOfPoints, self->values, (long)valuesSize); + return GRIB_DECODING_ERROR; + } + + values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * numberOfPoints); + ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->values, values, &valuesSize); + if (ret) + return ret; + + pvalues = values; + pval = val; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfRows, &numberOfRows); + if (ret) + return ret; - return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfColumns, &numberOfColumns); + if (ret) + return ret; + + if (grib_get_size(grib_handle_of_accessor(a), self->pl, &plSize) == GRIB_SUCCESS) { + Assert(plSize == numberOfRows); + pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); + ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->pl, pl, &plSize); + if (ret) + return ret; + + for (j = 0; j < numberOfRows; j++) { + if (j % 2) { + pval += pl[j]; + for (i = 0; i < pl[j]; i++) + *(pval--) = *(pvalues++); + pval += pl[j]; + } + else { + for (i = 0; i < pl[j]; i++) + *(pval++) = *(pvalues++); + } + } + + grib_context_free(a->context, pl); + } + else { + for (j = 0; j < numberOfRows; j++) { + if (j % 2) { + pval += numberOfColumns - 1; + for (i = 0; i < numberOfColumns; i++) + *(pval--) = *(pvalues++); + pval += numberOfColumns + 1; + } + else { + for (i = 0; i < numberOfColumns; i++) + *(pval++) = *(pvalues++); + } + } + } + + grib_context_free(a->context, values); + + return GRIB_SUCCESS; } -int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_data_apply_boustrophedonic_t::unpack_float(grib_accessor* a, float* val, size_t* len){ +int grib_accessor_class_data_apply_boustrophedonic_t::unpack_float(grib_accessor* a, float* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ +int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double_element(grib_accessor* a, size_t idx, double* val) +{ size_t size; double* values; @@ -62,7 +162,7 @@ int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double_element(grib return GRIB_INVALID_NEAREST; values = (double*)grib_context_malloc_clear(a->parent->h->context, size * sizeof(double)); - err = grib_get_double_array(a->parent->h, "codedValues", values, &size); + err = grib_get_double_array(a->parent->h, "codedValues", values, &size); if (err) { grib_context_free(a->parent->h->context, values); return err; @@ -72,7 +172,8 @@ int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double_element(grib return GRIB_SUCCESS; } -int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ +int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) +{ size_t size = 0, i = 0; double* values; int err = 0; @@ -99,7 +200,8 @@ int grib_accessor_class_data_apply_boustrophedonic_t::unpack_double_element_set( return GRIB_SUCCESS; } -int grib_accessor_class_data_apply_boustrophedonic_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_data_apply_boustrophedonic_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; size_t plSize = 0; @@ -181,6 +283,7 @@ int grib_accessor_class_data_apply_boustrophedonic_t::pack_double(grib_accessor* return GRIB_SUCCESS; } -int grib_accessor_class_data_apply_boustrophedonic_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_data_apply_boustrophedonic_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_DOUBLE; } diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h index 9810efe25..9b101e7ed 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_apply_boustrophedonic_h -#define eccodes_accessor_data_apply_boustrophedonic_h +#pragma once -#include "../grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_data_apply_boustrophedonic_t : public grib_accessor_gen_t @@ -40,106 +38,4 @@ class grib_accessor_class_data_apply_boustrophedonic_t : public grib_accessor_cl void init(grib_accessor*, const long, grib_arguments*) override; int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; - -private: - template int unpack(grib_accessor*, T*, size_t*); }; - - -template -int grib_accessor_class_data_apply_boustrophedonic_t::unpack(grib_accessor* a, T* val, size_t* len){ - grib_accessor_data_apply_boustrophedonic_t* self = (grib_accessor_data_apply_boustrophedonic_t*)a; - - size_t plSize = 0; - long* pl = 0; - double* values = 0; - double* pvalues = 0; - T* pval = 0; - size_t valuesSize = 0; - long i, j; - int ret; - long numberOfPoints, numberOfRows, numberOfColumns; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints); - if (ret) - return ret; - - if (*len < numberOfPoints) { - *len = numberOfPoints; - return GRIB_ARRAY_TOO_SMALL; - } - - ret = grib_get_size(grib_handle_of_accessor(a), self->values, &valuesSize); - if (ret) - return ret; - - /* constant field */ - if (valuesSize == 0) - return 0; - - if (valuesSize != numberOfPoints) { - grib_context_log(a->context, GRIB_LOG_ERROR, "boustrophedonic ordering error: ( %s=%ld ) != (sizeOf(%s)=%ld)", - self->numberOfPoints, numberOfPoints, self->values, (long)valuesSize); - return GRIB_DECODING_ERROR; - } - - values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * numberOfPoints); - ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->values, values, &valuesSize); - if (ret) - return ret; - - pvalues = values; - pval = val; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfRows, &numberOfRows); - if (ret) - return ret; - - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfColumns, &numberOfColumns); - if (ret) - return ret; - - if (grib_get_size(grib_handle_of_accessor(a), self->pl, &plSize) == GRIB_SUCCESS) { - Assert(plSize == numberOfRows); - pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); - ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->pl, pl, &plSize); - if (ret) - return ret; - - for (j = 0; j < numberOfRows; j++) { - if (j % 2) { - pval += pl[j]; - for (i = 0; i < pl[j]; i++) - *(pval--) = *(pvalues++); - pval += pl[j]; - } - else { - for (i = 0; i < pl[j]; i++) - *(pval++) = *(pvalues++); - } - } - - grib_context_free(a->context, pl); - } - else { - for (j = 0; j < numberOfRows; j++) { - if (j % 2) { - pval += numberOfColumns - 1; - for (i = 0; i < numberOfColumns; i++) - *(pval--) = *(pvalues++); - pval += numberOfColumns + 1; - } - else { - for (i = 0; i < numberOfColumns; i++) - *(pval++) = *(pvalues++); - } - } - } - - grib_context_free(a->context, values); - - return GRIB_SUCCESS; -} - - -#endif /* eccodes_accessor_data_apply_boustrophedonic_h */ From aca85e100e451b7f3198e8e00707d8d92db15f5b Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 27 Apr 2024 13:32:14 +0100 Subject: [PATCH 085/196] C++: Move function from header to local static. Use pragma once --- ...ass_data_g1second_order_general_packing.cc | 135 +++++- ...lass_data_g1second_order_general_packing.h | 112 +---- ..._data_g1second_order_row_by_row_packing.cc | 195 ++++++++- ...s_data_g1second_order_row_by_row_packing.h | 175 +------- ...ib_accessor_class_data_g22order_packing.cc | 387 +++++++++++++++--- ...rib_accessor_class_data_g22order_packing.h | 258 +----------- 6 files changed, 639 insertions(+), 623 deletions(-) diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc index 07ecb170a..8fb0165d0 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.cc @@ -11,14 +11,15 @@ #include "grib_accessor_class_data_g1second_order_general_packing.h" -grib_accessor_class_data_g1second_order_general_packing_t _grib_accessor_class_data_g1second_order_general_packing{"data_g1second_order_general_packing"}; +grib_accessor_class_data_g1second_order_general_packing_t _grib_accessor_class_data_g1second_order_general_packing{ "data_g1second_order_general_packing" }; grib_accessor_class* grib_accessor_class_data_g1second_order_general_packing = &_grib_accessor_class_data_g1second_order_general_packing; -void grib_accessor_class_data_g1second_order_general_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ +void grib_accessor_class_data_g1second_order_general_packing_t::init(grib_accessor* a, const long v, grib_arguments* args) +{ grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_g1second_order_general_packing_t* self = (grib_accessor_data_g1second_order_general_packing_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); + grib_handle* hand = grib_handle_of_accessor(a); self->half_byte = grib_arguments_get_name(hand, args, self->carg++); self->packingType = grib_arguments_get_name(hand, args, self->carg++); @@ -40,32 +41,138 @@ void grib_accessor_class_data_g1second_order_general_packing_t::init(grib_access a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -int grib_accessor_class_data_g1second_order_general_packing_t::value_count(grib_accessor* a, long* numberOfSecondOrderPackedValues){ - int err = 0; +int grib_accessor_class_data_g1second_order_general_packing_t::value_count(grib_accessor* a, long* numberOfSecondOrderPackedValues) +{ grib_accessor_data_g1second_order_general_packing_t* self = (grib_accessor_data_g1second_order_general_packing_t*)a; - *numberOfSecondOrderPackedValues = 0; + *numberOfSecondOrderPackedValues = 0; - err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, numberOfSecondOrderPackedValues); + int err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, numberOfSecondOrderPackedValues); return err; } -int grib_accessor_class_data_g1second_order_general_packing_t::unpack_float(grib_accessor* a, float* values, size_t* len){ - return unpack(a, values, len); +template +static int unpack_real(grib_accessor* a, T* values, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + grib_accessor_data_g1second_order_general_packing_t* self = (grib_accessor_data_g1second_order_general_packing_t*)a; + int ret = 0; + long numberOfGroups, numberOfSecondOrderPackedValues; + long* groupWidths = 0; + long* firstOrderValues = 0; + long* X = 0; + long pos = 0; + long widthOfFirstOrderValues = 0; + unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; + long i, n; + double reference_value; + long binary_scale_factor; + long decimal_scale_factor; + double s, d; + long* secondaryBitmap; + long groupLength, j; + size_t groupWidthsSize; + + buf += a->byte_offset(); + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->widthOfFirstOrderValues, &widthOfFirstOrderValues)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, + &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) + return ret; + + if (*len < (size_t)numberOfSecondOrderPackedValues) + return GRIB_ARRAY_TOO_SMALL; + + groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + groupWidthsSize = numberOfGroups; + if ((ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->groupWidths, groupWidths, &groupWidthsSize)) != GRIB_SUCCESS) + return ret; + + secondaryBitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * (numberOfSecondOrderPackedValues + 1)); + secondaryBitmap[numberOfSecondOrderPackedValues] = 1; + grib_decode_long_array(buf, &pos, 1, numberOfSecondOrderPackedValues, secondaryBitmap); + pos = 8 * ((pos + 7) / 8); + + firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); + pos = 8 * ((pos + 7) / 8); + + X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfSecondOrderPackedValues); + + n = 0; + i = -1; + groupLength = 0; + while (n < numberOfSecondOrderPackedValues) { + if (secondaryBitmap[n]) { + long* p = secondaryBitmap + n + 1; + groupLength = 1; + while (*p != 1) { + groupLength++; + p++; + } + i++; + } + if (groupWidths[i] > 0) { + for (j = 0; j < groupLength; j++) { + X[n] = grib_decode_unsigned_long(buf, &pos, groupWidths[i]); + X[n] = firstOrderValues[i] + X[n]; + n++; + } + } + else { + for (j = 0; j < groupLength; j++) { + X[n] = firstOrderValues[i]; + n++; + } + } + } + + s = codes_power(binary_scale_factor, 2); + d = codes_power(-decimal_scale_factor, 10); + for (i = 0; i < numberOfSecondOrderPackedValues; i++) { + values[i] = (T)(((X[i] * s) + reference_value) * d); + } + + *len = numberOfSecondOrderPackedValues; + grib_context_free(a->context, secondaryBitmap); + grib_context_free(a->context, firstOrderValues); + grib_context_free(a->context, X); + grib_context_free(a->context, groupWidths); + + return ret; +} + +int grib_accessor_class_data_g1second_order_general_packing_t::unpack_float(grib_accessor* a, float* values, size_t* len) +{ + return unpack_real(a, values, len); } -int grib_accessor_class_data_g1second_order_general_packing_t::unpack_double(grib_accessor* a, double* values, size_t* len){ - return unpack(a, values, len); +int grib_accessor_class_data_g1second_order_general_packing_t::unpack_double(grib_accessor* a, double* values, size_t* len) +{ + return unpack_real(a, values, len); } -int grib_accessor_class_data_g1second_order_general_packing_t::pack_double(grib_accessor* a, const double* cval, size_t* len){ +int grib_accessor_class_data_g1second_order_general_packing_t::pack_double(grib_accessor* a, const double* cval, size_t* len) +{ /* return GRIB_NOT_IMPLEMENTED; */ - int err = 0; char type[] = "grid_second_order"; size_t size = strlen(type); grib_handle* hand = grib_handle_of_accessor(a); - err = grib_set_string(hand, "packingType", type, &size); + int err = grib_set_string(hand, "packingType", type, &size); if (err) return err; diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h index 837e10097..2e8bb3620 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g1second_order_general_packing_h -#define eccodes_accessor_data_g1second_order_general_packing_h +#pragma once #include "grib_accessor_class_data_simple_packing.h" #include "grib_scaling.h" @@ -47,113 +46,4 @@ class grib_accessor_class_data_g1second_order_general_packing_t : public grib_ac int unpack_float(grib_accessor*, float* val, size_t* len) override; int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; - -private: - template int unpack(grib_accessor*, T*, size_t*); }; - - -template -int grib_accessor_class_data_g1second_order_general_packing_t::unpack(grib_accessor* a, T* values, size_t* len){ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - grib_accessor_data_g1second_order_general_packing_t* self = (grib_accessor_data_g1second_order_general_packing_t*)a; - int ret = 0; - long numberOfGroups, numberOfSecondOrderPackedValues; - long* groupWidths = 0; - long* firstOrderValues = 0; - long* X = 0; - long pos = 0; - long widthOfFirstOrderValues = 0; - unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - long i, n; - double reference_value; - long binary_scale_factor; - long decimal_scale_factor; - double s, d; - long* secondaryBitmap; - long groupLength, j; - size_t groupWidthsSize; - - buf += a->byte_offset(); - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->widthOfFirstOrderValues, &widthOfFirstOrderValues)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, - &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) - return ret; - - if (*len < (size_t)numberOfSecondOrderPackedValues) - return GRIB_ARRAY_TOO_SMALL; - - groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); - groupWidthsSize = numberOfGroups; - if ((ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->groupWidths, groupWidths, &groupWidthsSize)) != GRIB_SUCCESS) - return ret; - - secondaryBitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * (numberOfSecondOrderPackedValues + 1)); - secondaryBitmap[numberOfSecondOrderPackedValues] = 1; - grib_decode_long_array(buf, &pos, 1, numberOfSecondOrderPackedValues, secondaryBitmap); - pos = 8 * ((pos + 7) / 8); - - firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); - grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); - pos = 8 * ((pos + 7) / 8); - - X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfSecondOrderPackedValues); - - n = 0; - i = -1; - groupLength = 0; - while (n < numberOfSecondOrderPackedValues) { - if (secondaryBitmap[n]) { - long* p = secondaryBitmap + n + 1; - groupLength = 1; - while (*p != 1) { - groupLength++; - p++; - } - i++; - } - if (groupWidths[i] > 0) { - for (j = 0; j < groupLength; j++) { - X[n] = grib_decode_unsigned_long(buf, &pos, groupWidths[i]); - X[n] = firstOrderValues[i] + X[n]; - n++; - } - } - else { - for (j = 0; j < groupLength; j++) { - X[n] = firstOrderValues[i]; - n++; - } - } - } - - s = codes_power(binary_scale_factor, 2); - d = codes_power(-decimal_scale_factor, 10); - for (i = 0; i < numberOfSecondOrderPackedValues; i++) { - values[i] = (T)(((X[i] * s) + reference_value) * d); - } - - *len = numberOfSecondOrderPackedValues; - grib_context_free(a->context, secondaryBitmap); - grib_context_free(a->context, firstOrderValues); - grib_context_free(a->context, X); - grib_context_free(a->context, groupWidths); - - return ret; -} - -#endif /* eccodes_accessor_data_g1second_order_general_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc index f49a52586..afed13ca2 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.cc @@ -11,14 +11,15 @@ #include "grib_accessor_class_data_g1second_order_row_by_row_packing.h" -grib_accessor_class_data_g1second_order_row_by_row_packing_t _grib_accessor_class_data_g1second_order_row_by_row_packing{"data_g1second_order_row_by_row_packing"}; +grib_accessor_class_data_g1second_order_row_by_row_packing_t _grib_accessor_class_data_g1second_order_row_by_row_packing{ "data_g1second_order_row_by_row_packing" }; grib_accessor_class* grib_accessor_class_data_g1second_order_row_by_row_packing = &_grib_accessor_class_data_g1second_order_row_by_row_packing; -void grib_accessor_class_data_g1second_order_row_by_row_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ +void grib_accessor_class_data_g1second_order_row_by_row_packing_t::init(grib_accessor* a, const long v, grib_arguments* args) +{ grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_g1second_order_row_by_row_packing_t* self = (grib_accessor_data_g1second_order_row_by_row_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); + grib_handle* gh = grib_handle_of_accessor(a); self->half_byte = grib_arguments_get_name(gh, args, self->carg++); self->packingType = grib_arguments_get_name(gh, args, self->carg++); @@ -40,11 +41,13 @@ void grib_accessor_class_data_g1second_order_row_by_row_packing_t::init(grib_acc a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -int grib_accessor_class_data_g1second_order_row_by_row_packing_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_data_g1second_order_row_by_row_packing_t::value_count(grib_accessor* a, long* count) +{ grib_accessor_data_g1second_order_row_by_row_packing_t* self = (grib_accessor_data_g1second_order_row_by_row_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); + + grib_handle* gh = grib_handle_of_accessor(a); long n = 0, i = 0; - long numberOfRows = 0; + long numberOfRows = 0; long jPointsAreConsecutive = 0; long Ni = 0, Nj = 0; int bitmapPresent = 0; @@ -114,16 +117,186 @@ int grib_accessor_class_data_g1second_order_row_by_row_packing_t::value_count(gr return ret; } +template +static int unpack_real(grib_accessor* a, T* values, size_t* len) +{ + grib_accessor_data_g1second_order_row_by_row_packing_t* self = (grib_accessor_data_g1second_order_row_by_row_packing_t*)a; + + grib_handle* gh = grib_handle_of_accessor(a); + int ret = 0; + long numberOfGroups, numberOfSecondOrderPackedValues; + long* groupWidths = 0; + long* firstOrderValues = 0; + long* X = 0; + long numberOfRows, numberOfColumns; + long* numbersPerRow; + long pos = 0; + long widthOfFirstOrderValues = 0; + long jPointsAreConsecutive; + unsigned char* buf = (unsigned char*)gh->buffer->data; + long k, i, j, n, Ni, Nj; + double reference_value; + long binary_scale_factor; + long decimal_scale_factor; + double s, d; + size_t groupWidthsSize = 0; + int bitmapPresent = 0; + size_t plSize = 0; + long* pl = 0; + + buf += a->byte_offset(); + if ((ret = grib_get_long_internal(gh, self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(gh, self->jPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) + return ret; + + if (self->bitmap) + bitmapPresent = 1; + ret = grib_get_size(gh, self->pl, &plSize); + if (ret == GRIB_SUCCESS) { + pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); + if ((ret = grib_get_long_array(gh, self->pl, pl, &plSize)) != GRIB_SUCCESS) + return ret; + } + + if ((ret = grib_get_long_internal(gh, self->Ni, &Ni)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->Nj, &Nj)) != GRIB_SUCCESS) + return ret; + if (jPointsAreConsecutive) { + numberOfRows = Ni; + numberOfColumns = Nj; + } + else { + numberOfRows = Nj; + numberOfColumns = Ni; + } + + numbersPerRow = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfRows); + if (!numbersPerRow) + return GRIB_OUT_OF_MEMORY; + if (bitmapPresent) { + long *bitmap, *pbitmap; + size_t numberOfPoints = Ni * Nj; + + if (plSize && pl) { + numberOfPoints = 0; + for (i = 0; i < numberOfRows; i++) + numberOfPoints += pl[i]; + } + bitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfPoints); + pbitmap = bitmap; + grib_get_long_array(gh, self->bitmap, bitmap, &numberOfPoints); + if (plSize && pl) { + for (i = 0; i < numberOfRows; i++) { + for (j = 0; j < pl[i]; j++) { + numbersPerRow[i] += *(bitmap++); + } + } + } + else { + for (i = 0; i < numberOfRows; i++) { + numbersPerRow[i] = 0; + for (j = 0; j < Ni; j++) { + numbersPerRow[i] += *(bitmap++); + } + } + } + + grib_context_free(a->context, pbitmap); + } + else { + if (plSize && pl) { + for (i = 0; i < numberOfRows; i++) + numbersPerRow[i] = pl[i]; + } + else { + for (i = 0; i < numberOfRows; i++) + numbersPerRow[i] = numberOfColumns; + } + } + + if ((ret = grib_get_long_internal(gh, self->widthOfFirstOrderValues, &widthOfFirstOrderValues)) != 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_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(gh, self->numberOfSecondOrderPackedValues, + &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) + return ret; + + groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + groupWidthsSize = numberOfGroups; + if ((ret = grib_get_long_array_internal(gh, self->groupWidths, groupWidths, &groupWidthsSize)) != GRIB_SUCCESS) + return ret; + + firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); + pos = 8 * ((pos + 7) / 8); + + n = 0; + for (i = 0; i < numberOfGroups; i++) + n += numbersPerRow[i]; + + if (*len < (size_t)n) + return GRIB_ARRAY_TOO_SMALL; + + X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * n); + n = 0; + k = 0; + for (i = 0; i < numberOfGroups; i++) { + if (groupWidths[i] > 0) { + for (j = 0; j < numbersPerRow[k]; j++) { + X[n] = grib_decode_unsigned_long(buf, &pos, groupWidths[i]); + X[n] += firstOrderValues[i]; + n++; + } + } + else { + for (j = 0; j < numbersPerRow[k]; j++) { + X[n] = firstOrderValues[i]; + n++; + } + } + k++; + } + + s = codes_power(binary_scale_factor, 2); + d = codes_power(-decimal_scale_factor, 10); + for (i = 0; i < n; i++) { + values[i] = (T)(((X[i] * s) + reference_value) * d); + } + grib_context_free(a->context, firstOrderValues); + grib_context_free(a->context, X); + grib_context_free(a->context, groupWidths); + if (plSize) + grib_context_free(a->context, pl); + if (numbersPerRow) + grib_context_free(a->context, numbersPerRow); + + return ret; +} -int grib_accessor_class_data_g1second_order_row_by_row_packing_t::unpack_float(grib_accessor* a, float* values, size_t* len){ - return unpack(a, values, len); +int grib_accessor_class_data_g1second_order_row_by_row_packing_t::unpack_float(grib_accessor* a, float* values, size_t* len) +{ + return unpack_real(a, values, len); } -int grib_accessor_class_data_g1second_order_row_by_row_packing_t::unpack_double(grib_accessor* a, double* values, size_t* len){ - return unpack(a, values, len); +int grib_accessor_class_data_g1second_order_row_by_row_packing_t::unpack_double(grib_accessor* a, double* values, size_t* len) +{ + return unpack_real(a, values, len); } -int grib_accessor_class_data_g1second_order_row_by_row_packing_t::pack_double(grib_accessor* a, const double* cval, size_t* len){ +int grib_accessor_class_data_g1second_order_row_by_row_packing_t::pack_double(grib_accessor* a, const double* cval, size_t* len) +{ int err = 0; grib_handle* gh = grib_handle_of_accessor(a); char type[] = "grid_second_order"; diff --git a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h index d2db87fe9..9b274a408 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g1second_order_row_by_row_packing_h -#define eccodes_accessor_data_g1second_order_row_by_row_packing_h +#pragma once #include "grib_accessor_class_data_simple_packing.h" #include "grib_scaling.h" @@ -47,176 +46,4 @@ class grib_accessor_class_data_g1second_order_row_by_row_packing_t : public grib int unpack_float(grib_accessor*, float* val, size_t* len) override; int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; - -private: - template int unpack(grib_accessor*, T*, size_t*); }; - - -template -int grib_accessor_class_data_g1second_order_row_by_row_packing_t::unpack(grib_accessor* a, T* values, size_t* len){ - grib_accessor_data_g1second_order_row_by_row_packing_t* self = (grib_accessor_data_g1second_order_row_by_row_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); - int ret = 0; - long numberOfGroups, numberOfSecondOrderPackedValues; - long* groupWidths = 0; - long* firstOrderValues = 0; - long* X = 0; - long numberOfRows, numberOfColumns; - long* numbersPerRow; - long pos = 0; - long widthOfFirstOrderValues = 0; - long jPointsAreConsecutive; - unsigned char* buf = (unsigned char*)gh->buffer->data; - long k, i, j, n, Ni, Nj; - double reference_value; - long binary_scale_factor; - long decimal_scale_factor; - double s, d; - size_t groupWidthsSize = 0; - int bitmapPresent = 0; - size_t plSize = 0; - long* pl = 0; - - buf += a->byte_offset(); - if ((ret = grib_get_long_internal(gh, self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(gh, self->jPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) - return ret; - - if (self->bitmap) - bitmapPresent = 1; - ret = grib_get_size(gh, self->pl, &plSize); - if (ret == GRIB_SUCCESS) { - pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); - if ((ret = grib_get_long_array(gh, self->pl, pl, &plSize)) != GRIB_SUCCESS) - return ret; - } - - if ((ret = grib_get_long_internal(gh, self->Ni, &Ni)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->Nj, &Nj)) != GRIB_SUCCESS) - return ret; - if (jPointsAreConsecutive) { - numberOfRows = Ni; - numberOfColumns = Nj; - } - else { - numberOfRows = Nj; - numberOfColumns = Ni; - } - - numbersPerRow = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfRows); - if (!numbersPerRow) - return GRIB_OUT_OF_MEMORY; - if (bitmapPresent) { - long *bitmap, *pbitmap; - size_t numberOfPoints = Ni * Nj; - - if (plSize && pl) { - numberOfPoints = 0; - for (i = 0; i < numberOfRows; i++) - numberOfPoints += pl[i]; - } - bitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfPoints); - pbitmap = bitmap; - grib_get_long_array(gh, self->bitmap, bitmap, &numberOfPoints); - if (plSize && pl) { - for (i = 0; i < numberOfRows; i++) { - for (j = 0; j < pl[i]; j++) { - numbersPerRow[i] += *(bitmap++); - } - } - } - else { - for (i = 0; i < numberOfRows; i++) { - numbersPerRow[i] = 0; - for (j = 0; j < Ni; j++) { - numbersPerRow[i] += *(bitmap++); - } - } - } - - grib_context_free(a->context, pbitmap); - } - else { - if (plSize && pl) { - for (i = 0; i < numberOfRows; i++) - numbersPerRow[i] = pl[i]; - } - else { - for (i = 0; i < numberOfRows; i++) - numbersPerRow[i] = numberOfColumns; - } - } - - if ((ret = grib_get_long_internal(gh, self->widthOfFirstOrderValues, &widthOfFirstOrderValues)) != 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_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(gh, self->numberOfSecondOrderPackedValues, - &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) - return ret; - - groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); - groupWidthsSize = numberOfGroups; - if ((ret = grib_get_long_array_internal(gh, self->groupWidths, groupWidths, &groupWidthsSize)) != GRIB_SUCCESS) - return ret; - - firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); - grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); - pos = 8 * ((pos + 7) / 8); - - n = 0; - for (i = 0; i < numberOfGroups; i++) - n += numbersPerRow[i]; - - if (*len < (size_t)n) - return GRIB_ARRAY_TOO_SMALL; - - X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * n); - n = 0; - k = 0; - for (i = 0; i < numberOfGroups; i++) { - if (groupWidths[i] > 0) { - for (j = 0; j < numbersPerRow[k]; j++) { - X[n] = grib_decode_unsigned_long(buf, &pos, groupWidths[i]); - X[n] += firstOrderValues[i]; - n++; - } - } - else { - for (j = 0; j < numbersPerRow[k]; j++) { - X[n] = firstOrderValues[i]; - n++; - } - } - k++; - } - - s = codes_power(binary_scale_factor, 2); - d = codes_power(-decimal_scale_factor, 10); - for (i = 0; i < n; i++) { - values[i] = (T)(((X[i] * s) + reference_value) * d); - } - grib_context_free(a->context, firstOrderValues); - grib_context_free(a->context, X); - grib_context_free(a->context, groupWidths); - if (plSize) - grib_context_free(a->context, pl); - if (numbersPerRow) - grib_context_free(a->context, numbersPerRow); - - return ret; -} - -#endif /* eccodes_accessor_data_g1second_order_row_by_row_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.cc b/src/accessor/grib_accessor_class_data_g22order_packing.cc index 8fe861965..7a0d2b754 100644 --- a/src/accessor/grib_accessor_class_data_g22order_packing.cc +++ b/src/accessor/grib_accessor_class_data_g22order_packing.cc @@ -11,20 +11,21 @@ #include "grib_accessor_class_data_g22order_packing.h" -grib_accessor_class_data_g22order_packing_t _grib_accessor_class_data_g22order_packing{"data_g22order_packing"}; +grib_accessor_class_data_g22order_packing_t _grib_accessor_class_data_g22order_packing{ "data_g22order_packing" }; grib_accessor_class* grib_accessor_class_data_g22order_packing = &_grib_accessor_class_data_g22order_packing; -void grib_accessor_class_data_g22order_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ +void grib_accessor_class_data_g22order_packing_t::init(grib_accessor* a, const long v, grib_arguments* args) +{ grib_accessor_class_values_t::init(a, v, args); grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); - grib_handle* gh = grib_handle_of_accessor(a); + grib_handle* gh = grib_handle_of_accessor(a); - self->numberOfValues = grib_arguments_get_name(gh, args, self->carg++); - self->bits_per_value = grib_arguments_get_name(gh, args, self->carg++); - self->reference_value = grib_arguments_get_name(gh, args, self->carg++); - self->binary_scale_factor = grib_arguments_get_name(gh, args, self->carg++); - self->decimal_scale_factor = grib_arguments_get_name(gh, args, self->carg++); + self->numberOfValues = grib_arguments_get_name(gh, args, self->carg++); + self->bits_per_value = grib_arguments_get_name(gh, args, self->carg++); + self->reference_value = grib_arguments_get_name(gh, args, self->carg++); + self->binary_scale_factor = grib_arguments_get_name(gh, args, self->carg++); + self->decimal_scale_factor = grib_arguments_get_name(gh, args, self->carg++); self->optimize_scale_factor = grib_arguments_get_name(gh, args, self->carg++); self->typeOfOriginalFieldValues = grib_arguments_get_name(gh, args, self->carg++); @@ -45,32 +46,34 @@ void grib_accessor_class_data_g22order_packing_t::init(grib_accessor* a, const l a->flags |= GRIB_ACCESSOR_FLAG_DATA; } - #define ONES (~(int)0) // #define UNDEFINED 9.999e20 // #define UNDEFINED_LOW 9.9989e20 // #define UNDEFINED_HIGH 9.9991e20 -#define UNDEFINED 9999.0 -#define UNDEFINED_LOW 9998.9 -#define UNDEFINED_HIGH 9999.1 +#define UNDEFINED 9999.0 +#define UNDEFINED_LOW 9998.9 +#define UNDEFINED_HIGH 9999.1 #define UNDEFINED_VAL(x) ((x) >= UNDEFINED_LOW && (x) <= UNDEFINED_HIGH) -#define DEFINED_VAL(x) ((x) < UNDEFINED_LOW || (x) > UNDEFINED_HIGH) -#define UNDEFINED_ANGLE 999.0 +#define DEFINED_VAL(x) ((x) < UNDEFINED_LOW || (x) > UNDEFINED_HIGH) +#define UNDEFINED_ANGLE 999.0 -struct bitstream_context { +struct bitstream_context +{ unsigned char* bitstream; int rbits; int reg; int n_bitstream; }; -void init_bitstream(bitstream_context *ctx, unsigned char* new_bitstream){ +void init_bitstream(bitstream_context* ctx, unsigned char* new_bitstream) +{ ctx->bitstream = new_bitstream; ctx->n_bitstream = ctx->reg = ctx->rbits = 0; } -void finish_bitstream(bitstream_context *ctx){ +void finish_bitstream(bitstream_context* ctx) +{ if (ctx->rbits) { ctx->n_bitstream++; *ctx->bitstream++ = (ctx->reg << (8 - ctx->rbits)) & 255; @@ -78,7 +81,8 @@ void finish_bitstream(bitstream_context *ctx){ } } -void add_many_bitstream(bitstream_context *ctx, grib_accessor* a, int* t, int n, int n_bits){ +void add_many_bitstream(bitstream_context* ctx, grib_accessor* a, int* t, int n, int n_bits) +{ unsigned int jmask; int i; const int max_numbits = 25; @@ -101,7 +105,8 @@ void add_many_bitstream(bitstream_context *ctx, grib_accessor* a, int* t, int n, } } -void add_bitstream(bitstream_context *ctx, grib_accessor* a, int t, int n_bits){ +void add_bitstream(bitstream_context* ctx, grib_accessor* a, int t, int n_bits) +{ unsigned int jmask; const int max_numbits = 25; @@ -125,7 +130,8 @@ void add_bitstream(bitstream_context *ctx, grib_accessor* a, int t, int n_bits){ // find min/max of an integer array // return 0: if min max found // return 1: if min max not found, min = max = 0 -int int_min_max_array(int* data, unsigned int n, int* min, int* max){ +int int_min_max_array(int* data, unsigned int n, int* min, int* max) +{ unsigned int first; int mn, mx; @@ -166,7 +172,8 @@ int int_min_max_array(int* data, unsigned int n, int* min, int* max){ return 0; } -double Int_Power(double x, int y){ +double Int_Power(double x, int y) +{ double value; if (y < 0) { @@ -185,7 +192,8 @@ double Int_Power(double x, int y){ return value; } -int min_max_array(double* data, unsigned int n, double* min, double* max){ +int min_max_array(double* data, unsigned int n, double* min, double* max) +{ unsigned int first; double mn, mx; @@ -297,7 +305,8 @@ int min_max_array(double* data, unsigned int n, double* min, double* max){ // return bms; // } -int grib_accessor_class_data_g22order_packing_t::post_process(grib_context* c, long* vals, long len, long order, long bias, const unsigned long extras[2]){ +static int post_process(grib_context* c, long* vals, long len, long order, long bias, const unsigned long extras[2]) +{ unsigned long last, penultimate = 0, j = 0; Assert(order > 0); Assert(order <= 3); @@ -358,7 +367,8 @@ int grib_accessor_class_data_g22order_packing_t::post_process(grib_context* c, l } -int find_nbits(unsigned int i){ +int find_nbits(unsigned int i) +{ #if !defined __GNUC__ || __GNUC__ < 4 int j; j = 0; @@ -396,7 +406,8 @@ struct section struct section *head, *tail; }; -int sizeofsection(struct section* s, int ref_bits, int width_bits, int has_undef){ +int sizeofsection(struct section* s, int ref_bits, int width_bits, int has_undef) +{ if (s->mn == INT_MAX) { // all undef return ref_bits + width_bits; } @@ -424,7 +435,8 @@ static int sizeofsection2(int mn, int mx, int n, int ref_bits, int width_bits, return find_nbits(mx - mn + has_undef) * n + ref_bits + width_bits; } -int size_all(struct section* s, int ref_bits, int width_bits, int has_undef){ +int size_all(struct section* s, int ref_bits, int width_bits, int has_undef) +{ int bits; bits = 0; @@ -435,7 +447,8 @@ int size_all(struct section* s, int ref_bits, int width_bits, int has_undef){ return (bits + 7) / 8; } -void move_one_left(struct section* s, int* v){ +void move_one_left(struct section* s, int* v) +{ struct section* t; int val, i, j, k; @@ -500,7 +513,8 @@ void move_one_left(struct section* s, int* v){ } } -void move_one_right(struct section* s, int* v){ +void move_one_right(struct section* s, int* v) +{ struct section* t; int val, i, j, k; @@ -581,7 +595,8 @@ void move_one_right(struct section* s, int* v){ return; } -void exchange(struct section* s, int* v, int has_undef, int LEN_SEC_MAX){ +void exchange(struct section* s, int* v, int has_undef, int LEN_SEC_MAX) +{ struct section* t; int val0, val1, nbit_s, nbit_t; @@ -656,7 +671,8 @@ void exchange(struct section* s, int* v, int has_undef, int LEN_SEC_MAX){ } } -void merge_j(struct section* h, int ref_bits, int width_bits, int has_undef, int param, int LEN_SEC_MAX){ +void merge_j(struct section* h, int ref_bits, int width_bits, int has_undef, int param, int LEN_SEC_MAX) +{ struct section *t, *m; int size_head, size_mid, size_tail, saving_mt, saving_hm; int min0, max0, min1, max1; @@ -760,7 +776,8 @@ void merge_j(struct section* h, int ref_bits, int width_bits, int has_undef, int } } -int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); grib_handle* gh = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; @@ -800,7 +817,7 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; - optimize_scale_factor = 1; // TODO(masn): To be reviewed + optimize_scale_factor = 1; // TODO(masn): To be reviewed if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return err; @@ -830,7 +847,7 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c // orderOfSpatialDifferencing = 1 means "grid_complex_spatial_differencing" with orderOfSpatialDifferencing=1 // orderOfSpatialDifferencing = 2 means "grid_complex_spatial_differencing" with orderOfSpatialDifferencing=2 - use_bitmap = bitmap_present; + use_bitmap = bitmap_present; wanted_bits = bits_per_value; for (i = 0; i < *len; i++) { @@ -842,7 +859,7 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c if (ndef == 0) { // Special case: All undefined values // Section 5 const char* packing_type = "grid_complex"; - size_t packing_type_len = strlen(packing_type); + size_t packing_type_len = strlen(packing_type); grib_set_string_internal(gh, "packingType", packing_type, &packing_type_len); if ((err = grib_set_double_internal(gh, self->reference_value, grib_ieee_to_long(0.0))) != GRIB_SUCCESS) @@ -882,8 +899,8 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c if ((err = grib_set_long_internal(gh, "bitmapPresent", 0)) != GRIB_SUCCESS) return err; // Section 7 - constexpr size_t sec7_size = 3; - unsigned char empty_sec7[sec7_size] = {255, 0, 0}; // group reference, group width, group length + constexpr size_t sec7_size = 3; + unsigned char empty_sec7[sec7_size] = { 255, 0, 0 }; // group reference, group width, group length grib_buffer_replace(a, empty_sec7, sec7_size, 1, 1); return GRIB_SUCCESS; } @@ -899,12 +916,12 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c dec_scale = -decimal_scale_factor; bin_scale = binary_scale_factor; - //compute bitmap section - //if (use_bitmap == 0 || ndef == ndata) { - // if ((err = grib_set_long_internal(gh, "bitmapPresent", 0)) != GRIB_SUCCESS) return err; - //} else { - // if ((err = grib_set_long_internal(gh, "bitmapPresent", 1)) != GRIB_SUCCESS) return err; - //} + // compute bitmap section + // if (use_bitmap == 0 || ndef == ndata) { + // if ((err = grib_set_long_internal(gh, "bitmapPresent", 0)) != GRIB_SUCCESS) return err; + // } else { + // if ((err = grib_set_long_internal(gh, "bitmapPresent", 1)) != GRIB_SUCCESS) return err; + // } nndata = use_bitmap ? ndef : ndata; has_undef = use_bitmap ? 0 : ndata != ndef; @@ -1073,7 +1090,7 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c #ifdef DEBUG grib_context_log(a->context, GRIB_LOG_DEBUG, "COMPLEX: 2: vmx %d vmn %d nbits %d", vmx, vmn, - find_nbits(vmx - vmn + has_undef)); + find_nbits(vmx - vmn + has_undef)); #endif for (i = 0; i < nndata; i++) { @@ -1094,7 +1111,7 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c list = reinterpret_cast(grib_context_malloc_clear(a->context, nstruct * sizeof(section))); if (list == NULL) { - grib_context_log(a->context, GRIB_LOG_ERROR, "%s packing: memory allocation of list failed",cclass_name); + grib_context_log(a->context, GRIB_LOG_ERROR, "%s packing: memory allocation of list failed", cclass_name); return GRIB_OUT_OF_MEMORY; } @@ -1170,10 +1187,10 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c LEN_SEC_MAX); j = size_all(start.tail, vbits, LEN_BITS + est_group_width, has_undef); #ifdef DEBUG - grib_context_log(a->context, GRIB_LOG_DEBUG, - "COMPLEX: complex inc segments size size0 %d size1 %d segsize %d " - "LEN_BITS=%d", - j0, j, LEN_SEC_MAX, LEN_BITS); + grib_context_log(a->context, GRIB_LOG_DEBUG, + "COMPLEX: complex inc segments size size0 %d size1 %d segsize %d " + "LEN_BITS=%d", + j0, j, LEN_SEC_MAX, LEN_BITS); #endif if (j > j0) { memcpy(list, list_backup, nstruct * sizeof(struct section)); @@ -1181,7 +1198,7 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c LEN_SEC_MAX = (LEN_SEC_MAX - 1) / 2; } } - grib_context_free(a->context,list_backup); + grib_context_free(a->context, list_backup); exchange(start.tail, v, has_undef, LEN_SEC_MAX); #ifdef DEBUG @@ -1232,7 +1249,7 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c itmp2 = reinterpret_cast(grib_context_malloc(a->context, ngroups * sizeof(int))); if (lens == NULL || widths == NULL || refs == NULL || itmp == NULL || itmp2 == NULL) { - grib_context_log(a->context, GRIB_LOG_ERROR, "%s packing: memory alloc of lens/widths/refs/itmp/itmp2 failed",cclass_name); + grib_context_log(a->context, GRIB_LOG_ERROR, "%s packing: memory alloc of lens/widths/refs/itmp/itmp2 failed", cclass_name); return GRIB_OUT_OF_MEMORY; } @@ -1289,7 +1306,7 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c } } - bits_per_value = find_nbits(grefmx + has_undef); + bits_per_value = find_nbits(grefmx + has_undef); numberOfBitsUsedForTheGroupWidths = find_nbits(gwidmx - gwidmn + has_undef); if ((err = grib_set_long_internal(gh, self->bits_per_value, bits_per_value)) != GRIB_SUCCESS) @@ -1445,15 +1462,269 @@ int grib_accessor_class_data_g22order_packing_t::pack_double(grib_accessor* a, c return GRIB_SUCCESS; } -int grib_accessor_class_data_g22order_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +template +static int unpack(grib_accessor* a, T* val, const size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating points numbers"); + grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); + const char* cclass_name = a->cclass->name; + grib_handle* gh = grib_handle_of_accessor(a); + + size_t i = 0; + size_t j = 0; + long n_vals = 0; + long vcount = 0; + int err = GRIB_SUCCESS; + long* sec_val = NULL; + unsigned char* buf = reinterpret_cast(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 = 0; + long numberOfOctetsExtraDescriptors = 0; + double missingValue = 0; + + err = a->value_count(&n_vals); + if (err) + return err; + + if (*len < static_cast(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; + if (n_vals < vcount + nvals_per_group) { + return GRIB_DECODING_ERROR; + } + + // 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++) { + DEBUG_ASSERT_ACCESS(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, + "%s unpacking: Unsupported order of spatial differencing %ld", cclass_name, 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 = (T)codes_power(binary_scale_factor, 2); + decimal_s = (T)codes_power(-decimal_scale_factor, 10); + + for (i = 0; i < n_vals; i++) { + if (sec_val[i] == LONG_MAX) { + val[i] = (T)missingValue; + } + else { + val[i] = (T)((((T)sec_val[i]) * binary_s) + reference_value) * decimal_s; + } + } + + grib_context_free(a->context, sec_val); + return err; +} + +int grib_accessor_class_data_g22order_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_data_g22order_packing_t::unpack_float(grib_accessor* a, float* val, size_t* len){ +int grib_accessor_class_data_g22order_packing_t::unpack_float(grib_accessor* a, float* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_data_g22order_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ +int grib_accessor_class_data_g22order_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val) +{ size_t size = 0; double* values = NULL; int err = grib_get_size(grib_handle_of_accessor(a), "codedValues", &size); @@ -1473,7 +1744,8 @@ int grib_accessor_class_data_g22order_packing_t::unpack_double_element(grib_acce return GRIB_SUCCESS; } -int grib_accessor_class_data_g22order_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ +int grib_accessor_class_data_g22order_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) +{ size_t size = 0, i = 0; double* values; int err = 0; @@ -1500,8 +1772,9 @@ int grib_accessor_class_data_g22order_packing_t::unpack_double_element_set(grib_ return GRIB_SUCCESS; } -int grib_accessor_class_data_g22order_packing_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_data_g22order_packing_t::value_count(grib_accessor* a, long* count) +{ grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); - *count = 0; + *count = 0; return grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, count); } diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.h b/src/accessor/grib_accessor_class_data_g22order_packing.h index 0b87602a9..39d01a70b 100644 --- a/src/accessor/grib_accessor_class_data_g22order_packing.h +++ b/src/accessor/grib_accessor_class_data_g22order_packing.h @@ -9,11 +9,10 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g22order_packing_h -#define eccodes_accessor_data_g22order_packing_h +#pragma once #include "grib_accessor_class_values.h" -#include "../grib_scaling.h" +#include "grib_scaling.h" class grib_accessor_data_g22order_packing_t : public grib_accessor_values_t { @@ -53,257 +52,4 @@ class grib_accessor_class_data_g22order_packing_t : public grib_accessor_class_v void init(grib_accessor*, const long, grib_arguments*) override; int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; -private: - int post_process(grib_context*, long*, long, long, long, const unsigned long[2]); - template int unpack(grib_accessor*, T*, const size_t*); }; - - -template -int grib_accessor_class_data_g22order_packing_t::unpack(grib_accessor* a, T* val, const size_t* len){ - static_assert(std::is_floating_point::value, "Requires floating points numbers"); - grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); - const char* cclass_name = a->cclass->name; - grib_handle* gh = grib_handle_of_accessor(a); - - size_t i = 0; - size_t j = 0; - long n_vals = 0; - long vcount = 0; - int err = GRIB_SUCCESS; - long* sec_val = NULL; - unsigned char* buf = reinterpret_cast(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 = 0; - long numberOfOctetsExtraDescriptors = 0; - double missingValue = 0; - - err = a->value_count(&n_vals); if (err) - return err; - - if (*len < static_cast(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; - if (n_vals < vcount + nvals_per_group) { - return GRIB_DECODING_ERROR; - } - - // 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++) { - DEBUG_ASSERT_ACCESS(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, - "%s unpacking: Unsupported order of spatial differencing %ld", cclass_name, 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 = (T)codes_power(binary_scale_factor, 2); - decimal_s = (T)codes_power(-decimal_scale_factor, 10); - - for (i = 0; i < n_vals; i++) { - if (sec_val[i] == LONG_MAX) { - val[i] = (T)missingValue; - } - else { - val[i] = (T)((((T)sec_val[i]) * binary_s) + reference_value) * decimal_s; - } - } - - grib_context_free(a->context, sec_val); - return err; -} - -#endif /* eccodes_accessor_data_g22order_packing_h */ From 6018a0acc7cc4d205670059582fad29c76051247 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 27 Apr 2024 13:40:39 +0100 Subject: [PATCH 086/196] Fix the includes: Do not use .. --- src/accessor/grib_accessor.h | 4 +- ...grib_accessor_class_abstract_long_vector.h | 2 +- ..._accessor_class_abstract_long_vector.h.bak | 33 +++ .../grib_accessor_class_abstract_vector.h | 2 +- .../grib_accessor_class_abstract_vector.h.bak | 32 +++ src/accessor/grib_accessor_class_ascii.h | 2 +- src/accessor/grib_accessor_class_ascii.h.bak | 42 +++ src/accessor/grib_accessor_class_bit.h | 2 +- src/accessor/grib_accessor_class_bit.h.bak | 35 +++ src/accessor/grib_accessor_class_bitmap.h | 2 +- src/accessor/grib_accessor_class_bitmap.h.bak | 45 +++ src/accessor/grib_accessor_class_bits.h | 2 +- src/accessor/grib_accessor_class_bits.h.bak | 45 +++ .../grib_accessor_class_bits_per_value.h | 2 +- .../grib_accessor_class_bits_per_value.h.bak | 35 +++ src/accessor/grib_accessor_class_blob.h | 2 +- src/accessor/grib_accessor_class_blob.h.bak | 34 +++ src/accessor/grib_accessor_class_budgdate.h | 2 +- .../grib_accessor_class_budgdate.h.bak | 36 +++ .../grib_accessor_class_bufr_data_array.h.bak | 92 ++++++ .../grib_accessor_class_bufr_data_element.h | 2 +- ...rib_accessor_class_bufr_data_element.h.bak | 57 ++++ .../grib_accessor_class_bufr_elements_table.h | 2 +- ...b_accessor_class_bufr_elements_table.h.bak | 39 +++ ...accessor_class_bufr_extract_area_subsets.h | 2 +- ...ssor_class_bufr_extract_area_subsets.h.bak | 43 +++ ...ssor_class_bufr_extract_datetime_subsets.h | 2 +- ..._class_bufr_extract_datetime_subsets.h.bak | 36 +++ ...grib_accessor_class_bufr_extract_subsets.h | 2 +- ..._accessor_class_bufr_extract_subsets.h.bak | 37 +++ src/accessor/grib_accessor_class_bufr_group.h | 2 +- .../grib_accessor_class_bufr_group.h.bak | 32 +++ ...grib_accessor_class_bufr_simple_thinning.h | 2 +- ..._accessor_class_bufr_simple_thinning.h.bak | 39 +++ .../grib_accessor_class_bufr_string_values.h | 2 +- ...ib_accessor_class_bufr_string_values.h.bak | 38 +++ ...cessor_class_bufrdc_expanded_descriptors.h | 2 +- ...or_class_bufrdc_expanded_descriptors.h.bak | 37 +++ src/accessor/grib_accessor_class_bytes.h | 2 +- src/accessor/grib_accessor_class_bytes.h.bak | 35 +++ ...or_class_change_alternative_row_scanning.h | 2 +- ...lass_change_alternative_row_scanning.h.bak | 38 +++ ...accessor_class_change_scanning_direction.h | 2 +- ...ssor_class_change_scanning_direction.h.bak | 42 +++ ...ib_accessor_class_check_internal_version.h | 2 +- ...ccessor_class_check_internal_version.h.bak | 33 +++ .../grib_accessor_class_closest_date.h | 2 +- .../grib_accessor_class_closest_date.h.bak | 43 +++ src/accessor/grib_accessor_class_codeflag.h | 2 +- .../grib_accessor_class_codeflag.h.bak | 34 +++ src/accessor/grib_accessor_class_codetable.h | 2 +- .../grib_accessor_class_codetable.h.bak | 47 +++ .../grib_accessor_class_codetable_title.h | 2 +- .../grib_accessor_class_codetable_title.h.bak | 34 +++ .../grib_accessor_class_codetable_units.h | 2 +- .../grib_accessor_class_codetable_units.h.bak | 34 +++ src/accessor/grib_accessor_class_concept.h | 2 +- .../grib_accessor_class_concept.h.bak | 43 +++ src/accessor/grib_accessor_class_constant.h | 2 +- .../grib_accessor_class_constant.h.bak | 27 ++ src/accessor/grib_accessor_class_count_file.h | 2 +- .../grib_accessor_class_count_file.h.bak | 32 +++ .../grib_accessor_class_count_missing.h | 2 +- .../grib_accessor_class_count_missing.h.bak | 37 +++ .../grib_accessor_class_count_total.h | 2 +- .../grib_accessor_class_count_total.h.bak | 32 +++ .../grib_accessor_class_data_apply_bitmap.h | 2 +- ...rib_accessor_class_data_apply_bitmap.h.bak | 132 +++++++++ ...sor_class_data_apply_boustrophedonic.h.bak | 41 +++ ..._class_data_apply_boustrophedonic_bitmap.h | 2 +- ...ss_data_apply_boustrophedonic_bitmap.h.bak | 45 +++ ...ib_accessor_class_data_ccsds_packing.h.bak | 203 +++++++++++++ ..._accessor_class_data_complex_packing.h.bak | 272 ++++++++++++++++++ .../grib_accessor_class_data_dummy_field.h | 2 +- ...grib_accessor_class_data_dummy_field.h.bak | 37 +++ ...ib_accessor_class_data_g1complex_packing.h | 2 +- ...ccessor_class_data_g1complex_packing.h.bak | 37 +++ ...ta_g1second_order_constant_width_packing.h | 2 +- ...1second_order_constant_width_packing.h.bak | 53 ++++ ..._g1second_order_general_extended_packing.h | 2 +- ...econd_order_general_extended_packing.h.bak | 68 +++++ ..._data_g1second_order_general_packing.h.bak | 49 ++++ ...ta_g1second_order_row_by_row_packing.h.bak | 49 ++++ ...b_accessor_class_data_g1secondary_bitmap.h | 2 +- ...cessor_class_data_g1secondary_bitmap.h.bak | 34 +++ ...b_accessor_class_data_g1shsimple_packing.h | 2 +- ...cessor_class_data_g1shsimple_packing.h.bak | 32 +++ ...rib_accessor_class_data_g1simple_packing.h | 2 +- ...accessor_class_data_g1simple_packing.h.bak | 37 +++ ...accessor_class_data_g22order_packing.h.bak | 55 ++++ ..._accessor_class_data_g2bifourier_packing.h | 2 +- ...essor_class_data_g2bifourier_packing.h.bak | 47 +++ ...ib_accessor_class_data_g2complex_packing.h | 2 +- ...ccessor_class_data_g2complex_packing.h.bak | 34 +++ ...b_accessor_class_data_g2secondary_bitmap.h | 2 +- ...cessor_class_data_g2secondary_bitmap.h.bak | 34 +++ ...b_accessor_class_data_g2shsimple_packing.h | 2 +- ...cessor_class_data_g2shsimple_packing.h.bak | 36 +++ ...accessor_class_data_g2simple_packing.h.bak | 28 ++ ...data_g2simple_packing_with_preprocessing.h | 2 +- ..._g2simple_packing_with_preprocessing.h.bak | 36 +++ ...rib_accessor_class_data_jpeg2000_packing.h | 2 +- ...accessor_class_data_jpeg2000_packing.h.bak | 46 +++ ...grib_accessor_class_data_png_packing.h.bak | 41 +++ .../grib_accessor_class_data_raw_packing.h | 2 +- ...grib_accessor_class_data_raw_packing.h.bak | 38 +++ ...b_accessor_class_data_run_length_packing.h | 2 +- ...cessor_class_data_run_length_packing.h.bak | 40 +++ ...rib_accessor_class_data_secondary_bitmap.h | 2 +- ...accessor_class_data_secondary_bitmap.h.bak | 38 +++ .../grib_accessor_class_data_sh_packed.h | 2 +- .../grib_accessor_class_data_sh_packed.h.bak | 43 +++ .../grib_accessor_class_data_sh_unpacked.h | 2 +- ...grib_accessor_class_data_sh_unpacked.h.bak | 43 +++ ...rib_accessor_class_data_shsimple_packing.h | 2 +- ...accessor_class_data_shsimple_packing.h.bak | 37 +++ ...b_accessor_class_data_simple_packing.h.bak | 195 +++++++++++++ .../grib_accessor_class_decimal_precision.h | 2 +- ...rib_accessor_class_decimal_precision.h.bak | 37 +++ src/accessor/grib_accessor_class_dictionary.h | 2 +- .../grib_accessor_class_dictionary.h.bak | 42 +++ src/accessor/grib_accessor_class_dirty.h | 2 +- src/accessor/grib_accessor_class_dirty.h.bak | 34 +++ src/accessor/grib_accessor_class_divdouble.h | 2 +- .../grib_accessor_class_divdouble.h.bak | 34 +++ src/accessor/grib_accessor_class_double.h.bak | 30 ++ src/accessor/grib_accessor_class_element.h | 2 +- .../grib_accessor_class_element.h.bak | 36 +++ src/accessor/grib_accessor_class_evaluate.h | 2 +- .../grib_accessor_class_evaluate.h.bak | 33 +++ ...grib_accessor_class_expanded_descriptors.h | 2 +- ..._accessor_class_expanded_descriptors.h.bak | 47 +++ ...sor_class_from_scale_factor_scaled_value.h | 2 +- ...class_from_scale_factor_scaled_value.h.bak | 37 +++ ...rib_accessor_class_g1_half_byte_codeflag.h | 2 +- ...accessor_class_g1_half_byte_codeflag.h.bak | 35 +++ .../grib_accessor_class_g1_message_length.h | 2 +- ...rib_accessor_class_g1_message_length.h.bak | 34 +++ .../grib_accessor_class_g1_section4_length.h | 2 +- ...ib_accessor_class_g1_section4_length.h.bak | 34 +++ src/accessor/grib_accessor_class_g1bitmap.h | 2 +- .../grib_accessor_class_g1bitmap.h.bak | 35 +++ src/accessor/grib_accessor_class_g1date.h | 2 +- src/accessor/grib_accessor_class_g1date.h.bak | 39 +++ ...ib_accessor_class_g1day_of_the_year_date.h | 2 +- ...ccessor_class_g1day_of_the_year_date.h.bak | 33 +++ ...accessor_class_g1end_of_interval_monthly.h | 2 +- ...ssor_class_g1end_of_interval_monthly.h.bak | 36 +++ src/accessor/grib_accessor_class_g1fcperiod.h | 2 +- .../grib_accessor_class_g1fcperiod.h.bak | 31 ++ .../grib_accessor_class_g1forecastmonth.h | 2 +- .../grib_accessor_class_g1forecastmonth.h.bak | 40 +++ .../grib_accessor_class_g1monthlydate.h | 2 +- .../grib_accessor_class_g1monthlydate.h.bak | 33 +++ ...lass_g1number_of_coded_values_sh_complex.h | 2 +- ..._g1number_of_coded_values_sh_complex.h.bak | 40 +++ ...class_g1number_of_coded_values_sh_simple.h | 2 +- ...s_g1number_of_coded_values_sh_simple.h.bak | 37 +++ .../grib_accessor_class_g1step_range.h | 2 +- .../grib_accessor_class_g1step_range.h.bak | 48 ++++ .../grib_accessor_class_g1verificationdate.h | 2 +- ...ib_accessor_class_g1verificationdate.h.bak | 35 +++ src/accessor/grib_accessor_class_g2_aerosol.h | 2 +- .../grib_accessor_class_g2_aerosol.h.bak | 37 +++ .../grib_accessor_class_g2_chemical.h | 2 +- .../grib_accessor_class_g2_chemical.h.bak | 37 +++ src/accessor/grib_accessor_class_g2_eps.h | 2 +- src/accessor/grib_accessor_class_g2_eps.h.bak | 39 +++ .../grib_accessor_class_g2_mars_labeling.h | 2 +- ...grib_accessor_class_g2_mars_labeling.h.bak | 47 +++ src/accessor/grib_accessor_class_g2bitmap.h | 2 +- .../grib_accessor_class_g2bitmap.h.bak | 34 +++ .../grib_accessor_class_g2bitmap_present.h | 2 +- ...grib_accessor_class_g2bitmap_present.h.bak | 34 +++ src/accessor/grib_accessor_class_g2date.h | 2 +- src/accessor/grib_accessor_class_g2date.h.bak | 37 +++ src/accessor/grib_accessor_class_g2end_step.h | 2 +- .../grib_accessor_class_g2end_step.h.bak | 56 ++++ src/accessor/grib_accessor_class_g2grid.h | 2 +- src/accessor/grib_accessor_class_g2grid.h.bak | 42 +++ src/accessor/grib_accessor_class_g2latlon.h | 2 +- .../grib_accessor_class_g2latlon.h.bak | 38 +++ src/accessor/grib_accessor_class_g2level.h | 2 +- .../grib_accessor_class_g2level.h.bak | 40 +++ src/accessor/grib_accessor_class_g2lon.h | 2 +- src/accessor/grib_accessor_class_g2lon.h.bak | 34 +++ .../grib_accessor_class_g2step_range.cc | 4 +- .../grib_accessor_class_g2step_range.h | 2 +- .../grib_accessor_class_g2step_range.h.bak | 41 +++ .../grib_accessor_class_gaussian_grid_name.h | 2 +- ...ib_accessor_class_gaussian_grid_name.h.bak | 37 +++ .../grib_accessor_class_gds_is_present.h | 2 +- .../grib_accessor_class_gds_is_present.h.bak | 37 +++ ...ib_accessor_class_gds_not_present_bitmap.h | 2 +- ...ccessor_class_gds_not_present_bitmap.h.bak | 40 +++ src/accessor/grib_accessor_class_gen.h | 2 +- src/accessor/grib_accessor_class_gen.h.bak | 158 ++++++++++ src/accessor/grib_accessor_class_getenv.h.bak | 36 +++ .../grib_accessor_class_global_gaussian.h | 2 +- .../grib_accessor_class_global_gaussian.h.bak | 44 +++ src/accessor/grib_accessor_class_group.h | 2 +- src/accessor/grib_accessor_class_group.h.bak | 41 +++ src/accessor/grib_accessor_class_gts_header.h | 2 +- .../grib_accessor_class_gts_header.h.bak | 36 +++ src/accessor/grib_accessor_class_hash_array.h | 2 +- .../grib_accessor_class_hash_array.h.bak | 45 +++ .../grib_accessor_class_headers_only.h | 2 +- .../grib_accessor_class_headers_only.h.bak | 33 +++ src/accessor/grib_accessor_class_ibmfloat.h | 2 +- .../grib_accessor_class_ibmfloat.h.bak | 71 +++++ .../grib_accessor_class_ieeefloat.h.bak | 66 +++++ src/accessor/grib_accessor_class_ifs_param.h | 2 +- .../grib_accessor_class_ifs_param.h.bak | 36 +++ src/accessor/grib_accessor_class_iterator.h | 2 +- .../grib_accessor_class_iterator.h.bak | 36 +++ .../grib_accessor_class_julian_date.h | 2 +- .../grib_accessor_class_julian_date.h.bak | 48 ++++ src/accessor/grib_accessor_class_julian_day.h | 2 +- .../grib_accessor_class_julian_day.h.bak | 40 +++ .../grib_accessor_class_ksec1expver.h | 2 +- .../grib_accessor_class_ksec1expver.h.bak | 34 +++ src/accessor/grib_accessor_class_label.h | 2 +- src/accessor/grib_accessor_class_label.h.bak | 34 +++ src/accessor/grib_accessor_class_latitudes.h | 2 +- .../grib_accessor_class_latitudes.h.bak | 38 +++ .../grib_accessor_class_latlon_increment.h | 2 +- ...grib_accessor_class_latlon_increment.h.bak | 43 +++ .../grib_accessor_class_latlonvalues.h | 2 +- .../grib_accessor_class_latlonvalues.h.bak | 34 +++ .../grib_accessor_class_library_version.h | 2 +- .../grib_accessor_class_library_version.h.bak | 33 +++ .../grib_accessor_class_local_definition.h | 2 +- ...grib_accessor_class_local_definition.h.bak | 43 +++ src/accessor/grib_accessor_class_long.h | 2 +- src/accessor/grib_accessor_class_long.h.bak | 22 ++ .../grib_accessor_class_long_vector.h | 2 +- .../grib_accessor_class_long_vector.h.bak | 37 +++ src/accessor/grib_accessor_class_longitudes.h | 2 +- .../grib_accessor_class_longitudes.h.bak | 38 +++ src/accessor/grib_accessor_class_lookup.h.bak | 40 +++ src/accessor/grib_accessor_class_mars_param.h | 2 +- .../grib_accessor_class_mars_param.h.bak | 36 +++ src/accessor/grib_accessor_class_mars_step.h | 2 +- .../grib_accessor_class_mars_step.h.bak | 40 +++ src/accessor/grib_accessor_class_md5.h | 2 +- src/accessor/grib_accessor_class_md5.h.bak | 39 +++ src/accessor/grib_accessor_class_message.h | 2 +- .../grib_accessor_class_message.h.bak | 36 +++ .../grib_accessor_class_message_copy.h | 2 +- .../grib_accessor_class_message_copy.h.bak | 36 +++ src/accessor/grib_accessor_class_multdouble.h | 2 +- .../grib_accessor_class_multdouble.h.bak | 34 +++ src/accessor/grib_accessor_class_nearest.h | 2 +- .../grib_accessor_class_nearest.h.bak | 33 +++ src/accessor/grib_accessor_class_non_alpha.h | 2 +- .../grib_accessor_class_non_alpha.h.bak | 39 +++ ...ib_accessor_class_number_of_coded_values.h | 2 +- ...ccessor_class_number_of_coded_values.h.bak | 37 +++ .../grib_accessor_class_number_of_points.h | 2 +- ...grib_accessor_class_number_of_points.h.bak | 36 +++ ...accessor_class_number_of_points_gaussian.h | 2 +- ...ssor_class_number_of_points_gaussian.h.bak | 42 +++ .../grib_accessor_class_number_of_values.h | 2 +- ...grib_accessor_class_number_of_values.h.bak | 38 +++ ..._class_number_of_values_data_raw_packing.h | 2 +- ...ss_number_of_values_data_raw_packing.h.bak | 35 +++ .../grib_accessor_class_octahedral_gaussian.h | 2 +- ...b_accessor_class_octahedral_gaussian.h.bak | 37 +++ .../grib_accessor_class_octet_number.h | 2 +- .../grib_accessor_class_octet_number.h.bak | 35 +++ .../grib_accessor_class_offset_file.h | 2 +- .../grib_accessor_class_offset_file.h.bak | 33 +++ .../grib_accessor_class_offset_values.h | 2 +- .../grib_accessor_class_offset_values.h.bak | 35 +++ .../grib_accessor_class_optimal_step_units.h | 2 +- ...ib_accessor_class_optimal_step_units.h.bak | 44 +++ .../grib_accessor_class_pack_bufr_values.h | 2 +- ...grib_accessor_class_pack_bufr_values.h.bak | 42 +++ .../grib_accessor_class_packing_type.h | 2 +- .../grib_accessor_class_packing_type.h.bak | 37 +++ src/accessor/grib_accessor_class_pad.h | 2 +- src/accessor/grib_accessor_class_pad.h.bak | 34 +++ src/accessor/grib_accessor_class_padding.h | 2 +- .../grib_accessor_class_padding.h.bak | 37 +++ src/accessor/grib_accessor_class_padto.h | 2 +- src/accessor/grib_accessor_class_padto.h.bak | 34 +++ src/accessor/grib_accessor_class_padtoeven.h | 2 +- .../grib_accessor_class_padtoeven.h.bak | 34 +++ .../grib_accessor_class_padtomultiple.h | 2 +- .../grib_accessor_class_padtomultiple.h.bak | 34 +++ src/accessor/grib_accessor_class_position.h | 2 +- .../grib_accessor_class_position.h.bak | 34 +++ .../grib_accessor_class_proj_string.h | 2 +- .../grib_accessor_class_proj_string.h.bak | 35 +++ src/accessor/grib_accessor_class_raw.h | 2 +- src/accessor/grib_accessor_class_raw.h.bak | 41 +++ .../grib_accessor_class_rdbtime_guess_date.h | 2 +- ...ib_accessor_class_rdbtime_guess_date.h.bak | 38 +++ ...rib_accessor_class_reference_value_error.h | 2 +- ...accessor_class_reference_value_error.h.bak | 34 +++ src/accessor/grib_accessor_class_round.h | 2 +- src/accessor/grib_accessor_class_round.h.bak | 32 +++ src/accessor/grib_accessor_class_scale.h | 2 +- src/accessor/grib_accessor_class_scale.h.bak | 39 +++ .../grib_accessor_class_scale_values.h | 2 +- .../grib_accessor_class_scale_values.h.bak | 35 +++ ...cessor_class_second_order_bits_per_value.h | 2 +- ...or_class_second_order_bits_per_value.h.bak | 37 +++ .../grib_accessor_class_section.h.bak | 34 +++ .../grib_accessor_class_section_length.h | 2 +- .../grib_accessor_class_section_length.h.bak | 33 +++ .../grib_accessor_class_section_padding.h | 2 +- .../grib_accessor_class_section_padding.h.bak | 33 +++ .../grib_accessor_class_section_pointer.h | 2 +- .../grib_accessor_class_section_pointer.h.bak | 38 +++ ...grib_accessor_class_select_step_template.h | 2 +- ..._accessor_class_select_step_template.h.bak | 36 +++ .../grib_accessor_class_sexagesimal2decimal.h | 2 +- ...b_accessor_class_sexagesimal2decimal.h.bak | 34 +++ src/accessor/grib_accessor_class_signed.h | 2 +- src/accessor/grib_accessor_class_signed.h.bak | 42 +++ .../grib_accessor_class_signed_bits.h | 2 +- .../grib_accessor_class_signed_bits.h.bak | 40 +++ ...grib_accessor_class_simple_packing_error.h | 2 +- ..._accessor_class_simple_packing_error.h.bak | 37 +++ src/accessor/grib_accessor_class_size.h | 2 +- src/accessor/grib_accessor_class_size.h.bak | 33 +++ .../grib_accessor_class_smart_table.h | 2 +- .../grib_accessor_class_smart_table.h.bak | 52 ++++ ...ib_accessor_class_smart_table_column.h.bak | 37 +++ src/accessor/grib_accessor_class_spd.h | 2 +- src/accessor/grib_accessor_class_spd.h.bak | 40 +++ .../grib_accessor_class_spectral_truncation.h | 2 +- ...b_accessor_class_spectral_truncation.h.bak | 36 +++ src/accessor/grib_accessor_class_sprintf.h | 2 +- .../grib_accessor_class_sprintf.h.bak | 35 +++ src/accessor/grib_accessor_class_statistics.h | 2 +- .../grib_accessor_class_statistics.h.bak | 38 +++ .../grib_accessor_class_statistics_spectral.h | 2 +- ...b_accessor_class_statistics_spectral.h.bak | 40 +++ .../grib_accessor_class_step_human_readable.h | 2 +- ...b_accessor_class_step_human_readable.h.bak | 35 +++ .../grib_accessor_class_step_in_units.h | 2 +- .../grib_accessor_class_step_in_units.h.bak | 43 +++ src/accessor/grib_accessor_class_sum.h | 2 +- src/accessor/grib_accessor_class_sum.h.bak | 35 +++ src/accessor/grib_accessor_class_suppressed.h | 2 +- .../grib_accessor_class_suppressed.h.bak | 37 +++ src/accessor/grib_accessor_class_time.h | 2 +- src/accessor/grib_accessor_class_time.h.bak | 37 +++ src/accessor/grib_accessor_class_to_double.h | 2 +- .../grib_accessor_class_to_double.h.bak | 43 +++ src/accessor/grib_accessor_class_to_integer.h | 2 +- .../grib_accessor_class_to_integer.h.bak | 45 +++ src/accessor/grib_accessor_class_to_string.h | 2 +- .../grib_accessor_class_to_string.h.bak | 42 +++ .../grib_accessor_class_transient.h.bak | 25 ++ .../grib_accessor_class_transient_darray.h | 2 +- ...grib_accessor_class_transient_darray.h.bak | 41 +++ src/accessor/grib_accessor_class_trim.h | 2 +- src/accessor/grib_accessor_class_trim.h.bak | 37 +++ src/accessor/grib_accessor_class_uint16.h | 2 +- src/accessor/grib_accessor_class_uint16.h.bak | 32 +++ src/accessor/grib_accessor_class_uint32.h | 2 +- src/accessor/grib_accessor_class_uint32.h.bak | 32 +++ ...grib_accessor_class_uint32_little_endian.h | 2 +- ..._accessor_class_uint32_little_endian.h.bak | 32 +++ src/accessor/grib_accessor_class_uint64.h | 2 +- src/accessor/grib_accessor_class_uint64.h.bak | 32 +++ ...grib_accessor_class_uint64_little_endian.h | 2 +- ..._accessor_class_uint64_little_endian.h.bak | 32 +++ src/accessor/grib_accessor_class_uint8.h | 2 +- src/accessor/grib_accessor_class_uint8.h.bak | 32 +++ ...ib_accessor_class_unexpanded_descriptors.h | 2 +- ...ccessor_class_unexpanded_descriptors.h.bak | 39 +++ .../grib_accessor_class_unpack_bufr_values.h | 2 +- ...ib_accessor_class_unpack_bufr_values.h.bak | 42 +++ src/accessor/grib_accessor_class_unsigned.h | 2 +- .../grib_accessor_class_unsigned.h.bak | 40 +++ .../grib_accessor_class_unsigned_bits.h | 2 +- .../grib_accessor_class_unsigned_bits.h.bak | 40 +++ .../grib_accessor_class_validity_date.h | 2 +- .../grib_accessor_class_validity_date.h.bak | 39 +++ .../grib_accessor_class_validity_time.h | 2 +- .../grib_accessor_class_validity_time.h.bak | 39 +++ src/accessor/grib_accessor_class_values.h.bak | 41 +++ .../grib_accessor_class_variable.h.bak | 49 ++++ src/accessor/grib_accessor_class_vector.h | 2 +- src/accessor/grib_accessor_class_vector.h.bak | 34 +++ src/accessor/grib_accessor_class_when.h | 2 +- src/accessor/grib_accessor_class_when.h.bak | 34 +++ 391 files changed, 8812 insertions(+), 189 deletions(-) create mode 100644 src/accessor/grib_accessor_class_abstract_long_vector.h.bak create mode 100644 src/accessor/grib_accessor_class_abstract_vector.h.bak create mode 100644 src/accessor/grib_accessor_class_ascii.h.bak create mode 100644 src/accessor/grib_accessor_class_bit.h.bak create mode 100644 src/accessor/grib_accessor_class_bitmap.h.bak create mode 100644 src/accessor/grib_accessor_class_bits.h.bak create mode 100644 src/accessor/grib_accessor_class_bits_per_value.h.bak create mode 100644 src/accessor/grib_accessor_class_blob.h.bak create mode 100644 src/accessor/grib_accessor_class_budgdate.h.bak create mode 100644 src/accessor/grib_accessor_class_bufr_data_array.h.bak create mode 100644 src/accessor/grib_accessor_class_bufr_data_element.h.bak create mode 100644 src/accessor/grib_accessor_class_bufr_elements_table.h.bak create mode 100644 src/accessor/grib_accessor_class_bufr_extract_area_subsets.h.bak create mode 100644 src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h.bak create mode 100644 src/accessor/grib_accessor_class_bufr_extract_subsets.h.bak create mode 100644 src/accessor/grib_accessor_class_bufr_group.h.bak create mode 100644 src/accessor/grib_accessor_class_bufr_simple_thinning.h.bak create mode 100644 src/accessor/grib_accessor_class_bufr_string_values.h.bak create mode 100644 src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h.bak create mode 100644 src/accessor/grib_accessor_class_bytes.h.bak create mode 100644 src/accessor/grib_accessor_class_change_alternative_row_scanning.h.bak create mode 100644 src/accessor/grib_accessor_class_change_scanning_direction.h.bak create mode 100644 src/accessor/grib_accessor_class_check_internal_version.h.bak create mode 100644 src/accessor/grib_accessor_class_closest_date.h.bak create mode 100644 src/accessor/grib_accessor_class_codeflag.h.bak create mode 100644 src/accessor/grib_accessor_class_codetable.h.bak create mode 100644 src/accessor/grib_accessor_class_codetable_title.h.bak create mode 100644 src/accessor/grib_accessor_class_codetable_units.h.bak create mode 100644 src/accessor/grib_accessor_class_concept.h.bak create mode 100644 src/accessor/grib_accessor_class_constant.h.bak create mode 100644 src/accessor/grib_accessor_class_count_file.h.bak create mode 100644 src/accessor/grib_accessor_class_count_missing.h.bak create mode 100644 src/accessor/grib_accessor_class_count_total.h.bak create mode 100644 src/accessor/grib_accessor_class_data_apply_bitmap.h.bak create mode 100644 src/accessor/grib_accessor_class_data_apply_boustrophedonic.h.bak create mode 100644 src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h.bak create mode 100644 src/accessor/grib_accessor_class_data_ccsds_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_complex_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_dummy_field.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g1complex_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g1second_order_general_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g1secondary_bitmap.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g1shsimple_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g1simple_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g22order_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g2bifourier_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g2complex_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g2secondary_bitmap.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g2shsimple_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g2simple_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_jpeg2000_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_png_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_raw_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_run_length_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_secondary_bitmap.h.bak create mode 100644 src/accessor/grib_accessor_class_data_sh_packed.h.bak create mode 100644 src/accessor/grib_accessor_class_data_sh_unpacked.h.bak create mode 100644 src/accessor/grib_accessor_class_data_shsimple_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_data_simple_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_decimal_precision.h.bak create mode 100644 src/accessor/grib_accessor_class_dictionary.h.bak create mode 100644 src/accessor/grib_accessor_class_dirty.h.bak create mode 100644 src/accessor/grib_accessor_class_divdouble.h.bak create mode 100644 src/accessor/grib_accessor_class_double.h.bak create mode 100644 src/accessor/grib_accessor_class_element.h.bak create mode 100644 src/accessor/grib_accessor_class_evaluate.h.bak create mode 100644 src/accessor/grib_accessor_class_expanded_descriptors.h.bak create mode 100644 src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h.bak create mode 100644 src/accessor/grib_accessor_class_g1_half_byte_codeflag.h.bak create mode 100644 src/accessor/grib_accessor_class_g1_message_length.h.bak create mode 100644 src/accessor/grib_accessor_class_g1_section4_length.h.bak create mode 100644 src/accessor/grib_accessor_class_g1bitmap.h.bak create mode 100644 src/accessor/grib_accessor_class_g1date.h.bak create mode 100644 src/accessor/grib_accessor_class_g1day_of_the_year_date.h.bak create mode 100644 src/accessor/grib_accessor_class_g1end_of_interval_monthly.h.bak create mode 100644 src/accessor/grib_accessor_class_g1fcperiod.h.bak create mode 100644 src/accessor/grib_accessor_class_g1forecastmonth.h.bak create mode 100644 src/accessor/grib_accessor_class_g1monthlydate.h.bak create mode 100644 src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h.bak create mode 100644 src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h.bak create mode 100644 src/accessor/grib_accessor_class_g1step_range.h.bak create mode 100644 src/accessor/grib_accessor_class_g1verificationdate.h.bak create mode 100644 src/accessor/grib_accessor_class_g2_aerosol.h.bak create mode 100644 src/accessor/grib_accessor_class_g2_chemical.h.bak create mode 100644 src/accessor/grib_accessor_class_g2_eps.h.bak create mode 100644 src/accessor/grib_accessor_class_g2_mars_labeling.h.bak create mode 100644 src/accessor/grib_accessor_class_g2bitmap.h.bak create mode 100644 src/accessor/grib_accessor_class_g2bitmap_present.h.bak create mode 100644 src/accessor/grib_accessor_class_g2date.h.bak create mode 100644 src/accessor/grib_accessor_class_g2end_step.h.bak create mode 100644 src/accessor/grib_accessor_class_g2grid.h.bak create mode 100644 src/accessor/grib_accessor_class_g2latlon.h.bak create mode 100644 src/accessor/grib_accessor_class_g2level.h.bak create mode 100644 src/accessor/grib_accessor_class_g2lon.h.bak create mode 100644 src/accessor/grib_accessor_class_g2step_range.h.bak create mode 100644 src/accessor/grib_accessor_class_gaussian_grid_name.h.bak create mode 100644 src/accessor/grib_accessor_class_gds_is_present.h.bak create mode 100644 src/accessor/grib_accessor_class_gds_not_present_bitmap.h.bak create mode 100644 src/accessor/grib_accessor_class_gen.h.bak create mode 100644 src/accessor/grib_accessor_class_getenv.h.bak create mode 100644 src/accessor/grib_accessor_class_global_gaussian.h.bak create mode 100644 src/accessor/grib_accessor_class_group.h.bak create mode 100644 src/accessor/grib_accessor_class_gts_header.h.bak create mode 100644 src/accessor/grib_accessor_class_hash_array.h.bak create mode 100644 src/accessor/grib_accessor_class_headers_only.h.bak create mode 100644 src/accessor/grib_accessor_class_ibmfloat.h.bak create mode 100644 src/accessor/grib_accessor_class_ieeefloat.h.bak create mode 100644 src/accessor/grib_accessor_class_ifs_param.h.bak create mode 100644 src/accessor/grib_accessor_class_iterator.h.bak create mode 100644 src/accessor/grib_accessor_class_julian_date.h.bak create mode 100644 src/accessor/grib_accessor_class_julian_day.h.bak create mode 100644 src/accessor/grib_accessor_class_ksec1expver.h.bak create mode 100644 src/accessor/grib_accessor_class_label.h.bak create mode 100644 src/accessor/grib_accessor_class_latitudes.h.bak create mode 100644 src/accessor/grib_accessor_class_latlon_increment.h.bak create mode 100644 src/accessor/grib_accessor_class_latlonvalues.h.bak create mode 100644 src/accessor/grib_accessor_class_library_version.h.bak create mode 100644 src/accessor/grib_accessor_class_local_definition.h.bak create mode 100644 src/accessor/grib_accessor_class_long.h.bak create mode 100644 src/accessor/grib_accessor_class_long_vector.h.bak create mode 100644 src/accessor/grib_accessor_class_longitudes.h.bak create mode 100644 src/accessor/grib_accessor_class_lookup.h.bak create mode 100644 src/accessor/grib_accessor_class_mars_param.h.bak create mode 100644 src/accessor/grib_accessor_class_mars_step.h.bak create mode 100644 src/accessor/grib_accessor_class_md5.h.bak create mode 100644 src/accessor/grib_accessor_class_message.h.bak create mode 100644 src/accessor/grib_accessor_class_message_copy.h.bak create mode 100644 src/accessor/grib_accessor_class_multdouble.h.bak create mode 100644 src/accessor/grib_accessor_class_nearest.h.bak create mode 100644 src/accessor/grib_accessor_class_non_alpha.h.bak create mode 100644 src/accessor/grib_accessor_class_number_of_coded_values.h.bak create mode 100644 src/accessor/grib_accessor_class_number_of_points.h.bak create mode 100644 src/accessor/grib_accessor_class_number_of_points_gaussian.h.bak create mode 100644 src/accessor/grib_accessor_class_number_of_values.h.bak create mode 100644 src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h.bak create mode 100644 src/accessor/grib_accessor_class_octahedral_gaussian.h.bak create mode 100644 src/accessor/grib_accessor_class_octet_number.h.bak create mode 100644 src/accessor/grib_accessor_class_offset_file.h.bak create mode 100644 src/accessor/grib_accessor_class_offset_values.h.bak create mode 100644 src/accessor/grib_accessor_class_optimal_step_units.h.bak create mode 100644 src/accessor/grib_accessor_class_pack_bufr_values.h.bak create mode 100644 src/accessor/grib_accessor_class_packing_type.h.bak create mode 100644 src/accessor/grib_accessor_class_pad.h.bak create mode 100644 src/accessor/grib_accessor_class_padding.h.bak create mode 100644 src/accessor/grib_accessor_class_padto.h.bak create mode 100644 src/accessor/grib_accessor_class_padtoeven.h.bak create mode 100644 src/accessor/grib_accessor_class_padtomultiple.h.bak create mode 100644 src/accessor/grib_accessor_class_position.h.bak create mode 100644 src/accessor/grib_accessor_class_proj_string.h.bak create mode 100644 src/accessor/grib_accessor_class_raw.h.bak create mode 100644 src/accessor/grib_accessor_class_rdbtime_guess_date.h.bak create mode 100644 src/accessor/grib_accessor_class_reference_value_error.h.bak create mode 100644 src/accessor/grib_accessor_class_round.h.bak create mode 100644 src/accessor/grib_accessor_class_scale.h.bak create mode 100644 src/accessor/grib_accessor_class_scale_values.h.bak create mode 100644 src/accessor/grib_accessor_class_second_order_bits_per_value.h.bak create mode 100644 src/accessor/grib_accessor_class_section.h.bak create mode 100644 src/accessor/grib_accessor_class_section_length.h.bak create mode 100644 src/accessor/grib_accessor_class_section_padding.h.bak create mode 100644 src/accessor/grib_accessor_class_section_pointer.h.bak create mode 100644 src/accessor/grib_accessor_class_select_step_template.h.bak create mode 100644 src/accessor/grib_accessor_class_sexagesimal2decimal.h.bak create mode 100644 src/accessor/grib_accessor_class_signed.h.bak create mode 100644 src/accessor/grib_accessor_class_signed_bits.h.bak create mode 100644 src/accessor/grib_accessor_class_simple_packing_error.h.bak create mode 100644 src/accessor/grib_accessor_class_size.h.bak create mode 100644 src/accessor/grib_accessor_class_smart_table.h.bak create mode 100644 src/accessor/grib_accessor_class_smart_table_column.h.bak create mode 100644 src/accessor/grib_accessor_class_spd.h.bak create mode 100644 src/accessor/grib_accessor_class_spectral_truncation.h.bak create mode 100644 src/accessor/grib_accessor_class_sprintf.h.bak create mode 100644 src/accessor/grib_accessor_class_statistics.h.bak create mode 100644 src/accessor/grib_accessor_class_statistics_spectral.h.bak create mode 100644 src/accessor/grib_accessor_class_step_human_readable.h.bak create mode 100644 src/accessor/grib_accessor_class_step_in_units.h.bak create mode 100644 src/accessor/grib_accessor_class_sum.h.bak create mode 100644 src/accessor/grib_accessor_class_suppressed.h.bak create mode 100644 src/accessor/grib_accessor_class_time.h.bak create mode 100644 src/accessor/grib_accessor_class_to_double.h.bak create mode 100644 src/accessor/grib_accessor_class_to_integer.h.bak create mode 100644 src/accessor/grib_accessor_class_to_string.h.bak create mode 100644 src/accessor/grib_accessor_class_transient.h.bak create mode 100644 src/accessor/grib_accessor_class_transient_darray.h.bak create mode 100644 src/accessor/grib_accessor_class_trim.h.bak create mode 100644 src/accessor/grib_accessor_class_uint16.h.bak create mode 100644 src/accessor/grib_accessor_class_uint32.h.bak create mode 100644 src/accessor/grib_accessor_class_uint32_little_endian.h.bak create mode 100644 src/accessor/grib_accessor_class_uint64.h.bak create mode 100644 src/accessor/grib_accessor_class_uint64_little_endian.h.bak create mode 100644 src/accessor/grib_accessor_class_uint8.h.bak create mode 100644 src/accessor/grib_accessor_class_unexpanded_descriptors.h.bak create mode 100644 src/accessor/grib_accessor_class_unpack_bufr_values.h.bak create mode 100644 src/accessor/grib_accessor_class_unsigned.h.bak create mode 100644 src/accessor/grib_accessor_class_unsigned_bits.h.bak create mode 100644 src/accessor/grib_accessor_class_validity_date.h.bak create mode 100644 src/accessor/grib_accessor_class_validity_time.h.bak create mode 100644 src/accessor/grib_accessor_class_values.h.bak create mode 100644 src/accessor/grib_accessor_class_variable.h.bak create mode 100644 src/accessor/grib_accessor_class_vector.h.bak create mode 100644 src/accessor/grib_accessor_class_when.h.bak diff --git a/src/accessor/grib_accessor.h b/src/accessor/grib_accessor.h index 7220e90e7..c18a355d2 100644 --- a/src/accessor/grib_accessor.h +++ b/src/accessor/grib_accessor.h @@ -10,8 +10,8 @@ #pragma once -#include "../grib_api_internal.h" -#include "../grib_value.h" +#include "grib_api_internal.h" +#include "grib_value.h" class grib_accessor { diff --git a/src/accessor/grib_accessor_class_abstract_long_vector.h b/src/accessor/grib_accessor_class_abstract_long_vector.h index 2961979d8..5c3c6b5f9 100644 --- a/src/accessor/grib_accessor_class_abstract_long_vector.h +++ b/src/accessor/grib_accessor_class_abstract_long_vector.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_abstract_long_vector_h #define eccodes_accessor_abstract_long_vector_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_abstract_long_vector_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_abstract_long_vector.h.bak b/src/accessor/grib_accessor_class_abstract_long_vector.h.bak new file mode 100644 index 000000000..2961979d8 --- /dev/null +++ b/src/accessor/grib_accessor_class_abstract_long_vector.h.bak @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_abstract_long_vector_h +#define eccodes_accessor_abstract_long_vector_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_abstract_long_vector_t : public grib_accessor_gen_t +{ +public: + /* Members defined in abstract_long_vector */ + long* v; + long pack_index; + int number_of_elements; +}; + +class grib_accessor_class_abstract_long_vector_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_abstract_long_vector_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_abstract_long_vector_t{}; } +}; +#endif /* eccodes_accessor_abstract_long_vector_h */ diff --git a/src/accessor/grib_accessor_class_abstract_vector.h b/src/accessor/grib_accessor_class_abstract_vector.h index df7e3fdbf..d1201ede7 100644 --- a/src/accessor/grib_accessor_class_abstract_vector.h +++ b/src/accessor/grib_accessor_class_abstract_vector.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_abstract_vector_h #define eccodes_accessor_abstract_vector_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_abstract_vector_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_abstract_vector.h.bak b/src/accessor/grib_accessor_class_abstract_vector.h.bak new file mode 100644 index 000000000..df7e3fdbf --- /dev/null +++ b/src/accessor/grib_accessor_class_abstract_vector.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_abstract_vector_h +#define eccodes_accessor_abstract_vector_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_abstract_vector_t : public grib_accessor_double_t +{ +public: + /* Members defined in abstract_vector */ + double* v; + int number_of_elements; +}; + +class grib_accessor_class_abstract_vector_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_abstract_vector_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_abstract_vector_t{}; } +}; +#endif /* eccodes_accessor_abstract_vector_h */ diff --git a/src/accessor/grib_accessor_class_ascii.h b/src/accessor/grib_accessor_class_ascii.h index cb8e68bd7..ea00a247c 100644 --- a/src/accessor/grib_accessor_class_ascii.h +++ b/src/accessor/grib_accessor_class_ascii.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_ascii_h #define eccodes_accessor_ascii_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_ascii_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_ascii.h.bak b/src/accessor/grib_accessor_class_ascii.h.bak new file mode 100644 index 000000000..cb8e68bd7 --- /dev/null +++ b/src/accessor/grib_accessor_class_ascii.h.bak @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_ascii_h +#define eccodes_accessor_ascii_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_ascii_t : public grib_accessor_gen_t +{ +public: + /* Members defined in ascii */ +}; + +class grib_accessor_class_ascii_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_ascii_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_ascii_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_ascii_h */ diff --git a/src/accessor/grib_accessor_class_bit.h b/src/accessor/grib_accessor_class_bit.h index 3a9eee2d7..28c001488 100644 --- a/src/accessor/grib_accessor_class_bit.h +++ b/src/accessor/grib_accessor_class_bit.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bit_h #define eccodes_accessor_bit_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_bit_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_bit.h.bak b/src/accessor/grib_accessor_class_bit.h.bak new file mode 100644 index 000000000..3a9eee2d7 --- /dev/null +++ b/src/accessor/grib_accessor_class_bit.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bit_h +#define eccodes_accessor_bit_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_bit_t : public grib_accessor_long_t +{ +public: + /* Members defined in bit */ + const char* owner; + int bit_index; +}; + +class grib_accessor_class_bit_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_bit_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bit_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bit_h */ diff --git a/src/accessor/grib_accessor_class_bitmap.h b/src/accessor/grib_accessor_class_bitmap.h index d9b3ab9df..dd66d6256 100644 --- a/src/accessor/grib_accessor_class_bitmap.h +++ b/src/accessor/grib_accessor_class_bitmap.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bitmap_h #define eccodes_accessor_bitmap_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_bytes.h" class grib_accessor_bitmap_t : public grib_accessor_bytes_t diff --git a/src/accessor/grib_accessor_class_bitmap.h.bak b/src/accessor/grib_accessor_class_bitmap.h.bak new file mode 100644 index 000000000..d9b3ab9df --- /dev/null +++ b/src/accessor/grib_accessor_class_bitmap.h.bak @@ -0,0 +1,45 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bitmap_h +#define eccodes_accessor_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_bytes.h" + +class grib_accessor_bitmap_t : public grib_accessor_bytes_t +{ +public: + /* Members defined in bitmap */ + const char* tableReference; + const char* missing_value; + const char* offsetbsec; + const char* sLength; +}; + +class grib_accessor_class_bitmap_t : public grib_accessor_class_bytes_t +{ +public: + grib_accessor_class_bitmap_t(const char* name) : grib_accessor_class_bytes_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bitmap_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_bits.h b/src/accessor/grib_accessor_class_bits.h index b5dd2977b..dccc43486 100644 --- a/src/accessor/grib_accessor_class_bits.h +++ b/src/accessor/grib_accessor_class_bits.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bits_h #define eccodes_accessor_bits_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bits_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bits.h.bak b/src/accessor/grib_accessor_class_bits.h.bak new file mode 100644 index 000000000..b5dd2977b --- /dev/null +++ b/src/accessor/grib_accessor_class_bits.h.bak @@ -0,0 +1,45 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bits_h +#define eccodes_accessor_bits_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bits_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bits */ + const char* argument; + long start; + long len; + double referenceValue; + double referenceValuePresent; + double scale; +}; + +class grib_accessor_class_bits_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bits_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bits_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + long byte_count(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bits_h */ diff --git a/src/accessor/grib_accessor_class_bits_per_value.h b/src/accessor/grib_accessor_class_bits_per_value.h index 59514fc05..3d83e07e6 100644 --- a/src/accessor/grib_accessor_class_bits_per_value.h +++ b/src/accessor/grib_accessor_class_bits_per_value.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bits_per_value_h #define eccodes_accessor_bits_per_value_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_bits_per_value_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_bits_per_value.h.bak b/src/accessor/grib_accessor_class_bits_per_value.h.bak new file mode 100644 index 000000000..59514fc05 --- /dev/null +++ b/src/accessor/grib_accessor_class_bits_per_value.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bits_per_value_h +#define eccodes_accessor_bits_per_value_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_bits_per_value_t : public grib_accessor_long_t +{ +public: + /* Members defined in bits_per_value */ + const char* values; + const char* bits_per_value; +}; + +class grib_accessor_class_bits_per_value_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_bits_per_value_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bits_per_value_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bits_per_value_h */ diff --git a/src/accessor/grib_accessor_class_blob.h b/src/accessor/grib_accessor_class_blob.h index a2da98a03..d0dc4b290 100644 --- a/src/accessor/grib_accessor_class_blob.h +++ b/src/accessor/grib_accessor_class_blob.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_blob_h #define eccodes_accessor_blob_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_blob_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_blob.h.bak b/src/accessor/grib_accessor_class_blob.h.bak new file mode 100644 index 000000000..a2da98a03 --- /dev/null +++ b/src/accessor/grib_accessor_class_blob.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_blob_h +#define eccodes_accessor_blob_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_blob_t : public grib_accessor_gen_t +{ +public: + /* Members defined in blob */ +}; + +class grib_accessor_class_blob_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_blob_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_blob_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_blob_h */ diff --git a/src/accessor/grib_accessor_class_budgdate.h b/src/accessor/grib_accessor_class_budgdate.h index c3fc849c7..d5a75ffe1 100644 --- a/src/accessor/grib_accessor_class_budgdate.h +++ b/src/accessor/grib_accessor_class_budgdate.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_budgdate_h #define eccodes_accessor_budgdate_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_budgdate_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_budgdate.h.bak b/src/accessor/grib_accessor_class_budgdate.h.bak new file mode 100644 index 000000000..c3fc849c7 --- /dev/null +++ b/src/accessor/grib_accessor_class_budgdate.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_budgdate_h +#define eccodes_accessor_budgdate_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_budgdate_t : public grib_accessor_long_t +{ +public: + /* Members defined in budgdate */ + const char* year; + const char* month; + const char* day; +}; + +class grib_accessor_class_budgdate_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_budgdate_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_budgdate_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_budgdate_h */ diff --git a/src/accessor/grib_accessor_class_bufr_data_array.h.bak b/src/accessor/grib_accessor_class_bufr_data_array.h.bak new file mode 100644 index 000000000..c6089fa63 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_data_array.h.bak @@ -0,0 +1,92 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_data_array_h +#define eccodes_accessor_bufr_data_array_h + +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_data_array_t : public grib_accessor_gen_t +{ +public: + const char* bufrDataEncodedName; + const char* numberOfSubsetsName; + const char* expandedDescriptorsName; + const char* flagsName; + const char* unitsName; + const char* elementsDescriptorsIndexName; + const char* compressedDataName; + bufr_descriptors_array* expanded; + grib_accessor* expandedAccessor; + int* canBeMissing; + long numberOfSubsets; + long compressedData; + grib_vdarray* numericValues; + grib_vsarray* stringValues; + grib_viarray* elementsDescriptorsIndex; + int do_decode; + int bitmapStartElementsDescriptorsIndex; + int bitmapCurrentElementsDescriptorsIndex; + int bitmapSize; + int bitmapStart; + int bitmapCurrent; + grib_accessors_list* dataAccessors; + int unpackMode; + int bitsToEndData; + grib_section* dataKeys; + double* inputBitmap; + int nInputBitmap; + int iInputBitmap; + long* inputReplications; + int nInputReplications; + int iInputReplications; + long* inputExtendedReplications; + int nInputExtendedReplications; + int iInputExtendedReplications; + long* inputShortReplications; + int nInputShortReplications; + int iInputShortReplications; + grib_iarray* iss_list; + grib_trie_with_rank* dataAccessorsTrie; + grib_sarray* tempStrings; + grib_vdarray* tempDoubleValues; + int change_ref_value_operand; + size_t refValListSize; + long* refValList; + long refValIndex; + bufr_tableb_override* tableb_override; + int set_to_missing_if_out_of_range; +}; + +class grib_accessor_class_bufr_data_array_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_data_array_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_data_array_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; + +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); + +#endif /* eccodes_accessor_bufr_data_array_h */ diff --git a/src/accessor/grib_accessor_class_bufr_data_element.h b/src/accessor/grib_accessor_class_bufr_data_element.h index 6cba5b91c..a8766df47 100644 --- a/src/accessor/grib_accessor_class_bufr_data_element.h +++ b/src/accessor/grib_accessor_class_bufr_data_element.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bufr_data_element_h #define eccodes_accessor_bufr_data_element_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_data_element_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_data_element.h.bak b/src/accessor/grib_accessor_class_bufr_data_element.h.bak new file mode 100644 index 000000000..6cba5b91c --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_data_element.h.bak @@ -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. + */ + +#ifndef eccodes_accessor_bufr_data_element_h +#define eccodes_accessor_bufr_data_element_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_data_element_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_data_element */ + long index; + int type; + long compressedData; + long subsetNumber; + long numberOfSubsets; + bufr_descriptors_array* descriptors; + grib_vdarray* numericValues; + grib_vsarray* stringValues; + grib_viarray* elementsDescriptorsIndex; + char* cname; +}; + +class grib_accessor_class_bufr_data_element_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_data_element_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_data_element_t{}; } + int get_native_type(grib_accessor*) override; + int pack_missing(grib_accessor*) override; + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int pack_string_array(grib_accessor*, const char**, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; +}; +#endif /* eccodes_accessor_bufr_data_element_h */ diff --git a/src/accessor/grib_accessor_class_bufr_elements_table.h b/src/accessor/grib_accessor_class_bufr_elements_table.h index 8ddd8a824..1149b2ad3 100644 --- a/src/accessor/grib_accessor_class_bufr_elements_table.h +++ b/src/accessor/grib_accessor_class_bufr_elements_table.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bufr_elements_table_h #define eccodes_accessor_bufr_elements_table_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_elements_table_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_elements_table.h.bak b/src/accessor/grib_accessor_class_bufr_elements_table.h.bak new file mode 100644 index 000000000..8ddd8a824 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_elements_table.h.bak @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_elements_table_h +#define eccodes_accessor_bufr_elements_table_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_elements_table_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_elements_table */ + const char* dictionary; + const char* masterDir; + const char* localDir; +}; + +class grib_accessor_class_bufr_elements_table_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_elements_table_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_elements_table_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_elements_table_h */ diff --git a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h index d079f958e..f2e8b0ba2 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h +++ b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bufr_extract_area_subsets_h #define eccodes_accessor_bufr_extract_area_subsets_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_extract_area_subsets_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h.bak b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h.bak new file mode 100644 index 000000000..d079f958e --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h.bak @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_extract_area_subsets_h +#define eccodes_accessor_bufr_extract_area_subsets_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_extract_area_subsets_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_extract_area_subsets */ + const char* doExtractSubsets; + const char* numberOfSubsets; + const char* extractSubsetList; + const char* extractAreaWestLongitude; + const char* extractAreaEastLongitude; + const char* extractAreaNorthLatitude; + const char* extractAreaSouthLatitude; + const char* extractAreaLongitudeRank; + const char* extractAreaLatitudeRank; + const char* extractedAreaNumberOfSubsets; +}; + +class grib_accessor_class_bufr_extract_area_subsets_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_extract_area_subsets_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_extract_area_subsets_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_extract_area_subsets_h */ diff --git a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h index 7acfd35b3..3f7c505e0 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h +++ b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bufr_extract_datetime_subsets_h #define eccodes_accessor_bufr_extract_datetime_subsets_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_extract_datetime_subsets_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h.bak b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h.bak new file mode 100644 index 000000000..7acfd35b3 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_extract_datetime_subsets_h +#define eccodes_accessor_bufr_extract_datetime_subsets_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_extract_datetime_subsets_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_extract_datetime_subsets */ + const char* doExtractSubsets; + const char* numberOfSubsets; + const char* extractSubsetList; +}; + +class grib_accessor_class_bufr_extract_datetime_subsets_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_extract_datetime_subsets_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_extract_datetime_subsets_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_extract_datetime_subsets_h */ diff --git a/src/accessor/grib_accessor_class_bufr_extract_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_subsets.h index 80392338d..736206c08 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_subsets.h +++ b/src/accessor/grib_accessor_class_bufr_extract_subsets.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bufr_extract_subsets_h #define eccodes_accessor_bufr_extract_subsets_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_extract_subsets_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_extract_subsets.h.bak b/src/accessor/grib_accessor_class_bufr_extract_subsets.h.bak new file mode 100644 index 000000000..80392338d --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_extract_subsets.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_extract_subsets_h +#define eccodes_accessor_bufr_extract_subsets_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_extract_subsets_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_extract_subsets */ + const char* numericValues; + const char* pack; + grib_accessor* numericValuesAccessor; + grib_accessor* packAccessor; +}; + +class grib_accessor_class_bufr_extract_subsets_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_extract_subsets_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_extract_subsets_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_extract_subsets_h */ diff --git a/src/accessor/grib_accessor_class_bufr_group.h b/src/accessor/grib_accessor_class_bufr_group.h index 3bd71690f..c225cfe2d 100644 --- a/src/accessor/grib_accessor_class_bufr_group.h +++ b/src/accessor/grib_accessor_class_bufr_group.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bufr_group_h #define eccodes_accessor_bufr_group_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_variable.h" class grib_accessor_bufr_group_t : public grib_accessor_variable_t diff --git a/src/accessor/grib_accessor_class_bufr_group.h.bak b/src/accessor/grib_accessor_class_bufr_group.h.bak new file mode 100644 index 000000000..3bd71690f --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_group.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_group_h +#define eccodes_accessor_bufr_group_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_variable.h" + +class grib_accessor_bufr_group_t : public grib_accessor_variable_t +{ +public: + /* Members defined in bufr_group */ +}; + +class grib_accessor_class_bufr_group_t : public grib_accessor_class_variable_t +{ +public: + grib_accessor_class_bufr_group_t(const char* name) : grib_accessor_class_variable_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_group_t{}; } + void dump(grib_accessor*, grib_dumper*) override; + grib_accessor* next(grib_accessor* a, int explore) override; +}; +#endif /* eccodes_accessor_bufr_group_h */ diff --git a/src/accessor/grib_accessor_class_bufr_simple_thinning.h b/src/accessor/grib_accessor_class_bufr_simple_thinning.h index eb786f966..6971e5edb 100644 --- a/src/accessor/grib_accessor_class_bufr_simple_thinning.h +++ b/src/accessor/grib_accessor_class_bufr_simple_thinning.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bufr_simple_thinning_h #define eccodes_accessor_bufr_simple_thinning_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_simple_thinning_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_simple_thinning.h.bak b/src/accessor/grib_accessor_class_bufr_simple_thinning.h.bak new file mode 100644 index 000000000..eb786f966 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_simple_thinning.h.bak @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_simple_thinning_h +#define eccodes_accessor_bufr_simple_thinning_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bufr_simple_thinning_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bufr_simple_thinning */ + const char* doExtractSubsets; + const char* numberOfSubsets; + const char* extractSubsetList; + const char* simpleThinningStart; + const char* simpleThinningMissingRadius; + const char* simpleThinningSkip; +}; + +class grib_accessor_class_bufr_simple_thinning_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bufr_simple_thinning_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_simple_thinning_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_simple_thinning_h */ diff --git a/src/accessor/grib_accessor_class_bufr_string_values.h b/src/accessor/grib_accessor_class_bufr_string_values.h index 9038a8d73..2262990a7 100644 --- a/src/accessor/grib_accessor_class_bufr_string_values.h +++ b/src/accessor/grib_accessor_class_bufr_string_values.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bufr_string_values_h #define eccodes_accessor_bufr_string_values_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_bufr_string_values_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_bufr_string_values.h.bak b/src/accessor/grib_accessor_class_bufr_string_values.h.bak new file mode 100644 index 000000000..9038a8d73 --- /dev/null +++ b/src/accessor/grib_accessor_class_bufr_string_values.h.bak @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufr_string_values_h +#define eccodes_accessor_bufr_string_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_bufr_string_values_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in bufr_string_values */ + const char* dataAccessorName; + grib_accessor* dataAccessor; +}; + +class grib_accessor_class_bufr_string_values_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_bufr_string_values_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_string_values_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufr_string_values_h */ diff --git a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h index 588f9d08b..9d8f551b2 100644 --- a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h +++ b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bufrdc_expanded_descriptors_h #define eccodes_accessor_bufrdc_expanded_descriptors_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_bufrdc_expanded_descriptors_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h.bak b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h.bak new file mode 100644 index 000000000..588f9d08b --- /dev/null +++ b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bufrdc_expanded_descriptors_h +#define eccodes_accessor_bufrdc_expanded_descriptors_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_bufrdc_expanded_descriptors_t : public grib_accessor_long_t +{ +public: + /* Members defined in bufrdc_expanded_descriptors */ + const char* expandedDescriptors; + grib_accessor* expandedDescriptorsAccessor; +}; + +class grib_accessor_class_bufrdc_expanded_descriptors_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_bufrdc_expanded_descriptors_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bufrdc_expanded_descriptors_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_bufrdc_expanded_descriptors_h */ diff --git a/src/accessor/grib_accessor_class_bytes.h b/src/accessor/grib_accessor_class_bytes.h index 8204ceba7..ee72f13c3 100644 --- a/src/accessor/grib_accessor_class_bytes.h +++ b/src/accessor/grib_accessor_class_bytes.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_bytes_h #define eccodes_accessor_bytes_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bytes_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bytes.h.bak b/src/accessor/grib_accessor_class_bytes.h.bak new file mode 100644 index 000000000..8204ceba7 --- /dev/null +++ b/src/accessor/grib_accessor_class_bytes.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_bytes_h +#define eccodes_accessor_bytes_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_bytes_t : public grib_accessor_gen_t +{ +public: + /* Members defined in bytes */ +}; + +class grib_accessor_class_bytes_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_bytes_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_bytes_t{}; } + int get_native_type(grib_accessor*) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_bytes_h */ diff --git a/src/accessor/grib_accessor_class_change_alternative_row_scanning.h b/src/accessor/grib_accessor_class_change_alternative_row_scanning.h index c893e242f..3caca2a6b 100644 --- a/src/accessor/grib_accessor_class_change_alternative_row_scanning.h +++ b/src/accessor/grib_accessor_class_change_alternative_row_scanning.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_change_alternative_row_scanning_h #define eccodes_accessor_change_alternative_row_scanning_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_change_alternative_row_scanning_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_change_alternative_row_scanning.h.bak b/src/accessor/grib_accessor_class_change_alternative_row_scanning.h.bak new file mode 100644 index 000000000..c893e242f --- /dev/null +++ b/src/accessor/grib_accessor_class_change_alternative_row_scanning.h.bak @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_change_alternative_row_scanning_h +#define eccodes_accessor_change_alternative_row_scanning_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_change_alternative_row_scanning_t : public grib_accessor_gen_t +{ +public: + /* Members defined in change_alternative_row_scanning */ + const char* values; + const char* Ni; + const char* Nj; + const char* alternativeRowScanning; +}; + +class grib_accessor_class_change_alternative_row_scanning_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_change_alternative_row_scanning_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_change_alternative_row_scanning_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_change_alternative_row_scanning_h */ diff --git a/src/accessor/grib_accessor_class_change_scanning_direction.h b/src/accessor/grib_accessor_class_change_scanning_direction.h index 08f2ceb55..7d8ac8d6a 100644 --- a/src/accessor/grib_accessor_class_change_scanning_direction.h +++ b/src/accessor/grib_accessor_class_change_scanning_direction.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_change_scanning_direction_h #define eccodes_accessor_change_scanning_direction_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_change_scanning_direction_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_change_scanning_direction.h.bak b/src/accessor/grib_accessor_class_change_scanning_direction.h.bak new file mode 100644 index 000000000..08f2ceb55 --- /dev/null +++ b/src/accessor/grib_accessor_class_change_scanning_direction.h.bak @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_change_scanning_direction_h +#define eccodes_accessor_change_scanning_direction_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_change_scanning_direction_t : public grib_accessor_gen_t +{ +public: + /* Members defined in change_scanning_direction */ + const char* values; + const char* Ni; + const char* Nj; + const char* i_scans_negatively; + const char* j_scans_positively; + const char* first; + const char* last; + const char* axis; +}; + +class grib_accessor_class_change_scanning_direction_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_change_scanning_direction_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_change_scanning_direction_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_change_scanning_direction_h */ diff --git a/src/accessor/grib_accessor_class_check_internal_version.h b/src/accessor/grib_accessor_class_check_internal_version.h index 871f5a56e..222ec76ab 100644 --- a/src/accessor/grib_accessor_class_check_internal_version.h +++ b/src/accessor/grib_accessor_class_check_internal_version.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_check_internal_version_h #define eccodes_accessor_check_internal_version_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_check_internal_version_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_check_internal_version.h.bak b/src/accessor/grib_accessor_class_check_internal_version.h.bak new file mode 100644 index 000000000..871f5a56e --- /dev/null +++ b/src/accessor/grib_accessor_class_check_internal_version.h.bak @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_check_internal_version_h +#define eccodes_accessor_check_internal_version_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_check_internal_version_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in check_internal_version */ +}; + +class grib_accessor_class_check_internal_version_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_check_internal_version_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_check_internal_version_t{}; } + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_check_internal_version_h */ diff --git a/src/accessor/grib_accessor_class_closest_date.h b/src/accessor/grib_accessor_class_closest_date.h index b4fbace12..be6d3aa98 100644 --- a/src/accessor/grib_accessor_class_closest_date.h +++ b/src/accessor/grib_accessor_class_closest_date.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_closest_date_h #define eccodes_accessor_closest_date_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_closest_date_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_closest_date.h.bak b/src/accessor/grib_accessor_class_closest_date.h.bak new file mode 100644 index 000000000..b4fbace12 --- /dev/null +++ b/src/accessor/grib_accessor_class_closest_date.h.bak @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_closest_date_h +#define eccodes_accessor_closest_date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_closest_date_t : public grib_accessor_double_t +{ +public: + /* Members defined in closest_date */ + const char *dateLocal; + const char *timeLocal; + const char *numForecasts; + const char *year; + const char *month; + const char *day; + const char *hour; + const char *minute; + const char *second; +}; + +class grib_accessor_class_closest_date_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_closest_date_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_closest_date_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_closest_date_h */ diff --git a/src/accessor/grib_accessor_class_codeflag.h b/src/accessor/grib_accessor_class_codeflag.h index 734369b74..f74af599a 100644 --- a/src/accessor/grib_accessor_class_codeflag.h +++ b/src/accessor/grib_accessor_class_codeflag.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_codeflag_h #define eccodes_accessor_codeflag_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_codeflag_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_codeflag.h.bak b/src/accessor/grib_accessor_class_codeflag.h.bak new file mode 100644 index 000000000..734369b74 --- /dev/null +++ b/src/accessor/grib_accessor_class_codeflag.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_codeflag_h +#define eccodes_accessor_codeflag_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_codeflag_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in codeflag */ + const char* tablename; +}; + +class grib_accessor_class_codeflag_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_codeflag_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_codeflag_t{}; } + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_codeflag_h */ diff --git a/src/accessor/grib_accessor_class_codetable.h b/src/accessor/grib_accessor_class_codetable.h index c77c6f72d..48ae07502 100644 --- a/src/accessor/grib_accessor_class_codetable.h +++ b/src/accessor/grib_accessor_class_codetable.h @@ -14,7 +14,7 @@ #pragma once -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" #include diff --git a/src/accessor/grib_accessor_class_codetable.h.bak b/src/accessor/grib_accessor_class_codetable.h.bak new file mode 100644 index 000000000..c77c6f72d --- /dev/null +++ b/src/accessor/grib_accessor_class_codetable.h.bak @@ -0,0 +1,47 @@ +/* + * (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. + */ + +/***************************************** + * Enrico Fucile + ****************************************/ + +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" +#include + + +class grib_accessor_codetable_t : public grib_accessor_unsigned_t +{ +public: + const char* tablename; + const char* masterDir; + const char* localDir; + grib_codetable* table; + int table_loaded; +}; + +class grib_accessor_class_codetable_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor* create_empty_accessor() override { return new grib_accessor_codetable_t{}; } + grib_accessor_class_codetable_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + int get_native_type(grib_accessor*) override; + int pack_missing(grib_accessor*) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int pack_expression(grib_accessor*, grib_expression*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; diff --git a/src/accessor/grib_accessor_class_codetable_title.h b/src/accessor/grib_accessor_class_codetable_title.h index e115a9c28..873b3e0a1 100644 --- a/src/accessor/grib_accessor_class_codetable_title.h +++ b/src/accessor/grib_accessor_class_codetable_title.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_codetable_title_h #define eccodes_accessor_codetable_title_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_codetable_title_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_codetable_title.h.bak b/src/accessor/grib_accessor_class_codetable_title.h.bak new file mode 100644 index 000000000..e115a9c28 --- /dev/null +++ b/src/accessor/grib_accessor_class_codetable_title.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_codetable_title_h +#define eccodes_accessor_codetable_title_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_codetable_title_t : public grib_accessor_gen_t +{ +public: + /* Members defined in codetable_title */ + const char* codetable; +}; + +class grib_accessor_class_codetable_title_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_codetable_title_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_codetable_title_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_codetable_title_h */ diff --git a/src/accessor/grib_accessor_class_codetable_units.h b/src/accessor/grib_accessor_class_codetable_units.h index b5cfb75c8..913afb1d2 100644 --- a/src/accessor/grib_accessor_class_codetable_units.h +++ b/src/accessor/grib_accessor_class_codetable_units.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_codetable_units_h #define eccodes_accessor_codetable_units_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_codetable_units_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_codetable_units.h.bak b/src/accessor/grib_accessor_class_codetable_units.h.bak new file mode 100644 index 000000000..b5cfb75c8 --- /dev/null +++ b/src/accessor/grib_accessor_class_codetable_units.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_codetable_units_h +#define eccodes_accessor_codetable_units_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_codetable_units_t : public grib_accessor_gen_t +{ +public: + /* Members defined in codetable_units */ + const char* codetable; +}; + +class grib_accessor_class_codetable_units_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_codetable_units_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_codetable_units_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_codetable_units_h */ diff --git a/src/accessor/grib_accessor_class_concept.h b/src/accessor/grib_accessor_class_concept.h index 99405ed48..436e5b95e 100644 --- a/src/accessor/grib_accessor_class_concept.h +++ b/src/accessor/grib_accessor_class_concept.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_concept_h #define eccodes_accessor_concept_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_concept_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_concept.h.bak b/src/accessor/grib_accessor_class_concept.h.bak new file mode 100644 index 000000000..99405ed48 --- /dev/null +++ b/src/accessor/grib_accessor_class_concept.h.bak @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_concept_h +#define eccodes_accessor_concept_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_concept_t : public grib_accessor_gen_t +{ +public: + /* Members defined in concept */ +}; + +class grib_accessor_class_concept_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_concept_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_concept_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_concept_h */ diff --git a/src/accessor/grib_accessor_class_constant.h b/src/accessor/grib_accessor_class_constant.h index 0c4944c68..029c51e79 100644 --- a/src/accessor/grib_accessor_class_constant.h +++ b/src/accessor/grib_accessor_class_constant.h @@ -13,7 +13,7 @@ * Enrico Fucile **************************************/ -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_variable.h" class grib_accessor_constant_t : public grib_accessor_variable_t {}; diff --git a/src/accessor/grib_accessor_class_constant.h.bak b/src/accessor/grib_accessor_class_constant.h.bak new file mode 100644 index 000000000..0c4944c68 --- /dev/null +++ b/src/accessor/grib_accessor_class_constant.h.bak @@ -0,0 +1,27 @@ +/* + * (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. + */ + + +/************************************* + * Enrico Fucile + **************************************/ + +#include "../grib_api_internal.h" +#include "grib_accessor_class_variable.h" + +class grib_accessor_constant_t : public grib_accessor_variable_t {}; + +class grib_accessor_class_constant_t : public grib_accessor_class_variable_t +{ +public: + grib_accessor_class_constant_t(const char* name) : grib_accessor_class_variable_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_constant_t{}; } + void init(grib_accessor*, const long, grib_arguments*) override; +}; diff --git a/src/accessor/grib_accessor_class_count_file.h b/src/accessor/grib_accessor_class_count_file.h index 4b9a0b4f0..fd2251045 100644 --- a/src/accessor/grib_accessor_class_count_file.h +++ b/src/accessor/grib_accessor_class_count_file.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_count_file_h #define eccodes_accessor_count_file_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_count_file_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_count_file.h.bak b/src/accessor/grib_accessor_class_count_file.h.bak new file mode 100644 index 000000000..4b9a0b4f0 --- /dev/null +++ b/src/accessor/grib_accessor_class_count_file.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_count_file_h +#define eccodes_accessor_count_file_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_count_file_t : public grib_accessor_long_t +{ +public: + /* Members defined in count_file */ +}; + +class grib_accessor_class_count_file_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_count_file_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_count_file_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_count_file_h */ diff --git a/src/accessor/grib_accessor_class_count_missing.h b/src/accessor/grib_accessor_class_count_missing.h index fbf583109..d43c6f22e 100644 --- a/src/accessor/grib_accessor_class_count_missing.h +++ b/src/accessor/grib_accessor_class_count_missing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_count_missing_h #define eccodes_accessor_count_missing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_count_missing_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_count_missing.h.bak b/src/accessor/grib_accessor_class_count_missing.h.bak new file mode 100644 index 000000000..fbf583109 --- /dev/null +++ b/src/accessor/grib_accessor_class_count_missing.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_count_missing_h +#define eccodes_accessor_count_missing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_count_missing_t : public grib_accessor_long_t +{ +public: + /* Members defined in count_missing */ + const char* bitmap; + const char* unusedBitsInBitmap; + const char* numberOfDataPoints; + const char* missingValueManagementUsed; +}; + +class grib_accessor_class_count_missing_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_count_missing_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_count_missing_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_count_missing_h */ diff --git a/src/accessor/grib_accessor_class_count_total.h b/src/accessor/grib_accessor_class_count_total.h index ab044e8a9..9c242b5c6 100644 --- a/src/accessor/grib_accessor_class_count_total.h +++ b/src/accessor/grib_accessor_class_count_total.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_count_total_h #define eccodes_accessor_count_total_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_count_total_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_count_total.h.bak b/src/accessor/grib_accessor_class_count_total.h.bak new file mode 100644 index 000000000..ab044e8a9 --- /dev/null +++ b/src/accessor/grib_accessor_class_count_total.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_count_total_h +#define eccodes_accessor_count_total_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_count_total_t : public grib_accessor_long_t +{ +public: + /* Members defined in count_total */ +}; + +class grib_accessor_class_count_total_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_count_total_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_count_total_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_count_total_h */ diff --git a/src/accessor/grib_accessor_class_data_apply_bitmap.h b/src/accessor/grib_accessor_class_data_apply_bitmap.h index b2516ec4e..9e5e2955e 100644 --- a/src/accessor/grib_accessor_class_data_apply_bitmap.h +++ b/src/accessor/grib_accessor_class_data_apply_bitmap.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_apply_bitmap_h #define eccodes_accessor_data_apply_bitmap_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_data_apply_bitmap_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_data_apply_bitmap.h.bak b/src/accessor/grib_accessor_class_data_apply_bitmap.h.bak new file mode 100644 index 000000000..b2516ec4e --- /dev/null +++ b/src/accessor/grib_accessor_class_data_apply_bitmap.h.bak @@ -0,0 +1,132 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_apply_bitmap_h +#define eccodes_accessor_data_apply_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_data_apply_bitmap_t : public grib_accessor_gen_t +{ +public: + /* 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; +}; + +class grib_accessor_class_data_apply_bitmap_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_data_apply_bitmap_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_apply_bitmap_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; + +private: + template int unpack(grib_accessor*, T*, size_t*); +}; + + +template +int grib_accessor_class_data_apply_bitmap_t::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_t* self = (grib_accessor_data_apply_bitmap_t*)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 = a->value_count(&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", + __func__, + 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, __func__, coded_n_vals, n_vals); + + return GRIB_ARRAY_TOO_SMALL; + } + } + } + + *len = n_vals; + + grib_context_free(a->context, coded_vals); + return err; +} + +#endif /* eccodes_accessor_data_apply_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h.bak b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h.bak new file mode 100644 index 000000000..9b101e7ed --- /dev/null +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h.bak @@ -0,0 +1,41 @@ + +/* + * (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. + */ + +#pragma once + +#include "grib_accessor_class_gen.h" + +class grib_accessor_data_apply_boustrophedonic_t : public grib_accessor_gen_t +{ +public: + /* Members defined in data_apply_boustrophedonic */ + const char* values; + const char* numberOfRows; + const char* numberOfColumns; + const char* numberOfPoints; + const char* pl; +}; + +class grib_accessor_class_data_apply_boustrophedonic_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_data_apply_boustrophedonic_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_apply_boustrophedonic_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h index e92299eab..c03416060 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_apply_boustrophedonic_bitmap_h #define eccodes_accessor_data_apply_boustrophedonic_bitmap_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_data_apply_boustrophedonic_bitmap_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h.bak b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h.bak new file mode 100644 index 000000000..e92299eab --- /dev/null +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h.bak @@ -0,0 +1,45 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_apply_boustrophedonic_bitmap_h +#define eccodes_accessor_data_apply_boustrophedonic_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_data_apply_boustrophedonic_bitmap_t : public grib_accessor_gen_t +{ +public: + /* Members defined in data_apply_boustrophedonic_bitmap */ + const char* coded_values; + const char* bitmap; + const char* missing_value; + const char* binary_scale_factor; + const char* numberOfRows; + const char* numberOfColumns; + const char* numberOfPoints; +}; + +class grib_accessor_class_data_apply_boustrophedonic_bitmap_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_data_apply_boustrophedonic_bitmap_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_apply_boustrophedonic_bitmap_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_apply_boustrophedonic_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.h.bak b/src/accessor/grib_accessor_class_data_ccsds_packing.h.bak new file mode 100644 index 000000000..19889e937 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.h.bak @@ -0,0 +1,203 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_ccsds_packing_h +#define eccodes_accessor_data_ccsds_packing_h + +#include "grib_accessor_class_values.h" +#include "grib_scaling.h" + +#if defined(HAVE_LIBAEC) || defined(HAVE_AEC) +#include +#endif + +#ifndef LIBAEC_DLL_EXPORTED + #error Version of libaec appears to be too old. Please upgrade. +#endif + +class grib_accessor_data_ccsds_packing_t : public grib_accessor_values_t +{ +public: + /* 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* optimize_scaling_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; +}; + + + +// TODO(maee): if libaec is not available, this class should not be defined +class grib_accessor_class_data_ccsds_packing_t : public grib_accessor_class_values_t +{ +public: + grib_accessor_class_data_ccsds_packing_t(const char* name) : grib_accessor_class_values_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_ccsds_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; + +private: + template int unpack(grib_accessor*, T*, size_t* ); + void print_aec_stream_info(struct aec_stream*, const char*); + void modify_aec_flags(long*); + const char* aec_get_error_message(int); + bool is_big_endian(); +}; + + +template +int grib_accessor_class_data_ccsds_packing_t::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_t* self = (grib_accessor_data_ccsds_packing_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + const char* cclass_name = a->cclass->name; + + 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 nn = 0; + + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + double reference_value = 0; + long bits_per_value = 0; + + long ccsds_flags; + long ccsds_block_size; + long ccsds_rsi; + size_t nbytes; + + self->dirty = 0; + + if ((err = a->value_count(&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; + + modify_aec_flags(&ccsds_flags); + + // TODO(masn): 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 = codes_power(binary_scale_factor, 2); + dscale = codes_power(-decimal_scale_factor, 10); + + buflen = a->byte_count(); buf = (unsigned char*)hand->buffer->data; + buf += a->byte_offset(); + 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; + + nbytes = (bits_per_value + 7) / 8; + if (nbytes == 3) + nbytes = 4; + + size = n_vals * nbytes; + 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, "%s %s: aec_buffer_decode error %d (%s)", + cclass_name, __func__, err, aec_get_error_message(err)); + err = GRIB_DECODING_ERROR; + goto cleanup; + } + + // ECC-1427: Performance improvement (replaced by ECC-1602) + //grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); + + // ECC-1602: Performance improvement + switch (nbytes) { + case 1: + for (i = 0; i < n_vals; i++) { + val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; + } + break; + case 2: + for (i = 0; i < n_vals; i++) { + val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; + } + break; + case 4: + for (i = 0; i < n_vals; i++) { + val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; + } + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, "%s %s: unpacking %s, bits_per_value=%ld (max 32)", + cclass_name, __func__, a->name, bits_per_value); + err = GRIB_INVALID_BPV; + goto cleanup; + } + + *len = n_vals; + +cleanup: + grib_context_buffer_free(a->context, decoded); + return err; +} + +#endif /* eccodes_accessor_data_ccsds_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_complex_packing.h.bak b/src/accessor/grib_accessor_class_data_complex_packing.h.bak new file mode 100644 index 000000000..d588eef38 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_complex_packing.h.bak @@ -0,0 +1,272 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_complex_packing_h +#define eccodes_accessor_data_complex_packing_h + +#include "grib_accessor_class_data_simple_packing.h" +#include "grib_scaling.h" +#include "grib_ieeefloat.h" + +typedef unsigned long (*encode_float_proc)(double); +typedef double (*decode_float_proc)(unsigned long); + +class grib_accessor_data_complex_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* 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; +}; + +class grib_accessor_class_data_complex_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_complex_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_complex_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + +private: + template int unpack(grib_accessor*, T*, size_t*); +}; + +template +int grib_accessor_class_data_complex_packing_t::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_t* self = (grib_accessor_data_complex_packing_t*)a; + grib_handle* gh = grib_handle_of_accessor(a); + const char* cclass_name = a->cclass->name; + + 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; + + T s = 0; + T d = 0; + T 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; + T 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; + double tmp; + + decode_float_proc decode_float = NULL; + + err = a->value_count(&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, &tmp)) != GRIB_SUCCESS) + return ret; + reference_value = tmp; + 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, &tmp)) != GRIB_SUCCESS) + return ret; + laplacianOperator = tmp; + + 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; + } + + if (sub_j != sub_k || sub_j != sub_m || pen_j != pen_k || pen_j != pen_m) { + grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Invalid pentagonal resolution parameters", cclass_name); + return GRIB_DECODING_ERROR; + } + + buf = (unsigned char*)gh->buffer->data; + + maxv = pen_j + 1; + + buf += a->byte_offset(); hres = buf; + lres = buf; + + if (pen_j == sub_j) { + n_vals = (pen_j + 1) * (pen_j + 2); + d = codes_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 = a->byte_offset() + bytes * (sub_k + 1) * (sub_k + 2); + lpos = 8 * (packed_offset - offsetdata); + + s = codes_power(binary_scale_factor, 2); + d = codes_power(-decimal_scale_factor, 10); + + scals = (T*)grib_context_malloc(a->context, maxv * sizeof(T)); + if (!scals) return GRIB_OUT_OF_MEMORY; + + 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, + "%s: Problem with operator div by zero at index %d of %d", cclass_name, 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; +} + +#endif /* eccodes_accessor_data_complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_dummy_field.h b/src/accessor/grib_accessor_class_data_dummy_field.h index 00de1fe73..31d6d27b8 100644 --- a/src/accessor/grib_accessor_class_data_dummy_field.h +++ b/src/accessor/grib_accessor_class_data_dummy_field.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_dummy_field_h #define eccodes_accessor_data_dummy_field_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_g1simple_packing.h" class grib_accessor_data_dummy_field_t : public grib_accessor_data_g1simple_packing_t diff --git a/src/accessor/grib_accessor_class_data_dummy_field.h.bak b/src/accessor/grib_accessor_class_data_dummy_field.h.bak new file mode 100644 index 000000000..00de1fe73 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_dummy_field.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_dummy_field_h +#define eccodes_accessor_data_dummy_field_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_g1simple_packing.h" + +class grib_accessor_data_dummy_field_t : public grib_accessor_data_g1simple_packing_t +{ +public: + /* Members defined in data_dummy_field */ + const char* missing_value; + const char* numberOfPoints; + const char* bitmap; +}; + +class grib_accessor_class_data_dummy_field_t : public grib_accessor_class_data_g1simple_packing_t +{ +public: + grib_accessor_class_data_dummy_field_t(const char* name) : grib_accessor_class_data_g1simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_dummy_field_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_dummy_field_h */ diff --git a/src/accessor/grib_accessor_class_data_g1complex_packing.h b/src/accessor/grib_accessor_class_data_g1complex_packing.h index cc6208c95..a3c916606 100644 --- a/src/accessor/grib_accessor_class_data_g1complex_packing.h +++ b/src/accessor/grib_accessor_class_data_g1complex_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_g1complex_packing_h #define eccodes_accessor_data_g1complex_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_complex_packing.h" class grib_accessor_data_g1complex_packing_t : public grib_accessor_data_complex_packing_t diff --git a/src/accessor/grib_accessor_class_data_g1complex_packing.h.bak b/src/accessor/grib_accessor_class_data_g1complex_packing.h.bak new file mode 100644 index 000000000..cc6208c95 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1complex_packing.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1complex_packing_h +#define eccodes_accessor_data_g1complex_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_complex_packing.h" + +class grib_accessor_data_g1complex_packing_t : public grib_accessor_data_complex_packing_t +{ +public: + /* Members defined in data_g1complex_packing */ + const char* N; + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; +}; + +class grib_accessor_class_data_g1complex_packing_t : public grib_accessor_class_data_complex_packing_t +{ +public: + grib_accessor_class_data_g1complex_packing_t(const char* name) : grib_accessor_class_data_complex_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1complex_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g1complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h index adfc36716..8c190bd12 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_g1second_order_constant_width_packing_h #define eccodes_accessor_data_g1second_order_constant_width_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_g1second_order_constant_width_packing_t : public grib_accessor_data_simple_packing_t diff --git a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h.bak b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h.bak new file mode 100644 index 000000000..adfc36716 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h.bak @@ -0,0 +1,53 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1second_order_constant_width_packing_h +#define eccodes_accessor_data_g1second_order_constant_width_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g1second_order_constant_width_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g1second_order_constant_width_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* pl; + const char* Ni; + const char* Nj; + const char* jPointsAreConsecutive; + const char* bitmap; + const char* groupWidth; +}; + +class grib_accessor_class_data_g1second_order_constant_width_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g1second_order_constant_width_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_constant_width_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_g1second_order_constant_width_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h index 245217f7f..fb2356a4f 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_g1second_order_general_extended_packing_h #define eccodes_accessor_data_g1second_order_general_extended_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_g1second_order_general_extended_packing_t : public grib_accessor_data_simple_packing_t diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h.bak b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h.bak new file mode 100644 index 000000000..245217f7f --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h.bak @@ -0,0 +1,68 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1second_order_general_extended_packing_h +#define eccodes_accessor_data_g1second_order_general_extended_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g1second_order_general_extended_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g1second_order_general_extended_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* firstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* codedNumberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* groupWidths; + const char* widthOfWidths; + const char* groupLengths; + const char* widthOfLengths; + const char* NL; + const char* SPD; + const char* widthOfSPD; + const char* orderOfSPD; + const char* numberOfPoints; + const char* dataFlag; + double* dvalues; + float* fvalues; + int double_dirty; + int float_dirty; + size_t size; +}; + +class grib_accessor_class_data_g1second_order_general_extended_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g1second_order_general_extended_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_general_extended_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; + +private: + int unpack(grib_accessor* a, double*, float*, size_t*); +}; +#endif /* eccodes_accessor_data_g1second_order_general_extended_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h.bak b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h.bak new file mode 100644 index 000000000..2e8bb3620 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h.bak @@ -0,0 +1,49 @@ + +/* + * (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. + */ + +#pragma once + +#include "grib_accessor_class_data_simple_packing.h" +#include "grib_scaling.h" + +class grib_accessor_data_g1second_order_general_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g1second_order_general_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* pl; + const char* Ni; + const char* Nj; + const char* jPointsAreConsecutive; + const char* bitmap; + const char* groupWidths; +}; + +class grib_accessor_class_data_g1second_order_general_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g1second_order_general_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_general_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; diff --git a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h.bak b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h.bak new file mode 100644 index 000000000..9b274a408 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h.bak @@ -0,0 +1,49 @@ + +/* + * (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. + */ + +#pragma once + +#include "grib_accessor_class_data_simple_packing.h" +#include "grib_scaling.h" + +class grib_accessor_data_g1second_order_row_by_row_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g1second_order_row_by_row_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* pl; + const char* Ni; + const char* Nj; + const char* jPointsAreConsecutive; + const char* bitmap; + const char* groupWidths; +}; + +class grib_accessor_class_data_g1second_order_row_by_row_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g1second_order_row_by_row_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_row_by_row_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; diff --git a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h index e963d6f44..d0eaedb55 100644 --- a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h +++ b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_g1secondary_bitmap_h #define eccodes_accessor_data_g1secondary_bitmap_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_secondary_bitmap.h" class grib_accessor_data_g1secondary_bitmap_t : public grib_accessor_data_secondary_bitmap_t diff --git a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h.bak b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h.bak new file mode 100644 index 000000000..e963d6f44 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1secondary_bitmap_h +#define eccodes_accessor_data_g1secondary_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_secondary_bitmap.h" + +class grib_accessor_data_g1secondary_bitmap_t : public grib_accessor_data_secondary_bitmap_t +{ +public: + /* Members defined in data_g1secondary_bitmap */ + const char* number_of_ones; +}; + +class grib_accessor_class_data_g1secondary_bitmap_t : public grib_accessor_class_data_secondary_bitmap_t +{ +public: + grib_accessor_class_data_g1secondary_bitmap_t(const char* name) : grib_accessor_class_data_secondary_bitmap_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1secondary_bitmap_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g1secondary_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_g1shsimple_packing.h b/src/accessor/grib_accessor_class_data_g1shsimple_packing.h index 0c8efffa1..8a212b5df 100644 --- a/src/accessor/grib_accessor_class_data_g1shsimple_packing.h +++ b/src/accessor/grib_accessor_class_data_g1shsimple_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_g1shsimple_packing_h #define eccodes_accessor_data_g1shsimple_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_shsimple_packing.h" class grib_accessor_data_g1shsimple_packing_t : public grib_accessor_data_shsimple_packing_t diff --git a/src/accessor/grib_accessor_class_data_g1shsimple_packing.h.bak b/src/accessor/grib_accessor_class_data_g1shsimple_packing.h.bak new file mode 100644 index 000000000..0c8efffa1 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1shsimple_packing.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1shsimple_packing_h +#define eccodes_accessor_data_g1shsimple_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_shsimple_packing.h" + +class grib_accessor_data_g1shsimple_packing_t : public grib_accessor_data_shsimple_packing_t +{ +public: + /* Members defined in data_g1shsimple_packing */ +}; + +class grib_accessor_class_data_g1shsimple_packing_t : public grib_accessor_class_data_shsimple_packing_t +{ +public: + grib_accessor_class_data_g1shsimple_packing_t(const char* name) : grib_accessor_class_data_shsimple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1shsimple_packing_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; +}; +#endif /* eccodes_accessor_data_g1shsimple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1simple_packing.h b/src/accessor/grib_accessor_class_data_g1simple_packing.h index 3a351d17f..9d210ab63 100644 --- a/src/accessor/grib_accessor_class_data_g1simple_packing.h +++ b/src/accessor/grib_accessor_class_data_g1simple_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_g1simple_packing_h #define eccodes_accessor_data_g1simple_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_g1simple_packing_t : public grib_accessor_data_simple_packing_t diff --git a/src/accessor/grib_accessor_class_data_g1simple_packing.h.bak b/src/accessor/grib_accessor_class_data_g1simple_packing.h.bak new file mode 100644 index 000000000..3a351d17f --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g1simple_packing.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g1simple_packing_h +#define eccodes_accessor_data_g1simple_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g1simple_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g1simple_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; +}; + +class grib_accessor_class_data_g1simple_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g1simple_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1simple_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g1simple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.h.bak b/src/accessor/grib_accessor_class_data_g22order_packing.h.bak new file mode 100644 index 000000000..39d01a70b --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g22order_packing.h.bak @@ -0,0 +1,55 @@ + +/* + * (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. + */ + +#pragma once + +#include "grib_accessor_class_values.h" +#include "grib_scaling.h" + +class grib_accessor_data_g22order_packing_t : public grib_accessor_values_t +{ +public: + /* 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* optimize_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; +}; + +class grib_accessor_class_data_g22order_packing_t : public grib_accessor_class_values_t +{ +public: + grib_accessor_class_data_g22order_packing_t(const char* name) : grib_accessor_class_values_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g22order_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; diff --git a/src/accessor/grib_accessor_class_data_g2bifourier_packing.h b/src/accessor/grib_accessor_class_data_g2bifourier_packing.h index f4033a1ba..1d2838414 100644 --- a/src/accessor/grib_accessor_class_data_g2bifourier_packing.h +++ b/src/accessor/grib_accessor_class_data_g2bifourier_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_g2bifourier_packing_h #define eccodes_accessor_data_g2bifourier_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_g2bifourier_packing_t : public grib_accessor_data_simple_packing_t diff --git a/src/accessor/grib_accessor_class_data_g2bifourier_packing.h.bak b/src/accessor/grib_accessor_class_data_g2bifourier_packing.h.bak new file mode 100644 index 000000000..f4033a1ba --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2bifourier_packing.h.bak @@ -0,0 +1,47 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2bifourier_packing_h +#define eccodes_accessor_data_g2bifourier_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g2bifourier_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_g2bifourier_packing */ + const char* ieee_floats; + const char* laplacianOperatorIsSet; + const char* laplacianOperator; + const char* biFourierTruncationType; + const char* sub_i; + const char* sub_j; + const char* bif_i; + const char* bif_j; + const char* biFourierSubTruncationType; + const char* biFourierDoNotPackAxes; + const char* biFourierMakeTemplate; + const char* totalNumberOfValuesInUnpackedSubset; + const char* numberOfValues; +}; + +class grib_accessor_class_data_g2bifourier_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g2bifourier_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2bifourier_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2bifourier_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2complex_packing.h b/src/accessor/grib_accessor_class_data_g2complex_packing.h index e77b89276..ec7ab213e 100644 --- a/src/accessor/grib_accessor_class_data_g2complex_packing.h +++ b/src/accessor/grib_accessor_class_data_g2complex_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_g2complex_packing_h #define eccodes_accessor_data_g2complex_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_complex_packing.h" class grib_accessor_data_g2complex_packing_t : public grib_accessor_data_complex_packing_t diff --git a/src/accessor/grib_accessor_class_data_g2complex_packing.h.bak b/src/accessor/grib_accessor_class_data_g2complex_packing.h.bak new file mode 100644 index 000000000..e77b89276 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2complex_packing.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2complex_packing_h +#define eccodes_accessor_data_g2complex_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_complex_packing.h" + +class grib_accessor_data_g2complex_packing_t : public grib_accessor_data_complex_packing_t +{ +public: + /* Members defined in data_g2complex_packing */ + const char* numberOfValues; +}; + +class grib_accessor_class_data_g2complex_packing_t : public grib_accessor_class_data_complex_packing_t +{ +public: + grib_accessor_class_data_g2complex_packing_t(const char* name) : grib_accessor_class_data_complex_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2complex_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h index 394c79bfa..abc550a97 100644 --- a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h +++ b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_g2secondary_bitmap_h #define eccodes_accessor_data_g2secondary_bitmap_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_secondary_bitmap.h" class grib_accessor_data_g2secondary_bitmap_t : public grib_accessor_data_secondary_bitmap_t diff --git a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h.bak b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h.bak new file mode 100644 index 000000000..394c79bfa --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2secondary_bitmap_h +#define eccodes_accessor_data_g2secondary_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_secondary_bitmap.h" + +class grib_accessor_data_g2secondary_bitmap_t : public grib_accessor_data_secondary_bitmap_t +{ +public: + /* Members defined in data_g2secondary_bitmap */ + const char* number_of_values; +}; + +class grib_accessor_class_data_g2secondary_bitmap_t : public grib_accessor_class_data_secondary_bitmap_t +{ +public: + grib_accessor_class_data_g2secondary_bitmap_t(const char* name) : grib_accessor_class_data_secondary_bitmap_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2secondary_bitmap_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2secondary_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_g2shsimple_packing.h b/src/accessor/grib_accessor_class_data_g2shsimple_packing.h index 28e7a7c06..30899788b 100644 --- a/src/accessor/grib_accessor_class_data_g2shsimple_packing.h +++ b/src/accessor/grib_accessor_class_data_g2shsimple_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_g2shsimple_packing_h #define eccodes_accessor_data_g2shsimple_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_shsimple_packing.h" class grib_accessor_data_g2shsimple_packing_t : public grib_accessor_data_shsimple_packing_t diff --git a/src/accessor/grib_accessor_class_data_g2shsimple_packing.h.bak b/src/accessor/grib_accessor_class_data_g2shsimple_packing.h.bak new file mode 100644 index 000000000..28e7a7c06 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2shsimple_packing.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2shsimple_packing_h +#define eccodes_accessor_data_g2shsimple_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_shsimple_packing.h" + +class grib_accessor_data_g2shsimple_packing_t : public grib_accessor_data_shsimple_packing_t +{ +public: + /* Members defined in data_g2shsimple_packing */ + const char* numberOfValues; + const char* numberOfDataPoints; +}; + +class grib_accessor_class_data_g2shsimple_packing_t : public grib_accessor_class_data_shsimple_packing_t +{ +public: + grib_accessor_class_data_g2shsimple_packing_t(const char* name) : grib_accessor_class_data_shsimple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2shsimple_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2shsimple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing.h.bak b/src/accessor/grib_accessor_class_data_g2simple_packing.h.bak new file mode 100644 index 000000000..4f27ab87c --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2simple_packing.h.bak @@ -0,0 +1,28 @@ +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2simple_packing_h +#define eccodes_accessor_data_g2simple_packing_h + +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_g2simple_packing_t : public grib_accessor_data_simple_packing_t {}; + +class grib_accessor_class_data_g2simple_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_g2simple_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2simple_packing_t{}; } + int pack_bytes(grib_accessor*, const unsigned char*, size_t* len) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2simple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h index ac2bc2d27..797815bd3 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h +++ b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_g2simple_packing_with_preprocessing_h #define eccodes_accessor_data_g2simple_packing_with_preprocessing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_g2simple_packing.h" class grib_accessor_data_g2simple_packing_with_preprocessing_t : public grib_accessor_data_g2simple_packing_t diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h.bak b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h.bak new file mode 100644 index 000000000..ac2bc2d27 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_g2simple_packing_with_preprocessing_h +#define eccodes_accessor_data_g2simple_packing_with_preprocessing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_g2simple_packing.h" + +class grib_accessor_data_g2simple_packing_with_preprocessing_t : public grib_accessor_data_g2simple_packing_t +{ +public: + /* Members defined in data_g2simple_packing_with_preprocessing */ + const char* pre_processing; + const char* pre_processing_parameter; +}; + +class grib_accessor_class_data_g2simple_packing_with_preprocessing_t : public grib_accessor_class_data_g2simple_packing_t +{ +public: + grib_accessor_class_data_g2simple_packing_with_preprocessing_t(const char* name) : grib_accessor_class_data_g2simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2simple_packing_with_preprocessing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_g2simple_packing_with_preprocessing_h */ diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.h b/src/accessor/grib_accessor_class_data_jpeg2000_packing.h index a04ee58d5..4802dd2ac 100644 --- a/src/accessor/grib_accessor_class_data_jpeg2000_packing.h +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_jpeg2000_packing_h #define eccodes_accessor_data_jpeg2000_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_jpeg2000_packing_t : public grib_accessor_data_simple_packing_t diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.h.bak b/src/accessor/grib_accessor_class_data_jpeg2000_packing.h.bak new file mode 100644 index 000000000..a04ee58d5 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.h.bak @@ -0,0 +1,46 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_jpeg2000_packing_h +#define eccodes_accessor_data_jpeg2000_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_jpeg2000_packing_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_jpeg2000_packing */ + const char* type_of_compression_used; + const char* target_compression_ratio; + const char* ni; + const char* nj; + const char* list_defining_points; + const char* number_of_data_points; + const char* scanning_mode; + int jpeg_lib; + const char* dump_jpg; +}; + +class grib_accessor_class_data_jpeg2000_packing_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_jpeg2000_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_jpeg2000_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_jpeg2000_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_png_packing.h.bak b/src/accessor/grib_accessor_class_data_png_packing.h.bak new file mode 100644 index 000000000..841ed9d31 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_png_packing.h.bak @@ -0,0 +1,41 @@ +/* + * (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. + */ + +#pragma once + +#include "grib_accessor_class_values.h" + +class grib_accessor_data_png_packing_t : public grib_accessor_values_t +{ +public: + 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* ni; + const char* nj; + const char* list_defining_points; + const char* number_of_data_points; + const char* scanning_mode; +}; + +class grib_accessor_class_data_png_packing_t : public grib_accessor_class_values_t +{ +public: + grib_accessor_class_data_png_packing_t(const char* name) : grib_accessor_class_values_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_png_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; diff --git a/src/accessor/grib_accessor_class_data_raw_packing.h b/src/accessor/grib_accessor_class_data_raw_packing.h index 5b1b103e0..075cc470e 100644 --- a/src/accessor/grib_accessor_class_data_raw_packing.h +++ b/src/accessor/grib_accessor_class_data_raw_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_raw_packing_h #define eccodes_accessor_data_raw_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_values.h" class grib_accessor_data_raw_packing_t : public grib_accessor_values_t diff --git a/src/accessor/grib_accessor_class_data_raw_packing.h.bak b/src/accessor/grib_accessor_class_data_raw_packing.h.bak new file mode 100644 index 000000000..5b1b103e0 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_raw_packing.h.bak @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_raw_packing_h +#define eccodes_accessor_data_raw_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_values.h" + +class grib_accessor_data_raw_packing_t : public grib_accessor_values_t +{ +public: + /* Members defined in data_raw_packing */ + const char* number_of_values; + const char* precision; +}; + +class grib_accessor_class_data_raw_packing_t : public grib_accessor_class_values_t +{ +public: + grib_accessor_class_data_raw_packing_t(const char* name) : grib_accessor_class_values_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_raw_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; +}; +#endif /* eccodes_accessor_data_raw_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_run_length_packing.h b/src/accessor/grib_accessor_class_data_run_length_packing.h index 3125fdcf4..f57d69c39 100644 --- a/src/accessor/grib_accessor_class_data_run_length_packing.h +++ b/src/accessor/grib_accessor_class_data_run_length_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_run_length_packing_h #define eccodes_accessor_data_run_length_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_values.h" class grib_accessor_data_run_length_packing_t : public grib_accessor_values_t diff --git a/src/accessor/grib_accessor_class_data_run_length_packing.h.bak b/src/accessor/grib_accessor_class_data_run_length_packing.h.bak new file mode 100644 index 000000000..3125fdcf4 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_run_length_packing.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_run_length_packing_h +#define eccodes_accessor_data_run_length_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_values.h" + +class grib_accessor_data_run_length_packing_t : public grib_accessor_values_t +{ +public: + /* 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; +}; + +class grib_accessor_class_data_run_length_packing_t : public grib_accessor_class_values_t +{ +public: + grib_accessor_class_data_run_length_packing_t(const char* name) : grib_accessor_class_values_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_run_length_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_run_length_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_secondary_bitmap.h b/src/accessor/grib_accessor_class_data_secondary_bitmap.h index 3ac86e324..06a2ab576 100644 --- a/src/accessor/grib_accessor_class_data_secondary_bitmap.h +++ b/src/accessor/grib_accessor_class_data_secondary_bitmap.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_secondary_bitmap_h #define eccodes_accessor_data_secondary_bitmap_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_data_secondary_bitmap_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_data_secondary_bitmap.h.bak b/src/accessor/grib_accessor_class_data_secondary_bitmap.h.bak new file mode 100644 index 000000000..3ac86e324 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_secondary_bitmap.h.bak @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_secondary_bitmap_h +#define eccodes_accessor_data_secondary_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_data_secondary_bitmap_t : public grib_accessor_gen_t +{ +public: + /* Members defined in data_secondary_bitmap */ + const char* primary_bitmap; + const char* secondary_bitmap; + const char* missing_value; + const char* expand_by; +}; + +class grib_accessor_class_data_secondary_bitmap_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_data_secondary_bitmap_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_secondary_bitmap_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_secondary_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_sh_packed.h b/src/accessor/grib_accessor_class_data_sh_packed.h index 2d7cbdf47..109534010 100644 --- a/src/accessor/grib_accessor_class_data_sh_packed.h +++ b/src/accessor/grib_accessor_class_data_sh_packed.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_sh_packed_h #define eccodes_accessor_data_sh_packed_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_sh_packed_t : public grib_accessor_data_simple_packing_t diff --git a/src/accessor/grib_accessor_class_data_sh_packed.h.bak b/src/accessor/grib_accessor_class_data_sh_packed.h.bak new file mode 100644 index 000000000..2d7cbdf47 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_sh_packed.h.bak @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_sh_packed_h +#define eccodes_accessor_data_sh_packed_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_sh_packed_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_sh_packed */ + 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; +}; + +class grib_accessor_class_data_sh_packed_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_sh_packed_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_sh_packed_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_sh_packed_h */ diff --git a/src/accessor/grib_accessor_class_data_sh_unpacked.h b/src/accessor/grib_accessor_class_data_sh_unpacked.h index 4b1e893c0..3f9c57dc8 100644 --- a/src/accessor/grib_accessor_class_data_sh_unpacked.h +++ b/src/accessor/grib_accessor_class_data_sh_unpacked.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_sh_unpacked_h #define eccodes_accessor_data_sh_unpacked_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_sh_unpacked_t : public grib_accessor_data_simple_packing_t diff --git a/src/accessor/grib_accessor_class_data_sh_unpacked.h.bak b/src/accessor/grib_accessor_class_data_sh_unpacked.h.bak new file mode 100644 index 000000000..4b1e893c0 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_sh_unpacked.h.bak @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_sh_unpacked_h +#define eccodes_accessor_data_sh_unpacked_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_data_simple_packing.h" + +class grib_accessor_data_sh_unpacked_t : public grib_accessor_data_simple_packing_t +{ +public: + /* Members defined in data_sh_unpacked */ + 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; +}; + +class grib_accessor_class_data_sh_unpacked_t : public grib_accessor_class_data_simple_packing_t +{ +public: + grib_accessor_class_data_sh_unpacked_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_sh_unpacked_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_sh_unpacked_h */ diff --git a/src/accessor/grib_accessor_class_data_shsimple_packing.h b/src/accessor/grib_accessor_class_data_shsimple_packing.h index 851907eb9..b4c388902 100644 --- a/src/accessor/grib_accessor_class_data_shsimple_packing.h +++ b/src/accessor/grib_accessor_class_data_shsimple_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_data_shsimple_packing_h #define eccodes_accessor_data_shsimple_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_data_shsimple_packing_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_data_shsimple_packing.h.bak b/src/accessor/grib_accessor_class_data_shsimple_packing.h.bak new file mode 100644 index 000000000..851907eb9 --- /dev/null +++ b/src/accessor/grib_accessor_class_data_shsimple_packing.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_shsimple_packing_h +#define eccodes_accessor_data_shsimple_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_data_shsimple_packing_t : public grib_accessor_gen_t +{ +public: + /* Members defined in data_shsimple_packing */ + const char* coded_values; + const char* real_part; + int dirty; +}; + +class grib_accessor_class_data_shsimple_packing_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_data_shsimple_packing_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_shsimple_packing_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_data_shsimple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_simple_packing.h.bak b/src/accessor/grib_accessor_class_data_simple_packing.h.bak new file mode 100644 index 000000000..92f355b3f --- /dev/null +++ b/src/accessor/grib_accessor_class_data_simple_packing.h.bak @@ -0,0 +1,195 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_data_simple_packing_h +#define eccodes_accessor_data_simple_packing_h + +#include "grib_accessor_class_values.h" +#include "grib_bits_any_endian_simple.h" +#include "grib_scaling.h" + +class grib_accessor_data_simple_packing_t : public grib_accessor_values_t +{ +public: + /* 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; +}; + +class grib_accessor_class_data_simple_packing_t : public grib_accessor_class_values_t +{ +public: + grib_accessor_class_data_simple_packing_t(const char* name) : grib_accessor_class_values_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_data_simple_packing_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; + int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len) override; + +private: + template int unpack(grib_accessor*, T*, size_t*); +}; + + +template +int grib_accessor_class_data_simple_packing_t::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_t* self = (grib_accessor_data_simple_packing_t*)a; + const char* cclass_name = a->cclass->name; + 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 n_vals = 0; + long pos = 0; + long count = 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; + + err = a->value_count(&count); if (err) + return err; + n_vals = count; + + 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) { + for (i = 0; i < n_vals; i++) + val[i] = reference_value; + *len = n_vals; + return GRIB_SUCCESS; + } + + s = codes_power(binary_scale_factor, 2); + d = codes_power(-decimal_scale_factor, 10); + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "%s %s: Creating %s, %zu values", cclass_name, __func__, a->name, n_vals); + + offsetBeforeData = a->byte_offset(); 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, + "%s: Data section size mismatch: " + "offset before data=%ld, offset after data=%ld (num values=%zu, bits per value=%ld)", + cclass_name, offsetBeforeData, offsetAfterData, n_vals, bits_per_value); + return GRIB_DECODING_ERROR; + } + } + // 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; + // } + } + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "%s %s: calling outline function: bpv: %ld, rv: %g, bsf: %ld, dsf: %ld", + cclass_name, __func__, bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); + grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, val); + + *len = (long)n_vals; + + if (units_factor != 1.0) { + if (units_bias != 0.0) { + for (i = 0; i < n_vals; i++) { + val[i] = val[i] * units_factor + units_bias; + } + } else { + for (i = 0; i < n_vals; i++) { + val[i] *= units_factor; + } + } + } + else if (units_bias != 0.0) { + for (i = 0; i < n_vals; i++) { + val[i] += units_bias; + } + } + return err; +} + + +#endif /* eccodes_accessor_data_simple_packing_h */ diff --git a/src/accessor/grib_accessor_class_decimal_precision.h b/src/accessor/grib_accessor_class_decimal_precision.h index 455d77946..a3e3e3024 100644 --- a/src/accessor/grib_accessor_class_decimal_precision.h +++ b/src/accessor/grib_accessor_class_decimal_precision.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_decimal_precision_h #define eccodes_accessor_decimal_precision_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_decimal_precision_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_decimal_precision.h.bak b/src/accessor/grib_accessor_class_decimal_precision.h.bak new file mode 100644 index 000000000..455d77946 --- /dev/null +++ b/src/accessor/grib_accessor_class_decimal_precision.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_decimal_precision_h +#define eccodes_accessor_decimal_precision_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_decimal_precision_t : public grib_accessor_long_t +{ +public: + /* Members defined in decimal_precision */ + const char* values; + const char* bits_per_value; + const char* changing_precision; + const char* decimal_scale_factor; +}; + +class grib_accessor_class_decimal_precision_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_decimal_precision_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_decimal_precision_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_decimal_precision_h */ diff --git a/src/accessor/grib_accessor_class_dictionary.h b/src/accessor/grib_accessor_class_dictionary.h index 7f86a44ae..353cb9efa 100644 --- a/src/accessor/grib_accessor_class_dictionary.h +++ b/src/accessor/grib_accessor_class_dictionary.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_dictionary_h #define eccodes_accessor_dictionary_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_dictionary_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_dictionary.h.bak b/src/accessor/grib_accessor_class_dictionary.h.bak new file mode 100644 index 000000000..7f86a44ae --- /dev/null +++ b/src/accessor/grib_accessor_class_dictionary.h.bak @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_dictionary_h +#define eccodes_accessor_dictionary_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_dictionary_t : public grib_accessor_gen_t +{ +public: + /* Members defined in dictionary */ + const char* dictionary; + const char* key; + long column; + const char* masterDir; + const char* localDir; +}; + +class grib_accessor_class_dictionary_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_dictionary_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_dictionary_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_dictionary_h */ diff --git a/src/accessor/grib_accessor_class_dirty.h b/src/accessor/grib_accessor_class_dirty.h index 7a008ce29..78d4fcb64 100644 --- a/src/accessor/grib_accessor_class_dirty.h +++ b/src/accessor/grib_accessor_class_dirty.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_dirty_h #define eccodes_accessor_dirty_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_dirty_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_dirty.h.bak b/src/accessor/grib_accessor_class_dirty.h.bak new file mode 100644 index 000000000..7a008ce29 --- /dev/null +++ b/src/accessor/grib_accessor_class_dirty.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_dirty_h +#define eccodes_accessor_dirty_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_dirty_t : public grib_accessor_long_t +{ +public: + /* Members defined in dirty */ + const char* accessor; +}; + +class grib_accessor_class_dirty_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_dirty_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_dirty_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_dirty_h */ diff --git a/src/accessor/grib_accessor_class_divdouble.h b/src/accessor/grib_accessor_class_divdouble.h index e10239676..eb2357a3e 100644 --- a/src/accessor/grib_accessor_class_divdouble.h +++ b/src/accessor/grib_accessor_class_divdouble.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_divdouble_h #define eccodes_accessor_divdouble_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_divdouble_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_divdouble.h.bak b/src/accessor/grib_accessor_class_divdouble.h.bak new file mode 100644 index 000000000..e10239676 --- /dev/null +++ b/src/accessor/grib_accessor_class_divdouble.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_divdouble_h +#define eccodes_accessor_divdouble_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_divdouble_t : public grib_accessor_double_t +{ +public: + /* Members defined in divdouble */ + const char* val; + double divisor; +}; + +class grib_accessor_class_divdouble_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_divdouble_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_divdouble_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_divdouble_h */ diff --git a/src/accessor/grib_accessor_class_double.h.bak b/src/accessor/grib_accessor_class_double.h.bak new file mode 100644 index 000000000..1c1e2fb4f --- /dev/null +++ b/src/accessor/grib_accessor_class_double.h.bak @@ -0,0 +1,30 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_double_h +#define eccodes_accessor_double_h + +#include "grib_accessor_class_gen.h" + +class grib_accessor_double_t : public grib_accessor_gen_t {}; + +class grib_accessor_class_double_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_double_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_double_t{}; } + int get_native_type(grib_accessor*) override; + int pack_missing(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_double_h */ diff --git a/src/accessor/grib_accessor_class_element.h b/src/accessor/grib_accessor_class_element.h index f22109be2..fe1d58ecd 100644 --- a/src/accessor/grib_accessor_class_element.h +++ b/src/accessor/grib_accessor_class_element.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_element_h #define eccodes_accessor_element_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_element_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_element.h.bak b/src/accessor/grib_accessor_class_element.h.bak new file mode 100644 index 000000000..f22109be2 --- /dev/null +++ b/src/accessor/grib_accessor_class_element.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_element_h +#define eccodes_accessor_element_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_element_t : public grib_accessor_long_t +{ +public: + /* Members defined in element */ + const char* array; + long element; +}; + +class grib_accessor_class_element_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_element_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_element_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_element_h */ diff --git a/src/accessor/grib_accessor_class_evaluate.h b/src/accessor/grib_accessor_class_evaluate.h index e65c6473b..cfaf92c00 100644 --- a/src/accessor/grib_accessor_class_evaluate.h +++ b/src/accessor/grib_accessor_class_evaluate.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_evaluate_h #define eccodes_accessor_evaluate_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_evaluate_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_evaluate.h.bak b/src/accessor/grib_accessor_class_evaluate.h.bak new file mode 100644 index 000000000..e65c6473b --- /dev/null +++ b/src/accessor/grib_accessor_class_evaluate.h.bak @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_evaluate_h +#define eccodes_accessor_evaluate_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_evaluate_t : public grib_accessor_long_t +{ +public: + /* Members defined in evaluate */ + grib_arguments* arg; +}; + +class grib_accessor_class_evaluate_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_evaluate_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_evaluate_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_evaluate_h */ diff --git a/src/accessor/grib_accessor_class_expanded_descriptors.h b/src/accessor/grib_accessor_class_expanded_descriptors.h index be2094d4f..419b28c61 100644 --- a/src/accessor/grib_accessor_class_expanded_descriptors.h +++ b/src/accessor/grib_accessor_class_expanded_descriptors.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_expanded_descriptors_h #define eccodes_accessor_expanded_descriptors_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_expanded_descriptors_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_expanded_descriptors.h.bak b/src/accessor/grib_accessor_class_expanded_descriptors.h.bak new file mode 100644 index 000000000..be2094d4f --- /dev/null +++ b/src/accessor/grib_accessor_class_expanded_descriptors.h.bak @@ -0,0 +1,47 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_expanded_descriptors_h +#define eccodes_accessor_expanded_descriptors_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_expanded_descriptors_t : public grib_accessor_long_t +{ +public: + /* Members defined in expanded_descriptors */ + const char* unexpandedDescriptors; + const char* sequence; + const char* expandedName; + const char* tablesAccessorName; + bufr_descriptors_array* expanded; + int rank; + grib_accessor* expandedAccessor; + int do_expand; + grib_accessor* tablesAccessor; +}; + +class grib_accessor_class_expanded_descriptors_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_expanded_descriptors_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_expanded_descriptors_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_expanded_descriptors_h */ diff --git a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h index 1874c559f..d14cb9c56 100644 --- a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h +++ b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_from_scale_factor_scaled_value_h #define eccodes_accessor_from_scale_factor_scaled_value_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_from_scale_factor_scaled_value_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h.bak b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h.bak new file mode 100644 index 000000000..1874c559f --- /dev/null +++ b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_from_scale_factor_scaled_value_h +#define eccodes_accessor_from_scale_factor_scaled_value_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_from_scale_factor_scaled_value_t : public grib_accessor_double_t +{ +public: + /* Members defined in from_scale_factor_scaled_value */ + const char* scaleFactor; + const char* scaledValue; +}; + +class grib_accessor_class_from_scale_factor_scaled_value_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_from_scale_factor_scaled_value_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_from_scale_factor_scaled_value_t{}; } + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_from_scale_factor_scaled_value_h */ diff --git a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h index 9c5890aa3..bf6ae7372 100644 --- a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h +++ b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1_half_byte_codeflag_h #define eccodes_accessor_g1_half_byte_codeflag_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_g1_half_byte_codeflag_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h.bak b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h.bak new file mode 100644 index 000000000..9c5890aa3 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1_half_byte_codeflag_h +#define eccodes_accessor_g1_half_byte_codeflag_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_g1_half_byte_codeflag_t : public grib_accessor_gen_t +{ +public: + /* Members defined in g1_half_byte_codeflag */ +}; + +class grib_accessor_class_g1_half_byte_codeflag_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_g1_half_byte_codeflag_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1_half_byte_codeflag_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1_half_byte_codeflag_h */ diff --git a/src/accessor/grib_accessor_class_g1_message_length.h b/src/accessor/grib_accessor_class_g1_message_length.h index c3b865ec0..65d1983a9 100644 --- a/src/accessor/grib_accessor_class_g1_message_length.h +++ b/src/accessor/grib_accessor_class_g1_message_length.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1_message_length_h #define eccodes_accessor_g1_message_length_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_section_length.h" class grib_accessor_g1_message_length_t : public grib_accessor_section_length_t diff --git a/src/accessor/grib_accessor_class_g1_message_length.h.bak b/src/accessor/grib_accessor_class_g1_message_length.h.bak new file mode 100644 index 000000000..c3b865ec0 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1_message_length.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1_message_length_h +#define eccodes_accessor_g1_message_length_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_section_length.h" + +class grib_accessor_g1_message_length_t : public grib_accessor_section_length_t +{ +public: + /* Members defined in g1_message_length */ + const char *sec4_length; +}; + +class grib_accessor_class_g1_message_length_t : public grib_accessor_class_section_length_t +{ +public: + grib_accessor_class_g1_message_length_t(const char* name) : grib_accessor_class_section_length_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1_message_length_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1_message_length_h */ diff --git a/src/accessor/grib_accessor_class_g1_section4_length.h b/src/accessor/grib_accessor_class_g1_section4_length.h index 0a1b0c768..0cb88362a 100644 --- a/src/accessor/grib_accessor_class_g1_section4_length.h +++ b/src/accessor/grib_accessor_class_g1_section4_length.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1_section4_length_h #define eccodes_accessor_g1_section4_length_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_section_length.h" class grib_accessor_g1_section4_length_t : public grib_accessor_section_length_t diff --git a/src/accessor/grib_accessor_class_g1_section4_length.h.bak b/src/accessor/grib_accessor_class_g1_section4_length.h.bak new file mode 100644 index 000000000..0a1b0c768 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1_section4_length.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1_section4_length_h +#define eccodes_accessor_g1_section4_length_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_section_length.h" + +class grib_accessor_g1_section4_length_t : public grib_accessor_section_length_t +{ +public: + /* Members defined in g1_section4_length */ + const char* total_length; +}; + +class grib_accessor_class_g1_section4_length_t : public grib_accessor_class_section_length_t +{ +public: + grib_accessor_class_g1_section4_length_t(const char* name) : grib_accessor_class_section_length_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1_section4_length_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1_section4_length_h */ diff --git a/src/accessor/grib_accessor_class_g1bitmap.h b/src/accessor/grib_accessor_class_g1bitmap.h index b34344d1f..d27f6b4eb 100644 --- a/src/accessor/grib_accessor_class_g1bitmap.h +++ b/src/accessor/grib_accessor_class_g1bitmap.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1bitmap_h #define eccodes_accessor_g1bitmap_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_bitmap.h" class grib_accessor_g1bitmap_t : public grib_accessor_bitmap_t diff --git a/src/accessor/grib_accessor_class_g1bitmap.h.bak b/src/accessor/grib_accessor_class_g1bitmap.h.bak new file mode 100644 index 000000000..b34344d1f --- /dev/null +++ b/src/accessor/grib_accessor_class_g1bitmap.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1bitmap_h +#define eccodes_accessor_g1bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_bitmap.h" + +class grib_accessor_g1bitmap_t : public grib_accessor_bitmap_t +{ +public: + /* Members defined in g1bitmap */ + const char* unusedBits; +}; + +class grib_accessor_class_g1bitmap_t : public grib_accessor_class_bitmap_t +{ +public: + grib_accessor_class_g1bitmap_t(const char* name) : grib_accessor_class_bitmap_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1bitmap_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1bitmap_h */ diff --git a/src/accessor/grib_accessor_class_g1date.h b/src/accessor/grib_accessor_class_g1date.h index 27e71189f..734b2a3b5 100644 --- a/src/accessor/grib_accessor_class_g1date.h +++ b/src/accessor/grib_accessor_class_g1date.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1date_h #define eccodes_accessor_g1date_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1date_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g1date.h.bak b/src/accessor/grib_accessor_class_g1date.h.bak new file mode 100644 index 000000000..27e71189f --- /dev/null +++ b/src/accessor/grib_accessor_class_g1date.h.bak @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1date_h +#define eccodes_accessor_g1date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1date_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1date */ + const char* century; + const char* year; + const char* month; + const char* day; +}; + +class grib_accessor_class_g1date_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1date_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1date_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1date_h */ diff --git a/src/accessor/grib_accessor_class_g1day_of_the_year_date.h b/src/accessor/grib_accessor_class_g1day_of_the_year_date.h index 1563cdb9d..bc12f541e 100644 --- a/src/accessor/grib_accessor_class_g1day_of_the_year_date.h +++ b/src/accessor/grib_accessor_class_g1day_of_the_year_date.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1day_of_the_year_date_h #define eccodes_accessor_g1day_of_the_year_date_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_g1date.h" class grib_accessor_g1day_of_the_year_date_t : public grib_accessor_g1date_t diff --git a/src/accessor/grib_accessor_class_g1day_of_the_year_date.h.bak b/src/accessor/grib_accessor_class_g1day_of_the_year_date.h.bak new file mode 100644 index 000000000..1563cdb9d --- /dev/null +++ b/src/accessor/grib_accessor_class_g1day_of_the_year_date.h.bak @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1day_of_the_year_date_h +#define eccodes_accessor_g1day_of_the_year_date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_g1date.h" + +class grib_accessor_g1day_of_the_year_date_t : public grib_accessor_g1date_t +{ +public: + /* Members defined in g1day_of_the_year_date */ +}; + +class grib_accessor_class_g1day_of_the_year_date_t : public grib_accessor_class_g1date_t +{ +public: + grib_accessor_class_g1day_of_the_year_date_t(const char* name) : grib_accessor_class_g1date_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1day_of_the_year_date_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1day_of_the_year_date_h */ diff --git a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h index a1e29a76c..7e6ac3563 100644 --- a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h +++ b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1end_of_interval_monthly_h #define eccodes_accessor_g1end_of_interval_monthly_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_abstract_vector.h" class grib_accessor_g1end_of_interval_monthly_t : public grib_accessor_abstract_vector_t diff --git a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h.bak b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h.bak new file mode 100644 index 000000000..a1e29a76c --- /dev/null +++ b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1end_of_interval_monthly_h +#define eccodes_accessor_g1end_of_interval_monthly_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_abstract_vector.h" + +class grib_accessor_g1end_of_interval_monthly_t : public grib_accessor_abstract_vector_t +{ +public: + /* Members defined in g1end_of_interval_monthly */ + const char* verifyingMonth; +}; + +class grib_accessor_class_g1end_of_interval_monthly_t : public grib_accessor_class_abstract_vector_t +{ +public: + grib_accessor_class_g1end_of_interval_monthly_t(const char* name) : grib_accessor_class_abstract_vector_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1end_of_interval_monthly_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_g1end_of_interval_monthly_h */ diff --git a/src/accessor/grib_accessor_class_g1fcperiod.h b/src/accessor/grib_accessor_class_g1fcperiod.h index 3c0ff2c49..b2862cb78 100644 --- a/src/accessor/grib_accessor_class_g1fcperiod.h +++ b/src/accessor/grib_accessor_class_g1fcperiod.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1fcperiod_h #define eccodes_accessor_g1fcperiod_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_g1step_range.h" class grib_accessor_g1fcperiod_t : public grib_accessor_g1step_range_t diff --git a/src/accessor/grib_accessor_class_g1fcperiod.h.bak b/src/accessor/grib_accessor_class_g1fcperiod.h.bak new file mode 100644 index 000000000..3c0ff2c49 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1fcperiod.h.bak @@ -0,0 +1,31 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1fcperiod_h +#define eccodes_accessor_g1fcperiod_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_g1step_range.h" + +class grib_accessor_g1fcperiod_t : public grib_accessor_g1step_range_t +{ +public: + /* Members defined in g1fcperiod */ +}; + +class grib_accessor_class_g1fcperiod_t : public grib_accessor_class_g1step_range_t +{ +public: + grib_accessor_class_g1fcperiod_t(const char* name) : grib_accessor_class_g1step_range_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1fcperiod_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; +}; +#endif /* eccodes_accessor_g1fcperiod_h */ diff --git a/src/accessor/grib_accessor_class_g1forecastmonth.h b/src/accessor/grib_accessor_class_g1forecastmonth.h index 6d2b9ee63..3a5fbb89b 100644 --- a/src/accessor/grib_accessor_class_g1forecastmonth.h +++ b/src/accessor/grib_accessor_class_g1forecastmonth.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1forecastmonth_h #define eccodes_accessor_g1forecastmonth_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1forecastmonth_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g1forecastmonth.h.bak b/src/accessor/grib_accessor_class_g1forecastmonth.h.bak new file mode 100644 index 000000000..6d2b9ee63 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1forecastmonth.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1forecastmonth_h +#define eccodes_accessor_g1forecastmonth_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1forecastmonth_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1forecastmonth */ + const char* verification_yearmonth; + const char* base_date; + const char* day; + const char* hour; + const char* fcmonth; + const char* check; +}; + +class grib_accessor_class_g1forecastmonth_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1forecastmonth_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1forecastmonth_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1forecastmonth_h */ diff --git a/src/accessor/grib_accessor_class_g1monthlydate.h b/src/accessor/grib_accessor_class_g1monthlydate.h index 8efa9cf16..b279e56c3 100644 --- a/src/accessor/grib_accessor_class_g1monthlydate.h +++ b/src/accessor/grib_accessor_class_g1monthlydate.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1monthlydate_h #define eccodes_accessor_g1monthlydate_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1monthlydate_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g1monthlydate.h.bak b/src/accessor/grib_accessor_class_g1monthlydate.h.bak new file mode 100644 index 000000000..8efa9cf16 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1monthlydate.h.bak @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1monthlydate_h +#define eccodes_accessor_g1monthlydate_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1monthlydate_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1monthlydate */ + const char* date; +}; + +class grib_accessor_class_g1monthlydate_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1monthlydate_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1monthlydate_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1monthlydate_h */ diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h index 764bfa04d..75b21875b 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1number_of_coded_values_sh_complex_h #define eccodes_accessor_g1number_of_coded_values_sh_complex_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1number_of_coded_values_sh_complex_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h.bak b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h.bak new file mode 100644 index 000000000..764bfa04d --- /dev/null +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1number_of_coded_values_sh_complex_h +#define eccodes_accessor_g1number_of_coded_values_sh_complex_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1number_of_coded_values_sh_complex_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1number_of_coded_values_sh_complex */ + const char* numberOfValues; + const char* bitsPerValue; + const char* offsetBeforeData; + const char* offsetAfterData; + const char* unusedBits; + const char* JS; + const char* KS; + const char* MS; +}; + +class grib_accessor_class_g1number_of_coded_values_sh_complex_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1number_of_coded_values_sh_complex_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1number_of_coded_values_sh_complex_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1number_of_coded_values_sh_complex_h */ diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h index fb5ab298d..d59e4999c 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1number_of_coded_values_sh_simple_h #define eccodes_accessor_g1number_of_coded_values_sh_simple_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1number_of_coded_values_sh_simple_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h.bak b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h.bak new file mode 100644 index 000000000..fb5ab298d --- /dev/null +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1number_of_coded_values_sh_simple_h +#define eccodes_accessor_g1number_of_coded_values_sh_simple_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1number_of_coded_values_sh_simple_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1number_of_coded_values_sh_simple */ + const char* numberOfValues; + const char* bitsPerValue; + const char* offsetBeforeData; + const char* offsetAfterData; + const char* unusedBits; +}; + +class grib_accessor_class_g1number_of_coded_values_sh_simple_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1number_of_coded_values_sh_simple_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1number_of_coded_values_sh_simple_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1number_of_coded_values_sh_simple_h */ diff --git a/src/accessor/grib_accessor_class_g1step_range.h b/src/accessor/grib_accessor_class_g1step_range.h index c9c3dd911..26d7116e8 100644 --- a/src/accessor/grib_accessor_class_g1step_range.h +++ b/src/accessor/grib_accessor_class_g1step_range.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1step_range_h #define eccodes_accessor_g1step_range_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_abstract_long_vector.h" class grib_accessor_g1step_range_t : public grib_accessor_abstract_long_vector_t diff --git a/src/accessor/grib_accessor_class_g1step_range.h.bak b/src/accessor/grib_accessor_class_g1step_range.h.bak new file mode 100644 index 000000000..c9c3dd911 --- /dev/null +++ b/src/accessor/grib_accessor_class_g1step_range.h.bak @@ -0,0 +1,48 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1step_range_h +#define eccodes_accessor_g1step_range_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_abstract_long_vector.h" + +class grib_accessor_g1step_range_t : public grib_accessor_abstract_long_vector_t +{ +public: + /* Members defined in g1step_range */ + const char* p1; + const char* p2; + const char* timeRangeIndicator; + const char *unit; + const char *step_unit; + const char *stepType; + const char *patch_fp_precip; + int error_on_units; +}; + +class grib_accessor_class_g1step_range_t : public grib_accessor_class_abstract_long_vector_t +{ +public: + grib_accessor_class_g1step_range_t(const char* name) : grib_accessor_class_abstract_long_vector_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1step_range_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1step_range_h */ diff --git a/src/accessor/grib_accessor_class_g1verificationdate.h b/src/accessor/grib_accessor_class_g1verificationdate.h index 198801aba..70edcf7d8 100644 --- a/src/accessor/grib_accessor_class_g1verificationdate.h +++ b/src/accessor/grib_accessor_class_g1verificationdate.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g1verificationdate_h #define eccodes_accessor_g1verificationdate_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1verificationdate_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g1verificationdate.h.bak b/src/accessor/grib_accessor_class_g1verificationdate.h.bak new file mode 100644 index 000000000..198801aba --- /dev/null +++ b/src/accessor/grib_accessor_class_g1verificationdate.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g1verificationdate_h +#define eccodes_accessor_g1verificationdate_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g1verificationdate_t : public grib_accessor_long_t +{ +public: + /* Members defined in g1verificationdate */ + const char* date; + const char* time; + const char* step; +}; + +class grib_accessor_class_g1verificationdate_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g1verificationdate_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g1verificationdate_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g1verificationdate_h */ diff --git a/src/accessor/grib_accessor_class_g2_aerosol.h b/src/accessor/grib_accessor_class_g2_aerosol.h index fb29a9561..f9feaa5e8 100644 --- a/src/accessor/grib_accessor_class_g2_aerosol.h +++ b/src/accessor/grib_accessor_class_g2_aerosol.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2_aerosol_h #define eccodes_accessor_g2_aerosol_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_g2_aerosol_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_g2_aerosol.h.bak b/src/accessor/grib_accessor_class_g2_aerosol.h.bak new file mode 100644 index 000000000..fb29a9561 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2_aerosol.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2_aerosol_h +#define eccodes_accessor_g2_aerosol_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_g2_aerosol_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in g2_aerosol */ + const char* productDefinitionTemplateNumber; + const char* stepType; + int optical; +}; + +class grib_accessor_class_g2_aerosol_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_g2_aerosol_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_aerosol_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2_aerosol_h */ diff --git a/src/accessor/grib_accessor_class_g2_chemical.h b/src/accessor/grib_accessor_class_g2_chemical.h index 9cfe4f8bc..01a159008 100644 --- a/src/accessor/grib_accessor_class_g2_chemical.h +++ b/src/accessor/grib_accessor_class_g2_chemical.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2_chemical_h #define eccodes_accessor_g2_chemical_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_g2_chemical_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_g2_chemical.h.bak b/src/accessor/grib_accessor_class_g2_chemical.h.bak new file mode 100644 index 000000000..9cfe4f8bc --- /dev/null +++ b/src/accessor/grib_accessor_class_g2_chemical.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2_chemical_h +#define eccodes_accessor_g2_chemical_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_g2_chemical_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in g2_chemical */ + const char* productDefinitionTemplateNumber; + const char* stepType; + int chemical_type; +}; + +class grib_accessor_class_g2_chemical_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_g2_chemical_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_chemical_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2_chemical_h */ diff --git a/src/accessor/grib_accessor_class_g2_eps.h b/src/accessor/grib_accessor_class_g2_eps.h index 7c39dd580..a29e975ea 100644 --- a/src/accessor/grib_accessor_class_g2_eps.h +++ b/src/accessor/grib_accessor_class_g2_eps.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2_eps_h #define eccodes_accessor_g2_eps_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_g2_eps_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_g2_eps.h.bak b/src/accessor/grib_accessor_class_g2_eps.h.bak new file mode 100644 index 000000000..7c39dd580 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2_eps.h.bak @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2_eps_h +#define eccodes_accessor_g2_eps_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_g2_eps_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in g2_eps */ + const char* productDefinitionTemplateNumber; + const char* stream; + const char* type; + const char* stepType; + const char* derivedForecast; +}; + +class grib_accessor_class_g2_eps_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_g2_eps_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_eps_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2_eps_h */ diff --git a/src/accessor/grib_accessor_class_g2_mars_labeling.h b/src/accessor/grib_accessor_class_g2_mars_labeling.h index 0a678174f..a73962542 100644 --- a/src/accessor/grib_accessor_class_g2_mars_labeling.h +++ b/src/accessor/grib_accessor_class_g2_mars_labeling.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2_mars_labeling_h #define eccodes_accessor_g2_mars_labeling_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_g2_mars_labeling_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_g2_mars_labeling.h.bak b/src/accessor/grib_accessor_class_g2_mars_labeling.h.bak new file mode 100644 index 000000000..0a678174f --- /dev/null +++ b/src/accessor/grib_accessor_class_g2_mars_labeling.h.bak @@ -0,0 +1,47 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2_mars_labeling_h +#define eccodes_accessor_g2_mars_labeling_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_g2_mars_labeling_t : public grib_accessor_gen_t +{ +public: + /* Members defined in g2_mars_labeling */ + int index; + const char* the_class; + const char* stream; + const char* type; + const char* expver; + const char* typeOfProcessedData; + const char* productDefinitionTemplateNumber; + const char* stepType; + const char* derivedForecast; + const char* typeOfGeneratingProcess; +}; + +class grib_accessor_class_g2_mars_labeling_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_g2_mars_labeling_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_mars_labeling_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2_mars_labeling_h */ diff --git a/src/accessor/grib_accessor_class_g2bitmap.h b/src/accessor/grib_accessor_class_g2bitmap.h index 9af7a3b27..3f1b85d23 100644 --- a/src/accessor/grib_accessor_class_g2bitmap.h +++ b/src/accessor/grib_accessor_class_g2bitmap.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2bitmap_h #define eccodes_accessor_g2bitmap_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_bitmap.h" class grib_accessor_g2bitmap_t : public grib_accessor_bitmap_t diff --git a/src/accessor/grib_accessor_class_g2bitmap.h.bak b/src/accessor/grib_accessor_class_g2bitmap.h.bak new file mode 100644 index 000000000..9af7a3b27 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2bitmap.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2bitmap_h +#define eccodes_accessor_g2bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_bitmap.h" + +class grib_accessor_g2bitmap_t : public grib_accessor_bitmap_t +{ +public: + /* Members defined in g2bitmap */ + const char* numberOfValues; +}; + +class grib_accessor_class_g2bitmap_t : public grib_accessor_class_bitmap_t +{ +public: + grib_accessor_class_g2bitmap_t(const char* name) : grib_accessor_class_bitmap_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2bitmap_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2bitmap_h */ diff --git a/src/accessor/grib_accessor_class_g2bitmap_present.h b/src/accessor/grib_accessor_class_g2bitmap_present.h index 7b5cd3f66..18c7ac3f7 100644 --- a/src/accessor/grib_accessor_class_g2bitmap_present.h +++ b/src/accessor/grib_accessor_class_g2bitmap_present.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2bitmap_present_h #define eccodes_accessor_g2bitmap_present_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g2bitmap_present_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g2bitmap_present.h.bak b/src/accessor/grib_accessor_class_g2bitmap_present.h.bak new file mode 100644 index 000000000..7b5cd3f66 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2bitmap_present.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2bitmap_present_h +#define eccodes_accessor_g2bitmap_present_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g2bitmap_present_t : public grib_accessor_long_t +{ +public: + /* Members defined in g2bitmap_present */ + const char* bitmapIndicator; +}; + +class grib_accessor_class_g2bitmap_present_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g2bitmap_present_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2bitmap_present_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2bitmap_present_h */ diff --git a/src/accessor/grib_accessor_class_g2date.h b/src/accessor/grib_accessor_class_g2date.h index 20276c6fe..1c7a8a02d 100644 --- a/src/accessor/grib_accessor_class_g2date.h +++ b/src/accessor/grib_accessor_class_g2date.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2date_h #define eccodes_accessor_g2date_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g2date_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g2date.h.bak b/src/accessor/grib_accessor_class_g2date.h.bak new file mode 100644 index 000000000..20276c6fe --- /dev/null +++ b/src/accessor/grib_accessor_class_g2date.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2date_h +#define eccodes_accessor_g2date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g2date_t : public grib_accessor_long_t +{ +public: + /* Members defined in g2date */ + const char* century; + const char* year; + const char* month; + const char* day; +}; + +class grib_accessor_class_g2date_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g2date_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2date_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2date_h */ diff --git a/src/accessor/grib_accessor_class_g2end_step.h b/src/accessor/grib_accessor_class_g2end_step.h index 7a2d8ab21..b408681a0 100644 --- a/src/accessor/grib_accessor_class_g2end_step.h +++ b/src/accessor/grib_accessor_class_g2end_step.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2end_step_h #define eccodes_accessor_g2end_step_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g2end_step_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g2end_step.h.bak b/src/accessor/grib_accessor_class_g2end_step.h.bak new file mode 100644 index 000000000..7a2d8ab21 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2end_step.h.bak @@ -0,0 +1,56 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2end_step_h +#define eccodes_accessor_g2end_step_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g2end_step_t : public grib_accessor_long_t +{ +public: + /* Members defined in g2end_step */ + const char* start_step_value; + const char* step_units; + const char* year; + const char* month; + const char* day; + const char* hour; + const char* minute; + const char* second; + const char* year_of_end_of_interval; + const char* month_of_end_of_interval; + const char* day_of_end_of_interval; + const char* hour_of_end_of_interval; + const char* minute_of_end_of_interval; + const char* second_of_end_of_interval; + const char* time_range_unit; + const char* time_range_value; + const char* typeOfTimeIncrement; + const char* numberOfTimeRange; +}; + +class grib_accessor_class_g2end_step_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g2end_step_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2end_step_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2end_step_h */ diff --git a/src/accessor/grib_accessor_class_g2grid.h b/src/accessor/grib_accessor_class_g2grid.h index 0cd177ce5..25a527b69 100644 --- a/src/accessor/grib_accessor_class_g2grid.h +++ b/src/accessor/grib_accessor_class_g2grid.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2grid_h #define eccodes_accessor_g2grid_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_g2grid_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_g2grid.h.bak b/src/accessor/grib_accessor_class_g2grid.h.bak new file mode 100644 index 000000000..0cd177ce5 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2grid.h.bak @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2grid_h +#define eccodes_accessor_g2grid_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_g2grid_t : public grib_accessor_double_t +{ +public: + /* Members defined in g2grid */ + const char* latitude_first; + const char* longitude_first; + const char* latitude_last; + const char* longitude_last; + const char* i_increment; + const char* j_increment; + const char* basic_angle; + const char* sub_division; +}; + +class grib_accessor_class_g2grid_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_g2grid_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2grid_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2grid_h */ diff --git a/src/accessor/grib_accessor_class_g2latlon.h b/src/accessor/grib_accessor_class_g2latlon.h index f16e2623e..c179bdd60 100644 --- a/src/accessor/grib_accessor_class_g2latlon.h +++ b/src/accessor/grib_accessor_class_g2latlon.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2latlon_h #define eccodes_accessor_g2latlon_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_g2latlon_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_g2latlon.h.bak b/src/accessor/grib_accessor_class_g2latlon.h.bak new file mode 100644 index 000000000..f16e2623e --- /dev/null +++ b/src/accessor/grib_accessor_class_g2latlon.h.bak @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2latlon_h +#define eccodes_accessor_g2latlon_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_g2latlon_t : public grib_accessor_double_t +{ +public: + /* Members defined in g2latlon */ + const char* grid; + int index; + const char* given; +}; + +class grib_accessor_class_g2latlon_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_g2latlon_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2latlon_t{}; } + int pack_missing(grib_accessor*) override; + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2latlon_h */ diff --git a/src/accessor/grib_accessor_class_g2level.h b/src/accessor/grib_accessor_class_g2level.h index 567b8c1b4..a0163be8b 100644 --- a/src/accessor/grib_accessor_class_g2level.h +++ b/src/accessor/grib_accessor_class_g2level.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2level_h #define eccodes_accessor_g2level_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g2level_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g2level.h.bak b/src/accessor/grib_accessor_class_g2level.h.bak new file mode 100644 index 000000000..567b8c1b4 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2level.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2level_h +#define eccodes_accessor_g2level_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_g2level_t : public grib_accessor_long_t +{ +public: + /* Members defined in g2level */ + const char* type_first; + const char* scale_first; + const char* value_first; + const char* pressure_units; +}; + +class grib_accessor_class_g2level_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_g2level_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2level_t{}; } + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2level_h */ diff --git a/src/accessor/grib_accessor_class_g2lon.h b/src/accessor/grib_accessor_class_g2lon.h index d17a68c14..dd631adf4 100644 --- a/src/accessor/grib_accessor_class_g2lon.h +++ b/src/accessor/grib_accessor_class_g2lon.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2lon_h #define eccodes_accessor_g2lon_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_g2lon_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_g2lon.h.bak b/src/accessor/grib_accessor_class_g2lon.h.bak new file mode 100644 index 000000000..d17a68c14 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2lon.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2lon_h +#define eccodes_accessor_g2lon_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_g2lon_t : public grib_accessor_double_t +{ +public: + /* Members defined in g2lon */ + const char* longitude; +}; + +class grib_accessor_class_g2lon_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_g2lon_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2lon_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2lon_h */ diff --git a/src/accessor/grib_accessor_class_g2step_range.cc b/src/accessor/grib_accessor_class_g2step_range.cc index ae2b9976d..28019a783 100644 --- a/src/accessor/grib_accessor_class_g2step_range.cc +++ b/src/accessor/grib_accessor_class_g2step_range.cc @@ -11,8 +11,8 @@ #include "grib_api_internal.h" #include "grib_accessor_class_g2step_range.h" -#include "../step.h" -#include "../step_utilities.h" +#include "step.h" +#include "step_utilities.h" #include #include #include diff --git a/src/accessor/grib_accessor_class_g2step_range.h b/src/accessor/grib_accessor_class_g2step_range.h index c5a007806..45b50690c 100644 --- a/src/accessor/grib_accessor_class_g2step_range.h +++ b/src/accessor/grib_accessor_class_g2step_range.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_g2step_range_h #define eccodes_accessor_g2step_range_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_g2step_range_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_g2step_range.h.bak b/src/accessor/grib_accessor_class_g2step_range.h.bak new file mode 100644 index 000000000..c5a007806 --- /dev/null +++ b/src/accessor/grib_accessor_class_g2step_range.h.bak @@ -0,0 +1,41 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_g2step_range_h +#define eccodes_accessor_g2step_range_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_g2step_range_t : public grib_accessor_gen_t +{ +public: + /* Members defined in g2step_range */ + const char* start_step; + const char* end_step; +}; + +class grib_accessor_class_g2step_range_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_g2step_range_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_g2step_range_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_g2step_range_h */ diff --git a/src/accessor/grib_accessor_class_gaussian_grid_name.h b/src/accessor/grib_accessor_class_gaussian_grid_name.h index 1c12bfacd..a6be9dc33 100644 --- a/src/accessor/grib_accessor_class_gaussian_grid_name.h +++ b/src/accessor/grib_accessor_class_gaussian_grid_name.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_gaussian_grid_name_h #define eccodes_accessor_gaussian_grid_name_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_gaussian_grid_name_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_gaussian_grid_name.h.bak b/src/accessor/grib_accessor_class_gaussian_grid_name.h.bak new file mode 100644 index 000000000..1c12bfacd --- /dev/null +++ b/src/accessor/grib_accessor_class_gaussian_grid_name.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_gaussian_grid_name_h +#define eccodes_accessor_gaussian_grid_name_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_gaussian_grid_name_t : public grib_accessor_gen_t +{ +public: + /* Members defined in gaussian_grid_name */ + const char* N; + const char* Ni; + const char* isOctahedral; +}; + +class grib_accessor_class_gaussian_grid_name_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_gaussian_grid_name_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_gaussian_grid_name_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_gaussian_grid_name_h */ diff --git a/src/accessor/grib_accessor_class_gds_is_present.h b/src/accessor/grib_accessor_class_gds_is_present.h index fa1c5ca55..8dad7dd21 100644 --- a/src/accessor/grib_accessor_class_gds_is_present.h +++ b/src/accessor/grib_accessor_class_gds_is_present.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_gds_is_present_h #define eccodes_accessor_gds_is_present_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_gds_is_present_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_gds_is_present.h.bak b/src/accessor/grib_accessor_class_gds_is_present.h.bak new file mode 100644 index 000000000..fa1c5ca55 --- /dev/null +++ b/src/accessor/grib_accessor_class_gds_is_present.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_gds_is_present_h +#define eccodes_accessor_gds_is_present_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_gds_is_present_t : public grib_accessor_long_t +{ +public: + /* Members defined in gds_is_present */ + const char* gds_present; + const char* grid_definition; + const char* bitmap_present; + const char* values; +}; + +class grib_accessor_class_gds_is_present_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_gds_is_present_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_gds_is_present_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_gds_is_present_h */ diff --git a/src/accessor/grib_accessor_class_gds_not_present_bitmap.h b/src/accessor/grib_accessor_class_gds_not_present_bitmap.h index 68641a8e2..377fac8b4 100644 --- a/src/accessor/grib_accessor_class_gds_not_present_bitmap.h +++ b/src/accessor/grib_accessor_class_gds_not_present_bitmap.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_gds_not_present_bitmap_h #define eccodes_accessor_gds_not_present_bitmap_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_gds_not_present_bitmap_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_gds_not_present_bitmap.h.bak b/src/accessor/grib_accessor_class_gds_not_present_bitmap.h.bak new file mode 100644 index 000000000..68641a8e2 --- /dev/null +++ b/src/accessor/grib_accessor_class_gds_not_present_bitmap.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_gds_not_present_bitmap_h +#define eccodes_accessor_gds_not_present_bitmap_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_gds_not_present_bitmap_t : public grib_accessor_gen_t +{ +public: + /* Members defined in gds_not_present_bitmap */ + const char* missing_value; + const char* number_of_values; + const char* number_of_points; + const char* latitude_of_first_point; + const char* ni; +}; + +class grib_accessor_class_gds_not_present_bitmap_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_gds_not_present_bitmap_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_gds_not_present_bitmap_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_gds_not_present_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_gen.h b/src/accessor/grib_accessor_class_gen.h index 2d76361ae..9baf3e2dd 100644 --- a/src/accessor/grib_accessor_class_gen.h +++ b/src/accessor/grib_accessor_class_gen.h @@ -1,6 +1,6 @@ #pragma once -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor.h" #include diff --git a/src/accessor/grib_accessor_class_gen.h.bak b/src/accessor/grib_accessor_class_gen.h.bak new file mode 100644 index 000000000..2d76361ae --- /dev/null +++ b/src/accessor/grib_accessor_class_gen.h.bak @@ -0,0 +1,158 @@ +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor.h" +#include + +class grib_accessor_gen_t : public grib_accessor { + void init_accessor(const long, grib_arguments*) override; + void dump(grib_dumper* f) override; + int pack_missing() override; + //int grib_pack_zero(grib_accessor* a) override; + int is_missing_internal() override; + int pack_double(const double* v, size_t* len) override; + int pack_float(const float* v, size_t* len) override; + int pack_expression(grib_expression* e) override; + int pack_string(const char* v, size_t* len) override; + int pack_string_array(const char** v, size_t* len) override; + int pack_long(const long* v, size_t* len) override; + int pack_bytes(const unsigned char* v, size_t* len) override; + int unpack_bytes(unsigned char* v, size_t* len) override; + int unpack_double_subarray(double* v, size_t start, size_t len) override; + int unpack_double(double* v, size_t* len) override; + int unpack_float(float* v, size_t* len) override; + int unpack_double_element(size_t i, double* v) override; + int unpack_float_element(size_t i, float* v) override; + int unpack_double_element_set(const size_t* index_array, size_t len, double* val_array) override; + int unpack_float_element_set(const size_t* index_array, size_t len, float* val_array) override; + int unpack_string(char* v, size_t* len) override; + int unpack_string_array(char** v, size_t* len) override; + int unpack_long(long* v, size_t* len) override; + long get_native_type() override; + long get_next_position_offset() override; + long string_length() override; + long byte_offset() override; + long byte_count() override; + int value_count(long* count) override; + int notify_change(grib_accessor* changed) override; + grib_accessor* clone(grib_section* s, int* err) override; + void update_size(size_t len) override; + int nearest_smaller_value(double val, double* nearest) override; + size_t preferred_size(int from_handle) override; + grib_accessor* next_accessor() override; + void resize(size_t new_size) override; + void destroy(grib_context* ct) override; +}; + +class grib_accessor_class_gen_t : public grib_accessor_class +{ +public: + grib_accessor_class_gen_t(const char* name) : grib_accessor_class{name} {} + ~grib_accessor_class_gen_t(); + + grib_accessor* create_empty_accessor() override{ return new grib_accessor_gen_t(); } + grib_section* sub_section(grib_accessor* a) override; + int get_native_type(grib_accessor*) override; + int pack_missing(grib_accessor*) override; + int is_missing(grib_accessor*) override; + int pack_bytes(grib_accessor*, const unsigned char*, size_t* len) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_float(grib_accessor*, const float* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int pack_string_array(grib_accessor*, const char**, size_t* len) override; + int pack_expression(grib_accessor*, grib_expression*) override; + int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + size_t string_length(grib_accessor*) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void post_init(grib_accessor*) override; + int notify_change(grib_accessor*, grib_accessor*) override; + void update_size(grib_accessor*, size_t) override; + size_t preferred_size(grib_accessor*, int) override; + void resize(grib_accessor*, size_t) override; + int nearest_smaller_value(grib_accessor*, double, double*) override; + grib_accessor* next(grib_accessor*, int) override; + int compare(grib_accessor*, grib_accessor*) override; + int unpack_double_element(grib_accessor*, size_t i, double* val) override; + int unpack_float_element(grib_accessor*, size_t i, float* val) override; + int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; + int unpack_float_element_set(grib_accessor*, const size_t* index_array, size_t len, float* val_array) override; + int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len) override; + int clear(grib_accessor*) override; + grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; + + template + int unpack_helper(grib_accessor* a, T* v, size_t* len); + +private: + enum { + PACK_DOUBLE, + PACK_FLOAT, + PACK_LONG, + PACK_STRING, + UNPACK_DOUBLE, + UNPACK_FLOAT, + UNPACK_LONG, + UNPACK_STRING, + }; + std::bitset<8> is_overridden_ = 0b11111111; +}; + + +template +int grib_accessor_class_gen_t::unpack_helper(grib_accessor* a, T* v, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + int type = GRIB_TYPE_UNDEFINED; + const char* Tname = type_to_string(*v); + + if constexpr (std::is_same_v) { + is_overridden_[UNPACK_FLOAT] = 0; + } + else if constexpr (std::is_same_v) { + is_overridden_[UNPACK_DOUBLE] = 0; + } + + if (is_overridden_[UNPACK_LONG]) { + long val = 0; + size_t l = 1; + a->unpack_long(&val, &l); + if (is_overridden_[UNPACK_LONG]) { + *v = val; + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to %s", a->name, Tname); + return GRIB_SUCCESS; + } + } + + if (is_overridden_[UNPACK_STRING]) { + char val[1024]; + size_t l = sizeof(val); + char* last = NULL; + a->unpack_string(val, &l); + if (is_overridden_[UNPACK_STRING]) { + *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 %s", a->name, Tname); + return GRIB_SUCCESS; + } + } + } + + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as %s", a->name, Tname); + 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/accessor/grib_accessor_class_getenv.h.bak b/src/accessor/grib_accessor_class_getenv.h.bak new file mode 100644 index 000000000..5068dad2c --- /dev/null +++ b/src/accessor/grib_accessor_class_getenv.h.bak @@ -0,0 +1,36 @@ +/* + * (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. + */ + +#ifndef eccodes_accessor_getenv_h +#define eccodes_accessor_getenv_h + +#include "grib_accessor_class_ascii.h" + +class grib_accessor_getenv_t : public grib_accessor_ascii_t +{ +public: + const char* name; + char* value; + const char* default_value; +}; + +class grib_accessor_class_getenv_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_getenv_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_getenv_t{}; } + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; + +#endif /* eccodes_accessor_getenv_h */ diff --git a/src/accessor/grib_accessor_class_global_gaussian.h b/src/accessor/grib_accessor_class_global_gaussian.h index f1e8bf53b..5bd73dd8f 100644 --- a/src/accessor/grib_accessor_class_global_gaussian.h +++ b/src/accessor/grib_accessor_class_global_gaussian.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_global_gaussian_h #define eccodes_accessor_global_gaussian_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_global_gaussian_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_global_gaussian.h.bak b/src/accessor/grib_accessor_class_global_gaussian.h.bak new file mode 100644 index 000000000..f1e8bf53b --- /dev/null +++ b/src/accessor/grib_accessor_class_global_gaussian.h.bak @@ -0,0 +1,44 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_global_gaussian_h +#define eccodes_accessor_global_gaussian_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_global_gaussian_t : public grib_accessor_long_t +{ +public: + /* Members defined in global_gaussian */ + const char* N; + const char* Ni; + const char* di; + const char* latfirst; + const char* lonfirst; + const char* latlast; + const char* lonlast; + const char* plpresent; + const char* pl; + const char* basic_angle; + const char* subdivision; +}; + +class grib_accessor_class_global_gaussian_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_global_gaussian_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_global_gaussian_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_global_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_group.h b/src/accessor/grib_accessor_class_group.h index 085b91a8a..ab56f174e 100644 --- a/src/accessor/grib_accessor_class_group.h +++ b/src/accessor/grib_accessor_class_group.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_group_h #define eccodes_accessor_group_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_group_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_group.h.bak b/src/accessor/grib_accessor_class_group.h.bak new file mode 100644 index 000000000..085b91a8a --- /dev/null +++ b/src/accessor/grib_accessor_class_group.h.bak @@ -0,0 +1,41 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_group_h +#define eccodes_accessor_group_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_group_t : public grib_accessor_gen_t +{ +public: + /* Members defined in group */ + char endCharacter; +}; + +class grib_accessor_class_group_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_group_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_group_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_group_h */ diff --git a/src/accessor/grib_accessor_class_gts_header.h b/src/accessor/grib_accessor_class_gts_header.h index c164a9df9..15f2bfd9e 100644 --- a/src/accessor/grib_accessor_class_gts_header.h +++ b/src/accessor/grib_accessor_class_gts_header.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_gts_header_h #define eccodes_accessor_gts_header_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_gts_header_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_gts_header.h.bak b/src/accessor/grib_accessor_class_gts_header.h.bak new file mode 100644 index 000000000..c164a9df9 --- /dev/null +++ b/src/accessor/grib_accessor_class_gts_header.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_gts_header_h +#define eccodes_accessor_gts_header_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_gts_header_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in gts_header */ + int gts_offset; + int gts_length; +}; + +class grib_accessor_class_gts_header_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_gts_header_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_gts_header_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_gts_header_h */ diff --git a/src/accessor/grib_accessor_class_hash_array.h b/src/accessor/grib_accessor_class_hash_array.h index 78856c7e7..7ebd98929 100644 --- a/src/accessor/grib_accessor_class_hash_array.h +++ b/src/accessor/grib_accessor_class_hash_array.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_hash_array_h #define eccodes_accessor_hash_array_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_hash_array_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_hash_array.h.bak b/src/accessor/grib_accessor_class_hash_array.h.bak new file mode 100644 index 000000000..78856c7e7 --- /dev/null +++ b/src/accessor/grib_accessor_class_hash_array.h.bak @@ -0,0 +1,45 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_hash_array_h +#define eccodes_accessor_hash_array_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_hash_array_t : public grib_accessor_gen_t +{ +public: + /* Members defined in hash_array */ + char* key; + grib_hash_array_value* ha; +}; + +class grib_accessor_class_hash_array_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_hash_array_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_hash_array_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_hash_array_h */ diff --git a/src/accessor/grib_accessor_class_headers_only.h b/src/accessor/grib_accessor_class_headers_only.h index 29d7e8bf5..d5743cf90 100644 --- a/src/accessor/grib_accessor_class_headers_only.h +++ b/src/accessor/grib_accessor_class_headers_only.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_headers_only_h #define eccodes_accessor_headers_only_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_headers_only_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_headers_only.h.bak b/src/accessor/grib_accessor_class_headers_only.h.bak new file mode 100644 index 000000000..29d7e8bf5 --- /dev/null +++ b/src/accessor/grib_accessor_class_headers_only.h.bak @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_headers_only_h +#define eccodes_accessor_headers_only_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_headers_only_t : public grib_accessor_gen_t +{ +public: + /* Members defined in headers_only */ +}; + +class grib_accessor_class_headers_only_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_headers_only_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_headers_only_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_headers_only_h */ diff --git a/src/accessor/grib_accessor_class_ibmfloat.h b/src/accessor/grib_accessor_class_ibmfloat.h index d98864516..9291d30a3 100644 --- a/src/accessor/grib_accessor_class_ibmfloat.h +++ b/src/accessor/grib_accessor_class_ibmfloat.h @@ -11,7 +11,7 @@ #ifndef eccodes_accessor_ibmfloat_h #define eccodes_accessor_ibmfloat_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_ibmfloat_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_ibmfloat.h.bak b/src/accessor/grib_accessor_class_ibmfloat.h.bak new file mode 100644 index 000000000..d98864516 --- /dev/null +++ b/src/accessor/grib_accessor_class_ibmfloat.h.bak @@ -0,0 +1,71 @@ +/* + * (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. + */ + +#ifndef eccodes_accessor_ibmfloat_h +#define eccodes_accessor_ibmfloat_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_ibmfloat_t : public grib_accessor_double_t +{ +public: + /* Members defined in ibmfloat */ + grib_arguments* arg; +}; + +class grib_accessor_class_ibmfloat_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_ibmfloat_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_ibmfloat_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + int nearest_smaller_value(grib_accessor*, double, double*) override; +private: + template int unpack(grib_accessor*, T*, size_t*); +}; + + +template +int grib_accessor_class_ibmfloat_t::unpack(grib_accessor* a, T* val, size_t* len){ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + unsigned long rlen = 0; + long count = 0; + int err = 0; + unsigned long i = 0; + long bitp = a->offset * 8; + grib_handle* hand = grib_handle_of_accessor(a); + + err = a->value_count(&count); if (err) + return err; + rlen = count; + + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %lu values", *len, a->name, rlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < rlen; i++) + val[i] = (T)grib_long_to_ibm(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); + + *len = rlen; + return GRIB_SUCCESS; +} + +#endif /* eccodes_accessor_ibmfloat_h */ diff --git a/src/accessor/grib_accessor_class_ieeefloat.h.bak b/src/accessor/grib_accessor_class_ieeefloat.h.bak new file mode 100644 index 000000000..100b2ad6a --- /dev/null +++ b/src/accessor/grib_accessor_class_ieeefloat.h.bak @@ -0,0 +1,66 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_ieeefloat_h +#define eccodes_accessor_ieeefloat_h + +#include "grib_accessor_class_double.h" + +class grib_accessor_ieeefloat_t : public grib_accessor_double_t +{ +public: + grib_arguments* arg; +}; + +class grib_accessor_class_ieeefloat_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_ieeefloat_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_ieeefloat_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + int nearest_smaller_value(grib_accessor* a, double val, double* nearest) override; + +private: + template int unpack(grib_accessor*, T*, size_t*); +}; + + +template +int grib_accessor_class_ieeefloat_t::unpack(grib_accessor* a, T* val, size_t* len){ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + long rlen = 0; + int err = 0; + long i = 0; + long bitp = a->offset * 8; + grib_handle* hand = grib_handle_of_accessor(a); + + err = a->value_count(&rlen); if (err) + return err; + + if (*len < (size_t)rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %ld values", *len, a->name, rlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < rlen; i++) + val[i] = (T)grib_long_to_ieee(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); + + *len = rlen; + return GRIB_SUCCESS; +} + +#endif /* eccodes_accessor_ieeefloat_h */ diff --git a/src/accessor/grib_accessor_class_ifs_param.h b/src/accessor/grib_accessor_class_ifs_param.h index d41da1723..b9fe2bd33 100644 --- a/src/accessor/grib_accessor_class_ifs_param.h +++ b/src/accessor/grib_accessor_class_ifs_param.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_ifs_param_h #define eccodes_accessor_ifs_param_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_ifs_param_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_ifs_param.h.bak b/src/accessor/grib_accessor_class_ifs_param.h.bak new file mode 100644 index 000000000..d41da1723 --- /dev/null +++ b/src/accessor/grib_accessor_class_ifs_param.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_ifs_param_h +#define eccodes_accessor_ifs_param_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_ifs_param_t : public grib_accessor_gen_t +{ +public: + /* Members defined in ifs_param */ + const char* paramId; + const char* type; +}; + +class grib_accessor_class_ifs_param_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_ifs_param_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_ifs_param_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_ifs_param_h */ diff --git a/src/accessor/grib_accessor_class_iterator.h b/src/accessor/grib_accessor_class_iterator.h index 7288fa205..5f809c90e 100644 --- a/src/accessor/grib_accessor_class_iterator.h +++ b/src/accessor/grib_accessor_class_iterator.h @@ -14,7 +14,7 @@ #pragma once -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_iterator_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_iterator.h.bak b/src/accessor/grib_accessor_class_iterator.h.bak new file mode 100644 index 000000000..7288fa205 --- /dev/null +++ b/src/accessor/grib_accessor_class_iterator.h.bak @@ -0,0 +1,36 @@ +/* + * (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. + */ + +/*************************** + * Enrico Fucile + *************************/ + +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_iterator_t : public grib_accessor_gen_t +{ +public: + grib_arguments* args; +}; + +class grib_accessor_class_iterator_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_iterator_t(const char* name) : grib_accessor_class_gen_t(name) {}; + grib_accessor* create_empty_accessor() override { return new grib_accessor_iterator_t{}; } + void init(grib_accessor* a, const long l, grib_arguments* args) override; + void dump(grib_accessor* a, grib_dumper* dumper) override; +}; + + +//grib_iterator* grib_iterator_new(const grib_handle* ch, unsigned long flags, int* error) diff --git a/src/accessor/grib_accessor_class_julian_date.h b/src/accessor/grib_accessor_class_julian_date.h index 68008fec6..944e85996 100644 --- a/src/accessor/grib_accessor_class_julian_date.h +++ b/src/accessor/grib_accessor_class_julian_date.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_julian_date_h #define eccodes_accessor_julian_date_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_julian_date_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_julian_date.h.bak b/src/accessor/grib_accessor_class_julian_date.h.bak new file mode 100644 index 000000000..68008fec6 --- /dev/null +++ b/src/accessor/grib_accessor_class_julian_date.h.bak @@ -0,0 +1,48 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_julian_date_h +#define eccodes_accessor_julian_date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_julian_date_t : public grib_accessor_double_t +{ +public: + /* Members defined in julian_date */ + const char *year; + const char *month; + const char *day; + const char *hour; + const char *minute; + const char *second; + const char *ymd; + const char *hms; + char sep[5]; +}; + +class grib_accessor_class_julian_date_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_julian_date_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_julian_date_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int pack_expression(grib_accessor*, grib_expression*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_julian_date_h */ diff --git a/src/accessor/grib_accessor_class_julian_day.h b/src/accessor/grib_accessor_class_julian_day.h index 1d21fb920..b31f3b0dd 100644 --- a/src/accessor/grib_accessor_class_julian_day.h +++ b/src/accessor/grib_accessor_class_julian_day.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_julian_day_h #define eccodes_accessor_julian_day_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_julian_day_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_julian_day.h.bak b/src/accessor/grib_accessor_class_julian_day.h.bak new file mode 100644 index 000000000..1d21fb920 --- /dev/null +++ b/src/accessor/grib_accessor_class_julian_day.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_julian_day_h +#define eccodes_accessor_julian_day_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_julian_day_t : public grib_accessor_double_t +{ +public: + /* Members defined in julian_day */ + const char *date; + const char *hour; + const char *minute; + const char *second; +}; + +class grib_accessor_class_julian_day_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_julian_day_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_julian_day_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_julian_day_h */ diff --git a/src/accessor/grib_accessor_class_ksec1expver.h b/src/accessor/grib_accessor_class_ksec1expver.h index 3884a7709..ca0a18695 100644 --- a/src/accessor/grib_accessor_class_ksec1expver.h +++ b/src/accessor/grib_accessor_class_ksec1expver.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_ksec1expver_h #define eccodes_accessor_ksec1expver_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_ksec1expver_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_ksec1expver.h.bak b/src/accessor/grib_accessor_class_ksec1expver.h.bak new file mode 100644 index 000000000..3884a7709 --- /dev/null +++ b/src/accessor/grib_accessor_class_ksec1expver.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_ksec1expver_h +#define eccodes_accessor_ksec1expver_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_ksec1expver_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in ksec1expver */ +}; + +class grib_accessor_class_ksec1expver_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_ksec1expver_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_ksec1expver_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_ksec1expver_h */ diff --git a/src/accessor/grib_accessor_class_label.h b/src/accessor/grib_accessor_class_label.h index c4e64b322..01b7ac392 100644 --- a/src/accessor/grib_accessor_class_label.h +++ b/src/accessor/grib_accessor_class_label.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_label_h #define eccodes_accessor_label_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_label_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_label.h.bak b/src/accessor/grib_accessor_class_label.h.bak new file mode 100644 index 000000000..c4e64b322 --- /dev/null +++ b/src/accessor/grib_accessor_class_label.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_label_h +#define eccodes_accessor_label_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_label_t : public grib_accessor_gen_t +{ +public: + /* Members defined in label */ +}; + +class grib_accessor_class_label_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_label_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_label_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_label_h */ diff --git a/src/accessor/grib_accessor_class_latitudes.h b/src/accessor/grib_accessor_class_latitudes.h index 10344c7cb..e89db49e4 100644 --- a/src/accessor/grib_accessor_class_latitudes.h +++ b/src/accessor/grib_accessor_class_latitudes.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_latitudes_h #define eccodes_accessor_latitudes_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_latitudes_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_latitudes.h.bak b/src/accessor/grib_accessor_class_latitudes.h.bak new file mode 100644 index 000000000..10344c7cb --- /dev/null +++ b/src/accessor/grib_accessor_class_latitudes.h.bak @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_latitudes_h +#define eccodes_accessor_latitudes_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_latitudes_t : public grib_accessor_double_t +{ +public: + /* Members defined in latitudes */ + const char* values; + long distinct; + double* lats; + long size; + int save; +}; + +class grib_accessor_class_latitudes_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_latitudes_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_latitudes_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_latitudes_h */ diff --git a/src/accessor/grib_accessor_class_latlon_increment.h b/src/accessor/grib_accessor_class_latlon_increment.h index 4f5402e6a..e85d1ec91 100644 --- a/src/accessor/grib_accessor_class_latlon_increment.h +++ b/src/accessor/grib_accessor_class_latlon_increment.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_latlon_increment_h #define eccodes_accessor_latlon_increment_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_latlon_increment_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_latlon_increment.h.bak b/src/accessor/grib_accessor_class_latlon_increment.h.bak new file mode 100644 index 000000000..4f5402e6a --- /dev/null +++ b/src/accessor/grib_accessor_class_latlon_increment.h.bak @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_latlon_increment_h +#define eccodes_accessor_latlon_increment_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_latlon_increment_t : public grib_accessor_double_t +{ +public: + /* Members defined in latlon_increment */ + const char* directionIncrementGiven; + const char* directionIncrement; + const char* scansPositively; + const char* first; + const char* last; + const char* numberOfPoints; + const char* angleMultiplier; + const char* angleDivisor; + long isLongitude; +}; + +class grib_accessor_class_latlon_increment_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_latlon_increment_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_latlon_increment_t{}; } + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_latlon_increment_h */ diff --git a/src/accessor/grib_accessor_class_latlonvalues.h b/src/accessor/grib_accessor_class_latlonvalues.h index ed040f543..56faec4d9 100644 --- a/src/accessor/grib_accessor_class_latlonvalues.h +++ b/src/accessor/grib_accessor_class_latlonvalues.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_latlonvalues_h #define eccodes_accessor_latlonvalues_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_latlonvalues_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_latlonvalues.h.bak b/src/accessor/grib_accessor_class_latlonvalues.h.bak new file mode 100644 index 000000000..ed040f543 --- /dev/null +++ b/src/accessor/grib_accessor_class_latlonvalues.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_latlonvalues_h +#define eccodes_accessor_latlonvalues_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_latlonvalues_t : public grib_accessor_double_t +{ +public: + /* Members defined in latlonvalues */ + const char* values; +}; + +class grib_accessor_class_latlonvalues_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_latlonvalues_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_latlonvalues_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_latlonvalues_h */ diff --git a/src/accessor/grib_accessor_class_library_version.h b/src/accessor/grib_accessor_class_library_version.h index 28de10364..66099c2c0 100644 --- a/src/accessor/grib_accessor_class_library_version.h +++ b/src/accessor/grib_accessor_class_library_version.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_library_version_h #define eccodes_accessor_library_version_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_library_version_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_library_version.h.bak b/src/accessor/grib_accessor_class_library_version.h.bak new file mode 100644 index 000000000..28de10364 --- /dev/null +++ b/src/accessor/grib_accessor_class_library_version.h.bak @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_library_version_h +#define eccodes_accessor_library_version_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_library_version_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in library_version */ +}; + +class grib_accessor_class_library_version_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_library_version_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_library_version_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; +}; +#endif /* eccodes_accessor_library_version_h */ diff --git a/src/accessor/grib_accessor_class_local_definition.h b/src/accessor/grib_accessor_class_local_definition.h index 296bab69d..9be7d7e9a 100644 --- a/src/accessor/grib_accessor_class_local_definition.h +++ b/src/accessor/grib_accessor_class_local_definition.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_local_definition_h #define eccodes_accessor_local_definition_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_local_definition_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_local_definition.h.bak b/src/accessor/grib_accessor_class_local_definition.h.bak new file mode 100644 index 000000000..296bab69d --- /dev/null +++ b/src/accessor/grib_accessor_class_local_definition.h.bak @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_local_definition_h +#define eccodes_accessor_local_definition_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_local_definition_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in local_definition */ + const char* productDefinitionTemplateNumber; + const char* productDefinitionTemplateNumberInternal; + const char* grib2LocalSectionNumber; + const char* type; + const char* stream; + const char* the_class; + const char* eps; + const char* stepType; + const char* derivedForecast; +}; + +class grib_accessor_class_local_definition_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_local_definition_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_local_definition_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_local_definition_h */ diff --git a/src/accessor/grib_accessor_class_long.h b/src/accessor/grib_accessor_class_long.h index a0b01f9ae..acabf2612 100644 --- a/src/accessor/grib_accessor_class_long.h +++ b/src/accessor/grib_accessor_class_long.h @@ -1,6 +1,6 @@ #pragma once -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_long_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_long.h.bak b/src/accessor/grib_accessor_class_long.h.bak new file mode 100644 index 000000000..a0b01f9ae --- /dev/null +++ b/src/accessor/grib_accessor_class_long.h.bak @@ -0,0 +1,22 @@ +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_long_t : public grib_accessor_gen_t +{}; + +class grib_accessor_class_long_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_long_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_long_t{}; } + void init(grib_accessor* a, const long len, grib_arguments* arg) override; + int get_native_type(grib_accessor* a) override; + int pack_missing(grib_accessor* a) override; + int pack_string(grib_accessor* a, const char*, size_t* len) override; + int unpack_double(grib_accessor* a, double* val, size_t* len) override; + int unpack_string(grib_accessor* a, char*, size_t* len) override; + void dump(grib_accessor* a, grib_dumper*) override; + int compare(grib_accessor* a, grib_accessor*) override; +}; diff --git a/src/accessor/grib_accessor_class_long_vector.h b/src/accessor/grib_accessor_class_long_vector.h index 66fab29e6..b2d3a4a67 100644 --- a/src/accessor/grib_accessor_class_long_vector.h +++ b/src/accessor/grib_accessor_class_long_vector.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_long_vector_h #define eccodes_accessor_long_vector_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_abstract_long_vector.h" class grib_accessor_long_vector_t : public grib_accessor_abstract_long_vector_t diff --git a/src/accessor/grib_accessor_class_long_vector.h.bak b/src/accessor/grib_accessor_class_long_vector.h.bak new file mode 100644 index 000000000..66fab29e6 --- /dev/null +++ b/src/accessor/grib_accessor_class_long_vector.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_long_vector_h +#define eccodes_accessor_long_vector_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_abstract_long_vector.h" + +class grib_accessor_long_vector_t : public grib_accessor_abstract_long_vector_t +{ +public: + /* Members defined in long_vector */ + const char* vector; + int index; +}; + +class grib_accessor_class_long_vector_t : public grib_accessor_class_abstract_long_vector_t +{ +public: + grib_accessor_class_long_vector_t(const char* name) : grib_accessor_class_abstract_long_vector_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_long_vector_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_long_vector_h */ diff --git a/src/accessor/grib_accessor_class_longitudes.h b/src/accessor/grib_accessor_class_longitudes.h index 782b4d764..0825f5a90 100644 --- a/src/accessor/grib_accessor_class_longitudes.h +++ b/src/accessor/grib_accessor_class_longitudes.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_longitudes_h #define eccodes_accessor_longitudes_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_longitudes_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_longitudes.h.bak b/src/accessor/grib_accessor_class_longitudes.h.bak new file mode 100644 index 000000000..782b4d764 --- /dev/null +++ b/src/accessor/grib_accessor_class_longitudes.h.bak @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_longitudes_h +#define eccodes_accessor_longitudes_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_longitudes_t : public grib_accessor_double_t +{ +public: + /* Members defined in longitudes */ + const char* values; + long distinct; + double* lons; + long size; + int save; +}; + +class grib_accessor_class_longitudes_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_longitudes_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_longitudes_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_longitudes_h */ diff --git a/src/accessor/grib_accessor_class_lookup.h.bak b/src/accessor/grib_accessor_class_lookup.h.bak new file mode 100644 index 000000000..1fba42fe5 --- /dev/null +++ b/src/accessor/grib_accessor_class_lookup.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_lookup_h +#define eccodes_accessor_lookup_h + +#include "grib_accessor_class_long.h" + +class grib_accessor_lookup_t : public grib_accessor_long_t +{ +public: + long llength; + long loffset; + grib_expression* real_name; +}; + +class grib_accessor_class_lookup_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_lookup_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_lookup_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void post_init(grib_accessor*) override; + int notify_change(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_lookup_h */ diff --git a/src/accessor/grib_accessor_class_mars_param.h b/src/accessor/grib_accessor_class_mars_param.h index 87bcaad41..87400a5f7 100644 --- a/src/accessor/grib_accessor_class_mars_param.h +++ b/src/accessor/grib_accessor_class_mars_param.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_mars_param_h #define eccodes_accessor_mars_param_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_mars_param_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_mars_param.h.bak b/src/accessor/grib_accessor_class_mars_param.h.bak new file mode 100644 index 000000000..87bcaad41 --- /dev/null +++ b/src/accessor/grib_accessor_class_mars_param.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_mars_param_h +#define eccodes_accessor_mars_param_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_mars_param_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in mars_param */ + const char* paramId; + const char* table; + const char* param; +}; + +class grib_accessor_class_mars_param_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_mars_param_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_mars_param_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_mars_param_h */ diff --git a/src/accessor/grib_accessor_class_mars_step.h b/src/accessor/grib_accessor_class_mars_step.h index db3042648..67d95ef9a 100644 --- a/src/accessor/grib_accessor_class_mars_step.h +++ b/src/accessor/grib_accessor_class_mars_step.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_mars_step_h #define eccodes_accessor_mars_step_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_mars_step_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_mars_step.h.bak b/src/accessor/grib_accessor_class_mars_step.h.bak new file mode 100644 index 000000000..db3042648 --- /dev/null +++ b/src/accessor/grib_accessor_class_mars_step.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_mars_step_h +#define eccodes_accessor_mars_step_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_mars_step_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in mars_step */ + const char* stepRange; + const char* stepType; +}; + +class grib_accessor_class_mars_step_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_mars_step_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_mars_step_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_mars_step_h */ diff --git a/src/accessor/grib_accessor_class_md5.h b/src/accessor/grib_accessor_class_md5.h index 8d819cc9d..7b265f797 100644 --- a/src/accessor/grib_accessor_class_md5.h +++ b/src/accessor/grib_accessor_class_md5.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_md5_h #define eccodes_accessor_md5_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_md5_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_md5.h.bak b/src/accessor/grib_accessor_class_md5.h.bak new file mode 100644 index 000000000..8d819cc9d --- /dev/null +++ b/src/accessor/grib_accessor_class_md5.h.bak @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_md5_h +#define eccodes_accessor_md5_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_md5_t : public grib_accessor_gen_t +{ +public: + /* Members defined in md5 */ + const char* offset; + grib_expression* length; + grib_string_list* blocklist; +}; + +class grib_accessor_class_md5_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_md5_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_md5_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_md5_h */ diff --git a/src/accessor/grib_accessor_class_message.h b/src/accessor/grib_accessor_class_message.h index 912e8be4b..c81e23750 100644 --- a/src/accessor/grib_accessor_class_message.h +++ b/src/accessor/grib_accessor_class_message.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_message_h #define eccodes_accessor_message_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_bytes.h" class grib_accessor_message_t : public grib_accessor_bytes_t diff --git a/src/accessor/grib_accessor_class_message.h.bak b/src/accessor/grib_accessor_class_message.h.bak new file mode 100644 index 000000000..912e8be4b --- /dev/null +++ b/src/accessor/grib_accessor_class_message.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_message_h +#define eccodes_accessor_message_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_bytes.h" + +class grib_accessor_message_t : public grib_accessor_bytes_t +{ +public: + /* Members defined in message */ +}; + +class grib_accessor_class_message_t : public grib_accessor_class_bytes_t +{ +public: + grib_accessor_class_message_t(const char* name) : grib_accessor_class_bytes_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_message_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + void resize(grib_accessor*,size_t) override; +}; +#endif /* eccodes_accessor_message_h */ diff --git a/src/accessor/grib_accessor_class_message_copy.h b/src/accessor/grib_accessor_class_message_copy.h index 37072c685..53002c968 100644 --- a/src/accessor/grib_accessor_class_message_copy.h +++ b/src/accessor/grib_accessor_class_message_copy.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_message_copy_h #define eccodes_accessor_message_copy_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_message_copy_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_message_copy.h.bak b/src/accessor/grib_accessor_class_message_copy.h.bak new file mode 100644 index 000000000..37072c685 --- /dev/null +++ b/src/accessor/grib_accessor_class_message_copy.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_message_copy_h +#define eccodes_accessor_message_copy_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_message_copy_t : public grib_accessor_gen_t +{ +public: + /* Members defined in message_copy */ +}; + +class grib_accessor_class_message_copy_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_message_copy_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_message_copy_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long byte_count(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_message_copy_h */ diff --git a/src/accessor/grib_accessor_class_multdouble.h b/src/accessor/grib_accessor_class_multdouble.h index 9d6d76285..c9847dde1 100644 --- a/src/accessor/grib_accessor_class_multdouble.h +++ b/src/accessor/grib_accessor_class_multdouble.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_multdouble_h #define eccodes_accessor_multdouble_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_multdouble_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_multdouble.h.bak b/src/accessor/grib_accessor_class_multdouble.h.bak new file mode 100644 index 000000000..9d6d76285 --- /dev/null +++ b/src/accessor/grib_accessor_class_multdouble.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_multdouble_h +#define eccodes_accessor_multdouble_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_multdouble_t : public grib_accessor_double_t +{ +public: + /* Members defined in multdouble */ + const char* val; + double multiplier; +}; + +class grib_accessor_class_multdouble_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_multdouble_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_multdouble_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_multdouble_h */ diff --git a/src/accessor/grib_accessor_class_nearest.h b/src/accessor/grib_accessor_class_nearest.h index 831afea60..098eb69a8 100644 --- a/src/accessor/grib_accessor_class_nearest.h +++ b/src/accessor/grib_accessor_class_nearest.h @@ -10,7 +10,7 @@ #pragma once -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_nearest_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_nearest.h.bak b/src/accessor/grib_accessor_class_nearest.h.bak new file mode 100644 index 000000000..831afea60 --- /dev/null +++ b/src/accessor/grib_accessor_class_nearest.h.bak @@ -0,0 +1,33 @@ +/* + * (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. + */ + +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_nearest_t : public grib_accessor_gen_t +{ +public: + grib_arguments* args; +}; + + +class grib_accessor_class_nearest_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_nearest_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_nearest_t{}; } + void init(grib_accessor* a, const long l, grib_arguments* args) override; + void dump(grib_accessor* a, grib_dumper* dumper) override; +}; + + +//grib_nearest* grib_nearest_new(const grib_handle* ch, int* error); diff --git a/src/accessor/grib_accessor_class_non_alpha.h b/src/accessor/grib_accessor_class_non_alpha.h index 1b1b9d830..e9f910723 100644 --- a/src/accessor/grib_accessor_class_non_alpha.h +++ b/src/accessor/grib_accessor_class_non_alpha.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_non_alpha_h #define eccodes_accessor_non_alpha_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_non_alpha_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_non_alpha.h.bak b/src/accessor/grib_accessor_class_non_alpha.h.bak new file mode 100644 index 000000000..1b1b9d830 --- /dev/null +++ b/src/accessor/grib_accessor_class_non_alpha.h.bak @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_non_alpha_h +#define eccodes_accessor_non_alpha_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_non_alpha_t : public grib_accessor_gen_t +{ +public: + /* Members defined in non_alpha */ +}; + +class grib_accessor_class_non_alpha_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_non_alpha_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_non_alpha_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_non_alpha_h */ diff --git a/src/accessor/grib_accessor_class_number_of_coded_values.h b/src/accessor/grib_accessor_class_number_of_coded_values.h index de5e3b76b..7cb74d1c2 100644 --- a/src/accessor/grib_accessor_class_number_of_coded_values.h +++ b/src/accessor/grib_accessor_class_number_of_coded_values.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_number_of_coded_values_h #define eccodes_accessor_number_of_coded_values_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_number_of_coded_values_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_number_of_coded_values.h.bak b/src/accessor/grib_accessor_class_number_of_coded_values.h.bak new file mode 100644 index 000000000..de5e3b76b --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_coded_values.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_number_of_coded_values_h +#define eccodes_accessor_number_of_coded_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_number_of_coded_values_t : public grib_accessor_long_t +{ +public: + /* Members defined in number_of_coded_values */ + const char* numberOfValues; + const char* bitsPerValue; + const char* offsetBeforeData; + const char* offsetAfterData; + const char* unusedBits; +}; + +class grib_accessor_class_number_of_coded_values_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_number_of_coded_values_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_coded_values_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_number_of_coded_values_h */ diff --git a/src/accessor/grib_accessor_class_number_of_points.h b/src/accessor/grib_accessor_class_number_of_points.h index db3521c05..3ca18b6e9 100644 --- a/src/accessor/grib_accessor_class_number_of_points.h +++ b/src/accessor/grib_accessor_class_number_of_points.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_number_of_points_h #define eccodes_accessor_number_of_points_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_number_of_points_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_number_of_points.h.bak b/src/accessor/grib_accessor_class_number_of_points.h.bak new file mode 100644 index 000000000..db3521c05 --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_points.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_number_of_points_h +#define eccodes_accessor_number_of_points_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_number_of_points_t : public grib_accessor_long_t +{ +public: + /* Members defined in number_of_points */ + const char* ni; + const char* nj; + const char* plpresent; + const char* pl; +}; + +class grib_accessor_class_number_of_points_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_number_of_points_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_points_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_number_of_points_h */ diff --git a/src/accessor/grib_accessor_class_number_of_points_gaussian.h b/src/accessor/grib_accessor_class_number_of_points_gaussian.h index f01224f17..70ba3d6d4 100644 --- a/src/accessor/grib_accessor_class_number_of_points_gaussian.h +++ b/src/accessor/grib_accessor_class_number_of_points_gaussian.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_number_of_points_gaussian_h #define eccodes_accessor_number_of_points_gaussian_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_number_of_points_gaussian_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_number_of_points_gaussian.h.bak b/src/accessor/grib_accessor_class_number_of_points_gaussian.h.bak new file mode 100644 index 000000000..f01224f17 --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_points_gaussian.h.bak @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_number_of_points_gaussian_h +#define eccodes_accessor_number_of_points_gaussian_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_number_of_points_gaussian_t : public grib_accessor_long_t +{ +public: + /* Members defined in number_of_points_gaussian */ + const char* ni; + const char* nj; + const char* plpresent; + const char* pl; + const char* order; + const char* lat_first; + const char* lon_first; + const char* lat_last; + const char* lon_last; + const char* support_legacy; +}; + +class grib_accessor_class_number_of_points_gaussian_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_number_of_points_gaussian_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_points_gaussian_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_number_of_points_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_number_of_values.h b/src/accessor/grib_accessor_class_number_of_values.h index 88b18cd6f..246c29cbd 100644 --- a/src/accessor/grib_accessor_class_number_of_values.h +++ b/src/accessor/grib_accessor_class_number_of_values.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_number_of_values_h #define eccodes_accessor_number_of_values_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_number_of_values_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_number_of_values.h.bak b/src/accessor/grib_accessor_class_number_of_values.h.bak new file mode 100644 index 000000000..88b18cd6f --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_values.h.bak @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_number_of_values_h +#define eccodes_accessor_number_of_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_number_of_values_t : public grib_accessor_long_t +{ +public: + /* Members defined in number_of_values */ + const char* values; + const char* bitsPerValue; + const char* numberOfPoints; + const char* bitmapPresent; + const char* bitmap; + const char* numberOfCodedValues; +}; + +class grib_accessor_class_number_of_values_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_number_of_values_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_values_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_number_of_values_h */ diff --git a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h index c0a6e9fcb..ff57531d2 100644 --- a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h +++ b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_number_of_values_data_raw_packing_h #define eccodes_accessor_number_of_values_data_raw_packing_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_number_of_values_data_raw_packing_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h.bak b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h.bak new file mode 100644 index 000000000..c0a6e9fcb --- /dev/null +++ b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_number_of_values_data_raw_packing_h +#define eccodes_accessor_number_of_values_data_raw_packing_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_number_of_values_data_raw_packing_t : public grib_accessor_gen_t +{ +public: + /* Members defined in number_of_values_data_raw_packing */ + const char* values; + const char* precision; +}; + +class grib_accessor_class_number_of_values_data_raw_packing_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_number_of_values_data_raw_packing_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_values_data_raw_packing_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_number_of_values_data_raw_packing_h */ diff --git a/src/accessor/grib_accessor_class_octahedral_gaussian.h b/src/accessor/grib_accessor_class_octahedral_gaussian.h index 31784d000..f9aee3d78 100644 --- a/src/accessor/grib_accessor_class_octahedral_gaussian.h +++ b/src/accessor/grib_accessor_class_octahedral_gaussian.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_octahedral_gaussian_h #define eccodes_accessor_octahedral_gaussian_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_octahedral_gaussian_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_octahedral_gaussian.h.bak b/src/accessor/grib_accessor_class_octahedral_gaussian.h.bak new file mode 100644 index 000000000..31784d000 --- /dev/null +++ b/src/accessor/grib_accessor_class_octahedral_gaussian.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_octahedral_gaussian_h +#define eccodes_accessor_octahedral_gaussian_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_octahedral_gaussian_t : public grib_accessor_long_t +{ +public: + /* Members defined in octahedral_gaussian */ + const char* N; + const char* Ni; + const char* plpresent; + const char* pl; +}; + +class grib_accessor_class_octahedral_gaussian_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_octahedral_gaussian_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_octahedral_gaussian_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_octahedral_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_octet_number.h b/src/accessor/grib_accessor_class_octet_number.h index 4d6145742..6be9134af 100644 --- a/src/accessor/grib_accessor_class_octet_number.h +++ b/src/accessor/grib_accessor_class_octet_number.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_octet_number_h #define eccodes_accessor_octet_number_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_octet_number_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_octet_number.h.bak b/src/accessor/grib_accessor_class_octet_number.h.bak new file mode 100644 index 000000000..4d6145742 --- /dev/null +++ b/src/accessor/grib_accessor_class_octet_number.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_octet_number_h +#define eccodes_accessor_octet_number_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_octet_number_t : public grib_accessor_long_t +{ +public: + /* Members defined in octet_number */ + const char* left; + long right; +}; + +class grib_accessor_class_octet_number_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_octet_number_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_octet_number_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_octet_number_h */ diff --git a/src/accessor/grib_accessor_class_offset_file.h b/src/accessor/grib_accessor_class_offset_file.h index 34243b5a4..8806590f7 100644 --- a/src/accessor/grib_accessor_class_offset_file.h +++ b/src/accessor/grib_accessor_class_offset_file.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_offset_file_h #define eccodes_accessor_offset_file_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_offset_file_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_offset_file.h.bak b/src/accessor/grib_accessor_class_offset_file.h.bak new file mode 100644 index 000000000..34243b5a4 --- /dev/null +++ b/src/accessor/grib_accessor_class_offset_file.h.bak @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_offset_file_h +#define eccodes_accessor_offset_file_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_offset_file_t : public grib_accessor_double_t +{ +public: + /* Members defined in offset_file */ +}; + +class grib_accessor_class_offset_file_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_offset_file_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_offset_file_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_offset_file_h */ diff --git a/src/accessor/grib_accessor_class_offset_values.h b/src/accessor/grib_accessor_class_offset_values.h index 51e0f0f16..17d31a91a 100644 --- a/src/accessor/grib_accessor_class_offset_values.h +++ b/src/accessor/grib_accessor_class_offset_values.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_offset_values_h #define eccodes_accessor_offset_values_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_offset_values_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_offset_values.h.bak b/src/accessor/grib_accessor_class_offset_values.h.bak new file mode 100644 index 000000000..51e0f0f16 --- /dev/null +++ b/src/accessor/grib_accessor_class_offset_values.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_offset_values_h +#define eccodes_accessor_offset_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_offset_values_t : public grib_accessor_double_t +{ +public: + /* Members defined in offset_values */ + const char* values; + const char* missingValue; +}; + +class grib_accessor_class_offset_values_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_offset_values_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_offset_values_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_offset_values_h */ diff --git a/src/accessor/grib_accessor_class_optimal_step_units.h b/src/accessor/grib_accessor_class_optimal_step_units.h index 96383b291..5ab2249ae 100644 --- a/src/accessor/grib_accessor_class_optimal_step_units.h +++ b/src/accessor/grib_accessor_class_optimal_step_units.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_optimal_step_units_h #define eccodes_accessor_optimal_step_units_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_optimal_step_units_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_optimal_step_units.h.bak b/src/accessor/grib_accessor_class_optimal_step_units.h.bak new file mode 100644 index 000000000..96383b291 --- /dev/null +++ b/src/accessor/grib_accessor_class_optimal_step_units.h.bak @@ -0,0 +1,44 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_optimal_step_units_h +#define eccodes_accessor_optimal_step_units_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_optimal_step_units_t : public grib_accessor_gen_t +{ +public: + /* Members defined in optimal_step_units */ + const char* forecast_time_value; + const char* forecast_time_unit; + const char* time_range_value; + const char* time_range_unit; +}; + +class grib_accessor_class_optimal_step_units_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_optimal_step_units_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_optimal_step_units_t{}; } + int get_native_type(grib_accessor*) override; + int is_missing(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int pack_expression(grib_accessor*, grib_expression*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_optimal_step_units_h */ diff --git a/src/accessor/grib_accessor_class_pack_bufr_values.h b/src/accessor/grib_accessor_class_pack_bufr_values.h index b4bdaf43c..feef9ef37 100644 --- a/src/accessor/grib_accessor_class_pack_bufr_values.h +++ b/src/accessor/grib_accessor_class_pack_bufr_values.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_pack_bufr_values_h #define eccodes_accessor_pack_bufr_values_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_pack_bufr_values_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_pack_bufr_values.h.bak b/src/accessor/grib_accessor_class_pack_bufr_values.h.bak new file mode 100644 index 000000000..b4bdaf43c --- /dev/null +++ b/src/accessor/grib_accessor_class_pack_bufr_values.h.bak @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_pack_bufr_values_h +#define eccodes_accessor_pack_bufr_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_pack_bufr_values_t : public grib_accessor_gen_t +{ +public: + /* Members defined in pack_bufr_values */ + grib_accessor* data_accessor; +}; + +class grib_accessor_class_pack_bufr_values_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_pack_bufr_values_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_pack_bufr_values_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_pack_bufr_values_h */ diff --git a/src/accessor/grib_accessor_class_packing_type.h b/src/accessor/grib_accessor_class_packing_type.h index 3451db189..69c52f866 100644 --- a/src/accessor/grib_accessor_class_packing_type.h +++ b/src/accessor/grib_accessor_class_packing_type.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_packing_type_h #define eccodes_accessor_packing_type_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_packing_type_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_packing_type.h.bak b/src/accessor/grib_accessor_class_packing_type.h.bak new file mode 100644 index 000000000..3451db189 --- /dev/null +++ b/src/accessor/grib_accessor_class_packing_type.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_packing_type_h +#define eccodes_accessor_packing_type_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_packing_type_t : public grib_accessor_gen_t +{ +public: + /* Members defined in packing_type */ + const char* values; + const char* packing_type; +}; + +class grib_accessor_class_packing_type_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_packing_type_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_packing_type_t{}; } + int get_native_type(grib_accessor*) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_packing_type_h */ diff --git a/src/accessor/grib_accessor_class_pad.h b/src/accessor/grib_accessor_class_pad.h index 8ca8bb09b..28fefc891 100644 --- a/src/accessor/grib_accessor_class_pad.h +++ b/src/accessor/grib_accessor_class_pad.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_pad_h #define eccodes_accessor_pad_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_padding.h" class grib_accessor_pad_t : public grib_accessor_padding_t diff --git a/src/accessor/grib_accessor_class_pad.h.bak b/src/accessor/grib_accessor_class_pad.h.bak new file mode 100644 index 000000000..8ca8bb09b --- /dev/null +++ b/src/accessor/grib_accessor_class_pad.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_pad_h +#define eccodes_accessor_pad_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_padding.h" + +class grib_accessor_pad_t : public grib_accessor_padding_t +{ +public: + /* Members defined in padding */ + /* Members defined in pad */ + grib_expression* expression; +}; + +class grib_accessor_class_pad_t : public grib_accessor_class_padding_t +{ +public: + grib_accessor_class_pad_t(const char* name) : grib_accessor_class_padding_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_pad_t{}; } + void init(grib_accessor*, const long, grib_arguments*) override; + size_t preferred_size(grib_accessor*, int) override; +}; +#endif /* eccodes_accessor_pad_h */ diff --git a/src/accessor/grib_accessor_class_padding.h b/src/accessor/grib_accessor_class_padding.h index 65a416c4c..2d53ed7c8 100644 --- a/src/accessor/grib_accessor_class_padding.h +++ b/src/accessor/grib_accessor_class_padding.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_padding_h #define eccodes_accessor_padding_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_bytes.h" class grib_accessor_padding_t : public grib_accessor_bytes_t diff --git a/src/accessor/grib_accessor_class_padding.h.bak b/src/accessor/grib_accessor_class_padding.h.bak new file mode 100644 index 000000000..65a416c4c --- /dev/null +++ b/src/accessor/grib_accessor_class_padding.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_padding_h +#define eccodes_accessor_padding_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_bytes.h" + +class grib_accessor_padding_t : public grib_accessor_bytes_t +{ +public: + /* Members defined in padding */ +}; + +class grib_accessor_class_padding_t : public grib_accessor_class_bytes_t +{ +public: + grib_accessor_class_padding_t(const char* name) : grib_accessor_class_bytes_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_padding_t{}; } + size_t string_length(grib_accessor*) override; + long byte_count(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + void resize(grib_accessor*,size_t) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_padding_h */ diff --git a/src/accessor/grib_accessor_class_padto.h b/src/accessor/grib_accessor_class_padto.h index f7203b2cb..5b7867019 100644 --- a/src/accessor/grib_accessor_class_padto.h +++ b/src/accessor/grib_accessor_class_padto.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_padto_h #define eccodes_accessor_padto_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_padding.h" class grib_accessor_padto_t : public grib_accessor_padding_t diff --git a/src/accessor/grib_accessor_class_padto.h.bak b/src/accessor/grib_accessor_class_padto.h.bak new file mode 100644 index 000000000..f7203b2cb --- /dev/null +++ b/src/accessor/grib_accessor_class_padto.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_padto_h +#define eccodes_accessor_padto_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_padding.h" + +class grib_accessor_padto_t : public grib_accessor_padding_t +{ +public: + /* Members defined in padto */ + grib_expression* expression; +}; + +class grib_accessor_class_padto_t : public grib_accessor_class_padding_t +{ +public: + grib_accessor_class_padto_t(const char* name) : grib_accessor_class_padding_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_padto_t{}; } + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + size_t preferred_size(grib_accessor*, int) override; +}; +#endif /* eccodes_accessor_padto_h */ diff --git a/src/accessor/grib_accessor_class_padtoeven.h b/src/accessor/grib_accessor_class_padtoeven.h index 08f8fc072..2f9ccc1ff 100644 --- a/src/accessor/grib_accessor_class_padtoeven.h +++ b/src/accessor/grib_accessor_class_padtoeven.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_padtoeven_h #define eccodes_accessor_padtoeven_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_padding.h" class grib_accessor_padtoeven_t : public grib_accessor_padding_t diff --git a/src/accessor/grib_accessor_class_padtoeven.h.bak b/src/accessor/grib_accessor_class_padtoeven.h.bak new file mode 100644 index 000000000..08f8fc072 --- /dev/null +++ b/src/accessor/grib_accessor_class_padtoeven.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_padtoeven_h +#define eccodes_accessor_padtoeven_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_padding.h" + +class grib_accessor_padtoeven_t : public grib_accessor_padding_t +{ +public: + /* Members defined in padtoeven */ + const char* section_offset; + const char* section_length; +}; + +class grib_accessor_class_padtoeven_t : public grib_accessor_class_padding_t +{ +public: + grib_accessor_class_padtoeven_t(const char* name) : grib_accessor_class_padding_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_padtoeven_t{}; } + void init(grib_accessor*, const long, grib_arguments*) override; + size_t preferred_size(grib_accessor*, int) override; +}; +#endif /* eccodes_accessor_padtoeven_h */ diff --git a/src/accessor/grib_accessor_class_padtomultiple.h b/src/accessor/grib_accessor_class_padtomultiple.h index f57afad37..f391fbe58 100644 --- a/src/accessor/grib_accessor_class_padtomultiple.h +++ b/src/accessor/grib_accessor_class_padtomultiple.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_padtomultiple_h #define eccodes_accessor_padtomultiple_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_padding.h" class grib_accessor_padtomultiple_t : public grib_accessor_padding_t diff --git a/src/accessor/grib_accessor_class_padtomultiple.h.bak b/src/accessor/grib_accessor_class_padtomultiple.h.bak new file mode 100644 index 000000000..f57afad37 --- /dev/null +++ b/src/accessor/grib_accessor_class_padtomultiple.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_padtomultiple_h +#define eccodes_accessor_padtomultiple_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_padding.h" + +class grib_accessor_padtomultiple_t : public grib_accessor_padding_t +{ +public: + /* Members defined in padtomultiple */ + grib_expression* begin; + grib_expression* multiple; +}; + +class grib_accessor_class_padtomultiple_t : public grib_accessor_class_padding_t +{ +public: + grib_accessor_class_padtomultiple_t(const char* name) : grib_accessor_class_padding_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_padtomultiple_t{}; } + void init(grib_accessor*, const long, grib_arguments*) override; + size_t preferred_size(grib_accessor*, int) override; +}; +#endif /* eccodes_accessor_padtomultiple_h */ diff --git a/src/accessor/grib_accessor_class_position.h b/src/accessor/grib_accessor_class_position.h index 40d690694..05564e503 100644 --- a/src/accessor/grib_accessor_class_position.h +++ b/src/accessor/grib_accessor_class_position.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_position_h #define eccodes_accessor_position_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_position_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_position.h.bak b/src/accessor/grib_accessor_class_position.h.bak new file mode 100644 index 000000000..40d690694 --- /dev/null +++ b/src/accessor/grib_accessor_class_position.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_position_h +#define eccodes_accessor_position_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_position_t : public grib_accessor_gen_t +{ +public: + /* Members defined in position */ +}; + +class grib_accessor_class_position_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_position_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_position_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_position_h */ diff --git a/src/accessor/grib_accessor_class_proj_string.h b/src/accessor/grib_accessor_class_proj_string.h index c49c0f868..bb4fa76a7 100644 --- a/src/accessor/grib_accessor_class_proj_string.h +++ b/src/accessor/grib_accessor_class_proj_string.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_proj_string_h #define eccodes_accessor_proj_string_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_proj_string_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_proj_string.h.bak b/src/accessor/grib_accessor_class_proj_string.h.bak new file mode 100644 index 000000000..c49c0f868 --- /dev/null +++ b/src/accessor/grib_accessor_class_proj_string.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_proj_string_h +#define eccodes_accessor_proj_string_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_proj_string_t : public grib_accessor_gen_t +{ +public: + /* Members defined in proj_string */ + const char* grid_type; + int endpoint; +}; + +class grib_accessor_class_proj_string_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_proj_string_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_proj_string_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_proj_string_h */ diff --git a/src/accessor/grib_accessor_class_raw.h b/src/accessor/grib_accessor_class_raw.h index 30a2603e7..d754deb63 100644 --- a/src/accessor/grib_accessor_class_raw.h +++ b/src/accessor/grib_accessor_class_raw.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_raw_h #define eccodes_accessor_raw_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_raw_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_raw.h.bak b/src/accessor/grib_accessor_class_raw.h.bak new file mode 100644 index 000000000..30a2603e7 --- /dev/null +++ b/src/accessor/grib_accessor_class_raw.h.bak @@ -0,0 +1,41 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_raw_h +#define eccodes_accessor_raw_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_raw_t : public grib_accessor_gen_t +{ +public: + /* Members defined in raw */ + const char* totalLength; + const char* sectionLength; + long relativeOffset; +}; + +class grib_accessor_class_raw_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_raw_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_raw_t{}; } + int get_native_type(grib_accessor*) override; + int pack_bytes(grib_accessor*, const unsigned char*, size_t* len) override; + int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; + long byte_count(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_raw_h */ diff --git a/src/accessor/grib_accessor_class_rdbtime_guess_date.h b/src/accessor/grib_accessor_class_rdbtime_guess_date.h index e9ef0b4d3..1c75f1556 100644 --- a/src/accessor/grib_accessor_class_rdbtime_guess_date.h +++ b/src/accessor/grib_accessor_class_rdbtime_guess_date.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_rdbtime_guess_date_h #define eccodes_accessor_rdbtime_guess_date_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_rdbtime_guess_date_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_rdbtime_guess_date.h.bak b/src/accessor/grib_accessor_class_rdbtime_guess_date.h.bak new file mode 100644 index 000000000..e9ef0b4d3 --- /dev/null +++ b/src/accessor/grib_accessor_class_rdbtime_guess_date.h.bak @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_rdbtime_guess_date_h +#define eccodes_accessor_rdbtime_guess_date_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_rdbtime_guess_date_t : public grib_accessor_long_t +{ +public: + /* Members defined in rdbtime_guess_date */ + const char* typicalYear; + const char* typicalMonth; + const char* typicalDay; + const char* rdbDay; + long yearOrMonth; +}; + +class grib_accessor_class_rdbtime_guess_date_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_rdbtime_guess_date_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_rdbtime_guess_date_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_rdbtime_guess_date_h */ diff --git a/src/accessor/grib_accessor_class_reference_value_error.h b/src/accessor/grib_accessor_class_reference_value_error.h index e0b948e97..aea5e95e5 100644 --- a/src/accessor/grib_accessor_class_reference_value_error.h +++ b/src/accessor/grib_accessor_class_reference_value_error.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_reference_value_error_h #define eccodes_accessor_reference_value_error_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_reference_value_error_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_reference_value_error.h.bak b/src/accessor/grib_accessor_class_reference_value_error.h.bak new file mode 100644 index 000000000..e0b948e97 --- /dev/null +++ b/src/accessor/grib_accessor_class_reference_value_error.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_reference_value_error_h +#define eccodes_accessor_reference_value_error_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_reference_value_error_t : public grib_accessor_double_t +{ +public: + /* Members defined in reference_value_error */ + const char* referenceValue; + const char* floatType; +}; + +class grib_accessor_class_reference_value_error_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_reference_value_error_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_reference_value_error_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_reference_value_error_h */ diff --git a/src/accessor/grib_accessor_class_round.h b/src/accessor/grib_accessor_class_round.h index c38d7b6e8..ed94f9804 100644 --- a/src/accessor/grib_accessor_class_round.h +++ b/src/accessor/grib_accessor_class_round.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_round_h #define eccodes_accessor_round_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_evaluate.h" class grib_accessor_round_t : public grib_accessor_evaluate_t diff --git a/src/accessor/grib_accessor_class_round.h.bak b/src/accessor/grib_accessor_class_round.h.bak new file mode 100644 index 000000000..c38d7b6e8 --- /dev/null +++ b/src/accessor/grib_accessor_class_round.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_round_h +#define eccodes_accessor_round_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_evaluate.h" + +class grib_accessor_round_t : public grib_accessor_evaluate_t +{ +public: + /* Members defined in round */ +}; + +class grib_accessor_class_round_t : public grib_accessor_class_evaluate_t +{ +public: + grib_accessor_class_round_t(const char* name) : grib_accessor_class_evaluate_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_round_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; +}; +#endif /* eccodes_accessor_round_h */ diff --git a/src/accessor/grib_accessor_class_scale.h b/src/accessor/grib_accessor_class_scale.h index 7e1f0d80d..5a44f8013 100644 --- a/src/accessor/grib_accessor_class_scale.h +++ b/src/accessor/grib_accessor_class_scale.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_scale_h #define eccodes_accessor_scale_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_scale_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_scale.h.bak b/src/accessor/grib_accessor_class_scale.h.bak new file mode 100644 index 000000000..7e1f0d80d --- /dev/null +++ b/src/accessor/grib_accessor_class_scale.h.bak @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_scale_h +#define eccodes_accessor_scale_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_scale_t : public grib_accessor_double_t +{ +public: + /* Members defined in scale */ + const char* value; + const char* multiplier; + const char* divisor; + const char* truncating; +}; + +class grib_accessor_class_scale_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_scale_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_scale_t{}; } + int is_missing(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_scale_h */ diff --git a/src/accessor/grib_accessor_class_scale_values.h b/src/accessor/grib_accessor_class_scale_values.h index cb94e16b8..ab644956b 100644 --- a/src/accessor/grib_accessor_class_scale_values.h +++ b/src/accessor/grib_accessor_class_scale_values.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_scale_values_h #define eccodes_accessor_scale_values_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_scale_values_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_scale_values.h.bak b/src/accessor/grib_accessor_class_scale_values.h.bak new file mode 100644 index 000000000..cb94e16b8 --- /dev/null +++ b/src/accessor/grib_accessor_class_scale_values.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_scale_values_h +#define eccodes_accessor_scale_values_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_scale_values_t : public grib_accessor_double_t +{ +public: + /* Members defined in scale_values */ + const char* values; + const char* missingValue; +}; + +class grib_accessor_class_scale_values_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_scale_values_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_scale_values_t{}; } + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_scale_values_h */ diff --git a/src/accessor/grib_accessor_class_second_order_bits_per_value.h b/src/accessor/grib_accessor_class_second_order_bits_per_value.h index 370b364dd..5c30e9e19 100644 --- a/src/accessor/grib_accessor_class_second_order_bits_per_value.h +++ b/src/accessor/grib_accessor_class_second_order_bits_per_value.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_second_order_bits_per_value_h #define eccodes_accessor_second_order_bits_per_value_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_second_order_bits_per_value_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_second_order_bits_per_value.h.bak b/src/accessor/grib_accessor_class_second_order_bits_per_value.h.bak new file mode 100644 index 000000000..370b364dd --- /dev/null +++ b/src/accessor/grib_accessor_class_second_order_bits_per_value.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_second_order_bits_per_value_h +#define eccodes_accessor_second_order_bits_per_value_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_second_order_bits_per_value_t : public grib_accessor_long_t +{ +public: + /* Members defined in second_order_bits_per_value */ + const char* values; + const char* binaryScaleFactor; + const char* decimalScaleFactor; + long bitsPerValue; +}; + +class grib_accessor_class_second_order_bits_per_value_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_second_order_bits_per_value_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_second_order_bits_per_value_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_second_order_bits_per_value_h */ diff --git a/src/accessor/grib_accessor_class_section.h.bak b/src/accessor/grib_accessor_class_section.h.bak new file mode 100644 index 000000000..b1905b182 --- /dev/null +++ b/src/accessor/grib_accessor_class_section.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_section_h +#define eccodes_accessor_section_h + +#include "grib_accessor_class_gen.h" + +class grib_accessor_section_t : public grib_accessor_gen_t {}; + +class grib_accessor_class_section_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_section_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_section_t{}; } + int get_native_type(grib_accessor*) override; + long byte_count(grib_accessor*) override; + long next_offset(grib_accessor*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + grib_section* sub_section(grib_accessor*) override; + grib_accessor* next(grib_accessor*, int) override; +}; +#endif /* eccodes_accessor_section_h */ diff --git a/src/accessor/grib_accessor_class_section_length.h b/src/accessor/grib_accessor_class_section_length.h index 09490bebd..5c9b810d0 100644 --- a/src/accessor/grib_accessor_class_section_length.h +++ b/src/accessor/grib_accessor_class_section_length.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_section_length_h #define eccodes_accessor_section_length_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_section_length_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_section_length.h.bak b/src/accessor/grib_accessor_class_section_length.h.bak new file mode 100644 index 000000000..09490bebd --- /dev/null +++ b/src/accessor/grib_accessor_class_section_length.h.bak @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_section_length_h +#define eccodes_accessor_section_length_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_section_length_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in section_length */ +}; + +class grib_accessor_class_section_length_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_section_length_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_section_length_t{}; } + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_section_length_h */ diff --git a/src/accessor/grib_accessor_class_section_padding.h b/src/accessor/grib_accessor_class_section_padding.h index b6fce7f34..b039ed838 100644 --- a/src/accessor/grib_accessor_class_section_padding.h +++ b/src/accessor/grib_accessor_class_section_padding.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_section_padding_h #define eccodes_accessor_section_padding_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_padding.h" class grib_accessor_section_padding_t : public grib_accessor_padding_t diff --git a/src/accessor/grib_accessor_class_section_padding.h.bak b/src/accessor/grib_accessor_class_section_padding.h.bak new file mode 100644 index 000000000..b6fce7f34 --- /dev/null +++ b/src/accessor/grib_accessor_class_section_padding.h.bak @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_section_padding_h +#define eccodes_accessor_section_padding_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_padding.h" + +class grib_accessor_section_padding_t : public grib_accessor_padding_t +{ +public: + /* Members defined in section_padding */ + int preserve; +}; + +class grib_accessor_class_section_padding_t : public grib_accessor_class_padding_t +{ +public: + grib_accessor_class_section_padding_t(const char* name) : grib_accessor_class_padding_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_section_padding_t{}; } + void init(grib_accessor*, const long, grib_arguments*) override; + size_t preferred_size(grib_accessor*, int) override; +}; +#endif /* eccodes_accessor_section_padding_h */ diff --git a/src/accessor/grib_accessor_class_section_pointer.h b/src/accessor/grib_accessor_class_section_pointer.h index 45e77fbb9..0f92439a4 100644 --- a/src/accessor/grib_accessor_class_section_pointer.h +++ b/src/accessor/grib_accessor_class_section_pointer.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_section_pointer_h #define eccodes_accessor_section_pointer_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_section_pointer_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_section_pointer.h.bak b/src/accessor/grib_accessor_class_section_pointer.h.bak new file mode 100644 index 000000000..45e77fbb9 --- /dev/null +++ b/src/accessor/grib_accessor_class_section_pointer.h.bak @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_section_pointer_h +#define eccodes_accessor_section_pointer_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_section_pointer_t : public grib_accessor_gen_t +{ +public: + /* Members defined in section_pointer */ + const char* sectionOffset; + const char* sectionLength; + long sectionNumber; +}; + +class grib_accessor_class_section_pointer_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_section_pointer_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_section_pointer_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_section_pointer_h */ diff --git a/src/accessor/grib_accessor_class_select_step_template.h b/src/accessor/grib_accessor_class_select_step_template.h index a83d3ddfd..ad6548aa4 100644 --- a/src/accessor/grib_accessor_class_select_step_template.h +++ b/src/accessor/grib_accessor_class_select_step_template.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_select_step_template_h #define eccodes_accessor_select_step_template_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_select_step_template_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_select_step_template.h.bak b/src/accessor/grib_accessor_class_select_step_template.h.bak new file mode 100644 index 000000000..a83d3ddfd --- /dev/null +++ b/src/accessor/grib_accessor_class_select_step_template.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_select_step_template_h +#define eccodes_accessor_select_step_template_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" + +class grib_accessor_select_step_template_t : public grib_accessor_unsigned_t +{ +public: + /* Members defined in select_step_template */ + const char* productDefinitionTemplateNumber; + int instant; +}; + +class grib_accessor_class_select_step_template_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_select_step_template_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_select_step_template_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_select_step_template_h */ diff --git a/src/accessor/grib_accessor_class_sexagesimal2decimal.h b/src/accessor/grib_accessor_class_sexagesimal2decimal.h index c9009293e..32fa3498d 100644 --- a/src/accessor/grib_accessor_class_sexagesimal2decimal.h +++ b/src/accessor/grib_accessor_class_sexagesimal2decimal.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_sexagesimal2decimal_h #define eccodes_accessor_sexagesimal2decimal_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_to_double.h" class grib_accessor_sexagesimal2decimal_t : public grib_accessor_to_double_t diff --git a/src/accessor/grib_accessor_class_sexagesimal2decimal.h.bak b/src/accessor/grib_accessor_class_sexagesimal2decimal.h.bak new file mode 100644 index 000000000..c9009293e --- /dev/null +++ b/src/accessor/grib_accessor_class_sexagesimal2decimal.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_sexagesimal2decimal_h +#define eccodes_accessor_sexagesimal2decimal_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_to_double.h" + +class grib_accessor_sexagesimal2decimal_t : public grib_accessor_to_double_t +{ +public: + /* Members defined in sexagesimal2decimal */ +}; + +class grib_accessor_class_sexagesimal2decimal_t : public grib_accessor_class_to_double_t +{ +public: + grib_accessor_class_sexagesimal2decimal_t(const char* name) : grib_accessor_class_to_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_sexagesimal2decimal_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_sexagesimal2decimal_h */ diff --git a/src/accessor/grib_accessor_class_signed.h b/src/accessor/grib_accessor_class_signed.h index 23c9829a4..c25fc1752 100644 --- a/src/accessor/grib_accessor_class_signed.h +++ b/src/accessor/grib_accessor_class_signed.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_signed_h #define eccodes_accessor_signed_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_signed_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_signed.h.bak b/src/accessor/grib_accessor_class_signed.h.bak new file mode 100644 index 000000000..23c9829a4 --- /dev/null +++ b/src/accessor/grib_accessor_class_signed.h.bak @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_signed_h +#define eccodes_accessor_signed_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_signed_t : public grib_accessor_long_t +{ +public: + /* Members defined in signed */ + grib_arguments* arg; + int nbytes; +}; + +class grib_accessor_class_signed_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_signed_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_signed_t{}; } + int is_missing(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; +}; +#endif /* eccodes_accessor_signed_h */ diff --git a/src/accessor/grib_accessor_class_signed_bits.h b/src/accessor/grib_accessor_class_signed_bits.h index 96ba5f592..05cf524aa 100644 --- a/src/accessor/grib_accessor_class_signed_bits.h +++ b/src/accessor/grib_accessor_class_signed_bits.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_signed_bits_h #define eccodes_accessor_signed_bits_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_signed_bits_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_signed_bits.h.bak b/src/accessor/grib_accessor_class_signed_bits.h.bak new file mode 100644 index 000000000..96ba5f592 --- /dev/null +++ b/src/accessor/grib_accessor_class_signed_bits.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_signed_bits_h +#define eccodes_accessor_signed_bits_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_signed_bits_t : public grib_accessor_long_t +{ +public: + /* Members defined in signed_bits */ + const char* numberOfBits; + const char* numberOfElements; +}; + +class grib_accessor_class_signed_bits_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_signed_bits_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_signed_bits_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; +}; +#endif /* eccodes_accessor_signed_bits_h */ diff --git a/src/accessor/grib_accessor_class_simple_packing_error.h b/src/accessor/grib_accessor_class_simple_packing_error.h index 6c90188c5..950716638 100644 --- a/src/accessor/grib_accessor_class_simple_packing_error.h +++ b/src/accessor/grib_accessor_class_simple_packing_error.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_simple_packing_error_h #define eccodes_accessor_simple_packing_error_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_simple_packing_error_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_simple_packing_error.h.bak b/src/accessor/grib_accessor_class_simple_packing_error.h.bak new file mode 100644 index 000000000..6c90188c5 --- /dev/null +++ b/src/accessor/grib_accessor_class_simple_packing_error.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_simple_packing_error_h +#define eccodes_accessor_simple_packing_error_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_simple_packing_error_t : public grib_accessor_double_t +{ +public: + /* Members defined in simple_packing_error */ + const char* binaryScaleFactor; + const char* bitsPerValue; + const char* decimalScaleFactor; + const char* referenceValue; + const char* floatType; +}; + +class grib_accessor_class_simple_packing_error_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_simple_packing_error_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_simple_packing_error_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_simple_packing_error_h */ diff --git a/src/accessor/grib_accessor_class_size.h b/src/accessor/grib_accessor_class_size.h index dbf47f8bd..7cfb325f5 100644 --- a/src/accessor/grib_accessor_class_size.h +++ b/src/accessor/grib_accessor_class_size.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_size_h #define eccodes_accessor_size_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_size_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_size.h.bak b/src/accessor/grib_accessor_class_size.h.bak new file mode 100644 index 000000000..dbf47f8bd --- /dev/null +++ b/src/accessor/grib_accessor_class_size.h.bak @@ -0,0 +1,33 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_size_h +#define eccodes_accessor_size_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_size_t : public grib_accessor_long_t +{ +public: + /* Members defined in size */ + const char* accessor; +}; + +class grib_accessor_class_size_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_size_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_size_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_size_h */ diff --git a/src/accessor/grib_accessor_class_smart_table.h b/src/accessor/grib_accessor_class_smart_table.h index b6146a981..93a6ea682 100644 --- a/src/accessor/grib_accessor_class_smart_table.h +++ b/src/accessor/grib_accessor_class_smart_table.h @@ -15,7 +15,7 @@ #pragma once -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" #include diff --git a/src/accessor/grib_accessor_class_smart_table.h.bak b/src/accessor/grib_accessor_class_smart_table.h.bak new file mode 100644 index 000000000..b6146a981 --- /dev/null +++ b/src/accessor/grib_accessor_class_smart_table.h.bak @@ -0,0 +1,52 @@ +/* + * (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. + */ + +/***************************************** + * Enrico Fucile + ****************************************/ + + +#pragma once + +#include "../grib_api_internal.h" +#include "grib_accessor_class_unsigned.h" +#include + + +class grib_accessor_smart_table_t : public grib_accessor_unsigned_t +{ +public: + const char* values; + const char* tablename; + const char* masterDir; + const char* localDir; + const char* extraDir; + const char* extraTable; + int widthOfCode; + long* tableCodes; + size_t tableCodesSize; + grib_smart_table* table; + int dirty; +}; + + +class grib_accessor_class_smart_table_t : public grib_accessor_class_unsigned_t +{ +public: + grib_accessor_class_smart_table_t(const char* name) : grib_accessor_class_unsigned_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_smart_table_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; diff --git a/src/accessor/grib_accessor_class_smart_table_column.h.bak b/src/accessor/grib_accessor_class_smart_table_column.h.bak new file mode 100644 index 000000000..f5787f780 --- /dev/null +++ b/src/accessor/grib_accessor_class_smart_table_column.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_smart_table_column_h +#define eccodes_accessor_smart_table_column_h + +#include "grib_accessor_class_gen.h" + +class grib_accessor_smart_table_column_t : public grib_accessor_gen_t +{ +public: + const char* smartTable; + int index; +}; + +class grib_accessor_class_smart_table_column_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_smart_table_column_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_smart_table_column_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_smart_table_column_h */ diff --git a/src/accessor/grib_accessor_class_spd.h b/src/accessor/grib_accessor_class_spd.h index c35e5c742..3c47458d3 100644 --- a/src/accessor/grib_accessor_class_spd.h +++ b/src/accessor/grib_accessor_class_spd.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_spd_h #define eccodes_accessor_spd_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_spd_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_spd.h.bak b/src/accessor/grib_accessor_class_spd.h.bak new file mode 100644 index 000000000..c35e5c742 --- /dev/null +++ b/src/accessor/grib_accessor_class_spd.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_spd_h +#define eccodes_accessor_spd_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_spd_t : public grib_accessor_long_t +{ +public: + /* Members defined in spd */ + const char* numberOfBits; + const char* numberOfElements; +}; + +class grib_accessor_class_spd_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_spd_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_spd_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; +}; +#endif /* eccodes_accessor_spd_h */ diff --git a/src/accessor/grib_accessor_class_spectral_truncation.h b/src/accessor/grib_accessor_class_spectral_truncation.h index 0ab43b1fd..329c59155 100644 --- a/src/accessor/grib_accessor_class_spectral_truncation.h +++ b/src/accessor/grib_accessor_class_spectral_truncation.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_spectral_truncation_h #define eccodes_accessor_spectral_truncation_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_spectral_truncation_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_spectral_truncation.h.bak b/src/accessor/grib_accessor_class_spectral_truncation.h.bak new file mode 100644 index 000000000..0ab43b1fd --- /dev/null +++ b/src/accessor/grib_accessor_class_spectral_truncation.h.bak @@ -0,0 +1,36 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_spectral_truncation_h +#define eccodes_accessor_spectral_truncation_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_spectral_truncation_t : public grib_accessor_long_t +{ +public: + /* Members defined in spectral_truncation */ + const char* J; + const char* K; + const char* M; + const char* T; +}; + +class grib_accessor_class_spectral_truncation_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_spectral_truncation_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_spectral_truncation_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_spectral_truncation_h */ diff --git a/src/accessor/grib_accessor_class_sprintf.h b/src/accessor/grib_accessor_class_sprintf.h index 9bfb1c83e..360cd3b1b 100644 --- a/src/accessor/grib_accessor_class_sprintf.h +++ b/src/accessor/grib_accessor_class_sprintf.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_sprintf_h #define eccodes_accessor_sprintf_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_sprintf_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_sprintf.h.bak b/src/accessor/grib_accessor_class_sprintf.h.bak new file mode 100644 index 000000000..9bfb1c83e --- /dev/null +++ b/src/accessor/grib_accessor_class_sprintf.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_sprintf_h +#define eccodes_accessor_sprintf_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_sprintf_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in sprintf */ + grib_arguments* args; +}; + +class grib_accessor_class_sprintf_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_sprintf_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_sprintf_t{}; } + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_sprintf_h */ diff --git a/src/accessor/grib_accessor_class_statistics.h b/src/accessor/grib_accessor_class_statistics.h index 4eea0b546..e4ffed90d 100644 --- a/src/accessor/grib_accessor_class_statistics.h +++ b/src/accessor/grib_accessor_class_statistics.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_statistics_h #define eccodes_accessor_statistics_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_abstract_vector.h" class grib_accessor_statistics_t : public grib_accessor_abstract_vector_t diff --git a/src/accessor/grib_accessor_class_statistics.h.bak b/src/accessor/grib_accessor_class_statistics.h.bak new file mode 100644 index 000000000..4eea0b546 --- /dev/null +++ b/src/accessor/grib_accessor_class_statistics.h.bak @@ -0,0 +1,38 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_statistics_h +#define eccodes_accessor_statistics_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_abstract_vector.h" + +class grib_accessor_statistics_t : public grib_accessor_abstract_vector_t +{ +public: + /* Members defined in statistics */ + const char* values; + const char* missing_value; +}; + +class grib_accessor_class_statistics_t : public grib_accessor_class_abstract_vector_t +{ +public: + grib_accessor_class_statistics_t(const char* name) : grib_accessor_class_abstract_vector_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_statistics_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_statistics_h */ diff --git a/src/accessor/grib_accessor_class_statistics_spectral.h b/src/accessor/grib_accessor_class_statistics_spectral.h index 8075ddf31..c47f2385a 100644 --- a/src/accessor/grib_accessor_class_statistics_spectral.h +++ b/src/accessor/grib_accessor_class_statistics_spectral.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_statistics_spectral_h #define eccodes_accessor_statistics_spectral_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_abstract_vector.h" class grib_accessor_statistics_spectral_t : public grib_accessor_abstract_vector_t diff --git a/src/accessor/grib_accessor_class_statistics_spectral.h.bak b/src/accessor/grib_accessor_class_statistics_spectral.h.bak new file mode 100644 index 000000000..8075ddf31 --- /dev/null +++ b/src/accessor/grib_accessor_class_statistics_spectral.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_statistics_spectral_h +#define eccodes_accessor_statistics_spectral_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_abstract_vector.h" + +class grib_accessor_statistics_spectral_t : public grib_accessor_abstract_vector_t +{ +public: + /* Members defined in statistics_spectral */ + const char* values; + const char* J; + const char* K; + const char* M; + const char* JS; +}; + +class grib_accessor_class_statistics_spectral_t : public grib_accessor_class_abstract_vector_t +{ +public: + grib_accessor_class_statistics_spectral_t(const char* name) : grib_accessor_class_abstract_vector_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_statistics_spectral_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_statistics_spectral_h */ diff --git a/src/accessor/grib_accessor_class_step_human_readable.h b/src/accessor/grib_accessor_class_step_human_readable.h index 793ecb618..9d902f324 100644 --- a/src/accessor/grib_accessor_class_step_human_readable.h +++ b/src/accessor/grib_accessor_class_step_human_readable.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_step_human_readable_h #define eccodes_accessor_step_human_readable_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_step_human_readable_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_step_human_readable.h.bak b/src/accessor/grib_accessor_class_step_human_readable.h.bak new file mode 100644 index 000000000..793ecb618 --- /dev/null +++ b/src/accessor/grib_accessor_class_step_human_readable.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_step_human_readable_h +#define eccodes_accessor_step_human_readable_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_step_human_readable_t : public grib_accessor_gen_t +{ +public: + /* Members defined in step_human_readable */ + const char* stepUnits; + const char* step; +}; + +class grib_accessor_class_step_human_readable_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_step_human_readable_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_step_human_readable_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_step_human_readable_h */ diff --git a/src/accessor/grib_accessor_class_step_in_units.h b/src/accessor/grib_accessor_class_step_in_units.h index ba088db79..e6fe8a6f6 100644 --- a/src/accessor/grib_accessor_class_step_in_units.h +++ b/src/accessor/grib_accessor_class_step_in_units.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_step_in_units_h #define eccodes_accessor_step_in_units_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_step_in_units_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_step_in_units.h.bak b/src/accessor/grib_accessor_class_step_in_units.h.bak new file mode 100644 index 000000000..ba088db79 --- /dev/null +++ b/src/accessor/grib_accessor_class_step_in_units.h.bak @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_step_in_units_h +#define eccodes_accessor_step_in_units_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_step_in_units_t : public grib_accessor_long_t +{ +public: + /* Members defined in step_in_units */ + const char* forecast_time_value; + const char* forecast_time_unit; + const char* step_units; + const char* time_range_unit; + const char* time_range_value; +}; + +class grib_accessor_class_step_in_units_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_step_in_units_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_step_in_units_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_step_in_units_h */ diff --git a/src/accessor/grib_accessor_class_sum.h b/src/accessor/grib_accessor_class_sum.h index ceedb788a..c05c7c6d1 100644 --- a/src/accessor/grib_accessor_class_sum.h +++ b/src/accessor/grib_accessor_class_sum.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_sum_h #define eccodes_accessor_sum_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_sum_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_sum.h.bak b/src/accessor/grib_accessor_class_sum.h.bak new file mode 100644 index 000000000..ceedb788a --- /dev/null +++ b/src/accessor/grib_accessor_class_sum.h.bak @@ -0,0 +1,35 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_sum_h +#define eccodes_accessor_sum_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_double.h" + +class grib_accessor_sum_t : public grib_accessor_double_t +{ +public: + /* Members defined in sum */ + const char* values; +}; + +class grib_accessor_class_sum_t : public grib_accessor_class_double_t +{ +public: + grib_accessor_class_sum_t(const char* name) : grib_accessor_class_double_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_sum_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_sum_h */ diff --git a/src/accessor/grib_accessor_class_suppressed.h b/src/accessor/grib_accessor_class_suppressed.h index c8a93274e..844c1fb6b 100644 --- a/src/accessor/grib_accessor_class_suppressed.h +++ b/src/accessor/grib_accessor_class_suppressed.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_suppressed_h #define eccodes_accessor_suppressed_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_suppressed_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_suppressed.h.bak b/src/accessor/grib_accessor_class_suppressed.h.bak new file mode 100644 index 000000000..c8a93274e --- /dev/null +++ b/src/accessor/grib_accessor_class_suppressed.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_suppressed_h +#define eccodes_accessor_suppressed_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_suppressed_t : public grib_accessor_long_t +{ +public: + /* Members defined in suppressed */ + grib_arguments* args; +}; + +class grib_accessor_class_suppressed_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_suppressed_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_suppressed_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_suppressed_h */ diff --git a/src/accessor/grib_accessor_class_time.h b/src/accessor/grib_accessor_class_time.h index b1826e1d6..247e4a08d 100644 --- a/src/accessor/grib_accessor_class_time.h +++ b/src/accessor/grib_accessor_class_time.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_time_h #define eccodes_accessor_time_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_time_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_time.h.bak b/src/accessor/grib_accessor_class_time.h.bak new file mode 100644 index 000000000..b1826e1d6 --- /dev/null +++ b/src/accessor/grib_accessor_class_time.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_time_h +#define eccodes_accessor_time_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_time_t : public grib_accessor_long_t +{ +public: + /* Members defined in time */ + const char* hour; + const char* minute; + const char* second; +}; + +class grib_accessor_class_time_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_time_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_time_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_time_h */ diff --git a/src/accessor/grib_accessor_class_to_double.h b/src/accessor/grib_accessor_class_to_double.h index a2010cc1e..639cc98f5 100644 --- a/src/accessor/grib_accessor_class_to_double.h +++ b/src/accessor/grib_accessor_class_to_double.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_to_double_h #define eccodes_accessor_to_double_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_to_double_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_to_double.h.bak b/src/accessor/grib_accessor_class_to_double.h.bak new file mode 100644 index 000000000..a2010cc1e --- /dev/null +++ b/src/accessor/grib_accessor_class_to_double.h.bak @@ -0,0 +1,43 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_to_double_h +#define eccodes_accessor_to_double_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_to_double_t : public grib_accessor_gen_t +{ +public: + /* Members defined in to_double */ + const char* key; + long start; + size_t length; + long scale; +}; + +class grib_accessor_class_to_double_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_to_double_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_to_double_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_to_double_h */ diff --git a/src/accessor/grib_accessor_class_to_integer.h b/src/accessor/grib_accessor_class_to_integer.h index 3ee9dd87b..ec3505c75 100644 --- a/src/accessor/grib_accessor_class_to_integer.h +++ b/src/accessor/grib_accessor_class_to_integer.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_to_integer_h #define eccodes_accessor_to_integer_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_to_integer_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_to_integer.h.bak b/src/accessor/grib_accessor_class_to_integer.h.bak new file mode 100644 index 000000000..3ee9dd87b --- /dev/null +++ b/src/accessor/grib_accessor_class_to_integer.h.bak @@ -0,0 +1,45 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_to_integer_h +#define eccodes_accessor_to_integer_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_to_integer_t : public grib_accessor_gen_t +{ +public: + /* Members defined in to_integer */ + const char* key; + long start; + size_t length; +}; + +class grib_accessor_class_to_integer_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_to_integer_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_to_integer_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_to_integer_h */ diff --git a/src/accessor/grib_accessor_class_to_string.h b/src/accessor/grib_accessor_class_to_string.h index 0907cb82c..6dd1e4de8 100644 --- a/src/accessor/grib_accessor_class_to_string.h +++ b/src/accessor/grib_accessor_class_to_string.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_to_string_h #define eccodes_accessor_to_string_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_to_string_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_to_string.h.bak b/src/accessor/grib_accessor_class_to_string.h.bak new file mode 100644 index 000000000..0907cb82c --- /dev/null +++ b/src/accessor/grib_accessor_class_to_string.h.bak @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_to_string_h +#define eccodes_accessor_to_string_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_to_string_t : public grib_accessor_gen_t +{ +public: + /* Members defined in to_string */ + const char* key; + long start; + size_t length; +}; + +class grib_accessor_class_to_string_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_to_string_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_to_string_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_to_string_h */ diff --git a/src/accessor/grib_accessor_class_transient.h.bak b/src/accessor/grib_accessor_class_transient.h.bak new file mode 100644 index 000000000..e330ad686 --- /dev/null +++ b/src/accessor/grib_accessor_class_transient.h.bak @@ -0,0 +1,25 @@ +/* + * (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. + */ + +#pragma once + +#include "grib_accessor_class_variable.h" + +class grib_accessor_transient_t : public grib_accessor_variable_t { +public: +}; + +class grib_accessor_class_transient_t : public grib_accessor_class_variable_t { +public: + void init(grib_accessor* a, const long l, grib_arguments* args) override; + grib_accessor_class_transient_t(const char* name) : grib_accessor_class_variable_t(name) {}; + grib_accessor* create_empty_accessor() override { return new grib_accessor_transient_t{}; } +}; + diff --git a/src/accessor/grib_accessor_class_transient_darray.h b/src/accessor/grib_accessor_class_transient_darray.h index fe918bd55..6aeff1491 100644 --- a/src/accessor/grib_accessor_class_transient_darray.h +++ b/src/accessor/grib_accessor_class_transient_darray.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_transient_darray_h #define eccodes_accessor_transient_darray_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_transient_darray_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_transient_darray.h.bak b/src/accessor/grib_accessor_class_transient_darray.h.bak new file mode 100644 index 000000000..fe918bd55 --- /dev/null +++ b/src/accessor/grib_accessor_class_transient_darray.h.bak @@ -0,0 +1,41 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_transient_darray_h +#define eccodes_accessor_transient_darray_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_transient_darray_t : public grib_accessor_gen_t +{ +public: + /* Members defined in transient_darray */ + grib_darray* arr; + int type; +}; + +class grib_accessor_class_transient_darray_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_transient_darray_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_transient_darray_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_transient_darray_h */ diff --git a/src/accessor/grib_accessor_class_trim.h b/src/accessor/grib_accessor_class_trim.h index 9fd6b9230..664ccc528 100644 --- a/src/accessor/grib_accessor_class_trim.h +++ b/src/accessor/grib_accessor_class_trim.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_trim_h #define eccodes_accessor_trim_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_trim_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_trim.h.bak b/src/accessor/grib_accessor_class_trim.h.bak new file mode 100644 index 000000000..664ccc528 --- /dev/null +++ b/src/accessor/grib_accessor_class_trim.h.bak @@ -0,0 +1,37 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_trim_h +#define eccodes_accessor_trim_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_ascii.h" + +class grib_accessor_trim_t : public grib_accessor_ascii_t +{ +public: + /* Members defined in trim */ + const char* input; + int trim_left; + int trim_right; +}; + +class grib_accessor_class_trim_t : public grib_accessor_class_ascii_t +{ +public: + grib_accessor_class_trim_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_trim_t{}; } + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_trim_h */ diff --git a/src/accessor/grib_accessor_class_uint16.h b/src/accessor/grib_accessor_class_uint16.h index 0291df85c..0952e2d57 100644 --- a/src/accessor/grib_accessor_class_uint16.h +++ b/src/accessor/grib_accessor_class_uint16.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_uint16_h #define eccodes_accessor_uint16_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint16_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_uint16.h.bak b/src/accessor/grib_accessor_class_uint16.h.bak new file mode 100644 index 000000000..0952e2d57 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint16.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint16_h +#define eccodes_accessor_uint16_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint16_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint16 */ +}; + +class grib_accessor_class_uint16_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint16_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint16_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint16_h */ diff --git a/src/accessor/grib_accessor_class_uint32.h b/src/accessor/grib_accessor_class_uint32.h index be0457156..0cf8a0bd9 100644 --- a/src/accessor/grib_accessor_class_uint32.h +++ b/src/accessor/grib_accessor_class_uint32.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_uint32_h #define eccodes_accessor_uint32_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint32_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_uint32.h.bak b/src/accessor/grib_accessor_class_uint32.h.bak new file mode 100644 index 000000000..0cf8a0bd9 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint32.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint32_h +#define eccodes_accessor_uint32_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint32_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint32 */ +}; + +class grib_accessor_class_uint32_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint32_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint32_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint32_h */ diff --git a/src/accessor/grib_accessor_class_uint32_little_endian.h b/src/accessor/grib_accessor_class_uint32_little_endian.h index 4f51d3113..357791081 100644 --- a/src/accessor/grib_accessor_class_uint32_little_endian.h +++ b/src/accessor/grib_accessor_class_uint32_little_endian.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_uint32_little_endian_h #define eccodes_accessor_uint32_little_endian_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint32_little_endian_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_uint32_little_endian.h.bak b/src/accessor/grib_accessor_class_uint32_little_endian.h.bak new file mode 100644 index 000000000..357791081 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint32_little_endian.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint32_little_endian_h +#define eccodes_accessor_uint32_little_endian_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint32_little_endian_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint32_little_endian */ +}; + +class grib_accessor_class_uint32_little_endian_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint32_little_endian_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint32_little_endian_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint32_little_endian_h */ diff --git a/src/accessor/grib_accessor_class_uint64.h b/src/accessor/grib_accessor_class_uint64.h index 04d96b1b8..55215c77f 100644 --- a/src/accessor/grib_accessor_class_uint64.h +++ b/src/accessor/grib_accessor_class_uint64.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_uint64_h #define eccodes_accessor_uint64_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint64_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_uint64.h.bak b/src/accessor/grib_accessor_class_uint64.h.bak new file mode 100644 index 000000000..55215c77f --- /dev/null +++ b/src/accessor/grib_accessor_class_uint64.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint64_h +#define eccodes_accessor_uint64_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint64_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint64 */ +}; + +class grib_accessor_class_uint64_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint64_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint64_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint64_h */ diff --git a/src/accessor/grib_accessor_class_uint64_little_endian.h b/src/accessor/grib_accessor_class_uint64_little_endian.h index 5eb0068bb..8c04a5398 100644 --- a/src/accessor/grib_accessor_class_uint64_little_endian.h +++ b/src/accessor/grib_accessor_class_uint64_little_endian.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_uint64_little_endian_h #define eccodes_accessor_uint64_little_endian_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint64_little_endian_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_uint64_little_endian.h.bak b/src/accessor/grib_accessor_class_uint64_little_endian.h.bak new file mode 100644 index 000000000..8c04a5398 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint64_little_endian.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint64_little_endian_h +#define eccodes_accessor_uint64_little_endian_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint64_little_endian_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint64_little_endian */ +}; + +class grib_accessor_class_uint64_little_endian_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint64_little_endian_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint64_little_endian_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint64_little_endian_h */ diff --git a/src/accessor/grib_accessor_class_uint8.h b/src/accessor/grib_accessor_class_uint8.h index 8a06d0ceb..04dcb1075 100644 --- a/src/accessor/grib_accessor_class_uint8.h +++ b/src/accessor/grib_accessor_class_uint8.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_uint8_h #define eccodes_accessor_uint8_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint8_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_uint8.h.bak b/src/accessor/grib_accessor_class_uint8.h.bak new file mode 100644 index 000000000..04dcb1075 --- /dev/null +++ b/src/accessor/grib_accessor_class_uint8.h.bak @@ -0,0 +1,32 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_uint8_h +#define eccodes_accessor_uint8_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_uint8_t : public grib_accessor_gen_t +{ +public: + /* Members defined in uint8 */ +}; + +class grib_accessor_class_uint8_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_uint8_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_uint8_t{}; } + int get_native_type(grib_accessor*) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; +}; +#endif /* eccodes_accessor_uint8_h */ diff --git a/src/accessor/grib_accessor_class_unexpanded_descriptors.h b/src/accessor/grib_accessor_class_unexpanded_descriptors.h index 12c89f308..2db5b51b3 100644 --- a/src/accessor/grib_accessor_class_unexpanded_descriptors.h +++ b/src/accessor/grib_accessor_class_unexpanded_descriptors.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_unexpanded_descriptors_h #define eccodes_accessor_unexpanded_descriptors_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_unexpanded_descriptors_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_unexpanded_descriptors.h.bak b/src/accessor/grib_accessor_class_unexpanded_descriptors.h.bak new file mode 100644 index 000000000..2db5b51b3 --- /dev/null +++ b/src/accessor/grib_accessor_class_unexpanded_descriptors.h.bak @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_unexpanded_descriptors_h +#define eccodes_accessor_unexpanded_descriptors_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_unexpanded_descriptors_t : public grib_accessor_long_t +{ +public: + /* Members defined in unexpanded_descriptors */ + grib_accessor* unexpandedDescriptorsEncoded; + const char* createNewData; +}; + +class grib_accessor_class_unexpanded_descriptors_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_unexpanded_descriptors_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_unexpanded_descriptors_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; +}; +#endif /* eccodes_accessor_unexpanded_descriptors_h */ diff --git a/src/accessor/grib_accessor_class_unpack_bufr_values.h b/src/accessor/grib_accessor_class_unpack_bufr_values.h index 7890e7bad..0eea70de4 100644 --- a/src/accessor/grib_accessor_class_unpack_bufr_values.h +++ b/src/accessor/grib_accessor_class_unpack_bufr_values.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_unpack_bufr_values_h #define eccodes_accessor_unpack_bufr_values_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_unpack_bufr_values_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_unpack_bufr_values.h.bak b/src/accessor/grib_accessor_class_unpack_bufr_values.h.bak new file mode 100644 index 000000000..0eea70de4 --- /dev/null +++ b/src/accessor/grib_accessor_class_unpack_bufr_values.h.bak @@ -0,0 +1,42 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_unpack_bufr_values_h +#define eccodes_accessor_unpack_bufr_values_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_unpack_bufr_values_t : public grib_accessor_gen_t +{ +public: + /* Members defined in unpack_bufr_values */ + grib_accessor* data_accessor; +}; + +class grib_accessor_class_unpack_bufr_values_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_unpack_bufr_values_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_unpack_bufr_values_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + int unpack_string_array(grib_accessor*, char**, size_t* len) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_unpack_bufr_values_h */ diff --git a/src/accessor/grib_accessor_class_unsigned.h b/src/accessor/grib_accessor_class_unsigned.h index 99aadb93a..0523974ca 100644 --- a/src/accessor/grib_accessor_class_unsigned.h +++ b/src/accessor/grib_accessor_class_unsigned.h @@ -10,7 +10,7 @@ #pragma once -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_unsigned_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_unsigned.h.bak b/src/accessor/grib_accessor_class_unsigned.h.bak new file mode 100644 index 000000000..0523974ca --- /dev/null +++ b/src/accessor/grib_accessor_class_unsigned.h.bak @@ -0,0 +1,40 @@ +/* + * (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. + */ + +#pragma once + +#include "grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_unsigned_t : public grib_accessor_long_t +{ +public: + long nbytes; + grib_arguments* arg; +}; + + +class grib_accessor_class_unsigned_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_unsigned_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_unsigned_t{}; } + void init(grib_accessor* a, const long len, grib_arguments* arg) override; + void dump(grib_accessor* a, grib_dumper* dumper) override; + int unpack_long(grib_accessor* a, long* val, size_t* len) override; + int pack_long(grib_accessor* a, const long* val, size_t* len) override; + long byte_count(grib_accessor* a) override; + int value_count(grib_accessor* a, long* len) override; + long byte_offset(grib_accessor* a) override; + void update_size(grib_accessor* a, size_t s) override; + long next_offset(grib_accessor* a) override; + int is_missing(grib_accessor* a) override; + void destroy(grib_context* context, grib_accessor* a) override; +}; diff --git a/src/accessor/grib_accessor_class_unsigned_bits.h b/src/accessor/grib_accessor_class_unsigned_bits.h index 62ae48e60..ae20b0a5a 100644 --- a/src/accessor/grib_accessor_class_unsigned_bits.h +++ b/src/accessor/grib_accessor_class_unsigned_bits.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_unsigned_bits_h #define eccodes_accessor_unsigned_bits_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_unsigned_bits_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_unsigned_bits.h.bak b/src/accessor/grib_accessor_class_unsigned_bits.h.bak new file mode 100644 index 000000000..62ae48e60 --- /dev/null +++ b/src/accessor/grib_accessor_class_unsigned_bits.h.bak @@ -0,0 +1,40 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_unsigned_bits_h +#define eccodes_accessor_unsigned_bits_h + +#include "../grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_unsigned_bits_t : public grib_accessor_long_t +{ +public: + /* Members defined in unsigned_bits */ + const char* numberOfBits; + const char* numberOfElements; +}; + +class grib_accessor_class_unsigned_bits_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_unsigned_bits_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_unsigned_bits_t{}; } + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; +}; +#endif /* eccodes_accessor_unsigned_bits_h */ diff --git a/src/accessor/grib_accessor_class_validity_date.h b/src/accessor/grib_accessor_class_validity_date.h index 7a7eea971..dfd8eb320 100644 --- a/src/accessor/grib_accessor_class_validity_date.h +++ b/src/accessor/grib_accessor_class_validity_date.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_validity_date_h #define eccodes_accessor_validity_date_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_validity_date_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_validity_date.h.bak b/src/accessor/grib_accessor_class_validity_date.h.bak new file mode 100644 index 000000000..dfd8eb320 --- /dev/null +++ b/src/accessor/grib_accessor_class_validity_date.h.bak @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_validity_date_h +#define eccodes_accessor_validity_date_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_validity_date_t : public grib_accessor_long_t +{ +public: + /* Members defined in validity_date */ + const char* date; + const char* time; + const char* step; + const char* stepUnits; + const char* year; + const char* month; + const char* day; +}; + +class grib_accessor_class_validity_date_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_validity_date_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_validity_date_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_validity_date_h */ diff --git a/src/accessor/grib_accessor_class_validity_time.h b/src/accessor/grib_accessor_class_validity_time.h index 7fe86648a..3f7c27f7b 100644 --- a/src/accessor/grib_accessor_class_validity_time.h +++ b/src/accessor/grib_accessor_class_validity_time.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_validity_time_h #define eccodes_accessor_validity_time_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_validity_time_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_validity_time.h.bak b/src/accessor/grib_accessor_class_validity_time.h.bak new file mode 100644 index 000000000..3f7c27f7b --- /dev/null +++ b/src/accessor/grib_accessor_class_validity_time.h.bak @@ -0,0 +1,39 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_validity_time_h +#define eccodes_accessor_validity_time_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_long.h" + +class grib_accessor_validity_time_t : public grib_accessor_long_t +{ +public: + /* Members defined in validity_time */ + const char* date; + const char* time; + const char* step; + const char* stepUnits; + const char* hours; + const char* minutes; +}; + +class grib_accessor_class_validity_time_t : public grib_accessor_class_long_t +{ +public: + grib_accessor_class_validity_time_t(const char* name) : grib_accessor_class_long_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_validity_time_t{}; } + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_validity_time_h */ diff --git a/src/accessor/grib_accessor_class_values.h.bak b/src/accessor/grib_accessor_class_values.h.bak new file mode 100644 index 000000000..c7cbf54e7 --- /dev/null +++ b/src/accessor/grib_accessor_class_values.h.bak @@ -0,0 +1,41 @@ +/* + * (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. + */ + +#ifndef eccodes_accessor_values_h +#define eccodes_accessor_values_h + +#include "grib_accessor_class_gen.h" + +class grib_accessor_values_t : public grib_accessor_gen_t +{ +public: + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; +}; + +class grib_accessor_class_values_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_values_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_values_t{}; } + int get_native_type(grib_accessor*) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + long byte_count(grib_accessor*) override; + long byte_offset(grib_accessor*) override; + long next_offset(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + void update_size(grib_accessor*, size_t) override; + int compare(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_values_h */ diff --git a/src/accessor/grib_accessor_class_variable.h.bak b/src/accessor/grib_accessor_class_variable.h.bak new file mode 100644 index 000000000..90ff71238 --- /dev/null +++ b/src/accessor/grib_accessor_class_variable.h.bak @@ -0,0 +1,49 @@ +/* + * (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. + */ + +#pragma once + +#include "grib_accessor.h" +#include "grib_accessor_class_gen.h" + + +class grib_accessor_variable_t : public grib_accessor_gen_t +{ +public: + double dval; + float fval; + char* cval; + char* cname; + int type; +}; + +class grib_accessor_class_variable_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_variable_t(const char* name) : grib_accessor_class_gen_t(name) {}; + grib_accessor* create_empty_accessor() override { return new grib_accessor_variable_t{}; } + int get_native_type(grib_accessor*) override; + int pack_double(grib_accessor*, const double* val, size_t* len) override; + int pack_float(grib_accessor*, const float* val, size_t* len) override; + int pack_long(grib_accessor*, const long* val, size_t* len) override; + int pack_string(grib_accessor*, const char*, size_t* len) override; + int unpack_double(grib_accessor*, double* val, size_t* len) override; + int unpack_float(grib_accessor*, float* val, size_t* len) override; + int unpack_long(grib_accessor*, long* val, size_t* len) override; + int unpack_string(grib_accessor*, char*, size_t* len) override; + size_t string_length(grib_accessor*) override; + long byte_count(grib_accessor*) override; + int value_count(grib_accessor*, long*) override; + void destroy(grib_context*, grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int compare(grib_accessor*, grib_accessor*) override; + grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; +}; diff --git a/src/accessor/grib_accessor_class_vector.h b/src/accessor/grib_accessor_class_vector.h index df12303cd..671441001 100644 --- a/src/accessor/grib_accessor_class_vector.h +++ b/src/accessor/grib_accessor_class_vector.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_vector_h #define eccodes_accessor_vector_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_abstract_vector.h" class grib_accessor_vector_t : public grib_accessor_abstract_vector_t diff --git a/src/accessor/grib_accessor_class_vector.h.bak b/src/accessor/grib_accessor_class_vector.h.bak new file mode 100644 index 000000000..671441001 --- /dev/null +++ b/src/accessor/grib_accessor_class_vector.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_vector_h +#define eccodes_accessor_vector_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_abstract_vector.h" + +class grib_accessor_vector_t : public grib_accessor_abstract_vector_t +{ +public: + /* Members defined in vector */ + const char* vector; + int index; +}; + +class grib_accessor_class_vector_t : public grib_accessor_class_abstract_vector_t +{ +public: + grib_accessor_class_vector_t(const char* name) : grib_accessor_class_abstract_vector_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_vector_t{}; } + int unpack_double(grib_accessor*, double* val, size_t* len) override; + void init(grib_accessor*, const long, grib_arguments*) override; +}; +#endif /* eccodes_accessor_vector_h */ diff --git a/src/accessor/grib_accessor_class_when.h b/src/accessor/grib_accessor_class_when.h index 69f1dffbb..b2ddcc0b0 100644 --- a/src/accessor/grib_accessor_class_when.h +++ b/src/accessor/grib_accessor_class_when.h @@ -12,7 +12,7 @@ #ifndef eccodes_accessor_when_h #define eccodes_accessor_when_h -#include "../grib_api_internal.h" +#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_when_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_when.h.bak b/src/accessor/grib_accessor_class_when.h.bak new file mode 100644 index 000000000..b2ddcc0b0 --- /dev/null +++ b/src/accessor/grib_accessor_class_when.h.bak @@ -0,0 +1,34 @@ + +/* + * (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. + */ + +#ifndef eccodes_accessor_when_h +#define eccodes_accessor_when_h + +#include "grib_api_internal.h" +#include "grib_accessor_class_gen.h" + +class grib_accessor_when_t : public grib_accessor_gen_t +{ +public: + /* Members defined in when */ +}; + +class grib_accessor_class_when_t : public grib_accessor_class_gen_t +{ +public: + grib_accessor_class_when_t(const char* name) : grib_accessor_class_gen_t(name) {} + grib_accessor* create_empty_accessor() override { return new grib_accessor_when_t{}; } + int get_native_type(grib_accessor*) override; + void dump(grib_accessor*, grib_dumper*) override; + void init(grib_accessor*, const long, grib_arguments*) override; + int notify_change(grib_accessor*, grib_accessor*) override; +}; +#endif /* eccodes_accessor_when_h */ From bbcf302f48959f2640074b7f26d9519978578231 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 27 Apr 2024 13:54:06 +0100 Subject: [PATCH 087/196] Copyright notices --- ..._accessor_class_abstract_long_vector.h.bak | 33 --- .../grib_accessor_class_abstract_vector.h.bak | 32 --- src/accessor/grib_accessor_class_ascii.h.bak | 42 --- src/accessor/grib_accessor_class_bit.h.bak | 35 --- src/accessor/grib_accessor_class_bitmap.h.bak | 45 --- src/accessor/grib_accessor_class_bits.h.bak | 45 --- .../grib_accessor_class_bits_per_value.h.bak | 35 --- src/accessor/grib_accessor_class_blob.h.bak | 34 --- .../grib_accessor_class_budgdate.h.bak | 36 --- .../grib_accessor_class_bufr_data_array.h.bak | 92 ------ ...rib_accessor_class_bufr_data_element.h.bak | 57 ---- ...b_accessor_class_bufr_elements_table.h.bak | 39 --- ...ssor_class_bufr_extract_area_subsets.h.bak | 43 --- ..._class_bufr_extract_datetime_subsets.h.bak | 36 --- ..._accessor_class_bufr_extract_subsets.h.bak | 37 --- .../grib_accessor_class_bufr_group.h.bak | 32 --- ..._accessor_class_bufr_simple_thinning.h.bak | 39 --- ...ib_accessor_class_bufr_string_values.h.bak | 38 --- ...or_class_bufrdc_expanded_descriptors.h.bak | 37 --- src/accessor/grib_accessor_class_bytes.h.bak | 35 --- ...lass_change_alternative_row_scanning.h.bak | 38 --- ...ssor_class_change_scanning_direction.h.bak | 42 --- ...ccessor_class_check_internal_version.h.bak | 33 --- .../grib_accessor_class_closest_date.h.bak | 43 --- .../grib_accessor_class_codeflag.h.bak | 34 --- .../grib_accessor_class_codetable.h.bak | 47 --- .../grib_accessor_class_codetable_title.h.bak | 34 --- .../grib_accessor_class_codetable_units.h.bak | 34 --- .../grib_accessor_class_concept.h.bak | 43 --- .../grib_accessor_class_constant.h.bak | 27 -- .../grib_accessor_class_count_file.h.bak | 32 --- .../grib_accessor_class_count_missing.h.bak | 37 --- .../grib_accessor_class_count_total.h.bak | 32 --- ...rib_accessor_class_data_apply_bitmap.h.bak | 132 --------- ...sor_class_data_apply_boustrophedonic.h.bak | 41 --- ...ss_data_apply_boustrophedonic_bitmap.h.bak | 45 --- ...ib_accessor_class_data_ccsds_packing.h.bak | 203 ------------- ..._accessor_class_data_complex_packing.h.bak | 272 ------------------ ...grib_accessor_class_data_dummy_field.h.bak | 37 --- ...ccessor_class_data_g1complex_packing.h.bak | 37 --- ...1second_order_constant_width_packing.h.bak | 53 ---- ...econd_order_general_extended_packing.h.bak | 68 ----- ..._data_g1second_order_general_packing.h.bak | 49 ---- ...ta_g1second_order_row_by_row_packing.h.bak | 49 ---- ...cessor_class_data_g1secondary_bitmap.h.bak | 34 --- ...cessor_class_data_g1shsimple_packing.h.bak | 32 --- ...accessor_class_data_g1simple_packing.h.bak | 37 --- ...accessor_class_data_g22order_packing.h.bak | 55 ---- ...essor_class_data_g2bifourier_packing.h.bak | 47 --- ...ccessor_class_data_g2complex_packing.h.bak | 34 --- ...cessor_class_data_g2secondary_bitmap.h.bak | 34 --- ...cessor_class_data_g2shsimple_packing.h.bak | 36 --- ...accessor_class_data_g2simple_packing.h.bak | 28 -- ..._g2simple_packing_with_preprocessing.h.bak | 36 --- ...accessor_class_data_jpeg2000_packing.h.bak | 46 --- ...grib_accessor_class_data_png_packing.h.bak | 41 --- ...grib_accessor_class_data_raw_packing.h.bak | 38 --- ...cessor_class_data_run_length_packing.h.bak | 40 --- ...accessor_class_data_secondary_bitmap.h.bak | 38 --- .../grib_accessor_class_data_sh_packed.h.bak | 43 --- ...grib_accessor_class_data_sh_unpacked.h.bak | 43 --- ...accessor_class_data_shsimple_packing.h.bak | 37 --- ...b_accessor_class_data_simple_packing.h.bak | 195 ------------- ...rib_accessor_class_decimal_precision.h.bak | 37 --- .../grib_accessor_class_dictionary.h.bak | 42 --- src/accessor/grib_accessor_class_dirty.h.bak | 34 --- .../grib_accessor_class_divdouble.h.bak | 34 --- src/accessor/grib_accessor_class_double.h.bak | 30 -- .../grib_accessor_class_element.h.bak | 36 --- .../grib_accessor_class_evaluate.h.bak | 33 --- ..._accessor_class_expanded_descriptors.h.bak | 47 --- ...class_from_scale_factor_scaled_value.h.bak | 37 --- ...accessor_class_g1_half_byte_codeflag.h.bak | 35 --- ...rib_accessor_class_g1_message_length.h.bak | 34 --- ...ib_accessor_class_g1_section4_length.h.bak | 34 --- .../grib_accessor_class_g1bitmap.h.bak | 35 --- src/accessor/grib_accessor_class_g1date.h.bak | 39 --- ...ccessor_class_g1day_of_the_year_date.h.bak | 33 --- ...ssor_class_g1end_of_interval_monthly.h.bak | 36 --- .../grib_accessor_class_g1fcperiod.h.bak | 31 -- .../grib_accessor_class_g1forecastmonth.h.bak | 40 --- .../grib_accessor_class_g1monthlydate.h.bak | 33 --- ..._g1number_of_coded_values_sh_complex.h.bak | 40 --- ...s_g1number_of_coded_values_sh_simple.h.bak | 37 --- .../grib_accessor_class_g1step_range.h.bak | 48 ---- ...ib_accessor_class_g1verificationdate.h.bak | 35 --- .../grib_accessor_class_g2_aerosol.h.bak | 37 --- .../grib_accessor_class_g2_chemical.h.bak | 37 --- src/accessor/grib_accessor_class_g2_eps.h.bak | 39 --- ...grib_accessor_class_g2_mars_labeling.h.bak | 47 --- .../grib_accessor_class_g2bitmap.h.bak | 34 --- ...grib_accessor_class_g2bitmap_present.h.bak | 34 --- src/accessor/grib_accessor_class_g2date.h.bak | 37 --- .../grib_accessor_class_g2end_step.h.bak | 56 ---- src/accessor/grib_accessor_class_g2grid.h.bak | 42 --- .../grib_accessor_class_g2latlon.h.bak | 38 --- .../grib_accessor_class_g2level.h.bak | 40 --- src/accessor/grib_accessor_class_g2lon.h.bak | 34 --- .../grib_accessor_class_g2step_range.cc | 114 ++++---- .../grib_accessor_class_g2step_range.h | 2 - .../grib_accessor_class_g2step_range.h.bak | 41 --- ...ib_accessor_class_gaussian_grid_name.h.bak | 37 --- .../grib_accessor_class_gds_is_present.h.bak | 37 --- ...ccessor_class_gds_not_present_bitmap.h.bak | 40 --- src/accessor/grib_accessor_class_gen.cc | 13 +- src/accessor/grib_accessor_class_gen.h | 10 + src/accessor/grib_accessor_class_gen.h.bak | 158 ---------- src/accessor/grib_accessor_class_getenv.h.bak | 36 --- .../grib_accessor_class_global_gaussian.h.bak | 44 --- src/accessor/grib_accessor_class_group.h.bak | 41 --- .../grib_accessor_class_gts_header.h.bak | 36 --- .../grib_accessor_class_hash_array.h.bak | 45 --- .../grib_accessor_class_headers_only.h.bak | 33 --- .../grib_accessor_class_ibmfloat.h.bak | 71 ----- .../grib_accessor_class_ieeefloat.h.bak | 66 ----- .../grib_accessor_class_ifs_param.h.bak | 36 --- .../grib_accessor_class_iterator.h.bak | 36 --- .../grib_accessor_class_julian_date.h.bak | 48 ---- .../grib_accessor_class_julian_day.h.bak | 40 --- .../grib_accessor_class_ksec1expver.h.bak | 34 --- src/accessor/grib_accessor_class_label.h.bak | 34 --- .../grib_accessor_class_latitudes.h.bak | 38 --- ...grib_accessor_class_latlon_increment.h.bak | 43 --- .../grib_accessor_class_latlonvalues.h.bak | 34 --- .../grib_accessor_class_library_version.h.bak | 33 --- ...grib_accessor_class_local_definition.h.bak | 43 --- src/accessor/grib_accessor_class_long.cc | 10 + src/accessor/grib_accessor_class_long.h | 10 + src/accessor/grib_accessor_class_long.h.bak | 22 -- .../grib_accessor_class_long_vector.h.bak | 37 --- .../grib_accessor_class_longitudes.h.bak | 38 --- src/accessor/grib_accessor_class_lookup.h.bak | 40 --- .../grib_accessor_class_mars_param.h.bak | 36 --- .../grib_accessor_class_mars_step.h.bak | 40 --- src/accessor/grib_accessor_class_md5.h.bak | 39 --- .../grib_accessor_class_message.h.bak | 36 --- .../grib_accessor_class_message_copy.h.bak | 36 --- .../grib_accessor_class_multdouble.h.bak | 34 --- .../grib_accessor_class_nearest.h.bak | 33 --- .../grib_accessor_class_non_alpha.h.bak | 39 --- ...ccessor_class_number_of_coded_values.h.bak | 37 --- ...grib_accessor_class_number_of_points.h.bak | 36 --- ...ssor_class_number_of_points_gaussian.h.bak | 42 --- ...grib_accessor_class_number_of_values.h.bak | 38 --- ...ss_number_of_values_data_raw_packing.h.bak | 35 --- ...b_accessor_class_octahedral_gaussian.h.bak | 37 --- .../grib_accessor_class_octet_number.h.bak | 35 --- .../grib_accessor_class_offset_file.h.bak | 33 --- .../grib_accessor_class_offset_values.h.bak | 35 --- ...ib_accessor_class_optimal_step_units.h.bak | 44 --- ...grib_accessor_class_pack_bufr_values.h.bak | 42 --- .../grib_accessor_class_packing_type.h.bak | 37 --- src/accessor/grib_accessor_class_pad.h.bak | 34 --- .../grib_accessor_class_padding.h.bak | 37 --- src/accessor/grib_accessor_class_padto.h.bak | 34 --- .../grib_accessor_class_padtoeven.h.bak | 34 --- .../grib_accessor_class_padtomultiple.h.bak | 34 --- .../grib_accessor_class_position.h.bak | 34 --- .../grib_accessor_class_proj_string.h.bak | 35 --- src/accessor/grib_accessor_class_raw.h.bak | 41 --- ...ib_accessor_class_rdbtime_guess_date.h.bak | 38 --- ...accessor_class_reference_value_error.h.bak | 34 --- src/accessor/grib_accessor_class_round.h.bak | 32 --- src/accessor/grib_accessor_class_scale.h.bak | 39 --- .../grib_accessor_class_scale_values.h.bak | 35 --- ...or_class_second_order_bits_per_value.h.bak | 37 --- .../grib_accessor_class_section.h.bak | 34 --- .../grib_accessor_class_section_length.h.bak | 33 --- .../grib_accessor_class_section_padding.h.bak | 33 --- .../grib_accessor_class_section_pointer.h.bak | 38 --- ..._accessor_class_select_step_template.h.bak | 36 --- ...b_accessor_class_sexagesimal2decimal.h.bak | 34 --- src/accessor/grib_accessor_class_signed.h.bak | 42 --- .../grib_accessor_class_signed_bits.h.bak | 40 --- ..._accessor_class_simple_packing_error.h.bak | 37 --- src/accessor/grib_accessor_class_size.h.bak | 33 --- .../grib_accessor_class_smart_table.h.bak | 52 ---- ...ib_accessor_class_smart_table_column.h.bak | 37 --- src/accessor/grib_accessor_class_spd.h.bak | 40 --- ...b_accessor_class_spectral_truncation.h.bak | 36 --- .../grib_accessor_class_sprintf.h.bak | 35 --- .../grib_accessor_class_statistics.h.bak | 38 --- ...b_accessor_class_statistics_spectral.h.bak | 40 --- ...b_accessor_class_step_human_readable.h.bak | 35 --- .../grib_accessor_class_step_in_units.h.bak | 43 --- src/accessor/grib_accessor_class_sum.h.bak | 35 --- .../grib_accessor_class_suppressed.h.bak | 37 --- src/accessor/grib_accessor_class_time.h.bak | 37 --- .../grib_accessor_class_to_double.h.bak | 43 --- .../grib_accessor_class_to_integer.h.bak | 45 --- .../grib_accessor_class_to_string.h.bak | 42 --- .../grib_accessor_class_transient.h.bak | 25 -- ...grib_accessor_class_transient_darray.h.bak | 41 --- src/accessor/grib_accessor_class_trim.h.bak | 37 --- src/accessor/grib_accessor_class_uint16.h.bak | 32 --- src/accessor/grib_accessor_class_uint32.h.bak | 32 --- ..._accessor_class_uint32_little_endian.h.bak | 32 --- src/accessor/grib_accessor_class_uint64.h.bak | 32 --- ..._accessor_class_uint64_little_endian.h.bak | 32 --- src/accessor/grib_accessor_class_uint8.h.bak | 32 --- ...ccessor_class_unexpanded_descriptors.h.bak | 39 --- ...ib_accessor_class_unpack_bufr_values.h.bak | 42 --- .../grib_accessor_class_unsigned.h.bak | 40 --- .../grib_accessor_class_unsigned_bits.h.bak | 40 --- .../grib_accessor_class_validity_date.h.bak | 39 --- .../grib_accessor_class_validity_time.h.bak | 39 --- src/accessor/grib_accessor_class_values.h.bak | 41 --- .../grib_accessor_class_variable.h.bak | 49 ---- src/accessor/grib_accessor_class_vector.h.bak | 34 --- src/accessor/grib_accessor_class_when.h.bak | 34 --- src/accessor/grib_accessors_list.cc | 9 + src/accessor/grib_accessors_list.h | 10 + 212 files changed, 117 insertions(+), 8684 deletions(-) delete mode 100644 src/accessor/grib_accessor_class_abstract_long_vector.h.bak delete mode 100644 src/accessor/grib_accessor_class_abstract_vector.h.bak delete mode 100644 src/accessor/grib_accessor_class_ascii.h.bak delete mode 100644 src/accessor/grib_accessor_class_bit.h.bak delete mode 100644 src/accessor/grib_accessor_class_bitmap.h.bak delete mode 100644 src/accessor/grib_accessor_class_bits.h.bak delete mode 100644 src/accessor/grib_accessor_class_bits_per_value.h.bak delete mode 100644 src/accessor/grib_accessor_class_blob.h.bak delete mode 100644 src/accessor/grib_accessor_class_budgdate.h.bak delete mode 100644 src/accessor/grib_accessor_class_bufr_data_array.h.bak delete mode 100644 src/accessor/grib_accessor_class_bufr_data_element.h.bak delete mode 100644 src/accessor/grib_accessor_class_bufr_elements_table.h.bak delete mode 100644 src/accessor/grib_accessor_class_bufr_extract_area_subsets.h.bak delete mode 100644 src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h.bak delete mode 100644 src/accessor/grib_accessor_class_bufr_extract_subsets.h.bak delete mode 100644 src/accessor/grib_accessor_class_bufr_group.h.bak delete mode 100644 src/accessor/grib_accessor_class_bufr_simple_thinning.h.bak delete mode 100644 src/accessor/grib_accessor_class_bufr_string_values.h.bak delete mode 100644 src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h.bak delete mode 100644 src/accessor/grib_accessor_class_bytes.h.bak delete mode 100644 src/accessor/grib_accessor_class_change_alternative_row_scanning.h.bak delete mode 100644 src/accessor/grib_accessor_class_change_scanning_direction.h.bak delete mode 100644 src/accessor/grib_accessor_class_check_internal_version.h.bak delete mode 100644 src/accessor/grib_accessor_class_closest_date.h.bak delete mode 100644 src/accessor/grib_accessor_class_codeflag.h.bak delete mode 100644 src/accessor/grib_accessor_class_codetable.h.bak delete mode 100644 src/accessor/grib_accessor_class_codetable_title.h.bak delete mode 100644 src/accessor/grib_accessor_class_codetable_units.h.bak delete mode 100644 src/accessor/grib_accessor_class_concept.h.bak delete mode 100644 src/accessor/grib_accessor_class_constant.h.bak delete mode 100644 src/accessor/grib_accessor_class_count_file.h.bak delete mode 100644 src/accessor/grib_accessor_class_count_missing.h.bak delete mode 100644 src/accessor/grib_accessor_class_count_total.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_apply_bitmap.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_apply_boustrophedonic.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_ccsds_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_complex_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_dummy_field.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g1complex_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g1second_order_general_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g1secondary_bitmap.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g1shsimple_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g1simple_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g22order_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g2bifourier_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g2complex_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g2secondary_bitmap.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g2shsimple_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g2simple_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_jpeg2000_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_png_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_raw_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_run_length_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_secondary_bitmap.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_sh_packed.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_sh_unpacked.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_shsimple_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_data_simple_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_decimal_precision.h.bak delete mode 100644 src/accessor/grib_accessor_class_dictionary.h.bak delete mode 100644 src/accessor/grib_accessor_class_dirty.h.bak delete mode 100644 src/accessor/grib_accessor_class_divdouble.h.bak delete mode 100644 src/accessor/grib_accessor_class_double.h.bak delete mode 100644 src/accessor/grib_accessor_class_element.h.bak delete mode 100644 src/accessor/grib_accessor_class_evaluate.h.bak delete mode 100644 src/accessor/grib_accessor_class_expanded_descriptors.h.bak delete mode 100644 src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1_half_byte_codeflag.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1_message_length.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1_section4_length.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1bitmap.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1date.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1day_of_the_year_date.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1end_of_interval_monthly.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1fcperiod.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1forecastmonth.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1monthlydate.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1step_range.h.bak delete mode 100644 src/accessor/grib_accessor_class_g1verificationdate.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2_aerosol.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2_chemical.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2_eps.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2_mars_labeling.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2bitmap.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2bitmap_present.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2date.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2end_step.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2grid.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2latlon.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2level.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2lon.h.bak delete mode 100644 src/accessor/grib_accessor_class_g2step_range.h.bak delete mode 100644 src/accessor/grib_accessor_class_gaussian_grid_name.h.bak delete mode 100644 src/accessor/grib_accessor_class_gds_is_present.h.bak delete mode 100644 src/accessor/grib_accessor_class_gds_not_present_bitmap.h.bak delete mode 100644 src/accessor/grib_accessor_class_gen.h.bak delete mode 100644 src/accessor/grib_accessor_class_getenv.h.bak delete mode 100644 src/accessor/grib_accessor_class_global_gaussian.h.bak delete mode 100644 src/accessor/grib_accessor_class_group.h.bak delete mode 100644 src/accessor/grib_accessor_class_gts_header.h.bak delete mode 100644 src/accessor/grib_accessor_class_hash_array.h.bak delete mode 100644 src/accessor/grib_accessor_class_headers_only.h.bak delete mode 100644 src/accessor/grib_accessor_class_ibmfloat.h.bak delete mode 100644 src/accessor/grib_accessor_class_ieeefloat.h.bak delete mode 100644 src/accessor/grib_accessor_class_ifs_param.h.bak delete mode 100644 src/accessor/grib_accessor_class_iterator.h.bak delete mode 100644 src/accessor/grib_accessor_class_julian_date.h.bak delete mode 100644 src/accessor/grib_accessor_class_julian_day.h.bak delete mode 100644 src/accessor/grib_accessor_class_ksec1expver.h.bak delete mode 100644 src/accessor/grib_accessor_class_label.h.bak delete mode 100644 src/accessor/grib_accessor_class_latitudes.h.bak delete mode 100644 src/accessor/grib_accessor_class_latlon_increment.h.bak delete mode 100644 src/accessor/grib_accessor_class_latlonvalues.h.bak delete mode 100644 src/accessor/grib_accessor_class_library_version.h.bak delete mode 100644 src/accessor/grib_accessor_class_local_definition.h.bak delete mode 100644 src/accessor/grib_accessor_class_long.h.bak delete mode 100644 src/accessor/grib_accessor_class_long_vector.h.bak delete mode 100644 src/accessor/grib_accessor_class_longitudes.h.bak delete mode 100644 src/accessor/grib_accessor_class_lookup.h.bak delete mode 100644 src/accessor/grib_accessor_class_mars_param.h.bak delete mode 100644 src/accessor/grib_accessor_class_mars_step.h.bak delete mode 100644 src/accessor/grib_accessor_class_md5.h.bak delete mode 100644 src/accessor/grib_accessor_class_message.h.bak delete mode 100644 src/accessor/grib_accessor_class_message_copy.h.bak delete mode 100644 src/accessor/grib_accessor_class_multdouble.h.bak delete mode 100644 src/accessor/grib_accessor_class_nearest.h.bak delete mode 100644 src/accessor/grib_accessor_class_non_alpha.h.bak delete mode 100644 src/accessor/grib_accessor_class_number_of_coded_values.h.bak delete mode 100644 src/accessor/grib_accessor_class_number_of_points.h.bak delete mode 100644 src/accessor/grib_accessor_class_number_of_points_gaussian.h.bak delete mode 100644 src/accessor/grib_accessor_class_number_of_values.h.bak delete mode 100644 src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h.bak delete mode 100644 src/accessor/grib_accessor_class_octahedral_gaussian.h.bak delete mode 100644 src/accessor/grib_accessor_class_octet_number.h.bak delete mode 100644 src/accessor/grib_accessor_class_offset_file.h.bak delete mode 100644 src/accessor/grib_accessor_class_offset_values.h.bak delete mode 100644 src/accessor/grib_accessor_class_optimal_step_units.h.bak delete mode 100644 src/accessor/grib_accessor_class_pack_bufr_values.h.bak delete mode 100644 src/accessor/grib_accessor_class_packing_type.h.bak delete mode 100644 src/accessor/grib_accessor_class_pad.h.bak delete mode 100644 src/accessor/grib_accessor_class_padding.h.bak delete mode 100644 src/accessor/grib_accessor_class_padto.h.bak delete mode 100644 src/accessor/grib_accessor_class_padtoeven.h.bak delete mode 100644 src/accessor/grib_accessor_class_padtomultiple.h.bak delete mode 100644 src/accessor/grib_accessor_class_position.h.bak delete mode 100644 src/accessor/grib_accessor_class_proj_string.h.bak delete mode 100644 src/accessor/grib_accessor_class_raw.h.bak delete mode 100644 src/accessor/grib_accessor_class_rdbtime_guess_date.h.bak delete mode 100644 src/accessor/grib_accessor_class_reference_value_error.h.bak delete mode 100644 src/accessor/grib_accessor_class_round.h.bak delete mode 100644 src/accessor/grib_accessor_class_scale.h.bak delete mode 100644 src/accessor/grib_accessor_class_scale_values.h.bak delete mode 100644 src/accessor/grib_accessor_class_second_order_bits_per_value.h.bak delete mode 100644 src/accessor/grib_accessor_class_section.h.bak delete mode 100644 src/accessor/grib_accessor_class_section_length.h.bak delete mode 100644 src/accessor/grib_accessor_class_section_padding.h.bak delete mode 100644 src/accessor/grib_accessor_class_section_pointer.h.bak delete mode 100644 src/accessor/grib_accessor_class_select_step_template.h.bak delete mode 100644 src/accessor/grib_accessor_class_sexagesimal2decimal.h.bak delete mode 100644 src/accessor/grib_accessor_class_signed.h.bak delete mode 100644 src/accessor/grib_accessor_class_signed_bits.h.bak delete mode 100644 src/accessor/grib_accessor_class_simple_packing_error.h.bak delete mode 100644 src/accessor/grib_accessor_class_size.h.bak delete mode 100644 src/accessor/grib_accessor_class_smart_table.h.bak delete mode 100644 src/accessor/grib_accessor_class_smart_table_column.h.bak delete mode 100644 src/accessor/grib_accessor_class_spd.h.bak delete mode 100644 src/accessor/grib_accessor_class_spectral_truncation.h.bak delete mode 100644 src/accessor/grib_accessor_class_sprintf.h.bak delete mode 100644 src/accessor/grib_accessor_class_statistics.h.bak delete mode 100644 src/accessor/grib_accessor_class_statistics_spectral.h.bak delete mode 100644 src/accessor/grib_accessor_class_step_human_readable.h.bak delete mode 100644 src/accessor/grib_accessor_class_step_in_units.h.bak delete mode 100644 src/accessor/grib_accessor_class_sum.h.bak delete mode 100644 src/accessor/grib_accessor_class_suppressed.h.bak delete mode 100644 src/accessor/grib_accessor_class_time.h.bak delete mode 100644 src/accessor/grib_accessor_class_to_double.h.bak delete mode 100644 src/accessor/grib_accessor_class_to_integer.h.bak delete mode 100644 src/accessor/grib_accessor_class_to_string.h.bak delete mode 100644 src/accessor/grib_accessor_class_transient.h.bak delete mode 100644 src/accessor/grib_accessor_class_transient_darray.h.bak delete mode 100644 src/accessor/grib_accessor_class_trim.h.bak delete mode 100644 src/accessor/grib_accessor_class_uint16.h.bak delete mode 100644 src/accessor/grib_accessor_class_uint32.h.bak delete mode 100644 src/accessor/grib_accessor_class_uint32_little_endian.h.bak delete mode 100644 src/accessor/grib_accessor_class_uint64.h.bak delete mode 100644 src/accessor/grib_accessor_class_uint64_little_endian.h.bak delete mode 100644 src/accessor/grib_accessor_class_uint8.h.bak delete mode 100644 src/accessor/grib_accessor_class_unexpanded_descriptors.h.bak delete mode 100644 src/accessor/grib_accessor_class_unpack_bufr_values.h.bak delete mode 100644 src/accessor/grib_accessor_class_unsigned.h.bak delete mode 100644 src/accessor/grib_accessor_class_unsigned_bits.h.bak delete mode 100644 src/accessor/grib_accessor_class_validity_date.h.bak delete mode 100644 src/accessor/grib_accessor_class_validity_time.h.bak delete mode 100644 src/accessor/grib_accessor_class_values.h.bak delete mode 100644 src/accessor/grib_accessor_class_variable.h.bak delete mode 100644 src/accessor/grib_accessor_class_vector.h.bak delete mode 100644 src/accessor/grib_accessor_class_when.h.bak diff --git a/src/accessor/grib_accessor_class_abstract_long_vector.h.bak b/src/accessor/grib_accessor_class_abstract_long_vector.h.bak deleted file mode 100644 index 2961979d8..000000000 --- a/src/accessor/grib_accessor_class_abstract_long_vector.h.bak +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_abstract_long_vector_h -#define eccodes_accessor_abstract_long_vector_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_abstract_long_vector_t : public grib_accessor_gen_t -{ -public: - /* Members defined in abstract_long_vector */ - long* v; - long pack_index; - int number_of_elements; -}; - -class grib_accessor_class_abstract_long_vector_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_abstract_long_vector_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_abstract_long_vector_t{}; } -}; -#endif /* eccodes_accessor_abstract_long_vector_h */ diff --git a/src/accessor/grib_accessor_class_abstract_vector.h.bak b/src/accessor/grib_accessor_class_abstract_vector.h.bak deleted file mode 100644 index df7e3fdbf..000000000 --- a/src/accessor/grib_accessor_class_abstract_vector.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_abstract_vector_h -#define eccodes_accessor_abstract_vector_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_abstract_vector_t : public grib_accessor_double_t -{ -public: - /* Members defined in abstract_vector */ - double* v; - int number_of_elements; -}; - -class grib_accessor_class_abstract_vector_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_abstract_vector_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_abstract_vector_t{}; } -}; -#endif /* eccodes_accessor_abstract_vector_h */ diff --git a/src/accessor/grib_accessor_class_ascii.h.bak b/src/accessor/grib_accessor_class_ascii.h.bak deleted file mode 100644 index cb8e68bd7..000000000 --- a/src/accessor/grib_accessor_class_ascii.h.bak +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_ascii_h -#define eccodes_accessor_ascii_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_ascii_t : public grib_accessor_gen_t -{ -public: - /* Members defined in ascii */ -}; - -class grib_accessor_class_ascii_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_ascii_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_ascii_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_ascii_h */ diff --git a/src/accessor/grib_accessor_class_bit.h.bak b/src/accessor/grib_accessor_class_bit.h.bak deleted file mode 100644 index 3a9eee2d7..000000000 --- a/src/accessor/grib_accessor_class_bit.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bit_h -#define eccodes_accessor_bit_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_bit_t : public grib_accessor_long_t -{ -public: - /* Members defined in bit */ - const char* owner; - int bit_index; -}; - -class grib_accessor_class_bit_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_bit_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bit_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_bit_h */ diff --git a/src/accessor/grib_accessor_class_bitmap.h.bak b/src/accessor/grib_accessor_class_bitmap.h.bak deleted file mode 100644 index d9b3ab9df..000000000 --- a/src/accessor/grib_accessor_class_bitmap.h.bak +++ /dev/null @@ -1,45 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bitmap_h -#define eccodes_accessor_bitmap_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_bytes.h" - -class grib_accessor_bitmap_t : public grib_accessor_bytes_t -{ -public: - /* Members defined in bitmap */ - const char* tableReference; - const char* missing_value; - const char* offsetbsec; - const char* sLength; -}; - -class grib_accessor_class_bitmap_t : public grib_accessor_class_bytes_t -{ -public: - grib_accessor_class_bitmap_t(const char* name) : grib_accessor_class_bytes_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bitmap_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - long next_offset(grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; -}; -#endif /* eccodes_accessor_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_bits.h.bak b/src/accessor/grib_accessor_class_bits.h.bak deleted file mode 100644 index b5dd2977b..000000000 --- a/src/accessor/grib_accessor_class_bits.h.bak +++ /dev/null @@ -1,45 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bits_h -#define eccodes_accessor_bits_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_bits_t : public grib_accessor_gen_t -{ -public: - /* Members defined in bits */ - const char* argument; - long start; - long len; - double referenceValue; - double referenceValuePresent; - double scale; -}; - -class grib_accessor_class_bits_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_bits_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bits_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - long byte_count(grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_bits_h */ diff --git a/src/accessor/grib_accessor_class_bits_per_value.h.bak b/src/accessor/grib_accessor_class_bits_per_value.h.bak deleted file mode 100644 index 59514fc05..000000000 --- a/src/accessor/grib_accessor_class_bits_per_value.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bits_per_value_h -#define eccodes_accessor_bits_per_value_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_bits_per_value_t : public grib_accessor_long_t -{ -public: - /* Members defined in bits_per_value */ - const char* values; - const char* bits_per_value; -}; - -class grib_accessor_class_bits_per_value_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_bits_per_value_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bits_per_value_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_bits_per_value_h */ diff --git a/src/accessor/grib_accessor_class_blob.h.bak b/src/accessor/grib_accessor_class_blob.h.bak deleted file mode 100644 index a2da98a03..000000000 --- a/src/accessor/grib_accessor_class_blob.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_blob_h -#define eccodes_accessor_blob_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_blob_t : public grib_accessor_gen_t -{ -public: - /* Members defined in blob */ -}; - -class grib_accessor_class_blob_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_blob_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_blob_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_blob_h */ diff --git a/src/accessor/grib_accessor_class_budgdate.h.bak b/src/accessor/grib_accessor_class_budgdate.h.bak deleted file mode 100644 index c3fc849c7..000000000 --- a/src/accessor/grib_accessor_class_budgdate.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_budgdate_h -#define eccodes_accessor_budgdate_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_budgdate_t : public grib_accessor_long_t -{ -public: - /* Members defined in budgdate */ - const char* year; - const char* month; - const char* day; -}; - -class grib_accessor_class_budgdate_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_budgdate_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_budgdate_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_budgdate_h */ diff --git a/src/accessor/grib_accessor_class_bufr_data_array.h.bak b/src/accessor/grib_accessor_class_bufr_data_array.h.bak deleted file mode 100644 index c6089fa63..000000000 --- a/src/accessor/grib_accessor_class_bufr_data_array.h.bak +++ /dev/null @@ -1,92 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bufr_data_array_h -#define eccodes_accessor_bufr_data_array_h - -#include "grib_accessor_class_gen.h" - -class grib_accessor_bufr_data_array_t : public grib_accessor_gen_t -{ -public: - const char* bufrDataEncodedName; - const char* numberOfSubsetsName; - const char* expandedDescriptorsName; - const char* flagsName; - const char* unitsName; - const char* elementsDescriptorsIndexName; - const char* compressedDataName; - bufr_descriptors_array* expanded; - grib_accessor* expandedAccessor; - int* canBeMissing; - long numberOfSubsets; - long compressedData; - grib_vdarray* numericValues; - grib_vsarray* stringValues; - grib_viarray* elementsDescriptorsIndex; - int do_decode; - int bitmapStartElementsDescriptorsIndex; - int bitmapCurrentElementsDescriptorsIndex; - int bitmapSize; - int bitmapStart; - int bitmapCurrent; - grib_accessors_list* dataAccessors; - int unpackMode; - int bitsToEndData; - grib_section* dataKeys; - double* inputBitmap; - int nInputBitmap; - int iInputBitmap; - long* inputReplications; - int nInputReplications; - int iInputReplications; - long* inputExtendedReplications; - int nInputExtendedReplications; - int iInputExtendedReplications; - long* inputShortReplications; - int nInputShortReplications; - int iInputShortReplications; - grib_iarray* iss_list; - grib_trie_with_rank* dataAccessorsTrie; - grib_sarray* tempStrings; - grib_vdarray* tempDoubleValues; - int change_ref_value_operand; - size_t refValListSize; - long* refValList; - long refValIndex; - bufr_tableb_override* tableb_override; - int set_to_missing_if_out_of_range; -}; - -class grib_accessor_class_bufr_data_array_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_bufr_data_array_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_data_array_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - long byte_count(grib_accessor*) override; - long byte_offset(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; - -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); - -#endif /* eccodes_accessor_bufr_data_array_h */ diff --git a/src/accessor/grib_accessor_class_bufr_data_element.h.bak b/src/accessor/grib_accessor_class_bufr_data_element.h.bak deleted file mode 100644 index 6cba5b91c..000000000 --- a/src/accessor/grib_accessor_class_bufr_data_element.h.bak +++ /dev/null @@ -1,57 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bufr_data_element_h -#define eccodes_accessor_bufr_data_element_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_bufr_data_element_t : public grib_accessor_gen_t -{ -public: - /* Members defined in bufr_data_element */ - long index; - int type; - long compressedData; - long subsetNumber; - long numberOfSubsets; - bufr_descriptors_array* descriptors; - grib_vdarray* numericValues; - grib_vsarray* stringValues; - grib_viarray* elementsDescriptorsIndex; - char* cname; -}; - -class grib_accessor_class_bufr_data_element_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_bufr_data_element_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_data_element_t{}; } - int get_native_type(grib_accessor*) override; - int pack_missing(grib_accessor*) override; - int is_missing(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int pack_string_array(grib_accessor*, const char**, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int unpack_string_array(grib_accessor*, char**, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; -}; -#endif /* eccodes_accessor_bufr_data_element_h */ diff --git a/src/accessor/grib_accessor_class_bufr_elements_table.h.bak b/src/accessor/grib_accessor_class_bufr_elements_table.h.bak deleted file mode 100644 index 8ddd8a824..000000000 --- a/src/accessor/grib_accessor_class_bufr_elements_table.h.bak +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bufr_elements_table_h -#define eccodes_accessor_bufr_elements_table_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_bufr_elements_table_t : public grib_accessor_gen_t -{ -public: - /* Members defined in bufr_elements_table */ - const char* dictionary; - const char* masterDir; - const char* localDir; -}; - -class grib_accessor_class_bufr_elements_table_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_bufr_elements_table_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_elements_table_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_bufr_elements_table_h */ diff --git a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h.bak b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h.bak deleted file mode 100644 index d079f958e..000000000 --- a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h.bak +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bufr_extract_area_subsets_h -#define eccodes_accessor_bufr_extract_area_subsets_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_bufr_extract_area_subsets_t : public grib_accessor_gen_t -{ -public: - /* Members defined in bufr_extract_area_subsets */ - const char* doExtractSubsets; - const char* numberOfSubsets; - const char* extractSubsetList; - const char* extractAreaWestLongitude; - const char* extractAreaEastLongitude; - const char* extractAreaNorthLatitude; - const char* extractAreaSouthLatitude; - const char* extractAreaLongitudeRank; - const char* extractAreaLatitudeRank; - const char* extractedAreaNumberOfSubsets; -}; - -class grib_accessor_class_bufr_extract_area_subsets_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_bufr_extract_area_subsets_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_extract_area_subsets_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_bufr_extract_area_subsets_h */ diff --git a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h.bak b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h.bak deleted file mode 100644 index 7acfd35b3..000000000 --- a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bufr_extract_datetime_subsets_h -#define eccodes_accessor_bufr_extract_datetime_subsets_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_bufr_extract_datetime_subsets_t : public grib_accessor_gen_t -{ -public: - /* Members defined in bufr_extract_datetime_subsets */ - const char* doExtractSubsets; - const char* numberOfSubsets; - const char* extractSubsetList; -}; - -class grib_accessor_class_bufr_extract_datetime_subsets_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_bufr_extract_datetime_subsets_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_extract_datetime_subsets_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_bufr_extract_datetime_subsets_h */ diff --git a/src/accessor/grib_accessor_class_bufr_extract_subsets.h.bak b/src/accessor/grib_accessor_class_bufr_extract_subsets.h.bak deleted file mode 100644 index 80392338d..000000000 --- a/src/accessor/grib_accessor_class_bufr_extract_subsets.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bufr_extract_subsets_h -#define eccodes_accessor_bufr_extract_subsets_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_bufr_extract_subsets_t : public grib_accessor_gen_t -{ -public: - /* Members defined in bufr_extract_subsets */ - const char* numericValues; - const char* pack; - grib_accessor* numericValuesAccessor; - grib_accessor* packAccessor; -}; - -class grib_accessor_class_bufr_extract_subsets_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_bufr_extract_subsets_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_extract_subsets_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_bufr_extract_subsets_h */ diff --git a/src/accessor/grib_accessor_class_bufr_group.h.bak b/src/accessor/grib_accessor_class_bufr_group.h.bak deleted file mode 100644 index 3bd71690f..000000000 --- a/src/accessor/grib_accessor_class_bufr_group.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bufr_group_h -#define eccodes_accessor_bufr_group_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_variable.h" - -class grib_accessor_bufr_group_t : public grib_accessor_variable_t -{ -public: - /* Members defined in bufr_group */ -}; - -class grib_accessor_class_bufr_group_t : public grib_accessor_class_variable_t -{ -public: - grib_accessor_class_bufr_group_t(const char* name) : grib_accessor_class_variable_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_group_t{}; } - void dump(grib_accessor*, grib_dumper*) override; - grib_accessor* next(grib_accessor* a, int explore) override; -}; -#endif /* eccodes_accessor_bufr_group_h */ diff --git a/src/accessor/grib_accessor_class_bufr_simple_thinning.h.bak b/src/accessor/grib_accessor_class_bufr_simple_thinning.h.bak deleted file mode 100644 index eb786f966..000000000 --- a/src/accessor/grib_accessor_class_bufr_simple_thinning.h.bak +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bufr_simple_thinning_h -#define eccodes_accessor_bufr_simple_thinning_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_bufr_simple_thinning_t : public grib_accessor_gen_t -{ -public: - /* Members defined in bufr_simple_thinning */ - const char* doExtractSubsets; - const char* numberOfSubsets; - const char* extractSubsetList; - const char* simpleThinningStart; - const char* simpleThinningMissingRadius; - const char* simpleThinningSkip; -}; - -class grib_accessor_class_bufr_simple_thinning_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_bufr_simple_thinning_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_simple_thinning_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_bufr_simple_thinning_h */ diff --git a/src/accessor/grib_accessor_class_bufr_string_values.h.bak b/src/accessor/grib_accessor_class_bufr_string_values.h.bak deleted file mode 100644 index 9038a8d73..000000000 --- a/src/accessor/grib_accessor_class_bufr_string_values.h.bak +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bufr_string_values_h -#define eccodes_accessor_bufr_string_values_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_ascii.h" - -class grib_accessor_bufr_string_values_t : public grib_accessor_ascii_t -{ -public: - /* Members defined in bufr_string_values */ - const char* dataAccessorName; - grib_accessor* dataAccessor; -}; - -class grib_accessor_class_bufr_string_values_t : public grib_accessor_class_ascii_t -{ -public: - grib_accessor_class_bufr_string_values_t(const char* name) : grib_accessor_class_ascii_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bufr_string_values_t{}; } - int unpack_string(grib_accessor*, char*, size_t* len) override; - int unpack_string_array(grib_accessor*, char**, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_bufr_string_values_h */ diff --git a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h.bak b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h.bak deleted file mode 100644 index 588f9d08b..000000000 --- a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bufrdc_expanded_descriptors_h -#define eccodes_accessor_bufrdc_expanded_descriptors_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_bufrdc_expanded_descriptors_t : public grib_accessor_long_t -{ -public: - /* Members defined in bufrdc_expanded_descriptors */ - const char* expandedDescriptors; - grib_accessor* expandedDescriptorsAccessor; -}; - -class grib_accessor_class_bufrdc_expanded_descriptors_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_bufrdc_expanded_descriptors_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bufrdc_expanded_descriptors_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string_array(grib_accessor*, char**, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_bufrdc_expanded_descriptors_h */ diff --git a/src/accessor/grib_accessor_class_bytes.h.bak b/src/accessor/grib_accessor_class_bytes.h.bak deleted file mode 100644 index 8204ceba7..000000000 --- a/src/accessor/grib_accessor_class_bytes.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_bytes_h -#define eccodes_accessor_bytes_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_bytes_t : public grib_accessor_gen_t -{ -public: - /* Members defined in bytes */ -}; - -class grib_accessor_class_bytes_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_bytes_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_bytes_t{}; } - int get_native_type(grib_accessor*) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_bytes_h */ diff --git a/src/accessor/grib_accessor_class_change_alternative_row_scanning.h.bak b/src/accessor/grib_accessor_class_change_alternative_row_scanning.h.bak deleted file mode 100644 index c893e242f..000000000 --- a/src/accessor/grib_accessor_class_change_alternative_row_scanning.h.bak +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_change_alternative_row_scanning_h -#define eccodes_accessor_change_alternative_row_scanning_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_change_alternative_row_scanning_t : public grib_accessor_gen_t -{ -public: - /* Members defined in change_alternative_row_scanning */ - const char* values; - const char* Ni; - const char* Nj; - const char* alternativeRowScanning; -}; - -class grib_accessor_class_change_alternative_row_scanning_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_change_alternative_row_scanning_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_change_alternative_row_scanning_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_change_alternative_row_scanning_h */ diff --git a/src/accessor/grib_accessor_class_change_scanning_direction.h.bak b/src/accessor/grib_accessor_class_change_scanning_direction.h.bak deleted file mode 100644 index 08f2ceb55..000000000 --- a/src/accessor/grib_accessor_class_change_scanning_direction.h.bak +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_change_scanning_direction_h -#define eccodes_accessor_change_scanning_direction_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_change_scanning_direction_t : public grib_accessor_gen_t -{ -public: - /* Members defined in change_scanning_direction */ - const char* values; - const char* Ni; - const char* Nj; - const char* i_scans_negatively; - const char* j_scans_positively; - const char* first; - const char* last; - const char* axis; -}; - -class grib_accessor_class_change_scanning_direction_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_change_scanning_direction_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_change_scanning_direction_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_change_scanning_direction_h */ diff --git a/src/accessor/grib_accessor_class_check_internal_version.h.bak b/src/accessor/grib_accessor_class_check_internal_version.h.bak deleted file mode 100644 index 871f5a56e..000000000 --- a/src/accessor/grib_accessor_class_check_internal_version.h.bak +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_check_internal_version_h -#define eccodes_accessor_check_internal_version_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_ascii.h" - -class grib_accessor_check_internal_version_t : public grib_accessor_ascii_t -{ -public: - /* Members defined in check_internal_version */ -}; - -class grib_accessor_class_check_internal_version_t : public grib_accessor_class_ascii_t -{ -public: - grib_accessor_class_check_internal_version_t(const char* name) : grib_accessor_class_ascii_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_check_internal_version_t{}; } - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_check_internal_version_h */ diff --git a/src/accessor/grib_accessor_class_closest_date.h.bak b/src/accessor/grib_accessor_class_closest_date.h.bak deleted file mode 100644 index b4fbace12..000000000 --- a/src/accessor/grib_accessor_class_closest_date.h.bak +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_closest_date_h -#define eccodes_accessor_closest_date_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_closest_date_t : public grib_accessor_double_t -{ -public: - /* Members defined in closest_date */ - const char *dateLocal; - const char *timeLocal; - const char *numForecasts; - const char *year; - const char *month; - const char *day; - const char *hour; - const char *minute; - const char *second; -}; - -class grib_accessor_class_closest_date_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_closest_date_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_closest_date_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_closest_date_h */ diff --git a/src/accessor/grib_accessor_class_codeflag.h.bak b/src/accessor/grib_accessor_class_codeflag.h.bak deleted file mode 100644 index 734369b74..000000000 --- a/src/accessor/grib_accessor_class_codeflag.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_codeflag_h -#define eccodes_accessor_codeflag_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_unsigned.h" - -class grib_accessor_codeflag_t : public grib_accessor_unsigned_t -{ -public: - /* Members defined in codeflag */ - const char* tablename; -}; - -class grib_accessor_class_codeflag_t : public grib_accessor_class_unsigned_t -{ -public: - grib_accessor_class_codeflag_t(const char* name) : grib_accessor_class_unsigned_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_codeflag_t{}; } - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_codeflag_h */ diff --git a/src/accessor/grib_accessor_class_codetable.h.bak b/src/accessor/grib_accessor_class_codetable.h.bak deleted file mode 100644 index c77c6f72d..000000000 --- a/src/accessor/grib_accessor_class_codetable.h.bak +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (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. - */ - -/***************************************** - * Enrico Fucile - ****************************************/ - -#pragma once - -#include "../grib_api_internal.h" -#include "grib_accessor_class_unsigned.h" -#include - - -class grib_accessor_codetable_t : public grib_accessor_unsigned_t -{ -public: - const char* tablename; - const char* masterDir; - const char* localDir; - grib_codetable* table; - int table_loaded; -}; - -class grib_accessor_class_codetable_t : public grib_accessor_class_unsigned_t -{ -public: - grib_accessor* create_empty_accessor() override { return new grib_accessor_codetable_t{}; } - grib_accessor_class_codetable_t(const char* name) : grib_accessor_class_unsigned_t(name) {} - int get_native_type(grib_accessor*) override; - int pack_missing(grib_accessor*) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int pack_expression(grib_accessor*, grib_expression*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; diff --git a/src/accessor/grib_accessor_class_codetable_title.h.bak b/src/accessor/grib_accessor_class_codetable_title.h.bak deleted file mode 100644 index e115a9c28..000000000 --- a/src/accessor/grib_accessor_class_codetable_title.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_codetable_title_h -#define eccodes_accessor_codetable_title_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_codetable_title_t : public grib_accessor_gen_t -{ -public: - /* Members defined in codetable_title */ - const char* codetable; -}; - -class grib_accessor_class_codetable_title_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_codetable_title_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_codetable_title_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_codetable_title_h */ diff --git a/src/accessor/grib_accessor_class_codetable_units.h.bak b/src/accessor/grib_accessor_class_codetable_units.h.bak deleted file mode 100644 index b5cfb75c8..000000000 --- a/src/accessor/grib_accessor_class_codetable_units.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_codetable_units_h -#define eccodes_accessor_codetable_units_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_codetable_units_t : public grib_accessor_gen_t -{ -public: - /* Members defined in codetable_units */ - const char* codetable; -}; - -class grib_accessor_class_codetable_units_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_codetable_units_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_codetable_units_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_codetable_units_h */ diff --git a/src/accessor/grib_accessor_class_concept.h.bak b/src/accessor/grib_accessor_class_concept.h.bak deleted file mode 100644 index 99405ed48..000000000 --- a/src/accessor/grib_accessor_class_concept.h.bak +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_concept_h -#define eccodes_accessor_concept_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_concept_t : public grib_accessor_gen_t -{ -public: - /* Members defined in concept */ -}; - -class grib_accessor_class_concept_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_concept_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_concept_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_concept_h */ diff --git a/src/accessor/grib_accessor_class_constant.h.bak b/src/accessor/grib_accessor_class_constant.h.bak deleted file mode 100644 index 0c4944c68..000000000 --- a/src/accessor/grib_accessor_class_constant.h.bak +++ /dev/null @@ -1,27 +0,0 @@ -/* - * (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. - */ - - -/************************************* - * Enrico Fucile - **************************************/ - -#include "../grib_api_internal.h" -#include "grib_accessor_class_variable.h" - -class grib_accessor_constant_t : public grib_accessor_variable_t {}; - -class grib_accessor_class_constant_t : public grib_accessor_class_variable_t -{ -public: - grib_accessor_class_constant_t(const char* name) : grib_accessor_class_variable_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_constant_t{}; } - void init(grib_accessor*, const long, grib_arguments*) override; -}; diff --git a/src/accessor/grib_accessor_class_count_file.h.bak b/src/accessor/grib_accessor_class_count_file.h.bak deleted file mode 100644 index 4b9a0b4f0..000000000 --- a/src/accessor/grib_accessor_class_count_file.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_count_file_h -#define eccodes_accessor_count_file_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_count_file_t : public grib_accessor_long_t -{ -public: - /* Members defined in count_file */ -}; - -class grib_accessor_class_count_file_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_count_file_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_count_file_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_count_file_h */ diff --git a/src/accessor/grib_accessor_class_count_missing.h.bak b/src/accessor/grib_accessor_class_count_missing.h.bak deleted file mode 100644 index fbf583109..000000000 --- a/src/accessor/grib_accessor_class_count_missing.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_count_missing_h -#define eccodes_accessor_count_missing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_count_missing_t : public grib_accessor_long_t -{ -public: - /* Members defined in count_missing */ - const char* bitmap; - const char* unusedBitsInBitmap; - const char* numberOfDataPoints; - const char* missingValueManagementUsed; -}; - -class grib_accessor_class_count_missing_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_count_missing_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_count_missing_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_count_missing_h */ diff --git a/src/accessor/grib_accessor_class_count_total.h.bak b/src/accessor/grib_accessor_class_count_total.h.bak deleted file mode 100644 index ab044e8a9..000000000 --- a/src/accessor/grib_accessor_class_count_total.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_count_total_h -#define eccodes_accessor_count_total_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_count_total_t : public grib_accessor_long_t -{ -public: - /* Members defined in count_total */ -}; - -class grib_accessor_class_count_total_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_count_total_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_count_total_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_count_total_h */ diff --git a/src/accessor/grib_accessor_class_data_apply_bitmap.h.bak b/src/accessor/grib_accessor_class_data_apply_bitmap.h.bak deleted file mode 100644 index b2516ec4e..000000000 --- a/src/accessor/grib_accessor_class_data_apply_bitmap.h.bak +++ /dev/null @@ -1,132 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_apply_bitmap_h -#define eccodes_accessor_data_apply_bitmap_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_data_apply_bitmap_t : public grib_accessor_gen_t -{ -public: - /* 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; -}; - -class grib_accessor_class_data_apply_bitmap_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_data_apply_bitmap_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_apply_bitmap_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int compare(grib_accessor*, grib_accessor*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; - -private: - template int unpack(grib_accessor*, T*, size_t*); -}; - - -template -int grib_accessor_class_data_apply_bitmap_t::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_t* self = (grib_accessor_data_apply_bitmap_t*)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 = a->value_count(&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", - __func__, - 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, __func__, coded_n_vals, n_vals); - - return GRIB_ARRAY_TOO_SMALL; - } - } - } - - *len = n_vals; - - grib_context_free(a->context, coded_vals); - return err; -} - -#endif /* eccodes_accessor_data_apply_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h.bak b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h.bak deleted file mode 100644 index 9b101e7ed..000000000 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h.bak +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * (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. - */ - -#pragma once - -#include "grib_accessor_class_gen.h" - -class grib_accessor_data_apply_boustrophedonic_t : public grib_accessor_gen_t -{ -public: - /* Members defined in data_apply_boustrophedonic */ - const char* values; - const char* numberOfRows; - const char* numberOfColumns; - const char* numberOfPoints; - const char* pl; -}; - -class grib_accessor_class_data_apply_boustrophedonic_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_data_apply_boustrophedonic_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_apply_boustrophedonic_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; -}; diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h.bak b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h.bak deleted file mode 100644 index e92299eab..000000000 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h.bak +++ /dev/null @@ -1,45 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_apply_boustrophedonic_bitmap_h -#define eccodes_accessor_data_apply_boustrophedonic_bitmap_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_data_apply_boustrophedonic_bitmap_t : public grib_accessor_gen_t -{ -public: - /* Members defined in data_apply_boustrophedonic_bitmap */ - const char* coded_values; - const char* bitmap; - const char* missing_value; - const char* binary_scale_factor; - const char* numberOfRows; - const char* numberOfColumns; - const char* numberOfPoints; -}; - -class grib_accessor_class_data_apply_boustrophedonic_bitmap_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_data_apply_boustrophedonic_bitmap_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_apply_boustrophedonic_bitmap_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; -}; -#endif /* eccodes_accessor_data_apply_boustrophedonic_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.h.bak b/src/accessor/grib_accessor_class_data_ccsds_packing.h.bak deleted file mode 100644 index 19889e937..000000000 --- a/src/accessor/grib_accessor_class_data_ccsds_packing.h.bak +++ /dev/null @@ -1,203 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_ccsds_packing_h -#define eccodes_accessor_data_ccsds_packing_h - -#include "grib_accessor_class_values.h" -#include "grib_scaling.h" - -#if defined(HAVE_LIBAEC) || defined(HAVE_AEC) -#include -#endif - -#ifndef LIBAEC_DLL_EXPORTED - #error Version of libaec appears to be too old. Please upgrade. -#endif - -class grib_accessor_data_ccsds_packing_t : public grib_accessor_values_t -{ -public: - /* 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* optimize_scaling_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; -}; - - - -// TODO(maee): if libaec is not available, this class should not be defined -class grib_accessor_class_data_ccsds_packing_t : public grib_accessor_class_values_t -{ -public: - grib_accessor_class_data_ccsds_packing_t(const char* name) : grib_accessor_class_values_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_ccsds_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; - -private: - template int unpack(grib_accessor*, T*, size_t* ); - void print_aec_stream_info(struct aec_stream*, const char*); - void modify_aec_flags(long*); - const char* aec_get_error_message(int); - bool is_big_endian(); -}; - - -template -int grib_accessor_class_data_ccsds_packing_t::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_t* self = (grib_accessor_data_ccsds_packing_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - const char* cclass_name = a->cclass->name; - - 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 nn = 0; - - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - double reference_value = 0; - long bits_per_value = 0; - - long ccsds_flags; - long ccsds_block_size; - long ccsds_rsi; - size_t nbytes; - - self->dirty = 0; - - if ((err = a->value_count(&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; - - modify_aec_flags(&ccsds_flags); - - // TODO(masn): 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 = codes_power(binary_scale_factor, 2); - dscale = codes_power(-decimal_scale_factor, 10); - - buflen = a->byte_count(); buf = (unsigned char*)hand->buffer->data; - buf += a->byte_offset(); - 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; - - nbytes = (bits_per_value + 7) / 8; - if (nbytes == 3) - nbytes = 4; - - size = n_vals * nbytes; - 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, "%s %s: aec_buffer_decode error %d (%s)", - cclass_name, __func__, err, aec_get_error_message(err)); - err = GRIB_DECODING_ERROR; - goto cleanup; - } - - // ECC-1427: Performance improvement (replaced by ECC-1602) - //grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); - - // ECC-1602: Performance improvement - switch (nbytes) { - case 1: - for (i = 0; i < n_vals; i++) { - val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; - } - break; - case 2: - for (i = 0; i < n_vals; i++) { - val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; - } - break; - case 4: - for (i = 0; i < n_vals; i++) { - val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; - } - break; - default: - grib_context_log(a->context, GRIB_LOG_ERROR, "%s %s: unpacking %s, bits_per_value=%ld (max 32)", - cclass_name, __func__, a->name, bits_per_value); - err = GRIB_INVALID_BPV; - goto cleanup; - } - - *len = n_vals; - -cleanup: - grib_context_buffer_free(a->context, decoded); - return err; -} - -#endif /* eccodes_accessor_data_ccsds_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_complex_packing.h.bak b/src/accessor/grib_accessor_class_data_complex_packing.h.bak deleted file mode 100644 index d588eef38..000000000 --- a/src/accessor/grib_accessor_class_data_complex_packing.h.bak +++ /dev/null @@ -1,272 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_complex_packing_h -#define eccodes_accessor_data_complex_packing_h - -#include "grib_accessor_class_data_simple_packing.h" -#include "grib_scaling.h" -#include "grib_ieeefloat.h" - -typedef unsigned long (*encode_float_proc)(double); -typedef double (*decode_float_proc)(unsigned long); - -class grib_accessor_data_complex_packing_t : public grib_accessor_data_simple_packing_t -{ -public: - /* 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; -}; - -class grib_accessor_class_data_complex_packing_t : public grib_accessor_class_data_simple_packing_t -{ -public: - grib_accessor_class_data_complex_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_complex_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - -private: - template int unpack(grib_accessor*, T*, size_t*); -}; - -template -int grib_accessor_class_data_complex_packing_t::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_t* self = (grib_accessor_data_complex_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); - const char* cclass_name = a->cclass->name; - - 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; - - T s = 0; - T d = 0; - T 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; - T 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; - double tmp; - - decode_float_proc decode_float = NULL; - - err = a->value_count(&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, &tmp)) != GRIB_SUCCESS) - return ret; - reference_value = tmp; - 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, &tmp)) != GRIB_SUCCESS) - return ret; - laplacianOperator = tmp; - - 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; - } - - if (sub_j != sub_k || sub_j != sub_m || pen_j != pen_k || pen_j != pen_m) { - grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Invalid pentagonal resolution parameters", cclass_name); - return GRIB_DECODING_ERROR; - } - - buf = (unsigned char*)gh->buffer->data; - - maxv = pen_j + 1; - - buf += a->byte_offset(); hres = buf; - lres = buf; - - if (pen_j == sub_j) { - n_vals = (pen_j + 1) * (pen_j + 2); - d = codes_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 = a->byte_offset() + bytes * (sub_k + 1) * (sub_k + 2); - lpos = 8 * (packed_offset - offsetdata); - - s = codes_power(binary_scale_factor, 2); - d = codes_power(-decimal_scale_factor, 10); - - scals = (T*)grib_context_malloc(a->context, maxv * sizeof(T)); - if (!scals) return GRIB_OUT_OF_MEMORY; - - 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, - "%s: Problem with operator div by zero at index %d of %d", cclass_name, 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; -} - -#endif /* eccodes_accessor_data_complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_dummy_field.h.bak b/src/accessor/grib_accessor_class_data_dummy_field.h.bak deleted file mode 100644 index 00de1fe73..000000000 --- a/src/accessor/grib_accessor_class_data_dummy_field.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_dummy_field_h -#define eccodes_accessor_data_dummy_field_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_g1simple_packing.h" - -class grib_accessor_data_dummy_field_t : public grib_accessor_data_g1simple_packing_t -{ -public: - /* Members defined in data_dummy_field */ - const char* missing_value; - const char* numberOfPoints; - const char* bitmap; -}; - -class grib_accessor_class_data_dummy_field_t : public grib_accessor_class_data_g1simple_packing_t -{ -public: - grib_accessor_class_data_dummy_field_t(const char* name) : grib_accessor_class_data_g1simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_dummy_field_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_dummy_field_h */ diff --git a/src/accessor/grib_accessor_class_data_g1complex_packing.h.bak b/src/accessor/grib_accessor_class_data_g1complex_packing.h.bak deleted file mode 100644 index cc6208c95..000000000 --- a/src/accessor/grib_accessor_class_data_g1complex_packing.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g1complex_packing_h -#define eccodes_accessor_data_g1complex_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_complex_packing.h" - -class grib_accessor_data_g1complex_packing_t : public grib_accessor_data_complex_packing_t -{ -public: - /* Members defined in data_g1complex_packing */ - const char* N; - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; -}; - -class grib_accessor_class_data_g1complex_packing_t : public grib_accessor_class_data_complex_packing_t -{ -public: - grib_accessor_class_data_g1complex_packing_t(const char* name) : grib_accessor_class_data_complex_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1complex_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_g1complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h.bak b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h.bak deleted file mode 100644 index adfc36716..000000000 --- a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h.bak +++ /dev/null @@ -1,53 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g1second_order_constant_width_packing_h -#define eccodes_accessor_data_g1second_order_constant_width_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_simple_packing.h" - -class grib_accessor_data_g1second_order_constant_width_packing_t : public grib_accessor_data_simple_packing_t -{ -public: - /* Members defined in data_g1second_order_constant_width_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* pl; - const char* Ni; - const char* Nj; - const char* jPointsAreConsecutive; - const char* bitmap; - const char* groupWidth; -}; - -class grib_accessor_class_data_g1second_order_constant_width_packing_t : public grib_accessor_class_data_simple_packing_t -{ -public: - grib_accessor_class_data_g1second_order_constant_width_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_constant_width_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; -}; -#endif /* eccodes_accessor_data_g1second_order_constant_width_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h.bak b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h.bak deleted file mode 100644 index 245217f7f..000000000 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h.bak +++ /dev/null @@ -1,68 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g1second_order_general_extended_packing_h -#define eccodes_accessor_data_g1second_order_general_extended_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_simple_packing.h" - -class grib_accessor_data_g1second_order_general_extended_packing_t : public grib_accessor_data_simple_packing_t -{ -public: - /* Members defined in data_g1second_order_general_extended_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* firstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* codedNumberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* groupWidths; - const char* widthOfWidths; - const char* groupLengths; - const char* widthOfLengths; - const char* NL; - const char* SPD; - const char* widthOfSPD; - const char* orderOfSPD; - const char* numberOfPoints; - const char* dataFlag; - double* dvalues; - float* fvalues; - int double_dirty; - int float_dirty; - size_t size; -}; - -class grib_accessor_class_data_g1second_order_general_extended_packing_t : public grib_accessor_class_data_simple_packing_t -{ -public: - grib_accessor_class_data_g1second_order_general_extended_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_general_extended_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; - -private: - int unpack(grib_accessor* a, double*, float*, size_t*); -}; -#endif /* eccodes_accessor_data_g1second_order_general_extended_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h.bak b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h.bak deleted file mode 100644 index 2e8bb3620..000000000 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h.bak +++ /dev/null @@ -1,49 +0,0 @@ - -/* - * (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. - */ - -#pragma once - -#include "grib_accessor_class_data_simple_packing.h" -#include "grib_scaling.h" - -class grib_accessor_data_g1second_order_general_packing_t : public grib_accessor_data_simple_packing_t -{ -public: - /* Members defined in data_g1second_order_general_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* pl; - const char* Ni; - const char* Nj; - const char* jPointsAreConsecutive; - const char* bitmap; - const char* groupWidths; -}; - -class grib_accessor_class_data_g1second_order_general_packing_t : public grib_accessor_class_data_simple_packing_t -{ -public: - grib_accessor_class_data_g1second_order_general_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_general_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; diff --git a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h.bak b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h.bak deleted file mode 100644 index 9b274a408..000000000 --- a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h.bak +++ /dev/null @@ -1,49 +0,0 @@ - -/* - * (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. - */ - -#pragma once - -#include "grib_accessor_class_data_simple_packing.h" -#include "grib_scaling.h" - -class grib_accessor_data_g1second_order_row_by_row_packing_t : public grib_accessor_data_simple_packing_t -{ -public: - /* Members defined in data_g1second_order_row_by_row_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* pl; - const char* Ni; - const char* Nj; - const char* jPointsAreConsecutive; - const char* bitmap; - const char* groupWidths; -}; - -class grib_accessor_class_data_g1second_order_row_by_row_packing_t : public grib_accessor_class_data_simple_packing_t -{ -public: - grib_accessor_class_data_g1second_order_row_by_row_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1second_order_row_by_row_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; diff --git a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h.bak b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h.bak deleted file mode 100644 index e963d6f44..000000000 --- a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g1secondary_bitmap_h -#define eccodes_accessor_data_g1secondary_bitmap_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_secondary_bitmap.h" - -class grib_accessor_data_g1secondary_bitmap_t : public grib_accessor_data_secondary_bitmap_t -{ -public: - /* Members defined in data_g1secondary_bitmap */ - const char* number_of_ones; -}; - -class grib_accessor_class_data_g1secondary_bitmap_t : public grib_accessor_class_data_secondary_bitmap_t -{ -public: - grib_accessor_class_data_g1secondary_bitmap_t(const char* name) : grib_accessor_class_data_secondary_bitmap_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1secondary_bitmap_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_g1secondary_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_g1shsimple_packing.h.bak b/src/accessor/grib_accessor_class_data_g1shsimple_packing.h.bak deleted file mode 100644 index 0c8efffa1..000000000 --- a/src/accessor/grib_accessor_class_data_g1shsimple_packing.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g1shsimple_packing_h -#define eccodes_accessor_data_g1shsimple_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_shsimple_packing.h" - -class grib_accessor_data_g1shsimple_packing_t : public grib_accessor_data_shsimple_packing_t -{ -public: - /* Members defined in data_g1shsimple_packing */ -}; - -class grib_accessor_class_data_g1shsimple_packing_t : public grib_accessor_class_data_shsimple_packing_t -{ -public: - grib_accessor_class_data_g1shsimple_packing_t(const char* name) : grib_accessor_class_data_shsimple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1shsimple_packing_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; -}; -#endif /* eccodes_accessor_data_g1shsimple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1simple_packing.h.bak b/src/accessor/grib_accessor_class_data_g1simple_packing.h.bak deleted file mode 100644 index 3a351d17f..000000000 --- a/src/accessor/grib_accessor_class_data_g1simple_packing.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g1simple_packing_h -#define eccodes_accessor_data_g1simple_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_simple_packing.h" - -class grib_accessor_data_g1simple_packing_t : public grib_accessor_data_simple_packing_t -{ -public: - /* Members defined in data_g1simple_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; -}; - -class grib_accessor_class_data_g1simple_packing_t : public grib_accessor_class_data_simple_packing_t -{ -public: - grib_accessor_class_data_g1simple_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g1simple_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_g1simple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.h.bak b/src/accessor/grib_accessor_class_data_g22order_packing.h.bak deleted file mode 100644 index 39d01a70b..000000000 --- a/src/accessor/grib_accessor_class_data_g22order_packing.h.bak +++ /dev/null @@ -1,55 +0,0 @@ - -/* - * (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. - */ - -#pragma once - -#include "grib_accessor_class_values.h" -#include "grib_scaling.h" - -class grib_accessor_data_g22order_packing_t : public grib_accessor_values_t -{ -public: - /* 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* optimize_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; -}; - -class grib_accessor_class_data_g22order_packing_t : public grib_accessor_class_values_t -{ -public: - grib_accessor_class_data_g22order_packing_t(const char* name) : grib_accessor_class_values_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g22order_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; -}; diff --git a/src/accessor/grib_accessor_class_data_g2bifourier_packing.h.bak b/src/accessor/grib_accessor_class_data_g2bifourier_packing.h.bak deleted file mode 100644 index f4033a1ba..000000000 --- a/src/accessor/grib_accessor_class_data_g2bifourier_packing.h.bak +++ /dev/null @@ -1,47 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g2bifourier_packing_h -#define eccodes_accessor_data_g2bifourier_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_simple_packing.h" - -class grib_accessor_data_g2bifourier_packing_t : public grib_accessor_data_simple_packing_t -{ -public: - /* Members defined in data_g2bifourier_packing */ - const char* ieee_floats; - const char* laplacianOperatorIsSet; - const char* laplacianOperator; - const char* biFourierTruncationType; - const char* sub_i; - const char* sub_j; - const char* bif_i; - const char* bif_j; - const char* biFourierSubTruncationType; - const char* biFourierDoNotPackAxes; - const char* biFourierMakeTemplate; - const char* totalNumberOfValuesInUnpackedSubset; - const char* numberOfValues; -}; - -class grib_accessor_class_data_g2bifourier_packing_t : public grib_accessor_class_data_simple_packing_t -{ -public: - grib_accessor_class_data_g2bifourier_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2bifourier_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_g2bifourier_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2complex_packing.h.bak b/src/accessor/grib_accessor_class_data_g2complex_packing.h.bak deleted file mode 100644 index e77b89276..000000000 --- a/src/accessor/grib_accessor_class_data_g2complex_packing.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g2complex_packing_h -#define eccodes_accessor_data_g2complex_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_complex_packing.h" - -class grib_accessor_data_g2complex_packing_t : public grib_accessor_data_complex_packing_t -{ -public: - /* Members defined in data_g2complex_packing */ - const char* numberOfValues; -}; - -class grib_accessor_class_data_g2complex_packing_t : public grib_accessor_class_data_complex_packing_t -{ -public: - grib_accessor_class_data_g2complex_packing_t(const char* name) : grib_accessor_class_data_complex_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2complex_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_g2complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h.bak b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h.bak deleted file mode 100644 index 394c79bfa..000000000 --- a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g2secondary_bitmap_h -#define eccodes_accessor_data_g2secondary_bitmap_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_secondary_bitmap.h" - -class grib_accessor_data_g2secondary_bitmap_t : public grib_accessor_data_secondary_bitmap_t -{ -public: - /* Members defined in data_g2secondary_bitmap */ - const char* number_of_values; -}; - -class grib_accessor_class_data_g2secondary_bitmap_t : public grib_accessor_class_data_secondary_bitmap_t -{ -public: - grib_accessor_class_data_g2secondary_bitmap_t(const char* name) : grib_accessor_class_data_secondary_bitmap_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2secondary_bitmap_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_g2secondary_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_g2shsimple_packing.h.bak b/src/accessor/grib_accessor_class_data_g2shsimple_packing.h.bak deleted file mode 100644 index 28e7a7c06..000000000 --- a/src/accessor/grib_accessor_class_data_g2shsimple_packing.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g2shsimple_packing_h -#define eccodes_accessor_data_g2shsimple_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_shsimple_packing.h" - -class grib_accessor_data_g2shsimple_packing_t : public grib_accessor_data_shsimple_packing_t -{ -public: - /* Members defined in data_g2shsimple_packing */ - const char* numberOfValues; - const char* numberOfDataPoints; -}; - -class grib_accessor_class_data_g2shsimple_packing_t : public grib_accessor_class_data_shsimple_packing_t -{ -public: - grib_accessor_class_data_g2shsimple_packing_t(const char* name) : grib_accessor_class_data_shsimple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2shsimple_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_g2shsimple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing.h.bak b/src/accessor/grib_accessor_class_data_g2simple_packing.h.bak deleted file mode 100644 index 4f27ab87c..000000000 --- a/src/accessor/grib_accessor_class_data_g2simple_packing.h.bak +++ /dev/null @@ -1,28 +0,0 @@ -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g2simple_packing_h -#define eccodes_accessor_data_g2simple_packing_h - -#include "grib_accessor_class_data_simple_packing.h" - -class grib_accessor_data_g2simple_packing_t : public grib_accessor_data_simple_packing_t {}; - -class grib_accessor_class_data_g2simple_packing_t : public grib_accessor_class_data_simple_packing_t -{ -public: - grib_accessor_class_data_g2simple_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2simple_packing_t{}; } - int pack_bytes(grib_accessor*, const unsigned char*, size_t* len) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_g2simple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h.bak b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h.bak deleted file mode 100644 index ac2bc2d27..000000000 --- a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_g2simple_packing_with_preprocessing_h -#define eccodes_accessor_data_g2simple_packing_with_preprocessing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_g2simple_packing.h" - -class grib_accessor_data_g2simple_packing_with_preprocessing_t : public grib_accessor_data_g2simple_packing_t -{ -public: - /* Members defined in data_g2simple_packing_with_preprocessing */ - const char* pre_processing; - const char* pre_processing_parameter; -}; - -class grib_accessor_class_data_g2simple_packing_with_preprocessing_t : public grib_accessor_class_data_g2simple_packing_t -{ -public: - grib_accessor_class_data_g2simple_packing_with_preprocessing_t(const char* name) : grib_accessor_class_data_g2simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_g2simple_packing_with_preprocessing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_g2simple_packing_with_preprocessing_h */ diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.h.bak b/src/accessor/grib_accessor_class_data_jpeg2000_packing.h.bak deleted file mode 100644 index a04ee58d5..000000000 --- a/src/accessor/grib_accessor_class_data_jpeg2000_packing.h.bak +++ /dev/null @@ -1,46 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_jpeg2000_packing_h -#define eccodes_accessor_data_jpeg2000_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_simple_packing.h" - -class grib_accessor_data_jpeg2000_packing_t : public grib_accessor_data_simple_packing_t -{ -public: - /* Members defined in data_jpeg2000_packing */ - const char* type_of_compression_used; - const char* target_compression_ratio; - const char* ni; - const char* nj; - const char* list_defining_points; - const char* number_of_data_points; - const char* scanning_mode; - int jpeg_lib; - const char* dump_jpg; -}; - -class grib_accessor_class_data_jpeg2000_packing_t : public grib_accessor_class_data_simple_packing_t -{ -public: - grib_accessor_class_data_jpeg2000_packing_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_jpeg2000_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; -}; -#endif /* eccodes_accessor_data_jpeg2000_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_png_packing.h.bak b/src/accessor/grib_accessor_class_data_png_packing.h.bak deleted file mode 100644 index 841ed9d31..000000000 --- a/src/accessor/grib_accessor_class_data_png_packing.h.bak +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (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. - */ - -#pragma once - -#include "grib_accessor_class_values.h" - -class grib_accessor_data_png_packing_t : public grib_accessor_values_t -{ -public: - 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* ni; - const char* nj; - const char* list_defining_points; - const char* number_of_data_points; - const char* scanning_mode; -}; - -class grib_accessor_class_data_png_packing_t : public grib_accessor_class_values_t -{ -public: - grib_accessor_class_data_png_packing_t(const char* name) : grib_accessor_class_values_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_png_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; -}; diff --git a/src/accessor/grib_accessor_class_data_raw_packing.h.bak b/src/accessor/grib_accessor_class_data_raw_packing.h.bak deleted file mode 100644 index 5b1b103e0..000000000 --- a/src/accessor/grib_accessor_class_data_raw_packing.h.bak +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_raw_packing_h -#define eccodes_accessor_data_raw_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_values.h" - -class grib_accessor_data_raw_packing_t : public grib_accessor_values_t -{ -public: - /* Members defined in data_raw_packing */ - const char* number_of_values; - const char* precision; -}; - -class grib_accessor_class_data_raw_packing_t : public grib_accessor_class_values_t -{ -public: - grib_accessor_class_data_raw_packing_t(const char* name) : grib_accessor_class_values_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_raw_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; -}; -#endif /* eccodes_accessor_data_raw_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_run_length_packing.h.bak b/src/accessor/grib_accessor_class_data_run_length_packing.h.bak deleted file mode 100644 index 3125fdcf4..000000000 --- a/src/accessor/grib_accessor_class_data_run_length_packing.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_run_length_packing_h -#define eccodes_accessor_data_run_length_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_values.h" - -class grib_accessor_data_run_length_packing_t : public grib_accessor_values_t -{ -public: - /* 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; -}; - -class grib_accessor_class_data_run_length_packing_t : public grib_accessor_class_values_t -{ -public: - grib_accessor_class_data_run_length_packing_t(const char* name) : grib_accessor_class_values_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_run_length_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_run_length_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_secondary_bitmap.h.bak b/src/accessor/grib_accessor_class_data_secondary_bitmap.h.bak deleted file mode 100644 index 3ac86e324..000000000 --- a/src/accessor/grib_accessor_class_data_secondary_bitmap.h.bak +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_secondary_bitmap_h -#define eccodes_accessor_data_secondary_bitmap_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_data_secondary_bitmap_t : public grib_accessor_gen_t -{ -public: - /* Members defined in data_secondary_bitmap */ - const char* primary_bitmap; - const char* secondary_bitmap; - const char* missing_value; - const char* expand_by; -}; - -class grib_accessor_class_data_secondary_bitmap_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_data_secondary_bitmap_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_secondary_bitmap_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_secondary_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_sh_packed.h.bak b/src/accessor/grib_accessor_class_data_sh_packed.h.bak deleted file mode 100644 index 2d7cbdf47..000000000 --- a/src/accessor/grib_accessor_class_data_sh_packed.h.bak +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_sh_packed_h -#define eccodes_accessor_data_sh_packed_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_simple_packing.h" - -class grib_accessor_data_sh_packed_t : public grib_accessor_data_simple_packing_t -{ -public: - /* Members defined in data_sh_packed */ - 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; -}; - -class grib_accessor_class_data_sh_packed_t : public grib_accessor_class_data_simple_packing_t -{ -public: - grib_accessor_class_data_sh_packed_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_sh_packed_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_sh_packed_h */ diff --git a/src/accessor/grib_accessor_class_data_sh_unpacked.h.bak b/src/accessor/grib_accessor_class_data_sh_unpacked.h.bak deleted file mode 100644 index 4b1e893c0..000000000 --- a/src/accessor/grib_accessor_class_data_sh_unpacked.h.bak +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_sh_unpacked_h -#define eccodes_accessor_data_sh_unpacked_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_data_simple_packing.h" - -class grib_accessor_data_sh_unpacked_t : public grib_accessor_data_simple_packing_t -{ -public: - /* Members defined in data_sh_unpacked */ - 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; -}; - -class grib_accessor_class_data_sh_unpacked_t : public grib_accessor_class_data_simple_packing_t -{ -public: - grib_accessor_class_data_sh_unpacked_t(const char* name) : grib_accessor_class_data_simple_packing_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_sh_unpacked_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_sh_unpacked_h */ diff --git a/src/accessor/grib_accessor_class_data_shsimple_packing.h.bak b/src/accessor/grib_accessor_class_data_shsimple_packing.h.bak deleted file mode 100644 index 851907eb9..000000000 --- a/src/accessor/grib_accessor_class_data_shsimple_packing.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_shsimple_packing_h -#define eccodes_accessor_data_shsimple_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_data_shsimple_packing_t : public grib_accessor_gen_t -{ -public: - /* Members defined in data_shsimple_packing */ - const char* coded_values; - const char* real_part; - int dirty; -}; - -class grib_accessor_class_data_shsimple_packing_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_data_shsimple_packing_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_shsimple_packing_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_data_shsimple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_simple_packing.h.bak b/src/accessor/grib_accessor_class_data_simple_packing.h.bak deleted file mode 100644 index 92f355b3f..000000000 --- a/src/accessor/grib_accessor_class_data_simple_packing.h.bak +++ /dev/null @@ -1,195 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_data_simple_packing_h -#define eccodes_accessor_data_simple_packing_h - -#include "grib_accessor_class_values.h" -#include "grib_bits_any_endian_simple.h" -#include "grib_scaling.h" - -class grib_accessor_data_simple_packing_t : public grib_accessor_values_t -{ -public: - /* 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; -}; - -class grib_accessor_class_data_simple_packing_t : public grib_accessor_class_values_t -{ -public: - grib_accessor_class_data_simple_packing_t(const char* name) : grib_accessor_class_values_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_data_simple_packing_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; - int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len) override; - -private: - template int unpack(grib_accessor*, T*, size_t*); -}; - - -template -int grib_accessor_class_data_simple_packing_t::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_t* self = (grib_accessor_data_simple_packing_t*)a; - const char* cclass_name = a->cclass->name; - 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 n_vals = 0; - long pos = 0; - long count = 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; - - err = a->value_count(&count); if (err) - return err; - n_vals = count; - - 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) { - for (i = 0; i < n_vals; i++) - val[i] = reference_value; - *len = n_vals; - return GRIB_SUCCESS; - } - - s = codes_power(binary_scale_factor, 2); - d = codes_power(-decimal_scale_factor, 10); - - grib_context_log(a->context, GRIB_LOG_DEBUG, - "%s %s: Creating %s, %zu values", cclass_name, __func__, a->name, n_vals); - - offsetBeforeData = a->byte_offset(); 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, - "%s: Data section size mismatch: " - "offset before data=%ld, offset after data=%ld (num values=%zu, bits per value=%ld)", - cclass_name, offsetBeforeData, offsetAfterData, n_vals, bits_per_value); - return GRIB_DECODING_ERROR; - } - } - // 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; - // } - } - - grib_context_log(a->context, GRIB_LOG_DEBUG, - "%s %s: calling outline function: bpv: %ld, rv: %g, bsf: %ld, dsf: %ld", - cclass_name, __func__, bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); - grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, val); - - *len = (long)n_vals; - - if (units_factor != 1.0) { - if (units_bias != 0.0) { - for (i = 0; i < n_vals; i++) { - val[i] = val[i] * units_factor + units_bias; - } - } else { - for (i = 0; i < n_vals; i++) { - val[i] *= units_factor; - } - } - } - else if (units_bias != 0.0) { - for (i = 0; i < n_vals; i++) { - val[i] += units_bias; - } - } - return err; -} - - -#endif /* eccodes_accessor_data_simple_packing_h */ diff --git a/src/accessor/grib_accessor_class_decimal_precision.h.bak b/src/accessor/grib_accessor_class_decimal_precision.h.bak deleted file mode 100644 index 455d77946..000000000 --- a/src/accessor/grib_accessor_class_decimal_precision.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_decimal_precision_h -#define eccodes_accessor_decimal_precision_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_decimal_precision_t : public grib_accessor_long_t -{ -public: - /* Members defined in decimal_precision */ - const char* values; - const char* bits_per_value; - const char* changing_precision; - const char* decimal_scale_factor; -}; - -class grib_accessor_class_decimal_precision_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_decimal_precision_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_decimal_precision_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_decimal_precision_h */ diff --git a/src/accessor/grib_accessor_class_dictionary.h.bak b/src/accessor/grib_accessor_class_dictionary.h.bak deleted file mode 100644 index 7f86a44ae..000000000 --- a/src/accessor/grib_accessor_class_dictionary.h.bak +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_dictionary_h -#define eccodes_accessor_dictionary_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_dictionary_t : public grib_accessor_gen_t -{ -public: - /* Members defined in dictionary */ - const char* dictionary; - const char* key; - long column; - const char* masterDir; - const char* localDir; -}; - -class grib_accessor_class_dictionary_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_dictionary_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_dictionary_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_dictionary_h */ diff --git a/src/accessor/grib_accessor_class_dirty.h.bak b/src/accessor/grib_accessor_class_dirty.h.bak deleted file mode 100644 index 7a008ce29..000000000 --- a/src/accessor/grib_accessor_class_dirty.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_dirty_h -#define eccodes_accessor_dirty_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_dirty_t : public grib_accessor_long_t -{ -public: - /* Members defined in dirty */ - const char* accessor; -}; - -class grib_accessor_class_dirty_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_dirty_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_dirty_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_dirty_h */ diff --git a/src/accessor/grib_accessor_class_divdouble.h.bak b/src/accessor/grib_accessor_class_divdouble.h.bak deleted file mode 100644 index e10239676..000000000 --- a/src/accessor/grib_accessor_class_divdouble.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_divdouble_h -#define eccodes_accessor_divdouble_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_divdouble_t : public grib_accessor_double_t -{ -public: - /* Members defined in divdouble */ - const char* val; - double divisor; -}; - -class grib_accessor_class_divdouble_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_divdouble_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_divdouble_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_divdouble_h */ diff --git a/src/accessor/grib_accessor_class_double.h.bak b/src/accessor/grib_accessor_class_double.h.bak deleted file mode 100644 index 1c1e2fb4f..000000000 --- a/src/accessor/grib_accessor_class_double.h.bak +++ /dev/null @@ -1,30 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_double_h -#define eccodes_accessor_double_h - -#include "grib_accessor_class_gen.h" - -class grib_accessor_double_t : public grib_accessor_gen_t {}; - -class grib_accessor_class_double_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_double_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_double_t{}; } - int get_native_type(grib_accessor*) override; - int pack_missing(grib_accessor*) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_double_h */ diff --git a/src/accessor/grib_accessor_class_element.h.bak b/src/accessor/grib_accessor_class_element.h.bak deleted file mode 100644 index f22109be2..000000000 --- a/src/accessor/grib_accessor_class_element.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_element_h -#define eccodes_accessor_element_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_element_t : public grib_accessor_long_t -{ -public: - /* Members defined in element */ - const char* array; - long element; -}; - -class grib_accessor_class_element_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_element_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_element_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_element_h */ diff --git a/src/accessor/grib_accessor_class_evaluate.h.bak b/src/accessor/grib_accessor_class_evaluate.h.bak deleted file mode 100644 index e65c6473b..000000000 --- a/src/accessor/grib_accessor_class_evaluate.h.bak +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_evaluate_h -#define eccodes_accessor_evaluate_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_evaluate_t : public grib_accessor_long_t -{ -public: - /* Members defined in evaluate */ - grib_arguments* arg; -}; - -class grib_accessor_class_evaluate_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_evaluate_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_evaluate_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_evaluate_h */ diff --git a/src/accessor/grib_accessor_class_expanded_descriptors.h.bak b/src/accessor/grib_accessor_class_expanded_descriptors.h.bak deleted file mode 100644 index be2094d4f..000000000 --- a/src/accessor/grib_accessor_class_expanded_descriptors.h.bak +++ /dev/null @@ -1,47 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_expanded_descriptors_h -#define eccodes_accessor_expanded_descriptors_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_expanded_descriptors_t : public grib_accessor_long_t -{ -public: - /* Members defined in expanded_descriptors */ - const char* unexpandedDescriptors; - const char* sequence; - const char* expandedName; - const char* tablesAccessorName; - bufr_descriptors_array* expanded; - int rank; - grib_accessor* expandedAccessor; - int do_expand; - grib_accessor* tablesAccessor; -}; - -class grib_accessor_class_expanded_descriptors_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_expanded_descriptors_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_expanded_descriptors_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string_array(grib_accessor*, char**, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_expanded_descriptors_h */ diff --git a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h.bak b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h.bak deleted file mode 100644 index 1874c559f..000000000 --- a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_from_scale_factor_scaled_value_h -#define eccodes_accessor_from_scale_factor_scaled_value_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_from_scale_factor_scaled_value_t : public grib_accessor_double_t -{ -public: - /* Members defined in from_scale_factor_scaled_value */ - const char* scaleFactor; - const char* scaledValue; -}; - -class grib_accessor_class_from_scale_factor_scaled_value_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_from_scale_factor_scaled_value_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_from_scale_factor_scaled_value_t{}; } - int is_missing(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_from_scale_factor_scaled_value_h */ diff --git a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h.bak b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h.bak deleted file mode 100644 index 9c5890aa3..000000000 --- a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1_half_byte_codeflag_h -#define eccodes_accessor_g1_half_byte_codeflag_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_g1_half_byte_codeflag_t : public grib_accessor_gen_t -{ -public: - /* Members defined in g1_half_byte_codeflag */ -}; - -class grib_accessor_class_g1_half_byte_codeflag_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_g1_half_byte_codeflag_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1_half_byte_codeflag_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1_half_byte_codeflag_h */ diff --git a/src/accessor/grib_accessor_class_g1_message_length.h.bak b/src/accessor/grib_accessor_class_g1_message_length.h.bak deleted file mode 100644 index c3b865ec0..000000000 --- a/src/accessor/grib_accessor_class_g1_message_length.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1_message_length_h -#define eccodes_accessor_g1_message_length_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_section_length.h" - -class grib_accessor_g1_message_length_t : public grib_accessor_section_length_t -{ -public: - /* Members defined in g1_message_length */ - const char *sec4_length; -}; - -class grib_accessor_class_g1_message_length_t : public grib_accessor_class_section_length_t -{ -public: - grib_accessor_class_g1_message_length_t(const char* name) : grib_accessor_class_section_length_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1_message_length_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1_message_length_h */ diff --git a/src/accessor/grib_accessor_class_g1_section4_length.h.bak b/src/accessor/grib_accessor_class_g1_section4_length.h.bak deleted file mode 100644 index 0a1b0c768..000000000 --- a/src/accessor/grib_accessor_class_g1_section4_length.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1_section4_length_h -#define eccodes_accessor_g1_section4_length_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_section_length.h" - -class grib_accessor_g1_section4_length_t : public grib_accessor_section_length_t -{ -public: - /* Members defined in g1_section4_length */ - const char* total_length; -}; - -class grib_accessor_class_g1_section4_length_t : public grib_accessor_class_section_length_t -{ -public: - grib_accessor_class_g1_section4_length_t(const char* name) : grib_accessor_class_section_length_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1_section4_length_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1_section4_length_h */ diff --git a/src/accessor/grib_accessor_class_g1bitmap.h.bak b/src/accessor/grib_accessor_class_g1bitmap.h.bak deleted file mode 100644 index b34344d1f..000000000 --- a/src/accessor/grib_accessor_class_g1bitmap.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1bitmap_h -#define eccodes_accessor_g1bitmap_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_bitmap.h" - -class grib_accessor_g1bitmap_t : public grib_accessor_bitmap_t -{ -public: - /* Members defined in g1bitmap */ - const char* unusedBits; -}; - -class grib_accessor_class_g1bitmap_t : public grib_accessor_class_bitmap_t -{ -public: - grib_accessor_class_g1bitmap_t(const char* name) : grib_accessor_class_bitmap_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1bitmap_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1bitmap_h */ diff --git a/src/accessor/grib_accessor_class_g1date.h.bak b/src/accessor/grib_accessor_class_g1date.h.bak deleted file mode 100644 index 27e71189f..000000000 --- a/src/accessor/grib_accessor_class_g1date.h.bak +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1date_h -#define eccodes_accessor_g1date_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_g1date_t : public grib_accessor_long_t -{ -public: - /* Members defined in g1date */ - const char* century; - const char* year; - const char* month; - const char* day; -}; - -class grib_accessor_class_g1date_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_g1date_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1date_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1date_h */ diff --git a/src/accessor/grib_accessor_class_g1day_of_the_year_date.h.bak b/src/accessor/grib_accessor_class_g1day_of_the_year_date.h.bak deleted file mode 100644 index 1563cdb9d..000000000 --- a/src/accessor/grib_accessor_class_g1day_of_the_year_date.h.bak +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1day_of_the_year_date_h -#define eccodes_accessor_g1day_of_the_year_date_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_g1date.h" - -class grib_accessor_g1day_of_the_year_date_t : public grib_accessor_g1date_t -{ -public: - /* Members defined in g1day_of_the_year_date */ -}; - -class grib_accessor_class_g1day_of_the_year_date_t : public grib_accessor_class_g1date_t -{ -public: - grib_accessor_class_g1day_of_the_year_date_t(const char* name) : grib_accessor_class_g1date_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1day_of_the_year_date_t{}; } - int unpack_string(grib_accessor*, char*, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1day_of_the_year_date_h */ diff --git a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h.bak b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h.bak deleted file mode 100644 index a1e29a76c..000000000 --- a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1end_of_interval_monthly_h -#define eccodes_accessor_g1end_of_interval_monthly_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_abstract_vector.h" - -class grib_accessor_g1end_of_interval_monthly_t : public grib_accessor_abstract_vector_t -{ -public: - /* Members defined in g1end_of_interval_monthly */ - const char* verifyingMonth; -}; - -class grib_accessor_class_g1end_of_interval_monthly_t : public grib_accessor_class_abstract_vector_t -{ -public: - grib_accessor_class_g1end_of_interval_monthly_t(const char* name) : grib_accessor_class_abstract_vector_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1end_of_interval_monthly_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_g1end_of_interval_monthly_h */ diff --git a/src/accessor/grib_accessor_class_g1fcperiod.h.bak b/src/accessor/grib_accessor_class_g1fcperiod.h.bak deleted file mode 100644 index 3c0ff2c49..000000000 --- a/src/accessor/grib_accessor_class_g1fcperiod.h.bak +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1fcperiod_h -#define eccodes_accessor_g1fcperiod_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_g1step_range.h" - -class grib_accessor_g1fcperiod_t : public grib_accessor_g1step_range_t -{ -public: - /* Members defined in g1fcperiod */ -}; - -class grib_accessor_class_g1fcperiod_t : public grib_accessor_class_g1step_range_t -{ -public: - grib_accessor_class_g1fcperiod_t(const char* name) : grib_accessor_class_g1step_range_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1fcperiod_t{}; } - int unpack_string(grib_accessor*, char*, size_t* len) override; -}; -#endif /* eccodes_accessor_g1fcperiod_h */ diff --git a/src/accessor/grib_accessor_class_g1forecastmonth.h.bak b/src/accessor/grib_accessor_class_g1forecastmonth.h.bak deleted file mode 100644 index 6d2b9ee63..000000000 --- a/src/accessor/grib_accessor_class_g1forecastmonth.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1forecastmonth_h -#define eccodes_accessor_g1forecastmonth_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_g1forecastmonth_t : public grib_accessor_long_t -{ -public: - /* Members defined in g1forecastmonth */ - const char* verification_yearmonth; - const char* base_date; - const char* day; - const char* hour; - const char* fcmonth; - const char* check; -}; - -class grib_accessor_class_g1forecastmonth_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_g1forecastmonth_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1forecastmonth_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1forecastmonth_h */ diff --git a/src/accessor/grib_accessor_class_g1monthlydate.h.bak b/src/accessor/grib_accessor_class_g1monthlydate.h.bak deleted file mode 100644 index 8efa9cf16..000000000 --- a/src/accessor/grib_accessor_class_g1monthlydate.h.bak +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1monthlydate_h -#define eccodes_accessor_g1monthlydate_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_g1monthlydate_t : public grib_accessor_long_t -{ -public: - /* Members defined in g1monthlydate */ - const char* date; -}; - -class grib_accessor_class_g1monthlydate_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_g1monthlydate_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1monthlydate_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1monthlydate_h */ diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h.bak b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h.bak deleted file mode 100644 index 764bfa04d..000000000 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1number_of_coded_values_sh_complex_h -#define eccodes_accessor_g1number_of_coded_values_sh_complex_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_g1number_of_coded_values_sh_complex_t : public grib_accessor_long_t -{ -public: - /* Members defined in g1number_of_coded_values_sh_complex */ - const char* numberOfValues; - const char* bitsPerValue; - const char* offsetBeforeData; - const char* offsetAfterData; - const char* unusedBits; - const char* JS; - const char* KS; - const char* MS; -}; - -class grib_accessor_class_g1number_of_coded_values_sh_complex_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_g1number_of_coded_values_sh_complex_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1number_of_coded_values_sh_complex_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1number_of_coded_values_sh_complex_h */ diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h.bak b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h.bak deleted file mode 100644 index fb5ab298d..000000000 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1number_of_coded_values_sh_simple_h -#define eccodes_accessor_g1number_of_coded_values_sh_simple_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_g1number_of_coded_values_sh_simple_t : public grib_accessor_long_t -{ -public: - /* Members defined in g1number_of_coded_values_sh_simple */ - const char* numberOfValues; - const char* bitsPerValue; - const char* offsetBeforeData; - const char* offsetAfterData; - const char* unusedBits; -}; - -class grib_accessor_class_g1number_of_coded_values_sh_simple_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_g1number_of_coded_values_sh_simple_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1number_of_coded_values_sh_simple_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1number_of_coded_values_sh_simple_h */ diff --git a/src/accessor/grib_accessor_class_g1step_range.h.bak b/src/accessor/grib_accessor_class_g1step_range.h.bak deleted file mode 100644 index c9c3dd911..000000000 --- a/src/accessor/grib_accessor_class_g1step_range.h.bak +++ /dev/null @@ -1,48 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1step_range_h -#define eccodes_accessor_g1step_range_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_abstract_long_vector.h" - -class grib_accessor_g1step_range_t : public grib_accessor_abstract_long_vector_t -{ -public: - /* Members defined in g1step_range */ - const char* p1; - const char* p2; - const char* timeRangeIndicator; - const char *unit; - const char *step_unit; - const char *stepType; - const char *patch_fp_precip; - int error_on_units; -}; - -class grib_accessor_class_g1step_range_t : public grib_accessor_class_abstract_long_vector_t -{ -public: - grib_accessor_class_g1step_range_t(const char* name) : grib_accessor_class_abstract_long_vector_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1step_range_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1step_range_h */ diff --git a/src/accessor/grib_accessor_class_g1verificationdate.h.bak b/src/accessor/grib_accessor_class_g1verificationdate.h.bak deleted file mode 100644 index 198801aba..000000000 --- a/src/accessor/grib_accessor_class_g1verificationdate.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g1verificationdate_h -#define eccodes_accessor_g1verificationdate_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_g1verificationdate_t : public grib_accessor_long_t -{ -public: - /* Members defined in g1verificationdate */ - const char* date; - const char* time; - const char* step; -}; - -class grib_accessor_class_g1verificationdate_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_g1verificationdate_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g1verificationdate_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g1verificationdate_h */ diff --git a/src/accessor/grib_accessor_class_g2_aerosol.h.bak b/src/accessor/grib_accessor_class_g2_aerosol.h.bak deleted file mode 100644 index fb29a9561..000000000 --- a/src/accessor/grib_accessor_class_g2_aerosol.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2_aerosol_h -#define eccodes_accessor_g2_aerosol_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_unsigned.h" - -class grib_accessor_g2_aerosol_t : public grib_accessor_unsigned_t -{ -public: - /* Members defined in g2_aerosol */ - const char* productDefinitionTemplateNumber; - const char* stepType; - int optical; -}; - -class grib_accessor_class_g2_aerosol_t : public grib_accessor_class_unsigned_t -{ -public: - grib_accessor_class_g2_aerosol_t(const char* name) : grib_accessor_class_unsigned_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_aerosol_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2_aerosol_h */ diff --git a/src/accessor/grib_accessor_class_g2_chemical.h.bak b/src/accessor/grib_accessor_class_g2_chemical.h.bak deleted file mode 100644 index 9cfe4f8bc..000000000 --- a/src/accessor/grib_accessor_class_g2_chemical.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2_chemical_h -#define eccodes_accessor_g2_chemical_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_unsigned.h" - -class grib_accessor_g2_chemical_t : public grib_accessor_unsigned_t -{ -public: - /* Members defined in g2_chemical */ - const char* productDefinitionTemplateNumber; - const char* stepType; - int chemical_type; -}; - -class grib_accessor_class_g2_chemical_t : public grib_accessor_class_unsigned_t -{ -public: - grib_accessor_class_g2_chemical_t(const char* name) : grib_accessor_class_unsigned_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_chemical_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2_chemical_h */ diff --git a/src/accessor/grib_accessor_class_g2_eps.h.bak b/src/accessor/grib_accessor_class_g2_eps.h.bak deleted file mode 100644 index 7c39dd580..000000000 --- a/src/accessor/grib_accessor_class_g2_eps.h.bak +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2_eps_h -#define eccodes_accessor_g2_eps_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_unsigned.h" - -class grib_accessor_g2_eps_t : public grib_accessor_unsigned_t -{ -public: - /* Members defined in g2_eps */ - const char* productDefinitionTemplateNumber; - const char* stream; - const char* type; - const char* stepType; - const char* derivedForecast; -}; - -class grib_accessor_class_g2_eps_t : public grib_accessor_class_unsigned_t -{ -public: - grib_accessor_class_g2_eps_t(const char* name) : grib_accessor_class_unsigned_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_eps_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2_eps_h */ diff --git a/src/accessor/grib_accessor_class_g2_mars_labeling.h.bak b/src/accessor/grib_accessor_class_g2_mars_labeling.h.bak deleted file mode 100644 index 0a678174f..000000000 --- a/src/accessor/grib_accessor_class_g2_mars_labeling.h.bak +++ /dev/null @@ -1,47 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2_mars_labeling_h -#define eccodes_accessor_g2_mars_labeling_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_g2_mars_labeling_t : public grib_accessor_gen_t -{ -public: - /* Members defined in g2_mars_labeling */ - int index; - const char* the_class; - const char* stream; - const char* type; - const char* expver; - const char* typeOfProcessedData; - const char* productDefinitionTemplateNumber; - const char* stepType; - const char* derivedForecast; - const char* typeOfGeneratingProcess; -}; - -class grib_accessor_class_g2_mars_labeling_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_g2_mars_labeling_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2_mars_labeling_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2_mars_labeling_h */ diff --git a/src/accessor/grib_accessor_class_g2bitmap.h.bak b/src/accessor/grib_accessor_class_g2bitmap.h.bak deleted file mode 100644 index 9af7a3b27..000000000 --- a/src/accessor/grib_accessor_class_g2bitmap.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2bitmap_h -#define eccodes_accessor_g2bitmap_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_bitmap.h" - -class grib_accessor_g2bitmap_t : public grib_accessor_bitmap_t -{ -public: - /* Members defined in g2bitmap */ - const char* numberOfValues; -}; - -class grib_accessor_class_g2bitmap_t : public grib_accessor_class_bitmap_t -{ -public: - grib_accessor_class_g2bitmap_t(const char* name) : grib_accessor_class_bitmap_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2bitmap_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2bitmap_h */ diff --git a/src/accessor/grib_accessor_class_g2bitmap_present.h.bak b/src/accessor/grib_accessor_class_g2bitmap_present.h.bak deleted file mode 100644 index 7b5cd3f66..000000000 --- a/src/accessor/grib_accessor_class_g2bitmap_present.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2bitmap_present_h -#define eccodes_accessor_g2bitmap_present_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_g2bitmap_present_t : public grib_accessor_long_t -{ -public: - /* Members defined in g2bitmap_present */ - const char* bitmapIndicator; -}; - -class grib_accessor_class_g2bitmap_present_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_g2bitmap_present_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2bitmap_present_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2bitmap_present_h */ diff --git a/src/accessor/grib_accessor_class_g2date.h.bak b/src/accessor/grib_accessor_class_g2date.h.bak deleted file mode 100644 index 20276c6fe..000000000 --- a/src/accessor/grib_accessor_class_g2date.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2date_h -#define eccodes_accessor_g2date_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_g2date_t : public grib_accessor_long_t -{ -public: - /* Members defined in g2date */ - const char* century; - const char* year; - const char* month; - const char* day; -}; - -class grib_accessor_class_g2date_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_g2date_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2date_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2date_h */ diff --git a/src/accessor/grib_accessor_class_g2end_step.h.bak b/src/accessor/grib_accessor_class_g2end_step.h.bak deleted file mode 100644 index 7a2d8ab21..000000000 --- a/src/accessor/grib_accessor_class_g2end_step.h.bak +++ /dev/null @@ -1,56 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2end_step_h -#define eccodes_accessor_g2end_step_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_g2end_step_t : public grib_accessor_long_t -{ -public: - /* Members defined in g2end_step */ - const char* start_step_value; - const char* step_units; - const char* year; - const char* month; - const char* day; - const char* hour; - const char* minute; - const char* second; - const char* year_of_end_of_interval; - const char* month_of_end_of_interval; - const char* day_of_end_of_interval; - const char* hour_of_end_of_interval; - const char* minute_of_end_of_interval; - const char* second_of_end_of_interval; - const char* time_range_unit; - const char* time_range_value; - const char* typeOfTimeIncrement; - const char* numberOfTimeRange; -}; - -class grib_accessor_class_g2end_step_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_g2end_step_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2end_step_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2end_step_h */ diff --git a/src/accessor/grib_accessor_class_g2grid.h.bak b/src/accessor/grib_accessor_class_g2grid.h.bak deleted file mode 100644 index 0cd177ce5..000000000 --- a/src/accessor/grib_accessor_class_g2grid.h.bak +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2grid_h -#define eccodes_accessor_g2grid_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_g2grid_t : public grib_accessor_double_t -{ -public: - /* Members defined in g2grid */ - const char* latitude_first; - const char* longitude_first; - const char* latitude_last; - const char* longitude_last; - const char* i_increment; - const char* j_increment; - const char* basic_angle; - const char* sub_division; -}; - -class grib_accessor_class_g2grid_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_g2grid_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2grid_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2grid_h */ diff --git a/src/accessor/grib_accessor_class_g2latlon.h.bak b/src/accessor/grib_accessor_class_g2latlon.h.bak deleted file mode 100644 index f16e2623e..000000000 --- a/src/accessor/grib_accessor_class_g2latlon.h.bak +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2latlon_h -#define eccodes_accessor_g2latlon_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_g2latlon_t : public grib_accessor_double_t -{ -public: - /* Members defined in g2latlon */ - const char* grid; - int index; - const char* given; -}; - -class grib_accessor_class_g2latlon_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_g2latlon_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2latlon_t{}; } - int pack_missing(grib_accessor*) override; - int is_missing(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2latlon_h */ diff --git a/src/accessor/grib_accessor_class_g2level.h.bak b/src/accessor/grib_accessor_class_g2level.h.bak deleted file mode 100644 index 567b8c1b4..000000000 --- a/src/accessor/grib_accessor_class_g2level.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2level_h -#define eccodes_accessor_g2level_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_g2level_t : public grib_accessor_long_t -{ -public: - /* Members defined in g2level */ - const char* type_first; - const char* scale_first; - const char* value_first; - const char* pressure_units; -}; - -class grib_accessor_class_g2level_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_g2level_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2level_t{}; } - int is_missing(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2level_h */ diff --git a/src/accessor/grib_accessor_class_g2lon.h.bak b/src/accessor/grib_accessor_class_g2lon.h.bak deleted file mode 100644 index d17a68c14..000000000 --- a/src/accessor/grib_accessor_class_g2lon.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2lon_h -#define eccodes_accessor_g2lon_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_g2lon_t : public grib_accessor_double_t -{ -public: - /* Members defined in g2lon */ - const char* longitude; -}; - -class grib_accessor_class_g2lon_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_g2lon_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2lon_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2lon_h */ diff --git a/src/accessor/grib_accessor_class_g2step_range.cc b/src/accessor/grib_accessor_class_g2step_range.cc index 28019a783..0c1b49e21 100644 --- a/src/accessor/grib_accessor_class_g2step_range.cc +++ b/src/accessor/grib_accessor_class_g2step_range.cc @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,20 +8,18 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2step_range.h" #include "step.h" #include "step_utilities.h" -#include -#include #include -grib_accessor_class_g2step_range_t _grib_accessor_class_g2step_range{"g2step_range"}; +grib_accessor_class_g2step_range_t _grib_accessor_class_g2step_range{ "g2step_range" }; grib_accessor_class* grib_accessor_class_g2step_range = &_grib_accessor_class_g2step_range; -void grib_accessor_class_g2step_range_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_g2step_range_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_gen_t::init(a, l, c); grib_accessor_g2step_range_t* self = (grib_accessor_g2step_range_t*)a; @@ -34,39 +31,40 @@ void grib_accessor_class_g2step_range_t::init(grib_accessor* a, const long l, gr a->length = 0; } -//static void dump(grib_accessor* a, grib_dumper* dumper) +// static void dump(grib_accessor* a, grib_dumper* dumper) //{ - //grib_dump_string(dumper, a, NULL); +// grib_dump_string(dumper, a, NULL); //} -int grib_accessor_class_g2step_range_t::unpack_string(grib_accessor* a, char* val, size_t* len){ +int grib_accessor_class_g2step_range_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ grib_accessor_g2step_range_t* self = (grib_accessor_g2step_range_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; - size_t size = 0; - double start_step_value = 0; - double end_step_value = 0; + grib_handle* h = grib_handle_of_accessor(a); + int ret = 0; + size_t size = 0; + double start_step_value = 0; + double end_step_value = 0; long step_units; int show_hours = a->context->grib_hourly_steps_with_units; if ((ret = grib_get_double_internal(h, self->start_step, &start_step_value)) != GRIB_SUCCESS) return ret; - if ((ret= grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) return ret; try { - if (eccodes::Unit{step_units} == eccodes::Unit{eccodes::Unit::Value::MISSING}) { + if (eccodes::Unit{ step_units } == eccodes::Unit{ eccodes::Unit::Value::MISSING }) { if ((ret = grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) return ret; } - char fp_format[128] = "%g"; + char fp_format[128] = "%g"; size_t fp_format_len = sizeof(fp_format); if ((ret = grib_get_string_internal(h, "formatForDoubles", fp_format, &fp_format_len)) != GRIB_SUCCESS) return ret; std::stringstream ss; - eccodes::Step start_step{start_step_value, step_units}; + eccodes::Step start_step{ start_step_value, step_units }; if (self->end_step == NULL) { ss << start_step.value(fp_format, show_hours); } @@ -74,7 +72,7 @@ int grib_accessor_class_g2step_range_t::unpack_string(grib_accessor* a, char* va if ((ret = grib_get_double_internal(h, self->end_step, &end_step_value)) != GRIB_SUCCESS) return ret; - eccodes::Step end_step{end_step_value, step_units}; + eccodes::Step end_step{ end_step_value, step_units }; if (start_step_value == end_step_value) { ss << end_step.value(fp_format, show_hours); @@ -101,15 +99,15 @@ int grib_accessor_class_g2step_range_t::unpack_string(grib_accessor* a, char* va return GRIB_SUCCESS; } - // Step range format: [-] // and can be in different units // stepRange="X" in instantaneous field is equivalent to set step=X // stepRange="X" in accumulated field is equivalent to startStep=X, endStep=startStep -int grib_accessor_class_g2step_range_t::pack_string(grib_accessor* a, const char* val, size_t* len){ +int grib_accessor_class_g2step_range_t::pack_string(grib_accessor* a, const char* val, size_t* len) +{ grib_accessor_g2step_range_t* self = (grib_accessor_g2step_range_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; + grib_handle* h = grib_handle_of_accessor(a); + int ret = 0; long force_step_units; if ((ret = grib_get_long_internal(h, "forceStepUnits", &force_step_units)) != GRIB_SUCCESS) @@ -121,12 +119,12 @@ int grib_accessor_class_g2step_range_t::pack_string(grib_accessor* a, const char // If this key is defined (!= 255), it indicates that the stepUnits have been defined by the user. // Once this key is set, it has the highest priority: it automatically overrides certain units and the default value in stepUnits - if (h->loader) { // h->loader is set only when rebuilding or reparsing - force_step_units = 255; // See ECC-1768 and ECC-1800 + if (h->loader) { // h->loader is set only when rebuilding or reparsing + force_step_units = 255; // See ECC-1768 and ECC-1800 } try { - std::vector steps = parse_range(val, eccodes::Unit{force_step_units}); + std::vector steps = parse_range(val, eccodes::Unit{ force_step_units }); if (steps.size() == 0) { grib_context_log(a->context, GRIB_LOG_ERROR, "Could not parse step range: %s", val); return GRIB_INVALID_ARGUMENT; @@ -134,22 +132,22 @@ int grib_accessor_class_g2step_range_t::pack_string(grib_accessor* a, const char eccodes::Step step_0; eccodes::Step step_1; - if (eccodes::Unit{force_step_units} == eccodes::Unit{eccodes::Unit::Value::MISSING}) { + if (eccodes::Unit{ force_step_units } == eccodes::Unit{ eccodes::Unit::Value::MISSING }) { if (steps.size() > 1) std::tie(step_0, step_1) = find_common_units(steps[0].optimize_unit(), steps[1].optimize_unit()); else step_0 = steps[0].optimize_unit(); } else { - step_0 = eccodes::Step{steps[0].value(eccodes::Unit{force_step_units}), eccodes::Unit{force_step_units}}; + step_0 = eccodes::Step{ steps[0].value(eccodes::Unit{ force_step_units }), eccodes::Unit{ force_step_units } }; if (steps.size() > 1) { - step_1 = eccodes::Step{steps[1].value(eccodes::Unit{force_step_units}), eccodes::Unit{force_step_units}}; + step_1 = eccodes::Step{ steps[1].value(eccodes::Unit{ force_step_units }), eccodes::Unit{ force_step_units } }; } } if ((ret = grib_set_long_internal(h, "startStepUnit", step_0.unit().value()))) return ret; - if ((ret = set_step(h, "forecastTime" , "indicatorOfUnitOfTimeRange", step_0)) != GRIB_SUCCESS) + if ((ret = set_step(h, "forecastTime", "indicatorOfUnitOfTimeRange", step_0)) != GRIB_SUCCESS) return ret; if (self->end_step != NULL) { @@ -158,7 +156,8 @@ int grib_accessor_class_g2step_range_t::pack_string(grib_accessor* a, const char return ret; if ((ret = grib_set_long_internal(h, self->end_step, step_1.value()))) return ret; - } else { + } + else { if ((ret = grib_set_long_internal(h, "endStepUnit", step_0.unit().value()))) return ret; if ((ret = grib_set_long_internal(h, self->end_step, step_0.value()))) @@ -173,16 +172,19 @@ int grib_accessor_class_g2step_range_t::pack_string(grib_accessor* a, const char return GRIB_SUCCESS; } -int grib_accessor_class_g2step_range_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_g2step_range_t::value_count(grib_accessor* a, long* count) +{ *count = 1; return 0; } -size_t grib_accessor_class_g2step_range_t::string_length(grib_accessor* a){ +size_t grib_accessor_class_g2step_range_t::string_length(grib_accessor* a) +{ return 255; } -int grib_accessor_class_g2step_range_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_g2step_range_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ char buff[100]; size_t bufflen = 100; @@ -190,33 +192,33 @@ int grib_accessor_class_g2step_range_t::pack_long(grib_accessor* a, const long* return pack_string(a, buff, &bufflen); } - -int grib_accessor_class_g2step_range_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_g2step_range_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_g2step_range_t* self = (grib_accessor_g2step_range_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; - long end_start_value = 0; - long end_step_value = 0; - long step_units = 0; + grib_handle* h = grib_handle_of_accessor(a); + int ret = 0; + long end_start_value = 0; + long end_step_value = 0; + long step_units = 0; if ((ret = grib_get_long_internal(h, self->start_step, &end_start_value)) != GRIB_SUCCESS) return ret; try { if ((ret = grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) throw std::runtime_error("Failed to get stepUnits"); - if (eccodes::Unit{step_units} == eccodes::Unit{eccodes::Unit::Value::MISSING}) { + if (eccodes::Unit{ step_units } == eccodes::Unit{ eccodes::Unit::Value::MISSING }) { if ((ret = grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) return ret; } - eccodes::Step start_step{end_start_value, step_units}; + eccodes::Step start_step{ end_start_value, step_units }; if (self->end_step == NULL) { *val = start_step.value(); } else { if ((ret = grib_get_long_internal(h, self->end_step, &end_step_value)) != GRIB_SUCCESS) return ret; - eccodes::Step end_step{end_step_value, step_units}; + eccodes::Step end_step{ end_step_value, step_units }; *val = end_step.value(); } } @@ -228,14 +230,14 @@ int grib_accessor_class_g2step_range_t::unpack_long(grib_accessor* a, long* val, return GRIB_SUCCESS; } - -int grib_accessor_class_g2step_range_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_g2step_range_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_g2step_range_t* self = (grib_accessor_g2step_range_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; - double end_start_value = 0; - double end_step_value = 0; - long step_units = 0; + grib_handle* h = grib_handle_of_accessor(a); + int ret = 0; + double end_start_value = 0; + double end_step_value = 0; + long step_units = 0; if ((ret = grib_get_double_internal(h, self->start_step, &end_start_value)) != GRIB_SUCCESS) return ret; @@ -243,19 +245,19 @@ int grib_accessor_class_g2step_range_t::unpack_double(grib_accessor* a, double* throw std::runtime_error("Failed to get stepUnits"); try { - if (eccodes::Unit{step_units} == eccodes::Unit{eccodes::Unit::Value::MISSING}) { + if (eccodes::Unit{ step_units } == eccodes::Unit{ eccodes::Unit::Value::MISSING }) { if ((ret = grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) return ret; } - eccodes::Step start_step{end_start_value, step_units}; + eccodes::Step start_step{ end_start_value, step_units }; if (self->end_step == NULL) { *val = start_step.value(); } else { if ((ret = grib_get_double_internal(h, self->end_step, &end_step_value)) != GRIB_SUCCESS) return ret; - eccodes::Step end_step{end_step_value, step_units}; + eccodes::Step end_step{ end_step_value, step_units }; *val = end_step.value(); } } @@ -267,7 +269,7 @@ int grib_accessor_class_g2step_range_t::unpack_double(grib_accessor* a, double* return GRIB_SUCCESS; } - -int grib_accessor_class_g2step_range_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_g2step_range_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_STRING; } diff --git a/src/accessor/grib_accessor_class_g2step_range.h b/src/accessor/grib_accessor_class_g2step_range.h index 45b50690c..d15fa5e36 100644 --- a/src/accessor/grib_accessor_class_g2step_range.h +++ b/src/accessor/grib_accessor_class_g2step_range.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -12,7 +11,6 @@ #ifndef eccodes_accessor_g2step_range_h #define eccodes_accessor_g2step_range_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_g2step_range_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_g2step_range.h.bak b/src/accessor/grib_accessor_class_g2step_range.h.bak deleted file mode 100644 index c5a007806..000000000 --- a/src/accessor/grib_accessor_class_g2step_range.h.bak +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_g2step_range_h -#define eccodes_accessor_g2step_range_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_g2step_range_t : public grib_accessor_gen_t -{ -public: - /* Members defined in g2step_range */ - const char* start_step; - const char* end_step; -}; - -class grib_accessor_class_g2step_range_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_g2step_range_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_g2step_range_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_g2step_range_h */ diff --git a/src/accessor/grib_accessor_class_gaussian_grid_name.h.bak b/src/accessor/grib_accessor_class_gaussian_grid_name.h.bak deleted file mode 100644 index 1c12bfacd..000000000 --- a/src/accessor/grib_accessor_class_gaussian_grid_name.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_gaussian_grid_name_h -#define eccodes_accessor_gaussian_grid_name_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_gaussian_grid_name_t : public grib_accessor_gen_t -{ -public: - /* Members defined in gaussian_grid_name */ - const char* N; - const char* Ni; - const char* isOctahedral; -}; - -class grib_accessor_class_gaussian_grid_name_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_gaussian_grid_name_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_gaussian_grid_name_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_gaussian_grid_name_h */ diff --git a/src/accessor/grib_accessor_class_gds_is_present.h.bak b/src/accessor/grib_accessor_class_gds_is_present.h.bak deleted file mode 100644 index fa1c5ca55..000000000 --- a/src/accessor/grib_accessor_class_gds_is_present.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_gds_is_present_h -#define eccodes_accessor_gds_is_present_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_gds_is_present_t : public grib_accessor_long_t -{ -public: - /* Members defined in gds_is_present */ - const char* gds_present; - const char* grid_definition; - const char* bitmap_present; - const char* values; -}; - -class grib_accessor_class_gds_is_present_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_gds_is_present_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_gds_is_present_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_gds_is_present_h */ diff --git a/src/accessor/grib_accessor_class_gds_not_present_bitmap.h.bak b/src/accessor/grib_accessor_class_gds_not_present_bitmap.h.bak deleted file mode 100644 index 68641a8e2..000000000 --- a/src/accessor/grib_accessor_class_gds_not_present_bitmap.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_gds_not_present_bitmap_h -#define eccodes_accessor_gds_not_present_bitmap_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_gds_not_present_bitmap_t : public grib_accessor_gen_t -{ -public: - /* Members defined in gds_not_present_bitmap */ - const char* missing_value; - const char* number_of_values; - const char* number_of_points; - const char* latitude_of_first_point; - const char* ni; -}; - -class grib_accessor_class_gds_not_present_bitmap_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_gds_not_present_bitmap_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_gds_not_present_bitmap_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_gds_not_present_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index f118d45e3..0c522cadd 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -1,11 +1,18 @@ +/* + * (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 "grib_accessor.h" #include "grib_accessor_class_gen.h" #include // ======================== grib_accessor_gen ======================== - - - void grib_accessor_gen_t::dump(grib_dumper* f) { return cclass->dump(this, f); diff --git a/src/accessor/grib_accessor_class_gen.h b/src/accessor/grib_accessor_class_gen.h index 9baf3e2dd..deba6cad2 100644 --- a/src/accessor/grib_accessor_class_gen.h +++ b/src/accessor/grib_accessor_class_gen.h @@ -1,3 +1,13 @@ +/* + * (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. + */ + #pragma once #include "grib_api_internal.h" diff --git a/src/accessor/grib_accessor_class_gen.h.bak b/src/accessor/grib_accessor_class_gen.h.bak deleted file mode 100644 index 2d76361ae..000000000 --- a/src/accessor/grib_accessor_class_gen.h.bak +++ /dev/null @@ -1,158 +0,0 @@ -#pragma once - -#include "../grib_api_internal.h" -#include "grib_accessor.h" -#include - -class grib_accessor_gen_t : public grib_accessor { - void init_accessor(const long, grib_arguments*) override; - void dump(grib_dumper* f) override; - int pack_missing() override; - //int grib_pack_zero(grib_accessor* a) override; - int is_missing_internal() override; - int pack_double(const double* v, size_t* len) override; - int pack_float(const float* v, size_t* len) override; - int pack_expression(grib_expression* e) override; - int pack_string(const char* v, size_t* len) override; - int pack_string_array(const char** v, size_t* len) override; - int pack_long(const long* v, size_t* len) override; - int pack_bytes(const unsigned char* v, size_t* len) override; - int unpack_bytes(unsigned char* v, size_t* len) override; - int unpack_double_subarray(double* v, size_t start, size_t len) override; - int unpack_double(double* v, size_t* len) override; - int unpack_float(float* v, size_t* len) override; - int unpack_double_element(size_t i, double* v) override; - int unpack_float_element(size_t i, float* v) override; - int unpack_double_element_set(const size_t* index_array, size_t len, double* val_array) override; - int unpack_float_element_set(const size_t* index_array, size_t len, float* val_array) override; - int unpack_string(char* v, size_t* len) override; - int unpack_string_array(char** v, size_t* len) override; - int unpack_long(long* v, size_t* len) override; - long get_native_type() override; - long get_next_position_offset() override; - long string_length() override; - long byte_offset() override; - long byte_count() override; - int value_count(long* count) override; - int notify_change(grib_accessor* changed) override; - grib_accessor* clone(grib_section* s, int* err) override; - void update_size(size_t len) override; - int nearest_smaller_value(double val, double* nearest) override; - size_t preferred_size(int from_handle) override; - grib_accessor* next_accessor() override; - void resize(size_t new_size) override; - void destroy(grib_context* ct) override; -}; - -class grib_accessor_class_gen_t : public grib_accessor_class -{ -public: - grib_accessor_class_gen_t(const char* name) : grib_accessor_class{name} {} - ~grib_accessor_class_gen_t(); - - grib_accessor* create_empty_accessor() override{ return new grib_accessor_gen_t(); } - grib_section* sub_section(grib_accessor* a) override; - int get_native_type(grib_accessor*) override; - int pack_missing(grib_accessor*) override; - int is_missing(grib_accessor*) override; - int pack_bytes(grib_accessor*, const unsigned char*, size_t* len) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_float(grib_accessor*, const float* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int pack_string_array(grib_accessor*, const char**, size_t* len) override; - int pack_expression(grib_accessor*, grib_expression*) override; - int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int unpack_string_array(grib_accessor*, char**, size_t* len) override; - size_t string_length(grib_accessor*) override; - long byte_count(grib_accessor*) override; - long byte_offset(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void post_init(grib_accessor*) override; - int notify_change(grib_accessor*, grib_accessor*) override; - void update_size(grib_accessor*, size_t) override; - size_t preferred_size(grib_accessor*, int) override; - void resize(grib_accessor*, size_t) override; - int nearest_smaller_value(grib_accessor*, double, double*) override; - grib_accessor* next(grib_accessor*, int) override; - int compare(grib_accessor*, grib_accessor*) override; - int unpack_double_element(grib_accessor*, size_t i, double* val) override; - int unpack_float_element(grib_accessor*, size_t i, float* val) override; - int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; - int unpack_float_element_set(grib_accessor*, const size_t* index_array, size_t len, float* val_array) override; - int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len) override; - int clear(grib_accessor*) override; - grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; - - template - int unpack_helper(grib_accessor* a, T* v, size_t* len); - -private: - enum { - PACK_DOUBLE, - PACK_FLOAT, - PACK_LONG, - PACK_STRING, - UNPACK_DOUBLE, - UNPACK_FLOAT, - UNPACK_LONG, - UNPACK_STRING, - }; - std::bitset<8> is_overridden_ = 0b11111111; -}; - - -template -int grib_accessor_class_gen_t::unpack_helper(grib_accessor* a, T* v, size_t* len) -{ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - int type = GRIB_TYPE_UNDEFINED; - const char* Tname = type_to_string(*v); - - if constexpr (std::is_same_v) { - is_overridden_[UNPACK_FLOAT] = 0; - } - else if constexpr (std::is_same_v) { - is_overridden_[UNPACK_DOUBLE] = 0; - } - - if (is_overridden_[UNPACK_LONG]) { - long val = 0; - size_t l = 1; - a->unpack_long(&val, &l); - if (is_overridden_[UNPACK_LONG]) { - *v = val; - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to %s", a->name, Tname); - return GRIB_SUCCESS; - } - } - - if (is_overridden_[UNPACK_STRING]) { - char val[1024]; - size_t l = sizeof(val); - char* last = NULL; - a->unpack_string(val, &l); - if (is_overridden_[UNPACK_STRING]) { - *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 %s", a->name, Tname); - return GRIB_SUCCESS; - } - } - } - - grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as %s", a->name, Tname); - 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/accessor/grib_accessor_class_getenv.h.bak b/src/accessor/grib_accessor_class_getenv.h.bak deleted file mode 100644 index 5068dad2c..000000000 --- a/src/accessor/grib_accessor_class_getenv.h.bak +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (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. - */ - -#ifndef eccodes_accessor_getenv_h -#define eccodes_accessor_getenv_h - -#include "grib_accessor_class_ascii.h" - -class grib_accessor_getenv_t : public grib_accessor_ascii_t -{ -public: - const char* name; - char* value; - const char* default_value; -}; - -class grib_accessor_class_getenv_t : public grib_accessor_class_ascii_t -{ -public: - grib_accessor_class_getenv_t(const char* name) : grib_accessor_class_ascii_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_getenv_t{}; } - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; - -#endif /* eccodes_accessor_getenv_h */ diff --git a/src/accessor/grib_accessor_class_global_gaussian.h.bak b/src/accessor/grib_accessor_class_global_gaussian.h.bak deleted file mode 100644 index f1e8bf53b..000000000 --- a/src/accessor/grib_accessor_class_global_gaussian.h.bak +++ /dev/null @@ -1,44 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_global_gaussian_h -#define eccodes_accessor_global_gaussian_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_global_gaussian_t : public grib_accessor_long_t -{ -public: - /* Members defined in global_gaussian */ - const char* N; - const char* Ni; - const char* di; - const char* latfirst; - const char* lonfirst; - const char* latlast; - const char* lonlast; - const char* plpresent; - const char* pl; - const char* basic_angle; - const char* subdivision; -}; - -class grib_accessor_class_global_gaussian_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_global_gaussian_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_global_gaussian_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_global_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_group.h.bak b/src/accessor/grib_accessor_class_group.h.bak deleted file mode 100644 index 085b91a8a..000000000 --- a/src/accessor/grib_accessor_class_group.h.bak +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_group_h -#define eccodes_accessor_group_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_group_t : public grib_accessor_gen_t -{ -public: - /* Members defined in group */ - char endCharacter; -}; - -class grib_accessor_class_group_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_group_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_group_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_group_h */ diff --git a/src/accessor/grib_accessor_class_gts_header.h.bak b/src/accessor/grib_accessor_class_gts_header.h.bak deleted file mode 100644 index c164a9df9..000000000 --- a/src/accessor/grib_accessor_class_gts_header.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_gts_header_h -#define eccodes_accessor_gts_header_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_ascii.h" - -class grib_accessor_gts_header_t : public grib_accessor_ascii_t -{ -public: - /* Members defined in gts_header */ - int gts_offset; - int gts_length; -}; - -class grib_accessor_class_gts_header_t : public grib_accessor_class_ascii_t -{ -public: - grib_accessor_class_gts_header_t(const char* name) : grib_accessor_class_ascii_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_gts_header_t{}; } - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_gts_header_h */ diff --git a/src/accessor/grib_accessor_class_hash_array.h.bak b/src/accessor/grib_accessor_class_hash_array.h.bak deleted file mode 100644 index 78856c7e7..000000000 --- a/src/accessor/grib_accessor_class_hash_array.h.bak +++ /dev/null @@ -1,45 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_hash_array_h -#define eccodes_accessor_hash_array_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_hash_array_t : public grib_accessor_gen_t -{ -public: - /* Members defined in hash_array */ - char* key; - grib_hash_array_value* ha; -}; - -class grib_accessor_class_hash_array_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_hash_array_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_hash_array_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_hash_array_h */ diff --git a/src/accessor/grib_accessor_class_headers_only.h.bak b/src/accessor/grib_accessor_class_headers_only.h.bak deleted file mode 100644 index 29d7e8bf5..000000000 --- a/src/accessor/grib_accessor_class_headers_only.h.bak +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_headers_only_h -#define eccodes_accessor_headers_only_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_headers_only_t : public grib_accessor_gen_t -{ -public: - /* Members defined in headers_only */ -}; - -class grib_accessor_class_headers_only_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_headers_only_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_headers_only_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_headers_only_h */ diff --git a/src/accessor/grib_accessor_class_ibmfloat.h.bak b/src/accessor/grib_accessor_class_ibmfloat.h.bak deleted file mode 100644 index d98864516..000000000 --- a/src/accessor/grib_accessor_class_ibmfloat.h.bak +++ /dev/null @@ -1,71 +0,0 @@ -/* - * (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. - */ - -#ifndef eccodes_accessor_ibmfloat_h -#define eccodes_accessor_ibmfloat_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_ibmfloat_t : public grib_accessor_double_t -{ -public: - /* Members defined in ibmfloat */ - grib_arguments* arg; -}; - -class grib_accessor_class_ibmfloat_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_ibmfloat_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_ibmfloat_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - long byte_count(grib_accessor*) override; - long byte_offset(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; - int nearest_smaller_value(grib_accessor*, double, double*) override; -private: - template int unpack(grib_accessor*, T*, size_t*); -}; - - -template -int grib_accessor_class_ibmfloat_t::unpack(grib_accessor* a, T* val, size_t* len){ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - unsigned long rlen = 0; - long count = 0; - int err = 0; - unsigned long i = 0; - long bitp = a->offset * 8; - grib_handle* hand = grib_handle_of_accessor(a); - - err = a->value_count(&count); if (err) - return err; - rlen = count; - - if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %lu values", *len, a->name, rlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < rlen; i++) - val[i] = (T)grib_long_to_ibm(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); - - *len = rlen; - return GRIB_SUCCESS; -} - -#endif /* eccodes_accessor_ibmfloat_h */ diff --git a/src/accessor/grib_accessor_class_ieeefloat.h.bak b/src/accessor/grib_accessor_class_ieeefloat.h.bak deleted file mode 100644 index 100b2ad6a..000000000 --- a/src/accessor/grib_accessor_class_ieeefloat.h.bak +++ /dev/null @@ -1,66 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_ieeefloat_h -#define eccodes_accessor_ieeefloat_h - -#include "grib_accessor_class_double.h" - -class grib_accessor_ieeefloat_t : public grib_accessor_double_t -{ -public: - grib_arguments* arg; -}; - -class grib_accessor_class_ieeefloat_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_ieeefloat_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_ieeefloat_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; - int nearest_smaller_value(grib_accessor* a, double val, double* nearest) override; - -private: - template int unpack(grib_accessor*, T*, size_t*); -}; - - -template -int grib_accessor_class_ieeefloat_t::unpack(grib_accessor* a, T* val, size_t* len){ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - long rlen = 0; - int err = 0; - long i = 0; - long bitp = a->offset * 8; - grib_handle* hand = grib_handle_of_accessor(a); - - err = a->value_count(&rlen); if (err) - return err; - - if (*len < (size_t)rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %ld values", *len, a->name, rlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < rlen; i++) - val[i] = (T)grib_long_to_ieee(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); - - *len = rlen; - return GRIB_SUCCESS; -} - -#endif /* eccodes_accessor_ieeefloat_h */ diff --git a/src/accessor/grib_accessor_class_ifs_param.h.bak b/src/accessor/grib_accessor_class_ifs_param.h.bak deleted file mode 100644 index d41da1723..000000000 --- a/src/accessor/grib_accessor_class_ifs_param.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_ifs_param_h -#define eccodes_accessor_ifs_param_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_ifs_param_t : public grib_accessor_gen_t -{ -public: - /* Members defined in ifs_param */ - const char* paramId; - const char* type; -}; - -class grib_accessor_class_ifs_param_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_ifs_param_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_ifs_param_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_ifs_param_h */ diff --git a/src/accessor/grib_accessor_class_iterator.h.bak b/src/accessor/grib_accessor_class_iterator.h.bak deleted file mode 100644 index 7288fa205..000000000 --- a/src/accessor/grib_accessor_class_iterator.h.bak +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (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. - */ - -/*************************** - * Enrico Fucile - *************************/ - -#pragma once - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_iterator_t : public grib_accessor_gen_t -{ -public: - grib_arguments* args; -}; - -class grib_accessor_class_iterator_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_iterator_t(const char* name) : grib_accessor_class_gen_t(name) {}; - grib_accessor* create_empty_accessor() override { return new grib_accessor_iterator_t{}; } - void init(grib_accessor* a, const long l, grib_arguments* args) override; - void dump(grib_accessor* a, grib_dumper* dumper) override; -}; - - -//grib_iterator* grib_iterator_new(const grib_handle* ch, unsigned long flags, int* error) diff --git a/src/accessor/grib_accessor_class_julian_date.h.bak b/src/accessor/grib_accessor_class_julian_date.h.bak deleted file mode 100644 index 68008fec6..000000000 --- a/src/accessor/grib_accessor_class_julian_date.h.bak +++ /dev/null @@ -1,48 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_julian_date_h -#define eccodes_accessor_julian_date_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_julian_date_t : public grib_accessor_double_t -{ -public: - /* Members defined in julian_date */ - const char *year; - const char *month; - const char *day; - const char *hour; - const char *minute; - const char *second; - const char *ymd; - const char *hms; - char sep[5]; -}; - -class grib_accessor_class_julian_date_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_julian_date_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_julian_date_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int pack_expression(grib_accessor*, grib_expression*) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_julian_date_h */ diff --git a/src/accessor/grib_accessor_class_julian_day.h.bak b/src/accessor/grib_accessor_class_julian_day.h.bak deleted file mode 100644 index 1d21fb920..000000000 --- a/src/accessor/grib_accessor_class_julian_day.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_julian_day_h -#define eccodes_accessor_julian_day_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_julian_day_t : public grib_accessor_double_t -{ -public: - /* Members defined in julian_day */ - const char *date; - const char *hour; - const char *minute; - const char *second; -}; - -class grib_accessor_class_julian_day_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_julian_day_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_julian_day_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_julian_day_h */ diff --git a/src/accessor/grib_accessor_class_ksec1expver.h.bak b/src/accessor/grib_accessor_class_ksec1expver.h.bak deleted file mode 100644 index 3884a7709..000000000 --- a/src/accessor/grib_accessor_class_ksec1expver.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_ksec1expver_h -#define eccodes_accessor_ksec1expver_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_ascii.h" - -class grib_accessor_ksec1expver_t : public grib_accessor_ascii_t -{ -public: - /* Members defined in ksec1expver */ -}; - -class grib_accessor_class_ksec1expver_t : public grib_accessor_class_ascii_t -{ -public: - grib_accessor_class_ksec1expver_t(const char* name) : grib_accessor_class_ascii_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_ksec1expver_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_ksec1expver_h */ diff --git a/src/accessor/grib_accessor_class_label.h.bak b/src/accessor/grib_accessor_class_label.h.bak deleted file mode 100644 index c4e64b322..000000000 --- a/src/accessor/grib_accessor_class_label.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_label_h -#define eccodes_accessor_label_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_label_t : public grib_accessor_gen_t -{ -public: - /* Members defined in label */ -}; - -class grib_accessor_class_label_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_label_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_label_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_label_h */ diff --git a/src/accessor/grib_accessor_class_latitudes.h.bak b/src/accessor/grib_accessor_class_latitudes.h.bak deleted file mode 100644 index 10344c7cb..000000000 --- a/src/accessor/grib_accessor_class_latitudes.h.bak +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_latitudes_h -#define eccodes_accessor_latitudes_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_latitudes_t : public grib_accessor_double_t -{ -public: - /* Members defined in latitudes */ - const char* values; - long distinct; - double* lats; - long size; - int save; -}; - -class grib_accessor_class_latitudes_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_latitudes_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_latitudes_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_latitudes_h */ diff --git a/src/accessor/grib_accessor_class_latlon_increment.h.bak b/src/accessor/grib_accessor_class_latlon_increment.h.bak deleted file mode 100644 index 4f5402e6a..000000000 --- a/src/accessor/grib_accessor_class_latlon_increment.h.bak +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_latlon_increment_h -#define eccodes_accessor_latlon_increment_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_latlon_increment_t : public grib_accessor_double_t -{ -public: - /* Members defined in latlon_increment */ - const char* directionIncrementGiven; - const char* directionIncrement; - const char* scansPositively; - const char* first; - const char* last; - const char* numberOfPoints; - const char* angleMultiplier; - const char* angleDivisor; - long isLongitude; -}; - -class grib_accessor_class_latlon_increment_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_latlon_increment_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_latlon_increment_t{}; } - int is_missing(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_latlon_increment_h */ diff --git a/src/accessor/grib_accessor_class_latlonvalues.h.bak b/src/accessor/grib_accessor_class_latlonvalues.h.bak deleted file mode 100644 index ed040f543..000000000 --- a/src/accessor/grib_accessor_class_latlonvalues.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_latlonvalues_h -#define eccodes_accessor_latlonvalues_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_latlonvalues_t : public grib_accessor_double_t -{ -public: - /* Members defined in latlonvalues */ - const char* values; -}; - -class grib_accessor_class_latlonvalues_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_latlonvalues_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_latlonvalues_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_latlonvalues_h */ diff --git a/src/accessor/grib_accessor_class_library_version.h.bak b/src/accessor/grib_accessor_class_library_version.h.bak deleted file mode 100644 index 28de10364..000000000 --- a/src/accessor/grib_accessor_class_library_version.h.bak +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_library_version_h -#define eccodes_accessor_library_version_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_ascii.h" - -class grib_accessor_library_version_t : public grib_accessor_ascii_t -{ -public: - /* Members defined in library_version */ -}; - -class grib_accessor_class_library_version_t : public grib_accessor_class_ascii_t -{ -public: - grib_accessor_class_library_version_t(const char* name) : grib_accessor_class_ascii_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_library_version_t{}; } - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; -}; -#endif /* eccodes_accessor_library_version_h */ diff --git a/src/accessor/grib_accessor_class_local_definition.h.bak b/src/accessor/grib_accessor_class_local_definition.h.bak deleted file mode 100644 index 296bab69d..000000000 --- a/src/accessor/grib_accessor_class_local_definition.h.bak +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_local_definition_h -#define eccodes_accessor_local_definition_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_unsigned.h" - -class grib_accessor_local_definition_t : public grib_accessor_unsigned_t -{ -public: - /* Members defined in local_definition */ - const char* productDefinitionTemplateNumber; - const char* productDefinitionTemplateNumberInternal; - const char* grib2LocalSectionNumber; - const char* type; - const char* stream; - const char* the_class; - const char* eps; - const char* stepType; - const char* derivedForecast; -}; - -class grib_accessor_class_local_definition_t : public grib_accessor_class_unsigned_t -{ -public: - grib_accessor_class_local_definition_t(const char* name) : grib_accessor_class_unsigned_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_local_definition_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_local_definition_h */ diff --git a/src/accessor/grib_accessor_class_long.cc b/src/accessor/grib_accessor_class_long.cc index 89d757acb..588083c49 100644 --- a/src/accessor/grib_accessor_class_long.cc +++ b/src/accessor/grib_accessor_class_long.cc @@ -1,3 +1,13 @@ +/* + * (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 "grib_accessor_class_long.h" grib_accessor_class_long_t _grib_accessor_class_long{"long"}; diff --git a/src/accessor/grib_accessor_class_long.h b/src/accessor/grib_accessor_class_long.h index acabf2612..fea39235e 100644 --- a/src/accessor/grib_accessor_class_long.h +++ b/src/accessor/grib_accessor_class_long.h @@ -1,3 +1,13 @@ +/* + * (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. + */ + #pragma once #include "grib_api_internal.h" diff --git a/src/accessor/grib_accessor_class_long.h.bak b/src/accessor/grib_accessor_class_long.h.bak deleted file mode 100644 index a0b01f9ae..000000000 --- a/src/accessor/grib_accessor_class_long.h.bak +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_long_t : public grib_accessor_gen_t -{}; - -class grib_accessor_class_long_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_long_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_long_t{}; } - void init(grib_accessor* a, const long len, grib_arguments* arg) override; - int get_native_type(grib_accessor* a) override; - int pack_missing(grib_accessor* a) override; - int pack_string(grib_accessor* a, const char*, size_t* len) override; - int unpack_double(grib_accessor* a, double* val, size_t* len) override; - int unpack_string(grib_accessor* a, char*, size_t* len) override; - void dump(grib_accessor* a, grib_dumper*) override; - int compare(grib_accessor* a, grib_accessor*) override; -}; diff --git a/src/accessor/grib_accessor_class_long_vector.h.bak b/src/accessor/grib_accessor_class_long_vector.h.bak deleted file mode 100644 index 66fab29e6..000000000 --- a/src/accessor/grib_accessor_class_long_vector.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_long_vector_h -#define eccodes_accessor_long_vector_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_abstract_long_vector.h" - -class grib_accessor_long_vector_t : public grib_accessor_abstract_long_vector_t -{ -public: - /* Members defined in long_vector */ - const char* vector; - int index; -}; - -class grib_accessor_class_long_vector_t : public grib_accessor_class_abstract_long_vector_t -{ -public: - grib_accessor_class_long_vector_t(const char* name) : grib_accessor_class_abstract_long_vector_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_long_vector_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_long_vector_h */ diff --git a/src/accessor/grib_accessor_class_longitudes.h.bak b/src/accessor/grib_accessor_class_longitudes.h.bak deleted file mode 100644 index 782b4d764..000000000 --- a/src/accessor/grib_accessor_class_longitudes.h.bak +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_longitudes_h -#define eccodes_accessor_longitudes_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_longitudes_t : public grib_accessor_double_t -{ -public: - /* Members defined in longitudes */ - const char* values; - long distinct; - double* lons; - long size; - int save; -}; - -class grib_accessor_class_longitudes_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_longitudes_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_longitudes_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_longitudes_h */ diff --git a/src/accessor/grib_accessor_class_lookup.h.bak b/src/accessor/grib_accessor_class_lookup.h.bak deleted file mode 100644 index 1fba42fe5..000000000 --- a/src/accessor/grib_accessor_class_lookup.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_lookup_h -#define eccodes_accessor_lookup_h - -#include "grib_accessor_class_long.h" - -class grib_accessor_lookup_t : public grib_accessor_long_t -{ -public: - long llength; - long loffset; - grib_expression* real_name; -}; - -class grib_accessor_class_lookup_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_lookup_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_lookup_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - long byte_count(grib_accessor*) override; - long byte_offset(grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void post_init(grib_accessor*) override; - int notify_change(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_lookup_h */ diff --git a/src/accessor/grib_accessor_class_mars_param.h.bak b/src/accessor/grib_accessor_class_mars_param.h.bak deleted file mode 100644 index 87bcaad41..000000000 --- a/src/accessor/grib_accessor_class_mars_param.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_mars_param_h -#define eccodes_accessor_mars_param_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_ascii.h" - -class grib_accessor_mars_param_t : public grib_accessor_ascii_t -{ -public: - /* Members defined in mars_param */ - const char* paramId; - const char* table; - const char* param; -}; - -class grib_accessor_class_mars_param_t : public grib_accessor_class_ascii_t -{ -public: - grib_accessor_class_mars_param_t(const char* name) : grib_accessor_class_ascii_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_mars_param_t{}; } - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_mars_param_h */ diff --git a/src/accessor/grib_accessor_class_mars_step.h.bak b/src/accessor/grib_accessor_class_mars_step.h.bak deleted file mode 100644 index db3042648..000000000 --- a/src/accessor/grib_accessor_class_mars_step.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_mars_step_h -#define eccodes_accessor_mars_step_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_ascii.h" - -class grib_accessor_mars_step_t : public grib_accessor_ascii_t -{ -public: - /* Members defined in mars_step */ - const char* stepRange; - const char* stepType; -}; - -class grib_accessor_class_mars_step_t : public grib_accessor_class_ascii_t -{ -public: - grib_accessor_class_mars_step_t(const char* name) : grib_accessor_class_ascii_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_mars_step_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_mars_step_h */ diff --git a/src/accessor/grib_accessor_class_md5.h.bak b/src/accessor/grib_accessor_class_md5.h.bak deleted file mode 100644 index 8d819cc9d..000000000 --- a/src/accessor/grib_accessor_class_md5.h.bak +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_md5_h -#define eccodes_accessor_md5_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_md5_t : public grib_accessor_gen_t -{ -public: - /* Members defined in md5 */ - const char* offset; - grib_expression* length; - grib_string_list* blocklist; -}; - -class grib_accessor_class_md5_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_md5_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_md5_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_md5_h */ diff --git a/src/accessor/grib_accessor_class_message.h.bak b/src/accessor/grib_accessor_class_message.h.bak deleted file mode 100644 index 912e8be4b..000000000 --- a/src/accessor/grib_accessor_class_message.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_message_h -#define eccodes_accessor_message_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_bytes.h" - -class grib_accessor_message_t : public grib_accessor_bytes_t -{ -public: - /* Members defined in message */ -}; - -class grib_accessor_class_message_t : public grib_accessor_class_bytes_t -{ -public: - grib_accessor_class_message_t(const char* name) : grib_accessor_class_bytes_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_message_t{}; } - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; - void resize(grib_accessor*,size_t) override; -}; -#endif /* eccodes_accessor_message_h */ diff --git a/src/accessor/grib_accessor_class_message_copy.h.bak b/src/accessor/grib_accessor_class_message_copy.h.bak deleted file mode 100644 index 37072c685..000000000 --- a/src/accessor/grib_accessor_class_message_copy.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_message_copy_h -#define eccodes_accessor_message_copy_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_message_copy_t : public grib_accessor_gen_t -{ -public: - /* Members defined in message_copy */ -}; - -class grib_accessor_class_message_copy_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_message_copy_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_message_copy_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - long byte_count(grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_message_copy_h */ diff --git a/src/accessor/grib_accessor_class_multdouble.h.bak b/src/accessor/grib_accessor_class_multdouble.h.bak deleted file mode 100644 index 9d6d76285..000000000 --- a/src/accessor/grib_accessor_class_multdouble.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_multdouble_h -#define eccodes_accessor_multdouble_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_multdouble_t : public grib_accessor_double_t -{ -public: - /* Members defined in multdouble */ - const char* val; - double multiplier; -}; - -class grib_accessor_class_multdouble_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_multdouble_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_multdouble_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_multdouble_h */ diff --git a/src/accessor/grib_accessor_class_nearest.h.bak b/src/accessor/grib_accessor_class_nearest.h.bak deleted file mode 100644 index 831afea60..000000000 --- a/src/accessor/grib_accessor_class_nearest.h.bak +++ /dev/null @@ -1,33 +0,0 @@ -/* - * (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. - */ - -#pragma once - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_nearest_t : public grib_accessor_gen_t -{ -public: - grib_arguments* args; -}; - - -class grib_accessor_class_nearest_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_nearest_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_nearest_t{}; } - void init(grib_accessor* a, const long l, grib_arguments* args) override; - void dump(grib_accessor* a, grib_dumper* dumper) override; -}; - - -//grib_nearest* grib_nearest_new(const grib_handle* ch, int* error); diff --git a/src/accessor/grib_accessor_class_non_alpha.h.bak b/src/accessor/grib_accessor_class_non_alpha.h.bak deleted file mode 100644 index 1b1b9d830..000000000 --- a/src/accessor/grib_accessor_class_non_alpha.h.bak +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_non_alpha_h -#define eccodes_accessor_non_alpha_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_non_alpha_t : public grib_accessor_gen_t -{ -public: - /* Members defined in non_alpha */ -}; - -class grib_accessor_class_non_alpha_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_non_alpha_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_non_alpha_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_non_alpha_h */ diff --git a/src/accessor/grib_accessor_class_number_of_coded_values.h.bak b/src/accessor/grib_accessor_class_number_of_coded_values.h.bak deleted file mode 100644 index de5e3b76b..000000000 --- a/src/accessor/grib_accessor_class_number_of_coded_values.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_number_of_coded_values_h -#define eccodes_accessor_number_of_coded_values_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_number_of_coded_values_t : public grib_accessor_long_t -{ -public: - /* Members defined in number_of_coded_values */ - const char* numberOfValues; - const char* bitsPerValue; - const char* offsetBeforeData; - const char* offsetAfterData; - const char* unusedBits; -}; - -class grib_accessor_class_number_of_coded_values_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_number_of_coded_values_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_coded_values_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_number_of_coded_values_h */ diff --git a/src/accessor/grib_accessor_class_number_of_points.h.bak b/src/accessor/grib_accessor_class_number_of_points.h.bak deleted file mode 100644 index db3521c05..000000000 --- a/src/accessor/grib_accessor_class_number_of_points.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_number_of_points_h -#define eccodes_accessor_number_of_points_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_number_of_points_t : public grib_accessor_long_t -{ -public: - /* Members defined in number_of_points */ - const char* ni; - const char* nj; - const char* plpresent; - const char* pl; -}; - -class grib_accessor_class_number_of_points_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_number_of_points_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_points_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_number_of_points_h */ diff --git a/src/accessor/grib_accessor_class_number_of_points_gaussian.h.bak b/src/accessor/grib_accessor_class_number_of_points_gaussian.h.bak deleted file mode 100644 index f01224f17..000000000 --- a/src/accessor/grib_accessor_class_number_of_points_gaussian.h.bak +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_number_of_points_gaussian_h -#define eccodes_accessor_number_of_points_gaussian_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_number_of_points_gaussian_t : public grib_accessor_long_t -{ -public: - /* Members defined in number_of_points_gaussian */ - const char* ni; - const char* nj; - const char* plpresent; - const char* pl; - const char* order; - const char* lat_first; - const char* lon_first; - const char* lat_last; - const char* lon_last; - const char* support_legacy; -}; - -class grib_accessor_class_number_of_points_gaussian_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_number_of_points_gaussian_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_points_gaussian_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_number_of_points_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_number_of_values.h.bak b/src/accessor/grib_accessor_class_number_of_values.h.bak deleted file mode 100644 index 88b18cd6f..000000000 --- a/src/accessor/grib_accessor_class_number_of_values.h.bak +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_number_of_values_h -#define eccodes_accessor_number_of_values_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_number_of_values_t : public grib_accessor_long_t -{ -public: - /* Members defined in number_of_values */ - const char* values; - const char* bitsPerValue; - const char* numberOfPoints; - const char* bitmapPresent; - const char* bitmap; - const char* numberOfCodedValues; -}; - -class grib_accessor_class_number_of_values_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_number_of_values_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_values_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_number_of_values_h */ diff --git a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h.bak b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h.bak deleted file mode 100644 index c0a6e9fcb..000000000 --- a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_number_of_values_data_raw_packing_h -#define eccodes_accessor_number_of_values_data_raw_packing_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_number_of_values_data_raw_packing_t : public grib_accessor_gen_t -{ -public: - /* Members defined in number_of_values_data_raw_packing */ - const char* values; - const char* precision; -}; - -class grib_accessor_class_number_of_values_data_raw_packing_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_number_of_values_data_raw_packing_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_number_of_values_data_raw_packing_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_number_of_values_data_raw_packing_h */ diff --git a/src/accessor/grib_accessor_class_octahedral_gaussian.h.bak b/src/accessor/grib_accessor_class_octahedral_gaussian.h.bak deleted file mode 100644 index 31784d000..000000000 --- a/src/accessor/grib_accessor_class_octahedral_gaussian.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_octahedral_gaussian_h -#define eccodes_accessor_octahedral_gaussian_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_octahedral_gaussian_t : public grib_accessor_long_t -{ -public: - /* Members defined in octahedral_gaussian */ - const char* N; - const char* Ni; - const char* plpresent; - const char* pl; -}; - -class grib_accessor_class_octahedral_gaussian_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_octahedral_gaussian_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_octahedral_gaussian_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_octahedral_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_octet_number.h.bak b/src/accessor/grib_accessor_class_octet_number.h.bak deleted file mode 100644 index 4d6145742..000000000 --- a/src/accessor/grib_accessor_class_octet_number.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_octet_number_h -#define eccodes_accessor_octet_number_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_octet_number_t : public grib_accessor_long_t -{ -public: - /* Members defined in octet_number */ - const char* left; - long right; -}; - -class grib_accessor_class_octet_number_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_octet_number_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_octet_number_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_octet_number_h */ diff --git a/src/accessor/grib_accessor_class_offset_file.h.bak b/src/accessor/grib_accessor_class_offset_file.h.bak deleted file mode 100644 index 34243b5a4..000000000 --- a/src/accessor/grib_accessor_class_offset_file.h.bak +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_offset_file_h -#define eccodes_accessor_offset_file_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_offset_file_t : public grib_accessor_double_t -{ -public: - /* Members defined in offset_file */ -}; - -class grib_accessor_class_offset_file_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_offset_file_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_offset_file_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_offset_file_h */ diff --git a/src/accessor/grib_accessor_class_offset_values.h.bak b/src/accessor/grib_accessor_class_offset_values.h.bak deleted file mode 100644 index 51e0f0f16..000000000 --- a/src/accessor/grib_accessor_class_offset_values.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_offset_values_h -#define eccodes_accessor_offset_values_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_offset_values_t : public grib_accessor_double_t -{ -public: - /* Members defined in offset_values */ - const char* values; - const char* missingValue; -}; - -class grib_accessor_class_offset_values_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_offset_values_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_offset_values_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_offset_values_h */ diff --git a/src/accessor/grib_accessor_class_optimal_step_units.h.bak b/src/accessor/grib_accessor_class_optimal_step_units.h.bak deleted file mode 100644 index 96383b291..000000000 --- a/src/accessor/grib_accessor_class_optimal_step_units.h.bak +++ /dev/null @@ -1,44 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_optimal_step_units_h -#define eccodes_accessor_optimal_step_units_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_optimal_step_units_t : public grib_accessor_gen_t -{ -public: - /* Members defined in optimal_step_units */ - const char* forecast_time_value; - const char* forecast_time_unit; - const char* time_range_value; - const char* time_range_unit; -}; - -class grib_accessor_class_optimal_step_units_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_optimal_step_units_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_optimal_step_units_t{}; } - int get_native_type(grib_accessor*) override; - int is_missing(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int pack_expression(grib_accessor*, grib_expression*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_optimal_step_units_h */ diff --git a/src/accessor/grib_accessor_class_pack_bufr_values.h.bak b/src/accessor/grib_accessor_class_pack_bufr_values.h.bak deleted file mode 100644 index b4bdaf43c..000000000 --- a/src/accessor/grib_accessor_class_pack_bufr_values.h.bak +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_pack_bufr_values_h -#define eccodes_accessor_pack_bufr_values_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_pack_bufr_values_t : public grib_accessor_gen_t -{ -public: - /* Members defined in pack_bufr_values */ - grib_accessor* data_accessor; -}; - -class grib_accessor_class_pack_bufr_values_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_pack_bufr_values_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_pack_bufr_values_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int unpack_string_array(grib_accessor*, char**, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_pack_bufr_values_h */ diff --git a/src/accessor/grib_accessor_class_packing_type.h.bak b/src/accessor/grib_accessor_class_packing_type.h.bak deleted file mode 100644 index 3451db189..000000000 --- a/src/accessor/grib_accessor_class_packing_type.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_packing_type_h -#define eccodes_accessor_packing_type_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_packing_type_t : public grib_accessor_gen_t -{ -public: - /* Members defined in packing_type */ - const char* values; - const char* packing_type; -}; - -class grib_accessor_class_packing_type_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_packing_type_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_packing_type_t{}; } - int get_native_type(grib_accessor*) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_packing_type_h */ diff --git a/src/accessor/grib_accessor_class_pad.h.bak b/src/accessor/grib_accessor_class_pad.h.bak deleted file mode 100644 index 8ca8bb09b..000000000 --- a/src/accessor/grib_accessor_class_pad.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_pad_h -#define eccodes_accessor_pad_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_padding.h" - -class grib_accessor_pad_t : public grib_accessor_padding_t -{ -public: - /* Members defined in padding */ - /* Members defined in pad */ - grib_expression* expression; -}; - -class grib_accessor_class_pad_t : public grib_accessor_class_padding_t -{ -public: - grib_accessor_class_pad_t(const char* name) : grib_accessor_class_padding_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_pad_t{}; } - void init(grib_accessor*, const long, grib_arguments*) override; - size_t preferred_size(grib_accessor*, int) override; -}; -#endif /* eccodes_accessor_pad_h */ diff --git a/src/accessor/grib_accessor_class_padding.h.bak b/src/accessor/grib_accessor_class_padding.h.bak deleted file mode 100644 index 65a416c4c..000000000 --- a/src/accessor/grib_accessor_class_padding.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_padding_h -#define eccodes_accessor_padding_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_bytes.h" - -class grib_accessor_padding_t : public grib_accessor_bytes_t -{ -public: - /* Members defined in padding */ -}; - -class grib_accessor_class_padding_t : public grib_accessor_class_bytes_t -{ -public: - grib_accessor_class_padding_t(const char* name) : grib_accessor_class_bytes_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_padding_t{}; } - size_t string_length(grib_accessor*) override; - long byte_count(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; - void resize(grib_accessor*,size_t) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_padding_h */ diff --git a/src/accessor/grib_accessor_class_padto.h.bak b/src/accessor/grib_accessor_class_padto.h.bak deleted file mode 100644 index f7203b2cb..000000000 --- a/src/accessor/grib_accessor_class_padto.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_padto_h -#define eccodes_accessor_padto_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_padding.h" - -class grib_accessor_padto_t : public grib_accessor_padding_t -{ -public: - /* Members defined in padto */ - grib_expression* expression; -}; - -class grib_accessor_class_padto_t : public grib_accessor_class_padding_t -{ -public: - grib_accessor_class_padto_t(const char* name) : grib_accessor_class_padding_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_padto_t{}; } - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - size_t preferred_size(grib_accessor*, int) override; -}; -#endif /* eccodes_accessor_padto_h */ diff --git a/src/accessor/grib_accessor_class_padtoeven.h.bak b/src/accessor/grib_accessor_class_padtoeven.h.bak deleted file mode 100644 index 08f8fc072..000000000 --- a/src/accessor/grib_accessor_class_padtoeven.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_padtoeven_h -#define eccodes_accessor_padtoeven_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_padding.h" - -class grib_accessor_padtoeven_t : public grib_accessor_padding_t -{ -public: - /* Members defined in padtoeven */ - const char* section_offset; - const char* section_length; -}; - -class grib_accessor_class_padtoeven_t : public grib_accessor_class_padding_t -{ -public: - grib_accessor_class_padtoeven_t(const char* name) : grib_accessor_class_padding_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_padtoeven_t{}; } - void init(grib_accessor*, const long, grib_arguments*) override; - size_t preferred_size(grib_accessor*, int) override; -}; -#endif /* eccodes_accessor_padtoeven_h */ diff --git a/src/accessor/grib_accessor_class_padtomultiple.h.bak b/src/accessor/grib_accessor_class_padtomultiple.h.bak deleted file mode 100644 index f57afad37..000000000 --- a/src/accessor/grib_accessor_class_padtomultiple.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_padtomultiple_h -#define eccodes_accessor_padtomultiple_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_padding.h" - -class grib_accessor_padtomultiple_t : public grib_accessor_padding_t -{ -public: - /* Members defined in padtomultiple */ - grib_expression* begin; - grib_expression* multiple; -}; - -class grib_accessor_class_padtomultiple_t : public grib_accessor_class_padding_t -{ -public: - grib_accessor_class_padtomultiple_t(const char* name) : grib_accessor_class_padding_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_padtomultiple_t{}; } - void init(grib_accessor*, const long, grib_arguments*) override; - size_t preferred_size(grib_accessor*, int) override; -}; -#endif /* eccodes_accessor_padtomultiple_h */ diff --git a/src/accessor/grib_accessor_class_position.h.bak b/src/accessor/grib_accessor_class_position.h.bak deleted file mode 100644 index 40d690694..000000000 --- a/src/accessor/grib_accessor_class_position.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_position_h -#define eccodes_accessor_position_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_position_t : public grib_accessor_gen_t -{ -public: - /* Members defined in position */ -}; - -class grib_accessor_class_position_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_position_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_position_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_position_h */ diff --git a/src/accessor/grib_accessor_class_proj_string.h.bak b/src/accessor/grib_accessor_class_proj_string.h.bak deleted file mode 100644 index c49c0f868..000000000 --- a/src/accessor/grib_accessor_class_proj_string.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_proj_string_h -#define eccodes_accessor_proj_string_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_proj_string_t : public grib_accessor_gen_t -{ -public: - /* Members defined in proj_string */ - const char* grid_type; - int endpoint; -}; - -class grib_accessor_class_proj_string_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_proj_string_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_proj_string_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_proj_string_h */ diff --git a/src/accessor/grib_accessor_class_raw.h.bak b/src/accessor/grib_accessor_class_raw.h.bak deleted file mode 100644 index 30a2603e7..000000000 --- a/src/accessor/grib_accessor_class_raw.h.bak +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_raw_h -#define eccodes_accessor_raw_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_raw_t : public grib_accessor_gen_t -{ -public: - /* Members defined in raw */ - const char* totalLength; - const char* sectionLength; - long relativeOffset; -}; - -class grib_accessor_class_raw_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_raw_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_raw_t{}; } - int get_native_type(grib_accessor*) override; - int pack_bytes(grib_accessor*, const unsigned char*, size_t* len) override; - int unpack_bytes(grib_accessor*, unsigned char*, size_t* len) override; - long byte_count(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_raw_h */ diff --git a/src/accessor/grib_accessor_class_rdbtime_guess_date.h.bak b/src/accessor/grib_accessor_class_rdbtime_guess_date.h.bak deleted file mode 100644 index e9ef0b4d3..000000000 --- a/src/accessor/grib_accessor_class_rdbtime_guess_date.h.bak +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_rdbtime_guess_date_h -#define eccodes_accessor_rdbtime_guess_date_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_rdbtime_guess_date_t : public grib_accessor_long_t -{ -public: - /* Members defined in rdbtime_guess_date */ - const char* typicalYear; - const char* typicalMonth; - const char* typicalDay; - const char* rdbDay; - long yearOrMonth; -}; - -class grib_accessor_class_rdbtime_guess_date_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_rdbtime_guess_date_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_rdbtime_guess_date_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_rdbtime_guess_date_h */ diff --git a/src/accessor/grib_accessor_class_reference_value_error.h.bak b/src/accessor/grib_accessor_class_reference_value_error.h.bak deleted file mode 100644 index e0b948e97..000000000 --- a/src/accessor/grib_accessor_class_reference_value_error.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_reference_value_error_h -#define eccodes_accessor_reference_value_error_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_reference_value_error_t : public grib_accessor_double_t -{ -public: - /* Members defined in reference_value_error */ - const char* referenceValue; - const char* floatType; -}; - -class grib_accessor_class_reference_value_error_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_reference_value_error_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_reference_value_error_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_reference_value_error_h */ diff --git a/src/accessor/grib_accessor_class_round.h.bak b/src/accessor/grib_accessor_class_round.h.bak deleted file mode 100644 index c38d7b6e8..000000000 --- a/src/accessor/grib_accessor_class_round.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_round_h -#define eccodes_accessor_round_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_evaluate.h" - -class grib_accessor_round_t : public grib_accessor_evaluate_t -{ -public: - /* Members defined in round */ -}; - -class grib_accessor_class_round_t : public grib_accessor_class_evaluate_t -{ -public: - grib_accessor_class_round_t(const char* name) : grib_accessor_class_evaluate_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_round_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; -}; -#endif /* eccodes_accessor_round_h */ diff --git a/src/accessor/grib_accessor_class_scale.h.bak b/src/accessor/grib_accessor_class_scale.h.bak deleted file mode 100644 index 7e1f0d80d..000000000 --- a/src/accessor/grib_accessor_class_scale.h.bak +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_scale_h -#define eccodes_accessor_scale_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_scale_t : public grib_accessor_double_t -{ -public: - /* Members defined in scale */ - const char* value; - const char* multiplier; - const char* divisor; - const char* truncating; -}; - -class grib_accessor_class_scale_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_scale_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_scale_t{}; } - int is_missing(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_scale_h */ diff --git a/src/accessor/grib_accessor_class_scale_values.h.bak b/src/accessor/grib_accessor_class_scale_values.h.bak deleted file mode 100644 index cb94e16b8..000000000 --- a/src/accessor/grib_accessor_class_scale_values.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_scale_values_h -#define eccodes_accessor_scale_values_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_scale_values_t : public grib_accessor_double_t -{ -public: - /* Members defined in scale_values */ - const char* values; - const char* missingValue; -}; - -class grib_accessor_class_scale_values_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_scale_values_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_scale_values_t{}; } - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_scale_values_h */ diff --git a/src/accessor/grib_accessor_class_second_order_bits_per_value.h.bak b/src/accessor/grib_accessor_class_second_order_bits_per_value.h.bak deleted file mode 100644 index 370b364dd..000000000 --- a/src/accessor/grib_accessor_class_second_order_bits_per_value.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_second_order_bits_per_value_h -#define eccodes_accessor_second_order_bits_per_value_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_second_order_bits_per_value_t : public grib_accessor_long_t -{ -public: - /* Members defined in second_order_bits_per_value */ - const char* values; - const char* binaryScaleFactor; - const char* decimalScaleFactor; - long bitsPerValue; -}; - -class grib_accessor_class_second_order_bits_per_value_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_second_order_bits_per_value_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_second_order_bits_per_value_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_second_order_bits_per_value_h */ diff --git a/src/accessor/grib_accessor_class_section.h.bak b/src/accessor/grib_accessor_class_section.h.bak deleted file mode 100644 index b1905b182..000000000 --- a/src/accessor/grib_accessor_class_section.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_section_h -#define eccodes_accessor_section_h - -#include "grib_accessor_class_gen.h" - -class grib_accessor_section_t : public grib_accessor_gen_t {}; - -class grib_accessor_class_section_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_section_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_section_t{}; } - int get_native_type(grib_accessor*) override; - long byte_count(grib_accessor*) override; - long next_offset(grib_accessor*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; - grib_section* sub_section(grib_accessor*) override; - grib_accessor* next(grib_accessor*, int) override; -}; -#endif /* eccodes_accessor_section_h */ diff --git a/src/accessor/grib_accessor_class_section_length.h.bak b/src/accessor/grib_accessor_class_section_length.h.bak deleted file mode 100644 index 09490bebd..000000000 --- a/src/accessor/grib_accessor_class_section_length.h.bak +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_section_length_h -#define eccodes_accessor_section_length_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_unsigned.h" - -class grib_accessor_section_length_t : public grib_accessor_unsigned_t -{ -public: - /* Members defined in section_length */ -}; - -class grib_accessor_class_section_length_t : public grib_accessor_class_unsigned_t -{ -public: - grib_accessor_class_section_length_t(const char* name) : grib_accessor_class_unsigned_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_section_length_t{}; } - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_section_length_h */ diff --git a/src/accessor/grib_accessor_class_section_padding.h.bak b/src/accessor/grib_accessor_class_section_padding.h.bak deleted file mode 100644 index b6fce7f34..000000000 --- a/src/accessor/grib_accessor_class_section_padding.h.bak +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_section_padding_h -#define eccodes_accessor_section_padding_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_padding.h" - -class grib_accessor_section_padding_t : public grib_accessor_padding_t -{ -public: - /* Members defined in section_padding */ - int preserve; -}; - -class grib_accessor_class_section_padding_t : public grib_accessor_class_padding_t -{ -public: - grib_accessor_class_section_padding_t(const char* name) : grib_accessor_class_padding_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_section_padding_t{}; } - void init(grib_accessor*, const long, grib_arguments*) override; - size_t preferred_size(grib_accessor*, int) override; -}; -#endif /* eccodes_accessor_section_padding_h */ diff --git a/src/accessor/grib_accessor_class_section_pointer.h.bak b/src/accessor/grib_accessor_class_section_pointer.h.bak deleted file mode 100644 index 45e77fbb9..000000000 --- a/src/accessor/grib_accessor_class_section_pointer.h.bak +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_section_pointer_h -#define eccodes_accessor_section_pointer_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_section_pointer_t : public grib_accessor_gen_t -{ -public: - /* Members defined in section_pointer */ - const char* sectionOffset; - const char* sectionLength; - long sectionNumber; -}; - -class grib_accessor_class_section_pointer_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_section_pointer_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_section_pointer_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - long byte_count(grib_accessor*) override; - long byte_offset(grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_section_pointer_h */ diff --git a/src/accessor/grib_accessor_class_select_step_template.h.bak b/src/accessor/grib_accessor_class_select_step_template.h.bak deleted file mode 100644 index a83d3ddfd..000000000 --- a/src/accessor/grib_accessor_class_select_step_template.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_select_step_template_h -#define eccodes_accessor_select_step_template_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_unsigned.h" - -class grib_accessor_select_step_template_t : public grib_accessor_unsigned_t -{ -public: - /* Members defined in select_step_template */ - const char* productDefinitionTemplateNumber; - int instant; -}; - -class grib_accessor_class_select_step_template_t : public grib_accessor_class_unsigned_t -{ -public: - grib_accessor_class_select_step_template_t(const char* name) : grib_accessor_class_unsigned_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_select_step_template_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_select_step_template_h */ diff --git a/src/accessor/grib_accessor_class_sexagesimal2decimal.h.bak b/src/accessor/grib_accessor_class_sexagesimal2decimal.h.bak deleted file mode 100644 index c9009293e..000000000 --- a/src/accessor/grib_accessor_class_sexagesimal2decimal.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_sexagesimal2decimal_h -#define eccodes_accessor_sexagesimal2decimal_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_to_double.h" - -class grib_accessor_sexagesimal2decimal_t : public grib_accessor_to_double_t -{ -public: - /* Members defined in sexagesimal2decimal */ -}; - -class grib_accessor_class_sexagesimal2decimal_t : public grib_accessor_class_to_double_t -{ -public: - grib_accessor_class_sexagesimal2decimal_t(const char* name) : grib_accessor_class_to_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_sexagesimal2decimal_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_sexagesimal2decimal_h */ diff --git a/src/accessor/grib_accessor_class_signed.h.bak b/src/accessor/grib_accessor_class_signed.h.bak deleted file mode 100644 index 23c9829a4..000000000 --- a/src/accessor/grib_accessor_class_signed.h.bak +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_signed_h -#define eccodes_accessor_signed_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_signed_t : public grib_accessor_long_t -{ -public: - /* Members defined in signed */ - grib_arguments* arg; - int nbytes; -}; - -class grib_accessor_class_signed_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_signed_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_signed_t{}; } - int is_missing(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - long byte_count(grib_accessor*) override; - long byte_offset(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; -}; -#endif /* eccodes_accessor_signed_h */ diff --git a/src/accessor/grib_accessor_class_signed_bits.h.bak b/src/accessor/grib_accessor_class_signed_bits.h.bak deleted file mode 100644 index 96ba5f592..000000000 --- a/src/accessor/grib_accessor_class_signed_bits.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_signed_bits_h -#define eccodes_accessor_signed_bits_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_signed_bits_t : public grib_accessor_long_t -{ -public: - /* Members defined in signed_bits */ - const char* numberOfBits; - const char* numberOfElements; -}; - -class grib_accessor_class_signed_bits_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_signed_bits_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_signed_bits_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - long byte_count(grib_accessor*) override; - long byte_offset(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; -}; -#endif /* eccodes_accessor_signed_bits_h */ diff --git a/src/accessor/grib_accessor_class_simple_packing_error.h.bak b/src/accessor/grib_accessor_class_simple_packing_error.h.bak deleted file mode 100644 index 6c90188c5..000000000 --- a/src/accessor/grib_accessor_class_simple_packing_error.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_simple_packing_error_h -#define eccodes_accessor_simple_packing_error_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_simple_packing_error_t : public grib_accessor_double_t -{ -public: - /* Members defined in simple_packing_error */ - const char* binaryScaleFactor; - const char* bitsPerValue; - const char* decimalScaleFactor; - const char* referenceValue; - const char* floatType; -}; - -class grib_accessor_class_simple_packing_error_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_simple_packing_error_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_simple_packing_error_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_simple_packing_error_h */ diff --git a/src/accessor/grib_accessor_class_size.h.bak b/src/accessor/grib_accessor_class_size.h.bak deleted file mode 100644 index dbf47f8bd..000000000 --- a/src/accessor/grib_accessor_class_size.h.bak +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_size_h -#define eccodes_accessor_size_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_size_t : public grib_accessor_long_t -{ -public: - /* Members defined in size */ - const char* accessor; -}; - -class grib_accessor_class_size_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_size_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_size_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_size_h */ diff --git a/src/accessor/grib_accessor_class_smart_table.h.bak b/src/accessor/grib_accessor_class_smart_table.h.bak deleted file mode 100644 index b6146a981..000000000 --- a/src/accessor/grib_accessor_class_smart_table.h.bak +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (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. - */ - -/***************************************** - * Enrico Fucile - ****************************************/ - - -#pragma once - -#include "../grib_api_internal.h" -#include "grib_accessor_class_unsigned.h" -#include - - -class grib_accessor_smart_table_t : public grib_accessor_unsigned_t -{ -public: - const char* values; - const char* tablename; - const char* masterDir; - const char* localDir; - const char* extraDir; - const char* extraTable; - int widthOfCode; - long* tableCodes; - size_t tableCodesSize; - grib_smart_table* table; - int dirty; -}; - - -class grib_accessor_class_smart_table_t : public grib_accessor_class_unsigned_t -{ -public: - grib_accessor_class_smart_table_t(const char* name) : grib_accessor_class_unsigned_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_smart_table_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; diff --git a/src/accessor/grib_accessor_class_smart_table_column.h.bak b/src/accessor/grib_accessor_class_smart_table_column.h.bak deleted file mode 100644 index f5787f780..000000000 --- a/src/accessor/grib_accessor_class_smart_table_column.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_smart_table_column_h -#define eccodes_accessor_smart_table_column_h - -#include "grib_accessor_class_gen.h" - -class grib_accessor_smart_table_column_t : public grib_accessor_gen_t -{ -public: - const char* smartTable; - int index; -}; - -class grib_accessor_class_smart_table_column_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_smart_table_column_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_smart_table_column_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string_array(grib_accessor*, char**, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_smart_table_column_h */ diff --git a/src/accessor/grib_accessor_class_spd.h.bak b/src/accessor/grib_accessor_class_spd.h.bak deleted file mode 100644 index c35e5c742..000000000 --- a/src/accessor/grib_accessor_class_spd.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_spd_h -#define eccodes_accessor_spd_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_spd_t : public grib_accessor_long_t -{ -public: - /* Members defined in spd */ - const char* numberOfBits; - const char* numberOfElements; -}; - -class grib_accessor_class_spd_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_spd_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_spd_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - long byte_count(grib_accessor*) override; - long byte_offset(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; -}; -#endif /* eccodes_accessor_spd_h */ diff --git a/src/accessor/grib_accessor_class_spectral_truncation.h.bak b/src/accessor/grib_accessor_class_spectral_truncation.h.bak deleted file mode 100644 index 0ab43b1fd..000000000 --- a/src/accessor/grib_accessor_class_spectral_truncation.h.bak +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_spectral_truncation_h -#define eccodes_accessor_spectral_truncation_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_spectral_truncation_t : public grib_accessor_long_t -{ -public: - /* Members defined in spectral_truncation */ - const char* J; - const char* K; - const char* M; - const char* T; -}; - -class grib_accessor_class_spectral_truncation_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_spectral_truncation_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_spectral_truncation_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_spectral_truncation_h */ diff --git a/src/accessor/grib_accessor_class_sprintf.h.bak b/src/accessor/grib_accessor_class_sprintf.h.bak deleted file mode 100644 index 9bfb1c83e..000000000 --- a/src/accessor/grib_accessor_class_sprintf.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_sprintf_h -#define eccodes_accessor_sprintf_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_ascii.h" - -class grib_accessor_sprintf_t : public grib_accessor_ascii_t -{ -public: - /* Members defined in sprintf */ - grib_arguments* args; -}; - -class grib_accessor_class_sprintf_t : public grib_accessor_class_ascii_t -{ -public: - grib_accessor_class_sprintf_t(const char* name) : grib_accessor_class_ascii_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_sprintf_t{}; } - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_sprintf_h */ diff --git a/src/accessor/grib_accessor_class_statistics.h.bak b/src/accessor/grib_accessor_class_statistics.h.bak deleted file mode 100644 index 4eea0b546..000000000 --- a/src/accessor/grib_accessor_class_statistics.h.bak +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_statistics_h -#define eccodes_accessor_statistics_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_abstract_vector.h" - -class grib_accessor_statistics_t : public grib_accessor_abstract_vector_t -{ -public: - /* Members defined in statistics */ - const char* values; - const char* missing_value; -}; - -class grib_accessor_class_statistics_t : public grib_accessor_class_abstract_vector_t -{ -public: - grib_accessor_class_statistics_t(const char* name) : grib_accessor_class_abstract_vector_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_statistics_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_statistics_h */ diff --git a/src/accessor/grib_accessor_class_statistics_spectral.h.bak b/src/accessor/grib_accessor_class_statistics_spectral.h.bak deleted file mode 100644 index 8075ddf31..000000000 --- a/src/accessor/grib_accessor_class_statistics_spectral.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_statistics_spectral_h -#define eccodes_accessor_statistics_spectral_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_abstract_vector.h" - -class grib_accessor_statistics_spectral_t : public grib_accessor_abstract_vector_t -{ -public: - /* Members defined in statistics_spectral */ - const char* values; - const char* J; - const char* K; - const char* M; - const char* JS; -}; - -class grib_accessor_class_statistics_spectral_t : public grib_accessor_class_abstract_vector_t -{ -public: - grib_accessor_class_statistics_spectral_t(const char* name) : grib_accessor_class_abstract_vector_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_statistics_spectral_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_statistics_spectral_h */ diff --git a/src/accessor/grib_accessor_class_step_human_readable.h.bak b/src/accessor/grib_accessor_class_step_human_readable.h.bak deleted file mode 100644 index 793ecb618..000000000 --- a/src/accessor/grib_accessor_class_step_human_readable.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_step_human_readable_h -#define eccodes_accessor_step_human_readable_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_step_human_readable_t : public grib_accessor_gen_t -{ -public: - /* Members defined in step_human_readable */ - const char* stepUnits; - const char* step; -}; - -class grib_accessor_class_step_human_readable_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_step_human_readable_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_step_human_readable_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_step_human_readable_h */ diff --git a/src/accessor/grib_accessor_class_step_in_units.h.bak b/src/accessor/grib_accessor_class_step_in_units.h.bak deleted file mode 100644 index ba088db79..000000000 --- a/src/accessor/grib_accessor_class_step_in_units.h.bak +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_step_in_units_h -#define eccodes_accessor_step_in_units_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_step_in_units_t : public grib_accessor_long_t -{ -public: - /* Members defined in step_in_units */ - const char* forecast_time_value; - const char* forecast_time_unit; - const char* step_units; - const char* time_range_unit; - const char* time_range_value; -}; - -class grib_accessor_class_step_in_units_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_step_in_units_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_step_in_units_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_step_in_units_h */ diff --git a/src/accessor/grib_accessor_class_sum.h.bak b/src/accessor/grib_accessor_class_sum.h.bak deleted file mode 100644 index ceedb788a..000000000 --- a/src/accessor/grib_accessor_class_sum.h.bak +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_sum_h -#define eccodes_accessor_sum_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_double.h" - -class grib_accessor_sum_t : public grib_accessor_double_t -{ -public: - /* Members defined in sum */ - const char* values; -}; - -class grib_accessor_class_sum_t : public grib_accessor_class_double_t -{ -public: - grib_accessor_class_sum_t(const char* name) : grib_accessor_class_double_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_sum_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_sum_h */ diff --git a/src/accessor/grib_accessor_class_suppressed.h.bak b/src/accessor/grib_accessor_class_suppressed.h.bak deleted file mode 100644 index c8a93274e..000000000 --- a/src/accessor/grib_accessor_class_suppressed.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_suppressed_h -#define eccodes_accessor_suppressed_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_suppressed_t : public grib_accessor_long_t -{ -public: - /* Members defined in suppressed */ - grib_arguments* args; -}; - -class grib_accessor_class_suppressed_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_suppressed_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_suppressed_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_suppressed_h */ diff --git a/src/accessor/grib_accessor_class_time.h.bak b/src/accessor/grib_accessor_class_time.h.bak deleted file mode 100644 index b1826e1d6..000000000 --- a/src/accessor/grib_accessor_class_time.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_time_h -#define eccodes_accessor_time_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_time_t : public grib_accessor_long_t -{ -public: - /* Members defined in time */ - const char* hour; - const char* minute; - const char* second; -}; - -class grib_accessor_class_time_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_time_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_time_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_time_h */ diff --git a/src/accessor/grib_accessor_class_to_double.h.bak b/src/accessor/grib_accessor_class_to_double.h.bak deleted file mode 100644 index a2010cc1e..000000000 --- a/src/accessor/grib_accessor_class_to_double.h.bak +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_to_double_h -#define eccodes_accessor_to_double_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_to_double_t : public grib_accessor_gen_t -{ -public: - /* Members defined in to_double */ - const char* key; - long start; - size_t length; - long scale; -}; - -class grib_accessor_class_to_double_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_to_double_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_to_double_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_to_double_h */ diff --git a/src/accessor/grib_accessor_class_to_integer.h.bak b/src/accessor/grib_accessor_class_to_integer.h.bak deleted file mode 100644 index 3ee9dd87b..000000000 --- a/src/accessor/grib_accessor_class_to_integer.h.bak +++ /dev/null @@ -1,45 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_to_integer_h -#define eccodes_accessor_to_integer_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_to_integer_t : public grib_accessor_gen_t -{ -public: - /* Members defined in to_integer */ - const char* key; - long start; - size_t length; -}; - -class grib_accessor_class_to_integer_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_to_integer_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_to_integer_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_to_integer_h */ diff --git a/src/accessor/grib_accessor_class_to_string.h.bak b/src/accessor/grib_accessor_class_to_string.h.bak deleted file mode 100644 index 0907cb82c..000000000 --- a/src/accessor/grib_accessor_class_to_string.h.bak +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_to_string_h -#define eccodes_accessor_to_string_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_to_string_t : public grib_accessor_gen_t -{ -public: - /* Members defined in to_string */ - const char* key; - long start; - size_t length; -}; - -class grib_accessor_class_to_string_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_to_string_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_to_string_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_to_string_h */ diff --git a/src/accessor/grib_accessor_class_transient.h.bak b/src/accessor/grib_accessor_class_transient.h.bak deleted file mode 100644 index e330ad686..000000000 --- a/src/accessor/grib_accessor_class_transient.h.bak +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (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. - */ - -#pragma once - -#include "grib_accessor_class_variable.h" - -class grib_accessor_transient_t : public grib_accessor_variable_t { -public: -}; - -class grib_accessor_class_transient_t : public grib_accessor_class_variable_t { -public: - void init(grib_accessor* a, const long l, grib_arguments* args) override; - grib_accessor_class_transient_t(const char* name) : grib_accessor_class_variable_t(name) {}; - grib_accessor* create_empty_accessor() override { return new grib_accessor_transient_t{}; } -}; - diff --git a/src/accessor/grib_accessor_class_transient_darray.h.bak b/src/accessor/grib_accessor_class_transient_darray.h.bak deleted file mode 100644 index fe918bd55..000000000 --- a/src/accessor/grib_accessor_class_transient_darray.h.bak +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_transient_darray_h -#define eccodes_accessor_transient_darray_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_transient_darray_t : public grib_accessor_gen_t -{ -public: - /* Members defined in transient_darray */ - grib_darray* arr; - int type; -}; - -class grib_accessor_class_transient_darray_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_transient_darray_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_transient_darray_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_transient_darray_h */ diff --git a/src/accessor/grib_accessor_class_trim.h.bak b/src/accessor/grib_accessor_class_trim.h.bak deleted file mode 100644 index 664ccc528..000000000 --- a/src/accessor/grib_accessor_class_trim.h.bak +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_trim_h -#define eccodes_accessor_trim_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_ascii.h" - -class grib_accessor_trim_t : public grib_accessor_ascii_t -{ -public: - /* Members defined in trim */ - const char* input; - int trim_left; - int trim_right; -}; - -class grib_accessor_class_trim_t : public grib_accessor_class_ascii_t -{ -public: - grib_accessor_class_trim_t(const char* name) : grib_accessor_class_ascii_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_trim_t{}; } - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_trim_h */ diff --git a/src/accessor/grib_accessor_class_uint16.h.bak b/src/accessor/grib_accessor_class_uint16.h.bak deleted file mode 100644 index 0952e2d57..000000000 --- a/src/accessor/grib_accessor_class_uint16.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_uint16_h -#define eccodes_accessor_uint16_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_uint16_t : public grib_accessor_gen_t -{ -public: - /* Members defined in uint16 */ -}; - -class grib_accessor_class_uint16_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_uint16_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_uint16_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; -}; -#endif /* eccodes_accessor_uint16_h */ diff --git a/src/accessor/grib_accessor_class_uint32.h.bak b/src/accessor/grib_accessor_class_uint32.h.bak deleted file mode 100644 index 0cf8a0bd9..000000000 --- a/src/accessor/grib_accessor_class_uint32.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_uint32_h -#define eccodes_accessor_uint32_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_uint32_t : public grib_accessor_gen_t -{ -public: - /* Members defined in uint32 */ -}; - -class grib_accessor_class_uint32_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_uint32_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_uint32_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; -}; -#endif /* eccodes_accessor_uint32_h */ diff --git a/src/accessor/grib_accessor_class_uint32_little_endian.h.bak b/src/accessor/grib_accessor_class_uint32_little_endian.h.bak deleted file mode 100644 index 357791081..000000000 --- a/src/accessor/grib_accessor_class_uint32_little_endian.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_uint32_little_endian_h -#define eccodes_accessor_uint32_little_endian_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_uint32_little_endian_t : public grib_accessor_gen_t -{ -public: - /* Members defined in uint32_little_endian */ -}; - -class grib_accessor_class_uint32_little_endian_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_uint32_little_endian_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_uint32_little_endian_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; -}; -#endif /* eccodes_accessor_uint32_little_endian_h */ diff --git a/src/accessor/grib_accessor_class_uint64.h.bak b/src/accessor/grib_accessor_class_uint64.h.bak deleted file mode 100644 index 55215c77f..000000000 --- a/src/accessor/grib_accessor_class_uint64.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_uint64_h -#define eccodes_accessor_uint64_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_uint64_t : public grib_accessor_gen_t -{ -public: - /* Members defined in uint64 */ -}; - -class grib_accessor_class_uint64_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_uint64_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_uint64_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; -}; -#endif /* eccodes_accessor_uint64_h */ diff --git a/src/accessor/grib_accessor_class_uint64_little_endian.h.bak b/src/accessor/grib_accessor_class_uint64_little_endian.h.bak deleted file mode 100644 index 8c04a5398..000000000 --- a/src/accessor/grib_accessor_class_uint64_little_endian.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_uint64_little_endian_h -#define eccodes_accessor_uint64_little_endian_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_uint64_little_endian_t : public grib_accessor_gen_t -{ -public: - /* Members defined in uint64_little_endian */ -}; - -class grib_accessor_class_uint64_little_endian_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_uint64_little_endian_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_uint64_little_endian_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; -}; -#endif /* eccodes_accessor_uint64_little_endian_h */ diff --git a/src/accessor/grib_accessor_class_uint8.h.bak b/src/accessor/grib_accessor_class_uint8.h.bak deleted file mode 100644 index 04dcb1075..000000000 --- a/src/accessor/grib_accessor_class_uint8.h.bak +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_uint8_h -#define eccodes_accessor_uint8_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_uint8_t : public grib_accessor_gen_t -{ -public: - /* Members defined in uint8 */ -}; - -class grib_accessor_class_uint8_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_uint8_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_uint8_t{}; } - int get_native_type(grib_accessor*) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; -}; -#endif /* eccodes_accessor_uint8_h */ diff --git a/src/accessor/grib_accessor_class_unexpanded_descriptors.h.bak b/src/accessor/grib_accessor_class_unexpanded_descriptors.h.bak deleted file mode 100644 index 2db5b51b3..000000000 --- a/src/accessor/grib_accessor_class_unexpanded_descriptors.h.bak +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_unexpanded_descriptors_h -#define eccodes_accessor_unexpanded_descriptors_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_unexpanded_descriptors_t : public grib_accessor_long_t -{ -public: - /* Members defined in unexpanded_descriptors */ - grib_accessor* unexpandedDescriptorsEncoded; - const char* createNewData; -}; - -class grib_accessor_class_unexpanded_descriptors_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_unexpanded_descriptors_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_unexpanded_descriptors_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - long byte_offset(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; -}; -#endif /* eccodes_accessor_unexpanded_descriptors_h */ diff --git a/src/accessor/grib_accessor_class_unpack_bufr_values.h.bak b/src/accessor/grib_accessor_class_unpack_bufr_values.h.bak deleted file mode 100644 index 0eea70de4..000000000 --- a/src/accessor/grib_accessor_class_unpack_bufr_values.h.bak +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_unpack_bufr_values_h -#define eccodes_accessor_unpack_bufr_values_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_unpack_bufr_values_t : public grib_accessor_gen_t -{ -public: - /* Members defined in unpack_bufr_values */ - grib_accessor* data_accessor; -}; - -class grib_accessor_class_unpack_bufr_values_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_unpack_bufr_values_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_unpack_bufr_values_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - int unpack_string_array(grib_accessor*, char**, size_t* len) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_unpack_bufr_values_h */ diff --git a/src/accessor/grib_accessor_class_unsigned.h.bak b/src/accessor/grib_accessor_class_unsigned.h.bak deleted file mode 100644 index 0523974ca..000000000 --- a/src/accessor/grib_accessor_class_unsigned.h.bak +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (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. - */ - -#pragma once - -#include "grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_unsigned_t : public grib_accessor_long_t -{ -public: - long nbytes; - grib_arguments* arg; -}; - - -class grib_accessor_class_unsigned_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_unsigned_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_unsigned_t{}; } - void init(grib_accessor* a, const long len, grib_arguments* arg) override; - void dump(grib_accessor* a, grib_dumper* dumper) override; - int unpack_long(grib_accessor* a, long* val, size_t* len) override; - int pack_long(grib_accessor* a, const long* val, size_t* len) override; - long byte_count(grib_accessor* a) override; - int value_count(grib_accessor* a, long* len) override; - long byte_offset(grib_accessor* a) override; - void update_size(grib_accessor* a, size_t s) override; - long next_offset(grib_accessor* a) override; - int is_missing(grib_accessor* a) override; - void destroy(grib_context* context, grib_accessor* a) override; -}; diff --git a/src/accessor/grib_accessor_class_unsigned_bits.h.bak b/src/accessor/grib_accessor_class_unsigned_bits.h.bak deleted file mode 100644 index 62ae48e60..000000000 --- a/src/accessor/grib_accessor_class_unsigned_bits.h.bak +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_unsigned_bits_h -#define eccodes_accessor_unsigned_bits_h - -#include "../grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_unsigned_bits_t : public grib_accessor_long_t -{ -public: - /* Members defined in unsigned_bits */ - const char* numberOfBits; - const char* numberOfElements; -}; - -class grib_accessor_class_unsigned_bits_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_unsigned_bits_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_unsigned_bits_t{}; } - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - long byte_count(grib_accessor*) override; - long byte_offset(grib_accessor*) override; - long next_offset(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; -}; -#endif /* eccodes_accessor_unsigned_bits_h */ diff --git a/src/accessor/grib_accessor_class_validity_date.h.bak b/src/accessor/grib_accessor_class_validity_date.h.bak deleted file mode 100644 index dfd8eb320..000000000 --- a/src/accessor/grib_accessor_class_validity_date.h.bak +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_validity_date_h -#define eccodes_accessor_validity_date_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_validity_date_t : public grib_accessor_long_t -{ -public: - /* Members defined in validity_date */ - const char* date; - const char* time; - const char* step; - const char* stepUnits; - const char* year; - const char* month; - const char* day; -}; - -class grib_accessor_class_validity_date_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_validity_date_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_validity_date_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_validity_date_h */ diff --git a/src/accessor/grib_accessor_class_validity_time.h.bak b/src/accessor/grib_accessor_class_validity_time.h.bak deleted file mode 100644 index 3f7c27f7b..000000000 --- a/src/accessor/grib_accessor_class_validity_time.h.bak +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_validity_time_h -#define eccodes_accessor_validity_time_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_long.h" - -class grib_accessor_validity_time_t : public grib_accessor_long_t -{ -public: - /* Members defined in validity_time */ - const char* date; - const char* time; - const char* step; - const char* stepUnits; - const char* hours; - const char* minutes; -}; - -class grib_accessor_class_validity_time_t : public grib_accessor_class_long_t -{ -public: - grib_accessor_class_validity_time_t(const char* name) : grib_accessor_class_long_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_validity_time_t{}; } - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_validity_time_h */ diff --git a/src/accessor/grib_accessor_class_values.h.bak b/src/accessor/grib_accessor_class_values.h.bak deleted file mode 100644 index c7cbf54e7..000000000 --- a/src/accessor/grib_accessor_class_values.h.bak +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (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. - */ - -#ifndef eccodes_accessor_values_h -#define eccodes_accessor_values_h - -#include "grib_accessor_class_gen.h" - -class grib_accessor_values_t : public grib_accessor_gen_t -{ -public: - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -}; - -class grib_accessor_class_values_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_values_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_values_t{}; } - int get_native_type(grib_accessor*) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - long byte_count(grib_accessor*) override; - long byte_offset(grib_accessor*) override; - long next_offset(grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - void update_size(grib_accessor*, size_t) override; - int compare(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_values_h */ diff --git a/src/accessor/grib_accessor_class_variable.h.bak b/src/accessor/grib_accessor_class_variable.h.bak deleted file mode 100644 index 90ff71238..000000000 --- a/src/accessor/grib_accessor_class_variable.h.bak +++ /dev/null @@ -1,49 +0,0 @@ -/* - * (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. - */ - -#pragma once - -#include "grib_accessor.h" -#include "grib_accessor_class_gen.h" - - -class grib_accessor_variable_t : public grib_accessor_gen_t -{ -public: - double dval; - float fval; - char* cval; - char* cname; - int type; -}; - -class grib_accessor_class_variable_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_variable_t(const char* name) : grib_accessor_class_gen_t(name) {}; - grib_accessor* create_empty_accessor() override { return new grib_accessor_variable_t{}; } - int get_native_type(grib_accessor*) override; - int pack_double(grib_accessor*, const double* val, size_t* len) override; - int pack_float(grib_accessor*, const float* val, size_t* len) override; - int pack_long(grib_accessor*, const long* val, size_t* len) override; - int pack_string(grib_accessor*, const char*, size_t* len) override; - int unpack_double(grib_accessor*, double* val, size_t* len) override; - int unpack_float(grib_accessor*, float* val, size_t* len) override; - int unpack_long(grib_accessor*, long* val, size_t* len) override; - int unpack_string(grib_accessor*, char*, size_t* len) override; - size_t string_length(grib_accessor*) override; - long byte_count(grib_accessor*) override; - int value_count(grib_accessor*, long*) override; - void destroy(grib_context*, grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int compare(grib_accessor*, grib_accessor*) override; - grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; -}; diff --git a/src/accessor/grib_accessor_class_vector.h.bak b/src/accessor/grib_accessor_class_vector.h.bak deleted file mode 100644 index 671441001..000000000 --- a/src/accessor/grib_accessor_class_vector.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_vector_h -#define eccodes_accessor_vector_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_abstract_vector.h" - -class grib_accessor_vector_t : public grib_accessor_abstract_vector_t -{ -public: - /* Members defined in vector */ - const char* vector; - int index; -}; - -class grib_accessor_class_vector_t : public grib_accessor_class_abstract_vector_t -{ -public: - grib_accessor_class_vector_t(const char* name) : grib_accessor_class_abstract_vector_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_vector_t{}; } - int unpack_double(grib_accessor*, double* val, size_t* len) override; - void init(grib_accessor*, const long, grib_arguments*) override; -}; -#endif /* eccodes_accessor_vector_h */ diff --git a/src/accessor/grib_accessor_class_when.h.bak b/src/accessor/grib_accessor_class_when.h.bak deleted file mode 100644 index b2ddcc0b0..000000000 --- a/src/accessor/grib_accessor_class_when.h.bak +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * (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. - */ - -#ifndef eccodes_accessor_when_h -#define eccodes_accessor_when_h - -#include "grib_api_internal.h" -#include "grib_accessor_class_gen.h" - -class grib_accessor_when_t : public grib_accessor_gen_t -{ -public: - /* Members defined in when */ -}; - -class grib_accessor_class_when_t : public grib_accessor_class_gen_t -{ -public: - grib_accessor_class_when_t(const char* name) : grib_accessor_class_gen_t(name) {} - grib_accessor* create_empty_accessor() override { return new grib_accessor_when_t{}; } - int get_native_type(grib_accessor*) override; - void dump(grib_accessor*, grib_dumper*) override; - void init(grib_accessor*, const long, grib_arguments*) override; - int notify_change(grib_accessor*, grib_accessor*) override; -}; -#endif /* eccodes_accessor_when_h */ diff --git a/src/accessor/grib_accessors_list.cc b/src/accessor/grib_accessors_list.cc index 935516964..3ff166e42 100644 --- a/src/accessor/grib_accessors_list.cc +++ b/src/accessor/grib_accessors_list.cc @@ -1,3 +1,12 @@ +/* + * (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 "grib_accessors_list.h" diff --git a/src/accessor/grib_accessors_list.h b/src/accessor/grib_accessors_list.h index 0ec5798a4..3c5cc2ebe 100644 --- a/src/accessor/grib_accessors_list.h +++ b/src/accessor/grib_accessors_list.h @@ -1,3 +1,13 @@ +/* + * (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. + */ + #pragma once #include "grib_accessor.h" From 78578782f7892f1945a7159eeada78a10066c26f Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 27 Apr 2024 14:27:04 +0100 Subject: [PATCH 088/196] Remove unnecessary header files --- ...rib_accessor_class_abstract_long_vector.cc | 2 - .../grib_accessor_class_abstract_vector.cc | 2 - src/accessor/grib_accessor_class_ascii.cc | 1 - src/accessor/grib_accessor_class_bit.cc | 22 ++-- src/accessor/grib_accessor_class_bitmap.cc | 1 - src/accessor/grib_accessor_class_bits.cc | 1 - .../grib_accessor_class_bits_per_value.cc | 1 - src/accessor/grib_accessor_class_blob.cc | 1 - src/accessor/grib_accessor_class_budgdate.cc | 1 - .../grib_accessor_class_bufr_data_array.cc | 1 - ...grib_accessor_class_bufr_elements_table.cc | 2 - ...ccessor_class_bufr_extract_area_subsets.cc | 1 - ...sor_class_bufr_extract_datetime_subsets.cc | 1 - ...rib_accessor_class_bufr_extract_subsets.cc | 1 - .../grib_accessor_class_bufr_group.cc | 1 - ...rib_accessor_class_bufr_simple_thinning.cc | 1 - .../grib_accessor_class_bufr_string_values.cc | 1 - ...essor_class_bufrdc_expanded_descriptors.cc | 1 - src/accessor/grib_accessor_class_bytes.cc | 1 - ...r_class_change_alternative_row_scanning.cc | 1 - ...ccessor_class_change_scanning_direction.cc | 1 - ...b_accessor_class_check_internal_version.cc | 1 - .../grib_accessor_class_closest_date.cc | 1 - src/accessor/grib_accessor_class_codeflag.cc | 1 - src/accessor/grib_accessor_class_codetable.cc | 4 - .../grib_accessor_class_codetable_title.cc | 1 - .../grib_accessor_class_codetable_units.cc | 1 - src/accessor/grib_accessor_class_concept.cc | 1 - .../grib_accessor_class_count_file.cc | 1 - .../grib_accessor_class_count_missing.cc | 1 - .../grib_accessor_class_count_total.cc | 1 - .../grib_accessor_class_data_apply_bitmap.cc | 1 - ...cessor_class_data_apply_boustrophedonic.cc | 1 - ...class_data_apply_boustrophedonic_bitmap.cc | 1 - .../grib_accessor_class_data_dummy_field.cc | 1 - ...b_accessor_class_data_g1complex_packing.cc | 1 - ...a_g1second_order_constant_width_packing.cc | 1 - ...g1second_order_general_extended_packing.cc | 1 - ..._accessor_class_data_g1secondary_bitmap.cc | 1 - ..._accessor_class_data_g1shsimple_packing.cc | 1 - ...ib_accessor_class_data_g1simple_packing.cc | 1 - ...accessor_class_data_g2bifourier_packing.cc | 1 - ...b_accessor_class_data_g2complex_packing.cc | 1 - ..._accessor_class_data_g2secondary_bitmap.cc | 1 - ..._accessor_class_data_g2shsimple_packing.cc | 1 - ...ib_accessor_class_data_g2simple_packing.cc | 1 - ...ata_g2simple_packing_with_preprocessing.cc | 1 - ...ib_accessor_class_data_jpeg2000_packing.cc | 1 - .../grib_accessor_class_data_raw_packing.cc | 1 - ..._accessor_class_data_run_length_packing.cc | 1 - ...ib_accessor_class_data_secondary_bitmap.cc | 1 - .../grib_accessor_class_data_sh_packed.cc | 1 - .../grib_accessor_class_data_sh_unpacked.cc | 1 - ...ib_accessor_class_data_shsimple_packing.cc | 1 - .../grib_accessor_class_decimal_precision.cc | 1 - .../grib_accessor_class_dictionary.cc | 1 - src/accessor/grib_accessor_class_dirty.cc | 1 - src/accessor/grib_accessor_class_divdouble.cc | 1 - src/accessor/grib_accessor_class_double.cc | 1 - src/accessor/grib_accessor_class_element.cc | 1 - src/accessor/grib_accessor_class_evaluate.cc | 1 - ...rib_accessor_class_expanded_descriptors.cc | 1 - ...or_class_from_scale_factor_scaled_value.cc | 1 - ...ib_accessor_class_g1_half_byte_codeflag.cc | 1 - .../grib_accessor_class_g1_message_length.cc | 1 - .../grib_accessor_class_g1_section4_length.cc | 1 - src/accessor/grib_accessor_class_g1bitmap.cc | 1 - src/accessor/grib_accessor_class_g1date.cc | 1 - ...b_accessor_class_g1day_of_the_year_date.cc | 1 - ...ccessor_class_g1end_of_interval_monthly.cc | 1 - .../grib_accessor_class_g1fcperiod.cc | 1 - .../grib_accessor_class_g1forecastmonth.cc | 1 - .../grib_accessor_class_g1monthlydate.cc | 1 - ...ass_g1number_of_coded_values_sh_complex.cc | 1 - ...lass_g1number_of_coded_values_sh_simple.cc | 1 - .../grib_accessor_class_g1step_range.cc | 1 - .../grib_accessor_class_g1verificationdate.cc | 1 - .../grib_accessor_class_g2_aerosol.cc | 1 - .../grib_accessor_class_g2_chemical.cc | 1 - src/accessor/grib_accessor_class_g2_eps.cc | 1 - .../grib_accessor_class_g2_mars_labeling.cc | 1 - src/accessor/grib_accessor_class_g2bitmap.cc | 1 - .../grib_accessor_class_g2bitmap_present.cc | 1 - src/accessor/grib_accessor_class_g2date.cc | 1 - .../grib_accessor_class_g2end_step.cc | 1 - src/accessor/grib_accessor_class_g2grid.cc | 40 ++++--- src/accessor/grib_accessor_class_g2latlon.cc | 34 +++--- src/accessor/grib_accessor_class_g2level.cc | 106 ++++++++++-------- src/accessor/grib_accessor_class_g2lon.cc | 16 +-- .../grib_accessor_class_gaussian_grid_name.cc | 17 +-- .../grib_accessor_class_gds_is_present.cc | 40 +++---- ...b_accessor_class_gds_not_present_bitmap.cc | 5 +- .../grib_accessor_class_global_gaussian.cc | 1 - src/accessor/grib_accessor_class_group.cc | 1 - .../grib_accessor_class_gts_header.cc | 1 - .../grib_accessor_class_hash_array.cc | 1 - .../grib_accessor_class_headers_only.cc | 1 - src/accessor/grib_accessor_class_ibmfloat.cc | 1 - src/accessor/grib_accessor_class_ieeefloat.cc | 1 - src/accessor/grib_accessor_class_ifs_param.cc | 1 - src/accessor/grib_accessor_class_iterator.cc | 5 - .../grib_accessor_class_julian_date.cc | 1 - .../grib_accessor_class_julian_day.cc | 1 - .../grib_accessor_class_ksec1expver.cc | 1 - src/accessor/grib_accessor_class_label.cc | 1 - src/accessor/grib_accessor_class_latitudes.cc | 54 ++++----- .../grib_accessor_class_latlon_increment.cc | 1 - .../grib_accessor_class_latlonvalues.cc | 1 - .../grib_accessor_class_library_version.cc | 1 - .../grib_accessor_class_local_definition.cc | 1 - .../grib_accessor_class_long_vector.cc | 1 - .../grib_accessor_class_longitudes.cc | 1 - src/accessor/grib_accessor_class_lookup.cc | 1 - .../grib_accessor_class_mars_param.cc | 1 - src/accessor/grib_accessor_class_mars_step.cc | 1 - src/accessor/grib_accessor_class_md5.cc | 31 +++-- src/accessor/grib_accessor_class_message.cc | 1 - .../grib_accessor_class_message_copy.cc | 1 - .../grib_accessor_class_multdouble.cc | 1 - src/accessor/grib_accessor_class_non_alpha.cc | 1 - ...b_accessor_class_number_of_coded_values.cc | 1 - .../grib_accessor_class_number_of_points.cc | 1 - ...ccessor_class_number_of_points_gaussian.cc | 1 - .../grib_accessor_class_number_of_values.cc | 1 - ...class_number_of_values_data_raw_packing.cc | 1 - ...grib_accessor_class_octahedral_gaussian.cc | 1 - .../grib_accessor_class_octet_number.cc | 1 - .../grib_accessor_class_offset_file.cc | 1 - .../grib_accessor_class_offset_values.cc | 1 - .../grib_accessor_class_optimal_step_units.cc | 1 - .../grib_accessor_class_pack_bufr_values.cc | 1 - .../grib_accessor_class_packing_type.cc | 1 - src/accessor/grib_accessor_class_pad.cc | 1 - src/accessor/grib_accessor_class_padding.cc | 1 - src/accessor/grib_accessor_class_padto.cc | 1 - src/accessor/grib_accessor_class_padtoeven.cc | 1 - .../grib_accessor_class_padtomultiple.cc | 1 - src/accessor/grib_accessor_class_position.cc | 1 - .../grib_accessor_class_proj_string.cc | 1 - src/accessor/grib_accessor_class_raw.cc | 1 - .../grib_accessor_class_rdbtime_guess_date.cc | 1 - ...ib_accessor_class_reference_value_error.cc | 1 - src/accessor/grib_accessor_class_round.cc | 1 - src/accessor/grib_accessor_class_scale.cc | 1 - .../grib_accessor_class_scale_values.cc | 1 - ...essor_class_second_order_bits_per_value.cc | 1 - .../grib_accessor_class_section_length.cc | 1 - .../grib_accessor_class_section_padding.cc | 1 - .../grib_accessor_class_section_pointer.cc | 1 - ...rib_accessor_class_select_step_template.cc | 1 - ...grib_accessor_class_sexagesimal2decimal.cc | 1 - src/accessor/grib_accessor_class_signed.cc | 1 - .../grib_accessor_class_signed_bits.cc | 1 - ...rib_accessor_class_simple_packing_error.cc | 1 - src/accessor/grib_accessor_class_size.cc | 1 - .../grib_accessor_class_smart_table.cc | 4 - .../grib_accessor_class_smart_table_column.cc | 1 - src/accessor/grib_accessor_class_spd.cc | 1 - ...grib_accessor_class_spectral_truncation.cc | 1 - src/accessor/grib_accessor_class_sprintf.cc | 1 - .../grib_accessor_class_statistics.cc | 1 - ...grib_accessor_class_statistics_spectral.cc | 1 - ...grib_accessor_class_step_human_readable.cc | 1 - .../grib_accessor_class_step_in_units.cc | 1 - src/accessor/grib_accessor_class_sum.cc | 1 - .../grib_accessor_class_suppressed.cc | 1 - src/accessor/grib_accessor_class_time.cc | 1 - src/accessor/grib_accessor_class_to_double.cc | 1 - .../grib_accessor_class_to_integer.cc | 1 - src/accessor/grib_accessor_class_to_string.cc | 1 - .../grib_accessor_class_transient_darray.cc | 1 - src/accessor/grib_accessor_class_trim.cc | 1 - src/accessor/grib_accessor_class_uint16.cc | 1 - src/accessor/grib_accessor_class_uint32.cc | 1 - ...rib_accessor_class_uint32_little_endian.cc | 1 - src/accessor/grib_accessor_class_uint64.cc | 1 - ...rib_accessor_class_uint64_little_endian.cc | 1 - src/accessor/grib_accessor_class_uint8.cc | 1 - ...b_accessor_class_unexpanded_descriptors.cc | 1 - .../grib_accessor_class_unpack_bufr_values.cc | 4 - .../grib_accessor_class_unsigned_bits.cc | 1 - .../grib_accessor_class_validity_date.cc | 1 - .../grib_accessor_class_validity_time.cc | 1 - src/accessor/grib_accessor_class_values.cc | 1 - src/accessor/grib_accessor_class_vector.cc | 1 - src/accessor/grib_accessor_class_when.cc | 1 - 186 files changed, 202 insertions(+), 355 deletions(-) diff --git a/src/accessor/grib_accessor_class_abstract_long_vector.cc b/src/accessor/grib_accessor_class_abstract_long_vector.cc index ad0740841..0f4514aa1 100644 --- a/src/accessor/grib_accessor_class_abstract_long_vector.cc +++ b/src/accessor/grib_accessor_class_abstract_long_vector.cc @@ -9,9 +9,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_abstract_long_vector.h" grib_accessor_class_abstract_long_vector_t _grib_accessor_class_abstract_long_vector{"abstract_long_vector"}; grib_accessor_class* grib_accessor_class_abstract_long_vector = &_grib_accessor_class_abstract_long_vector; - diff --git a/src/accessor/grib_accessor_class_abstract_vector.cc b/src/accessor/grib_accessor_class_abstract_vector.cc index 692e9c404..2ee141e8f 100644 --- a/src/accessor/grib_accessor_class_abstract_vector.cc +++ b/src/accessor/grib_accessor_class_abstract_vector.cc @@ -9,9 +9,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_abstract_vector.h" grib_accessor_class_abstract_vector_t _grib_accessor_class_abstract_vector{"abstract_vector"}; grib_accessor_class* grib_accessor_class_abstract_vector = &_grib_accessor_class_abstract_vector; - diff --git a/src/accessor/grib_accessor_class_ascii.cc b/src/accessor/grib_accessor_class_ascii.cc index 2c824fe29..f45053267 100644 --- a/src/accessor/grib_accessor_class_ascii.cc +++ b/src/accessor/grib_accessor_class_ascii.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" grib_accessor_class_ascii_t _grib_accessor_class_ascii{"ascii"}; diff --git a/src/accessor/grib_accessor_class_bit.cc b/src/accessor/grib_accessor_class_bit.cc index ef30efe24..c1efac202 100644 --- a/src/accessor/grib_accessor_class_bit.cc +++ b/src/accessor/grib_accessor_class_bit.cc @@ -9,25 +9,26 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bit.h" -grib_accessor_class_bit_t _grib_accessor_class_bit{"bit"}; +grib_accessor_class_bit_t _grib_accessor_class_bit{ "bit" }; grib_accessor_class* grib_accessor_class_bit = &_grib_accessor_class_bit; -void grib_accessor_class_bit_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_bit_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_long_t::init(a, len, arg); grib_accessor_bit_t* self = (grib_accessor_bit_t*)a; - a->length = 0; + a->length = 0; self->owner = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); self->bit_index = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); } -int grib_accessor_class_bit_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_bit_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_bit_t* self = (grib_accessor_bit_t*)a; - int ret = 0; - long data = 0; + int ret = 0; + long data = 0; if (*len < 1) { grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit_t: unpack_long: Wrong size for %s, it contains %d values ", a->name, 1); @@ -49,7 +50,8 @@ int grib_accessor_class_bit_t::unpack_long(grib_accessor* a, long* val, size_t* return GRIB_SUCCESS; } -int grib_accessor_class_bit_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_bit_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_bit_t* self = (grib_accessor_bit_t*)a; if (*len < 1) { @@ -61,7 +63,7 @@ int grib_accessor_class_bit_t::pack_long(grib_accessor* a, const long* val, size grib_accessor* owner = grib_find_accessor(grib_handle_of_accessor(a), self->owner); if (!owner) { grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit_t: Cannot get the owner %s for computing the bit value of %s", - self->owner, a->name); + self->owner, a->name); *len = 0; return GRIB_NOT_FOUND; } @@ -71,7 +73,7 @@ int grib_accessor_class_bit_t::pack_long(grib_accessor* a, const long* val, size /* Note: In the definitions, flagbit numbers go from 7 to 0 (the bit_index), while WMO convention is from 1 to 8 */ if (a->context->debug) { /* Print bit positions from 1 (MSB) */ - fprintf(stderr, "ECCODES DEBUG Setting bit %d in %s to %d\n", 8 - self->bit_index, owner->name, (*val > 0) ); + fprintf(stderr, "ECCODES DEBUG Setting bit %d in %s to %d\n", 8 - self->bit_index, owner->name, (*val > 0)); } grib_set_bit(mdata, 7 - self->bit_index, *val > 0); diff --git a/src/accessor/grib_accessor_class_bitmap.cc b/src/accessor/grib_accessor_class_bitmap.cc index a2d659f65..e507d021b 100644 --- a/src/accessor/grib_accessor_class_bitmap.cc +++ b/src/accessor/grib_accessor_class_bitmap.cc @@ -9,7 +9,6 @@ * 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" grib_accessor_class_bitmap_t _grib_accessor_class_bitmap{"bitmap"}; diff --git a/src/accessor/grib_accessor_class_bits.cc b/src/accessor/grib_accessor_class_bits.cc index d5d1f248c..e0a9e7d8d 100644 --- a/src/accessor/grib_accessor_class_bits.cc +++ b/src/accessor/grib_accessor_class_bits.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bits.h" grib_accessor_class_bits_t _grib_accessor_class_bits{"bits"}; diff --git a/src/accessor/grib_accessor_class_bits_per_value.cc b/src/accessor/grib_accessor_class_bits_per_value.cc index 51403f855..590c48d89 100644 --- a/src/accessor/grib_accessor_class_bits_per_value.cc +++ b/src/accessor/grib_accessor_class_bits_per_value.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bits_per_value.h" grib_accessor_class_bits_per_value_t _grib_accessor_class_bits_per_value{"bits_per_value"}; diff --git a/src/accessor/grib_accessor_class_blob.cc b/src/accessor/grib_accessor_class_blob.cc index 93c7095bb..ca7b21f24 100644 --- a/src/accessor/grib_accessor_class_blob.cc +++ b/src/accessor/grib_accessor_class_blob.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_blob.h" grib_accessor_class_blob_t _grib_accessor_class_blob{"blob"}; diff --git a/src/accessor/grib_accessor_class_budgdate.cc b/src/accessor/grib_accessor_class_budgdate.cc index e496488e2..4c58c20f2 100644 --- a/src/accessor/grib_accessor_class_budgdate.cc +++ b/src/accessor/grib_accessor_class_budgdate.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_budgdate.h" grib_accessor_class_budgdate_t _grib_accessor_class_budgdate{"budgdate"}; diff --git a/src/accessor/grib_accessor_class_bufr_data_array.cc b/src/accessor/grib_accessor_class_bufr_data_array.cc index e89d096b1..0314effa0 100644 --- a/src/accessor/grib_accessor_class_bufr_data_array.cc +++ b/src/accessor/grib_accessor_class_bufr_data_array.cc @@ -10,7 +10,6 @@ */ #include "grib_scaling.h" -#include "grib_api_internal.h" #include "grib_accessor_class_bufr_data_array.h" grib_accessor_class_bufr_data_array_t _grib_accessor_class_bufr_data_array{"bufr_data_array"}; diff --git a/src/accessor/grib_accessor_class_bufr_elements_table.cc b/src/accessor/grib_accessor_class_bufr_elements_table.cc index 9a34353de..42e7a1324 100644 --- a/src/accessor/grib_accessor_class_bufr_elements_table.cc +++ b/src/accessor/grib_accessor_class_bufr_elements_table.cc @@ -9,11 +9,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_bufr_elements_table.h" #include "grib_scaling.h" - #if GRIB_PTHREADS static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; diff --git a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc index cbd6b5c5f..9a2310635 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc +++ b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bufr_extract_area_subsets.h" grib_accessor_class_bufr_extract_area_subsets_t _grib_accessor_class_bufr_extract_area_subsets{"bufr_extract_area_subsets"}; diff --git a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc index 400473180..368f49f0c 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc +++ b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bufr_extract_datetime_subsets.h" grib_accessor_class_bufr_extract_datetime_subsets_t _grib_accessor_class_bufr_extract_datetime_subsets{"bufr_extract_datetime_subsets"}; diff --git a/src/accessor/grib_accessor_class_bufr_extract_subsets.cc b/src/accessor/grib_accessor_class_bufr_extract_subsets.cc index 75f0618b8..7d5a23652 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_subsets.cc +++ b/src/accessor/grib_accessor_class_bufr_extract_subsets.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bufr_extract_subsets.h" grib_accessor_class_bufr_extract_subsets_t _grib_accessor_class_bufr_extract_subsets{"bufr_extract_subsets"}; diff --git a/src/accessor/grib_accessor_class_bufr_group.cc b/src/accessor/grib_accessor_class_bufr_group.cc index 2aae5e583..71249f70d 100644 --- a/src/accessor/grib_accessor_class_bufr_group.cc +++ b/src/accessor/grib_accessor_class_bufr_group.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bufr_group.h" grib_accessor_class_bufr_group_t _grib_accessor_class_bufr_group{"bufr_group"}; diff --git a/src/accessor/grib_accessor_class_bufr_simple_thinning.cc b/src/accessor/grib_accessor_class_bufr_simple_thinning.cc index c2621e52c..2c66d4585 100644 --- a/src/accessor/grib_accessor_class_bufr_simple_thinning.cc +++ b/src/accessor/grib_accessor_class_bufr_simple_thinning.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bufr_simple_thinning.h" grib_accessor_class_bufr_simple_thinning_t _grib_accessor_class_bufr_simple_thinning{"bufr_simple_thinning"}; diff --git a/src/accessor/grib_accessor_class_bufr_string_values.cc b/src/accessor/grib_accessor_class_bufr_string_values.cc index f6b7d561a..eb76f6fb9 100644 --- a/src/accessor/grib_accessor_class_bufr_string_values.cc +++ b/src/accessor/grib_accessor_class_bufr_string_values.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bufr_string_values.h" #include "grib_accessor_class_bufr_data_array.h" diff --git a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc index 9aa38faa4..bd411d510 100644 --- a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bufrdc_expanded_descriptors.h" grib_accessor_class_bufrdc_expanded_descriptors_t _grib_accessor_class_bufrdc_expanded_descriptors{"bufrdc_expanded_descriptors"}; diff --git a/src/accessor/grib_accessor_class_bytes.cc b/src/accessor/grib_accessor_class_bytes.cc index b7719e232..47c8713ae 100644 --- a/src/accessor/grib_accessor_class_bytes.cc +++ b/src/accessor/grib_accessor_class_bytes.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_bytes.h" grib_accessor_class_bytes_t _grib_accessor_class_bytes{"bytes"}; diff --git a/src/accessor/grib_accessor_class_change_alternative_row_scanning.cc b/src/accessor/grib_accessor_class_change_alternative_row_scanning.cc index f9d740206..50475b6a6 100644 --- a/src/accessor/grib_accessor_class_change_alternative_row_scanning.cc +++ b/src/accessor/grib_accessor_class_change_alternative_row_scanning.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_change_alternative_row_scanning.h" grib_accessor_class_change_alternative_row_scanning_t _grib_accessor_class_change_alternative_row_scanning{"change_alternative_row_scanning"}; diff --git a/src/accessor/grib_accessor_class_change_scanning_direction.cc b/src/accessor/grib_accessor_class_change_scanning_direction.cc index cfa45c592..e3b6144c9 100644 --- a/src/accessor/grib_accessor_class_change_scanning_direction.cc +++ b/src/accessor/grib_accessor_class_change_scanning_direction.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_change_scanning_direction.h" grib_accessor_class_change_scanning_direction_t _grib_accessor_class_change_scanning_direction{"change_scanning_direction"}; diff --git a/src/accessor/grib_accessor_class_check_internal_version.cc b/src/accessor/grib_accessor_class_check_internal_version.cc index 987a512f5..f8ceb1896 100644 --- a/src/accessor/grib_accessor_class_check_internal_version.cc +++ b/src/accessor/grib_accessor_class_check_internal_version.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_check_internal_version.h" grib_accessor_class_check_internal_version_t _grib_accessor_class_check_internal_version{"check_internal_version"}; diff --git a/src/accessor/grib_accessor_class_closest_date.cc b/src/accessor/grib_accessor_class_closest_date.cc index ace5bdf71..b0b3bb512 100644 --- a/src/accessor/grib_accessor_class_closest_date.cc +++ b/src/accessor/grib_accessor_class_closest_date.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_closest_date.h" #include diff --git a/src/accessor/grib_accessor_class_codeflag.cc b/src/accessor/grib_accessor_class_codeflag.cc index d81c031a9..75b73aca4 100644 --- a/src/accessor/grib_accessor_class_codeflag.cc +++ b/src/accessor/grib_accessor_class_codeflag.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_codeflag.h" grib_accessor_class_codeflag_t _grib_accessor_class_codeflag{"codeflag"}; diff --git a/src/accessor/grib_accessor_class_codetable.cc b/src/accessor/grib_accessor_class_codetable.cc index 54f51929b..552274e75 100644 --- a/src/accessor/grib_accessor_class_codetable.cc +++ b/src/accessor/grib_accessor_class_codetable.cc @@ -8,10 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - #include "grib_accessor_class_codetable.h" #include diff --git a/src/accessor/grib_accessor_class_codetable_title.cc b/src/accessor/grib_accessor_class_codetable_title.cc index 52d8b8b32..d124ee75f 100644 --- a/src/accessor/grib_accessor_class_codetable_title.cc +++ b/src/accessor/grib_accessor_class_codetable_title.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_codetable_title.h" #include "grib_accessor_class_codetable.h" diff --git a/src/accessor/grib_accessor_class_codetable_units.cc b/src/accessor/grib_accessor_class_codetable_units.cc index cb72847e0..2e7ccda61 100644 --- a/src/accessor/grib_accessor_class_codetable_units.cc +++ b/src/accessor/grib_accessor_class_codetable_units.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_codetable_units.h" #include "grib_accessor_class_codetable.h" diff --git a/src/accessor/grib_accessor_class_concept.cc b/src/accessor/grib_accessor_class_concept.cc index 32e612546..f67391af6 100644 --- a/src/accessor/grib_accessor_class_concept.cc +++ b/src/accessor/grib_accessor_class_concept.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_concept.h" grib_accessor_class_concept_t _grib_accessor_class_concept{"concept"}; diff --git a/src/accessor/grib_accessor_class_count_file.cc b/src/accessor/grib_accessor_class_count_file.cc index b3317e515..a347e49ff 100644 --- a/src/accessor/grib_accessor_class_count_file.cc +++ b/src/accessor/grib_accessor_class_count_file.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_count_file.h" grib_accessor_class_count_file_t _grib_accessor_class_count_file{"count_file"}; diff --git a/src/accessor/grib_accessor_class_count_missing.cc b/src/accessor/grib_accessor_class_count_missing.cc index a14c6d6c0..c381be043 100644 --- a/src/accessor/grib_accessor_class_count_missing.cc +++ b/src/accessor/grib_accessor_class_count_missing.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_count_missing.h" grib_accessor_class_count_missing_t _grib_accessor_class_count_missing{"count_missing"}; diff --git a/src/accessor/grib_accessor_class_count_total.cc b/src/accessor/grib_accessor_class_count_total.cc index 604981a56..561a8743d 100644 --- a/src/accessor/grib_accessor_class_count_total.cc +++ b/src/accessor/grib_accessor_class_count_total.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_count_total.h" grib_accessor_class_count_total_t _grib_accessor_class_count_total{"count_total"}; diff --git a/src/accessor/grib_accessor_class_data_apply_bitmap.cc b/src/accessor/grib_accessor_class_data_apply_bitmap.cc index 5529ab36f..86e54ff63 100644 --- a/src/accessor/grib_accessor_class_data_apply_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_apply_bitmap.cc @@ -9,7 +9,6 @@ * 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" grib_accessor_class_data_apply_bitmap_t _grib_accessor_class_data_apply_bitmap{"data_apply_bitmap"}; diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc index a4b020276..2569a05cb 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.cc @@ -9,7 +9,6 @@ * 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_boustrophedonic.h" grib_accessor_class_data_apply_boustrophedonic_t _grib_accessor_class_data_apply_boustrophedonic{ "data_apply_boustrophedonic" }; diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc index d7e07a561..f796cfb02 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.cc @@ -9,7 +9,6 @@ * 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_boustrophedonic_bitmap.h" grib_accessor_class_data_apply_boustrophedonic_bitmap_t _grib_accessor_class_data_apply_boustrophedonic_bitmap{"data_apply_boustrophedonic_bitmap"}; diff --git a/src/accessor/grib_accessor_class_data_dummy_field.cc b/src/accessor/grib_accessor_class_data_dummy_field.cc index 23bc83c9c..eddadcc08 100644 --- a/src/accessor/grib_accessor_class_data_dummy_field.cc +++ b/src/accessor/grib_accessor_class_data_dummy_field.cc @@ -9,7 +9,6 @@ * 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_dummy_field.h" grib_accessor_class_data_dummy_field_t _grib_accessor_class_data_dummy_field{"data_dummy_field"}; diff --git a/src/accessor/grib_accessor_class_data_g1complex_packing.cc b/src/accessor/grib_accessor_class_data_g1complex_packing.cc index b1fc4fa4b..5ac11346e 100644 --- a/src/accessor/grib_accessor_class_data_g1complex_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1complex_packing.cc @@ -9,7 +9,6 @@ * 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_g1complex_packing.h" grib_accessor_class_data_g1complex_packing_t _grib_accessor_class_data_g1complex_packing{"data_g1complex_packing"}; diff --git a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc index 44452957e..579fbd8cb 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc @@ -9,7 +9,6 @@ * 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_g1second_order_constant_width_packing.h" #include "grib_scaling.h" diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc index 48b5081df..a5c1084ac 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc @@ -9,7 +9,6 @@ * 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_g1second_order_general_extended_packing.h" #include "grib_scaling.h" diff --git a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc index 639512a57..3697f6f75 100644 --- a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.cc @@ -9,7 +9,6 @@ * 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_g1secondary_bitmap.h" grib_accessor_class_data_g1secondary_bitmap_t _grib_accessor_class_data_g1secondary_bitmap{"data_g1secondary_bitmap"}; diff --git a/src/accessor/grib_accessor_class_data_g1shsimple_packing.cc b/src/accessor/grib_accessor_class_data_g1shsimple_packing.cc index d6a8a6562..f1f06d654 100644 --- a/src/accessor/grib_accessor_class_data_g1shsimple_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1shsimple_packing.cc @@ -9,7 +9,6 @@ * 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_g1shsimple_packing.h" grib_accessor_class_data_g1shsimple_packing_t _grib_accessor_class_data_g1shsimple_packing{"data_g1shsimple_packing"}; diff --git a/src/accessor/grib_accessor_class_data_g1simple_packing.cc b/src/accessor/grib_accessor_class_data_g1simple_packing.cc index 2346e33dd..a19132f1a 100644 --- a/src/accessor/grib_accessor_class_data_g1simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1simple_packing.cc @@ -9,7 +9,6 @@ * 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_g1simple_packing.h" #include "grib_scaling.h" diff --git a/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc b/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc index 06121f9aa..60cf8e0f9 100644 --- a/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc @@ -9,7 +9,6 @@ * 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_g2bifourier_packing.h" #include "grib_scaling.h" diff --git a/src/accessor/grib_accessor_class_data_g2complex_packing.cc b/src/accessor/grib_accessor_class_data_g2complex_packing.cc index 7ccd19117..c1e5e7aad 100644 --- a/src/accessor/grib_accessor_class_data_g2complex_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2complex_packing.cc @@ -9,7 +9,6 @@ * 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_g2complex_packing.h" grib_accessor_class_data_g2complex_packing_t _grib_accessor_class_data_g2complex_packing{"data_g2complex_packing"}; diff --git a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc index f16ccf74f..a6fd7bd46 100644 --- a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.cc @@ -9,7 +9,6 @@ * 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_g2secondary_bitmap.h" grib_accessor_class_data_g2secondary_bitmap_t _grib_accessor_class_data_g2secondary_bitmap{"data_g2secondary_bitmap"}; diff --git a/src/accessor/grib_accessor_class_data_g2shsimple_packing.cc b/src/accessor/grib_accessor_class_data_g2shsimple_packing.cc index ad204da06..7e2b5cd54 100644 --- a/src/accessor/grib_accessor_class_data_g2shsimple_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2shsimple_packing.cc @@ -9,7 +9,6 @@ * 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_g2shsimple_packing.h" grib_accessor_class_data_g2shsimple_packing_t _grib_accessor_class_data_g2shsimple_packing{"data_g2shsimple_packing"}; diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing.cc b/src/accessor/grib_accessor_class_data_g2simple_packing.cc index 849c4647a..7f3ef141a 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2simple_packing.cc @@ -9,7 +9,6 @@ * 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_g2simple_packing.h" #include "grib_scaling.h" diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc index ad877ca82..8eac09789 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc +++ b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc @@ -9,7 +9,6 @@ * 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_g2simple_packing_with_preprocessing.h" #define DIRECT 0 #define INVERSE 1 diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc index 73ad0ea64..a68a3eae7 100644 --- a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc @@ -9,7 +9,6 @@ * 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_jpeg2000_packing.h" grib_accessor_class_data_jpeg2000_packing_t _grib_accessor_class_data_jpeg2000_packing{"data_jpeg2000_packing"}; diff --git a/src/accessor/grib_accessor_class_data_raw_packing.cc b/src/accessor/grib_accessor_class_data_raw_packing.cc index e9de19af0..499b46bec 100644 --- a/src/accessor/grib_accessor_class_data_raw_packing.cc +++ b/src/accessor/grib_accessor_class_data_raw_packing.cc @@ -9,7 +9,6 @@ * 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_raw_packing.h" #include "grib_ieeefloat.h" diff --git a/src/accessor/grib_accessor_class_data_run_length_packing.cc b/src/accessor/grib_accessor_class_data_run_length_packing.cc index 849652127..35792c503 100644 --- a/src/accessor/grib_accessor_class_data_run_length_packing.cc +++ b/src/accessor/grib_accessor_class_data_run_length_packing.cc @@ -9,7 +9,6 @@ * 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_run_length_packing.h" #include "grib_scaling.h" diff --git a/src/accessor/grib_accessor_class_data_secondary_bitmap.cc b/src/accessor/grib_accessor_class_data_secondary_bitmap.cc index b453aa5b1..f79098f84 100644 --- a/src/accessor/grib_accessor_class_data_secondary_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_secondary_bitmap.cc @@ -9,7 +9,6 @@ * 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_secondary_bitmap.h" grib_accessor_class_data_secondary_bitmap_t _grib_accessor_class_data_secondary_bitmap{"data_secondary_bitmap"}; diff --git a/src/accessor/grib_accessor_class_data_sh_packed.cc b/src/accessor/grib_accessor_class_data_sh_packed.cc index f7febe225..80bc7648f 100644 --- a/src/accessor/grib_accessor_class_data_sh_packed.cc +++ b/src/accessor/grib_accessor_class_data_sh_packed.cc @@ -9,7 +9,6 @@ * 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_sh_packed.h" #include "grib_scaling.h" diff --git a/src/accessor/grib_accessor_class_data_sh_unpacked.cc b/src/accessor/grib_accessor_class_data_sh_unpacked.cc index 9573bd732..efa738c65 100644 --- a/src/accessor/grib_accessor_class_data_sh_unpacked.cc +++ b/src/accessor/grib_accessor_class_data_sh_unpacked.cc @@ -9,7 +9,6 @@ * 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_sh_unpacked.h" #include "grib_scaling.h" diff --git a/src/accessor/grib_accessor_class_data_shsimple_packing.cc b/src/accessor/grib_accessor_class_data_shsimple_packing.cc index 6fd8d9f6b..0de921d06 100644 --- a/src/accessor/grib_accessor_class_data_shsimple_packing.cc +++ b/src/accessor/grib_accessor_class_data_shsimple_packing.cc @@ -9,7 +9,6 @@ * 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_shsimple_packing.h" grib_accessor_class_data_shsimple_packing_t _grib_accessor_class_data_shsimple_packing{"data_shsimple_packing"}; diff --git a/src/accessor/grib_accessor_class_decimal_precision.cc b/src/accessor/grib_accessor_class_decimal_precision.cc index c063512c0..6149de763 100644 --- a/src/accessor/grib_accessor_class_decimal_precision.cc +++ b/src/accessor/grib_accessor_class_decimal_precision.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_decimal_precision.h" grib_accessor_class_decimal_precision_t _grib_accessor_class_decimal_precision{"decimal_precision"}; diff --git a/src/accessor/grib_accessor_class_dictionary.cc b/src/accessor/grib_accessor_class_dictionary.cc index 59ed89b32..9a0b3307d 100644 --- a/src/accessor/grib_accessor_class_dictionary.cc +++ b/src/accessor/grib_accessor_class_dictionary.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_dictionary.h" grib_accessor_class_dictionary_t _grib_accessor_class_dictionary{"dictionary"}; diff --git a/src/accessor/grib_accessor_class_dirty.cc b/src/accessor/grib_accessor_class_dirty.cc index 89a05806b..39df7e450 100644 --- a/src/accessor/grib_accessor_class_dirty.cc +++ b/src/accessor/grib_accessor_class_dirty.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_dirty.h" grib_accessor_class_dirty_t _grib_accessor_class_dirty{"dirty"}; diff --git a/src/accessor/grib_accessor_class_divdouble.cc b/src/accessor/grib_accessor_class_divdouble.cc index cf79b434d..a652752fa 100644 --- a/src/accessor/grib_accessor_class_divdouble.cc +++ b/src/accessor/grib_accessor_class_divdouble.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_divdouble.h" grib_accessor_class_divdouble_t _grib_accessor_class_divdouble{"divdouble"}; diff --git a/src/accessor/grib_accessor_class_double.cc b/src/accessor/grib_accessor_class_double.cc index 0e3b0ea00..a0e3a49b5 100644 --- a/src/accessor/grib_accessor_class_double.cc +++ b/src/accessor/grib_accessor_class_double.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" grib_accessor_class_double_t _grib_accessor_class_double{"double"}; diff --git a/src/accessor/grib_accessor_class_element.cc b/src/accessor/grib_accessor_class_element.cc index a058d3dea..eb2a874f2 100644 --- a/src/accessor/grib_accessor_class_element.cc +++ b/src/accessor/grib_accessor_class_element.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_element.h" grib_accessor_class_element_t _grib_accessor_class_element{"element"}; diff --git a/src/accessor/grib_accessor_class_evaluate.cc b/src/accessor/grib_accessor_class_evaluate.cc index 25f4f5ba5..efed99598 100644 --- a/src/accessor/grib_accessor_class_evaluate.cc +++ b/src/accessor/grib_accessor_class_evaluate.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_evaluate.h" grib_accessor_class_evaluate_t _grib_accessor_class_evaluate{"evaluate"}; diff --git a/src/accessor/grib_accessor_class_expanded_descriptors.cc b/src/accessor/grib_accessor_class_expanded_descriptors.cc index d885ad1d8..ff91dbc6f 100644 --- a/src/accessor/grib_accessor_class_expanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_expanded_descriptors.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_expanded_descriptors.h" #include "grib_scaling.h" diff --git a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc index 9ba8aa65e..4168e1476 100644 --- a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc +++ b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_from_scale_factor_scaled_value.h" grib_accessor_class_from_scale_factor_scaled_value_t _grib_accessor_class_from_scale_factor_scaled_value{"from_scale_factor_scaled_value"}; diff --git a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc index f2d309d06..2f757addc 100644 --- a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc +++ b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1_half_byte_codeflag.h" grib_accessor_class_g1_half_byte_codeflag_t _grib_accessor_class_g1_half_byte_codeflag{"g1_half_byte_codeflag"}; diff --git a/src/accessor/grib_accessor_class_g1_message_length.cc b/src/accessor/grib_accessor_class_g1_message_length.cc index de8145a53..89ce742c5 100644 --- a/src/accessor/grib_accessor_class_g1_message_length.cc +++ b/src/accessor/grib_accessor_class_g1_message_length.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1_message_length.h" grib_accessor_class_g1_message_length_t _grib_accessor_class_g1_message_length{"g1_message_length"}; diff --git a/src/accessor/grib_accessor_class_g1_section4_length.cc b/src/accessor/grib_accessor_class_g1_section4_length.cc index 1c4f9ccf1..8eea656b0 100644 --- a/src/accessor/grib_accessor_class_g1_section4_length.cc +++ b/src/accessor/grib_accessor_class_g1_section4_length.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1_section4_length.h" grib_accessor_class_g1_section4_length_t _grib_accessor_class_g1_section4_length{"g1_section4_length"}; diff --git a/src/accessor/grib_accessor_class_g1bitmap.cc b/src/accessor/grib_accessor_class_g1bitmap.cc index 1a7a7bb9e..e8c0645ad 100644 --- a/src/accessor/grib_accessor_class_g1bitmap.cc +++ b/src/accessor/grib_accessor_class_g1bitmap.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1bitmap.h" #include "shared_functions.h" diff --git a/src/accessor/grib_accessor_class_g1date.cc b/src/accessor/grib_accessor_class_g1date.cc index 938628031..64631a1ea 100644 --- a/src/accessor/grib_accessor_class_g1date.cc +++ b/src/accessor/grib_accessor_class_g1date.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1date.h" grib_accessor_class_g1date_t _grib_accessor_class_g1date{"g1date"}; diff --git a/src/accessor/grib_accessor_class_g1day_of_the_year_date.cc b/src/accessor/grib_accessor_class_g1day_of_the_year_date.cc index a75e043c9..83d23ea92 100644 --- a/src/accessor/grib_accessor_class_g1day_of_the_year_date.cc +++ b/src/accessor/grib_accessor_class_g1day_of_the_year_date.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1day_of_the_year_date.h" grib_accessor_class_g1day_of_the_year_date_t _grib_accessor_class_g1day_of_the_year_date{"g1day_of_the_year_date"}; diff --git a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc index c280f26b3..ea48fc6cb 100644 --- a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc +++ b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1end_of_interval_monthly.h" grib_accessor_class_g1end_of_interval_monthly_t _grib_accessor_class_g1end_of_interval_monthly{"g1end_of_interval_monthly"}; diff --git a/src/accessor/grib_accessor_class_g1fcperiod.cc b/src/accessor/grib_accessor_class_g1fcperiod.cc index 143a381e7..fcf98d78d 100644 --- a/src/accessor/grib_accessor_class_g1fcperiod.cc +++ b/src/accessor/grib_accessor_class_g1fcperiod.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1fcperiod.h" grib_accessor_class_g1fcperiod_t _grib_accessor_class_g1fcperiod{"g1fcperiod"}; diff --git a/src/accessor/grib_accessor_class_g1forecastmonth.cc b/src/accessor/grib_accessor_class_g1forecastmonth.cc index a849125f9..7da455773 100644 --- a/src/accessor/grib_accessor_class_g1forecastmonth.cc +++ b/src/accessor/grib_accessor_class_g1forecastmonth.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1forecastmonth.h" grib_accessor_class_g1forecastmonth_t _grib_accessor_class_g1forecastmonth{"g1forecastmonth"}; diff --git a/src/accessor/grib_accessor_class_g1monthlydate.cc b/src/accessor/grib_accessor_class_g1monthlydate.cc index 79aba52ed..420f96ef3 100644 --- a/src/accessor/grib_accessor_class_g1monthlydate.cc +++ b/src/accessor/grib_accessor_class_g1monthlydate.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1monthlydate.h" grib_accessor_class_g1monthlydate_t _grib_accessor_class_g1monthlydate{"g1monthlydate"}; diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc index 0623a32d7..9976ad812 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1number_of_coded_values_sh_complex.h" grib_accessor_class_g1number_of_coded_values_sh_complex_t _grib_accessor_class_g1number_of_coded_values_sh_complex{"g1number_of_coded_values_sh_complex"}; diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc index 50fe992c9..802e6ceb7 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1number_of_coded_values_sh_simple.h" grib_accessor_class_g1number_of_coded_values_sh_simple_t _grib_accessor_class_g1number_of_coded_values_sh_simple{"g1number_of_coded_values_sh_simple"}; diff --git a/src/accessor/grib_accessor_class_g1step_range.cc b/src/accessor/grib_accessor_class_g1step_range.cc index 8ad1b3e12..a2920a1cf 100644 --- a/src/accessor/grib_accessor_class_g1step_range.cc +++ b/src/accessor/grib_accessor_class_g1step_range.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1step_range.h" grib_accessor_class_g1step_range_t _grib_accessor_class_g1step_range{"g1step_range"}; diff --git a/src/accessor/grib_accessor_class_g1verificationdate.cc b/src/accessor/grib_accessor_class_g1verificationdate.cc index b77267427..63a1f1356 100644 --- a/src/accessor/grib_accessor_class_g1verificationdate.cc +++ b/src/accessor/grib_accessor_class_g1verificationdate.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g1verificationdate.h" grib_accessor_class_g1verificationdate_t _grib_accessor_class_g1verificationdate{"g1verificationdate"}; diff --git a/src/accessor/grib_accessor_class_g2_aerosol.cc b/src/accessor/grib_accessor_class_g2_aerosol.cc index 4d20e0d9a..464563187 100644 --- a/src/accessor/grib_accessor_class_g2_aerosol.cc +++ b/src/accessor/grib_accessor_class_g2_aerosol.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2_aerosol.h" grib_accessor_class_g2_aerosol_t _grib_accessor_class_g2_aerosol{"g2_aerosol"}; diff --git a/src/accessor/grib_accessor_class_g2_chemical.cc b/src/accessor/grib_accessor_class_g2_chemical.cc index d00e90feb..3d05886a5 100644 --- a/src/accessor/grib_accessor_class_g2_chemical.cc +++ b/src/accessor/grib_accessor_class_g2_chemical.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2_chemical.h" grib_accessor_class_g2_chemical_t _grib_accessor_class_g2_chemical{"g2_chemical"}; diff --git a/src/accessor/grib_accessor_class_g2_eps.cc b/src/accessor/grib_accessor_class_g2_eps.cc index afdea42bf..6b6c42fd7 100644 --- a/src/accessor/grib_accessor_class_g2_eps.cc +++ b/src/accessor/grib_accessor_class_g2_eps.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2_eps.h" grib_accessor_class_g2_eps_t _grib_accessor_class_g2_eps{"g2_eps"}; diff --git a/src/accessor/grib_accessor_class_g2_mars_labeling.cc b/src/accessor/grib_accessor_class_g2_mars_labeling.cc index 8fcc03141..4ea0f5e7c 100644 --- a/src/accessor/grib_accessor_class_g2_mars_labeling.cc +++ b/src/accessor/grib_accessor_class_g2_mars_labeling.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2_mars_labeling.h" grib_accessor_class_g2_mars_labeling_t _grib_accessor_class_g2_mars_labeling{"g2_mars_labeling"}; diff --git a/src/accessor/grib_accessor_class_g2bitmap.cc b/src/accessor/grib_accessor_class_g2bitmap.cc index 3996e0c7f..d5af880b3 100644 --- a/src/accessor/grib_accessor_class_g2bitmap.cc +++ b/src/accessor/grib_accessor_class_g2bitmap.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2bitmap.h" #include "shared_functions.h" diff --git a/src/accessor/grib_accessor_class_g2bitmap_present.cc b/src/accessor/grib_accessor_class_g2bitmap_present.cc index 4e31cb3ba..1444783fe 100644 --- a/src/accessor/grib_accessor_class_g2bitmap_present.cc +++ b/src/accessor/grib_accessor_class_g2bitmap_present.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2bitmap_present.h" grib_accessor_class_g2bitmap_present_t _grib_accessor_class_g2bitmap_present{"g2bitmap_present"}; diff --git a/src/accessor/grib_accessor_class_g2date.cc b/src/accessor/grib_accessor_class_g2date.cc index b4ea04eda..238da76f7 100644 --- a/src/accessor/grib_accessor_class_g2date.cc +++ b/src/accessor/grib_accessor_class_g2date.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2date.h" grib_accessor_class_g2date_t _grib_accessor_class_g2date{"g2date"}; diff --git a/src/accessor/grib_accessor_class_g2end_step.cc b/src/accessor/grib_accessor_class_g2end_step.cc index 1e0f77c03..20bf71e59 100644 --- a/src/accessor/grib_accessor_class_g2end_step.cc +++ b/src/accessor/grib_accessor_class_g2end_step.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2end_step.h" #include "step.h" #include "step_utilities.h" diff --git a/src/accessor/grib_accessor_class_g2grid.cc b/src/accessor/grib_accessor_class_g2grid.cc index c28351a29..b5d33a39d 100644 --- a/src/accessor/grib_accessor_class_g2grid.cc +++ b/src/accessor/grib_accessor_class_g2grid.cc @@ -9,18 +9,18 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2grid.h" -grib_accessor_class_g2grid_t _grib_accessor_class_g2grid{"g2grid"}; +grib_accessor_class_g2grid_t _grib_accessor_class_g2grid{ "g2grid" }; grib_accessor_class* grib_accessor_class_g2grid = &_grib_accessor_class_g2grid; -void grib_accessor_class_g2grid_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_g2grid_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_double_t::init(a, l, c); grib_accessor_g2grid_t* self = (grib_accessor_g2grid_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; self->latitude_first = grib_arguments_get_name(hand, c, n++); self->longitude_first = grib_arguments_get_name(hand, c, n++); @@ -36,7 +36,8 @@ void grib_accessor_class_g2grid_t::init(grib_accessor* a, const long l, grib_arg GRIB_ACCESSOR_FLAG_READ_ONLY; } -int grib_accessor_class_g2grid_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_g2grid_t::value_count(grib_accessor* a, long* count) +{ *count = 6; return 0; } @@ -44,10 +45,11 @@ int grib_accessor_class_g2grid_t::value_count(grib_accessor* a, long* count){ // GRIB edition 2 uses microdegrees #define ANGLE_SUBDIVISIONS (1000 * 1000) -int grib_accessor_class_g2grid_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_g2grid_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_g2grid_t* self = (grib_accessor_g2grid_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; long basic_angle = 0; long sub_division = 0; @@ -93,7 +95,8 @@ int grib_accessor_class_g2grid_t::unpack_double(grib_accessor* a, double* val, s if (!self->j_increment) { v[n++] = GRIB_MISSING_LONG; - } else { + } + else { if ((ret = grib_get_long_internal(hand, self->j_increment, &v[n++])) != GRIB_SUCCESS) return ret; } @@ -106,7 +109,8 @@ int grib_accessor_class_g2grid_t::unpack_double(grib_accessor* a, double* val, s return GRIB_SUCCESS; } -long gcd(long a, long b){ +long gcd(long a, long b) +{ if (b > a) return gcd(b, a); if (b == 0) @@ -114,11 +118,13 @@ long gcd(long a, long b){ return gcd(b, a % b); } -long lcm(long a, long b){ +long lcm(long a, long b) +{ return a * b / gcd(a, b); } -int is_ok(const double* val, long v[6], double basic_angle, double sub_division){ +int is_ok(const double* val, long v[6], double basic_angle, double sub_division) +{ int i; int ok = 1; @@ -142,7 +148,8 @@ int is_ok(const double* val, long v[6], double basic_angle, double sub_division) return ok; } -int trial(const double* val, long v[6], long* basic_angle, long* sub_division){ +int trial(const double* val, long v[6], long* basic_angle, long* sub_division) +{ int i = 0; long ni, nj; @@ -172,9 +179,10 @@ int trial(const double* val, long v[6], long* basic_angle, long* sub_division){ return is_ok(val, v, *basic_angle, *sub_division); } -int grib_accessor_class_g2grid_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_g2grid_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_g2grid_t* self = (grib_accessor_g2grid_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); + grib_handle* hand = grib_handle_of_accessor(a); int ret; long v[6]; int n; diff --git a/src/accessor/grib_accessor_class_g2latlon.cc b/src/accessor/grib_accessor_class_g2latlon.cc index 35bb09e7e..afb3a2f7a 100644 --- a/src/accessor/grib_accessor_class_g2latlon.cc +++ b/src/accessor/grib_accessor_class_g2latlon.cc @@ -9,26 +9,27 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2latlon.h" -grib_accessor_class_g2latlon_t _grib_accessor_class_g2latlon{"g2latlon"}; +grib_accessor_class_g2latlon_t _grib_accessor_class_g2latlon{ "g2latlon" }; grib_accessor_class* grib_accessor_class_g2latlon = &_grib_accessor_class_g2latlon; -void grib_accessor_class_g2latlon_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_g2latlon_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_double_t::init(a, l, c); grib_accessor_g2latlon_t* self = (grib_accessor_g2latlon_t*)a; - int n = 0; + int n = 0; self->grid = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); self->index = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); self->given = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -int grib_accessor_class_g2latlon_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_g2latlon_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_g2latlon_t* self = (grib_accessor_g2latlon_t*)a; - int ret = 0; + int ret = 0; long given = 1; double grid[6]; @@ -56,12 +57,13 @@ int grib_accessor_class_g2latlon_t::unpack_double(grib_accessor* a, double* val, return GRIB_SUCCESS; } -int grib_accessor_class_g2latlon_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_g2latlon_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_g2latlon_t* self = (grib_accessor_g2latlon_t*)a; - int ret = 0; + int ret = 0; double grid[6]; - size_t size = 6; - double new_val = *val; + size_t size = 6; + double new_val = *val; grib_handle* hand = grib_handle_of_accessor(a); if (*len < 1) { @@ -94,10 +96,11 @@ int grib_accessor_class_g2latlon_t::pack_double(grib_accessor* a, const double* return grib_set_double_array_internal(hand, self->grid, grid, size); } -int grib_accessor_class_g2latlon_t::pack_missing(grib_accessor* a){ +int grib_accessor_class_g2latlon_t::pack_missing(grib_accessor* a) +{ grib_accessor_g2latlon_t* self = (grib_accessor_g2latlon_t*)a; - double missing = GRIB_MISSING_DOUBLE; - size_t size = 1; + double missing = GRIB_MISSING_DOUBLE; + size_t size = 1; if (!self->given) return GRIB_NOT_IMPLEMENTED; @@ -105,9 +108,10 @@ int grib_accessor_class_g2latlon_t::pack_missing(grib_accessor* a){ return pack_double(a, &missing, &size); } -int grib_accessor_class_g2latlon_t::is_missing(grib_accessor* a){ +int grib_accessor_class_g2latlon_t::is_missing(grib_accessor* a) +{ grib_accessor_g2latlon_t* self = (grib_accessor_g2latlon_t*)a; - long given = 1; + long given = 1; if (self->given) grib_get_long_internal(grib_handle_of_accessor(a), self->given, &given); diff --git a/src/accessor/grib_accessor_class_g2level.cc b/src/accessor/grib_accessor_class_g2level.cc index 37e3c01d6..8da0be27f 100644 --- a/src/accessor/grib_accessor_class_g2level.cc +++ b/src/accessor/grib_accessor_class_g2level.cc @@ -9,18 +9,18 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2level.h" -grib_accessor_class_g2level_t _grib_accessor_class_g2level{"g2level"}; +grib_accessor_class_g2level_t _grib_accessor_class_g2level{ "g2level" }; grib_accessor_class* grib_accessor_class_g2level = &_grib_accessor_class_g2level; -void grib_accessor_class_g2level_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_g2level_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_g2level_t* self = (grib_accessor_g2level_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; self->type_first = grib_arguments_get_name(hand, c, n++); self->scale_first = grib_arguments_get_name(hand, c, n++); @@ -31,24 +31,26 @@ void grib_accessor_class_g2level_t::init(grib_accessor* a, const long l, grib_ar a->flags |= GRIB_ACCESSOR_FLAG_COPY_IF_CHANGING_EDITION; } -bool is_tigge(grib_handle* h){ +bool is_tigge(grib_handle* h) +{ long productionStatus = 0; - int err = grib_get_long(h, "productionStatusOfProcessedData", &productionStatus); + int err = grib_get_long(h, "productionStatusOfProcessedData", &productionStatus); if (err) return false; return (productionStatus == 4 || productionStatus == 5); } -int grib_accessor_class_g2level_t::unpack_double(grib_accessor* a, double* val, size_t* len){ - int ret = 0; +int grib_accessor_class_g2level_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ + int ret = 0; grib_accessor_g2level_t* self = (grib_accessor_g2level_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); + grib_handle* hand = grib_handle_of_accessor(a); long type_first = 0; long scale_first = 0; long value_first = 0; char pressure_units[10] = {0,}; size_t pressure_units_len = 10; - bool tigge = is_tigge(hand); + bool tigge = is_tigge(hand); double v; @@ -76,8 +78,9 @@ int grib_accessor_class_g2level_t::unpack_double(grib_accessor* a, double* val, // GRIB-637, ECC-1081: Potential vorticity surface if (type_first == 109) { if (tigge) { - scale_first -= 6; // TIGGE data follows different rules - } else { + scale_first -= 6; // TIGGE data follows different rules + } + else { scale_first -= 9; } } @@ -93,9 +96,9 @@ int grib_accessor_class_g2level_t::unpack_double(grib_accessor* a, double* val, } 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 char pa[] = "Pa"; @@ -115,27 +118,29 @@ int grib_accessor_class_g2level_t::unpack_double(grib_accessor* a, double* val, return GRIB_SUCCESS; } -int grib_accessor_class_g2level_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_g2level_t::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; } -int grib_accessor_class_g2level_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_g2level_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_g2level_t* self = (grib_accessor_g2level_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret = 0; - double value_first = *val; - //long scale_first = 0; - long type_first = 0; - char pressure_units[10] = {0,}; - size_t pressure_units_len = 10; - const long lval = (long)value_first; - - if (value_first == lval) { // input is a whole number; process it as an integer + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; + double value_first = *val; + // long scale_first = 0; + long type_first = 0; + char pressure_units[10] = {0,}; + size_t pressure_units_len = 10; + const long lval = (long)value_first; + + if (value_first == lval) { // input is a whole number; process it as an integer return pack_long(a, &lval, len); } @@ -149,7 +154,7 @@ int grib_accessor_class_g2level_t::pack_double(grib_accessor* a, const double* v return ret; switch (type_first) { - case 100: // Pa + case 100: // Pa if (!strcmp(pressure_units, "hPa")) value_first *= 100; break; @@ -160,14 +165,14 @@ int grib_accessor_class_g2level_t::pack_double(grib_accessor* a, const double* v // final = scaled_value * 10 ^ -scale_factor - //scale_first = 2; - //value_first *= 100; - //value_first = value_first + 0.5; //round up + // scale_first = 2; + // value_first *= 100; + // value_first = value_first + 0.5; //round up // TODO(masn): These maxima should come from the respective accessors - const int64_t scaled_value_max = (1ULL << 32) - 1; // scaledValueOf*FixedSurface is 4 octets - const int64_t scale_factor_max = (1ULL << 8) - 1; // scaleFactorOf*FixedSurface is 1 octet - int64_t lscaled_value=0, lscale_factor=0; + const int64_t scaled_value_max = (1ULL << 32) - 1; // scaledValueOf*FixedSurface is 4 octets + const int64_t scale_factor_max = (1ULL << 8) - 1; // scaleFactorOf*FixedSurface is 1 octet + int64_t lscaled_value = 0, lscale_factor = 0; ret = compute_scaled_value_and_scale_factor(value_first, scaled_value_max, scale_factor_max, &lscaled_value, &lscale_factor); if (ret) { @@ -186,7 +191,8 @@ int grib_accessor_class_g2level_t::pack_double(grib_accessor* a, const double* v return GRIB_SUCCESS; } -int grib_accessor_class_g2level_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_g2level_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ int ret = 0; long value_first = *val; long scale_first = 0; @@ -195,9 +201,9 @@ int grib_accessor_class_g2level_t::pack_long(grib_accessor* a, const long* val, size_t pressure_units_len = 10; grib_accessor_g2level_t* self = (grib_accessor_g2level_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int change_scale_and_value = 1; - bool tigge = is_tigge(hand); + grib_handle* hand = grib_handle_of_accessor(a); + int change_scale_and_value = 1; + bool tigge = is_tigge(hand); if (*len != 1) return GRIB_WRONG_ARRAY_SIZE; @@ -218,16 +224,17 @@ int grib_accessor_class_g2level_t::pack_long(grib_accessor* a, const long* val, 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: // Potential vorticity surface (See ECC-1081) + case 109: // Potential vorticity surface (See ECC-1081) if (!tigge) { scale_first = 9; - } else { - scale_first = 6; // TIGGE data follows different rules + } + else { + scale_first = 6; // TIGGE data follows different rules } break; @@ -260,12 +267,13 @@ int grib_accessor_class_g2level_t::pack_long(grib_accessor* a, const long* val, return GRIB_SUCCESS; } -int grib_accessor_class_g2level_t::is_missing(grib_accessor* a){ +int grib_accessor_class_g2level_t::is_missing(grib_accessor* a) +{ grib_accessor_g2level_t* self = (grib_accessor_g2level_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int err = 0; - int ret = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int err = 0; - ret = grib_is_missing(hand, self->scale_first, &err) + - grib_is_missing(hand, self->value_first, &err); return ret; + int ret = grib_is_missing(hand, self->scale_first, &err) + + grib_is_missing(hand, self->value_first, &err); + return ret; } diff --git a/src/accessor/grib_accessor_class_g2lon.cc b/src/accessor/grib_accessor_class_g2lon.cc index e5b25640f..b7cb43d03 100644 --- a/src/accessor/grib_accessor_class_g2lon.cc +++ b/src/accessor/grib_accessor_class_g2lon.cc @@ -9,24 +9,25 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_g2lon.h" -grib_accessor_class_g2lon_t _grib_accessor_class_g2lon{"g2lon"}; +grib_accessor_class_g2lon_t _grib_accessor_class_g2lon{ "g2lon" }; grib_accessor_class* grib_accessor_class_g2lon = &_grib_accessor_class_g2lon; -void grib_accessor_class_g2lon_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_g2lon_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_double_t::init(a, l, c); grib_accessor_g2lon_t* self = (grib_accessor_g2lon_t*)a; - int n = 0; + int n = 0; self->longitude = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -int grib_accessor_class_g2lon_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_g2lon_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_g2lon_t* self = (grib_accessor_g2lon_t*)a; - int ret = 0; + int ret = 0; long longitude; if ((ret = grib_get_long(grib_handle_of_accessor(a), self->longitude, &longitude)) != GRIB_SUCCESS) @@ -42,7 +43,8 @@ int grib_accessor_class_g2lon_t::unpack_double(grib_accessor* a, double* val, si return GRIB_SUCCESS; } -int grib_accessor_class_g2lon_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_g2lon_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_g2lon_t* self = (grib_accessor_g2lon_t*)a; long longitude; double value = *val; diff --git a/src/accessor/grib_accessor_class_gaussian_grid_name.cc b/src/accessor/grib_accessor_class_gaussian_grid_name.cc index b77970ae9..f6b79e794 100644 --- a/src/accessor/grib_accessor_class_gaussian_grid_name.cc +++ b/src/accessor/grib_accessor_class_gaussian_grid_name.cc @@ -9,17 +9,17 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_gaussian_grid_name.h" -grib_accessor_class_gaussian_grid_name_t _grib_accessor_class_gaussian_grid_name{"gaussian_grid_name"}; +grib_accessor_class_gaussian_grid_name_t _grib_accessor_class_gaussian_grid_name{ "gaussian_grid_name" }; grib_accessor_class* grib_accessor_class_gaussian_grid_name = &_grib_accessor_class_gaussian_grid_name; -void grib_accessor_class_gaussian_grid_name_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_gaussian_grid_name_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_gaussian_grid_name_t* self = (grib_accessor_gaussian_grid_name_t*)a; - int n = 0; + int n = 0; self->N = grib_arguments_get_name(a->parent->h, arg, n++); self->Ni = grib_arguments_get_name(a->parent->h, arg, n++); @@ -29,13 +29,15 @@ void grib_accessor_class_gaussian_grid_name_t::init(grib_accessor* a, const long a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } -int grib_accessor_class_gaussian_grid_name_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_gaussian_grid_name_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_STRING; } #define MAX_GRIDNAME_LEN 16 -int grib_accessor_class_gaussian_grid_name_t::unpack_string(grib_accessor* a, char* v, size_t* len){ +int grib_accessor_class_gaussian_grid_name_t::unpack_string(grib_accessor* a, char* v, size_t* len) +{ grib_accessor_gaussian_grid_name_t* self = (grib_accessor_gaussian_grid_name_t*)a; long N = 0, Ni = 0; @@ -80,6 +82,7 @@ int grib_accessor_class_gaussian_grid_name_t::unpack_string(grib_accessor* a, ch return GRIB_SUCCESS; } -size_t grib_accessor_class_gaussian_grid_name_t::string_length(grib_accessor* a){ +size_t grib_accessor_class_gaussian_grid_name_t::string_length(grib_accessor* a) +{ return MAX_GRIDNAME_LEN; } diff --git a/src/accessor/grib_accessor_class_gds_is_present.cc b/src/accessor/grib_accessor_class_gds_is_present.cc index b2685ee3a..b568b9bdd 100644 --- a/src/accessor/grib_accessor_class_gds_is_present.cc +++ b/src/accessor/grib_accessor_class_gds_is_present.cc @@ -9,36 +9,37 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_gds_is_present.h" -grib_accessor_class_gds_is_present_t _grib_accessor_class_gds_is_present{"gds_is_present"}; +grib_accessor_class_gds_is_present_t _grib_accessor_class_gds_is_present{ "gds_is_present" }; grib_accessor_class* grib_accessor_class_gds_is_present = &_grib_accessor_class_gds_is_present; -void grib_accessor_class_gds_is_present_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_gds_is_present_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); - int n = 0; + int n = 0; grib_accessor_gds_is_present_t* self = (grib_accessor_gds_is_present_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - self->gds_present = grib_arguments_get_name(h, c, n++); - self->grid_definition = grib_arguments_get_name(h, c, n++); - self->bitmap_present = grib_arguments_get_name(h, c, n++); - self->values = grib_arguments_get_name(h, c, n++); + grib_handle* h = grib_handle_of_accessor(a); + self->gds_present = grib_arguments_get_name(h, c, n++); + self->grid_definition = grib_arguments_get_name(h, c, n++); + self->bitmap_present = grib_arguments_get_name(h, c, n++); + self->values = grib_arguments_get_name(h, c, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; a->length = 0; } -int grib_accessor_class_gds_is_present_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_gds_is_present_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_gds_is_present_t* self = (grib_accessor_gds_is_present_t*)a; - long missing = 255; - int ret = 0; - size_t size = 0; - double* values = NULL; - grib_context* c = a->context; - grib_handle* h = grib_handle_of_accessor(a); + long missing = 255; + int ret = 0; + size_t size = 0; + double* values = NULL; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); if (*val != 1) return GRIB_NOT_IMPLEMENTED; @@ -73,9 +74,10 @@ int grib_accessor_class_gds_is_present_t::pack_long(grib_accessor* a, const long return GRIB_SUCCESS; } -int grib_accessor_class_gds_is_present_t::unpack_long(grib_accessor* a, long* val, size_t* len){ - int ret = 0; - grib_handle* h = grib_handle_of_accessor(a); +int grib_accessor_class_gds_is_present_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ + int ret = 0; + grib_handle* h = grib_handle_of_accessor(a); grib_accessor_gds_is_present_t* self = (grib_accessor_gds_is_present_t*)a; if ((ret = grib_get_long_internal(h, self->gds_present, val)) != GRIB_SUCCESS) diff --git a/src/accessor/grib_accessor_class_gds_not_present_bitmap.cc b/src/accessor/grib_accessor_class_gds_not_present_bitmap.cc index 0fd8c9e01..6691e2fea 100644 --- a/src/accessor/grib_accessor_class_gds_not_present_bitmap.cc +++ b/src/accessor/grib_accessor_class_gds_not_present_bitmap.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_gds_not_present_bitmap.h" grib_accessor_class_gds_not_present_bitmap_t _grib_accessor_class_gds_not_present_bitmap{"gds_not_present_bitmap"}; @@ -47,9 +46,9 @@ int grib_accessor_class_gds_not_present_bitmap_t::unpack_double(grib_accessor* a long nn = 0; long missing_value; - int err = 0; double* coded_vals = NULL; - err = a->value_count(&nn); n_vals = nn; + int err = a->value_count(&nn); + n_vals = nn; if (err) return err; diff --git a/src/accessor/grib_accessor_class_global_gaussian.cc b/src/accessor/grib_accessor_class_global_gaussian.cc index 1a86afd55..34ac67881 100644 --- a/src/accessor/grib_accessor_class_global_gaussian.cc +++ b/src/accessor/grib_accessor_class_global_gaussian.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_global_gaussian.h" grib_accessor_class_global_gaussian_t _grib_accessor_class_global_gaussian{"global_gaussian"}; diff --git a/src/accessor/grib_accessor_class_group.cc b/src/accessor/grib_accessor_class_group.cc index d540c927c..aef185022 100644 --- a/src/accessor/grib_accessor_class_group.cc +++ b/src/accessor/grib_accessor_class_group.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_group.h" grib_accessor_class_group_t _grib_accessor_class_group{"group"}; diff --git a/src/accessor/grib_accessor_class_gts_header.cc b/src/accessor/grib_accessor_class_gts_header.cc index 493cbf0f8..62a63bb8f 100644 --- a/src/accessor/grib_accessor_class_gts_header.cc +++ b/src/accessor/grib_accessor_class_gts_header.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_gts_header.h" grib_accessor_class_gts_header_t _grib_accessor_class_gts_header{"gts_header"}; diff --git a/src/accessor/grib_accessor_class_hash_array.cc b/src/accessor/grib_accessor_class_hash_array.cc index d4f005710..1955dc07f 100644 --- a/src/accessor/grib_accessor_class_hash_array.cc +++ b/src/accessor/grib_accessor_class_hash_array.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_hash_array.h" grib_accessor_class_hash_array_t _grib_accessor_class_hash_array{"hash_array"}; diff --git a/src/accessor/grib_accessor_class_headers_only.cc b/src/accessor/grib_accessor_class_headers_only.cc index 802fd3f67..9b053112d 100644 --- a/src/accessor/grib_accessor_class_headers_only.cc +++ b/src/accessor/grib_accessor_class_headers_only.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_headers_only.h" grib_accessor_class_headers_only_t _grib_accessor_class_headers_only{"headers_only"}; diff --git a/src/accessor/grib_accessor_class_ibmfloat.cc b/src/accessor/grib_accessor_class_ibmfloat.cc index 65c59ba0f..f3b0f8b98 100644 --- a/src/accessor/grib_accessor_class_ibmfloat.cc +++ b/src/accessor/grib_accessor_class_ibmfloat.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_ibmfloat.h" grib_accessor_class_ibmfloat_t _grib_accessor_class_ibmfloat{"ibmfloat"}; diff --git a/src/accessor/grib_accessor_class_ieeefloat.cc b/src/accessor/grib_accessor_class_ieeefloat.cc index e15091925..53894a8a6 100644 --- a/src/accessor/grib_accessor_class_ieeefloat.cc +++ b/src/accessor/grib_accessor_class_ieeefloat.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_ieeefloat.h" grib_accessor_class_ieeefloat_t _grib_accessor_class_ieeefloat{"ieeefloat"}; diff --git a/src/accessor/grib_accessor_class_ifs_param.cc b/src/accessor/grib_accessor_class_ifs_param.cc index 419eeff91..32a972c7c 100644 --- a/src/accessor/grib_accessor_class_ifs_param.cc +++ b/src/accessor/grib_accessor_class_ifs_param.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_ifs_param.h" grib_accessor_class_ifs_param_t _grib_accessor_class_ifs_param{"ifs_param"}; diff --git a/src/accessor/grib_accessor_class_iterator.cc b/src/accessor/grib_accessor_class_iterator.cc index 138146747..4cdfd6670 100644 --- a/src/accessor/grib_accessor_class_iterator.cc +++ b/src/accessor/grib_accessor_class_iterator.cc @@ -8,11 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************** - * Enrico Fucile - *************************/ - -#include "grib_api_internal.h" #include "grib_accessor_class_iterator.h" grib_accessor_class_iterator_t _grib_accessor_class_iterator{"iterator"}; diff --git a/src/accessor/grib_accessor_class_julian_date.cc b/src/accessor/grib_accessor_class_julian_date.cc index 8e3f1e1c4..e633b42e4 100644 --- a/src/accessor/grib_accessor_class_julian_date.cc +++ b/src/accessor/grib_accessor_class_julian_date.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_julian_date.h" grib_accessor_class_julian_date_t _grib_accessor_class_julian_date{"julian_date"}; diff --git a/src/accessor/grib_accessor_class_julian_day.cc b/src/accessor/grib_accessor_class_julian_day.cc index f96213a0e..e46751181 100644 --- a/src/accessor/grib_accessor_class_julian_day.cc +++ b/src/accessor/grib_accessor_class_julian_day.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_julian_day.h" grib_accessor_class_julian_day_t _grib_accessor_class_julian_day{"julian_day"}; diff --git a/src/accessor/grib_accessor_class_ksec1expver.cc b/src/accessor/grib_accessor_class_ksec1expver.cc index 0b6d94754..0eb0af2c1 100644 --- a/src/accessor/grib_accessor_class_ksec1expver.cc +++ b/src/accessor/grib_accessor_class_ksec1expver.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_ksec1expver.h" grib_accessor_class_ksec1expver_t _grib_accessor_class_ksec1expver{"ksec1expver"}; diff --git a/src/accessor/grib_accessor_class_label.cc b/src/accessor/grib_accessor_class_label.cc index dfcecd887..5b9448399 100644 --- a/src/accessor/grib_accessor_class_label.cc +++ b/src/accessor/grib_accessor_class_label.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_label.h" grib_accessor_class_label_t _grib_accessor_class_label{"label"}; diff --git a/src/accessor/grib_accessor_class_latitudes.cc b/src/accessor/grib_accessor_class_latitudes.cc index c290c9f8e..ae2f718bd 100644 --- a/src/accessor/grib_accessor_class_latitudes.cc +++ b/src/accessor/grib_accessor_class_latitudes.cc @@ -9,16 +9,14 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_latitudes.h" -grib_accessor_class_latitudes_t _grib_accessor_class_latitudes{"latitudes"}; +grib_accessor_class_latitudes_t _grib_accessor_class_latitudes{ "latitudes" }; grib_accessor_class* grib_accessor_class_latitudes = &_grib_accessor_class_latitudes; - - static int get_distinct(grib_accessor* a, double** val, long* len); -int compare_doubles(const void* a, const void* b, int ascending){ +int compare_doubles(const void* a, const void* b, int ascending) +{ /* ascending is a boolean: 0 or 1 */ double* arg1 = (double*)a; double* arg2 = (double*)b; @@ -35,17 +33,20 @@ int compare_doubles(const void* a, const void* b, int ascending){ else return 1; } -int compare_doubles_ascending(const void* a, const void* b){ +int compare_doubles_ascending(const void* a, const void* b) +{ return compare_doubles(a, b, 1); } -int compare_doubles_descending(const void* a, const void* b){ +int compare_doubles_descending(const void* a, const void* b) +{ return compare_doubles(a, b, 0); } -void grib_accessor_class_latitudes_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_latitudes_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_double_t::init(a, l, c); grib_accessor_latitudes_t* self = (grib_accessor_latitudes_t*)a; - int n = 0; + int n = 0; self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); self->distinct = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); @@ -54,18 +55,19 @@ void grib_accessor_class_latitudes_t::init(grib_accessor* a, const long l, grib_ a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -int grib_accessor_class_latitudes_t::unpack_double(grib_accessor* a, double* val, size_t* len){ - grib_context* c = a->context; +int grib_accessor_class_latitudes_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ + grib_context* c = a->context; grib_accessor_latitudes_t* self = (grib_accessor_latitudes_t*)a; - int ret = 0; - double* v = val; - double dummyLon = 0; - size_t size = 0; - long count = 0; - grib_iterator* iter = NULL; + int ret = 0; + double* v = val; + double dummyLon = 0; + size_t size = 0; + long count = 0; + grib_iterator* iter = NULL; self->save = 1; - ret = value_count(a, &count); + ret = value_count(a, &count); if (ret) return ret; size = count; if (*len < size) { @@ -107,11 +109,12 @@ int grib_accessor_class_latitudes_t::unpack_double(grib_accessor* a, double* val return ret; } -int grib_accessor_class_latitudes_t::value_count(grib_accessor* a, long* len){ +int grib_accessor_class_latitudes_t::value_count(grib_accessor* a, long* len) +{ grib_accessor_latitudes_t* self = (grib_accessor_latitudes_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - grib_context* c = a->context; - double* val = NULL; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = a->context; + double* val = NULL; int ret; size_t size; @@ -138,20 +141,21 @@ int grib_accessor_class_latitudes_t::value_count(grib_accessor* a, long* len){ return ret; } -static int get_distinct(grib_accessor* a, double** val, long* len){ +static int get_distinct(grib_accessor* a, double** val, long* len) +{ long count = 0; double prev; double* v = NULL; double* v1 = NULL; double dummyLon = 0; - int ret = 0; + int ret = 0; int i; long jScansPositively = 0; /* default: north to south */ size_t size = *len; grib_context* c = a->context; // 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); + 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); diff --git a/src/accessor/grib_accessor_class_latlon_increment.cc b/src/accessor/grib_accessor_class_latlon_increment.cc index 66e0944ac..885a4cd61 100644 --- a/src/accessor/grib_accessor_class_latlon_increment.cc +++ b/src/accessor/grib_accessor_class_latlon_increment.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_latlon_increment.h" grib_accessor_class_latlon_increment_t _grib_accessor_class_latlon_increment{"latlon_increment"}; diff --git a/src/accessor/grib_accessor_class_latlonvalues.cc b/src/accessor/grib_accessor_class_latlonvalues.cc index 42a2b8c31..5d43d6be9 100644 --- a/src/accessor/grib_accessor_class_latlonvalues.cc +++ b/src/accessor/grib_accessor_class_latlonvalues.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_latlonvalues.h" grib_accessor_class_latlonvalues_t _grib_accessor_class_latlonvalues{"latlonvalues"}; diff --git a/src/accessor/grib_accessor_class_library_version.cc b/src/accessor/grib_accessor_class_library_version.cc index 61fafe279..527b4809a 100644 --- a/src/accessor/grib_accessor_class_library_version.cc +++ b/src/accessor/grib_accessor_class_library_version.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_library_version.h" grib_accessor_class_library_version_t _grib_accessor_class_library_version{"library_version"}; diff --git a/src/accessor/grib_accessor_class_local_definition.cc b/src/accessor/grib_accessor_class_local_definition.cc index b0633c698..0964a3005 100644 --- a/src/accessor/grib_accessor_class_local_definition.cc +++ b/src/accessor/grib_accessor_class_local_definition.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_local_definition.h" grib_accessor_class_local_definition_t _grib_accessor_class_local_definition{"local_definition"}; diff --git a/src/accessor/grib_accessor_class_long_vector.cc b/src/accessor/grib_accessor_class_long_vector.cc index 2ca32aa48..0aee8c8c9 100644 --- a/src/accessor/grib_accessor_class_long_vector.cc +++ b/src/accessor/grib_accessor_class_long_vector.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_long_vector.h" #include "grib_accessor_class_abstract_long_vector.h" diff --git a/src/accessor/grib_accessor_class_longitudes.cc b/src/accessor/grib_accessor_class_longitudes.cc index 68b89dc23..e25654c94 100644 --- a/src/accessor/grib_accessor_class_longitudes.cc +++ b/src/accessor/grib_accessor_class_longitudes.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_longitudes.h" grib_accessor_class_longitudes_t _grib_accessor_class_longitudes{"longitudes"}; diff --git a/src/accessor/grib_accessor_class_lookup.cc b/src/accessor/grib_accessor_class_lookup.cc index 3275b9d4e..17ccd4d61 100644 --- a/src/accessor/grib_accessor_class_lookup.cc +++ b/src/accessor/grib_accessor_class_lookup.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_lookup.h" grib_accessor_class_lookup_t _grib_accessor_class_lookup{"lookup"}; diff --git a/src/accessor/grib_accessor_class_mars_param.cc b/src/accessor/grib_accessor_class_mars_param.cc index 99012ca4f..feb5fc905 100644 --- a/src/accessor/grib_accessor_class_mars_param.cc +++ b/src/accessor/grib_accessor_class_mars_param.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_mars_param.h" grib_accessor_class_mars_param_t _grib_accessor_class_mars_param{"mars_param"}; diff --git a/src/accessor/grib_accessor_class_mars_step.cc b/src/accessor/grib_accessor_class_mars_step.cc index 40e198ba3..34d245998 100644 --- a/src/accessor/grib_accessor_class_mars_step.cc +++ b/src/accessor/grib_accessor_class_mars_step.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_mars_step.h" grib_accessor_class_mars_step_t _grib_accessor_class_mars_step{"mars_step"}; diff --git a/src/accessor/grib_accessor_class_md5.cc b/src/accessor/grib_accessor_class_md5.cc index 4cc9beaf0..40cbae672 100644 --- a/src/accessor/grib_accessor_class_md5.cc +++ b/src/accessor/grib_accessor_class_md5.cc @@ -9,17 +9,17 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_md5.h" #include "md5.h" -grib_accessor_class_md5_t _grib_accessor_class_md5{"md5"}; +grib_accessor_class_md5_t _grib_accessor_class_md5{ "md5" }; grib_accessor_class* grib_accessor_class_md5 = &_grib_accessor_class_md5; -void grib_accessor_class_md5_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_md5_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_gen_t::init(a, len, arg); - grib_accessor_md5_t* self = (grib_accessor_md5_t*)a; + grib_accessor_md5_t* self = (grib_accessor_md5_t*)a; char* b = 0; int n = 0; grib_string_list* current = 0; @@ -48,11 +48,13 @@ void grib_accessor_class_md5_t::init(grib_accessor* a, const long len, grib_argu a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } -int grib_accessor_class_md5_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_md5_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_STRING; } -int grib_accessor_class_md5_t::compare(grib_accessor* a, grib_accessor* b){ +int grib_accessor_class_md5_t::compare(grib_accessor* a, grib_accessor* b) +{ int retval = GRIB_SUCCESS; size_t alen = 0; @@ -60,11 +62,13 @@ int grib_accessor_class_md5_t::compare(grib_accessor* a, grib_accessor* b){ int err = 0; long count = 0; - err = a->value_count(&count); if (err) + err = a->value_count(&count); + if (err) return err; alen = count; - err = b->value_count(&count); if (err) + err = b->value_count(&count); + if (err) return err; blen = count; @@ -74,7 +78,8 @@ int grib_accessor_class_md5_t::compare(grib_accessor* a, grib_accessor* b){ return retval; } -int grib_accessor_class_md5_t::unpack_string(grib_accessor* a, char* v, size_t* len){ +int grib_accessor_class_md5_t::unpack_string(grib_accessor* a, char* v, size_t* len) +{ grib_accessor_md5_t* self = (grib_accessor_md5_t*)a; unsigned mess_len; unsigned char* mess; @@ -82,7 +87,7 @@ int grib_accessor_class_md5_t::unpack_string(grib_accessor* a, char* v, size_t* long offset = 0, length = 0; grib_string_list* blocklist = NULL; int ret = GRIB_SUCCESS; - long i = 0; + long i = 0; struct grib_md5_state md5c; if (*len < 32) { @@ -131,7 +136,8 @@ int grib_accessor_class_md5_t::unpack_string(grib_accessor* a, char* v, size_t* return ret; } -void grib_accessor_class_md5_t::destroy(grib_context* c, grib_accessor* a){ +void grib_accessor_class_md5_t::destroy(grib_context* c, grib_accessor* a) +{ grib_accessor_md5_t* self = (grib_accessor_md5_t*)a; if (self->blocklist) { grib_string_list* next = self->blocklist; @@ -146,7 +152,8 @@ void grib_accessor_class_md5_t::destroy(grib_context* c, grib_accessor* a){ grib_accessor_class_gen_t::destroy(c, a); } -int grib_accessor_class_md5_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_md5_t::value_count(grib_accessor* a, long* count) +{ *count = 1; /* ECC-1475 */ return 0; } diff --git a/src/accessor/grib_accessor_class_message.cc b/src/accessor/grib_accessor_class_message.cc index c855e067e..be704b1a1 100644 --- a/src/accessor/grib_accessor_class_message.cc +++ b/src/accessor/grib_accessor_class_message.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_message.h" grib_accessor_class_message_t _grib_accessor_class_message{"message"}; diff --git a/src/accessor/grib_accessor_class_message_copy.cc b/src/accessor/grib_accessor_class_message_copy.cc index 36490fb89..7927b6c60 100644 --- a/src/accessor/grib_accessor_class_message_copy.cc +++ b/src/accessor/grib_accessor_class_message_copy.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_message_copy.h" grib_accessor_class_message_copy_t _grib_accessor_class_message_copy{"message_copy"}; diff --git a/src/accessor/grib_accessor_class_multdouble.cc b/src/accessor/grib_accessor_class_multdouble.cc index ea5068291..cbe5b42da 100644 --- a/src/accessor/grib_accessor_class_multdouble.cc +++ b/src/accessor/grib_accessor_class_multdouble.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_multdouble.h" grib_accessor_class_multdouble_t _grib_accessor_class_multdouble{"multdouble"}; diff --git a/src/accessor/grib_accessor_class_non_alpha.cc b/src/accessor/grib_accessor_class_non_alpha.cc index 26401d764..68aaffdd7 100644 --- a/src/accessor/grib_accessor_class_non_alpha.cc +++ b/src/accessor/grib_accessor_class_non_alpha.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_non_alpha.h" grib_accessor_class_non_alpha_t _grib_accessor_class_non_alpha{"non_alpha"}; diff --git a/src/accessor/grib_accessor_class_number_of_coded_values.cc b/src/accessor/grib_accessor_class_number_of_coded_values.cc index 3cbcf7324..f1023dd2e 100644 --- a/src/accessor/grib_accessor_class_number_of_coded_values.cc +++ b/src/accessor/grib_accessor_class_number_of_coded_values.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_number_of_coded_values.h" grib_accessor_class_number_of_coded_values_t _grib_accessor_class_number_of_coded_values{"number_of_coded_values"}; diff --git a/src/accessor/grib_accessor_class_number_of_points.cc b/src/accessor/grib_accessor_class_number_of_points.cc index d1c164fac..c1b63f2a2 100644 --- a/src/accessor/grib_accessor_class_number_of_points.cc +++ b/src/accessor/grib_accessor_class_number_of_points.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_number_of_points.h" grib_accessor_class_number_of_points_t _grib_accessor_class_number_of_points{"number_of_points"}; diff --git a/src/accessor/grib_accessor_class_number_of_points_gaussian.cc b/src/accessor/grib_accessor_class_number_of_points_gaussian.cc index 909aa1b3d..9cabea10c 100644 --- a/src/accessor/grib_accessor_class_number_of_points_gaussian.cc +++ b/src/accessor/grib_accessor_class_number_of_points_gaussian.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_number_of_points_gaussian.h" grib_accessor_class_number_of_points_gaussian_t _grib_accessor_class_number_of_points_gaussian{"number_of_points_gaussian"}; diff --git a/src/accessor/grib_accessor_class_number_of_values.cc b/src/accessor/grib_accessor_class_number_of_values.cc index 1b8e9fd65..414cf5e05 100644 --- a/src/accessor/grib_accessor_class_number_of_values.cc +++ b/src/accessor/grib_accessor_class_number_of_values.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_number_of_values.h" grib_accessor_class_number_of_values_t _grib_accessor_class_number_of_values{"number_of_values"}; diff --git a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc index 1605faa21..b8f1d667b 100644 --- a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc +++ b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_number_of_values_data_raw_packing.h" grib_accessor_class_number_of_values_data_raw_packing_t _grib_accessor_class_number_of_values_data_raw_packing{"number_of_values_data_raw_packing"}; diff --git a/src/accessor/grib_accessor_class_octahedral_gaussian.cc b/src/accessor/grib_accessor_class_octahedral_gaussian.cc index a5e4c7a76..ca106dd4a 100644 --- a/src/accessor/grib_accessor_class_octahedral_gaussian.cc +++ b/src/accessor/grib_accessor_class_octahedral_gaussian.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_octahedral_gaussian.h" grib_accessor_class_octahedral_gaussian_t _grib_accessor_class_octahedral_gaussian{"octahedral_gaussian"}; diff --git a/src/accessor/grib_accessor_class_octet_number.cc b/src/accessor/grib_accessor_class_octet_number.cc index bb30500a4..4b270f257 100644 --- a/src/accessor/grib_accessor_class_octet_number.cc +++ b/src/accessor/grib_accessor_class_octet_number.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_octet_number.h" grib_accessor_class_octet_number_t _grib_accessor_class_octet_number{"octet_number"}; diff --git a/src/accessor/grib_accessor_class_offset_file.cc b/src/accessor/grib_accessor_class_offset_file.cc index 9bcb55f99..b52e8eb41 100644 --- a/src/accessor/grib_accessor_class_offset_file.cc +++ b/src/accessor/grib_accessor_class_offset_file.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_offset_file.h" grib_accessor_class_offset_file_t _grib_accessor_class_offset_file{"offset_file"}; diff --git a/src/accessor/grib_accessor_class_offset_values.cc b/src/accessor/grib_accessor_class_offset_values.cc index 700bdb0f4..26f78b5c3 100644 --- a/src/accessor/grib_accessor_class_offset_values.cc +++ b/src/accessor/grib_accessor_class_offset_values.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_offset_values.h" grib_accessor_class_offset_values_t _grib_accessor_class_offset_values{"offset_values"}; diff --git a/src/accessor/grib_accessor_class_optimal_step_units.cc b/src/accessor/grib_accessor_class_optimal_step_units.cc index 8df1db80e..3c725ec87 100644 --- a/src/accessor/grib_accessor_class_optimal_step_units.cc +++ b/src/accessor/grib_accessor_class_optimal_step_units.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_optimal_step_units.h" #include "step.h" #include "step_utilities.h" diff --git a/src/accessor/grib_accessor_class_pack_bufr_values.cc b/src/accessor/grib_accessor_class_pack_bufr_values.cc index 4c276ed42..08b80d607 100644 --- a/src/accessor/grib_accessor_class_pack_bufr_values.cc +++ b/src/accessor/grib_accessor_class_pack_bufr_values.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_pack_bufr_values.h" grib_accessor_class_pack_bufr_values_t _grib_accessor_class_pack_bufr_values{"pack_bufr_values"}; diff --git a/src/accessor/grib_accessor_class_packing_type.cc b/src/accessor/grib_accessor_class_packing_type.cc index 8be8c02aa..5dd862a07 100644 --- a/src/accessor/grib_accessor_class_packing_type.cc +++ b/src/accessor/grib_accessor_class_packing_type.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_packing_type.h" grib_accessor_class_packing_type_t _grib_accessor_class_packing_type{"packing_type"}; diff --git a/src/accessor/grib_accessor_class_pad.cc b/src/accessor/grib_accessor_class_pad.cc index aa6ff538f..345b510fb 100644 --- a/src/accessor/grib_accessor_class_pad.cc +++ b/src/accessor/grib_accessor_class_pad.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_pad.h" grib_accessor_class_pad_t _grib_accessor_class_pad{"pad"}; diff --git a/src/accessor/grib_accessor_class_padding.cc b/src/accessor/grib_accessor_class_padding.cc index 2dd0c6265..499c77f2b 100644 --- a/src/accessor/grib_accessor_class_padding.cc +++ b/src/accessor/grib_accessor_class_padding.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_padding.h" grib_accessor_class_padding_t _grib_accessor_class_padding{"padding"}; diff --git a/src/accessor/grib_accessor_class_padto.cc b/src/accessor/grib_accessor_class_padto.cc index d162403ed..110d8d858 100644 --- a/src/accessor/grib_accessor_class_padto.cc +++ b/src/accessor/grib_accessor_class_padto.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_padto.h" grib_accessor_class_padto_t _grib_accessor_class_padto{"padto"}; diff --git a/src/accessor/grib_accessor_class_padtoeven.cc b/src/accessor/grib_accessor_class_padtoeven.cc index ff6aef055..adf8b0d84 100644 --- a/src/accessor/grib_accessor_class_padtoeven.cc +++ b/src/accessor/grib_accessor_class_padtoeven.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_padtoeven.h" grib_accessor_class_padtoeven_t _grib_accessor_class_padtoeven{"padtoeven"}; diff --git a/src/accessor/grib_accessor_class_padtomultiple.cc b/src/accessor/grib_accessor_class_padtomultiple.cc index 88e4c6591..d4e463578 100644 --- a/src/accessor/grib_accessor_class_padtomultiple.cc +++ b/src/accessor/grib_accessor_class_padtomultiple.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_padtomultiple.h" grib_accessor_class_padtomultiple_t _grib_accessor_class_padtomultiple{"padtomultiple"}; diff --git a/src/accessor/grib_accessor_class_position.cc b/src/accessor/grib_accessor_class_position.cc index a8d6201d4..f1a429270 100644 --- a/src/accessor/grib_accessor_class_position.cc +++ b/src/accessor/grib_accessor_class_position.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_position.h" grib_accessor_class_position_t _grib_accessor_class_position{"position"}; diff --git a/src/accessor/grib_accessor_class_proj_string.cc b/src/accessor/grib_accessor_class_proj_string.cc index d55b277e0..f8c8e127f 100644 --- a/src/accessor/grib_accessor_class_proj_string.cc +++ b/src/accessor/grib_accessor_class_proj_string.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_proj_string.h" grib_accessor_class_proj_string_t _grib_accessor_class_proj_string{"proj_string"}; diff --git a/src/accessor/grib_accessor_class_raw.cc b/src/accessor/grib_accessor_class_raw.cc index 1473325a3..4a80b772a 100644 --- a/src/accessor/grib_accessor_class_raw.cc +++ b/src/accessor/grib_accessor_class_raw.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_raw.h" grib_accessor_class_raw_t _grib_accessor_class_raw{"raw"}; diff --git a/src/accessor/grib_accessor_class_rdbtime_guess_date.cc b/src/accessor/grib_accessor_class_rdbtime_guess_date.cc index 77d917757..173e0a3dc 100644 --- a/src/accessor/grib_accessor_class_rdbtime_guess_date.cc +++ b/src/accessor/grib_accessor_class_rdbtime_guess_date.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_rdbtime_guess_date.h" grib_accessor_class_rdbtime_guess_date_t _grib_accessor_class_rdbtime_guess_date{"rdbtime_guess_date"}; diff --git a/src/accessor/grib_accessor_class_reference_value_error.cc b/src/accessor/grib_accessor_class_reference_value_error.cc index 7329acaee..9a1dba20b 100644 --- a/src/accessor/grib_accessor_class_reference_value_error.cc +++ b/src/accessor/grib_accessor_class_reference_value_error.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_reference_value_error.h" grib_accessor_class_reference_value_error_t _grib_accessor_class_reference_value_error{"reference_value_error"}; diff --git a/src/accessor/grib_accessor_class_round.cc b/src/accessor/grib_accessor_class_round.cc index b1a114d0e..f56fa4a1c 100644 --- a/src/accessor/grib_accessor_class_round.cc +++ b/src/accessor/grib_accessor_class_round.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_round.h" grib_accessor_class_round_t _grib_accessor_class_round{"round"}; diff --git a/src/accessor/grib_accessor_class_scale.cc b/src/accessor/grib_accessor_class_scale.cc index 76deb2dc5..eb01412d2 100644 --- a/src/accessor/grib_accessor_class_scale.cc +++ b/src/accessor/grib_accessor_class_scale.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_scale.h" grib_accessor_class_scale_t _grib_accessor_class_scale{"scale"}; diff --git a/src/accessor/grib_accessor_class_scale_values.cc b/src/accessor/grib_accessor_class_scale_values.cc index dcb3e8a1a..03c5e0de2 100644 --- a/src/accessor/grib_accessor_class_scale_values.cc +++ b/src/accessor/grib_accessor_class_scale_values.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_scale_values.h" grib_accessor_class_scale_values_t _grib_accessor_class_scale_values{"scale_values"}; diff --git a/src/accessor/grib_accessor_class_second_order_bits_per_value.cc b/src/accessor/grib_accessor_class_second_order_bits_per_value.cc index 5d0075ad3..1c253764a 100644 --- a/src/accessor/grib_accessor_class_second_order_bits_per_value.cc +++ b/src/accessor/grib_accessor_class_second_order_bits_per_value.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_second_order_bits_per_value.h" #include "grib_scaling.h" diff --git a/src/accessor/grib_accessor_class_section_length.cc b/src/accessor/grib_accessor_class_section_length.cc index 3378d60c8..bcc75cc2b 100644 --- a/src/accessor/grib_accessor_class_section_length.cc +++ b/src/accessor/grib_accessor_class_section_length.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_section_length.h" grib_accessor_class_section_length_t _grib_accessor_class_section_length{"section_length"}; diff --git a/src/accessor/grib_accessor_class_section_padding.cc b/src/accessor/grib_accessor_class_section_padding.cc index d05abcd25..c3457898f 100644 --- a/src/accessor/grib_accessor_class_section_padding.cc +++ b/src/accessor/grib_accessor_class_section_padding.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_section_padding.h" grib_accessor_class_section_padding_t _grib_accessor_class_section_padding{"section_padding"}; diff --git a/src/accessor/grib_accessor_class_section_pointer.cc b/src/accessor/grib_accessor_class_section_pointer.cc index 93344acfc..72eb78d6d 100644 --- a/src/accessor/grib_accessor_class_section_pointer.cc +++ b/src/accessor/grib_accessor_class_section_pointer.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_section_pointer.h" grib_accessor_class_section_pointer_t _grib_accessor_class_section_pointer{"section_pointer"}; diff --git a/src/accessor/grib_accessor_class_select_step_template.cc b/src/accessor/grib_accessor_class_select_step_template.cc index 8de2bc24f..bc72a5220 100644 --- a/src/accessor/grib_accessor_class_select_step_template.cc +++ b/src/accessor/grib_accessor_class_select_step_template.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_select_step_template.h" grib_accessor_class_select_step_template_t _grib_accessor_class_select_step_template{"select_step_template"}; diff --git a/src/accessor/grib_accessor_class_sexagesimal2decimal.cc b/src/accessor/grib_accessor_class_sexagesimal2decimal.cc index 275ce2ff0..e1920c1b9 100644 --- a/src/accessor/grib_accessor_class_sexagesimal2decimal.cc +++ b/src/accessor/grib_accessor_class_sexagesimal2decimal.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_sexagesimal2decimal.h" grib_accessor_class_sexagesimal2decimal_t _grib_accessor_class_sexagesimal2decimal{"sexagesimal2decimal"}; diff --git a/src/accessor/grib_accessor_class_signed.cc b/src/accessor/grib_accessor_class_signed.cc index 84822b421..dea029231 100644 --- a/src/accessor/grib_accessor_class_signed.cc +++ b/src/accessor/grib_accessor_class_signed.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_signed.h" grib_accessor_class_signed_t _grib_accessor_class_signed{"signed"}; diff --git a/src/accessor/grib_accessor_class_signed_bits.cc b/src/accessor/grib_accessor_class_signed_bits.cc index c43f2c064..3da4d03c2 100644 --- a/src/accessor/grib_accessor_class_signed_bits.cc +++ b/src/accessor/grib_accessor_class_signed_bits.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_signed_bits.h" grib_accessor_class_signed_bits_t _grib_accessor_class_signed_bits{"signed_bits"}; diff --git a/src/accessor/grib_accessor_class_simple_packing_error.cc b/src/accessor/grib_accessor_class_simple_packing_error.cc index 3675b7d15..5f713a950 100644 --- a/src/accessor/grib_accessor_class_simple_packing_error.cc +++ b/src/accessor/grib_accessor_class_simple_packing_error.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_simple_packing_error.h" #include "grib_scaling.h" diff --git a/src/accessor/grib_accessor_class_size.cc b/src/accessor/grib_accessor_class_size.cc index 363cafd28..a9aa37f06 100644 --- a/src/accessor/grib_accessor_class_size.cc +++ b/src/accessor/grib_accessor_class_size.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_size.h" grib_accessor_class_size_t _grib_accessor_class_size{"size"}; diff --git a/src/accessor/grib_accessor_class_smart_table.cc b/src/accessor/grib_accessor_class_smart_table.cc index e26169656..2d18ade06 100644 --- a/src/accessor/grib_accessor_class_smart_table.cc +++ b/src/accessor/grib_accessor_class_smart_table.cc @@ -8,10 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - #include "grib_accessor_class_smart_table.h" #include diff --git a/src/accessor/grib_accessor_class_smart_table_column.cc b/src/accessor/grib_accessor_class_smart_table_column.cc index d04f63e5e..7d352471d 100644 --- a/src/accessor/grib_accessor_class_smart_table_column.cc +++ b/src/accessor/grib_accessor_class_smart_table_column.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_smart_table_column.h" #include "grib_accessor_class_smart_table.h" diff --git a/src/accessor/grib_accessor_class_spd.cc b/src/accessor/grib_accessor_class_spd.cc index 699ab6f9c..dd717ba3c 100644 --- a/src/accessor/grib_accessor_class_spd.cc +++ b/src/accessor/grib_accessor_class_spd.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_spd.h" grib_accessor_class_spd_t _grib_accessor_class_spd{"spd"}; diff --git a/src/accessor/grib_accessor_class_spectral_truncation.cc b/src/accessor/grib_accessor_class_spectral_truncation.cc index 5a51a416c..2fc45511f 100644 --- a/src/accessor/grib_accessor_class_spectral_truncation.cc +++ b/src/accessor/grib_accessor_class_spectral_truncation.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_spectral_truncation.h" grib_accessor_class_spectral_truncation_t _grib_accessor_class_spectral_truncation{"spectral_truncation"}; diff --git a/src/accessor/grib_accessor_class_sprintf.cc b/src/accessor/grib_accessor_class_sprintf.cc index 6c361604e..cc9e37e6a 100644 --- a/src/accessor/grib_accessor_class_sprintf.cc +++ b/src/accessor/grib_accessor_class_sprintf.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_sprintf.h" grib_accessor_class_sprintf_t _grib_accessor_class_sprintf{"sprintf"}; diff --git a/src/accessor/grib_accessor_class_statistics.cc b/src/accessor/grib_accessor_class_statistics.cc index f84731e0e..2d5cfd756 100644 --- a/src/accessor/grib_accessor_class_statistics.cc +++ b/src/accessor/grib_accessor_class_statistics.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_statistics.h" grib_accessor_class_statistics_t _grib_accessor_class_statistics{"statistics"}; diff --git a/src/accessor/grib_accessor_class_statistics_spectral.cc b/src/accessor/grib_accessor_class_statistics_spectral.cc index ea57cd2be..f2cfb6f35 100644 --- a/src/accessor/grib_accessor_class_statistics_spectral.cc +++ b/src/accessor/grib_accessor_class_statistics_spectral.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_statistics_spectral.h" grib_accessor_class_statistics_spectral_t _grib_accessor_class_statistics_spectral{"statistics_spectral"}; diff --git a/src/accessor/grib_accessor_class_step_human_readable.cc b/src/accessor/grib_accessor_class_step_human_readable.cc index ea6930f90..ea5280632 100644 --- a/src/accessor/grib_accessor_class_step_human_readable.cc +++ b/src/accessor/grib_accessor_class_step_human_readable.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_step_human_readable.h" grib_accessor_class_step_human_readable_t _grib_accessor_class_step_human_readable{"step_human_readable"}; diff --git a/src/accessor/grib_accessor_class_step_in_units.cc b/src/accessor/grib_accessor_class_step_in_units.cc index 1d6c0afb9..3bbdba009 100644 --- a/src/accessor/grib_accessor_class_step_in_units.cc +++ b/src/accessor/grib_accessor_class_step_in_units.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_step_in_units.h" #include "step.h" #include "step_utilities.h" diff --git a/src/accessor/grib_accessor_class_sum.cc b/src/accessor/grib_accessor_class_sum.cc index 5001e6b52..39b96854f 100644 --- a/src/accessor/grib_accessor_class_sum.cc +++ b/src/accessor/grib_accessor_class_sum.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_sum.h" grib_accessor_class_sum_t _grib_accessor_class_sum{"sum"}; diff --git a/src/accessor/grib_accessor_class_suppressed.cc b/src/accessor/grib_accessor_class_suppressed.cc index e205b782e..14d5932bc 100644 --- a/src/accessor/grib_accessor_class_suppressed.cc +++ b/src/accessor/grib_accessor_class_suppressed.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_suppressed.h" grib_accessor_class_suppressed_t _grib_accessor_class_suppressed{"suppressed"}; diff --git a/src/accessor/grib_accessor_class_time.cc b/src/accessor/grib_accessor_class_time.cc index ead200ca3..debb1a2f4 100644 --- a/src/accessor/grib_accessor_class_time.cc +++ b/src/accessor/grib_accessor_class_time.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_time.h" grib_accessor_class_time_t _grib_accessor_class_time{"time"}; diff --git a/src/accessor/grib_accessor_class_to_double.cc b/src/accessor/grib_accessor_class_to_double.cc index 51e6de3e1..854a32ffc 100644 --- a/src/accessor/grib_accessor_class_to_double.cc +++ b/src/accessor/grib_accessor_class_to_double.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_to_double.h" grib_accessor_class_to_double_t _grib_accessor_class_to_double{"to_double"}; diff --git a/src/accessor/grib_accessor_class_to_integer.cc b/src/accessor/grib_accessor_class_to_integer.cc index 9109ab603..bc58f31c6 100644 --- a/src/accessor/grib_accessor_class_to_integer.cc +++ b/src/accessor/grib_accessor_class_to_integer.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_to_integer.h" grib_accessor_class_to_integer_t _grib_accessor_class_to_integer{"to_integer"}; diff --git a/src/accessor/grib_accessor_class_to_string.cc b/src/accessor/grib_accessor_class_to_string.cc index 65f7a3647..4f1150ffb 100644 --- a/src/accessor/grib_accessor_class_to_string.cc +++ b/src/accessor/grib_accessor_class_to_string.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_to_string.h" grib_accessor_class_to_string_t _grib_accessor_class_to_string{"to_string"}; diff --git a/src/accessor/grib_accessor_class_transient_darray.cc b/src/accessor/grib_accessor_class_transient_darray.cc index 5ed3333db..d45ec3478 100644 --- a/src/accessor/grib_accessor_class_transient_darray.cc +++ b/src/accessor/grib_accessor_class_transient_darray.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_transient_darray.h" grib_accessor_class_transient_darray_t _grib_accessor_class_transient_darray{"transient_darray"}; diff --git a/src/accessor/grib_accessor_class_trim.cc b/src/accessor/grib_accessor_class_trim.cc index 8e0e45a6b..a7db4f3ff 100644 --- a/src/accessor/grib_accessor_class_trim.cc +++ b/src/accessor/grib_accessor_class_trim.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_trim.h" grib_accessor_class_trim_t _grib_accessor_class_trim{"trim"}; diff --git a/src/accessor/grib_accessor_class_uint16.cc b/src/accessor/grib_accessor_class_uint16.cc index b8476105c..1d9158ac0 100644 --- a/src/accessor/grib_accessor_class_uint16.cc +++ b/src/accessor/grib_accessor_class_uint16.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_uint16.h" grib_accessor_class_uint16_t _grib_accessor_class_uint16{"uint16"}; diff --git a/src/accessor/grib_accessor_class_uint32.cc b/src/accessor/grib_accessor_class_uint32.cc index 6465375b6..7518cb68c 100644 --- a/src/accessor/grib_accessor_class_uint32.cc +++ b/src/accessor/grib_accessor_class_uint32.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_uint32.h" grib_accessor_class_uint32_t _grib_accessor_class_uint32{"uint32"}; diff --git a/src/accessor/grib_accessor_class_uint32_little_endian.cc b/src/accessor/grib_accessor_class_uint32_little_endian.cc index 7800d30c0..b8733bd0a 100644 --- a/src/accessor/grib_accessor_class_uint32_little_endian.cc +++ b/src/accessor/grib_accessor_class_uint32_little_endian.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_uint32_little_endian.h" grib_accessor_class_uint32_little_endian_t _grib_accessor_class_uint32_little_endian{"uint32_little_endian"}; diff --git a/src/accessor/grib_accessor_class_uint64.cc b/src/accessor/grib_accessor_class_uint64.cc index 302702dab..4c79f7bb4 100644 --- a/src/accessor/grib_accessor_class_uint64.cc +++ b/src/accessor/grib_accessor_class_uint64.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_uint64.h" grib_accessor_class_uint64_t _grib_accessor_class_uint64{"uint64"}; diff --git a/src/accessor/grib_accessor_class_uint64_little_endian.cc b/src/accessor/grib_accessor_class_uint64_little_endian.cc index 80da3d903..81d0fed37 100644 --- a/src/accessor/grib_accessor_class_uint64_little_endian.cc +++ b/src/accessor/grib_accessor_class_uint64_little_endian.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_uint64_little_endian.h" grib_accessor_class_uint64_little_endian_t _grib_accessor_class_uint64_little_endian{"uint64_little_endian"}; diff --git a/src/accessor/grib_accessor_class_uint8.cc b/src/accessor/grib_accessor_class_uint8.cc index b86079a53..ce5d88f98 100644 --- a/src/accessor/grib_accessor_class_uint8.cc +++ b/src/accessor/grib_accessor_class_uint8.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_uint8.h" grib_accessor_class_uint8_t _grib_accessor_class_uint8{"uint8"}; diff --git a/src/accessor/grib_accessor_class_unexpanded_descriptors.cc b/src/accessor/grib_accessor_class_unexpanded_descriptors.cc index 4339691a9..f430b4864 100644 --- a/src/accessor/grib_accessor_class_unexpanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_unexpanded_descriptors.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_unexpanded_descriptors.h" grib_accessor_class_unexpanded_descriptors_t _grib_accessor_class_unexpanded_descriptors{"unexpanded_descriptors"}; diff --git a/src/accessor/grib_accessor_class_unpack_bufr_values.cc b/src/accessor/grib_accessor_class_unpack_bufr_values.cc index 4b3be3ad4..9942a64a8 100644 --- a/src/accessor/grib_accessor_class_unpack_bufr_values.cc +++ b/src/accessor/grib_accessor_class_unpack_bufr_values.cc @@ -9,16 +9,12 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_unpack_bufr_values.h" #include "grib_accessor_class_bufr_data_array.h" - - grib_accessor_class_unpack_bufr_values_t _grib_accessor_class_unpack_bufr_values{"unpack_bufr_values"}; grib_accessor_class* grib_accessor_class_unpack_bufr_values = &_grib_accessor_class_unpack_bufr_values; - void grib_accessor_class_unpack_bufr_values_t::init(grib_accessor* a, const long len, grib_arguments* params){ grib_accessor_class_gen_t::init(a, len, params); char* key; diff --git a/src/accessor/grib_accessor_class_unsigned_bits.cc b/src/accessor/grib_accessor_class_unsigned_bits.cc index 14c22d309..40088c17d 100644 --- a/src/accessor/grib_accessor_class_unsigned_bits.cc +++ b/src/accessor/grib_accessor_class_unsigned_bits.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_unsigned_bits.h" grib_accessor_class_unsigned_bits_t _grib_accessor_class_unsigned_bits{"unsigned_bits"}; diff --git a/src/accessor/grib_accessor_class_validity_date.cc b/src/accessor/grib_accessor_class_validity_date.cc index 8a62f296b..19c26bf48 100644 --- a/src/accessor/grib_accessor_class_validity_date.cc +++ b/src/accessor/grib_accessor_class_validity_date.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_validity_date.h" #include "shared_functions.h" diff --git a/src/accessor/grib_accessor_class_validity_time.cc b/src/accessor/grib_accessor_class_validity_time.cc index c74b44035..9cbc445cb 100644 --- a/src/accessor/grib_accessor_class_validity_time.cc +++ b/src/accessor/grib_accessor_class_validity_time.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_validity_time.h" #include "shared_functions.h" diff --git a/src/accessor/grib_accessor_class_values.cc b/src/accessor/grib_accessor_class_values.cc index 7def5b09e..5aa172a05 100644 --- a/src/accessor/grib_accessor_class_values.cc +++ b/src/accessor/grib_accessor_class_values.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_values.h" grib_accessor_class_values_t _grib_accessor_class_values{"values"}; diff --git a/src/accessor/grib_accessor_class_vector.cc b/src/accessor/grib_accessor_class_vector.cc index 36b252f95..bd0185d73 100644 --- a/src/accessor/grib_accessor_class_vector.cc +++ b/src/accessor/grib_accessor_class_vector.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_vector.h" #include "grib_accessor_class_abstract_vector.h" diff --git a/src/accessor/grib_accessor_class_when.cc b/src/accessor/grib_accessor_class_when.cc index 68b7196c3..2ab2652f0 100644 --- a/src/accessor/grib_accessor_class_when.cc +++ b/src/accessor/grib_accessor_class_when.cc @@ -9,7 +9,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" #include "grib_accessor_class_when.h" grib_accessor_class_when_t _grib_accessor_class_when{"when"}; From f6d42954d24df648ee17e853c5533a6979231caf Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 27 Apr 2024 14:39:23 +0100 Subject: [PATCH 089/196] Initialize all data members --- src/accessor/grib_accessor.cc | 20 ++++++++++---------- src/accessor/grib_accessor.h | 14 ++++++++------ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/accessor/grib_accessor.cc b/src/accessor/grib_accessor.cc index 08e50cb78..23c52c888 100644 --- a/src/accessor/grib_accessor.cc +++ b/src/accessor/grib_accessor.cc @@ -61,26 +61,26 @@ int grib_accessor::add_attribute(grib_accessor* attr, int nest_if_clash) { int id = 0; int idx = 0; - grib_accessor* same = NULL; - grib_accessor* aloc = this; + grib_accessor* pSame = NULL; + grib_accessor* pAloc = this; if (this->has_attributes()) { - same = this->get_attribute_index(attr->name, &id); + pSame = this->get_attribute_index(attr->name, &id); } - if (same) { + if (pSame) { if (nest_if_clash == 0) return GRIB_ATTRIBUTE_CLASH; - aloc = same; + pAloc = pSame; } for (id = 0; id < MAX_ACCESSOR_ATTRIBUTES; id++) { - if (aloc->attributes[id] == NULL) { + if (pAloc->attributes[id] == NULL) { // attr->parent=a->parent; - aloc->attributes[id] = attr; - attr->parent_as_attribute = aloc; - if (aloc->same) - attr->same = aloc->same->get_attribute_index(attr->name, &idx); + pAloc->attributes[id] = attr; + attr->parent_as_attribute = pAloc; + if (pAloc->same) + attr->same = pAloc->same->get_attribute_index(attr->name, &idx); grib_context_log(this->context, GRIB_LOG_DEBUG, "added attribute %s->%s", this->name, attr->name); return GRIB_SUCCESS; diff --git a/src/accessor/grib_accessor.h b/src/accessor/grib_accessor.h index c18a355d2..7fe8aad19 100644 --- a/src/accessor/grib_accessor.h +++ b/src/accessor/grib_accessor.h @@ -16,7 +16,11 @@ class grib_accessor { public: - grib_accessor() : name(nullptr), name_space(nullptr), context(nullptr), h(nullptr), creator(nullptr), length(0), offset(0), parent(nullptr), next_(nullptr), previous_(nullptr), cclass(nullptr), flags(0), sub_section(nullptr), dirty(0), same(nullptr), loop(0), vvalue(nullptr), set(nullptr), parent_as_attribute(nullptr) {} + grib_accessor() : + name(nullptr), name_space(nullptr), context(nullptr), h(nullptr), creator(nullptr), + length(0), offset(0), parent(nullptr), next_(nullptr), previous_(nullptr), cclass(nullptr), + flags(0), sub_section(nullptr), dirty(0), same(nullptr), loop(0), vvalue(nullptr), + set(nullptr), parent_as_attribute(nullptr) {} virtual ~grib_accessor() {} virtual void init_accessor(const long, grib_arguments*) = 0; @@ -78,15 +82,15 @@ class grib_accessor unsigned long flags; /** < Various flags */ grib_section* sub_section; - const char* all_names[MAX_ACCESSOR_NAMES]; /** < name of the accessor */ - const char* all_name_spaces[MAX_ACCESSOR_NAMES]; /** < namespace to which the accessor belongs */ + const char* all_names[MAX_ACCESSOR_NAMES]= {0,}; /** < name of the accessor */ + const char* all_name_spaces[MAX_ACCESSOR_NAMES] = {0,}; /** < namespace to which the accessor belongs */ int dirty; grib_accessor* same; /** < accessors with the same name */ long loop; /** < used in lists */ grib_virtual_value* vvalue; /** < virtual value used when transient flag on **/ const char* set; - grib_accessor* attributes[MAX_ACCESSOR_ATTRIBUTES]; /** < attributes are accessors */ + grib_accessor* attributes[MAX_ACCESSOR_ATTRIBUTES] = {0,}; /** < attributes are accessors */ grib_accessor* parent_as_attribute; }; @@ -141,5 +145,3 @@ class grib_accessor_class virtual int clear(grib_accessor*) = 0; virtual grib_accessor* make_clone(grib_accessor*, grib_section*, int*) = 0; }; - - From b250b23246cfac45352d87aca3594d33aaa8f4a8 Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 29 Apr 2024 16:51:26 +0100 Subject: [PATCH 090/196] Cosmetics --- src/grib_accessor_class_bitmap.cc | 2 +- src/grib_accessor_class_data_g22order_packing.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/grib_accessor_class_bitmap.cc b/src/grib_accessor_class_bitmap.cc index b86b34332..c5be0ebbb 100644 --- a/src/grib_accessor_class_bitmap.cc +++ b/src/grib_accessor_class_bitmap.cc @@ -214,7 +214,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) template static int unpack(grib_accessor* a, T* val, size_t* len) { - static_assert(std::is_floating_point::value, "Requires floating points numbers"); + static_assert(std::is_floating_point::value, "Requires floating point numbers"); long pos = a->offset * 8; long tlen; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/grib_accessor_class_data_g22order_packing.cc b/src/grib_accessor_class_data_g22order_packing.cc index 4ed535d29..954456e2e 100644 --- a/src/grib_accessor_class_data_g22order_packing.cc +++ b/src/grib_accessor_class_data_g22order_packing.cc @@ -509,7 +509,7 @@ static int post_process(grib_context* c, long* vals, long len, long order, long template static int unpack(grib_accessor* a, T* val, const size_t* len) { - static_assert(std::is_floating_point::value, "Requires floating points numbers"); + static_assert(std::is_floating_point::value, "Requires floating point numbers"); grib_accessor_data_g22order_packing* self = reinterpret_cast(a); const char* cclass_name = a->cclass->name; grib_handle* gh = grib_handle_of_accessor(a); From cc51075dc6190b80f8170220236a9b45823b7b43 Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 30 Apr 2024 08:36:28 +0100 Subject: [PATCH 091/196] Testing: Catch error messages --- tests/pseudo_budg.sh | 3 +++ tests/pseudo_diag.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tests/pseudo_budg.sh b/tests/pseudo_budg.sh index 4c50789d8..9c793a718 100755 --- a/tests/pseudo_budg.sh +++ b/tests/pseudo_budg.sh @@ -17,6 +17,9 @@ tempOut=temp.$label.txt tempRef=temp.$label.ref tempBud=temp.$label.bud +# Abort if any error messages are posted +export ECCODES_FAIL_IF_LOG_MESSAGE=1 + ${tools_dir}/grib_ls -j ${data_dir}/budg > $tempOut cat > $tempRef << EOF { "messages" : [ diff --git a/tests/pseudo_diag.sh b/tests/pseudo_diag.sh index 50208a45e..af45d6aea 100755 --- a/tests/pseudo_diag.sh +++ b/tests/pseudo_diag.sh @@ -20,6 +20,9 @@ REDIRECT=/dev/null sample=$ECCODES_SAMPLES_PATH/diag.tmpl +# Abort if any error messages are posted +export ECCODES_FAIL_IF_LOG_MESSAGE=1 + # Basic grib commands should not fail # ------------------------------------ ${tools_dir}/grib_ls $sample > $REDIRECT From f55015ee1018b43a7ddb5b5e81cfa1aa7d3bf0fc Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 30 Apr 2024 08:40:44 +0100 Subject: [PATCH 092/196] Testing: Catch error messages (Setting integer values double array) --- tests/pseudo_budg.sh | 3 +++ tests/pseudo_diag.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tests/pseudo_budg.sh b/tests/pseudo_budg.sh index 4c50789d8..9c793a718 100755 --- a/tests/pseudo_budg.sh +++ b/tests/pseudo_budg.sh @@ -17,6 +17,9 @@ tempOut=temp.$label.txt tempRef=temp.$label.ref tempBud=temp.$label.bud +# Abort if any error messages are posted +export ECCODES_FAIL_IF_LOG_MESSAGE=1 + ${tools_dir}/grib_ls -j ${data_dir}/budg > $tempOut cat > $tempRef << EOF { "messages" : [ diff --git a/tests/pseudo_diag.sh b/tests/pseudo_diag.sh index 50208a45e..af45d6aea 100755 --- a/tests/pseudo_diag.sh +++ b/tests/pseudo_diag.sh @@ -20,6 +20,9 @@ REDIRECT=/dev/null sample=$ECCODES_SAMPLES_PATH/diag.tmpl +# Abort if any error messages are posted +export ECCODES_FAIL_IF_LOG_MESSAGE=1 + # Basic grib commands should not fail # ------------------------------------ ${tools_dir}/grib_ls $sample > $REDIRECT From a9e361fb9655205ad548aabf62e265e3d9da091e Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 30 Apr 2024 17:13:31 +0100 Subject: [PATCH 093/196] ECC-1817: Tools documentation: grib_compare/bufr_compare '-f' option --- tools/bufr_compare.cc | 2 +- tools/grib_compare.cc | 2 +- tools/gts_compare.cc | 2 +- tools/metar_compare.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/bufr_compare.cc b/tools/bufr_compare.cc index e0447e20b..325c67cd3 100644 --- a/tools/bufr_compare.cc +++ b/tools/bufr_compare.cc @@ -26,7 +26,7 @@ grib_option grib_options[] = { { "A:", 0, 0, 0, 1, 0 }, { "t:", "factor", "Compare data values using factor multiplied by the tolerance specified in options -R -A.\n", 0, 1, 0 }, { "w:", 0, 0, 0, 1, 0 }, - { "f", 0, 0, 0, 1, 0 }, + { "f", 0, "Forcefully compare, do not stop after first difference.\n", 0, 1, 0 }, { "F", 0, 0, 1, 0, 0 }, { "q", 0, 0, 1, 0, 0 }, { "M", 0, 0, 1, 0, 0 }, diff --git a/tools/grib_compare.cc b/tools/grib_compare.cc index 558ff0386..ba86c1a1f 100644 --- a/tools/grib_compare.cc +++ b/tools/grib_compare.cc @@ -27,7 +27,7 @@ grib_option grib_options[] = { { "P", 0, "Compare data values using the packing error as tolerance.\n", 0, 1, 0 }, { "T:", "factor", "Compare data values using factor multiplied by the tolerance specified in options -P -R -A.\n", 0, 1, 0 }, { "w:", 0, 0, 0, 1, 0 }, - { "f", 0, 0, 0, 1, 0 }, + { "f", 0, "Forcefully compare, do not stop after first difference.\n", 0, 1, 0 }, { "F", 0, 0, 1, 0, 0 }, { "q", 0, 0, 1, 0, 0 }, { "M", 0, 0, 1, 0, 0 }, diff --git a/tools/gts_compare.cc b/tools/gts_compare.cc index 1dc362059..d5cd47126 100644 --- a/tools/gts_compare.cc +++ b/tools/gts_compare.cc @@ -23,7 +23,7 @@ grib_option grib_options[] = { /*{"R:",0,0,0,1,0},*/ /*{"A:",0,0,0,1,0},*/ { "w:", 0, 0, 0, 1, 0 }, - { "f", 0, 0, 0, 1, 0 }, + { "f", 0, "Forcefully compare, do not stop after first difference.\n", 0, 1, 0 }, { "F", 0, 0, 1, 0, 0 }, { "q", 0, 0, 1, 0, 0 }, { "I", 0, 0, 1, 0, 0 }, diff --git a/tools/metar_compare.cc b/tools/metar_compare.cc index a86cafd0d..d5aa9315b 100644 --- a/tools/metar_compare.cc +++ b/tools/metar_compare.cc @@ -20,7 +20,7 @@ grib_option grib_options[] = { { "R:", 0, 0, 0, 1, 0 }, { "A:", 0, 0, 0, 1, 0 }, { "w:", 0, 0, 0, 1, 0 }, - { "f", 0, 0, 0, 1, 0 }, + { "f", 0, "Forcefully compare, do not stop after first difference.\n", 0, 1, 0 }, { "F", 0, 0, 1, 0, 0 }, { "q", 0, 0, 1, 0, 0 }, { "I", 0, 0, 1, 0, 0 }, From 7d49e7b87acc8a14bcd48ba89f8ad5025c423d76 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 1 May 2024 14:20:26 +0100 Subject: [PATCH 094/196] Compiler warning: parameter 'err' set but not used --- tests/CMakeLists.txt | 3 +++ tests/grib_histogram.sh | 21 ++++++++++++++++++++ tests/grib_to_json.sh | 43 +++++++++++++++++++++++++++++++++++++++++ tests/grib_to_ppm.sh | 24 +++++++++++++++++++++++ tools/metar_compare.cc | 4 ++-- 5 files changed, 93 insertions(+), 2 deletions(-) create mode 100755 tests/grib_histogram.sh create mode 100755 tests/grib_to_json.sh create mode 100755 tests/grib_to_ppm.sh diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 56bfa91ed..31d1b744f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -226,6 +226,9 @@ if( HAVE_BUILD_TOOLS ) grib_keys_iter grib_keys_iter_skip grib_geo_iter + grib_to_json + grib_to_ppm + grib_histogram bufr_get_element bufr_wmo_tables bufr_extract_headers diff --git a/tests/grib_histogram.sh b/tests/grib_histogram.sh new file mode 100755 index 000000000..c5b56ab22 --- /dev/null +++ b/tests/grib_histogram.sh @@ -0,0 +1,21 @@ +#!/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_histogram_test" +REDIRECT=/dev/null +tempOut=temp.$label.txt + +${tools_dir}/grib_histogram $ECCODES_SAMPLES_PATH/GRIB1.tmpl > $tempOut +${tools_dir}/grib_histogram $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempOut + +# Clean up +rm -f $tempOut diff --git a/tests/grib_to_json.sh b/tests/grib_to_json.sh new file mode 100755 index 000000000..be05aa00c --- /dev/null +++ b/tests/grib_to_json.sh @@ -0,0 +1,43 @@ +#!/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_to_json_test" +REDIRECT=/dev/null +tempOut=temp.$label.txt + +if [ ! -x "${tools_dir}/grib_to_json" ]; then + exit 0 +fi + +# Currently only works for GRIB edition 1 !!! +${tools_dir}/grib_to_json $ECCODES_SAMPLES_PATH/GRIB1.tmpl > $tempOut + +# Decide if we have the JSON verifier commandline utility +JSON_VERIF="json_xs" +JSON_CHECK="" +if command -v $JSON_VERIF >/dev/null 2>&1; then + JSON_CHECK=$JSON_VERIF +fi + +# Check the json_xs command actually works! +set +e +echo '[]' | json_xs > $REDIRECT 2>&1 +if [ $? -ne 0 ]; then JSON_CHECK=""; fi +set -e +echo "Using $JSON_CHECK ..." + +if test "x$JSON_CHECK" != "x"; then + json_xs < $tempOut >$REDIRECT 2> $REDIRECT +fi + +# Clean up +rm -f $tempOut diff --git a/tests/grib_to_ppm.sh b/tests/grib_to_ppm.sh new file mode 100755 index 000000000..470f169ff --- /dev/null +++ b/tests/grib_to_ppm.sh @@ -0,0 +1,24 @@ +#!/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_to_ppm_test" +tempOut=temp.$label.txt + +if [ ! -x "${tools_dir}/grib2ppm" ]; then + exit 0 +fi + +${tools_dir}/grib2ppm $ECCODES_SAMPLES_PATH/GRIB1.tmpl > $tempOut +${tools_dir}/grib2ppm $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempOut + +# Clean up +rm -f $tempOut diff --git a/tools/metar_compare.cc b/tools/metar_compare.cc index d5aa9315b..6ffc5db5a 100644 --- a/tools/metar_compare.cc +++ b/tools/metar_compare.cc @@ -713,7 +713,7 @@ static int compare_values(const grib_runtime_options* options, grib_handle* h1, return GRIB_SUCCESS; } -static int compare_all_dump_keys(grib_handle* h1, grib_handle* h2, grib_runtime_options* options, int* err) +static int compare_all_dump_keys(grib_handle* h1, grib_handle* h2, grib_runtime_options* options, int* pErr) { int ret = 0; const char* name = NULL; @@ -733,7 +733,7 @@ static int compare_all_dump_keys(grib_handle* h1, grib_handle* h2, grib_runtime_ if (xa == NULL || (xa->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) continue; if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { - err++; + (*pErr)++; write_messages(h1, h2); ret = 1; } From 147bdc429083a2fa28bfdb9267349f4acc1e477f Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 1 May 2024 14:29:46 +0100 Subject: [PATCH 095/196] Compiler warning: parameter 'err' set but not used --- tools/gts_compare.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gts_compare.cc b/tools/gts_compare.cc index d5cd47126..3a084893d 100644 --- a/tools/gts_compare.cc +++ b/tools/gts_compare.cc @@ -559,7 +559,7 @@ static int compare_values(const grib_runtime_options* options, grib_handle* h1, return GRIB_SUCCESS; } -static int compare_all_dump_keys(grib_handle* h1, grib_handle* h2, grib_runtime_options* options, int* err) +static int compare_all_dump_keys(grib_handle* h1, grib_handle* h2, grib_runtime_options* options, int* pErr) { int ret = 0; const char* name = NULL; @@ -580,7 +580,7 @@ static int compare_all_dump_keys(grib_handle* h1, grib_handle* h2, grib_runtime_ if (xa == NULL || (xa->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) continue; if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { - err++; + (*pErr)++; write_messages(h1, h2); ret = 1; } From 7688705e4d03fa9cb96eeb2da267b36372956132 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 1 May 2024 15:49:54 +0100 Subject: [PATCH 096/196] Test generator --- tests/create_test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/create_test.sh b/tests/create_test.sh index 3be842e8e..a63abcb5f 100755 --- a/tests/create_test.sh +++ b/tests/create_test.sh @@ -43,6 +43,7 @@ tempGrib=temp.\$label.grib tempBufr=temp.\$label.bufr tempFilt=temp.\$label.filt tempLog=temp.\$label.log +tempOut=temp.\$label.txt tempRef=temp.\$label.ref sample_grib2=\$ECCODES_SAMPLES_PATH/GRIB2.tmpl @@ -61,7 +62,8 @@ sample_bufr4=\$ECCODES_SAMPLES_PATH/BUFR4.tmpl #\${tools_dir}/bufr_set #... -rm -f \$tempGrib \$tempBufr \$tempFilt \$tempLog \$tempRef +# Clean up +rm -f \$tempGrib \$tempBufr \$tempFilt \$tempLog \$tempOut \$tempRef EOF echo >&2 From a76e0f57d395426f84b75158c06be432bd95853e Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 1 May 2024 15:50:18 +0100 Subject: [PATCH 097/196] Testing: Extra tools --- tests/CMakeLists.txt | 1 + tests/grib_list_keys.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 tests/grib_list_keys.sh diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 31d1b744f..b26747382 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -228,6 +228,7 @@ if( HAVE_BUILD_TOOLS ) grib_geo_iter grib_to_json grib_to_ppm + grib_list_keys grib_histogram bufr_get_element bufr_wmo_tables diff --git a/tests/grib_list_keys.sh b/tests/grib_list_keys.sh new file mode 100755 index 000000000..c93a8fc63 --- /dev/null +++ b/tests/grib_list_keys.sh @@ -0,0 +1,21 @@ +#!/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_list_keys_test" +tempOut=temp.$label.txt + +if [ -d "$ECCODES_DEFINITION_PATH" ]; then + ${tools_dir}/grib_list_keys $ECCODES_DEFINITION_PATH/boot.def +fi + +# Clean up +rm -f $tempOut From 906a395cc58bed789c4687f7149e24c1da594acc Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 1 May 2024 16:02:43 +0100 Subject: [PATCH 098/196] Testing: Fix broken test --- tests/grib_list_keys.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/grib_list_keys.sh b/tests/grib_list_keys.sh index c93a8fc63..c5b71cb07 100755 --- a/tests/grib_list_keys.sh +++ b/tests/grib_list_keys.sh @@ -14,7 +14,9 @@ label="grib_list_keys_test" tempOut=temp.$label.txt if [ -d "$ECCODES_DEFINITION_PATH" ]; then - ${tools_dir}/grib_list_keys $ECCODES_DEFINITION_PATH/boot.def + if [ -x "${tools_dir}/grib_list_keys" ]; then + ${tools_dir}/grib_list_keys $ECCODES_DEFINITION_PATH/boot.def + fi fi # Clean up From 49d742eabe894806e06d70b4b08e96e7e95a9bbb Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 1 May 2024 18:08:34 +0100 Subject: [PATCH 099/196] Testing: grib_sub_area_check --- tests/CMakeLists.txt | 1 + tests/grib_sub_area_check.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 tests/grib_sub_area_check.sh diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b26747382..43dd441cd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -228,6 +228,7 @@ if( HAVE_BUILD_TOOLS ) grib_geo_iter grib_to_json grib_to_ppm + grib_sub_area_check grib_list_keys grib_histogram bufr_get_element diff --git a/tests/grib_sub_area_check.sh b/tests/grib_sub_area_check.sh new file mode 100755 index 000000000..a80ea6be7 --- /dev/null +++ b/tests/grib_sub_area_check.sh @@ -0,0 +1,29 @@ +#!/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_sub_area_check_test" +tempOut=temp.$label.txt + +if [ ! -x "${tools_dir}/gg_sub_area_check" ]; then + exit 0 +fi + +f1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +f2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +${tools_dir}/gg_sub_area_check $f1 $f2 > $tempOut + +f1=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib1.tmpl +f2=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl +${tools_dir}/gg_sub_area_check $f1 $f2 > $tempOut + +# Clean up +rm -f $tempOut From 6874520bfc48a589b614f6d53e4ccc70d0219431 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 1 May 2024 21:41:59 +0100 Subject: [PATCH 100/196] Testing: grib_to_ppm and grib_sub_area_check --- tests/grib_sub_area_check.sh | 6 ++++++ tests/grib_to_ppm.sh | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/tests/grib_sub_area_check.sh b/tests/grib_sub_area_check.sh index a80ea6be7..9b602e4cb 100755 --- a/tests/grib_sub_area_check.sh +++ b/tests/grib_sub_area_check.sh @@ -17,6 +17,12 @@ if [ ! -x "${tools_dir}/gg_sub_area_check" ]; then exit 0 fi +set +e +${tools_dir}/gg_sub_area_check +status=$? +set -e +[ $status -ne 0 ] + f1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl f2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl ${tools_dir}/gg_sub_area_check $f1 $f2 > $tempOut diff --git a/tests/grib_to_ppm.sh b/tests/grib_to_ppm.sh index 470f169ff..0b2f63308 100755 --- a/tests/grib_to_ppm.sh +++ b/tests/grib_to_ppm.sh @@ -17,6 +17,11 @@ if [ ! -x "${tools_dir}/grib2ppm" ]; then exit 0 fi +# No options +${tools_dir}/grib2ppm + +${tools_dir}/grib2ppm -l 6 -u 7 -c $data_dir/sample.grib2 > $tempOut + ${tools_dir}/grib2ppm $ECCODES_SAMPLES_PATH/GRIB1.tmpl > $tempOut ${tools_dir}/grib2ppm $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempOut From 1f335a011e88e85c4a6909cdbad071581fd25b48 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 1 May 2024 21:53:06 +0100 Subject: [PATCH 101/196] Testing: big2gribex --- tests/CMakeLists.txt | 1 + tests/big2gribex.sh | 23 +++++++++++++++++++++++ tools/big2gribex.cc | 21 ++++++--------------- 3 files changed, 30 insertions(+), 15 deletions(-) create mode 100755 tests/big2gribex.sh diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 43dd441cd..1508b820a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -228,6 +228,7 @@ if( HAVE_BUILD_TOOLS ) grib_geo_iter grib_to_json grib_to_ppm + big2gribex grib_sub_area_check grib_list_keys grib_histogram diff --git a/tests/big2gribex.sh b/tests/big2gribex.sh new file mode 100755 index 000000000..c8c0b6098 --- /dev/null +++ b/tests/big2gribex.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="big2gribex_test" +tempGrib=temp.$label.grib + +if [ ! -x ${tools_dir}/big2gribex ]; then + exit 0 +fi + +${tools_dir}/big2gribex $data_dir/test.grib1 $tempGrib + +# Clean up +rm -f $tempGrib diff --git a/tools/big2gribex.cc b/tools/big2gribex.cc index a36b01126..c2797a821 100644 --- a/tools/big2gribex.cc +++ b/tools/big2gribex.cc @@ -8,18 +8,16 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/* - * Implementation: big2gribex - * - * Description: - * - */ - #include #include #include "grib_api.h" -void usage(char*); + +static void usage(const char* progname) +{ + printf("\nUsage: %s grib_in grib_out\n", progname); + exit(1); +} int main(int argc, char* argv[]) { @@ -70,12 +68,5 @@ int main(int argc, char* argv[]) exit(1); } - return 0; } - -void usage(char* progname) -{ - printf("\nUsage: %s grib_in grib_out\n", progname); - exit(1); -} From 3ffb5a6bd0cceb25c201d8d370984fe6788dc6b1 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 2 May 2024 08:23:00 +0100 Subject: [PATCH 102/196] Testing: grib_merge --- tests/CMakeLists.txt | 1 + tests/grib_list_keys.sh | 5 ++++- tests/grib_merge.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 tests/grib_merge.sh diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1508b820a..ac0f133de 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -228,6 +228,7 @@ if( HAVE_BUILD_TOOLS ) grib_geo_iter grib_to_json grib_to_ppm + grib_merge big2gribex grib_sub_area_check grib_list_keys diff --git a/tests/grib_list_keys.sh b/tests/grib_list_keys.sh index c5b71cb07..c58bddc96 100755 --- a/tests/grib_list_keys.sh +++ b/tests/grib_list_keys.sh @@ -15,7 +15,10 @@ tempOut=temp.$label.txt if [ -d "$ECCODES_DEFINITION_PATH" ]; then if [ -x "${tools_dir}/grib_list_keys" ]; then - ${tools_dir}/grib_list_keys $ECCODES_DEFINITION_PATH/boot.def + ${tools_dir}/grib_list_keys $ECCODES_DEFINITION_PATH/boot.def > $tempOut + ${tools_dir}/grib_list_keys $ECCODES_DEFINITION_PATH/grib2/template.4.2000.def > $tempOut + ${tools_dir}/grib_list_keys $ECCODES_DEFINITION_PATH/grib2/template.3.0.def > $tempOut + ${tools_dir}/grib_list_keys $ECCODES_DEFINITION_PATH/grib2/template.3.120.def > $tempOut fi fi diff --git a/tests/grib_merge.sh b/tests/grib_merge.sh new file mode 100755 index 000000000..33c7960ce --- /dev/null +++ b/tests/grib_merge.sh @@ -0,0 +1,26 @@ +#!/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_merge_test" + +tempGrib=temp.$label.grib +tempFilt=temp.$label.filt +tempLog=temp.$label.log +tempOut=temp.$label.txt +tempRef=temp.$label.ref + +f1=$ECCODES_SAMPLES_PATH/regular_ll_pl_grib1.tmpl +f2=$ECCODES_SAMPLES_PATH/regular_ll_sfc_grib1.tmpl +${tools_dir}/grib_merge $f1 $f2 $tempGrib + +# Clean up +rm -f $tempGrib $tempFilt $tempLog $tempOut $tempRef From 8168444b122fc731afb9537baef41c5d14611a42 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 2 May 2024 08:29:38 +0100 Subject: [PATCH 103/196] Testing: grib_merge --- tests/grib_merge.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/grib_merge.sh b/tests/grib_merge.sh index 33c7960ce..acf59e7a6 100755 --- a/tests/grib_merge.sh +++ b/tests/grib_merge.sh @@ -13,14 +13,10 @@ label="grib_merge_test" tempGrib=temp.$label.grib -tempFilt=temp.$label.filt -tempLog=temp.$label.log -tempOut=temp.$label.txt -tempRef=temp.$label.ref f1=$ECCODES_SAMPLES_PATH/regular_ll_pl_grib1.tmpl f2=$ECCODES_SAMPLES_PATH/regular_ll_sfc_grib1.tmpl ${tools_dir}/grib_merge $f1 $f2 $tempGrib # Clean up -rm -f $tempGrib $tempFilt $tempLog $tempOut $tempRef +rm -f $tempGrib From e06656c67309faf2d68517ce5d193e8008a4be97 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 May 2024 08:50:21 +0000 Subject: [PATCH 104/196] Testing: Fix grib2ppm test --- tests/grib_to_ppm.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/grib_to_ppm.sh b/tests/grib_to_ppm.sh index 0b2f63308..6deea0f8a 100755 --- a/tests/grib_to_ppm.sh +++ b/tests/grib_to_ppm.sh @@ -21,9 +21,7 @@ fi ${tools_dir}/grib2ppm ${tools_dir}/grib2ppm -l 6 -u 7 -c $data_dir/sample.grib2 > $tempOut - -${tools_dir}/grib2ppm $ECCODES_SAMPLES_PATH/GRIB1.tmpl > $tempOut -${tools_dir}/grib2ppm $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempOut +${tools_dir}/grib2ppm $data_dir/sample.grib2 > $tempOut # Clean up rm -f $tempOut From 607f15bbdcba70fb9ae696e97626baf9ef784726 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 2 May 2024 10:54:23 +0100 Subject: [PATCH 105/196] Tools: Fix for Windows and constant fields --- tools/grib2ppm.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/grib2ppm.cc b/tools/grib2ppm.cc index cac306481..820178789 100644 --- a/tools/grib2ppm.cc +++ b/tools/grib2ppm.cc @@ -122,7 +122,7 @@ int main(int argc, char* argv[]) continue; } - f = fopen(argv[i], "r"); + f = fopen(argv[i], "rb"); if (!f) { perror(argv[i]); exit(1); @@ -226,7 +226,9 @@ int main(int argc, char* argv[]) if (v > ucap) { v = ucap; } - c = (v - min) * 65535 / (max - min); + double denom = 1; + if (max != min) denom = max - min; + c = (v - min) * 65535 / denom; hh = c >> 8; l = c & 0xff; printf("%c", hh); From c04bc4fa03e3b19d9f83d5ab9cd01ebad54ae8d2 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 May 2024 10:25:11 +0000 Subject: [PATCH 106/196] ECC-1818: GRIB Geoiterator issues for Lambert azimuthal equal area --- ...b_iterator_class_lambert_azimuthal_equal_area.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/grib_iterator_class_lambert_azimuthal_equal_area.cc b/src/grib_iterator_class_lambert_azimuthal_equal_area.cc index a945ee1d2..24dba1877 100644 --- a/src/grib_iterator_class_lambert_azimuthal_equal_area.cc +++ b/src/grib_iterator_class_lambert_azimuthal_equal_area.cc @@ -209,7 +209,11 @@ static int init_oblate(grib_handle* h, sinphi_ = sin(standardParallelInRadians); /* (P->phi0); */ Q__sinb1 = pj_qsfn(sinphi_, e, one_es) / Q__qp; Q__cosb1 = sqrt(1.0 - Q__sinb1 * Q__sinb1); - Q__dd = cos(standardParallelInRadians) / (sqrt(1. - es * sinphi_ * sinphi_) * Q__rq * Q__cosb1); + if (Q__cosb1 == 0) { + Q__dd = 1.0; + } else { + Q__dd = cos(standardParallelInRadians) / (sqrt(1. - es * sinphi_ * sinphi_) * Q__rq * Q__cosb1); + } Q__ymf = (Q__xmf = Q__rq) / Q__dd; Q__xmf *= Q__dd; @@ -253,7 +257,12 @@ static int init_oblate(grib_handle* h, xy_y *= Q__dd; rho = hypot(xy_x, xy_y); Assert(rho >= EPS10); /* TODO(masn): check */ - sCe = 2. * asin(.5 * rho / Q__rq); + const double asin_arg = (0.5 * rho / Q__rq); + if (asin_arg < -1.0 || asin_arg > 1.0) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Invalid value: arcsin argument=%g", asin_arg); + return GRIB_GEOCALCULUS_PROBLEM; + } + sCe = 2. * asin(asin_arg); cCe = cos(sCe); sCe = sin(sCe); xy_x *= sCe; From 13c04fc5a63190433b1120db3ed96cdc85d92ddc Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 2 May 2024 14:46:56 +0100 Subject: [PATCH 107/196] Testing: grib_histogram --- tests/big2gribex.sh | 6 ++++++ tests/grib_histogram.sh | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/tests/big2gribex.sh b/tests/big2gribex.sh index c8c0b6098..acc78cdf2 100755 --- a/tests/big2gribex.sh +++ b/tests/big2gribex.sh @@ -17,6 +17,12 @@ if [ ! -x ${tools_dir}/big2gribex ]; then exit 0 fi +set +e +${tools_dir}/big2gribex +status=$? +set -e +[ $status -ne 0 ] + ${tools_dir}/big2gribex $data_dir/test.grib1 $tempGrib # Clean up diff --git a/tests/grib_histogram.sh b/tests/grib_histogram.sh index c5b56ab22..9653a9500 100755 --- a/tests/grib_histogram.sh +++ b/tests/grib_histogram.sh @@ -17,5 +17,17 @@ tempOut=temp.$label.txt ${tools_dir}/grib_histogram $ECCODES_SAMPLES_PATH/GRIB1.tmpl > $tempOut ${tools_dir}/grib_histogram $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempOut +${tools_dir}/grib_histogram -p step,shortName $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempOut + +# Something with a bitmap +input=$data_dir/reduced_latlon_surface.grib2 +grib_check_key_equals $input numberOfMissing 98701 +${tools_dir}/grib_histogram $input > $tempOut + +# Skip +input=$data_dir/tigge_cf_ecmwf.grib2 +${tools_dir}/grib_histogram -w level=925,shortName=gh $input > $tempOut + + # Clean up rm -f $tempOut From beb8abb32c21291e433055baf3e44f10459a1e2a Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 2 May 2024 16:23:06 +0100 Subject: [PATCH 108/196] Dead code removal --- tools/grib_histogram.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tools/grib_histogram.cc b/tools/grib_histogram.cc index 90a7e8532..fa77614d7 100644 --- a/tools/grib_histogram.cc +++ b/tools/grib_histogram.cc @@ -76,14 +76,6 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) names[name_count++] = options->requested_print_keys[i].name; } - if (!options->skip) { - if (options->set_values_count != 0) - err = grib_set_values(h, options->set_values, options->set_values_count); - - if (err != GRIB_SUCCESS && options->fail) - exit(err); - } - GRIB_CHECK(grib_get_long(h, "missingValuesPresent", &missingValuesPresent), 0); GRIB_CHECK(grib_get_size(h, "values", &size), 0); From 4735c01df5a30f1bbe052e8d0f6ede6f765c1873 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Thu, 2 May 2024 16:10:38 +0000 Subject: [PATCH 109/196] Simplify generic pack_double function --- src/accessor/grib_accessor_class_gen.cc | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index 0c522cadd..a147996dd 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -539,33 +539,15 @@ int pack_double_array_as_long(grib_accessor* a, const double* v, size_t* len) int grib_accessor_class_gen_t::pack_double(grib_accessor* a, const double* v, size_t* len) { - static int check_pack_long = 1; - if (check_pack_long) { - const long v_tmp = (long) (*v); - size_t l_tmp = 0; - pack_long(a, &v_tmp, &l_tmp); - check_pack_long = 0; - } - is_overridden_[PACK_DOUBLE] = 0; + grib_context* c = a->context; - int do_pack_as_long = 0; - grib_context* c = a->context; - if (is_overridden_[PACK_LONG]) { - do_pack_as_long = 1; - } - else { + if (strcmp(a->cclass->name, "codetable") == 0 || is_overridden_[PACK_LONG]) { /* ECC-648: Special case of codetable */ - if (strcmp(a->cclass->name, "codetable") == 0) { - do_pack_as_long = 1; - } - } - - if (do_pack_as_long) { return pack_double_array_as_long(a, v, len); } - grib_context_log(c, GRIB_LOG_ERROR, "Should not pack '%s' as a double", a->name); + grib_context_log(c, GRIB_LOG_ERROR, "Should not pack '%s' as a double", a->name); if (is_overridden_[PACK_STRING]) { grib_context_log(c, GRIB_LOG_ERROR, "Try packing as a string"); } From 33dbaa5db91dd51406f066502fc8f9ffae100655 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Thu, 2 May 2024 17:26:22 +0000 Subject: [PATCH 110/196] Fix reflection --- src/accessor/grib_accessor_class_gen.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index a147996dd..cba6e3ae0 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -586,10 +586,7 @@ int grib_accessor_class_gen_t::pack_string(grib_accessor* a, const char* v, size __func__, v, a->name); return GRIB_WRONG_TYPE; } - int err = a->pack_double(&val, &l); - if (is_overridden_[PACK_DOUBLE]) { - return err; - } + return a->pack_double(&val, &l); } if (is_overridden_[PACK_LONG]) { From 71f5dbd1df46ed00e0a3a1e8325eed5e53c75db5 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 2 May 2024 20:36:36 +0100 Subject: [PATCH 111/196] Tools: Deprecated tools --- tools/{ => deprecated}/bufr_3to4.cc | 0 tools/{ => deprecated}/mars_request.cc | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tools/{ => deprecated}/bufr_3to4.cc (100%) rename tools/{ => deprecated}/mars_request.cc (100%) diff --git a/tools/bufr_3to4.cc b/tools/deprecated/bufr_3to4.cc similarity index 100% rename from tools/bufr_3to4.cc rename to tools/deprecated/bufr_3to4.cc diff --git a/tools/mars_request.cc b/tools/deprecated/mars_request.cc similarity index 100% rename from tools/mars_request.cc rename to tools/deprecated/mars_request.cc From e1630d3435f5125e52066924ffc25e2cb537a663 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 3 May 2024 09:56:14 +0100 Subject: [PATCH 112/196] Examples: Cleanup --- examples/C/new_sample.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/examples/C/new_sample.c b/examples/C/new_sample.c index 9560e3924..82524b022 100644 --- a/examples/C/new_sample.c +++ b/examples/C/new_sample.c @@ -25,8 +25,7 @@ int main(int argc, char** argv) exit(1); } - /* h = codes_grib_handle_new_from_samples(NULL, "GRIB2"); */ - h = codes_handle_new_from_samples(NULL, "just a test"); + h = codes_handle_new_from_samples(NULL, "nonexistentsample"); if (h) return 1; h = codes_handle_new_from_samples(NULL, "GRIB2"); @@ -148,12 +147,6 @@ int main(int argc, char** argv) CODES_CHECK(codes_set_long(h, "jScansPositively", 0), 0); CODES_CHECK(codes_set_long(h, "jPointsAreConsecutive", 0), 0); CODES_CHECK(codes_set_long(h, "alternativeRowScanning", 0), 0); - CODES_CHECK(codes_set_long(h, "iScansPositively", 1), 0); - - /* ITERATOR */ - - - /* NEAREST */ CODES_CHECK(codes_set_long(h, "timeRangeIndicator", 0), 0); CODES_CHECK(codes_set_long(h, "NV", 0), 0); @@ -165,15 +158,12 @@ int main(int argc, char** argv) /* Parameter information */ - /* 0 = Temperature (grib2/tables/4/4.1.0.table) */ CODES_CHECK(codes_set_long(h, "parameterCategory", 0), 0); - /* 0 = Temperature (K) (grib2/tables/4/4.2.0.0.table) */ CODES_CHECK(codes_set_long(h, "parameterNumber", 0), 0); - /* 0 = Analysis (grib2/tables/4/4.3.table) */ CODES_CHECK(codes_set_long(h, "typeOfGeneratingProcess", 0), 0); @@ -185,7 +175,6 @@ int main(int argc, char** argv) /* 1 = Hour (grib2/tables/4/4.4.table) */ CODES_CHECK(codes_set_long(h, "indicatorOfUnitOfTimeRange", 1), 0); - /* 1 = Hour (stepUnits.table) */ CODES_CHECK(codes_set_long(h, "stepUnits", 1), 0); @@ -226,7 +215,6 @@ int main(int argc, char** argv) /* grib 2 Section 6 BIT-MAP SECTION */ - /* 255 = A bit map does not apply to this product (grib2/tables/4/6.0.table) */ CODES_CHECK(codes_set_long(h, "bitMapIndicator", 255), 0); From ea073235d2b06f04268d59e38767a6617935ed19 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 3 May 2024 09:56:40 +0100 Subject: [PATCH 113/196] Error messages: Samples path --- src/grib_handle.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grib_handle.cc b/src/grib_handle.cc index 732537f12..1afad3476 100644 --- a/src/grib_handle.cc +++ b/src/grib_handle.cc @@ -231,7 +231,7 @@ grib_handle* codes_handle_new_from_samples(grib_context* c, const char* name) if (!g) { grib_context_log(c, GRIB_LOG_ERROR, "Unable to load sample file '%s.tmpl'\n" - " from %s\n" + " samples path='%s'\n" " (ecCodes Version=%s)", name, c->grib_samples_path, ECCODES_VERSION_STR); } From ea6fca236eacf8037c214e114eb176545dfc80cf Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Fri, 3 May 2024 12:41:00 +0000 Subject: [PATCH 114/196] Initialisation of accessors lists --- src/accessor/grib_accessors_list.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/accessor/grib_accessors_list.h b/src/accessor/grib_accessors_list.h index 3c5cc2ebe..2bdd29de7 100644 --- a/src/accessor/grib_accessors_list.h +++ b/src/accessor/grib_accessors_list.h @@ -26,11 +26,11 @@ class grib_accessors_list int unpack_float(float* val, size_t* buffer_len); int unpack_string(char** val, size_t* buffer_len); - grib_accessor* accessor; - int rank; - grib_accessors_list* next_; - grib_accessors_list* prev_; - grib_accessors_list* last_; + grib_accessor* accessor = nullptr; + int rank = 0; + grib_accessors_list* next_ = nullptr; + grib_accessors_list* prev_ = nullptr; + grib_accessors_list* last_ = nullptr; }; grib_accessors_list* grib_accessors_list_create(grib_context* c); From 97294f6b5064c08e83bf3b0eebeb24d22ebcb8c9 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Fri, 3 May 2024 13:49:22 +0000 Subject: [PATCH 115/196] ECC-1813: Init local variables, add comment, improve test --- src/grib_accessor_class_optimal_step_units.cc | 12 +- tests/grib_sub_hourly.sh | 116 +++++++++--------- 2 files changed, 68 insertions(+), 60 deletions(-) diff --git a/src/grib_accessor_class_optimal_step_units.cc b/src/grib_accessor_class_optimal_step_units.cc index 6c15ef430..d06592e31 100644 --- a/src/grib_accessor_class_optimal_step_units.cc +++ b/src/grib_accessor_class_optimal_step_units.cc @@ -178,10 +178,10 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) grib_handle* h = grib_handle_of_accessor(a); grib_accessor_optimal_step_units* self = (grib_accessor_optimal_step_units*)a; - long start_step; - long start_step_unit; - long end_step; - long end_step_unit; + long start_step = 0; + long start_step_unit = 0; + long end_step = 0; + long end_step_unit = 0; int ret; auto supported_units = eccodes::Unit::list_supported_units(); @@ -204,6 +204,10 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_INVALID_ARGUMENT; } + // ECC-1813: When the stepUnits key is used without specifying a value, as in the command + // "grib-set -s stepUnits=m in.grib out.grib", the following code initiates an indirect update + // of the low-level keys: forecastTime,indicatorOfUnitOfTimeRange,indicatorOfUnitForTimeRange,lengthOfTimeRange + self->overwriteStepUnits = *val; if ((ret = grib_set_long_internal(h, "forceStepUnits", *val)) != GRIB_SUCCESS) return ret; diff --git a/tests/grib_sub_hourly.sh b/tests/grib_sub_hourly.sh index 23c1fb9ca..bb7bac891 100755 --- a/tests/grib_sub_hourly.sh +++ b/tests/grib_sub_hourly.sh @@ -64,21 +64,25 @@ accumulated_field=$data_dir/reduced_gaussian_sub_area.grib2 # ECC-1813: Test that we can set the stepUnits without setting the step -fn="$instantaneous_field" +in="$instantaneous_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s" -${tools_dir}/grib_set -s stepUnits=m,step=60 $fn $temp +${tools_dir}/grib_set -s stepUnits=m,step=60 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "60 m" ${tools_dir}/grib_set -s stepUnits=s $temp $temp2 grib_check_key_equals $temp2 "-p $low_level_keys" "3600 s" +${tools_dir}/grib_set -s stepUnits=m $temp $temp2 +grib_check_key_equals $temp2 "-p $low_level_keys" "60 m" ${tools_dir}/grib_set -s stepUnits=h $temp $temp2 grib_check_key_equals $temp2 "-p $low_level_keys" "1 h" -fn="$accumulated_field" +in="$accumulated_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" -${tools_dir}/grib_set -s stepUnits=m,stepRange=60-180 $fn $temp +${tools_dir}/grib_set -s stepUnits=m,stepRange=60-180 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "60 m 120 m" ${tools_dir}/grib_set -s stepUnits=s $temp $temp2 grib_check_key_equals $temp2 "-p $low_level_keys" "3600 s 7200 s" +${tools_dir}/grib_set -s stepUnits=m $temp $temp2 +grib_check_key_equals $temp2 "-p $low_level_keys" "60 m 120 m" ${tools_dir}/grib_set -s stepUnits=h $temp $temp2 grib_check_key_equals $temp2 "-p $low_level_keys" "1 h 2 h" @@ -87,23 +91,23 @@ ${tools_dir}/grib_get -p stepunits $data_dir/tigge_cf_ecmwf.grib2 #### Make sure that step, stepRange, startStep, endStep produce the same result for instantaneous fields -fn="$instantaneous_field" +in="$instantaneous_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s" keys_step="step,step:s,step:i,step:d,stepUnits:s" keys_step_range="stepRange,stepRange:s,stepRange:i,stepRange:d,stepUnits:s" keys_start_step="startStep,startStep:s,startStep:i,startStep:d,stepUnits:s" keys_end_step="endStep,endStep:s,endStep:i,endStep:d,stepUnits:s" -${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=h $fn $temp +${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=h $in $temp grib_check_key_equals $temp "-p $low_level_keys" "0 h" -${tools_dir}/grib_set -s stepUnits=m,step=59 $fn $temp +${tools_dir}/grib_set -s stepUnits=m,step=59 $in $temp grib_check_key_equals $temp "-p $keys_step" "59m 59m 59 59 m" grib_check_key_equals $temp "-p $keys_step_range" "59m 59m 59 59 m" grib_check_key_equals $temp "-p $keys_start_step" "59m 59m 59 59 m" grib_check_key_equals $temp "-p $keys_end_step" "59m 59m 59 59 m" -${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=h $fn $temp +${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=h $in $temp grib_check_key_equals $temp "-p $low_level_keys" "0 h" -${tools_dir}/grib_set -s step=59m $fn $temp +${tools_dir}/grib_set -s step=59m $in $temp grib_check_key_equals $temp "-p $keys_step" "59m 59m 59 59 m" grib_check_key_equals $temp "-p $keys_step_range" "59m 59m 59 59 m" grib_check_key_equals $temp "-p $keys_start_step" "59m 59m 59 59 m" @@ -114,53 +118,53 @@ grib_check_key_equals $temp "-p $keys_end_step" "59m 59m 59 59 m" # else optimise low level keys # instant fields: low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" -fn="$instantaneous_field" +in="$instantaneous_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s" keys__="step,stepUnits:s" keys_s="step:s" keys_i="step:i,stepUnits:s" keys_d="step:d,stepUnits:s" -${tools_dir}/grib_set -s stepUnits=m,step=60 $fn $temp +${tools_dir}/grib_set -s stepUnits=m,step=60 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "60 m" grib_check_key_equals $temp "-p $keys_s" "1$HOUR" grib_check_key_equals $temp "-p $keys_s -s stepUnits=m" "60m" -${tools_dir}/grib_set -s stepUnits=m,step=60 $fn $temp +${tools_dir}/grib_set -s stepUnits=m,step=60 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "60 m" grib_check_key_equals $temp "-p $keys_s" "1$HOUR" grib_check_key_equals $temp "-p $keys_s -s stepUnits=m" "60m" -${tools_dir}/grib_set -s step=60m $fn $temp +${tools_dir}/grib_set -s step=60m $in $temp grib_check_key_equals $temp "-p $low_level_keys" "1 h" grib_check_key_equals $temp "-p $keys_s" "1$HOUR" grib_check_key_equals $temp "-p $keys_s -s stepUnits=m" "60m" # accumulated fields: -fn="$accumulated_field" +in="$accumulated_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" keys__="step,startStep,endStep,stepRange,stepUnits:s" keys_s="step:s,startStep:s,endStep:s,stepRange:s,stepUnits:s" keys_i="step:i,startStep:i,endStep:i,stepRange:i,stepUnits:s" keys_d="step:d,startStep:d,endStep:d,stepRange:d,stepUnits:s" -${tools_dir}/grib_set -s stepUnits=m,stepRange=60-120 $fn $temp +${tools_dir}/grib_set -s stepUnits=m,stepRange=60-120 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "60 m 60 m" grib_check_key_equals $temp "-p $keys_s" "2$HOUR 1$HOUR 2$HOUR 1$HOUR-2$HOUR h" grib_check_key_equals $temp "-p $keys_s -s stepUnits=m" "120m 60m 120m 60m-120m m" -${tools_dir}/grib_set -s stepUnits=m,stepRange=60-120 $fn $temp +${tools_dir}/grib_set -s stepUnits=m,stepRange=60-120 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "60 m 60 m" grib_check_key_equals $temp "-p $keys_s" "2$HOUR 1$HOUR 2$HOUR 1$HOUR-2$HOUR h" grib_check_key_equals $temp "-p $keys_s -s stepUnits=m" "120m 60m 120m 60m-120m m" -${tools_dir}/grib_set -s stepRange=60m-120m $fn $temp +${tools_dir}/grib_set -s stepRange=60m-120m $in $temp grib_check_key_equals $temp "-p $low_level_keys" "1 h 1 h" grib_check_key_equals $temp "-p $keys_s" "2$HOUR 1$HOUR 2$HOUR 1$HOUR-2$HOUR h" grib_check_key_equals $temp "-p $keys_s -s stepUnits=m" "120m 60m 120m 60m-120m m" #### CHECK units -fn="$accumulated_field" +in="$accumulated_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" -${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=96,indicatorOfUnitForTimeRange=h $fn $temp +${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=96,indicatorOfUnitForTimeRange=h $in $temp grib_check_key_equals $temp "-p $low_level_keys" "0 h 96 h" grib_check_key_equals $temp " -w count=1 -s stepUnits=s -p step:i,stepUnits:s" "345600 s" @@ -181,38 +185,38 @@ grib_check_key_equals $temp " -w count=1 -s stepUnits=6h -p step,stepUnits:s" "1 grib_check_key_equals $temp " -w count=1 -s stepUnits=12h -p step,stepUnits:s" "8x12h 12h" grib_check_key_equals $temp " -w count=1 -s stepUnits=D -p step,stepUnits:s" "4D D" -${tools_dir}/grib_set -s stepUnits=s,startStep=0,endStep=345600 $fn $temp +${tools_dir}/grib_set -s stepUnits=s,startStep=0,endStep=345600 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "0 s 345600 s" -${tools_dir}/grib_set -s stepUnits=m,startStep=0,endStep=5760 $fn $temp +${tools_dir}/grib_set -s stepUnits=m,startStep=0,endStep=5760 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "0 m 5760 m" -${tools_dir}/grib_set -s stepUnits=h,startStep=0,endStep=96 $fn $temp +${tools_dir}/grib_set -s stepUnits=h,startStep=0,endStep=96 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "0 h 96 h" -${tools_dir}/grib_set -s stepUnits=6h,startStep=0,endStep=16 $fn $temp +${tools_dir}/grib_set -s stepUnits=6h,startStep=0,endStep=16 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "0 6h 16 6h" -${tools_dir}/grib_set -s stepUnits=12h,startStep=0,endStep=8 $fn $temp +${tools_dir}/grib_set -s stepUnits=12h,startStep=0,endStep=8 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "0 12h 8 12h" -${tools_dir}/grib_set -s stepUnits=D,startStep=0,endStep=4 $fn $temp +${tools_dir}/grib_set -s stepUnits=D,startStep=0,endStep=4 $in $temp grib_check_key_equals $temp "-p $low_level_keys" "0 D 4 D" #### CHECK negative forecastTime -fn="$accumulated_field" +in="$accumulated_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" -${tools_dir}/grib_set -s forecastTime=-6,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=6,indicatorOfUnitForTimeRange=h $fn $temp +${tools_dir}/grib_set -s forecastTime=-6,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=6,indicatorOfUnitForTimeRange=h $in $temp grib_check_key_equals $temp "-p $low_level_keys" "-6 h 6 h" grib_check_key_equals $temp "-s stepUnits:s=h -p startStep:s,endStep:s" "-6$HOUR 0$HOUR" grib_check_key_equals $temp "-s stepUnits:s=m -p startStep:s,endStep:s" "-360m 0m" grib_check_key_equals $temp "-s stepUnits:s=s -p startStep:s,endStep:s" "-21600s 0s" -${tools_dir}/grib_set -s forecastTime=-48,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=0,indicatorOfUnitForTimeRange=h $fn $temp +${tools_dir}/grib_set -s forecastTime=-48,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=0,indicatorOfUnitForTimeRange=h $in $temp grib_check_key_equals $temp "-p stepRange" "-48$HOUR" #### CHECK: check optimal units are set correctly in GRIB files -fn="$accumulated_field" +in="$accumulated_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" -${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=1,indicatorOfUnitForTimeRange=D $fn $temp +${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=1,indicatorOfUnitForTimeRange=D $in $temp grib_check_key_equals $temp "-p $low_level_keys" "24 h 1 D" ### TODO(maee): @Shahram: how to make parameters position independent @@ -239,18 +243,18 @@ grib_check_key_equals $temp2 "-p $low_level_keys" "60 h 120 h" ${tools_dir}/grib_set -s stepUnits:s=h,startStep:i=60,endStep:i=180 $temp $temp2 grib_check_key_equals $temp2 "-p $low_level_keys" "60 h 120 h" -#fn="$accumulated_field" +#in="$accumulated_field" #low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" ##high_level_keys="startStep:s,endStep:s" #high_level_keys="startStep:i,endStep:i" -#${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=1,indicatorOfUnitForTimeRange=D $fn $temp +#${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=1,indicatorOfUnitForTimeRange=D $in $temp #grib_check_key_equals $temp "-p $low_level_keys" "24 h 1 D" #grib_check_key_equals $temp "-p $high_level_keys" "24 48" #${tools_dir}/grib_set -s startStep:i=24 $temp $temp2 #grib_check_key_equals $temp2 "-p $low_level_keys" "24 h 0 h" #grib_check_key_equals $temp2 "-p $high_level_keys" "24 24" -#${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=24,indicatorOfUnitForTimeRange=h $fn $temp +#${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=24,indicatorOfUnitForTimeRange=h $in $temp #grib_check_key_equals $temp "-p $low_level_keys" "24 h 24 h" #grib_check_key_equals $temp "-p $high_level_keys" "24 48" #${tools_dir}/grib_set -s startStep:i=24 $temp $temp2 @@ -259,9 +263,9 @@ grib_check_key_equals $temp2 "-p $low_level_keys" "60 h 120 h" #exit #### CHECK: grib_set - endStep + stepUnits -fn="$accumulated_field" +in="$accumulated_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" -${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=1,indicatorOfUnitForTimeRange=D $fn $temp +${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=1,indicatorOfUnitForTimeRange=D $in $temp grib_check_key_equals $temp "-p $low_level_keys" "24 h 1 D" # Use range unit: hour @@ -321,14 +325,14 @@ ${tools_dir}/grib_set -s stepRange:s=62D-122D $temp $temp2 grib_check_key_equals $temp2 "-p $low_level_keys" "1488 h 1440 h" grib_check_key_equals $temp2 "-p stepRange:s" "1488$HOUR-2928$HOUR" -fn="$instantaneous_field" +in="$instantaneous_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s" keys__="step,stepUnits:s" keys_s="step:s" keys_i="step:i,stepUnits:s" keys_d="step:d,stepUnits:s" -${tools_dir}/grib_set -s forecastTime=59,indicatorOfUnitOfTimeRange=m $fn $temp +${tools_dir}/grib_set -s forecastTime=59,indicatorOfUnitOfTimeRange=m $in $temp grib_check_key_equals $temp "-p $keys__ -s stepUnits=s" "3540s s" grib_check_key_equals $temp "-p $keys__ -s stepUnits=m" "59m m" #grib_check_key_equals $temp "-p $keys__ -s stepUnits=h" "0" # not supported @@ -343,7 +347,7 @@ grib_check_key_equals $temp "-p $keys_d -s stepUnits=m" "59 m" #grib_check_key_equals $temp "-p $keys_d -s stepUnits=h" "0.983333" # not supported -${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=m $fn $temp +${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=m $in $temp grib_check_key_equals $temp "-p $keys_i -s stepUnits=s" "0 s" grib_check_key_equals $temp "-p $keys_i -s stepUnits=m" "0 m" grib_check_key_equals $temp "-p $keys_i -s stepUnits=h" "0 h" @@ -352,14 +356,14 @@ grib_check_key_equals $temp "-p $keys_d -s stepUnits=m" "0 m" grib_check_key_equals $temp "-p $keys_d -s stepUnits=h" "0 h" -fn="$instantaneous_field" +in="$instantaneous_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s" keys__="step,stepUnits:s" keys_s="step:s,stepUnits:s" keys_i="step:i,stepUnits:s" keys_d="step:d,stepUnits:s" -${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=m $fn $temp +${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=m $in $temp grib_check_key_equals $temp "-p $low_level_keys" "0 m" grib_check_key_equals $temp "-p $keys__" "0m m" grib_check_key_equals $temp "-p $keys_s" "0m m" @@ -380,7 +384,7 @@ grib_check_key_equals $temp "-p $keys_d -s stepUnits=m" "0 m" grib_check_key_equals $temp "-p $keys_d -s stepUnits=h" "0 h" -${tools_dir}/grib_set -s forecastTime=59,indicatorOfUnitOfTimeRange=m $fn $temp +${tools_dir}/grib_set -s forecastTime=59,indicatorOfUnitOfTimeRange=m $in $temp grib_check_key_equals $temp "-p $low_level_keys" "59 m" grib_check_key_equals $temp "-p $keys__" "59m m" #grib_check_key_equals $temp "-p $keys_s" "59" @@ -388,14 +392,14 @@ grib_check_key_equals $temp "-p $keys_s" "59m m" grib_check_key_equals $temp "-p $keys_i" "59 m" grib_check_key_equals $temp "-p $keys_d" "59 m" -${tools_dir}/grib_set -s forecastTime=60,indicatorOfUnitOfTimeRange=m $fn $temp +${tools_dir}/grib_set -s forecastTime=60,indicatorOfUnitOfTimeRange=m $in $temp grib_check_key_equals $temp "-p $low_level_keys" "60 m" grib_check_key_equals $temp "-p $keys__" "1$HOUR h" grib_check_key_equals $temp "-p $keys_s" "1$HOUR h" grib_check_key_equals $temp "-p $keys_i" "1 h" grib_check_key_equals $temp "-p $keys_d" "1 h" -${tools_dir}/grib_set -s forecastTime=61,indicatorOfUnitOfTimeRange=m $fn $temp +${tools_dir}/grib_set -s forecastTime=61,indicatorOfUnitOfTimeRange=m $in $temp grib_check_key_equals $temp "-p $low_level_keys" "61 m" grib_check_key_equals $temp "-p $keys__" "61m m" #grib_check_key_equals $temp "-p $keys_s" "61" @@ -403,14 +407,14 @@ grib_check_key_equals $temp "-p $keys_s" "61m m" grib_check_key_equals $temp "-p $keys_i" "61 m" grib_check_key_equals $temp "-p $keys_d" "61 m" -${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h $fn $temp +${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h $in $temp grib_check_key_equals $temp "-p $low_level_keys" "24 h" grib_check_key_equals $temp "-p $keys__" "24$HOUR h" grib_check_key_equals $temp "-p $keys_s" "24$HOUR h" grib_check_key_equals $temp "-p $keys_i" "24 h" grib_check_key_equals $temp "-p $keys_d" "24 h" -${tools_dir}/grib_set -s forecastTime=1440,indicatorOfUnitOfTimeRange=m $fn $temp +${tools_dir}/grib_set -s forecastTime=1440,indicatorOfUnitOfTimeRange=m $in $temp grib_check_key_equals $temp "-p $low_level_keys" "1440 m" grib_check_key_equals $temp "-p $keys__" "24$HOUR h" grib_check_key_equals $temp "-p $keys_s" "24$HOUR h" @@ -418,40 +422,40 @@ grib_check_key_equals $temp "-p $keys_i" "24 h" grib_check_key_equals $temp "-p $keys_d" "24 h" -fn="$accumulated_field" +in="$accumulated_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" -${tools_dir}/grib_set -s stepRange=60m-2h $fn $temp +${tools_dir}/grib_set -s stepRange=60m-2h $in $temp grib_check_key_equals $temp "-p $low_level_keys" "1 h 1 h" -fn="$accumulated_field" +in="$accumulated_field" low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" keys__="stepRange,startStep,endStep" keys_s="stepRange:s,startStep:s,endStep:s" keys_i="stepRange:i,startStep:i,endStep:i" keys_d="stepRange:d,startStep:d,endStep:d" -${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=m,lengthOfTimeRange=2,indicatorOfUnitForTimeRange=h $fn $temp +${tools_dir}/grib_set -s forecastTime=0,indicatorOfUnitOfTimeRange=m,lengthOfTimeRange=2,indicatorOfUnitForTimeRange=h $in $temp grib_check_key_equals $temp "-p $low_level_keys" "0 m 2 h" grib_check_key_equals $temp "-p $keys__" "0$HOUR-2$HOUR 0$HOUR 2$HOUR" grib_check_key_equals $temp "-p $keys_s" "0$HOUR-2$HOUR 0$HOUR 2$HOUR" grib_check_key_equals $temp "-p $keys_i" "2 0 2" grib_check_key_equals $temp "-p $keys_d" "2 0 2" -${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=1,indicatorOfUnitForTimeRange=D $fn $temp +${tools_dir}/grib_set -s forecastTime=24,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=1,indicatorOfUnitForTimeRange=D $in $temp grib_check_key_equals $temp "-p $low_level_keys" "24 h 1 D" grib_check_key_equals $temp "-p $keys__" "24$HOUR-48$HOUR 24$HOUR 48$HOUR" grib_check_key_equals $temp "-p $keys_s" "24$HOUR-48$HOUR 24$HOUR 48$HOUR" grib_check_key_equals $temp "-p $keys_i" "48 24 48" grib_check_key_equals $temp "-p $keys_d" "48 24 48" -${tools_dir}/grib_set -s forecastTime=25,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=1,indicatorOfUnitForTimeRange=D $fn $temp +${tools_dir}/grib_set -s forecastTime=25,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=1,indicatorOfUnitForTimeRange=D $in $temp grib_check_key_equals $temp "-p $low_level_keys" "25 h 1 D" grib_check_key_equals $temp "-p $keys__" "25$HOUR-49$HOUR 25$HOUR 49$HOUR" grib_check_key_equals $temp "-p $keys_s" "25$HOUR-49$HOUR 25$HOUR 49$HOUR" grib_check_key_equals $temp "-p $keys_i" "49 25 49" grib_check_key_equals $temp "-p $keys_d" "49 25 49" -${tools_dir}/grib_set -s forecastTime=45,indicatorOfUnitOfTimeRange=m,lengthOfTimeRange=15,indicatorOfUnitForTimeRange=m $fn $temp +${tools_dir}/grib_set -s forecastTime=45,indicatorOfUnitOfTimeRange=m,lengthOfTimeRange=15,indicatorOfUnitForTimeRange=m $in $temp grib_check_key_equals $temp "-p $low_level_keys" "45 m 15 m" grib_check_key_equals $temp "-p $keys__" "45m-60m 45m 60m" #grib_check_key_equals $temp "-p $keys_s" "45-60 45 60" @@ -459,28 +463,28 @@ grib_check_key_equals $temp "-p $keys_s" "45m-60m 45m 60m" grib_check_key_equals $temp "-p $keys_i" "60 45 60" grib_check_key_equals $temp "-p $keys_d" "60 45 60" -${tools_dir}/grib_set -s forecastTime=60,indicatorOfUnitOfTimeRange=m,lengthOfTimeRange=2,indicatorOfUnitForTimeRange=h $fn $temp +${tools_dir}/grib_set -s forecastTime=60,indicatorOfUnitOfTimeRange=m,lengthOfTimeRange=2,indicatorOfUnitForTimeRange=h $in $temp grib_check_key_equals $temp "-p $low_level_keys" "60 m 2 h" grib_check_key_equals $temp "-p $keys__" "1$HOUR-3$HOUR 1$HOUR 3$HOUR" grib_check_key_equals $temp "-p $keys_s" "1$HOUR-3$HOUR 1$HOUR 3$HOUR" grib_check_key_equals $temp "-p $keys_i" "3 1 3" grib_check_key_equals $temp "-p $keys_d" "3 1 3" -${tools_dir}/grib_set -s forecastTime=18,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=6,indicatorOfUnitForTimeRange=h $fn $temp +${tools_dir}/grib_set -s forecastTime=18,indicatorOfUnitOfTimeRange=h,lengthOfTimeRange=6,indicatorOfUnitForTimeRange=h $in $temp grib_check_key_equals $temp "-p $low_level_keys" "18 h 6 h" grib_check_key_equals $temp "-p $keys__" "18$HOUR-24$HOUR 18$HOUR 24$HOUR" grib_check_key_equals $temp "-p $keys_s" "18$HOUR-24$HOUR 18$HOUR 24$HOUR" grib_check_key_equals $temp "-p $keys_i" "24 18 24" grib_check_key_equals $temp "-p $keys_d" "24 18 24" -${tools_dir}/grib_set -s forecastTime=1080,indicatorOfUnitOfTimeRange=m,lengthOfTimeRange=360,indicatorOfUnitForTimeRange=m $fn $temp +${tools_dir}/grib_set -s forecastTime=1080,indicatorOfUnitOfTimeRange=m,lengthOfTimeRange=360,indicatorOfUnitForTimeRange=m $in $temp grib_check_key_equals $temp "-p $low_level_keys" "1080 m 360 m" grib_check_key_equals $temp "-p $keys__" "18$HOUR-24$HOUR 18$HOUR 24$HOUR" grib_check_key_equals $temp "-p $keys_s" "18$HOUR-24$HOUR 18$HOUR 24$HOUR" grib_check_key_equals $temp "-p $keys_i" "24 18 24" grib_check_key_equals $temp "-p $keys_d" "24 18 24" -${tools_dir}/grib_set -s forecastTime=1080,indicatorOfUnitOfTimeRange=m,lengthOfTimeRange=6,indicatorOfUnitForTimeRange=h $fn $temp +${tools_dir}/grib_set -s forecastTime=1080,indicatorOfUnitOfTimeRange=m,lengthOfTimeRange=6,indicatorOfUnitForTimeRange=h $in $temp grib_check_key_equals $temp "-p $low_level_keys" "1080 m 6 h" grib_check_key_equals $temp "-p $keys__" "18$HOUR-24$HOUR 18$HOUR 24$HOUR" grib_check_key_equals $temp "-p $keys_s" "18$HOUR-24$HOUR 18$HOUR 24$HOUR" From 4f577fea529851993abd42c6bb8e9626cf94ed15 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 3 May 2024 17:32:10 +0100 Subject: [PATCH 116/196] Expression: unary op name --- src/grib_expression_class_unop.cc | 11 +++++++++-- src/grib_iterator_class_healpix.cc | 6 +++--- tools/grib_histogram.cc | 1 - 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/grib_expression_class_unop.cc b/src/grib_expression_class_unop.cc index 6188b4586..ae7678043 100644 --- a/src/grib_expression_class_unop.cc +++ b/src/grib_expression_class_unop.cc @@ -17,6 +17,7 @@ CLASS = expression IMPLEMENTS = destroy IMPLEMENTS = native_type + IMPLEMENTS = get_name IMPLEMENTS = evaluate_long IMPLEMENTS = evaluate_double IMPLEMENTS = print @@ -42,6 +43,7 @@ typedef const char* string; /* to keep make_class.pl happy */ static void destroy(grib_context*,grib_expression* e); static void print(grib_context*,grib_expression*,grib_handle*); static void add_dependency(grib_expression* e, grib_accessor* observer); +static string get_name(grib_expression* e); static int native_type(grib_expression*,grib_handle*); static int evaluate_long(grib_expression*,grib_handle*,long*); static int evaluate_double(grib_expression*,grib_handle*,double*); @@ -65,7 +67,7 @@ static grib_expression_class _grib_expression_class_unop = { &print, &add_dependency, &native_type, - 0, + &get_name, &evaluate_long, &evaluate_double, 0, @@ -97,6 +99,12 @@ static int evaluate_double(grib_expression* g, grib_handle* h, double* dres) return GRIB_SUCCESS; } +static const char* get_name(grib_expression* g) +{ + grib_expression_unop* e = (grib_expression_unop*)g; + return grib_expression_get_name(e->exp); +} + static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_unop* e = (grib_expression_unop*)g; @@ -111,7 +119,6 @@ static void destroy(grib_context* c, grib_expression* g) grib_expression_free(c, e->exp); } - static void add_dependency(grib_expression* g, grib_accessor* observer) { grib_expression_unop* e = (grib_expression_unop*)g; diff --git a/src/grib_iterator_class_healpix.cc b/src/grib_iterator_class_healpix.cc index 7befaf894..6a545b6c5 100644 --- a/src/grib_iterator_class_healpix.cc +++ b/src/grib_iterator_class_healpix.cc @@ -83,9 +83,9 @@ grib_iterator_class* grib_iterator_class_healpix = &_grib_iterator_class_healpix 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 */ diff --git a/tools/grib_histogram.cc b/tools/grib_histogram.cc index fa77614d7..6c84da43a 100644 --- a/tools/grib_histogram.cc +++ b/tools/grib_histogram.cc @@ -62,7 +62,6 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) size_t last_size = 0; long missingValuesPresent; double delta; - int err = 0; double* values = NULL; size_t size; From e152763d7c67452e810e8f56b4e33ac78eee1c80 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 3 May 2024 19:25:25 +0100 Subject: [PATCH 117/196] ECC-1818: Add test --- tests/grib_grid_lamb_az_eq_area.sh | 65 ++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/tests/grib_grid_lamb_az_eq_area.sh b/tests/grib_grid_lamb_az_eq_area.sh index f3ed52588..a580d0498 100755 --- a/tests/grib_grid_lamb_az_eq_area.sh +++ b/tests/grib_grid_lamb_az_eq_area.sh @@ -11,21 +11,21 @@ label="grib_grid_lamb_az_eq_area_test" -GRIB_INFILE=${data_dir}/regular_gaussian_pressure_level_constant.grib2 -REF_FILE=grib_lamb_az_eq_area.ref +input=${data_dir}/regular_gaussian_pressure_level_constant.grib2 +tempRef=grib_lamb_az_eq_area.ref # Temporary files created for this test -FILTER_FILE=temp.$label.filter -GRIB_OUTFILE=temp.$label.grib2 -DATA_OUTFILE=temp.$label.txt -rm -f $FILTER_FILE $GRIB_OUTFILE $DATA_OUTFILE +tempFilt=temp.$label.filter +tempGrib=temp.$label.grib2 +tempOut=temp.$label.txt +rm -f $tempFilt $tempGrib $tempOut # -------------------- # Spherical Earth # -------------------- # Create a filter -cat > $FILTER_FILE< $tempFilt< $DATA_OUTFILE +${tools_dir}/grib_get_data $tempGrib > $tempOut # Compare output with reference. If the diff fails, script will immediately exit with status 1 -diff $REF_FILE $DATA_OUTFILE +diff $tempRef $tempOut -grib_check_key_equals $GRIB_OUTFILE standardParallelInDegrees,centralLongitudeInDegrees '48 9' -grib_check_key_equals $GRIB_OUTFILE xDirectionGridLengthInMetres,yDirectionGridLengthInMetres '5000 5000' +grib_check_key_equals $tempGrib standardParallelInDegrees,centralLongitudeInDegrees '48 9' +grib_check_key_equals $tempGrib xDirectionGridLengthInMetres,yDirectionGridLengthInMetres '5000 5000' # Nearest -${tools_dir}/grib_ls -l 67,-33,1 $GRIB_OUTFILE +${tools_dir}/grib_ls -l 67,-33,1 $tempGrib # jPointsAreConsecutive tempOutA=temp.$label.A.txt tempOutB=temp.$label.B.txt -${tools_dir}/grib_get_data -s jPointsAreConsecutive=0 $GRIB_OUTFILE > $tempOutA -${tools_dir}/grib_get_data -s jPointsAreConsecutive=1 $GRIB_OUTFILE > $tempOutB +${tools_dir}/grib_get_data -s jPointsAreConsecutive=0 $tempGrib > $tempOutA +${tools_dir}/grib_get_data -s jPointsAreConsecutive=1 $tempGrib > $tempOutB # Results should be different. set +e diff $tempOutA $tempOutB > /dev/null @@ -80,7 +80,7 @@ rm -f $tempOutA $tempOutB # Oblate spheroid # -------------------- -cat > $FILTER_FILE< $tempFilt< $DATA_OUTFILE +${tools_dir}/grib_get_data $tempGrib > $tempOut + +# ECC-1818 +# --------- +cat > $tempFilt< $tempOut # Clean up -rm -f $FILTER_FILE $DATA_OUTFILE -rm -f $GRIB_OUTFILE +rm -f $tempFilt $tempOut $tempGrib From 599fbbf375b2f5549f0bd0209d4c7003394bf681 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 4 May 2024 14:33:13 +0100 Subject: [PATCH 118/196] ECC-1819: GRIB: Keys iScansPositively and jScansNegatively should be read-only --- definitions/grib1/scanning_mode.def | 4 +- definitions/grib2/template.3.healpix.def | 4 +- .../grib2/template.3.scanning_mode.def | 4 +- .../grib3/template.4.scanning_mode.def | 2 +- src/grib_accessor.cc | 4 +- tests/grib_change_scanning.sh | 40 ++++++++++++++++--- 6 files changed, 44 insertions(+), 14 deletions(-) diff --git a/definitions/grib1/scanning_mode.def b/definitions/grib1/scanning_mode.def index 31a56e27d..19a7f8167 100644 --- a/definitions/grib1/scanning_mode.def +++ b/definitions/grib1/scanning_mode.def @@ -9,8 +9,8 @@ flagbit jScansPositively(scanningMode,6) : dump; flagbit jPointsAreConsecutive(scanningMode,5) : dump; constant alternativeRowScanning=0 : dump; -transient iScansPositively = !iScansNegatively : constraint; -transient jScansNegatively = !jScansPositively : constraint; +transient iScansPositively = !iScansNegatively : constraint, read_only; +transient jScansNegatively = !jScansPositively : constraint, read_only; alias geography.iScansNegatively=iScansNegatively; alias geography.jScansPositively=jScansPositively; diff --git a/definitions/grib2/template.3.healpix.def b/definitions/grib2/template.3.healpix.def index bf0429a5b..136904194 100644 --- a/definitions/grib2/template.3.healpix.def +++ b/definitions/grib2/template.3.healpix.def @@ -32,8 +32,8 @@ alias geography.orderingConvention = orderingConvention; flags[1] scanningMode 'grib2/tables/[tablesVersion]/3.13.table'; flagbit iScansNegatively(scanningMode,7) : dump; # WMO bit 1 flagbit jScansPositively(scanningMode,6) : dump; # WMO bit 2 -transient iScansPositively = !iScansNegatively : constraint; -transient jScansNegatively = !jScansPositively : constraint; +transient iScansPositively = !iScansNegatively : constraint, read_only; +transient jScansNegatively = !jScansPositively : constraint, read_only; iterator healpix(numberOfPoints,missingValue,values,Nside,orderingConvention); nearest healpix(values,radius,Nx,Ny); diff --git a/definitions/grib2/template.3.scanning_mode.def b/definitions/grib2/template.3.scanning_mode.def index 2eb2ca71e..1be608f41 100644 --- a/definitions/grib2/template.3.scanning_mode.def +++ b/definitions/grib2/template.3.scanning_mode.def @@ -20,8 +20,8 @@ alias geography.iScansNegatively=iScansNegatively; alias geography.jScansPositively=jScansPositively; alias geography.jPointsAreConsecutive=jPointsAreConsecutive; -transient iScansPositively = !iScansNegatively : constraint; -transient jScansNegatively = !jScansPositively : constraint; +transient iScansPositively = !iScansNegatively : constraint, read_only; +transient jScansNegatively = !jScansPositively : constraint, read_only; flagbit scanningMode5(scanningMode,3) = 0: read_only; flagbit scanningMode6(scanningMode,2) = 0: read_only; diff --git a/definitions/grib3/template.4.scanning_mode.def b/definitions/grib3/template.4.scanning_mode.def index 4fcd2fabb..31414321f 100644 --- a/definitions/grib3/template.4.scanning_mode.def +++ b/definitions/grib3/template.4.scanning_mode.def @@ -20,7 +20,7 @@ alias geography.iScansNegatively=iScansNegatively; alias geography.jScansPositively=jScansPositively; alias geography.jPointsAreConsecutive=jPointsAreConsecutive; -transient iScansPositively = !iScansNegatively : constraint; +transient iScansPositively = !iScansNegatively : constraint, read_only; flagbit scanningMode5(scanningMode,3) = 0: read_only; flagbit scanningMode6(scanningMode,2) = 0: read_only; diff --git a/src/grib_accessor.cc b/src/grib_accessor.cc index a08f5348e..a684b9e1d 100644 --- a/src/grib_accessor.cc +++ b/src/grib_accessor.cc @@ -112,7 +112,9 @@ int grib_pack_float(grib_accessor* a, const float* v, size_t* len) int grib_pack_expression(grib_accessor* a, grib_expression* e) { grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); + // grib_context_log(a->context, GRIB_LOG_INFO, "....(%s)%s is packing", + // (a->parent->owner)?(a->parent->owner->name):"root", + // a->name); while (c) { if (c->pack_expression) { return c->pack_expression(a, e); diff --git a/tests/grib_change_scanning.sh b/tests/grib_change_scanning.sh index 25c5e005b..5f1d46596 100755 --- a/tests/grib_change_scanning.sh +++ b/tests/grib_change_scanning.sh @@ -11,6 +11,12 @@ . ./include.ctest.sh label="grib_change_scanning_test" +tempFilt=temp.$label.filt +tempGribA=temp.$label.A.grib +tempGribB=temp.$label.B.grib +tempText=temp.$label.txt +tempRef=temp.$label.ref + editions="1 2" gridTypes="regular_ll rotated_ll" @@ -77,12 +83,6 @@ done # alternativeRowScanning # ----------------------- -tempFilt=temp.$label.filt -tempGribA=temp.$label.A.grib -tempGribB=temp.$label.B.grib -tempText=temp.$label.txt -tempRef=temp.$label.ref - cat > $tempFilt </dev/null cmp $tempGribA $tempGribB + +# Check constraint keys follow (observe) their expressions +# -------------------------------------------------------- +cat > $tempFilt <$tempText + status=$? + set -e + [ $status -ne 0 ] + grep -q "Value is read only" $tempText + rm $tempText + done +done + # Clean up rm -f $tempFilt $tempGribA $tempGribB $tempRef $tempText rm -f ${data_dir}/scan1.grib ${data_dir}/scan.grib From 7382fb3ab7476d9265aacb863b7348388981555f Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 4 May 2024 15:30:56 +0100 Subject: [PATCH 119/196] Tools: Documentation --- tools/bufr_ls.cc | 2 +- tools/grib_ls.cc | 2 +- tools/grib_options.cc | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/bufr_ls.cc b/tools/bufr_ls.cc index c57114617..b3ebaf531 100644 --- a/tools/bufr_ls.cc +++ b/tools/bufr_ls.cc @@ -17,7 +17,7 @@ grib_option grib_options[] = { { "F:", 0, 0, 1, 1, "%g" }, { "P:", 0, 0, 0, 1, 0 }, { "w:", 0, 0, 0, 1, 0 }, - { "j", 0, "JSON output\n", 0, 1, 0 }, + { "j", 0, "JSON output.\n", 0, 1, 0 }, /* {"B:",0,0,0,1,0}, */ { "s:", 0, 0, 0, 1, 0 }, { "n:", 0, 0, 1, 1, "ls" }, diff --git a/tools/grib_ls.cc b/tools/grib_ls.cc index 59f25306b..c5d06df01 100644 --- a/tools/grib_ls.cc +++ b/tools/grib_ls.cc @@ -17,7 +17,7 @@ grib_option grib_options[] = { { "F:", 0, 0, 1, 1, "%g" }, { "P:", 0, 0, 0, 1, 0 }, { "w:", 0, 0, 0, 1, 0 }, - { "j", 0, "JSON output\n", 0, 1, 0 }, + { "j", 0, "JSON output.\n", 0, 1, 0 }, { "B:", 0, 0, 0, 1, 0 }, { "l:", 0, 0, 0, 1, 0 }, { "s:", 0, 0, 0, 1, 0 }, diff --git a/tools/grib_options.cc b/tools/grib_options.cc index c15de1d80..b612db63a 100644 --- a/tools/grib_options.cc +++ b/tools/grib_options.cc @@ -39,7 +39,7 @@ static grib_options_help grib_options_help_list[] = { { "e:", "tolerance", "\n\t\tOnly values whose difference is more than tolerance are considered different.\n" }, { "f", 0, "Force. Force the execution not to fail on error.\n" }, { "F:", "format", "\n\t\tC style format for floating-point values.\n" }, - { "g", 0, "Copy GTS header. \n" }, + { "g", 0, "Copy GTS header.\n" }, { "G", 0, "GRIBEX compatibility mode.\n" }, { "i:", "index", "\n\t\tData value corresponding to the given index is printed.\n" }, @@ -81,7 +81,7 @@ static grib_options_help grib_options_help_list[] = { "\n\t\tIn the value you can also use the forward-slash character '/' to specify an OR condition (i.e. a logical disjunction)" "\n\t\tNote: only one -w clause is allowed.\n" }, { "v", 0, "Verbose.\n" }, - { "7", 0, "Does not fail when the message has wrong length\n" }, + { "7", 0, "Does not fail when the message has wrong length.\n" }, { "A:", "absolute error\n", "\tCompare floating-point values using the absolute error as tolerance.\n\t\tDefault is absolute error=0\n" }, { "C", 0, "C code mode. A C code program generating the message is dumped.\n" }, @@ -98,7 +98,7 @@ static grib_options_help grib_options_help_list[] = { { "S", 0, "Strict. Only messages matching all the constraints are copied to" "\n\t\tthe output file\n" }, - { "T:", "T | B | M | A", "Message type. T->GTS, B->BUFR, M->METAR (Experimental), A->Any (Experimental).\n\t\t\t\tThe input file is interpreted according to the message type.\n" }, + { "T:", "T | B | A", "Message type. T->GTS, B->BUFR, A->Any (Experimental).\n\t\t\tThe input file is interpreted according to the message type.\n" }, { "V", 0, "Version.\n" }, { "W:", "width", "\n\t\tMinimum width of each column in output. Default is 10.\n" }, { "X:", "offset", "\n\t\tInput file offset in bytes. Processing of the input file will start from the given offset.\n" }, From 7ddc88a430ae3caa06c36f7b6210c7b91ee64f28 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 7 May 2024 10:03:49 +0000 Subject: [PATCH 120/196] Fix py_bufr_ecc-869.py test --- src/accessor/grib_accessor_class_bufr_data_array.cc | 6 ++++-- src/accessor/grib_accessor_class_gen.cc | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/accessor/grib_accessor_class_bufr_data_array.cc b/src/accessor/grib_accessor_class_bufr_data_array.cc index 0314effa0..14f13d966 100644 --- a/src/accessor/grib_accessor_class_bufr_data_array.cc +++ b/src/accessor/grib_accessor_class_bufr_data_array.cc @@ -2066,7 +2066,8 @@ int is_bitmap_start_descriptor(grib_accessors_list* al, int* err){ acode = al->accessor->get_attribute("code"); if (acode) - *err = acode->unpack_long(code, &l); else + *err = acode->unpack_long(code, &l); + else return 1; switch (code[0]) { @@ -2081,7 +2082,8 @@ int is_bitmap_start_descriptor(grib_accessors_list* al, int* err){ { //long index[1]; //grib_accessor* anindex=grib_accessor_get_attribute(al->accessor,"index"); - //anindex->unpack_long(index,&l); return 1; + //anindex->unpack_long(index,&l); + return 1; } } return 0; diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index cba6e3ae0..292c87c35 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -542,7 +542,7 @@ int grib_accessor_class_gen_t::pack_double(grib_accessor* a, const double* v, si is_overridden_[PACK_DOUBLE] = 0; grib_context* c = a->context; - if (strcmp(a->cclass->name, "codetable") == 0 || is_overridden_[PACK_LONG]) { + if (is_overridden_[PACK_LONG] || strcmp(a->cclass->name, "codetable") == 0) { /* ECC-648: Special case of codetable */ return pack_double_array_as_long(a, v, len); } From 677f73f3c8695a50ab6cac399d81a586f9a30c87 Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 7 May 2024 15:51:08 +0100 Subject: [PATCH 121/196] ECC-1820: Fix Windows build --- .../grib_accessor_class_data_ccsds_packing.cc | 291 ++++++++++++++---- .../grib_accessor_class_data_ccsds_packing.h | 158 +--------- 2 files changed, 229 insertions(+), 220 deletions(-) diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.cc b/src/accessor/grib_accessor_class_data_ccsds_packing.cc index 1feed1323..e453a7b09 100644 --- a/src/accessor/grib_accessor_class_data_ccsds_packing.cc +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.cc @@ -11,14 +11,24 @@ #include "grib_accessor_class_data_ccsds_packing.h" -grib_accessor_class_data_ccsds_packing_t _grib_accessor_class_data_ccsds_packing{"data_ccsds_packing"}; +#if defined(HAVE_LIBAEC) || defined(HAVE_AEC) + #include +#endif + +#ifndef LIBAEC_DLL_EXPORTED + #error Version of libaec appears to be too old. Please upgrade. +#endif + +grib_accessor_class_data_ccsds_packing_t _grib_accessor_class_data_ccsds_packing{ "data_ccsds_packing" }; grib_accessor_class* grib_accessor_class_data_ccsds_packing = &_grib_accessor_class_data_ccsds_packing; -void grib_accessor_class_data_ccsds_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ +void grib_accessor_class_data_ccsds_packing_t::init(grib_accessor* a, const long v, grib_arguments* args) +{ grib_accessor_class_values_t::init(a, v, args); grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; - grib_handle* h = grib_handle_of_accessor(a); + + grib_handle* h = grib_handle_of_accessor(a); self->number_of_values = grib_arguments_get_name(h, args, self->carg++); self->reference_value = grib_arguments_get_name(h, args, self->carg++); @@ -34,7 +44,8 @@ void grib_accessor_class_data_ccsds_packing_t::init(grib_accessor* a, const long a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -int grib_accessor_class_data_ccsds_packing_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_data_ccsds_packing_t::value_count(grib_accessor* a, long* count) +{ grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; *count = 0; return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, count); @@ -42,47 +53,50 @@ int grib_accessor_class_data_ccsds_packing_t::value_count(grib_accessor* a, long #if defined(HAVE_LIBAEC) || defined(HAVE_AEC) -bool grib_accessor_class_data_ccsds_packing_t::is_big_endian() +static bool is_big_endian() { - unsigned char is_big_endian = 0; + unsigned char is_big_endian = 0; unsigned short endianess_test = 1; return reinterpret_cast(&endianess_test)[0] == is_big_endian; } -void grib_accessor_class_data_ccsds_packing_t::modify_aec_flags(long* flags){ +static void modify_aec_flags(long* flags) +{ // ECC-1602: Performance improvement: enabled the use of native data types *flags &= ~AEC_DATA_3BYTE; // disable support for 3-bytes per value if (is_big_endian()) - *flags |= AEC_DATA_MSB; // enable big-endian + *flags |= AEC_DATA_MSB; // enable big-endian else *flags &= ~AEC_DATA_MSB; // enable little-endian } -const char* grib_accessor_class_data_ccsds_packing_t::aec_get_error_message(int code) +static 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"; + if (code == AEC_MEM_ERROR) return "AEC_MEM_ERROR"; + if (code == AEC_DATA_ERROR) return "AEC_DATA_ERROR"; if (code == AEC_STREAM_ERROR) return "AEC_STREAM_ERROR"; - if (code == AEC_CONF_ERROR) return "AEC_CONF_ERROR"; - if (code == AEC_OK) return "AEC_OK"; + if (code == AEC_CONF_ERROR) return "AEC_CONF_ERROR"; + if (code == AEC_OK) return "AEC_OK"; return "Unknown error code"; } -void grib_accessor_class_data_ccsds_packing_t::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); +static 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); - fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.block_size=%u\n", func, strm->block_size); - fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.rsi=%u\n", func, strm->rsi); - fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.avail_out=%lu\n", func, strm->avail_out); - fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.avail_in=%lu\n", func, strm->avail_in); + fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.block_size=%u\n", func, strm->block_size); + fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.rsi=%u\n", func, strm->rsi); + fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.avail_out=%lu\n", func, strm->avail_out); + fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.avail_in=%lu\n", func, strm->avail_in); } -int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); + grib_handle* hand = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; - int err = GRIB_SUCCESS; + int err = GRIB_SUCCESS; size_t buflen = 0, i = 0; bool is_constant_field = false; @@ -92,9 +106,9 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons long binary_scale_factor = 0; long decimal_scale_factor = 0; - //long optimize_scaling_factor = 0; - double reference_value = 0; - long bits_per_value = 0; + // long optimize_scaling_factor = 0; + double reference_value = 0; + long bits_per_value = 0; double max, min, d, divisor; long number_of_data_points; @@ -118,8 +132,8 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons if ((err = grib_get_long_internal(hand, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; - //if ((err = grib_get_long_internal(gh, self->optimize_scaling_factor, &optimize_scaling_factor)) != GRIB_SUCCESS) - // return err; + // if ((err = grib_get_long_internal(gh, self->optimize_scaling_factor, &optimize_scaling_factor)) != GRIB_SUCCESS) + // return err; if ((err = grib_get_long_internal(hand, self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) return err; @@ -139,8 +153,10 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons max = val[0]; min = max; for (i = 1; i < n_vals; i++) { - if (val[i] > max) max = val[i]; - else if (val[i] < min) min = val[i]; + if (val[i] > max) + max = val[i]; + else if (val[i] < min) + min = val[i]; } if ((err = grib_check_data_values_minmax(hand, min, max)) != GRIB_SUCCESS) { @@ -149,10 +165,11 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons if (min == max) { is_constant_field = true; - } else { + } + 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 } } @@ -172,7 +189,7 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons 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; @@ -191,25 +208,25 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons if (grib_get_nearest_smaller_value(hand, self->reference_value, min, &reference_value) != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, - "%s %s: Unable to find nearest_smaller_value of %g for %s", cclass_name, __func__, min, self->reference_value); + "%s %s: Unable to find nearest_smaller_value of %g for %s", cclass_name, __func__, min, self->reference_value); return GRIB_INTERNAL_ERROR; } if (reference_value > min) { grib_context_log(a->context, GRIB_LOG_ERROR, - "%s %s: reference_value=%g min_value=%g diff=%g", cclass_name, __func__, reference_value, min, reference_value - min); + "%s %s: reference_value=%g min_value=%g diff=%g", cclass_name, __func__, reference_value, min, reference_value - min); DEBUG_ASSERT(reference_value <= min); return GRIB_INTERNAL_ERROR; } } else { - int last = 127; // last must be a parameter coming from the def file - double range = 0; + 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; double unscaled_min = 0; - double f = 0; - double decimal = 1; + double f = 0; + double decimal = 1; decimal_scale_factor = 0; range = (max - min); @@ -292,17 +309,17 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons } break; default: - grib_context_log(a->context, GRIB_LOG_ERROR,"%s pack_double: packing %s, bits_per_value=%ld (max 32)", - cclass_name, a->name, bits_per_value); + grib_context_log(a->context, GRIB_LOG_ERROR, "%s pack_double: packing %s, bits_per_value=%ld (max 32)", + cclass_name, a->name, bits_per_value); err = GRIB_INVALID_BPV; goto cleanup; } - grib_context_log(a->context, GRIB_LOG_DEBUG,"%s pack_double: packing %s, %zu values", cclass_name, a->name, n_vals); + grib_context_log(a->context, GRIB_LOG_DEBUG, "%s pack_double: packing %s, %zu values", cclass_name, a->name, n_vals); // ECC-1431: GRIB2: CCSDS encoding failure AEC_STREAM_ERROR buflen = (nbytes * n_vals) * 67 / 64 + 256; - buf = (unsigned char*)grib_context_buffer_malloc_clear(a->context, buflen); + buf = (unsigned char*)grib_context_buffer_malloc_clear(a->context, buflen); if (!buf) { err = GRIB_OUT_OF_MEMORY; @@ -317,7 +334,7 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons grib_get_double_internal(hand, self->reference_value, &ref); if (ref != reference_value) { grib_context_log(a->context, GRIB_LOG_ERROR, "%s %s: %s (ref=%.10e != reference_value=%.10e)", - cclass_name, __func__, self->reference_value, ref, reference_value); + cclass_name, __func__, self->reference_value, ref, reference_value); return GRIB_INTERNAL_ERROR; } } @@ -338,7 +355,6 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons strm.next_in = encoded; strm.avail_in = nbytes * 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 @@ -346,7 +362,7 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons if ((err = aec_buffer_encode(&strm)) != AEC_OK) { grib_context_log(a->context, GRIB_LOG_ERROR, "%s %s: aec_buffer_encode error %d (%s)", - cclass_name, __func__, err, aec_get_error_message(err)); + cclass_name, __func__, err, aec_get_error_message(err)); err = GRIB_ENCODING_ERROR; goto cleanup; } @@ -367,23 +383,165 @@ int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, cons return err; } -int grib_accessor_class_data_ccsds_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +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_t* self = (grib_accessor_data_ccsds_packing_t*)a; + grib_handle* hand = grib_handle_of_accessor(a); + const char* cclass_name = a->cclass->name; + + 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 nn = 0; + + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + double reference_value = 0; + long bits_per_value = 0; + + long ccsds_flags; + long ccsds_block_size; + long ccsds_rsi; + size_t nbytes; + + self->dirty = 0; + + if ((err = a->value_count(&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; + + modify_aec_flags(&ccsds_flags); + + // TODO(masn): 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 = codes_power(binary_scale_factor, 2); + dscale = codes_power(-decimal_scale_factor, 10); + + buflen = a->byte_count(); + buf = (unsigned char*)hand->buffer->data; + buf += a->byte_offset(); + 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; + + nbytes = (bits_per_value + 7) / 8; + if (nbytes == 3) + nbytes = 4; + + size = n_vals * nbytes; + 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, "%s %s: aec_buffer_decode error %d (%s)", + cclass_name, __func__, err, aec_get_error_message(err)); + err = GRIB_DECODING_ERROR; + goto cleanup; + } + + // ECC-1427: Performance improvement (replaced by ECC-1602) + // grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); + + // ECC-1602: Performance improvement + switch (nbytes) { + case 1: + for (i = 0; i < n_vals; i++) { + val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; + } + break; + case 2: + for (i = 0; i < n_vals; i++) { + val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; + } + break; + case 4: + for (i = 0; i < n_vals; i++) { + val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; + } + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, "%s %s: unpacking %s, bits_per_value=%ld (max 32)", + cclass_name, __func__, a->name, bits_per_value); + err = GRIB_INVALID_BPV; + goto cleanup; + } + + *len = n_vals; + +cleanup: + grib_context_buffer_free(a->context, decoded); + return err; +} + +int grib_accessor_class_data_ccsds_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_data_ccsds_packing_t::unpack_float(grib_accessor* a, float* val, size_t* len){ +int grib_accessor_class_data_ccsds_packing_t::unpack_float(grib_accessor* a, float* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_data_ccsds_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ +int grib_accessor_class_data_ccsds_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val) +{ // The index idx relates to codedValues NOT values! const grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int err = 0; - size_t size = 0; - long bits_per_value = 0; + + grib_handle* hand = grib_handle_of_accessor(a); + int err = 0; + size_t size = 0; + long bits_per_value = 0; double reference_value = 0; - double* values = NULL; + double* values = NULL; if ((err = grib_get_long_internal(hand, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) return err; @@ -411,13 +569,14 @@ int grib_accessor_class_data_ccsds_packing_t::unpack_double_element(grib_accesso return GRIB_SUCCESS; } -int grib_accessor_class_data_ccsds_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ +int grib_accessor_class_data_ccsds_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) +{ const grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; grib_handle* hand = grib_handle_of_accessor(a); size_t size = 0, i = 0; - double* values = NULL; - int err = 0; - long bits_per_value = 0; + double* values = NULL; + int err = 0; + long bits_per_value = 0; double reference_value = 0; if ((err = grib_get_long_internal(hand, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) @@ -458,28 +617,34 @@ int grib_accessor_class_data_ccsds_packing_t::unpack_double_element_set(grib_acc #else -static void print_error_feature_not_enabled(grib_context* c){ +static void print_error_feature_not_enabled(grib_context* c) +{ grib_context_log(c, GRIB_LOG_ERROR, "CCSDS support not enabled. " "Please rebuild with -DENABLE_AEC=ON (Adaptive Entropy Coding library)"); } -int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_data_ccsds_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } -int grib_accessor_class_data_ccsds_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_data_ccsds_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } -int grib_accessor_class_data_ccsds_packing_t::unpack_float(grib_accessor* a, float* val, size_t* len){ +int grib_accessor_class_data_ccsds_packing_t::unpack_float(grib_accessor* a, float* val, size_t* len) +{ print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } -int grib_accessor_class_data_ccsds_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ +int grib_accessor_class_data_ccsds_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val) +{ print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } -int grib_accessor_class_data_ccsds_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ +int grib_accessor_class_data_ccsds_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) +{ print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.h b/src/accessor/grib_accessor_class_data_ccsds_packing.h index 19889e937..c93c0d24c 100644 --- a/src/accessor/grib_accessor_class_data_ccsds_packing.h +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.h @@ -9,20 +9,11 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_ccsds_packing_h -#define eccodes_accessor_data_ccsds_packing_h +#pragma once #include "grib_accessor_class_values.h" #include "grib_scaling.h" -#if defined(HAVE_LIBAEC) || defined(HAVE_AEC) -#include -#endif - -#ifndef LIBAEC_DLL_EXPORTED - #error Version of libaec appears to be too old. Please upgrade. -#endif - class grib_accessor_data_ccsds_packing_t : public grib_accessor_values_t { public: @@ -40,7 +31,6 @@ class grib_accessor_data_ccsds_packing_t : public grib_accessor_values_t }; - // TODO(maee): if libaec is not available, this class should not be defined class grib_accessor_class_data_ccsds_packing_t : public grib_accessor_class_values_t { @@ -54,150 +44,4 @@ class grib_accessor_class_data_ccsds_packing_t : public grib_accessor_class_valu void init(grib_accessor*, const long, grib_arguments*) override; int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; - -private: - template int unpack(grib_accessor*, T*, size_t* ); - void print_aec_stream_info(struct aec_stream*, const char*); - void modify_aec_flags(long*); - const char* aec_get_error_message(int); - bool is_big_endian(); }; - - -template -int grib_accessor_class_data_ccsds_packing_t::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_t* self = (grib_accessor_data_ccsds_packing_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - const char* cclass_name = a->cclass->name; - - 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 nn = 0; - - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - double reference_value = 0; - long bits_per_value = 0; - - long ccsds_flags; - long ccsds_block_size; - long ccsds_rsi; - size_t nbytes; - - self->dirty = 0; - - if ((err = a->value_count(&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; - - modify_aec_flags(&ccsds_flags); - - // TODO(masn): 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 = codes_power(binary_scale_factor, 2); - dscale = codes_power(-decimal_scale_factor, 10); - - buflen = a->byte_count(); buf = (unsigned char*)hand->buffer->data; - buf += a->byte_offset(); - 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; - - nbytes = (bits_per_value + 7) / 8; - if (nbytes == 3) - nbytes = 4; - - size = n_vals * nbytes; - 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, "%s %s: aec_buffer_decode error %d (%s)", - cclass_name, __func__, err, aec_get_error_message(err)); - err = GRIB_DECODING_ERROR; - goto cleanup; - } - - // ECC-1427: Performance improvement (replaced by ECC-1602) - //grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); - - // ECC-1602: Performance improvement - switch (nbytes) { - case 1: - for (i = 0; i < n_vals; i++) { - val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; - } - break; - case 2: - for (i = 0; i < n_vals; i++) { - val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; - } - break; - case 4: - for (i = 0; i < n_vals; i++) { - val[i] = (reinterpret_cast(decoded)[i] * bscale + reference_value) * dscale; - } - break; - default: - grib_context_log(a->context, GRIB_LOG_ERROR, "%s %s: unpacking %s, bits_per_value=%ld (max 32)", - cclass_name, __func__, a->name, bits_per_value); - err = GRIB_INVALID_BPV; - goto cleanup; - } - - *len = n_vals; - -cleanup: - grib_context_buffer_free(a->context, decoded); - return err; -} - -#endif /* eccodes_accessor_data_ccsds_packing_h */ From 481c78c22772d7c92f4446712e07f9decbc48645 Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 7 May 2024 16:03:20 +0100 Subject: [PATCH 122/196] ECC-1820: Fix CCSDS class when -DENABLE_AEC=OFF --- src/accessor/grib_accessor_class_data_ccsds_packing.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.cc b/src/accessor/grib_accessor_class_data_ccsds_packing.cc index e453a7b09..5b0813bfd 100644 --- a/src/accessor/grib_accessor_class_data_ccsds_packing.cc +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.cc @@ -13,11 +13,11 @@ #if defined(HAVE_LIBAEC) || defined(HAVE_AEC) #include + #ifndef LIBAEC_DLL_EXPORTED + #error Version of libaec appears to be too old. Please upgrade. + #endif #endif -#ifndef LIBAEC_DLL_EXPORTED - #error Version of libaec appears to be too old. Please upgrade. -#endif grib_accessor_class_data_ccsds_packing_t _grib_accessor_class_data_ccsds_packing{ "data_ccsds_packing" }; grib_accessor_class* grib_accessor_class_data_ccsds_packing = &_grib_accessor_class_data_ccsds_packing; From 867da9928cbe1ff6f1a78f7e1d4af19dae982e56 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 7 May 2024 15:12:50 +0000 Subject: [PATCH 123/196] Cleanup --- ...essor_class_data_g2simple_packing_with_preprocessing.cc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc index 8eac09789..fa653c0cb 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc +++ b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc @@ -127,10 +127,6 @@ int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::unpack_doubl return err; } - // TODO(maee): fix this - //Assert(super->super); - //super2 = *(super->super); - //err = super2->unpack_double(a, val, &n_vals); [> GRIB-364 <] err = grib_accessor_class_data_simple_packing_t::unpack_double(a, val, &n_vals); if (err != GRIB_SUCCESS) return err; @@ -146,7 +142,6 @@ int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::unpack_doubl int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ grib_accessor_data_g2simple_packing_with_preprocessing_t* self = (grib_accessor_data_g2simple_packing_with_preprocessing_t*)a; - //grib_accessor_class* super = *(a->cclass->super); size_t n_vals = *len; int err = 0; @@ -163,8 +158,6 @@ int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::pack_double( if (err != GRIB_SUCCESS) return err; - // TOOD(maee): fix this - //err = super->pack_double(a, val, len); err = grib_accessor_class_data_g2simple_packing_t::pack_double(a, val, len); if (err != GRIB_SUCCESS) return err; From 41c513e7d90b5826f24fdee410d8d665589da5bf Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 7 May 2024 16:47:42 +0100 Subject: [PATCH 124/196] ECC-1820: Remove duplicate entry --- src/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 28e037c21..fce6d88d8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -126,7 +126,6 @@ list( APPEND eccodes_src_files accessor/grib_accessor_class_g2lon.cc accessor/grib_accessor_class_global_gaussian.cc accessor/grib_accessor_class_gaussian_grid_name.cc - accessor/grib_accessor_class_gen.cc accessor/grib_accessor_class_getenv.cc accessor/grib_accessor_class_gts_header.cc accessor/grib_accessor_class_ifs_param.cc From 6b1dae3e5527b373189d8691683472337da0caca Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 7 May 2024 15:58:49 +0000 Subject: [PATCH 125/196] Cleanup --- .../grib_accessor_class_data_g2simple_packing.cc | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing.cc b/src/accessor/grib_accessor_class_data_g2simple_packing.cc index 7f3ef141a..08aa11699 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2simple_packing.cc @@ -104,20 +104,7 @@ int grib_accessor_class_data_g2simple_packing_t::pack_double(grib_accessor* a, c return grib_set_double_array(h, "values", val, *len); } - // ==== TODO(maee): Fix this ==== ret = grib_accessor_class_data_simple_packing_t::pack_double(a, cval, len); - //if (super != grib_accessor_class_data_g2simple_packing) { - // [> Normal case: parent not same as me! <] - // ret = super->pack_double(a, val, len); - //} - //else { - // [> GRIB-364: simple packing with logarithm pre-processing <] - // grib_accessor_class* super2 = NULL; - // Assert(super->super); - // super2 = *(super->super); - // ret = super2->pack_double(a, val, len); - //} - // ============================= switch (ret) { case GRIB_CONSTANT_FIELD: grib_buffer_replace(a, NULL, 0, 1, 1); From 1a3e11e67f0c644f3801182a592950a81e3bbf5c Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 7 May 2024 15:59:20 +0000 Subject: [PATCH 126/196] Better commment --- src/accessor/grib_accessor_class_gen.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index 292c87c35..5618d95e2 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -229,7 +229,8 @@ void grib_accessor_class_gen_t::init(grib_accessor* a, const long len, grib_argu grib_expression* expression = grib_arguments_get_expression(grib_handle_of_accessor(a), act->default_value, 0); int type = grib_expression_native_type(grib_handle_of_accessor(a), expression); switch (type) { - // TODO(maee): single-precision + // TODO(maee): add single-precision case + case GRIB_TYPE_DOUBLE: grib_expression_evaluate_double(grib_handle_of_accessor(a), expression, &d); a->pack_double(&d, &s_len); From 6aa4be2084fc91489c2adf24c741f8dd928a9f89 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 7 May 2024 16:35:10 +0000 Subject: [PATCH 127/196] Remove unnecessary includes --- src/grib_accessor_class.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/grib_accessor_class.h b/src/grib_accessor_class.h index ceda43659..cfec4d21d 100644 --- a/src/grib_accessor_class.h +++ b/src/grib_accessor_class.h @@ -25,12 +25,10 @@ extern grib_accessor_class* grib_accessor_class_change_scanning_direction; extern grib_accessor_class* grib_accessor_class_check_internal_version; extern grib_accessor_class* grib_accessor_class_closest_date; extern grib_accessor_class* grib_accessor_class_codeflag; -#include "accessor/grib_accessor_class_codetable.h" extern grib_accessor_class* grib_accessor_class_codetable; extern grib_accessor_class* grib_accessor_class_codetable_title; extern grib_accessor_class* grib_accessor_class_codetable_units; extern grib_accessor_class* grib_accessor_class_concept; -#include "accessor/grib_accessor_class_constant.h" extern grib_accessor_class* grib_accessor_class_constant; extern grib_accessor_class* grib_accessor_class_count_file; extern grib_accessor_class* grib_accessor_class_count_missing; @@ -115,7 +113,6 @@ extern grib_accessor_class* grib_accessor_class_headers_only; extern grib_accessor_class* grib_accessor_class_ibmfloat; extern grib_accessor_class* grib_accessor_class_ieeefloat; extern grib_accessor_class* grib_accessor_class_ifs_param; -#include "accessor/grib_accessor_class_iterator.h" extern grib_accessor_class* grib_accessor_class_iterator; extern grib_accessor_class* grib_accessor_class_julian_date; extern grib_accessor_class* grib_accessor_class_julian_day; @@ -126,7 +123,6 @@ extern grib_accessor_class* grib_accessor_class_latlon_increment; extern grib_accessor_class* grib_accessor_class_latlonvalues; extern grib_accessor_class* grib_accessor_class_library_version; extern grib_accessor_class* grib_accessor_class_local_definition; -#include "accessor/grib_accessor_class_long.h" extern grib_accessor_class* grib_accessor_class_long; extern grib_accessor_class* grib_accessor_class_long_vector; extern grib_accessor_class* grib_accessor_class_longitudes; @@ -137,7 +133,6 @@ extern grib_accessor_class* grib_accessor_class_md5; extern grib_accessor_class* grib_accessor_class_message; extern grib_accessor_class* grib_accessor_class_message_copy; extern grib_accessor_class* grib_accessor_class_multdouble; -#include "accessor/grib_accessor_class_nearest.h" extern grib_accessor_class* grib_accessor_class_nearest; extern grib_accessor_class* grib_accessor_class_non_alpha; extern grib_accessor_class* grib_accessor_class_number_of_coded_values; @@ -176,7 +171,6 @@ extern grib_accessor_class* grib_accessor_class_signed; extern grib_accessor_class* grib_accessor_class_signed_bits; extern grib_accessor_class* grib_accessor_class_simple_packing_error; extern grib_accessor_class* grib_accessor_class_size; -#include "accessor/grib_accessor_class_smart_table.h" extern grib_accessor_class* grib_accessor_class_smart_table; extern grib_accessor_class* grib_accessor_class_smart_table_column; extern grib_accessor_class* grib_accessor_class_spd; @@ -192,7 +186,6 @@ extern grib_accessor_class* grib_accessor_class_time; extern grib_accessor_class* grib_accessor_class_to_double; extern grib_accessor_class* grib_accessor_class_to_integer; extern grib_accessor_class* grib_accessor_class_to_string; -#include "accessor/grib_accessor_class_transient.h" extern grib_accessor_class* grib_accessor_class_transient; extern grib_accessor_class* grib_accessor_class_transient_darray; extern grib_accessor_class* grib_accessor_class_trim; @@ -204,13 +197,11 @@ extern grib_accessor_class* grib_accessor_class_uint64_little_endian; extern grib_accessor_class* grib_accessor_class_uint8; extern grib_accessor_class* grib_accessor_class_unexpanded_descriptors; extern grib_accessor_class* grib_accessor_class_unpack_bufr_values; -#include "accessor/grib_accessor_class_unsigned.h" extern grib_accessor_class* grib_accessor_class_unsigned; extern grib_accessor_class* grib_accessor_class_unsigned_bits; extern grib_accessor_class* grib_accessor_class_validity_date; extern grib_accessor_class* grib_accessor_class_validity_time; extern grib_accessor_class* grib_accessor_class_values; -#include "accessor/grib_accessor_class_variable.h" extern grib_accessor_class* grib_accessor_class_variable; extern grib_accessor_class* grib_accessor_class_vector; extern grib_accessor_class* grib_accessor_class_when; From 57b2698cc3400aae6e34160ed3a564f4e0616f6c Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 8 May 2024 10:15:10 +0100 Subject: [PATCH 128/196] Compiler warnings re sprintf --- fortran/grib_fortran.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fortran/grib_fortran.cc b/fortran/grib_fortran.cc index 34a061730..972118384 100644 --- a/fortran/grib_fortran.cc +++ b/fortran/grib_fortran.cc @@ -987,7 +987,7 @@ void grib_f_write_on_fail(int* gid) { file_count++; GRIB_MUTEX_UNLOCK(&handle_mutex) - sprintf(filename,"%ld_%d_error.grib",(long)pid,file_count); + snprintf(filename, sizeof(filename), "%ld_%d_error.grib",(long)pid,file_count); h=get_handle(*gid); if (h) grib_write_message(h,filename,"w"); @@ -1250,7 +1250,7 @@ int grib_f_keys_iterator_get_name_(int* iterid,char* name,int len) fort_char_clean(name, len); - sprintf(buf,"%s",grib_keys_iterator_get_name(kiter)); + snprintf(buf, sizeof(buf), "%s",grib_keys_iterator_get_name(kiter)); lsize = strlen(buf); if (input_len < lsize) return GRIB_ARRAY_TOO_SMALL; @@ -1322,7 +1322,7 @@ int codes_f_bufr_keys_iterator_get_name_(int* iterid, char* name, int len) fort_char_clean(name, len); - sprintf(buf, "%s", codes_bufr_keys_iterator_get_name(kiter)); + snprintf(buf, sizeof(buf), "%s", codes_bufr_keys_iterator_get_name(kiter)); lsize = strlen(buf); if (input_len < lsize) return GRIB_ARRAY_TOO_SMALL; From cf72dca9714ba8bd52c27895bde755799c4f1266 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 8 May 2024 10:16:12 +0100 Subject: [PATCH 129/196] Move function from header to local static. Use pragma once --- .../grib_accessor_class_data_apply_bitmap.cc | 178 ++++++++--- .../grib_accessor_class_data_apply_bitmap.h | 90 +----- ...rib_accessor_class_data_complex_packing.cc | 279 ++++++++++++++++-- ...grib_accessor_class_data_complex_packing.h | 227 +------------- ...grib_accessor_class_data_simple_packing.cc | 258 ++++++++++++---- .../grib_accessor_class_data_simple_packing.h | 151 +--------- 6 files changed, 597 insertions(+), 586 deletions(-) diff --git a/src/accessor/grib_accessor_class_data_apply_bitmap.cc b/src/accessor/grib_accessor_class_data_apply_bitmap.cc index 86e54ff63..cf3d5f4a5 100644 --- a/src/accessor/grib_accessor_class_data_apply_bitmap.cc +++ b/src/accessor/grib_accessor_class_data_apply_bitmap.cc @@ -11,13 +11,14 @@ #include "grib_accessor_class_data_apply_bitmap.h" -grib_accessor_class_data_apply_bitmap_t _grib_accessor_class_data_apply_bitmap{"data_apply_bitmap"}; +grib_accessor_class_data_apply_bitmap_t _grib_accessor_class_data_apply_bitmap{ "data_apply_bitmap" }; grib_accessor_class* grib_accessor_class_data_apply_bitmap = &_grib_accessor_class_data_apply_bitmap; -void grib_accessor_class_data_apply_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args){ +void grib_accessor_class_data_apply_bitmap_t::init(grib_accessor* a, const long v, grib_arguments* args) +{ grib_accessor_class_gen_t::init(a, v, args); - int n = 0; + int n = 0; grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; self->coded_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); @@ -29,14 +30,16 @@ void grib_accessor_class_data_apply_bitmap_t::init(grib_accessor* a, const long a->length = 0; } -void grib_accessor_class_data_apply_bitmap_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_data_apply_bitmap_t::dump(grib_accessor* a, grib_dumper* dumper) +{ grib_dump_values(dumper, a); } -int grib_accessor_class_data_apply_bitmap_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_data_apply_bitmap_t::value_count(grib_accessor* a, long* count) +{ grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; - size_t len = 0; - int ret = 0; + size_t len = 0; + int ret = GRIB_SUCCESS; if (grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) ret = grib_get_size(grib_handle_of_accessor(a), self->bitmap, &len); @@ -48,17 +51,18 @@ int grib_accessor_class_data_apply_bitmap_t::value_count(grib_accessor* a, long* return ret; } -int grib_accessor_class_data_apply_bitmap_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ +int grib_accessor_class_data_apply_bitmap_t::unpack_double_element(grib_accessor* a, size_t idx, double* val) +{ grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); - int err = 0, i = 0; - size_t cidx = 0; + grib_handle* gh = grib_handle_of_accessor(a); + size_t i = 0, cidx = 0; double missing_value = 0; double* bvals = NULL; size_t n_vals = 0; long nn = 0; - err = a->value_count(&nn); n_vals = nn; + int err = a->value_count(&nn); + n_vals = nn; if (err) return err; @@ -93,19 +97,21 @@ int grib_accessor_class_data_apply_bitmap_t::unpack_double_element(grib_accessor return grib_get_double_element_internal(gh, self->coded_values, cidx, val); } -int grib_accessor_class_data_apply_bitmap_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ +int grib_accessor_class_data_apply_bitmap_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) +{ grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); + grib_handle* gh = grib_handle_of_accessor(a); int err = 0, all_missing = 1; - size_t cidx = 0; /* index into the coded_values array */ - size_t* cidx_array = NULL; /* array of indexes into the coded_values */ - double* cval_array = NULL; /* array of values of the coded_values */ + size_t cidx = 0; /* index into the coded_values array */ + size_t* cidx_array = NULL; /* array of indexes into the coded_values */ + double* cval_array = NULL; /* array of values of the coded_values */ double missing_value = 0; double* bvals = NULL; size_t n_vals = 0, i = 0, j = 0, idx = 0, count_1s = 0, ci = 0; long nn = 0; - err = a->value_count(&nn); n_vals = nn; + err = a->value_count(&nn); + n_vals = nn; if (err) return err; if (!grib_find_accessor(gh, self->bitmap)) @@ -119,7 +125,8 @@ int grib_accessor_class_data_apply_bitmap_t::unpack_double_element_set(grib_acce for (i = 0; i < len; i++) { if (val_array[i] == 0) { val_array[i] = missing_value; - } else { + } + else { all_missing = 0; count_1s++; } @@ -144,7 +151,7 @@ int grib_accessor_class_data_apply_bitmap_t::unpack_double_element_set(grib_acce ci = 0; for (i = 0; i < len; i++) { if (val_array[i] == 1) { - idx = index_array[i]; + idx = index_array[i]; cidx = 0; for (j = 0; j < idx; j++) { cidx += bvals[j]; @@ -171,17 +178,18 @@ int grib_accessor_class_data_apply_bitmap_t::unpack_double_element_set(grib_acce return GRIB_SUCCESS; } -int grib_accessor_class_data_apply_bitmap_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_data_apply_bitmap_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; - int err = 0; - size_t bmaplen = *len; - long coded_n_vals = 0; - double* coded_vals = NULL; - long i = 0; - long j = 0; - double missing_value = 0; - grib_handle* hand = grib_handle_of_accessor(a); - grib_context* ctxt = a->context; + int err = 0; + size_t bmaplen = *len; + long coded_n_vals = 0; + double* coded_vals = NULL; + long i = 0; + long j = 0; + double missing_value = 0; + grib_handle* hand = grib_handle_of_accessor(a); + grib_context* ctxt = a->context; if (*len == 0) return GRIB_NO_VALUES; @@ -231,22 +239,106 @@ int grib_accessor_class_data_apply_bitmap_t::pack_double(grib_accessor* a, const } -int grib_accessor_class_data_apply_bitmap_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +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_t* self = (grib_accessor_data_apply_bitmap_t*)a; + + size_t i = 0; + size_t j = 0; + size_t n_vals = 0; + long nn = 0; + size_t coded_n_vals = 0; + T* coded_vals = NULL; + double missing_value = 0; + + int err = a->value_count(&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", + __func__, 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, __func__, coded_n_vals, n_vals); + + return GRIB_ARRAY_TOO_SMALL; + } + } + } + + *len = n_vals; + + grib_context_free(a->context, coded_vals); + return err; +} + +int grib_accessor_class_data_apply_bitmap_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_data_apply_bitmap_t::unpack_float(grib_accessor* a, float* val, size_t* len){ +int grib_accessor_class_data_apply_bitmap_t::unpack_float(grib_accessor* a, float* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_data_apply_bitmap_t::get_native_type(grib_accessor* a){ - //grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; - //return grib_accessor_get_native_type(grib_find_accessor(grib_handle_of_accessor(a),self->coded_values)); - +int grib_accessor_class_data_apply_bitmap_t::get_native_type(grib_accessor* a) +{ + // grib_accessor_data_apply_bitmap_t* self = (grib_accessor_data_apply_bitmap_t*)a; + // return grib_accessor_get_native_type(grib_find_accessor(grib_handle_of_accessor(a),self->coded_values)); return GRIB_TYPE_DOUBLE; } -int grib_accessor_class_data_apply_bitmap_t::compare(grib_accessor* a, grib_accessor* b){ +int grib_accessor_class_data_apply_bitmap_t::compare(grib_accessor* a, grib_accessor* b) +{ int retval = GRIB_SUCCESS; double* aval = 0; double* bval = 0; @@ -256,11 +348,13 @@ int grib_accessor_class_data_apply_bitmap_t::compare(grib_accessor* a, grib_acce int err = 0; long count = 0; - err = a->value_count(&count); if (err) + err = a->value_count(&count); + if (err) return err; alen = count; - err = b->value_count(&count); if (err) + err = b->value_count(&count); + if (err) return err; blen = count; @@ -270,9 +364,10 @@ int grib_accessor_class_data_apply_bitmap_t::compare(grib_accessor* a, grib_acce aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - a->unpack_double(aval, &alen); b->unpack_double(bval, &blen); + a->unpack_double(aval, &alen); + b->unpack_double(bval, &blen); retval = GRIB_SUCCESS; - for (size_t i=0; i int unpack(grib_accessor*, T*, size_t*); }; - - -template -int grib_accessor_class_data_apply_bitmap_t::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_t* self = (grib_accessor_data_apply_bitmap_t*)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 = a->value_count(&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", - __func__, - 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, __func__, coded_n_vals, n_vals); - - return GRIB_ARRAY_TOO_SMALL; - } - } - } - - *len = n_vals; - - grib_context_free(a->context, coded_vals); - return err; -} - -#endif /* eccodes_accessor_data_apply_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_complex_packing.cc b/src/accessor/grib_accessor_class_data_complex_packing.cc index 77a3ab822..81e402303 100644 --- a/src/accessor/grib_accessor_class_data_complex_packing.cc +++ b/src/accessor/grib_accessor_class_data_complex_packing.cc @@ -11,13 +11,14 @@ #include "grib_accessor_class_data_complex_packing.h" -grib_accessor_class_data_complex_packing_t _grib_accessor_class_data_complex_packing{"data_complex_packing"}; +grib_accessor_class_data_complex_packing_t _grib_accessor_class_data_complex_packing{ "data_complex_packing" }; grib_accessor_class* grib_accessor_class_data_complex_packing = &_grib_accessor_class_data_complex_packing; -void grib_accessor_class_data_complex_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ +void grib_accessor_class_data_complex_packing_t::init(grib_accessor* a, const long v, grib_arguments* args) +{ grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_complex_packing_t* self = (grib_accessor_data_complex_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); + grib_handle* gh = grib_handle_of_accessor(a); self->GRIBEX_sh_bug_present = grib_arguments_get_name(gh, args, self->carg++); self->ieee_floats = grib_arguments_get_name(gh, args, self->carg++); @@ -33,14 +34,16 @@ void grib_accessor_class_data_complex_packing_t::init(grib_accessor* a, const lo a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -int grib_accessor_class_data_complex_packing_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_data_complex_packing_t::value_count(grib_accessor* a, long* count) +{ grib_accessor_data_complex_packing_t* self = (grib_accessor_data_complex_packing_t*)a; - int ret = 0; + + int ret = GRIB_SUCCESS; grib_handle* gh = grib_handle_of_accessor(a); - long pen_j = 0; - long pen_k = 0; - long pen_m = 0; - *count = 0; + long pen_j = 0; + long pen_k = 0; + long pen_m = 0; + *count = 0; if (a->length == 0) return 0; @@ -62,7 +65,8 @@ int grib_accessor_class_data_complex_packing_t::value_count(grib_accessor* a, lo return ret; } -double calculate_pfactor(const grib_context* ctx, const double* spectralField, long fieldTruncation, long subsetTruncation){ +double calculate_pfactor(const grib_context* ctx, const double* spectralField, long fieldTruncation, long subsetTruncation) +{ /*long n_vals = ((fieldTruncation+1)*(fieldTruncation+2));*/ long loop, index, m, n = 0; double pFactor, zeps = 1.0e-15; @@ -95,7 +99,6 @@ double calculate_pfactor(const grib_context* ctx, const double* spectralField, l /* * Form norms for the rows which contain part of the unscaled subset. */ - index = -2; for (m = 0; m < subsetTruncation; m++) { for (n = m; n <= fieldTruncation; n++) { @@ -110,7 +113,6 @@ double calculate_pfactor(const grib_context* ctx, const double* spectralField, l /* * Form norms for the rows which do not contain part of the unscaled subset. */ - for (m = subsetTruncation; m <= fieldTruncation; m++) { for (n = m; n <= fieldTruncation; n++) { index += 2; @@ -146,7 +148,6 @@ double calculate_pfactor(const grib_context* ctx, const double* spectralField, l /* * Perform a least square fit for the equation */ - for (loop = ismin; loop <= ismax; loop++) { x = log((double)(loop * (loop + 1))); y = log(norms[loop]); @@ -168,10 +169,11 @@ double calculate_pfactor(const grib_context* ctx, const double* spectralField, l return pFactor; } -int grib_accessor_class_data_complex_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_data_complex_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_data_complex_packing_t* self = (grib_accessor_data_complex_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); - const char* cclass_name = a->cclass->name; + grib_handle* gh = grib_handle_of_accessor(a); + const char* cclass_name = a->cclass->name; size_t i = 0; int ret = GRIB_SUCCESS; @@ -519,7 +521,7 @@ int grib_accessor_class_data_complex_packing_t::pack_double(grib_accessor* a, co grib_get_double_internal(gh, self->reference_value, &ref); if (ref != reference_value) { grib_context_log(a->context, GRIB_LOG_ERROR, "%s %s: %s (ref=%.10e != reference_value=%.10e)", - cclass_name, __func__, self->reference_value, ref, reference_value); + cclass_name, __func__, self->reference_value, ref, reference_value); return GRIB_INTERNAL_ERROR; } } @@ -536,34 +538,253 @@ int grib_accessor_class_data_complex_packing_t::pack_double(grib_accessor* a, co return ret; } +template +static int unpack_real(grib_accessor* a, T* val, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + grib_accessor_data_complex_packing_t* self = (grib_accessor_data_complex_packing_t*)a; + grib_handle* gh = grib_handle_of_accessor(a); + const char* cclass_name = a->cclass->name; + + 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; + + T s = 0; + T d = 0; + T 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; -int grib_accessor_class_data_complex_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ - return unpack(a, val, len); + long offsetdata = 0; + long bits_per_value = 0; + T 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; + double tmp; + + decode_float_proc decode_float = NULL; + + err = a->value_count(&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, &tmp)) != GRIB_SUCCESS) + return ret; + reference_value = tmp; + 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, &tmp)) != GRIB_SUCCESS) + return ret; + laplacianOperator = tmp; + + 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; + } + + if (sub_j != sub_k || sub_j != sub_m || pen_j != pen_k || pen_j != pen_m) { + grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Invalid pentagonal resolution parameters", cclass_name); + return GRIB_DECODING_ERROR; + } + + buf = (unsigned char*)gh->buffer->data; + + maxv = pen_j + 1; + + buf += a->byte_offset(); + hres = buf; + lres = buf; + + if (pen_j == sub_j) { + n_vals = (pen_j + 1) * (pen_j + 2); + d = codes_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 = a->byte_offset() + bytes * (sub_k + 1) * (sub_k + 2); + lpos = 8 * (packed_offset - offsetdata); + + s = codes_power(binary_scale_factor, 2); + d = codes_power(-decimal_scale_factor, 10); + + scals = (T*)grib_context_malloc(a->context, maxv * sizeof(T)); + if (!scals) return GRIB_OUT_OF_MEMORY; + + 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, + "%s: Problem with operator div by zero at index %d of %d", cclass_name, 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; +} + +int grib_accessor_class_data_complex_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ + return unpack_real(a, val, len); } -int grib_accessor_class_data_complex_packing_t::unpack_float(grib_accessor* a, float* val, size_t* len){ +int grib_accessor_class_data_complex_packing_t::unpack_float(grib_accessor* a, float* val, size_t* len) +{ // TODO(maee): See ECC-1579 // Investigate why results are not bit-identical // return unpack(a, val, len); - int err = 0; - size_t i = 0; - size_t size = *len; - double* val8 = NULL; - val8 = (double*)grib_context_malloc(a->context, size*(sizeof(double))); + size_t size = *len; + double* val8 = (double*)grib_context_malloc(a->context, size * (sizeof(double))); if (!val8) return GRIB_OUT_OF_MEMORY; - err = unpack(a, val8, len); + int err = unpack_real(a, val8, len); if (err) { - grib_context_free(a->context,val8); + grib_context_free(a->context, val8); return err; } - for(i=0; icontext,val8); + grib_context_free(a->context, val8); return GRIB_SUCCESS; } diff --git a/src/accessor/grib_accessor_class_data_complex_packing.h b/src/accessor/grib_accessor_class_data_complex_packing.h index d588eef38..a8276311a 100644 --- a/src/accessor/grib_accessor_class_data_complex_packing.h +++ b/src/accessor/grib_accessor_class_data_complex_packing.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_complex_packing_h -#define eccodes_accessor_data_complex_packing_h +#pragma once #include "grib_accessor_class_data_simple_packing.h" #include "grib_scaling.h" @@ -45,228 +44,4 @@ class grib_accessor_class_data_complex_packing_t : public grib_accessor_class_da int unpack_float(grib_accessor*, float* val, size_t* len) override; int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; - -private: - template int unpack(grib_accessor*, T*, size_t*); }; - -template -int grib_accessor_class_data_complex_packing_t::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_t* self = (grib_accessor_data_complex_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); - const char* cclass_name = a->cclass->name; - - 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; - - T s = 0; - T d = 0; - T 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; - T 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; - double tmp; - - decode_float_proc decode_float = NULL; - - err = a->value_count(&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, &tmp)) != GRIB_SUCCESS) - return ret; - reference_value = tmp; - 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, &tmp)) != GRIB_SUCCESS) - return ret; - laplacianOperator = tmp; - - 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; - } - - if (sub_j != sub_k || sub_j != sub_m || pen_j != pen_k || pen_j != pen_m) { - grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Invalid pentagonal resolution parameters", cclass_name); - return GRIB_DECODING_ERROR; - } - - buf = (unsigned char*)gh->buffer->data; - - maxv = pen_j + 1; - - buf += a->byte_offset(); hres = buf; - lres = buf; - - if (pen_j == sub_j) { - n_vals = (pen_j + 1) * (pen_j + 2); - d = codes_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 = a->byte_offset() + bytes * (sub_k + 1) * (sub_k + 2); - lpos = 8 * (packed_offset - offsetdata); - - s = codes_power(binary_scale_factor, 2); - d = codes_power(-decimal_scale_factor, 10); - - scals = (T*)grib_context_malloc(a->context, maxv * sizeof(T)); - if (!scals) return GRIB_OUT_OF_MEMORY; - - 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, - "%s: Problem with operator div by zero at index %d of %d", cclass_name, 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; -} - -#endif /* eccodes_accessor_data_complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_simple_packing.cc b/src/accessor/grib_accessor_class_data_simple_packing.cc index d1032808e..591e89526 100644 --- a/src/accessor/grib_accessor_class_data_simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_simple_packing.cc @@ -11,26 +11,28 @@ #include "grib_accessor_class_data_simple_packing.h" #include "grib_optimize_decimal_factor.h" +#include "grib_bits_any_endian_simple.h" #include #include -grib_accessor_class_data_simple_packing_t _grib_accessor_class_data_simple_packing{"data_simple_packing"}; +grib_accessor_class_data_simple_packing_t _grib_accessor_class_data_simple_packing{ "data_simple_packing" }; grib_accessor_class* grib_accessor_class_data_simple_packing = &_grib_accessor_class_data_simple_packing; -void grib_accessor_class_data_simple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ +void grib_accessor_class_data_simple_packing_t::init(grib_accessor* a, const long v, grib_arguments* args) +{ grib_accessor_class_values_t::init(a, v, args); grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); - self->units_factor = grib_arguments_get_name(gh, args, self->carg++); - self->units_bias = grib_arguments_get_name(gh, args, self->carg++); - self->changing_precision = grib_arguments_get_name(gh, args, self->carg++); - self->number_of_values = grib_arguments_get_name(gh, args, self->carg++); - self->bits_per_value = grib_arguments_get_name(gh, args, self->carg++); - self->reference_value = grib_arguments_get_name(gh, args, self->carg++); - self->binary_scale_factor = grib_arguments_get_name(gh, args, self->carg++); - self->decimal_scale_factor = grib_arguments_get_name(gh, args, self->carg++); - self->optimize_scaling_factor = grib_arguments_get_name(gh, args, self->carg++); + grib_handle* gh = grib_handle_of_accessor(a); + self->units_factor = grib_arguments_get_name(gh, args, self->carg++); + self->units_bias = grib_arguments_get_name(gh, args, self->carg++); + self->changing_precision = grib_arguments_get_name(gh, args, self->carg++); + self->number_of_values = grib_arguments_get_name(gh, args, self->carg++); + self->bits_per_value = grib_arguments_get_name(gh, args, self->carg++); + self->reference_value = grib_arguments_get_name(gh, args, self->carg++); + self->binary_scale_factor = grib_arguments_get_name(gh, args, self->carg++); + self->decimal_scale_factor = grib_arguments_get_name(gh, args, self->carg++); + self->optimize_scaling_factor = grib_arguments_get_name(gh, args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; self->dirty = 1; } @@ -44,7 +46,8 @@ static const unsigned long nbits[32] = { 0x40000000, 0x80000000 }; -static int number_of_bits(unsigned long x, long* result){ +static int number_of_bits(unsigned long x, long* result) +{ const int count = sizeof(nbits) / sizeof(nbits[0]); const unsigned long* n = nbits; *result = 0; @@ -58,19 +61,21 @@ static int number_of_bits(unsigned long x, long* result){ return GRIB_SUCCESS; } -int grib_accessor_class_data_simple_packing_t::value_count(grib_accessor* a, long* number_of_values){ +int grib_accessor_class_data_simple_packing_t::value_count(grib_accessor* a, long* number_of_values) +{ grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; - *number_of_values = 0; + *number_of_values = 0; return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, number_of_values); } -int grib_accessor_class_data_simple_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ +int grib_accessor_class_data_simple_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val) +{ grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; - const char* cclass_name = a->cclass->name; + const char* cclass_name = a->cclass->name; - long n_vals; - int err = 0; + long n_vals = 0; + int err = 0; grib_handle* gh = grib_handle_of_accessor(a); double reference_value; @@ -78,12 +83,12 @@ int grib_accessor_class_data_simple_packing_t::unpack_double_element(grib_access long bits_per_value; long decimal_scale_factor; unsigned char* buf = (unsigned char*)gh->buffer->data; - double s = 0; - double d = 0; - long pos = 0; + double s = 0; + double d = 0; + long pos = 0; - n_vals = 0; - err = a->value_count(&n_vals); if (err) + err = a->value_count(&n_vals); + if (err) return err; if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) @@ -146,29 +151,176 @@ int grib_accessor_class_data_simple_packing_t::unpack_double_element(grib_access return err; } -int grib_accessor_class_data_simple_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ - int err = 0; +int grib_accessor_class_data_simple_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) +{ + int err = 0; size_t i = 0; - for (i=0; i +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_t* self = (grib_accessor_data_simple_packing_t*)a; + const char* cclass_name = a->cclass->name; + 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 n_vals = 0; + long pos = 0; + long count = 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; + + err = a->value_count(&count); + if (err) + return err; + n_vals = count; + + 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; -int grib_accessor_class_data_simple_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + /* Special case */ + + if (bits_per_value == 0) { + for (i = 0; i < n_vals; i++) + val[i] = reference_value; + *len = n_vals; + return GRIB_SUCCESS; + } + + s = codes_power(binary_scale_factor, 2); + d = codes_power(-decimal_scale_factor, 10); + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "%s %s: Creating %s, %zu values", cclass_name, __func__, a->name, n_vals); + + offsetBeforeData = a->byte_offset(); + 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, + "%s: Data section size mismatch: " + "offset before data=%ld, offset after data=%ld (num values=%zu, bits per value=%ld)", + cclass_name, offsetBeforeData, offsetAfterData, n_vals, bits_per_value); + return GRIB_DECODING_ERROR; + } + } + // 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; + // } + } + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "%s %s: calling outline function: bpv: %ld, rv: %g, bsf: %ld, dsf: %ld", + cclass_name, __func__, bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); + grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, val); + + *len = (long)n_vals; + + if (units_factor != 1.0) { + if (units_bias != 0.0) { + for (i = 0; i < n_vals; i++) { + val[i] = val[i] * units_factor + units_bias; + } + } + else { + for (i = 0; i < n_vals; i++) { + val[i] *= units_factor; + } + } + } + else if (units_bias != 0.0) { + for (i = 0; i < n_vals; i++) { + val[i] += units_bias; + } + } + return err; +} + +int grib_accessor_class_data_simple_packing_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_data_simple_packing_t::unpack_float(grib_accessor* a, float* val, size_t* len){ +int grib_accessor_class_data_simple_packing_t::unpack_float(grib_accessor* a, float* val, size_t* len) +{ return unpack(a, val, len); } -int _unpack_double(grib_accessor* a, double* val, size_t* len, unsigned char* buf, long pos, size_t n_vals){ +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_t* self = (grib_accessor_data_simple_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); - const char* cclass_name = a->cclass->name; + grib_handle* gh = grib_handle_of_accessor(a); + const char* cclass_name = a->cclass->name; size_t i = 0; int err = 0; @@ -240,7 +392,8 @@ int _unpack_double(grib_accessor* a, double* val, size_t* len, unsigned char* bu grib_context_log(a->context, GRIB_LOG_DEBUG, "%s %s: Creating %s, %zu values", cclass_name, __func__, a->name, n_vals); - offsetBeforeData = a->byte_offset(); buf += offsetBeforeData; + offsetBeforeData = a->byte_offset(); + buf += offsetBeforeData; /*Assert(((bits_per_value*n_vals)/8) < (1<<29));*/ /* See GRIB-787 */ @@ -290,14 +443,16 @@ int _unpack_double(grib_accessor* a, double* val, size_t* len, unsigned char* bu return err; } -int grib_accessor_class_data_simple_packing_t::unpack_double_subarray(grib_accessor* a, double* val, size_t start, size_t len){ +int grib_accessor_class_data_simple_packing_t::unpack_double_subarray(grib_accessor* a, double* val, size_t start, size_t len) +{ grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; - unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - size_t nvals = len; - size_t* plen = &len; - long bits_per_value = 0; - long pos; - int err; + + unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; + size_t nvals = len; + size_t* plen = &len; + long bits_per_value = 0; + long pos = 0; + int err = GRIB_SUCCESS; if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) @@ -308,14 +463,15 @@ int grib_accessor_class_data_simple_packing_t::unpack_double_subarray(grib_acces return _unpack_double(a, val, plen, buf, pos, nvals); } -int grib_accessor_class_data_simple_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_data_simple_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; - grib_handle* gh = grib_handle_of_accessor(a); - const char* cclass_name = a->cclass->name; + grib_handle* gh = grib_handle_of_accessor(a); + const char* cclass_name = a->cclass->name; - size_t i = 0; - size_t n_vals = *len; - int err = 0; + size_t i = 0; + size_t n_vals = *len; + int err = 0; double reference_value = 0; long binary_scale_factor = 0; long bits_per_value = 0; @@ -360,8 +516,10 @@ int grib_accessor_class_data_simple_packing_t::pack_double(grib_accessor* a, con max = val[0]; min = max; for (i = 1; i < n_vals; i++) { - if (val[i] > max) max = val[i]; - else if (val[i] < min) min = val[i]; + if (val[i] > max) + max = val[i]; + else if (val[i] < min) + min = val[i]; } if ((err = grib_check_data_values_minmax(gh, min, max)) != GRIB_SUCCESS) { @@ -460,7 +618,7 @@ int grib_accessor_class_data_simple_packing_t::pack_double(grib_accessor* a, con /* divisor=1; */ } else { - int last = 127; /* 'last' should be a parameter coming from a definitions file */ + int last = 127; /* 'last' should be a parameter coming from a definitions file */ if (c->gribex_mode_on && self->edition == 1) last = 99; /* bits_per_value is given and decimal_scale_factor and binary_scale_factor are calcualated */ diff --git a/src/accessor/grib_accessor_class_data_simple_packing.h b/src/accessor/grib_accessor_class_data_simple_packing.h index 92f355b3f..52761202d 100644 --- a/src/accessor/grib_accessor_class_data_simple_packing.h +++ b/src/accessor/grib_accessor_class_data_simple_packing.h @@ -9,11 +9,9 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_simple_packing_h -#define eccodes_accessor_data_simple_packing_h +#pragma once #include "grib_accessor_class_values.h" -#include "grib_bits_any_endian_simple.h" #include "grib_scaling.h" class grib_accessor_data_simple_packing_t : public grib_accessor_values_t @@ -45,151 +43,4 @@ class grib_accessor_class_data_simple_packing_t : public grib_accessor_class_val int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len) override; - -private: - template int unpack(grib_accessor*, T*, size_t*); }; - - -template -int grib_accessor_class_data_simple_packing_t::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_t* self = (grib_accessor_data_simple_packing_t*)a; - const char* cclass_name = a->cclass->name; - 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 n_vals = 0; - long pos = 0; - long count = 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; - - err = a->value_count(&count); if (err) - return err; - n_vals = count; - - 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) { - for (i = 0; i < n_vals; i++) - val[i] = reference_value; - *len = n_vals; - return GRIB_SUCCESS; - } - - s = codes_power(binary_scale_factor, 2); - d = codes_power(-decimal_scale_factor, 10); - - grib_context_log(a->context, GRIB_LOG_DEBUG, - "%s %s: Creating %s, %zu values", cclass_name, __func__, a->name, n_vals); - - offsetBeforeData = a->byte_offset(); 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, - "%s: Data section size mismatch: " - "offset before data=%ld, offset after data=%ld (num values=%zu, bits per value=%ld)", - cclass_name, offsetBeforeData, offsetAfterData, n_vals, bits_per_value); - return GRIB_DECODING_ERROR; - } - } - // 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; - // } - } - - grib_context_log(a->context, GRIB_LOG_DEBUG, - "%s %s: calling outline function: bpv: %ld, rv: %g, bsf: %ld, dsf: %ld", - cclass_name, __func__, bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); - grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, val); - - *len = (long)n_vals; - - if (units_factor != 1.0) { - if (units_bias != 0.0) { - for (i = 0; i < n_vals; i++) { - val[i] = val[i] * units_factor + units_bias; - } - } else { - for (i = 0; i < n_vals; i++) { - val[i] *= units_factor; - } - } - } - else if (units_bias != 0.0) { - for (i = 0; i < n_vals; i++) { - val[i] += units_bias; - } - } - return err; -} - - -#endif /* eccodes_accessor_data_simple_packing_h */ From 0d802de270724b10706f6adae8495e91cc30c341 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 8 May 2024 09:35:23 +0000 Subject: [PATCH 130/196] Fix grib_accessor_class_gen definition --- src/accessor/grib_accessor_class_gen.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index 5618d95e2..7223f39a9 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -208,7 +208,7 @@ void grib_accessor_gen_t::destroy(grib_context* ct) grib_accessor_class_gen_t _grib_accessor_class_gen = grib_accessor_class_gen_t("gen"); -grib_accessor_class_gen_t* grib_accessor_class_gen = &_grib_accessor_class_gen; +grib_accessor_class* grib_accessor_class_gen = &_grib_accessor_class_gen; void grib_accessor_class_gen_t::init(grib_accessor* a, const long len, grib_arguments* param) { From e0f2213627fb9c5b11483e304835cd1b1a96f9e0 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 8 May 2024 12:12:18 +0100 Subject: [PATCH 131/196] ECC-1820: Remove unnecessary header files --- src/accessor/grib_accessor_class_abstract_long_vector.h | 1 - src/accessor/grib_accessor_class_abstract_vector.h | 1 - src/accessor/grib_accessor_class_ascii.h | 1 - src/accessor/grib_accessor_class_bit.h | 1 - src/accessor/grib_accessor_class_bitmap.h | 1 - src/accessor/grib_accessor_class_bits.h | 1 - src/accessor/grib_accessor_class_bits_per_value.h | 1 - src/accessor/grib_accessor_class_blob.h | 1 - src/accessor/grib_accessor_class_budgdate.h | 1 - src/accessor/grib_accessor_class_bufr_data_element.h | 1 - src/accessor/grib_accessor_class_bufr_elements_table.h | 1 - .../grib_accessor_class_bufr_extract_area_subsets.h | 1 - .../grib_accessor_class_bufr_extract_datetime_subsets.h | 1 - src/accessor/grib_accessor_class_bufr_extract_subsets.h | 1 - src/accessor/grib_accessor_class_bufr_group.h | 1 - src/accessor/grib_accessor_class_bufr_simple_thinning.h | 1 - src/accessor/grib_accessor_class_bufr_string_values.h | 1 - .../grib_accessor_class_bufrdc_expanded_descriptors.h | 1 - src/accessor/grib_accessor_class_bytes.h | 1 - .../grib_accessor_class_change_alternative_row_scanning.h | 1 - .../grib_accessor_class_change_scanning_direction.h | 1 - src/accessor/grib_accessor_class_check_internal_version.h | 1 - src/accessor/grib_accessor_class_closest_date.h | 1 - src/accessor/grib_accessor_class_codeflag.h | 1 - src/accessor/grib_accessor_class_codetable.h | 6 ------ src/accessor/grib_accessor_class_codetable_title.h | 1 - src/accessor/grib_accessor_class_codetable_units.h | 1 - src/accessor/grib_accessor_class_concept.h | 1 - src/accessor/grib_accessor_class_constant.h | 6 ------ src/accessor/grib_accessor_class_count_file.h | 1 - src/accessor/grib_accessor_class_count_missing.h | 1 - src/accessor/grib_accessor_class_count_total.h | 1 - src/accessor/grib_accessor_class_data_apply_bitmap.h | 1 - ...rib_accessor_class_data_apply_boustrophedonic_bitmap.h | 1 - src/accessor/grib_accessor_class_data_dummy_field.h | 1 - src/accessor/grib_accessor_class_data_g1complex_packing.h | 5 +---- ...sor_class_data_g1second_order_constant_width_packing.h | 5 +---- ...r_class_data_g1second_order_general_extended_packing.h | 5 +---- .../grib_accessor_class_data_g1secondary_bitmap.h | 5 +---- .../grib_accessor_class_data_g1shsimple_packing.h | 5 +---- src/accessor/grib_accessor_class_data_g1simple_packing.h | 5 +---- .../grib_accessor_class_data_g2bifourier_packing.h | 5 +---- src/accessor/grib_accessor_class_data_g2complex_packing.h | 5 +---- .../grib_accessor_class_data_g2secondary_bitmap.h | 5 +---- .../grib_accessor_class_data_g2shsimple_packing.h | 5 +---- ...essor_class_data_g2simple_packing_with_preprocessing.h | 5 +---- src/accessor/grib_accessor_class_data_jpeg2000_packing.h | 5 +---- src/accessor/grib_accessor_class_data_raw_packing.h | 5 +---- .../grib_accessor_class_data_run_length_packing.h | 5 +---- src/accessor/grib_accessor_class_data_secondary_bitmap.h | 5 +---- src/accessor/grib_accessor_class_data_sh_packed.h | 5 +---- src/accessor/grib_accessor_class_data_sh_unpacked.h | 5 +---- src/accessor/grib_accessor_class_data_shsimple_packing.h | 5 +---- src/accessor/grib_accessor_class_decimal_precision.h | 1 - src/accessor/grib_accessor_class_dictionary.h | 1 - src/accessor/grib_accessor_class_dirty.h | 1 - src/accessor/grib_accessor_class_divdouble.h | 1 - src/accessor/grib_accessor_class_element.h | 1 - src/accessor/grib_accessor_class_evaluate.h | 1 - src/accessor/grib_accessor_class_expanded_descriptors.h | 1 - .../grib_accessor_class_from_scale_factor_scaled_value.h | 1 - src/accessor/grib_accessor_class_g1_half_byte_codeflag.h | 1 - src/accessor/grib_accessor_class_g1_message_length.h | 1 - src/accessor/grib_accessor_class_g1_section4_length.h | 1 - src/accessor/grib_accessor_class_g1bitmap.h | 1 - src/accessor/grib_accessor_class_g1date.h | 1 - src/accessor/grib_accessor_class_g1day_of_the_year_date.h | 1 - .../grib_accessor_class_g1end_of_interval_monthly.h | 1 - src/accessor/grib_accessor_class_g1fcperiod.h | 1 - src/accessor/grib_accessor_class_g1forecastmonth.h | 1 - src/accessor/grib_accessor_class_g1monthlydate.h | 1 - ...b_accessor_class_g1number_of_coded_values_sh_complex.h | 1 - ...ib_accessor_class_g1number_of_coded_values_sh_simple.h | 1 - src/accessor/grib_accessor_class_g1step_range.h | 1 - src/accessor/grib_accessor_class_g1verificationdate.h | 1 - src/accessor/grib_accessor_class_g2_aerosol.h | 1 - src/accessor/grib_accessor_class_g2_chemical.h | 1 - src/accessor/grib_accessor_class_g2_eps.h | 1 - src/accessor/grib_accessor_class_g2_mars_labeling.h | 1 - src/accessor/grib_accessor_class_g2bitmap.h | 1 - src/accessor/grib_accessor_class_g2bitmap_present.h | 1 - src/accessor/grib_accessor_class_g2date.h | 1 - src/accessor/grib_accessor_class_g2end_step.h | 1 - src/accessor/grib_accessor_class_g2grid.h | 1 - src/accessor/grib_accessor_class_g2latlon.h | 1 - src/accessor/grib_accessor_class_g2level.h | 1 - src/accessor/grib_accessor_class_g2lon.h | 1 - src/accessor/grib_accessor_class_gaussian_grid_name.h | 1 - src/accessor/grib_accessor_class_gds_is_present.h | 1 - src/accessor/grib_accessor_class_gds_not_present_bitmap.h | 1 - src/accessor/grib_accessor_class_global_gaussian.h | 1 - src/accessor/grib_accessor_class_group.h | 1 - src/accessor/grib_accessor_class_gts_header.h | 1 - src/accessor/grib_accessor_class_hash_array.h | 1 - src/accessor/grib_accessor_class_headers_only.h | 1 - src/accessor/grib_accessor_class_ifs_param.h | 1 - src/accessor/grib_accessor_class_julian_date.h | 1 - src/accessor/grib_accessor_class_julian_day.h | 1 - src/accessor/grib_accessor_class_ksec1expver.h | 1 - src/accessor/grib_accessor_class_label.h | 1 - src/accessor/grib_accessor_class_latitudes.h | 1 - src/accessor/grib_accessor_class_latlon_increment.h | 1 - src/accessor/grib_accessor_class_latlonvalues.h | 1 - src/accessor/grib_accessor_class_library_version.h | 1 - src/accessor/grib_accessor_class_local_definition.h | 1 - src/accessor/grib_accessor_class_long.h | 1 - src/accessor/grib_accessor_class_long_vector.h | 1 - src/accessor/grib_accessor_class_longitudes.h | 1 - src/accessor/grib_accessor_class_mars_param.h | 1 - src/accessor/grib_accessor_class_mars_step.h | 1 - src/accessor/grib_accessor_class_md5.h | 1 - src/accessor/grib_accessor_class_message.h | 1 - src/accessor/grib_accessor_class_message_copy.h | 1 - src/accessor/grib_accessor_class_multdouble.h | 1 - src/accessor/grib_accessor_class_nearest.h | 1 - src/accessor/grib_accessor_class_non_alpha.h | 1 - src/accessor/grib_accessor_class_number_of_coded_values.h | 1 - src/accessor/grib_accessor_class_number_of_points.h | 1 - .../grib_accessor_class_number_of_points_gaussian.h | 1 - src/accessor/grib_accessor_class_number_of_values.h | 1 - ...rib_accessor_class_number_of_values_data_raw_packing.h | 1 - src/accessor/grib_accessor_class_octahedral_gaussian.h | 1 - src/accessor/grib_accessor_class_octet_number.h | 1 - src/accessor/grib_accessor_class_offset_file.h | 1 - src/accessor/grib_accessor_class_offset_values.h | 1 - src/accessor/grib_accessor_class_pack_bufr_values.h | 1 - src/accessor/grib_accessor_class_packing_type.h | 1 - src/accessor/grib_accessor_class_pad.h | 1 - src/accessor/grib_accessor_class_padding.h | 1 - src/accessor/grib_accessor_class_padto.h | 1 - src/accessor/grib_accessor_class_padtoeven.h | 1 - src/accessor/grib_accessor_class_padtomultiple.h | 1 - src/accessor/grib_accessor_class_position.h | 1 - src/accessor/grib_accessor_class_proj_string.h | 1 - src/accessor/grib_accessor_class_raw.h | 1 - src/accessor/grib_accessor_class_rdbtime_guess_date.h | 1 - src/accessor/grib_accessor_class_reference_value_error.h | 1 - src/accessor/grib_accessor_class_round.h | 1 - src/accessor/grib_accessor_class_scale.h | 1 - src/accessor/grib_accessor_class_scale_values.h | 1 - .../grib_accessor_class_second_order_bits_per_value.h | 1 - src/accessor/grib_accessor_class_section_length.h | 1 - src/accessor/grib_accessor_class_section_padding.h | 1 - src/accessor/grib_accessor_class_section_pointer.h | 1 - src/accessor/grib_accessor_class_select_step_template.h | 1 - src/accessor/grib_accessor_class_sexagesimal2decimal.h | 1 - src/accessor/grib_accessor_class_signed.h | 1 - src/accessor/grib_accessor_class_signed_bits.h | 1 - src/accessor/grib_accessor_class_simple_packing_error.h | 1 - src/accessor/grib_accessor_class_size.h | 1 - src/accessor/grib_accessor_class_smart_table.h | 8 -------- src/accessor/grib_accessor_class_spd.h | 1 - src/accessor/grib_accessor_class_spectral_truncation.h | 1 - src/accessor/grib_accessor_class_sprintf.h | 1 - src/accessor/grib_accessor_class_statistics.h | 1 - src/accessor/grib_accessor_class_statistics_spectral.h | 1 - src/accessor/grib_accessor_class_step_human_readable.h | 1 - src/accessor/grib_accessor_class_step_in_units.h | 1 - src/accessor/grib_accessor_class_sum.h | 1 - src/accessor/grib_accessor_class_suppressed.h | 1 - src/accessor/grib_accessor_class_time.h | 1 - src/accessor/grib_accessor_class_to_double.h | 1 - src/accessor/grib_accessor_class_to_integer.h | 1 - src/accessor/grib_accessor_class_to_string.h | 1 - src/accessor/grib_accessor_class_transient_darray.h | 1 - src/accessor/grib_accessor_class_trim.h | 1 - src/accessor/grib_accessor_class_uint16.h | 1 - src/accessor/grib_accessor_class_uint32.h | 1 - src/accessor/grib_accessor_class_uint32_little_endian.h | 1 - src/accessor/grib_accessor_class_uint64.h | 1 - src/accessor/grib_accessor_class_uint64_little_endian.h | 1 - src/accessor/grib_accessor_class_uint8.h | 1 - src/accessor/grib_accessor_class_unexpanded_descriptors.h | 1 - src/accessor/grib_accessor_class_unpack_bufr_values.h | 1 - src/accessor/grib_accessor_class_unsigned.h | 1 - src/accessor/grib_accessor_class_unsigned_bits.h | 1 - src/accessor/grib_accessor_class_validity_date.h | 1 - src/accessor/grib_accessor_class_validity_time.h | 1 - src/accessor/grib_accessor_class_values.h | 4 +--- src/accessor/grib_accessor_class_vector.h | 1 - src/accessor/grib_accessor_class_when.h | 1 - 181 files changed, 19 insertions(+), 254 deletions(-) diff --git a/src/accessor/grib_accessor_class_abstract_long_vector.h b/src/accessor/grib_accessor_class_abstract_long_vector.h index 5c3c6b5f9..0585a5819 100644 --- a/src/accessor/grib_accessor_class_abstract_long_vector.h +++ b/src/accessor/grib_accessor_class_abstract_long_vector.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_abstract_long_vector_h #define eccodes_accessor_abstract_long_vector_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_abstract_long_vector_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_abstract_vector.h b/src/accessor/grib_accessor_class_abstract_vector.h index d1201ede7..7d5dd13df 100644 --- a/src/accessor/grib_accessor_class_abstract_vector.h +++ b/src/accessor/grib_accessor_class_abstract_vector.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_abstract_vector_h #define eccodes_accessor_abstract_vector_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_abstract_vector_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_ascii.h b/src/accessor/grib_accessor_class_ascii.h index ea00a247c..1fa848236 100644 --- a/src/accessor/grib_accessor_class_ascii.h +++ b/src/accessor/grib_accessor_class_ascii.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_ascii_h #define eccodes_accessor_ascii_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_ascii_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bit.h b/src/accessor/grib_accessor_class_bit.h index 28c001488..7ad258b03 100644 --- a/src/accessor/grib_accessor_class_bit.h +++ b/src/accessor/grib_accessor_class_bit.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bit_h #define eccodes_accessor_bit_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_bit_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_bitmap.h b/src/accessor/grib_accessor_class_bitmap.h index dd66d6256..599e8c7ab 100644 --- a/src/accessor/grib_accessor_class_bitmap.h +++ b/src/accessor/grib_accessor_class_bitmap.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bitmap_h #define eccodes_accessor_bitmap_h -#include "grib_api_internal.h" #include "grib_accessor_class_bytes.h" class grib_accessor_bitmap_t : public grib_accessor_bytes_t diff --git a/src/accessor/grib_accessor_class_bits.h b/src/accessor/grib_accessor_class_bits.h index dccc43486..2508e5ba0 100644 --- a/src/accessor/grib_accessor_class_bits.h +++ b/src/accessor/grib_accessor_class_bits.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bits_h #define eccodes_accessor_bits_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bits_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bits_per_value.h b/src/accessor/grib_accessor_class_bits_per_value.h index 3d83e07e6..dee7f76e3 100644 --- a/src/accessor/grib_accessor_class_bits_per_value.h +++ b/src/accessor/grib_accessor_class_bits_per_value.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bits_per_value_h #define eccodes_accessor_bits_per_value_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_bits_per_value_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_blob.h b/src/accessor/grib_accessor_class_blob.h index d0dc4b290..9743ca17b 100644 --- a/src/accessor/grib_accessor_class_blob.h +++ b/src/accessor/grib_accessor_class_blob.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_blob_h #define eccodes_accessor_blob_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_blob_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_budgdate.h b/src/accessor/grib_accessor_class_budgdate.h index d5a75ffe1..1b8103a03 100644 --- a/src/accessor/grib_accessor_class_budgdate.h +++ b/src/accessor/grib_accessor_class_budgdate.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_budgdate_h #define eccodes_accessor_budgdate_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_budgdate_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_bufr_data_element.h b/src/accessor/grib_accessor_class_bufr_data_element.h index a8766df47..4dd22a7d5 100644 --- a/src/accessor/grib_accessor_class_bufr_data_element.h +++ b/src/accessor/grib_accessor_class_bufr_data_element.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bufr_data_element_h #define eccodes_accessor_bufr_data_element_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_data_element_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_elements_table.h b/src/accessor/grib_accessor_class_bufr_elements_table.h index 1149b2ad3..d29bc9192 100644 --- a/src/accessor/grib_accessor_class_bufr_elements_table.h +++ b/src/accessor/grib_accessor_class_bufr_elements_table.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bufr_elements_table_h #define eccodes_accessor_bufr_elements_table_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_elements_table_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h index f2e8b0ba2..b22452490 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h +++ b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bufr_extract_area_subsets_h #define eccodes_accessor_bufr_extract_area_subsets_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_extract_area_subsets_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h index 3f7c505e0..5f4bf9dd7 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h +++ b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bufr_extract_datetime_subsets_h #define eccodes_accessor_bufr_extract_datetime_subsets_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_extract_datetime_subsets_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_extract_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_subsets.h index 736206c08..0d0f60fd7 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_subsets.h +++ b/src/accessor/grib_accessor_class_bufr_extract_subsets.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bufr_extract_subsets_h #define eccodes_accessor_bufr_extract_subsets_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_extract_subsets_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_group.h b/src/accessor/grib_accessor_class_bufr_group.h index c225cfe2d..87f060282 100644 --- a/src/accessor/grib_accessor_class_bufr_group.h +++ b/src/accessor/grib_accessor_class_bufr_group.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bufr_group_h #define eccodes_accessor_bufr_group_h -#include "grib_api_internal.h" #include "grib_accessor_class_variable.h" class grib_accessor_bufr_group_t : public grib_accessor_variable_t diff --git a/src/accessor/grib_accessor_class_bufr_simple_thinning.h b/src/accessor/grib_accessor_class_bufr_simple_thinning.h index 6971e5edb..5cb9f6144 100644 --- a/src/accessor/grib_accessor_class_bufr_simple_thinning.h +++ b/src/accessor/grib_accessor_class_bufr_simple_thinning.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bufr_simple_thinning_h #define eccodes_accessor_bufr_simple_thinning_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bufr_simple_thinning_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_bufr_string_values.h b/src/accessor/grib_accessor_class_bufr_string_values.h index 2262990a7..387bafd1e 100644 --- a/src/accessor/grib_accessor_class_bufr_string_values.h +++ b/src/accessor/grib_accessor_class_bufr_string_values.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bufr_string_values_h #define eccodes_accessor_bufr_string_values_h -#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_bufr_string_values_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h index 9d8f551b2..fcc08fc91 100644 --- a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h +++ b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bufrdc_expanded_descriptors_h #define eccodes_accessor_bufrdc_expanded_descriptors_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_bufrdc_expanded_descriptors_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_bytes.h b/src/accessor/grib_accessor_class_bytes.h index ee72f13c3..558d52018 100644 --- a/src/accessor/grib_accessor_class_bytes.h +++ b/src/accessor/grib_accessor_class_bytes.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_bytes_h #define eccodes_accessor_bytes_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_bytes_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_change_alternative_row_scanning.h b/src/accessor/grib_accessor_class_change_alternative_row_scanning.h index 3caca2a6b..e2ecc7994 100644 --- a/src/accessor/grib_accessor_class_change_alternative_row_scanning.h +++ b/src/accessor/grib_accessor_class_change_alternative_row_scanning.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_change_alternative_row_scanning_h #define eccodes_accessor_change_alternative_row_scanning_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_change_alternative_row_scanning_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_change_scanning_direction.h b/src/accessor/grib_accessor_class_change_scanning_direction.h index 7d8ac8d6a..0dae34341 100644 --- a/src/accessor/grib_accessor_class_change_scanning_direction.h +++ b/src/accessor/grib_accessor_class_change_scanning_direction.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_change_scanning_direction_h #define eccodes_accessor_change_scanning_direction_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_change_scanning_direction_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_check_internal_version.h b/src/accessor/grib_accessor_class_check_internal_version.h index 222ec76ab..46f9a29d5 100644 --- a/src/accessor/grib_accessor_class_check_internal_version.h +++ b/src/accessor/grib_accessor_class_check_internal_version.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_check_internal_version_h #define eccodes_accessor_check_internal_version_h -#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_check_internal_version_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_closest_date.h b/src/accessor/grib_accessor_class_closest_date.h index be6d3aa98..e5b65c683 100644 --- a/src/accessor/grib_accessor_class_closest_date.h +++ b/src/accessor/grib_accessor_class_closest_date.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_closest_date_h #define eccodes_accessor_closest_date_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_closest_date_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_codeflag.h b/src/accessor/grib_accessor_class_codeflag.h index f74af599a..f9465f703 100644 --- a/src/accessor/grib_accessor_class_codeflag.h +++ b/src/accessor/grib_accessor_class_codeflag.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_codeflag_h #define eccodes_accessor_codeflag_h -#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_codeflag_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_codetable.h b/src/accessor/grib_accessor_class_codetable.h index 48ae07502..8a16d9113 100644 --- a/src/accessor/grib_accessor_class_codetable.h +++ b/src/accessor/grib_accessor_class_codetable.h @@ -8,17 +8,11 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - #pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" #include - class grib_accessor_codetable_t : public grib_accessor_unsigned_t { public: diff --git a/src/accessor/grib_accessor_class_codetable_title.h b/src/accessor/grib_accessor_class_codetable_title.h index 873b3e0a1..4a2114579 100644 --- a/src/accessor/grib_accessor_class_codetable_title.h +++ b/src/accessor/grib_accessor_class_codetable_title.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_codetable_title_h #define eccodes_accessor_codetable_title_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_codetable_title_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_codetable_units.h b/src/accessor/grib_accessor_class_codetable_units.h index 913afb1d2..d5207f532 100644 --- a/src/accessor/grib_accessor_class_codetable_units.h +++ b/src/accessor/grib_accessor_class_codetable_units.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_codetable_units_h #define eccodes_accessor_codetable_units_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_codetable_units_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_concept.h b/src/accessor/grib_accessor_class_concept.h index 436e5b95e..e2d9b8474 100644 --- a/src/accessor/grib_accessor_class_concept.h +++ b/src/accessor/grib_accessor_class_concept.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_concept_h #define eccodes_accessor_concept_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_concept_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_constant.h b/src/accessor/grib_accessor_class_constant.h index 029c51e79..916df88e9 100644 --- a/src/accessor/grib_accessor_class_constant.h +++ b/src/accessor/grib_accessor_class_constant.h @@ -8,12 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ - -/************************************* - * Enrico Fucile - **************************************/ - -#include "grib_api_internal.h" #include "grib_accessor_class_variable.h" class grib_accessor_constant_t : public grib_accessor_variable_t {}; diff --git a/src/accessor/grib_accessor_class_count_file.h b/src/accessor/grib_accessor_class_count_file.h index fd2251045..727df09c2 100644 --- a/src/accessor/grib_accessor_class_count_file.h +++ b/src/accessor/grib_accessor_class_count_file.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_count_file_h #define eccodes_accessor_count_file_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_count_file_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_count_missing.h b/src/accessor/grib_accessor_class_count_missing.h index d43c6f22e..405456843 100644 --- a/src/accessor/grib_accessor_class_count_missing.h +++ b/src/accessor/grib_accessor_class_count_missing.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_count_missing_h #define eccodes_accessor_count_missing_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_count_missing_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_count_total.h b/src/accessor/grib_accessor_class_count_total.h index 9c242b5c6..4518f9703 100644 --- a/src/accessor/grib_accessor_class_count_total.h +++ b/src/accessor/grib_accessor_class_count_total.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_count_total_h #define eccodes_accessor_count_total_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_count_total_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_data_apply_bitmap.h b/src/accessor/grib_accessor_class_data_apply_bitmap.h index 18b7802a9..a2d724ed7 100644 --- a/src/accessor/grib_accessor_class_data_apply_bitmap.h +++ b/src/accessor/grib_accessor_class_data_apply_bitmap.h @@ -11,7 +11,6 @@ #pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_data_apply_bitmap_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h index c03416060..5b26b3a4f 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_data_apply_boustrophedonic_bitmap_h #define eccodes_accessor_data_apply_boustrophedonic_bitmap_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_data_apply_boustrophedonic_bitmap_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_data_dummy_field.h b/src/accessor/grib_accessor_class_data_dummy_field.h index 31d6d27b8..2fac95235 100644 --- a/src/accessor/grib_accessor_class_data_dummy_field.h +++ b/src/accessor/grib_accessor_class_data_dummy_field.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_data_dummy_field_h #define eccodes_accessor_data_dummy_field_h -#include "grib_api_internal.h" #include "grib_accessor_class_data_g1simple_packing.h" class grib_accessor_data_dummy_field_t : public grib_accessor_data_g1simple_packing_t diff --git a/src/accessor/grib_accessor_class_data_g1complex_packing.h b/src/accessor/grib_accessor_class_data_g1complex_packing.h index a3c916606..75ad18d66 100644 --- a/src/accessor/grib_accessor_class_data_g1complex_packing.h +++ b/src/accessor/grib_accessor_class_data_g1complex_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g1complex_packing_h -#define eccodes_accessor_data_g1complex_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_complex_packing.h" class grib_accessor_data_g1complex_packing_t : public grib_accessor_data_complex_packing_t @@ -34,4 +32,3 @@ class grib_accessor_class_data_g1complex_packing_t : public grib_accessor_class_ int pack_double(grib_accessor*, const double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_g1complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h index 8c190bd12..0da32c286 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g1second_order_constant_width_packing_h -#define eccodes_accessor_data_g1second_order_constant_width_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_g1second_order_constant_width_packing_t : public grib_accessor_data_simple_packing_t @@ -50,4 +48,3 @@ class grib_accessor_class_data_g1second_order_constant_width_packing_t : public int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; }; -#endif /* eccodes_accessor_data_g1second_order_constant_width_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h index fb2356a4f..4bb6c061c 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g1second_order_general_extended_packing_h -#define eccodes_accessor_data_g1second_order_general_extended_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_g1second_order_general_extended_packing_t : public grib_accessor_data_simple_packing_t @@ -65,4 +63,3 @@ class grib_accessor_class_data_g1second_order_general_extended_packing_t : publi private: int unpack(grib_accessor* a, double*, float*, size_t*); }; -#endif /* eccodes_accessor_data_g1second_order_general_extended_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h index d0eaedb55..562108986 100644 --- a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h +++ b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g1secondary_bitmap_h -#define eccodes_accessor_data_g1secondary_bitmap_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_secondary_bitmap.h" class grib_accessor_data_g1secondary_bitmap_t : public grib_accessor_data_secondary_bitmap_t @@ -31,4 +29,3 @@ class grib_accessor_class_data_g1secondary_bitmap_t : public grib_accessor_class int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_g1secondary_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_g1shsimple_packing.h b/src/accessor/grib_accessor_class_data_g1shsimple_packing.h index 8a212b5df..56e1ee47b 100644 --- a/src/accessor/grib_accessor_class_data_g1shsimple_packing.h +++ b/src/accessor/grib_accessor_class_data_g1shsimple_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g1shsimple_packing_h -#define eccodes_accessor_data_g1shsimple_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_shsimple_packing.h" class grib_accessor_data_g1shsimple_packing_t : public grib_accessor_data_shsimple_packing_t @@ -29,4 +27,3 @@ class grib_accessor_class_data_g1shsimple_packing_t : public grib_accessor_class int unpack_double(grib_accessor*, double* val, size_t* len) override; int value_count(grib_accessor*, long*) override; }; -#endif /* eccodes_accessor_data_g1shsimple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g1simple_packing.h b/src/accessor/grib_accessor_class_data_g1simple_packing.h index 9d210ab63..2dfedd6c9 100644 --- a/src/accessor/grib_accessor_class_data_g1simple_packing.h +++ b/src/accessor/grib_accessor_class_data_g1simple_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g1simple_packing_h -#define eccodes_accessor_data_g1simple_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_g1simple_packing_t : public grib_accessor_data_simple_packing_t @@ -34,4 +32,3 @@ class grib_accessor_class_data_g1simple_packing_t : public grib_accessor_class_d int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_g1simple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2bifourier_packing.h b/src/accessor/grib_accessor_class_data_g2bifourier_packing.h index 1d2838414..b3ca0176a 100644 --- a/src/accessor/grib_accessor_class_data_g2bifourier_packing.h +++ b/src/accessor/grib_accessor_class_data_g2bifourier_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g2bifourier_packing_h -#define eccodes_accessor_data_g2bifourier_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_g2bifourier_packing_t : public grib_accessor_data_simple_packing_t @@ -44,4 +42,3 @@ class grib_accessor_class_data_g2bifourier_packing_t : public grib_accessor_clas int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_g2bifourier_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2complex_packing.h b/src/accessor/grib_accessor_class_data_g2complex_packing.h index ec7ab213e..cfa0f8116 100644 --- a/src/accessor/grib_accessor_class_data_g2complex_packing.h +++ b/src/accessor/grib_accessor_class_data_g2complex_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g2complex_packing_h -#define eccodes_accessor_data_g2complex_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_complex_packing.h" class grib_accessor_data_g2complex_packing_t : public grib_accessor_data_complex_packing_t @@ -31,4 +29,3 @@ class grib_accessor_class_data_g2complex_packing_t : public grib_accessor_class_ int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_g2complex_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h index abc550a97..64428a4ce 100644 --- a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h +++ b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g2secondary_bitmap_h -#define eccodes_accessor_data_g2secondary_bitmap_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_secondary_bitmap.h" class grib_accessor_data_g2secondary_bitmap_t : public grib_accessor_data_secondary_bitmap_t @@ -31,4 +29,3 @@ class grib_accessor_class_data_g2secondary_bitmap_t : public grib_accessor_class int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_g2secondary_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_g2shsimple_packing.h b/src/accessor/grib_accessor_class_data_g2shsimple_packing.h index 30899788b..c0189ae66 100644 --- a/src/accessor/grib_accessor_class_data_g2shsimple_packing.h +++ b/src/accessor/grib_accessor_class_data_g2shsimple_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g2shsimple_packing_h -#define eccodes_accessor_data_g2shsimple_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_shsimple_packing.h" class grib_accessor_data_g2shsimple_packing_t : public grib_accessor_data_shsimple_packing_t @@ -33,4 +31,3 @@ class grib_accessor_class_data_g2shsimple_packing_t : public grib_accessor_class int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_g2shsimple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h index 797815bd3..5825b9d16 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h +++ b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g2simple_packing_with_preprocessing_h -#define eccodes_accessor_data_g2simple_packing_with_preprocessing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_g2simple_packing.h" class grib_accessor_data_g2simple_packing_with_preprocessing_t : public grib_accessor_data_g2simple_packing_t @@ -33,4 +31,3 @@ class grib_accessor_class_data_g2simple_packing_with_preprocessing_t : public gr int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_g2simple_packing_with_preprocessing_h */ diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.h b/src/accessor/grib_accessor_class_data_jpeg2000_packing.h index 4802dd2ac..6fc01b977 100644 --- a/src/accessor/grib_accessor_class_data_jpeg2000_packing.h +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_jpeg2000_packing_h -#define eccodes_accessor_data_jpeg2000_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_jpeg2000_packing_t : public grib_accessor_data_simple_packing_t @@ -43,4 +41,3 @@ class grib_accessor_class_data_jpeg2000_packing_t : public grib_accessor_class_d int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; }; -#endif /* eccodes_accessor_data_jpeg2000_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_raw_packing.h b/src/accessor/grib_accessor_class_data_raw_packing.h index 075cc470e..8012c1f51 100644 --- a/src/accessor/grib_accessor_class_data_raw_packing.h +++ b/src/accessor/grib_accessor_class_data_raw_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_raw_packing_h -#define eccodes_accessor_data_raw_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_values.h" class grib_accessor_data_raw_packing_t : public grib_accessor_values_t @@ -35,4 +33,3 @@ class grib_accessor_class_data_raw_packing_t : public grib_accessor_class_values int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; }; -#endif /* eccodes_accessor_data_raw_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_run_length_packing.h b/src/accessor/grib_accessor_class_data_run_length_packing.h index f57d69c39..c35689abf 100644 --- a/src/accessor/grib_accessor_class_data_run_length_packing.h +++ b/src/accessor/grib_accessor_class_data_run_length_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_run_length_packing_h -#define eccodes_accessor_data_run_length_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_values.h" class grib_accessor_data_run_length_packing_t : public grib_accessor_values_t @@ -37,4 +35,3 @@ class grib_accessor_class_data_run_length_packing_t : public grib_accessor_class int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_run_length_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_secondary_bitmap.h b/src/accessor/grib_accessor_class_data_secondary_bitmap.h index 06a2ab576..8bc156ef5 100644 --- a/src/accessor/grib_accessor_class_data_secondary_bitmap.h +++ b/src/accessor/grib_accessor_class_data_secondary_bitmap.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_secondary_bitmap_h -#define eccodes_accessor_data_secondary_bitmap_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_data_secondary_bitmap_t : public grib_accessor_gen_t @@ -35,4 +33,3 @@ class grib_accessor_class_data_secondary_bitmap_t : public grib_accessor_class_g void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_secondary_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_sh_packed.h b/src/accessor/grib_accessor_class_data_sh_packed.h index 109534010..377db9ab4 100644 --- a/src/accessor/grib_accessor_class_data_sh_packed.h +++ b/src/accessor/grib_accessor_class_data_sh_packed.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_sh_packed_h -#define eccodes_accessor_data_sh_packed_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_sh_packed_t : public grib_accessor_data_simple_packing_t @@ -40,4 +38,3 @@ class grib_accessor_class_data_sh_packed_t : public grib_accessor_class_data_sim int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_sh_packed_h */ diff --git a/src/accessor/grib_accessor_class_data_sh_unpacked.h b/src/accessor/grib_accessor_class_data_sh_unpacked.h index 3f9c57dc8..b201e3dd3 100644 --- a/src/accessor/grib_accessor_class_data_sh_unpacked.h +++ b/src/accessor/grib_accessor_class_data_sh_unpacked.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_sh_unpacked_h -#define eccodes_accessor_data_sh_unpacked_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_data_simple_packing.h" class grib_accessor_data_sh_unpacked_t : public grib_accessor_data_simple_packing_t @@ -40,4 +38,3 @@ class grib_accessor_class_data_sh_unpacked_t : public grib_accessor_class_data_s int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_sh_unpacked_h */ diff --git a/src/accessor/grib_accessor_class_data_shsimple_packing.h b/src/accessor/grib_accessor_class_data_shsimple_packing.h index b4c388902..e77612ddd 100644 --- a/src/accessor/grib_accessor_class_data_shsimple_packing.h +++ b/src/accessor/grib_accessor_class_data_shsimple_packing.h @@ -9,10 +9,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_shsimple_packing_h -#define eccodes_accessor_data_shsimple_packing_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_data_shsimple_packing_t : public grib_accessor_gen_t @@ -34,4 +32,3 @@ class grib_accessor_class_data_shsimple_packing_t : public grib_accessor_class_g void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_shsimple_packing_h */ diff --git a/src/accessor/grib_accessor_class_decimal_precision.h b/src/accessor/grib_accessor_class_decimal_precision.h index a3e3e3024..741e32e83 100644 --- a/src/accessor/grib_accessor_class_decimal_precision.h +++ b/src/accessor/grib_accessor_class_decimal_precision.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_decimal_precision_h #define eccodes_accessor_decimal_precision_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_decimal_precision_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_dictionary.h b/src/accessor/grib_accessor_class_dictionary.h index 353cb9efa..327c6fc72 100644 --- a/src/accessor/grib_accessor_class_dictionary.h +++ b/src/accessor/grib_accessor_class_dictionary.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_dictionary_h #define eccodes_accessor_dictionary_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_dictionary_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_dirty.h b/src/accessor/grib_accessor_class_dirty.h index 78d4fcb64..1e49bf0a4 100644 --- a/src/accessor/grib_accessor_class_dirty.h +++ b/src/accessor/grib_accessor_class_dirty.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_dirty_h #define eccodes_accessor_dirty_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_dirty_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_divdouble.h b/src/accessor/grib_accessor_class_divdouble.h index eb2357a3e..bc61e4012 100644 --- a/src/accessor/grib_accessor_class_divdouble.h +++ b/src/accessor/grib_accessor_class_divdouble.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_divdouble_h #define eccodes_accessor_divdouble_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_divdouble_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_element.h b/src/accessor/grib_accessor_class_element.h index fe1d58ecd..20fa07fcc 100644 --- a/src/accessor/grib_accessor_class_element.h +++ b/src/accessor/grib_accessor_class_element.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_element_h #define eccodes_accessor_element_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_element_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_evaluate.h b/src/accessor/grib_accessor_class_evaluate.h index cfaf92c00..d3a856881 100644 --- a/src/accessor/grib_accessor_class_evaluate.h +++ b/src/accessor/grib_accessor_class_evaluate.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_evaluate_h #define eccodes_accessor_evaluate_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_evaluate_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_expanded_descriptors.h b/src/accessor/grib_accessor_class_expanded_descriptors.h index 419b28c61..b359a829f 100644 --- a/src/accessor/grib_accessor_class_expanded_descriptors.h +++ b/src/accessor/grib_accessor_class_expanded_descriptors.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_expanded_descriptors_h #define eccodes_accessor_expanded_descriptors_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_expanded_descriptors_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h index d14cb9c56..d73bffe02 100644 --- a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h +++ b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_from_scale_factor_scaled_value_h #define eccodes_accessor_from_scale_factor_scaled_value_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_from_scale_factor_scaled_value_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h index bf6ae7372..765ddeb0b 100644 --- a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h +++ b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1_half_byte_codeflag_h #define eccodes_accessor_g1_half_byte_codeflag_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_g1_half_byte_codeflag_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_g1_message_length.h b/src/accessor/grib_accessor_class_g1_message_length.h index 65d1983a9..38e85365e 100644 --- a/src/accessor/grib_accessor_class_g1_message_length.h +++ b/src/accessor/grib_accessor_class_g1_message_length.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1_message_length_h #define eccodes_accessor_g1_message_length_h -#include "grib_api_internal.h" #include "grib_accessor_class_section_length.h" class grib_accessor_g1_message_length_t : public grib_accessor_section_length_t diff --git a/src/accessor/grib_accessor_class_g1_section4_length.h b/src/accessor/grib_accessor_class_g1_section4_length.h index 0cb88362a..100f69157 100644 --- a/src/accessor/grib_accessor_class_g1_section4_length.h +++ b/src/accessor/grib_accessor_class_g1_section4_length.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1_section4_length_h #define eccodes_accessor_g1_section4_length_h -#include "grib_api_internal.h" #include "grib_accessor_class_section_length.h" class grib_accessor_g1_section4_length_t : public grib_accessor_section_length_t diff --git a/src/accessor/grib_accessor_class_g1bitmap.h b/src/accessor/grib_accessor_class_g1bitmap.h index d27f6b4eb..005114620 100644 --- a/src/accessor/grib_accessor_class_g1bitmap.h +++ b/src/accessor/grib_accessor_class_g1bitmap.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1bitmap_h #define eccodes_accessor_g1bitmap_h -#include "grib_api_internal.h" #include "grib_accessor_class_bitmap.h" class grib_accessor_g1bitmap_t : public grib_accessor_bitmap_t diff --git a/src/accessor/grib_accessor_class_g1date.h b/src/accessor/grib_accessor_class_g1date.h index 734b2a3b5..6119ca99e 100644 --- a/src/accessor/grib_accessor_class_g1date.h +++ b/src/accessor/grib_accessor_class_g1date.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1date_h #define eccodes_accessor_g1date_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1date_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g1day_of_the_year_date.h b/src/accessor/grib_accessor_class_g1day_of_the_year_date.h index bc12f541e..a5564f968 100644 --- a/src/accessor/grib_accessor_class_g1day_of_the_year_date.h +++ b/src/accessor/grib_accessor_class_g1day_of_the_year_date.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1day_of_the_year_date_h #define eccodes_accessor_g1day_of_the_year_date_h -#include "grib_api_internal.h" #include "grib_accessor_class_g1date.h" class grib_accessor_g1day_of_the_year_date_t : public grib_accessor_g1date_t diff --git a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h index 7e6ac3563..a37edfbcf 100644 --- a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h +++ b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1end_of_interval_monthly_h #define eccodes_accessor_g1end_of_interval_monthly_h -#include "grib_api_internal.h" #include "grib_accessor_class_abstract_vector.h" class grib_accessor_g1end_of_interval_monthly_t : public grib_accessor_abstract_vector_t diff --git a/src/accessor/grib_accessor_class_g1fcperiod.h b/src/accessor/grib_accessor_class_g1fcperiod.h index b2862cb78..40810cb86 100644 --- a/src/accessor/grib_accessor_class_g1fcperiod.h +++ b/src/accessor/grib_accessor_class_g1fcperiod.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1fcperiod_h #define eccodes_accessor_g1fcperiod_h -#include "grib_api_internal.h" #include "grib_accessor_class_g1step_range.h" class grib_accessor_g1fcperiod_t : public grib_accessor_g1step_range_t diff --git a/src/accessor/grib_accessor_class_g1forecastmonth.h b/src/accessor/grib_accessor_class_g1forecastmonth.h index 3a5fbb89b..ff268febc 100644 --- a/src/accessor/grib_accessor_class_g1forecastmonth.h +++ b/src/accessor/grib_accessor_class_g1forecastmonth.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1forecastmonth_h #define eccodes_accessor_g1forecastmonth_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1forecastmonth_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g1monthlydate.h b/src/accessor/grib_accessor_class_g1monthlydate.h index b279e56c3..6148e4307 100644 --- a/src/accessor/grib_accessor_class_g1monthlydate.h +++ b/src/accessor/grib_accessor_class_g1monthlydate.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1monthlydate_h #define eccodes_accessor_g1monthlydate_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1monthlydate_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h index 75b21875b..e8cdb50ca 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1number_of_coded_values_sh_complex_h #define eccodes_accessor_g1number_of_coded_values_sh_complex_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1number_of_coded_values_sh_complex_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h index d59e4999c..f5cc84b02 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1number_of_coded_values_sh_simple_h #define eccodes_accessor_g1number_of_coded_values_sh_simple_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1number_of_coded_values_sh_simple_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g1step_range.h b/src/accessor/grib_accessor_class_g1step_range.h index 26d7116e8..252a214ae 100644 --- a/src/accessor/grib_accessor_class_g1step_range.h +++ b/src/accessor/grib_accessor_class_g1step_range.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1step_range_h #define eccodes_accessor_g1step_range_h -#include "grib_api_internal.h" #include "grib_accessor_class_abstract_long_vector.h" class grib_accessor_g1step_range_t : public grib_accessor_abstract_long_vector_t diff --git a/src/accessor/grib_accessor_class_g1verificationdate.h b/src/accessor/grib_accessor_class_g1verificationdate.h index 70edcf7d8..1a97bf3c6 100644 --- a/src/accessor/grib_accessor_class_g1verificationdate.h +++ b/src/accessor/grib_accessor_class_g1verificationdate.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g1verificationdate_h #define eccodes_accessor_g1verificationdate_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g1verificationdate_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g2_aerosol.h b/src/accessor/grib_accessor_class_g2_aerosol.h index f9feaa5e8..96c1b4b9e 100644 --- a/src/accessor/grib_accessor_class_g2_aerosol.h +++ b/src/accessor/grib_accessor_class_g2_aerosol.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2_aerosol_h #define eccodes_accessor_g2_aerosol_h -#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_g2_aerosol_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_g2_chemical.h b/src/accessor/grib_accessor_class_g2_chemical.h index 01a159008..59df76928 100644 --- a/src/accessor/grib_accessor_class_g2_chemical.h +++ b/src/accessor/grib_accessor_class_g2_chemical.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2_chemical_h #define eccodes_accessor_g2_chemical_h -#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_g2_chemical_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_g2_eps.h b/src/accessor/grib_accessor_class_g2_eps.h index a29e975ea..b651985b1 100644 --- a/src/accessor/grib_accessor_class_g2_eps.h +++ b/src/accessor/grib_accessor_class_g2_eps.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2_eps_h #define eccodes_accessor_g2_eps_h -#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_g2_eps_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_g2_mars_labeling.h b/src/accessor/grib_accessor_class_g2_mars_labeling.h index a73962542..b3f7969bb 100644 --- a/src/accessor/grib_accessor_class_g2_mars_labeling.h +++ b/src/accessor/grib_accessor_class_g2_mars_labeling.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2_mars_labeling_h #define eccodes_accessor_g2_mars_labeling_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_g2_mars_labeling_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_g2bitmap.h b/src/accessor/grib_accessor_class_g2bitmap.h index 3f1b85d23..3c6f3e39c 100644 --- a/src/accessor/grib_accessor_class_g2bitmap.h +++ b/src/accessor/grib_accessor_class_g2bitmap.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2bitmap_h #define eccodes_accessor_g2bitmap_h -#include "grib_api_internal.h" #include "grib_accessor_class_bitmap.h" class grib_accessor_g2bitmap_t : public grib_accessor_bitmap_t diff --git a/src/accessor/grib_accessor_class_g2bitmap_present.h b/src/accessor/grib_accessor_class_g2bitmap_present.h index 18c7ac3f7..8ac86bbb4 100644 --- a/src/accessor/grib_accessor_class_g2bitmap_present.h +++ b/src/accessor/grib_accessor_class_g2bitmap_present.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2bitmap_present_h #define eccodes_accessor_g2bitmap_present_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g2bitmap_present_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g2date.h b/src/accessor/grib_accessor_class_g2date.h index 1c7a8a02d..da4e6b379 100644 --- a/src/accessor/grib_accessor_class_g2date.h +++ b/src/accessor/grib_accessor_class_g2date.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2date_h #define eccodes_accessor_g2date_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g2date_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g2end_step.h b/src/accessor/grib_accessor_class_g2end_step.h index b408681a0..756079631 100644 --- a/src/accessor/grib_accessor_class_g2end_step.h +++ b/src/accessor/grib_accessor_class_g2end_step.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2end_step_h #define eccodes_accessor_g2end_step_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g2end_step_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g2grid.h b/src/accessor/grib_accessor_class_g2grid.h index 25a527b69..ca1ef3e6c 100644 --- a/src/accessor/grib_accessor_class_g2grid.h +++ b/src/accessor/grib_accessor_class_g2grid.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2grid_h #define eccodes_accessor_g2grid_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_g2grid_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_g2latlon.h b/src/accessor/grib_accessor_class_g2latlon.h index c179bdd60..519b63b57 100644 --- a/src/accessor/grib_accessor_class_g2latlon.h +++ b/src/accessor/grib_accessor_class_g2latlon.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2latlon_h #define eccodes_accessor_g2latlon_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_g2latlon_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_g2level.h b/src/accessor/grib_accessor_class_g2level.h index a0163be8b..f0abf7e6e 100644 --- a/src/accessor/grib_accessor_class_g2level.h +++ b/src/accessor/grib_accessor_class_g2level.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2level_h #define eccodes_accessor_g2level_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_g2level_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_g2lon.h b/src/accessor/grib_accessor_class_g2lon.h index dd631adf4..409cc1297 100644 --- a/src/accessor/grib_accessor_class_g2lon.h +++ b/src/accessor/grib_accessor_class_g2lon.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_g2lon_h #define eccodes_accessor_g2lon_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_g2lon_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_gaussian_grid_name.h b/src/accessor/grib_accessor_class_gaussian_grid_name.h index a6be9dc33..abb505cb5 100644 --- a/src/accessor/grib_accessor_class_gaussian_grid_name.h +++ b/src/accessor/grib_accessor_class_gaussian_grid_name.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_gaussian_grid_name_h #define eccodes_accessor_gaussian_grid_name_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_gaussian_grid_name_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_gds_is_present.h b/src/accessor/grib_accessor_class_gds_is_present.h index 8dad7dd21..b7617a64d 100644 --- a/src/accessor/grib_accessor_class_gds_is_present.h +++ b/src/accessor/grib_accessor_class_gds_is_present.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_gds_is_present_h #define eccodes_accessor_gds_is_present_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_gds_is_present_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_gds_not_present_bitmap.h b/src/accessor/grib_accessor_class_gds_not_present_bitmap.h index 377fac8b4..03750bb03 100644 --- a/src/accessor/grib_accessor_class_gds_not_present_bitmap.h +++ b/src/accessor/grib_accessor_class_gds_not_present_bitmap.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_gds_not_present_bitmap_h #define eccodes_accessor_gds_not_present_bitmap_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_gds_not_present_bitmap_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_global_gaussian.h b/src/accessor/grib_accessor_class_global_gaussian.h index 5bd73dd8f..8c9d37f13 100644 --- a/src/accessor/grib_accessor_class_global_gaussian.h +++ b/src/accessor/grib_accessor_class_global_gaussian.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_global_gaussian_h #define eccodes_accessor_global_gaussian_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_global_gaussian_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_group.h b/src/accessor/grib_accessor_class_group.h index ab56f174e..3d718fdfa 100644 --- a/src/accessor/grib_accessor_class_group.h +++ b/src/accessor/grib_accessor_class_group.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_group_h #define eccodes_accessor_group_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_group_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_gts_header.h b/src/accessor/grib_accessor_class_gts_header.h index 15f2bfd9e..3027def40 100644 --- a/src/accessor/grib_accessor_class_gts_header.h +++ b/src/accessor/grib_accessor_class_gts_header.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_gts_header_h #define eccodes_accessor_gts_header_h -#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_gts_header_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_hash_array.h b/src/accessor/grib_accessor_class_hash_array.h index 7ebd98929..f3791d91f 100644 --- a/src/accessor/grib_accessor_class_hash_array.h +++ b/src/accessor/grib_accessor_class_hash_array.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_hash_array_h #define eccodes_accessor_hash_array_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_hash_array_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_headers_only.h b/src/accessor/grib_accessor_class_headers_only.h index d5743cf90..d972319c5 100644 --- a/src/accessor/grib_accessor_class_headers_only.h +++ b/src/accessor/grib_accessor_class_headers_only.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_headers_only_h #define eccodes_accessor_headers_only_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_headers_only_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_ifs_param.h b/src/accessor/grib_accessor_class_ifs_param.h index b9fe2bd33..1c86b8561 100644 --- a/src/accessor/grib_accessor_class_ifs_param.h +++ b/src/accessor/grib_accessor_class_ifs_param.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_ifs_param_h #define eccodes_accessor_ifs_param_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_ifs_param_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_julian_date.h b/src/accessor/grib_accessor_class_julian_date.h index 944e85996..b555ee9dc 100644 --- a/src/accessor/grib_accessor_class_julian_date.h +++ b/src/accessor/grib_accessor_class_julian_date.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_julian_date_h #define eccodes_accessor_julian_date_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_julian_date_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_julian_day.h b/src/accessor/grib_accessor_class_julian_day.h index b31f3b0dd..6bb48344f 100644 --- a/src/accessor/grib_accessor_class_julian_day.h +++ b/src/accessor/grib_accessor_class_julian_day.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_julian_day_h #define eccodes_accessor_julian_day_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_julian_day_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_ksec1expver.h b/src/accessor/grib_accessor_class_ksec1expver.h index ca0a18695..7225613a5 100644 --- a/src/accessor/grib_accessor_class_ksec1expver.h +++ b/src/accessor/grib_accessor_class_ksec1expver.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_ksec1expver_h #define eccodes_accessor_ksec1expver_h -#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_ksec1expver_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_label.h b/src/accessor/grib_accessor_class_label.h index 01b7ac392..058ce9a11 100644 --- a/src/accessor/grib_accessor_class_label.h +++ b/src/accessor/grib_accessor_class_label.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_label_h #define eccodes_accessor_label_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_label_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_latitudes.h b/src/accessor/grib_accessor_class_latitudes.h index e89db49e4..1b55b5210 100644 --- a/src/accessor/grib_accessor_class_latitudes.h +++ b/src/accessor/grib_accessor_class_latitudes.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_latitudes_h #define eccodes_accessor_latitudes_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_latitudes_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_latlon_increment.h b/src/accessor/grib_accessor_class_latlon_increment.h index e85d1ec91..3c189450d 100644 --- a/src/accessor/grib_accessor_class_latlon_increment.h +++ b/src/accessor/grib_accessor_class_latlon_increment.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_latlon_increment_h #define eccodes_accessor_latlon_increment_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_latlon_increment_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_latlonvalues.h b/src/accessor/grib_accessor_class_latlonvalues.h index 56faec4d9..0109e7e86 100644 --- a/src/accessor/grib_accessor_class_latlonvalues.h +++ b/src/accessor/grib_accessor_class_latlonvalues.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_latlonvalues_h #define eccodes_accessor_latlonvalues_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_latlonvalues_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_library_version.h b/src/accessor/grib_accessor_class_library_version.h index 66099c2c0..d4c56b52c 100644 --- a/src/accessor/grib_accessor_class_library_version.h +++ b/src/accessor/grib_accessor_class_library_version.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_library_version_h #define eccodes_accessor_library_version_h -#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_library_version_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_local_definition.h b/src/accessor/grib_accessor_class_local_definition.h index 9be7d7e9a..6ca10add6 100644 --- a/src/accessor/grib_accessor_class_local_definition.h +++ b/src/accessor/grib_accessor_class_local_definition.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_local_definition_h #define eccodes_accessor_local_definition_h -#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_local_definition_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_long.h b/src/accessor/grib_accessor_class_long.h index fea39235e..72a67a8e5 100644 --- a/src/accessor/grib_accessor_class_long.h +++ b/src/accessor/grib_accessor_class_long.h @@ -10,7 +10,6 @@ #pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_long_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_long_vector.h b/src/accessor/grib_accessor_class_long_vector.h index b2d3a4a67..aacd5e06e 100644 --- a/src/accessor/grib_accessor_class_long_vector.h +++ b/src/accessor/grib_accessor_class_long_vector.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_long_vector_h #define eccodes_accessor_long_vector_h -#include "grib_api_internal.h" #include "grib_accessor_class_abstract_long_vector.h" class grib_accessor_long_vector_t : public grib_accessor_abstract_long_vector_t diff --git a/src/accessor/grib_accessor_class_longitudes.h b/src/accessor/grib_accessor_class_longitudes.h index 0825f5a90..a1964ea51 100644 --- a/src/accessor/grib_accessor_class_longitudes.h +++ b/src/accessor/grib_accessor_class_longitudes.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_longitudes_h #define eccodes_accessor_longitudes_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_longitudes_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_mars_param.h b/src/accessor/grib_accessor_class_mars_param.h index 87400a5f7..d56488c0a 100644 --- a/src/accessor/grib_accessor_class_mars_param.h +++ b/src/accessor/grib_accessor_class_mars_param.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_mars_param_h #define eccodes_accessor_mars_param_h -#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_mars_param_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_mars_step.h b/src/accessor/grib_accessor_class_mars_step.h index 67d95ef9a..5a570203f 100644 --- a/src/accessor/grib_accessor_class_mars_step.h +++ b/src/accessor/grib_accessor_class_mars_step.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_mars_step_h #define eccodes_accessor_mars_step_h -#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_mars_step_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_md5.h b/src/accessor/grib_accessor_class_md5.h index 7b265f797..fdfc70718 100644 --- a/src/accessor/grib_accessor_class_md5.h +++ b/src/accessor/grib_accessor_class_md5.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_md5_h #define eccodes_accessor_md5_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_md5_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_message.h b/src/accessor/grib_accessor_class_message.h index c81e23750..478c01964 100644 --- a/src/accessor/grib_accessor_class_message.h +++ b/src/accessor/grib_accessor_class_message.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_message_h #define eccodes_accessor_message_h -#include "grib_api_internal.h" #include "grib_accessor_class_bytes.h" class grib_accessor_message_t : public grib_accessor_bytes_t diff --git a/src/accessor/grib_accessor_class_message_copy.h b/src/accessor/grib_accessor_class_message_copy.h index 53002c968..fa4110a1c 100644 --- a/src/accessor/grib_accessor_class_message_copy.h +++ b/src/accessor/grib_accessor_class_message_copy.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_message_copy_h #define eccodes_accessor_message_copy_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_message_copy_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_multdouble.h b/src/accessor/grib_accessor_class_multdouble.h index c9847dde1..5cc218aac 100644 --- a/src/accessor/grib_accessor_class_multdouble.h +++ b/src/accessor/grib_accessor_class_multdouble.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_multdouble_h #define eccodes_accessor_multdouble_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_multdouble_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_nearest.h b/src/accessor/grib_accessor_class_nearest.h index 098eb69a8..efc7ebfc4 100644 --- a/src/accessor/grib_accessor_class_nearest.h +++ b/src/accessor/grib_accessor_class_nearest.h @@ -10,7 +10,6 @@ #pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_nearest_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_non_alpha.h b/src/accessor/grib_accessor_class_non_alpha.h index e9f910723..72674ac5d 100644 --- a/src/accessor/grib_accessor_class_non_alpha.h +++ b/src/accessor/grib_accessor_class_non_alpha.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_non_alpha_h #define eccodes_accessor_non_alpha_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_non_alpha_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_number_of_coded_values.h b/src/accessor/grib_accessor_class_number_of_coded_values.h index 7cb74d1c2..1d46cdd6b 100644 --- a/src/accessor/grib_accessor_class_number_of_coded_values.h +++ b/src/accessor/grib_accessor_class_number_of_coded_values.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_number_of_coded_values_h #define eccodes_accessor_number_of_coded_values_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_number_of_coded_values_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_number_of_points.h b/src/accessor/grib_accessor_class_number_of_points.h index 3ca18b6e9..4adaddaa2 100644 --- a/src/accessor/grib_accessor_class_number_of_points.h +++ b/src/accessor/grib_accessor_class_number_of_points.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_number_of_points_h #define eccodes_accessor_number_of_points_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_number_of_points_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_number_of_points_gaussian.h b/src/accessor/grib_accessor_class_number_of_points_gaussian.h index 70ba3d6d4..48e63d28c 100644 --- a/src/accessor/grib_accessor_class_number_of_points_gaussian.h +++ b/src/accessor/grib_accessor_class_number_of_points_gaussian.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_number_of_points_gaussian_h #define eccodes_accessor_number_of_points_gaussian_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_number_of_points_gaussian_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_number_of_values.h b/src/accessor/grib_accessor_class_number_of_values.h index 246c29cbd..8b6418a9c 100644 --- a/src/accessor/grib_accessor_class_number_of_values.h +++ b/src/accessor/grib_accessor_class_number_of_values.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_number_of_values_h #define eccodes_accessor_number_of_values_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_number_of_values_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h index ff57531d2..0a4601852 100644 --- a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h +++ b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_number_of_values_data_raw_packing_h #define eccodes_accessor_number_of_values_data_raw_packing_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_number_of_values_data_raw_packing_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_octahedral_gaussian.h b/src/accessor/grib_accessor_class_octahedral_gaussian.h index f9aee3d78..f9c540018 100644 --- a/src/accessor/grib_accessor_class_octahedral_gaussian.h +++ b/src/accessor/grib_accessor_class_octahedral_gaussian.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_octahedral_gaussian_h #define eccodes_accessor_octahedral_gaussian_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_octahedral_gaussian_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_octet_number.h b/src/accessor/grib_accessor_class_octet_number.h index 6be9134af..35f536214 100644 --- a/src/accessor/grib_accessor_class_octet_number.h +++ b/src/accessor/grib_accessor_class_octet_number.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_octet_number_h #define eccodes_accessor_octet_number_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_octet_number_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_offset_file.h b/src/accessor/grib_accessor_class_offset_file.h index 8806590f7..326559d81 100644 --- a/src/accessor/grib_accessor_class_offset_file.h +++ b/src/accessor/grib_accessor_class_offset_file.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_offset_file_h #define eccodes_accessor_offset_file_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_offset_file_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_offset_values.h b/src/accessor/grib_accessor_class_offset_values.h index 17d31a91a..4fe2fc779 100644 --- a/src/accessor/grib_accessor_class_offset_values.h +++ b/src/accessor/grib_accessor_class_offset_values.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_offset_values_h #define eccodes_accessor_offset_values_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_offset_values_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_pack_bufr_values.h b/src/accessor/grib_accessor_class_pack_bufr_values.h index feef9ef37..8cb218129 100644 --- a/src/accessor/grib_accessor_class_pack_bufr_values.h +++ b/src/accessor/grib_accessor_class_pack_bufr_values.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_pack_bufr_values_h #define eccodes_accessor_pack_bufr_values_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_pack_bufr_values_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_packing_type.h b/src/accessor/grib_accessor_class_packing_type.h index 69c52f866..2a454c1f4 100644 --- a/src/accessor/grib_accessor_class_packing_type.h +++ b/src/accessor/grib_accessor_class_packing_type.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_packing_type_h #define eccodes_accessor_packing_type_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_packing_type_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_pad.h b/src/accessor/grib_accessor_class_pad.h index 28fefc891..08bf09727 100644 --- a/src/accessor/grib_accessor_class_pad.h +++ b/src/accessor/grib_accessor_class_pad.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_pad_h #define eccodes_accessor_pad_h -#include "grib_api_internal.h" #include "grib_accessor_class_padding.h" class grib_accessor_pad_t : public grib_accessor_padding_t diff --git a/src/accessor/grib_accessor_class_padding.h b/src/accessor/grib_accessor_class_padding.h index 2d53ed7c8..7544987e0 100644 --- a/src/accessor/grib_accessor_class_padding.h +++ b/src/accessor/grib_accessor_class_padding.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_padding_h #define eccodes_accessor_padding_h -#include "grib_api_internal.h" #include "grib_accessor_class_bytes.h" class grib_accessor_padding_t : public grib_accessor_bytes_t diff --git a/src/accessor/grib_accessor_class_padto.h b/src/accessor/grib_accessor_class_padto.h index 5b7867019..fde8ebbef 100644 --- a/src/accessor/grib_accessor_class_padto.h +++ b/src/accessor/grib_accessor_class_padto.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_padto_h #define eccodes_accessor_padto_h -#include "grib_api_internal.h" #include "grib_accessor_class_padding.h" class grib_accessor_padto_t : public grib_accessor_padding_t diff --git a/src/accessor/grib_accessor_class_padtoeven.h b/src/accessor/grib_accessor_class_padtoeven.h index 2f9ccc1ff..5dff5ba39 100644 --- a/src/accessor/grib_accessor_class_padtoeven.h +++ b/src/accessor/grib_accessor_class_padtoeven.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_padtoeven_h #define eccodes_accessor_padtoeven_h -#include "grib_api_internal.h" #include "grib_accessor_class_padding.h" class grib_accessor_padtoeven_t : public grib_accessor_padding_t diff --git a/src/accessor/grib_accessor_class_padtomultiple.h b/src/accessor/grib_accessor_class_padtomultiple.h index f391fbe58..5bcb0ea71 100644 --- a/src/accessor/grib_accessor_class_padtomultiple.h +++ b/src/accessor/grib_accessor_class_padtomultiple.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_padtomultiple_h #define eccodes_accessor_padtomultiple_h -#include "grib_api_internal.h" #include "grib_accessor_class_padding.h" class grib_accessor_padtomultiple_t : public grib_accessor_padding_t diff --git a/src/accessor/grib_accessor_class_position.h b/src/accessor/grib_accessor_class_position.h index 05564e503..5597940b4 100644 --- a/src/accessor/grib_accessor_class_position.h +++ b/src/accessor/grib_accessor_class_position.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_position_h #define eccodes_accessor_position_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_position_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_proj_string.h b/src/accessor/grib_accessor_class_proj_string.h index bb4fa76a7..7205a8942 100644 --- a/src/accessor/grib_accessor_class_proj_string.h +++ b/src/accessor/grib_accessor_class_proj_string.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_proj_string_h #define eccodes_accessor_proj_string_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_proj_string_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_raw.h b/src/accessor/grib_accessor_class_raw.h index d754deb63..5f4cc36ef 100644 --- a/src/accessor/grib_accessor_class_raw.h +++ b/src/accessor/grib_accessor_class_raw.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_raw_h #define eccodes_accessor_raw_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_raw_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_rdbtime_guess_date.h b/src/accessor/grib_accessor_class_rdbtime_guess_date.h index 1c75f1556..9cef89877 100644 --- a/src/accessor/grib_accessor_class_rdbtime_guess_date.h +++ b/src/accessor/grib_accessor_class_rdbtime_guess_date.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_rdbtime_guess_date_h #define eccodes_accessor_rdbtime_guess_date_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_rdbtime_guess_date_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_reference_value_error.h b/src/accessor/grib_accessor_class_reference_value_error.h index aea5e95e5..bac786ca6 100644 --- a/src/accessor/grib_accessor_class_reference_value_error.h +++ b/src/accessor/grib_accessor_class_reference_value_error.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_reference_value_error_h #define eccodes_accessor_reference_value_error_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_reference_value_error_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_round.h b/src/accessor/grib_accessor_class_round.h index ed94f9804..e235dfd85 100644 --- a/src/accessor/grib_accessor_class_round.h +++ b/src/accessor/grib_accessor_class_round.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_round_h #define eccodes_accessor_round_h -#include "grib_api_internal.h" #include "grib_accessor_class_evaluate.h" class grib_accessor_round_t : public grib_accessor_evaluate_t diff --git a/src/accessor/grib_accessor_class_scale.h b/src/accessor/grib_accessor_class_scale.h index 5a44f8013..e75fdb021 100644 --- a/src/accessor/grib_accessor_class_scale.h +++ b/src/accessor/grib_accessor_class_scale.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_scale_h #define eccodes_accessor_scale_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_scale_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_scale_values.h b/src/accessor/grib_accessor_class_scale_values.h index ab644956b..4c807f696 100644 --- a/src/accessor/grib_accessor_class_scale_values.h +++ b/src/accessor/grib_accessor_class_scale_values.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_scale_values_h #define eccodes_accessor_scale_values_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_scale_values_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_second_order_bits_per_value.h b/src/accessor/grib_accessor_class_second_order_bits_per_value.h index 5c30e9e19..b5a38b417 100644 --- a/src/accessor/grib_accessor_class_second_order_bits_per_value.h +++ b/src/accessor/grib_accessor_class_second_order_bits_per_value.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_second_order_bits_per_value_h #define eccodes_accessor_second_order_bits_per_value_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_second_order_bits_per_value_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_section_length.h b/src/accessor/grib_accessor_class_section_length.h index 5c9b810d0..0c56b4cb0 100644 --- a/src/accessor/grib_accessor_class_section_length.h +++ b/src/accessor/grib_accessor_class_section_length.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_section_length_h #define eccodes_accessor_section_length_h -#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_section_length_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_section_padding.h b/src/accessor/grib_accessor_class_section_padding.h index b039ed838..f3ea9c821 100644 --- a/src/accessor/grib_accessor_class_section_padding.h +++ b/src/accessor/grib_accessor_class_section_padding.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_section_padding_h #define eccodes_accessor_section_padding_h -#include "grib_api_internal.h" #include "grib_accessor_class_padding.h" class grib_accessor_section_padding_t : public grib_accessor_padding_t diff --git a/src/accessor/grib_accessor_class_section_pointer.h b/src/accessor/grib_accessor_class_section_pointer.h index 0f92439a4..e34125800 100644 --- a/src/accessor/grib_accessor_class_section_pointer.h +++ b/src/accessor/grib_accessor_class_section_pointer.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_section_pointer_h #define eccodes_accessor_section_pointer_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_section_pointer_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_select_step_template.h b/src/accessor/grib_accessor_class_select_step_template.h index ad6548aa4..d2e58c757 100644 --- a/src/accessor/grib_accessor_class_select_step_template.h +++ b/src/accessor/grib_accessor_class_select_step_template.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_select_step_template_h #define eccodes_accessor_select_step_template_h -#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" class grib_accessor_select_step_template_t : public grib_accessor_unsigned_t diff --git a/src/accessor/grib_accessor_class_sexagesimal2decimal.h b/src/accessor/grib_accessor_class_sexagesimal2decimal.h index 32fa3498d..0dec18f2c 100644 --- a/src/accessor/grib_accessor_class_sexagesimal2decimal.h +++ b/src/accessor/grib_accessor_class_sexagesimal2decimal.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_sexagesimal2decimal_h #define eccodes_accessor_sexagesimal2decimal_h -#include "grib_api_internal.h" #include "grib_accessor_class_to_double.h" class grib_accessor_sexagesimal2decimal_t : public grib_accessor_to_double_t diff --git a/src/accessor/grib_accessor_class_signed.h b/src/accessor/grib_accessor_class_signed.h index c25fc1752..72d3c6657 100644 --- a/src/accessor/grib_accessor_class_signed.h +++ b/src/accessor/grib_accessor_class_signed.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_signed_h #define eccodes_accessor_signed_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_signed_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_signed_bits.h b/src/accessor/grib_accessor_class_signed_bits.h index 05cf524aa..d70a9a27a 100644 --- a/src/accessor/grib_accessor_class_signed_bits.h +++ b/src/accessor/grib_accessor_class_signed_bits.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_signed_bits_h #define eccodes_accessor_signed_bits_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_signed_bits_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_simple_packing_error.h b/src/accessor/grib_accessor_class_simple_packing_error.h index 950716638..55f720b78 100644 --- a/src/accessor/grib_accessor_class_simple_packing_error.h +++ b/src/accessor/grib_accessor_class_simple_packing_error.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_simple_packing_error_h #define eccodes_accessor_simple_packing_error_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_simple_packing_error_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_size.h b/src/accessor/grib_accessor_class_size.h index 7cfb325f5..12914616e 100644 --- a/src/accessor/grib_accessor_class_size.h +++ b/src/accessor/grib_accessor_class_size.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_size_h #define eccodes_accessor_size_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_size_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_smart_table.h b/src/accessor/grib_accessor_class_smart_table.h index 93a6ea682..c7aaf0827 100644 --- a/src/accessor/grib_accessor_class_smart_table.h +++ b/src/accessor/grib_accessor_class_smart_table.h @@ -8,18 +8,11 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - - #pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_unsigned.h" #include - class grib_accessor_smart_table_t : public grib_accessor_unsigned_t { public: @@ -36,7 +29,6 @@ class grib_accessor_smart_table_t : public grib_accessor_unsigned_t int dirty; }; - class grib_accessor_class_smart_table_t : public grib_accessor_class_unsigned_t { public: diff --git a/src/accessor/grib_accessor_class_spd.h b/src/accessor/grib_accessor_class_spd.h index 3c47458d3..17ebb9b15 100644 --- a/src/accessor/grib_accessor_class_spd.h +++ b/src/accessor/grib_accessor_class_spd.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_spd_h #define eccodes_accessor_spd_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_spd_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_spectral_truncation.h b/src/accessor/grib_accessor_class_spectral_truncation.h index 329c59155..fb43b42d1 100644 --- a/src/accessor/grib_accessor_class_spectral_truncation.h +++ b/src/accessor/grib_accessor_class_spectral_truncation.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_spectral_truncation_h #define eccodes_accessor_spectral_truncation_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_spectral_truncation_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_sprintf.h b/src/accessor/grib_accessor_class_sprintf.h index 360cd3b1b..c183db830 100644 --- a/src/accessor/grib_accessor_class_sprintf.h +++ b/src/accessor/grib_accessor_class_sprintf.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_sprintf_h #define eccodes_accessor_sprintf_h -#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_sprintf_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_statistics.h b/src/accessor/grib_accessor_class_statistics.h index e4ffed90d..fcc866ca8 100644 --- a/src/accessor/grib_accessor_class_statistics.h +++ b/src/accessor/grib_accessor_class_statistics.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_statistics_h #define eccodes_accessor_statistics_h -#include "grib_api_internal.h" #include "grib_accessor_class_abstract_vector.h" class grib_accessor_statistics_t : public grib_accessor_abstract_vector_t diff --git a/src/accessor/grib_accessor_class_statistics_spectral.h b/src/accessor/grib_accessor_class_statistics_spectral.h index c47f2385a..1451a0d2e 100644 --- a/src/accessor/grib_accessor_class_statistics_spectral.h +++ b/src/accessor/grib_accessor_class_statistics_spectral.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_statistics_spectral_h #define eccodes_accessor_statistics_spectral_h -#include "grib_api_internal.h" #include "grib_accessor_class_abstract_vector.h" class grib_accessor_statistics_spectral_t : public grib_accessor_abstract_vector_t diff --git a/src/accessor/grib_accessor_class_step_human_readable.h b/src/accessor/grib_accessor_class_step_human_readable.h index 9d902f324..4100f6008 100644 --- a/src/accessor/grib_accessor_class_step_human_readable.h +++ b/src/accessor/grib_accessor_class_step_human_readable.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_step_human_readable_h #define eccodes_accessor_step_human_readable_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_step_human_readable_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_step_in_units.h b/src/accessor/grib_accessor_class_step_in_units.h index e6fe8a6f6..0f8036d13 100644 --- a/src/accessor/grib_accessor_class_step_in_units.h +++ b/src/accessor/grib_accessor_class_step_in_units.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_step_in_units_h #define eccodes_accessor_step_in_units_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_step_in_units_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_sum.h b/src/accessor/grib_accessor_class_sum.h index c05c7c6d1..5ee44d7a0 100644 --- a/src/accessor/grib_accessor_class_sum.h +++ b/src/accessor/grib_accessor_class_sum.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_sum_h #define eccodes_accessor_sum_h -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_sum_t : public grib_accessor_double_t diff --git a/src/accessor/grib_accessor_class_suppressed.h b/src/accessor/grib_accessor_class_suppressed.h index 844c1fb6b..5de58f430 100644 --- a/src/accessor/grib_accessor_class_suppressed.h +++ b/src/accessor/grib_accessor_class_suppressed.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_suppressed_h #define eccodes_accessor_suppressed_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_suppressed_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_time.h b/src/accessor/grib_accessor_class_time.h index 247e4a08d..c343872b8 100644 --- a/src/accessor/grib_accessor_class_time.h +++ b/src/accessor/grib_accessor_class_time.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_time_h #define eccodes_accessor_time_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_time_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_to_double.h b/src/accessor/grib_accessor_class_to_double.h index 639cc98f5..8b3d861e0 100644 --- a/src/accessor/grib_accessor_class_to_double.h +++ b/src/accessor/grib_accessor_class_to_double.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_to_double_h #define eccodes_accessor_to_double_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_to_double_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_to_integer.h b/src/accessor/grib_accessor_class_to_integer.h index ec3505c75..38f909248 100644 --- a/src/accessor/grib_accessor_class_to_integer.h +++ b/src/accessor/grib_accessor_class_to_integer.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_to_integer_h #define eccodes_accessor_to_integer_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_to_integer_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_to_string.h b/src/accessor/grib_accessor_class_to_string.h index 6dd1e4de8..0a5077eb0 100644 --- a/src/accessor/grib_accessor_class_to_string.h +++ b/src/accessor/grib_accessor_class_to_string.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_to_string_h #define eccodes_accessor_to_string_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_to_string_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_transient_darray.h b/src/accessor/grib_accessor_class_transient_darray.h index 6aeff1491..a1142dbe3 100644 --- a/src/accessor/grib_accessor_class_transient_darray.h +++ b/src/accessor/grib_accessor_class_transient_darray.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_transient_darray_h #define eccodes_accessor_transient_darray_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_transient_darray_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_trim.h b/src/accessor/grib_accessor_class_trim.h index 664ccc528..df06a277f 100644 --- a/src/accessor/grib_accessor_class_trim.h +++ b/src/accessor/grib_accessor_class_trim.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_trim_h #define eccodes_accessor_trim_h -#include "grib_api_internal.h" #include "grib_accessor_class_ascii.h" class grib_accessor_trim_t : public grib_accessor_ascii_t diff --git a/src/accessor/grib_accessor_class_uint16.h b/src/accessor/grib_accessor_class_uint16.h index 0952e2d57..d77d2b6f6 100644 --- a/src/accessor/grib_accessor_class_uint16.h +++ b/src/accessor/grib_accessor_class_uint16.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_uint16_h #define eccodes_accessor_uint16_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint16_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_uint32.h b/src/accessor/grib_accessor_class_uint32.h index 0cf8a0bd9..e327b275e 100644 --- a/src/accessor/grib_accessor_class_uint32.h +++ b/src/accessor/grib_accessor_class_uint32.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_uint32_h #define eccodes_accessor_uint32_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint32_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_uint32_little_endian.h b/src/accessor/grib_accessor_class_uint32_little_endian.h index 357791081..554ea6a93 100644 --- a/src/accessor/grib_accessor_class_uint32_little_endian.h +++ b/src/accessor/grib_accessor_class_uint32_little_endian.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_uint32_little_endian_h #define eccodes_accessor_uint32_little_endian_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint32_little_endian_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_uint64.h b/src/accessor/grib_accessor_class_uint64.h index 55215c77f..3e7779fa3 100644 --- a/src/accessor/grib_accessor_class_uint64.h +++ b/src/accessor/grib_accessor_class_uint64.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_uint64_h #define eccodes_accessor_uint64_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint64_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_uint64_little_endian.h b/src/accessor/grib_accessor_class_uint64_little_endian.h index 8c04a5398..e2e1774b1 100644 --- a/src/accessor/grib_accessor_class_uint64_little_endian.h +++ b/src/accessor/grib_accessor_class_uint64_little_endian.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_uint64_little_endian_h #define eccodes_accessor_uint64_little_endian_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint64_little_endian_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_uint8.h b/src/accessor/grib_accessor_class_uint8.h index 04dcb1075..fb18550e6 100644 --- a/src/accessor/grib_accessor_class_uint8.h +++ b/src/accessor/grib_accessor_class_uint8.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_uint8_h #define eccodes_accessor_uint8_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_uint8_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_unexpanded_descriptors.h b/src/accessor/grib_accessor_class_unexpanded_descriptors.h index 2db5b51b3..eac0dbf6a 100644 --- a/src/accessor/grib_accessor_class_unexpanded_descriptors.h +++ b/src/accessor/grib_accessor_class_unexpanded_descriptors.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_unexpanded_descriptors_h #define eccodes_accessor_unexpanded_descriptors_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_unexpanded_descriptors_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_unpack_bufr_values.h b/src/accessor/grib_accessor_class_unpack_bufr_values.h index 0eea70de4..dde08dc9b 100644 --- a/src/accessor/grib_accessor_class_unpack_bufr_values.h +++ b/src/accessor/grib_accessor_class_unpack_bufr_values.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_unpack_bufr_values_h #define eccodes_accessor_unpack_bufr_values_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_unpack_bufr_values_t : public grib_accessor_gen_t diff --git a/src/accessor/grib_accessor_class_unsigned.h b/src/accessor/grib_accessor_class_unsigned.h index 0523974ca..50f3cfb16 100644 --- a/src/accessor/grib_accessor_class_unsigned.h +++ b/src/accessor/grib_accessor_class_unsigned.h @@ -10,7 +10,6 @@ #pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_unsigned_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_unsigned_bits.h b/src/accessor/grib_accessor_class_unsigned_bits.h index ae20b0a5a..3042ea3fa 100644 --- a/src/accessor/grib_accessor_class_unsigned_bits.h +++ b/src/accessor/grib_accessor_class_unsigned_bits.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_unsigned_bits_h #define eccodes_accessor_unsigned_bits_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_unsigned_bits_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_validity_date.h b/src/accessor/grib_accessor_class_validity_date.h index dfd8eb320..ca2efb7c4 100644 --- a/src/accessor/grib_accessor_class_validity_date.h +++ b/src/accessor/grib_accessor_class_validity_date.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_validity_date_h #define eccodes_accessor_validity_date_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_validity_date_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_validity_time.h b/src/accessor/grib_accessor_class_validity_time.h index 3f7c27f7b..7b998e595 100644 --- a/src/accessor/grib_accessor_class_validity_time.h +++ b/src/accessor/grib_accessor_class_validity_time.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_validity_time_h #define eccodes_accessor_validity_time_h -#include "grib_api_internal.h" #include "grib_accessor_class_long.h" class grib_accessor_validity_time_t : public grib_accessor_long_t diff --git a/src/accessor/grib_accessor_class_values.h b/src/accessor/grib_accessor_class_values.h index c7cbf54e7..5de50f2bd 100644 --- a/src/accessor/grib_accessor_class_values.h +++ b/src/accessor/grib_accessor_class_values.h @@ -8,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_values_h -#define eccodes_accessor_values_h +#pragma once #include "grib_accessor_class_gen.h" @@ -38,4 +37,3 @@ class grib_accessor_class_values_t : public grib_accessor_class_gen_t void update_size(grib_accessor*, size_t) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_values_h */ diff --git a/src/accessor/grib_accessor_class_vector.h b/src/accessor/grib_accessor_class_vector.h index 671441001..12871fcc9 100644 --- a/src/accessor/grib_accessor_class_vector.h +++ b/src/accessor/grib_accessor_class_vector.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_vector_h #define eccodes_accessor_vector_h -#include "grib_api_internal.h" #include "grib_accessor_class_abstract_vector.h" class grib_accessor_vector_t : public grib_accessor_abstract_vector_t diff --git a/src/accessor/grib_accessor_class_when.h b/src/accessor/grib_accessor_class_when.h index b2ddcc0b0..22c5bee97 100644 --- a/src/accessor/grib_accessor_class_when.h +++ b/src/accessor/grib_accessor_class_when.h @@ -12,7 +12,6 @@ #ifndef eccodes_accessor_when_h #define eccodes_accessor_when_h -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_when_t : public grib_accessor_gen_t From f0b68e4b157da02e4fcbda6ddd6634bfac32d847 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 8 May 2024 13:05:36 +0100 Subject: [PATCH 132/196] ECC-1820: Accessor hash --- src/grib_accessor_classes_hash.cc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/grib_accessor_classes_hash.cc b/src/grib_accessor_classes_hash.cc index 178ed937b..5617c9456 100644 --- a/src/grib_accessor_classes_hash.cc +++ b/src/grib_accessor_classes_hash.cc @@ -51,8 +51,7 @@ struct accessor_class_hash { const char *name; grib_accessor_class **cclass;}; #endif #endif -static unsigned int -grib_accessor_classes_get_id (const char *str, size_t len) +static unsigned int grib_accessor_classes_get_id (const char *str, size_t len) { static const unsigned short asso_values[] = { @@ -622,20 +621,19 @@ static const struct accessor_class_hash classes[] = {"g1verificationdate", &grib_accessor_class_g1verificationdate} }; -const struct accessor_class_hash * -grib_accessor_classes_hash (const char *str, size_t len) -{ - if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) +static const struct accessor_class_hash* grib_accessor_classes_hash(const char *str, size_t len) { unsigned int key = grib_accessor_classes_get_id (str, len); - if (key <= MAX_HASH_VALUE) +#ifdef DEBUG { - const char *s = classes[key].name; + const char *s; + Assert( len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH ); + Assert( key <= MAX_HASH_VALUE ); + s = classes[key].name; + Assert( *str == *s && strcmp(str + 1, s + 1)==0 ); + } +#endif - if (*str == *s && !strcmp (str + 1, s + 1)) return &classes[key]; - } - } - return 0; } From 915935d512c8622d22001746c72409a42e272c4e Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 8 May 2024 13:11:39 +0100 Subject: [PATCH 133/196] ECC-1820: Remove unused files --- src/grib_accessor_class_bitmap.cc | 297 -------------- ...ib_accessor_class_g1_half_byte_codeflag.cc | 147 ------- src/grib_accessor_class_g2step_range.cc | 375 ------------------ src/grib_accessor_class_transient_darray.cc | 216 ---------- 4 files changed, 1035 deletions(-) delete mode 100644 src/grib_accessor_class_bitmap.cc delete mode 100644 src/grib_accessor_class_g1_half_byte_codeflag.cc delete mode 100644 src/grib_accessor_class_g2step_range.cc delete mode 100644 src/grib_accessor_class_transient_darray.cc diff --git a/src/grib_accessor_class_bitmap.cc b/src/grib_accessor_class_bitmap.cc deleted file mode 100644 index c5be0ebbb..000000000 --- a/src/grib_accessor_class_bitmap.cc +++ /dev/null @@ -1,297 +0,0 @@ -/* - * (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 "grib_api_internal.h" -#include - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_bytes - IMPLEMENTS = next_offset - IMPLEMENTS = unpack_double;unpack_double_element;unpack_double_element_set - IMPLEMENTS = unpack_float - IMPLEMENTS = unpack_long - IMPLEMENTS = unpack_string - IMPLEMENTS = string_length - IMPLEMENTS = init;dump;update_size - MEMBERS=const char* tableReference - MEMBERS=const char* missing_value - MEMBERS=const char* offsetbsec - MEMBERS=const char* sLength - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 size_t string_length(grib_accessor*); -static long next_offset(grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); -static void update_size(grib_accessor*, size_t); -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_bitmap -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in bytes */ - /* Members defined in bitmap */ - const char* tableReference; - const char* missing_value; - const char* offsetbsec; - const char* sLength; -} grib_accessor_bitmap; - -extern grib_accessor_class* grib_accessor_class_bytes; - -static grib_accessor_class _grib_accessor_class_bitmap = { - &grib_accessor_class_bytes, /* super */ - "bitmap", /* name */ - sizeof(grib_accessor_bitmap), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - &next_offset, /* next_offset */ - &string_length, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - 0, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - &unpack_float, /* unpack_float */ - 0, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value (double) */ - 0, /* unpack only ith value (float) */ - &unpack_double_element_set, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_bitmap = &_grib_accessor_class_bitmap; - -/* END_CLASS_IMP */ - - -static void compute_size(grib_accessor* a) -{ - long slen = 0; - long off = 0; - grib_handle* hand = grib_handle_of_accessor(a); - - grib_accessor_bitmap* self = (grib_accessor_bitmap*)a; - grib_get_long_internal(hand, self->offsetbsec, &off); - grib_get_long_internal(hand, self->sLength, &slen); - - if (slen == 0) { - grib_accessor* seclen; - size_t size; - /* Assume reparsing */ - Assert(hand->loader != 0); - if (hand->loader != 0) { - seclen = grib_find_accessor(hand, self->sLength); - Assert(seclen); - grib_get_block_length(seclen->parent, &size); - slen = size; - } - } - - // printf("compute_size off=%ld slen=%ld a->offset=%ld\n", (long)off,(long)slen,(long)a->offset); - - a->length = off + (slen - a->offset); - - if (a->length < 0) { - /* Assume reparsing */ - /*Assert(hand->loader != 0);*/ - a->length = 0; - } - - Assert(a->length >= 0); -} - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - grib_accessor_bitmap* self = (grib_accessor_bitmap*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; - - self->tableReference = grib_arguments_get_name(hand, arg, n++); - self->missing_value = grib_arguments_get_name(hand, arg, n++); - self->offsetbsec = grib_arguments_get_name(hand, arg, n++); - self->sLength = grib_arguments_get_name(hand, arg, n++); - - compute_size(a); -} - -static long next_offset(grib_accessor* a) -{ - return grib_byte_offset(a) + grib_byte_count(a); -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - long len = 0; - char label[1024]; - - grib_value_count(a, &len); - - snprintf(label, 1024, "Bitmap of %ld values", len); - grib_dump_bytes(dumper, a, label); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - long pos = a->offset * 8; - long tlen = 0; - const grib_handle* hand = grib_handle_of_accessor(a); - - int 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 = tlen; - return GRIB_ARRAY_TOO_SMALL; - } - - for (long i = 0; i < tlen; i++) { - val[i] = (long)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); - } - *len = tlen; - return GRIB_SUCCESS; -} - -template -static int unpack(grib_accessor* a, T* val, size_t* len) -{ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - long pos = a->offset * 8; - long tlen; - grib_handle* hand = grib_handle_of_accessor(a); - - int 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 = tlen; - return GRIB_ARRAY_TOO_SMALL; - } - - for (long 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; - - pos += idx; - *val = (double)grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, 1); - - return GRIB_SUCCESS; -} -static int unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) -{ - for (size_t i=0; ilength = s; -} - -static size_t string_length(grib_accessor* a) -{ - return a->length; -} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_handle* hand = grib_handle_of_accessor(a); - const size_t l = a->length; - - if (*len < l) { - const char* cclass_name = a->cclass->name; - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, l, *len); - *len = l; - return GRIB_BUFFER_TOO_SMALL; - } - - for (long i = 0; i < a->length; i++) { - val[i] = hand->buffer->data[a->offset + i]; - } - - *len = a->length; - - return GRIB_SUCCESS; -} diff --git a/src/grib_accessor_class_g1_half_byte_codeflag.cc b/src/grib_accessor_class_g1_half_byte_codeflag.cc deleted file mode 100644 index c7d9828e0..000000000 --- a/src/grib_accessor_class_g1_half_byte_codeflag.cc +++ /dev/null @@ -1,147 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init;dump - IMPLEMENTS = get_native_type - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g1_half_byte_codeflag -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in g1_half_byte_codeflag */ -} grib_accessor_g1_half_byte_codeflag; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_g1_half_byte_codeflag = { - &grib_accessor_class_gen, /* super */ - "g1_half_byte_codeflag", /* name */ - sizeof(grib_accessor_g1_half_byte_codeflag), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - 0, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g1_half_byte_codeflag = &_grib_accessor_class_g1_half_byte_codeflag; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len, grib_arguments* arg) -{ - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - if (*len < 1) { - *len = 1; - return GRIB_ARRAY_TOO_SMALL; - } - unsigned char dat = grib_handle_of_accessor(a)->buffer->data[a->offset] & 0x0f; - - *val = dat; - *len = 1; - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - if (*len < 1) { - *len = 1; - return GRIB_ARRAY_TOO_SMALL; - } - - // printf("HALF BYTE pack long %ld %02x\n",*val,grib_handle_of_accessor(a)->buffer->data[a->offset]); - grib_handle_of_accessor(a)->buffer->data[a->offset] = (a->parent->h->buffer->data[a->offset] & 0xf0) | (*val & 0x0f); - // printf("HALF BYTE pack long %ld %02x\n",*val,grib_handle_of_accessor(a)->buffer->data[a->offset]); - - *len = 1; - return GRIB_SUCCESS; -} - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_LONG; -} diff --git a/src/grib_accessor_class_g2step_range.cc b/src/grib_accessor_class_g2step_range.cc deleted file mode 100644 index e1dd9494b..000000000 --- a/src/grib_accessor_class_g2step_range.cc +++ /dev/null @@ -1,375 +0,0 @@ -/* - * (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 "grib_api_internal.h" -#include "step.h" -#include "step_utilities.h" -#include -#include -#include -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = pack_string;unpack_string;value_count - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = unpack_double - IMPLEMENTS = unpack_string;pack_string - IMPLEMENTS = get_native_type;string_length - IMPLEMENTS = init - MEMBERS = const char* start_step - MEMBERS = const char* end_step - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -or edit "accessor.class" and rerun ./make_class.pl - -*/ - -static int get_native_type(grib_accessor*); -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 unpack_double(grib_accessor*, double* 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 size_t string_length(grib_accessor*); -static int value_count(grib_accessor*, long*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_g2step_range -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in g2step_range */ - const char* start_step; - const char* end_step; -} grib_accessor_g2step_range; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_g2step_range = { - &grib_accessor_class_gen, /* super */ - "g2step_range", /* name */ - sizeof(grib_accessor_g2step_range), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* destroy */ - 0, /* dump */ - 0, /* next_offset */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - 0, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - &pack_string, /* pack_string */ - &unpack_string, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_g2step_range = &_grib_accessor_class_g2step_range; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long l, grib_arguments* c) -{ - grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; - - int n = 0; - - self->start_step = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->end_step = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - - a->length = 0; -} - -//static void dump(grib_accessor* a, grib_dumper* dumper) -//{ - //grib_dump_string(dumper, a, NULL); -//} - -static int unpack_string(grib_accessor* a, char* val, size_t* len) -{ - grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; - size_t size = 0; - double start_step_value = 0; - double end_step_value = 0; - long step_units; - - int show_hours = a->context->grib_hourly_steps_with_units; - - if ((ret = grib_get_double_internal(h, self->start_step, &start_step_value)) != GRIB_SUCCESS) - return ret; - if ((ret= grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) - return ret; - try { - if (eccodes::Unit{step_units} == eccodes::Unit{eccodes::Unit::Value::MISSING}) { - if ((ret = grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) - return ret; - } - - char fp_format[128] = "%g"; - size_t fp_format_len = sizeof(fp_format); - if ((ret = grib_get_string_internal(h, "formatForDoubles", fp_format, &fp_format_len)) != GRIB_SUCCESS) - return ret; - std::stringstream ss; - - eccodes::Step start_step{start_step_value, step_units}; - if (self->end_step == NULL) { - ss << start_step.value(fp_format, show_hours); - } - else { - if ((ret = grib_get_double_internal(h, self->end_step, &end_step_value)) != GRIB_SUCCESS) - return ret; - - eccodes::Step end_step{end_step_value, step_units}; - - if (start_step_value == end_step_value) { - ss << end_step.value(fp_format, show_hours); - } - else { - ss << start_step.value(fp_format, show_hours) << "-" << end_step.value(fp_format, show_hours); - } - } - - size = ss.str().size() + 1; - - if (*len < size) - return GRIB_ARRAY_TOO_SMALL; - - *len = size; - - memcpy(val, ss.str().c_str(), size); - } - catch (std::exception& e) { - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_g2step_range::unpack_string: %s", e.what()); - return GRIB_DECODING_ERROR; - } - - return GRIB_SUCCESS; -} - - -// Step range format: [-] -// and can be in different units -// stepRange="X" in instantaneous field is equivalent to set step=X -// stepRange="X" in accumulated field is equivalent to startStep=X, endStep=startStep -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; - - long force_step_units; - if ((ret = grib_get_long_internal(h, "forceStepUnits", &force_step_units)) != GRIB_SUCCESS) - return ret; - - // Note: - // forceStepUnits is a special key that is used to identify the origin of the defined units - // i.e., whether they have been defined by the user. - // If this key is defined (!= 255), it indicates that the stepUnits have been defined by the user. - // Once this key is set, it has the highest priority: it automatically overrides certain units and the default value in stepUnits - - if (h->loader) { // h->loader is set only when rebuilding or reparsing - force_step_units = 255; // See ECC-1768 and ECC-1800 - } - - try { - std::vector steps = parse_range(val, eccodes::Unit{force_step_units}); - if (steps.size() == 0) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Could not parse step range: %s", val); - return GRIB_INVALID_ARGUMENT; - } - - eccodes::Step step_0; - eccodes::Step step_1; - if (eccodes::Unit{force_step_units} == eccodes::Unit{eccodes::Unit::Value::MISSING}) { - if (steps.size() > 1) - std::tie(step_0, step_1) = find_common_units(steps[0].optimize_unit(), steps[1].optimize_unit()); - else - step_0 = steps[0].optimize_unit(); - } - else { - step_0 = eccodes::Step{steps[0].value(eccodes::Unit{force_step_units}), eccodes::Unit{force_step_units}}; - if (steps.size() > 1) { - step_1 = eccodes::Step{steps[1].value(eccodes::Unit{force_step_units}), eccodes::Unit{force_step_units}}; - } - } - - if ((ret = grib_set_long_internal(h, "startStepUnit", step_0.unit().value()))) - return ret; - if ((ret = set_step(h, "forecastTime" , "indicatorOfUnitOfTimeRange", step_0)) != GRIB_SUCCESS) - return ret; - - if (self->end_step != NULL) { - if (steps.size() > 1) { - if ((ret = grib_set_long_internal(h, "endStepUnit", step_1.unit().value()))) - return ret; - if ((ret = grib_set_long_internal(h, self->end_step, step_1.value()))) - return ret; - } else { - if ((ret = grib_set_long_internal(h, "endStepUnit", step_0.unit().value()))) - return ret; - if ((ret = grib_set_long_internal(h, self->end_step, step_0.value()))) - return ret; - } - } - } - catch (std::exception& e) { - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_class_g2step_range::pack_string: %s", e.what()); - return GRIB_INVALID_ARGUMENT; - } - return GRIB_SUCCESS; -} - -static int value_count(grib_accessor* a, long* count) -{ - *count = 1; - return 0; -} - -static size_t string_length(grib_accessor* a) -{ - return 255; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - char buff[100]; - size_t bufflen = 100; - - snprintf(buff, sizeof(buff), "%ld", *val); - return pack_string(a, buff, &bufflen); -} - - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; - long end_start_value = 0; - long end_step_value = 0; - long step_units = 0; - - if ((ret = grib_get_long_internal(h, self->start_step, &end_start_value)) != GRIB_SUCCESS) - return ret; - try { - if ((ret = grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) - throw std::runtime_error("Failed to get stepUnits"); - if (eccodes::Unit{step_units} == eccodes::Unit{eccodes::Unit::Value::MISSING}) { - if ((ret = grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) - return ret; - } - - eccodes::Step start_step{end_start_value, step_units}; - if (self->end_step == NULL) { - *val = start_step.value(); - } - else { - if ((ret = grib_get_long_internal(h, self->end_step, &end_step_value)) != GRIB_SUCCESS) - return ret; - eccodes::Step end_step{end_step_value, step_units}; - *val = end_step.value(); - } - } - catch (std::exception& e) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Failed to unpack step range: %s", e.what()); - return GRIB_DECODING_ERROR; - } - - return GRIB_SUCCESS; -} - - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; - double end_start_value = 0; - double end_step_value = 0; - long step_units = 0; - - if ((ret = grib_get_double_internal(h, self->start_step, &end_start_value)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) - throw std::runtime_error("Failed to get stepUnits"); - - try { - if (eccodes::Unit{step_units} == eccodes::Unit{eccodes::Unit::Value::MISSING}) { - if ((ret = grib_get_long_internal(h, "stepUnits", &step_units)) != GRIB_SUCCESS) - return ret; - } - - eccodes::Step start_step{end_start_value, step_units}; - if (self->end_step == NULL) { - *val = start_step.value(); - } - else { - if ((ret = grib_get_double_internal(h, self->end_step, &end_step_value)) != GRIB_SUCCESS) - return ret; - eccodes::Step end_step{end_step_value, step_units}; - *val = end_step.value(); - } - } - catch (std::exception& e) { - grib_context_log(a->context, GRIB_LOG_ERROR, "grid_accessor_g2step_range::unpack_double: %s", e.what()); - return GRIB_DECODING_ERROR; - } - - return GRIB_SUCCESS; -} - - -static int get_native_type(grib_accessor* a) -{ - return GRIB_TYPE_STRING; -} diff --git a/src/grib_accessor_class_transient_darray.cc b/src/grib_accessor_class_transient_darray.cc deleted file mode 100644 index 51dbc2433..000000000 --- a/src/grib_accessor_class_transient_darray.cc +++ /dev/null @@ -1,216 +0,0 @@ -/* - * (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 "grib_api_internal.h" - -/* - This is used by make_class.pl - - START_CLASS_DEF - CLASS = accessor - SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = unpack_long;pack_long;destroy - IMPLEMENTS = init;dump;value_count - IMPLEMENTS = get_native_type - MEMBERS=grib_darray* arr - MEMBERS=int type; - END_CLASS_DEF - - */ - -/* START_CLASS_IMP */ - -/* - -Don't edit anything between START_CLASS_IMP and END_CLASS_IMP -Instead edit values between START_CLASS_DEF and END_CLASS_DEF -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 pack_long(grib_accessor*, const long* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int value_count(grib_accessor*, long*); -static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*, const long, grib_arguments*); - -typedef struct grib_accessor_transient_darray -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in transient_darray */ - grib_darray* arr; - int type; -} grib_accessor_transient_darray; - -extern grib_accessor_class* grib_accessor_class_gen; - -static grib_accessor_class _grib_accessor_class_transient_darray = { - &grib_accessor_class_gen, /* super */ - "transient_darray", /* name */ - sizeof(grib_accessor_transient_darray), /* size */ - 0, /* inited */ - 0, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* destroy */ - &dump, /* dump */ - 0, /* next_offset */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* pack_missing */ - 0, /* is_missing */ - &pack_long, /* pack_long */ - &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ - 0, /* pack_float */ - &unpack_double, /* unpack_double */ - 0, /* unpack_float */ - 0, /* pack_string */ - 0, /* unpack_string */ - 0, /* pack_string_array */ - 0, /* unpack_string_array */ - 0, /* pack_bytes */ - 0, /* unpack_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 (double) */ - 0, /* unpack only ith value (float) */ - 0, /* unpack a given set of elements (double) */ - 0, /* unpack a given set of elements (float) */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ -}; - - -grib_accessor_class* grib_accessor_class_transient_darray = &_grib_accessor_class_transient_darray; - -/* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long length, grib_arguments* args) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - self->arr = NULL; - self->type = GRIB_TYPE_DOUBLE; - a->length = 0; -} - -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_double(dumper, a, NULL); -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - - if (self->arr) - grib_darray_delete(a->context, self->arr); - self->arr = grib_darray_new(a->context, *len, 10); - - for (size_t i = 0; i < *len; i++) - grib_darray_push(a->context, self->arr, val[i]); - - return GRIB_SUCCESS; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - - if (self->arr) - grib_darray_delete(a->context, self->arr); - self->arr = grib_darray_new(a->context, *len, 10); - - for (size_t i = 0; i < *len; i++) - grib_darray_push(a->context, self->arr, (double)val[i]); - - return GRIB_SUCCESS; -} - -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - long count = 0; - - value_count(a, &count); - - if (*len < count) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s (setting %zu, required %ld)", a->name, *len, count); - *len = count; - return GRIB_ARRAY_TOO_SMALL; - } - - *len = count; - for (size_t i = 0; i < *len; i++) - val[i] = self->arr->v[i]; - - return GRIB_SUCCESS; -} - -static int unpack_long(grib_accessor* a, long* val, size_t* len) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - long count = 0; - - value_count(a, &count); - - if (*len < count) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s (setting %zu, required %ld)", a->name, *len, count); - *len = count; - return GRIB_ARRAY_TOO_SMALL; - } - - *len = count; - for (size_t i = 0; i < *len; i++) - val[i] = (long)self->arr->v[i]; - - return GRIB_SUCCESS; -} - -static void destroy(grib_context* c, grib_accessor* a) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - if (self->arr) - grib_darray_delete(a->context, self->arr); -} - -static int value_count(grib_accessor* a, long* count) -{ - grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - if (self->arr) - *count = grib_darray_used_size(self->arr); - else - *count = 0; - - return 0; -} - -static int get_native_type(grib_accessor* a) -{ - const grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; - return self->type; -} From d397f5867aa17eb9525989edcb07c3c9269cfce9 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 8 May 2024 15:54:40 +0100 Subject: [PATCH 134/196] ECC-1820: Local static functions --- src/accessor/grib_accessor_class_ascii.cc | 63 ++++--- src/accessor/grib_accessor_class_bitmap.cc | 58 +++--- .../grib_accessor_class_bits_per_value.cc | 33 ++-- .../grib_accessor_class_bufr_data_array.cc | 128 ++++++++----- ...grib_accessor_class_bufr_elements_table.cc | 58 +++--- ...ccessor_class_bufr_extract_area_subsets.cc | 31 +-- ...sor_class_bufr_extract_datetime_subsets.cc | 59 +++--- ...rib_accessor_class_bufr_simple_thinning.cc | 18 +- src/accessor/grib_accessor_class_codeflag.cc | 23 ++- src/accessor/grib_accessor_class_codetable.cc | 8 +- src/accessor/grib_accessor_class_concept.cc | 134 +++++++------ .../grib_accessor_class_count_missing.cc | 36 ++-- ...g1second_order_general_extended_packing.cc | 79 ++++---- ...ib_accessor_class_data_g22order_packing.cc | 20 +- ...accessor_class_data_g2bifourier_packing.cc | 21 ++- ...ata_g2simple_packing_with_preprocessing.cc | 21 ++- ...ib_accessor_class_data_jpeg2000_packing.cc | 2 +- .../grib_accessor_class_data_png_packing.cc | 12 +- src/accessor/grib_accessor_class_element.cc | 15 +- ...rib_accessor_class_expanded_descriptors.cc | 30 ++- .../grib_accessor_class_g1forecastmonth.cc | 53 +++--- .../grib_accessor_class_g2_mars_labeling.cc | 59 +++--- .../grib_accessor_class_g2end_step.cc | 176 ++++++++++-------- src/accessor/grib_accessor_class_g2grid.cc | 12 +- .../grib_accessor_class_longitudes.cc | 1 - ...ccessor_class_number_of_points_gaussian.cc | 78 ++++---- ...grib_accessor_class_octahedral_gaussian.cc | 2 +- ...essor_class_second_order_bits_per_value.cc | 2 +- .../grib_accessor_class_smart_table.cc | 6 +- ...grib_accessor_class_step_human_readable.cc | 41 ++-- .../grib_accessor_class_suppressed.cc | 29 +-- 31 files changed, 773 insertions(+), 535 deletions(-) diff --git a/src/accessor/grib_accessor_class_ascii.cc b/src/accessor/grib_accessor_class_ascii.cc index f45053267..b3e9f6a8a 100644 --- a/src/accessor/grib_accessor_class_ascii.cc +++ b/src/accessor/grib_accessor_class_ascii.cc @@ -11,35 +11,40 @@ #include "grib_accessor_class_ascii.h" -grib_accessor_class_ascii_t _grib_accessor_class_ascii{"ascii"}; +grib_accessor_class_ascii_t _grib_accessor_class_ascii{ "ascii" }; grib_accessor_class* grib_accessor_class_ascii = &_grib_accessor_class_ascii; -void grib_accessor_class_ascii_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_ascii_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_gen_t::init(a, len, arg); a->length = len; Assert(a->length >= 0); } -int grib_accessor_class_ascii_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_ascii_t::value_count(grib_accessor* a, long* count) +{ *count = 1; return 0; } -size_t grib_accessor_class_ascii_t::string_length(grib_accessor* a){ +size_t grib_accessor_class_ascii_t::string_length(grib_accessor* a) +{ return a->length; } -void grib_accessor_class_ascii_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_ascii_t::dump(grib_accessor* a, grib_dumper* dumper) +{ grib_dump_string(dumper, a, NULL); } -int grib_accessor_class_ascii_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_ascii_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_STRING; } -int grib_accessor_class_ascii_t::unpack_string(grib_accessor* a, char* val, size_t* len){ - size_t i = 0; +int grib_accessor_class_ascii_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ grib_handle* hand = grib_handle_of_accessor(a); const size_t alen = a->length; @@ -47,30 +52,32 @@ int grib_accessor_class_ascii_t::unpack_string(grib_accessor* a, char* val, size const char* cclass_name = a->cclass->name; grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - cclass_name, a->name, alen+1, *len); + cclass_name, a->name, alen + 1, *len); *len = alen + 1; return GRIB_BUFFER_TOO_SMALL; } + size_t i = 0; for (i = 0; i < alen; i++) val[i] = hand->buffer->data[a->offset + i]; val[i] = 0; - *len = i; + *len = i; return GRIB_SUCCESS; } -int grib_accessor_class_ascii_t::pack_string(grib_accessor* a, const char* val, size_t* len){ - size_t i = 0; +int grib_accessor_class_ascii_t::pack_string(grib_accessor* a, const char* val, size_t* len) +{ grib_handle* hand = grib_handle_of_accessor(a); const size_t alen = a->length; if (len[0] > (alen + 1)) { grib_context_log(a->context, GRIB_LOG_ERROR, - "pack_string: Wrong size (%zu) 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 < alen; i++) { + for (size_t i = 0; i < alen; i++) { if (i < len[0]) hand->buffer->data[a->offset + i] = val[i]; else @@ -80,17 +87,20 @@ int grib_accessor_class_ascii_t::pack_string(grib_accessor* a, const char* val, return GRIB_SUCCESS; } -int grib_accessor_class_ascii_t::pack_long(grib_accessor* a, const long* v, size_t* len){ +int grib_accessor_class_ascii_t::pack_long(grib_accessor* a, const long* v, size_t* len) +{ grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as long (It's a string)", a->name); return GRIB_NOT_IMPLEMENTED; } -int grib_accessor_class_ascii_t::pack_double(grib_accessor* a, const double* v, size_t* len){ +int grib_accessor_class_ascii_t::pack_double(grib_accessor* a, const double* v, size_t* len) +{ grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as double (It's a string)", a->name); return GRIB_NOT_IMPLEMENTED; } -int grib_accessor_class_ascii_t::unpack_long(grib_accessor* a, long* v, size_t* len){ +int grib_accessor_class_ascii_t::unpack_long(grib_accessor* a, long* v, size_t* len) +{ char val[1024] = {0,}; size_t l = sizeof(val); size_t i = 0; @@ -116,12 +126,14 @@ int grib_accessor_class_ascii_t::unpack_long(grib_accessor* a, long* v, size_t* return GRIB_SUCCESS; } -int grib_accessor_class_ascii_t::unpack_double(grib_accessor* a, double* v, size_t* len){ +int grib_accessor_class_ascii_t::unpack_double(grib_accessor* a, double* v, size_t* len) +{ char val[1024]; size_t l = sizeof(val); char* last = NULL; - int err = a->unpack_string(val, &l); if (err) return err; + int err = a->unpack_string(val, &l); + if (err) return err; *v = strtod(val, &last); @@ -135,14 +147,15 @@ int grib_accessor_class_ascii_t::unpack_double(grib_accessor* a, double* v, size return GRIB_NOT_IMPLEMENTED; } -int grib_accessor_class_ascii_t::compare(grib_accessor* a, grib_accessor* b){ +int grib_accessor_class_ascii_t::compare(grib_accessor* a, grib_accessor* b) +{ int retval = 0; char* aval = 0; char* bval = 0; int err = 0; - size_t alen = a->length+1; - size_t blen = b->length+1; + size_t alen = a->length + 1; + size_t blen = b->length + 1; if (alen != blen) return GRIB_COUNT_MISMATCH; @@ -150,8 +163,10 @@ int grib_accessor_class_ascii_t::compare(grib_accessor* a, grib_accessor* b){ aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - err = a->unpack_string(aval, &alen); if (err) return err; - err = b->unpack_string(bval, &blen); if (err) return err; + err = a->unpack_string(aval, &alen); + if (err) return err; + err = b->unpack_string(bval, &blen); + if (err) return err; retval = GRIB_SUCCESS; if (!STR_EQUAL(aval, bval)) diff --git a/src/accessor/grib_accessor_class_bitmap.cc b/src/accessor/grib_accessor_class_bitmap.cc index e507d021b..505871a3a 100644 --- a/src/accessor/grib_accessor_class_bitmap.cc +++ b/src/accessor/grib_accessor_class_bitmap.cc @@ -11,12 +11,11 @@ #include "grib_accessor_class_bitmap.h" -grib_accessor_class_bitmap_t _grib_accessor_class_bitmap{"bitmap"}; +grib_accessor_class_bitmap_t _grib_accessor_class_bitmap{ "bitmap" }; grib_accessor_class* grib_accessor_class_bitmap = &_grib_accessor_class_bitmap; - - -void compute_size(grib_accessor* a){ +static void compute_size(grib_accessor* a) +{ long slen = 0; long off = 0; grib_handle* hand = grib_handle_of_accessor(a); @@ -51,7 +50,8 @@ void compute_size(grib_accessor* a){ Assert(a->length >= 0); } -void grib_accessor_class_bitmap_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_bitmap_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_bytes_t::init(a, len, arg); grib_accessor_bitmap_t* self = (grib_accessor_bitmap_t*)a; grib_handle* hand = grib_handle_of_accessor(a); @@ -65,24 +65,29 @@ void grib_accessor_class_bitmap_t::init(grib_accessor* a, const long len, grib_a compute_size(a); } -long grib_accessor_class_bitmap_t::next_offset(grib_accessor* a){ - return a->byte_offset() + a->byte_count();} +long grib_accessor_class_bitmap_t::next_offset(grib_accessor* a) +{ + return a->byte_offset() + a->byte_count(); +} -void grib_accessor_class_bitmap_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_bitmap_t::dump(grib_accessor* a, grib_dumper* dumper) +{ long len = 0; char label[1024]; a->value_count(&len); - snprintf(label, 1024, "Bitmap of %ld values", len); + snprintf(label, sizeof(label), "Bitmap of %ld values", len); grib_dump_bytes(dumper, a, label); } -int grib_accessor_class_bitmap_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_bitmap_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ long pos = a->offset * 8; long tlen = 0; const grib_handle* hand = grib_handle_of_accessor(a); - int err = a->value_count(&tlen); if (err) + int err = a->value_count(&tlen); + if (err) return err; if (*len < tlen) { @@ -99,13 +104,15 @@ int grib_accessor_class_bitmap_t::unpack_long(grib_accessor* a, long* val, size_ } template -int unpack(grib_accessor* a, T* val, size_t* len){ +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; grib_handle* hand = grib_handle_of_accessor(a); - int err = a->value_count(&tlen); if (err) + int err = a->value_count(&tlen); + if (err) return err; if (*len < tlen) { @@ -121,15 +128,18 @@ int unpack(grib_accessor* a, T* val, size_t* len){ return GRIB_SUCCESS; } -int grib_accessor_class_bitmap_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_bitmap_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_bitmap_t::unpack_float(grib_accessor* a, float* val, size_t* len){ +int grib_accessor_class_bitmap_t::unpack_float(grib_accessor* a, float* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_bitmap_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ +int grib_accessor_class_bitmap_t::unpack_double_element(grib_accessor* a, size_t idx, double* val) +{ long pos = a->offset * 8; pos += idx; @@ -137,24 +147,28 @@ int grib_accessor_class_bitmap_t::unpack_double_element(grib_accessor* a, size_t return GRIB_SUCCESS; } -int grib_accessor_class_bitmap_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ - for (size_t i=0; ilength = s; } -size_t grib_accessor_class_bitmap_t::string_length(grib_accessor* a){ +size_t grib_accessor_class_bitmap_t::string_length(grib_accessor* a) +{ return a->length; } -int grib_accessor_class_bitmap_t::unpack_string(grib_accessor* a, char* val, size_t* len){ +int grib_accessor_class_bitmap_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ grib_handle* hand = grib_handle_of_accessor(a); - const size_t l = a->length; + const size_t l = a->length; if (*len < l) { const char* cclass_name = a->cclass->name; diff --git a/src/accessor/grib_accessor_class_bits_per_value.cc b/src/accessor/grib_accessor_class_bits_per_value.cc index 590c48d89..dbdef54cb 100644 --- a/src/accessor/grib_accessor_class_bits_per_value.cc +++ b/src/accessor/grib_accessor_class_bits_per_value.cc @@ -11,24 +11,27 @@ #include "grib_accessor_class_bits_per_value.h" -grib_accessor_class_bits_per_value_t _grib_accessor_class_bits_per_value{"bits_per_value"}; +grib_accessor_class_bits_per_value_t _grib_accessor_class_bits_per_value{ "bits_per_value" }; grib_accessor_class* grib_accessor_class_bits_per_value = &_grib_accessor_class_bits_per_value; -void grib_accessor_class_bits_per_value_t::init(grib_accessor* a, const long l, grib_arguments* args){ +void grib_accessor_class_bits_per_value_t::init(grib_accessor* a, const long l, grib_arguments* args) +{ grib_accessor_class_long_t::init(a, l, args); - int n = 0; + int n = 0; grib_accessor_bits_per_value_t* self = (grib_accessor_bits_per_value_t*)a; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->length = 0; } -int grib_accessor_class_bits_per_value_t::unpack_long(grib_accessor* a, long* val, size_t* len){ - int ret = 0; +int grib_accessor_class_bits_per_value_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_bits_per_value_t* self = (grib_accessor_bits_per_value_t*)a; - grib_handle* h = grib_handle_of_accessor(a); + + int ret = 0; + grib_handle* h = grib_handle_of_accessor(a); if ((ret = grib_get_long_internal(h, self->bits_per_value, val)) != GRIB_SUCCESS) return ret; @@ -37,13 +40,15 @@ int grib_accessor_class_bits_per_value_t::unpack_long(grib_accessor* a, long* va return ret; } -int grib_accessor_class_bits_per_value_t::pack_long(grib_accessor* a, const long* val, size_t* len){ - double* values = NULL; - size_t size = 0; - int ret = 0; +int grib_accessor_class_bits_per_value_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_bits_per_value_t* self = (grib_accessor_bits_per_value_t*)a; - grib_context* c = a->context; - grib_handle* h = grib_handle_of_accessor(a); + + double* values = NULL; + size_t size = 0; + int ret = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) return ret; diff --git a/src/accessor/grib_accessor_class_bufr_data_array.cc b/src/accessor/grib_accessor_class_bufr_data_array.cc index 14f13d966..e0c998950 100644 --- a/src/accessor/grib_accessor_class_bufr_data_array.cc +++ b/src/accessor/grib_accessor_class_bufr_data_array.cc @@ -34,28 +34,32 @@ grib_accessor_class* grib_accessor_class_bufr_data_array = &_grib_accessor_class return retval; \ } -int process_elements(grib_accessor* a, int flag, long onlySubset, long startSubset, long endSubset); +static int process_elements(grib_accessor* a, int flag, long onlySubset, long startSubset, long endSubset); typedef int (*codec_element_proc)(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* b, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex, grib_darray* dval, grib_sarray* sval); typedef int (*codec_replication_proc)(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions); +static int create_keys(const grib_accessor* a, long onlySubset, long startSubset, long endSubset); -int create_keys(const grib_accessor* a, long onlySubset, long startSubset, long endSubset); -void restart_bitmap(grib_accessor_bufr_data_array_t* self){ +static void restart_bitmap(grib_accessor_bufr_data_array_t* self) +{ self->bitmapCurrent = -1; self->bitmapCurrentElementsDescriptorsIndex = self->bitmapStartElementsDescriptorsIndex - 1; } -void cancel_bitmap(grib_accessor_bufr_data_array_t* self){ +static void cancel_bitmap(grib_accessor_bufr_data_array_t* self) +{ self->bitmapCurrent = -1; self->bitmapStart = -1; } -int is_bitmap_start_defined(grib_accessor_bufr_data_array_t* self){ +static int is_bitmap_start_defined(grib_accessor_bufr_data_array_t* self) +{ return self->bitmapStart == -1 ? 0 : 1; } -size_t get_length(grib_accessor* a){ +size_t get_length(grib_accessor* a) +{ grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; - size_t len = 0; + size_t len = 0; const grib_handle* h = grib_handle_of_accessor(a); @@ -65,7 +69,8 @@ size_t get_length(grib_accessor* a){ } /* Operator 203YYY: Store the TableB code and changed reference value in linked list */ -void tableB_override_store_ref_val(grib_context* c, grib_accessor_bufr_data_array_t* self, int code, long new_ref_val){ +static void tableB_override_store_ref_val(grib_context* c, grib_accessor_bufr_data_array_t* self, int code, long new_ref_val) +{ bufr_tableb_override* tb = (bufr_tableb_override*)grib_context_malloc_clear(c, sizeof(bufr_tableb_override)); tb->code = code; tb->new_ref_val = new_ref_val; @@ -82,7 +87,8 @@ void tableB_override_store_ref_val(grib_context* c, grib_accessor_bufr_data_arra } /* Operator 203YYY: Retrieve changed reference value from linked list */ -int tableB_override_get_ref_val(grib_accessor_bufr_data_array_t* self, int code, long* out_ref_val){ +static int tableB_override_get_ref_val(grib_accessor_bufr_data_array_t* self, int code, long* out_ref_val) +{ bufr_tableb_override* p = self->tableb_override; while (p) { if (p->code == code) { @@ -95,7 +101,8 @@ int tableB_override_get_ref_val(grib_accessor_bufr_data_array_t* self, int code, } /* Operator 203YYY: Clear and free linked list */ -void tableB_override_clear(grib_context* c, grib_accessor_bufr_data_array_t* self){ +void tableB_override_clear(grib_context* c, grib_accessor_bufr_data_array_t* self) +{ bufr_tableb_override* tb = self->tableb_override; while (tb) { bufr_tableb_override* n = tb->next; @@ -106,7 +113,8 @@ void tableB_override_clear(grib_context* c, grib_accessor_bufr_data_array_t* sel } /* Operator 203YYY: Copy contents of linked list to the transient array key */ -int tableB_override_set_key(grib_handle* h, grib_accessor_bufr_data_array_t* self){ +int tableB_override_set_key(grib_handle* h, grib_accessor_bufr_data_array_t* self) +{ int err = GRIB_SUCCESS; size_t size = 0; long* refVals = NULL; @@ -126,7 +134,8 @@ int tableB_override_set_key(grib_handle* h, grib_accessor_bufr_data_array_t* sel return err; } /* Check numBits is sufficient for entries in the overridden reference values list*/ -int check_overridden_reference_values(const grib_context* c, long* refValList, size_t refValListSize, int numBits){ +static int check_overridden_reference_values(const grib_context* c, long* refValList, size_t refValListSize, int numBits) +{ const long maxval = (1 << (numBits - 1)) - 1; const long minval = -(1 << (numBits - 1)); size_t i = 0; @@ -205,7 +214,8 @@ void grib_accessor_class_bufr_data_array_t::init(grib_accessor* a, const long v, // } // } -int check_end_data(grib_context* c, bufr_descriptor* bd, grib_accessor_bufr_data_array_t* self, int size){ +static int check_end_data(grib_context* c, bufr_descriptor* bd, grib_accessor_bufr_data_array_t* self, int size) +{ const int saved_bitsToEndData = self->bitsToEndData; if (c->debug == 1) grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \tbitsToEndData=%d elementSize=%d", self->bitsToEndData, size); @@ -302,7 +312,8 @@ void accessor_bufr_data_array_set_unpackMode(grib_accessor* a, int unpackMode) self->unpackMode = unpackMode; } -int get_descriptors(grib_accessor* a){ +static int get_descriptors(grib_accessor* a) +{ grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; int ret = 0, i, numberOfDescriptors; grib_handle* h = grib_handle_of_accessor(a); @@ -328,7 +339,7 @@ int get_descriptors(grib_accessor* a){ return ret; } -int decode_string_array(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, +static int decode_string_array(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, grib_accessor_bufr_data_array_t* self) { int ret = 0; @@ -469,7 +480,7 @@ grib_darray* decode_double_array(grib_context* c, unsigned char* data, long* pos return ret; } -int encode_string_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, +static int encode_string_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, grib_accessor_bufr_data_array_t* self, grib_sarray* stringValues) { int err = 0, n, ival; @@ -535,7 +546,7 @@ void set_missing_long_to_double(grib_darray* dvalues){ } /* ECC-750: The 'factor' argument is 10^-scale */ -int descriptor_get_min_max(bufr_descriptor* bd, long width, long reference, double factor, +static int descriptor_get_min_max(bufr_descriptor* bd, long width, long reference, double factor, double* minAllowed, double* maxAllowed) { /* Maximum value is allowed to be the largest number (all bits 1) which means it's MISSING */ @@ -551,7 +562,7 @@ int descriptor_get_min_max(bufr_descriptor* bd, long width, long reference, doub return GRIB_SUCCESS; } -int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, +static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, grib_accessor_bufr_data_array_t* self, grib_darray* dvalues) { int err = 0; @@ -769,7 +780,7 @@ int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bufr_desc return err; } -int encode_double_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, +static int encode_double_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, grib_accessor_bufr_data_array_t* self, double value) { size_t lval; @@ -816,7 +827,7 @@ int encode_double_value(grib_context* c, grib_buffer* buff, long* pos, bufr_desc return err; } -int encode_string_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, +static int encode_string_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, grib_accessor_bufr_data_array_t* self, char* sval) { int err = 0; @@ -832,7 +843,7 @@ int encode_string_value(grib_context* c, grib_buffer* buff, long* pos, bufr_desc return err; } -char* decode_string_value(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, +static char* decode_string_value(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, grib_accessor_bufr_data_array_t* self, int* err) { char* sval = 0; @@ -855,7 +866,7 @@ char* decode_string_value(grib_context* c, unsigned char* data, long* pos, bufr_ return sval; } -double decode_double_value(grib_context* c, unsigned char* data, long* pos, +static double decode_double_value(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, int canBeMissing, grib_accessor_bufr_data_array_t* self, int* err) { @@ -886,7 +897,7 @@ double decode_double_value(grib_context* c, unsigned char* data, long* pos, return dval; } -int decode_element(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, +static int decode_element(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* b, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex, grib_darray* dval, grib_sarray* sval) { @@ -968,7 +979,7 @@ int decode_element(grib_context* c, grib_accessor_bufr_data_array_t* self, int s return err; } -int decode_replication(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, +static int decode_replication(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions) { int ret = 0; @@ -1033,7 +1044,8 @@ int decode_replication(grib_context* c, grib_accessor_bufr_data_array_t* self, i return ret; } -int encode_new_bitmap(grib_context* c, grib_buffer* buff, long* pos, int idx, grib_accessor_bufr_data_array_t* self){ +static int encode_new_bitmap(grib_context* c, grib_buffer* buff, long* pos, int idx, grib_accessor_bufr_data_array_t* self) +{ grib_darray* doubleValues = NULL; int err = 0; double cdval = 0; @@ -1055,7 +1067,7 @@ int encode_new_bitmap(grib_context* c, grib_buffer* buff, long* pos, int idx, gr } /* Operator 203YYY: Change Reference Values: Encoding definition phase */ -int encode_overridden_reference_value(grib_context* c, grib_accessor_bufr_data_array_t* self, +static int encode_overridden_reference_value(grib_context* c, grib_accessor_bufr_data_array_t* self, grib_buffer* buff, long* pos, bufr_descriptor* bd) { int err = 0; @@ -1094,7 +1106,7 @@ int encode_overridden_reference_value(grib_context* c, grib_accessor_bufr_data_a return err; } -int encode_new_element(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, +static int encode_new_element(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex, grib_darray* dval, grib_sarray* sval) { @@ -1154,7 +1166,7 @@ int encode_new_element(grib_context* c, grib_accessor_bufr_data_array_t* self, i return err; } -int encode_new_replication(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, +static int encode_new_replication(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions) { int err = 0; @@ -1217,7 +1229,7 @@ int encode_new_replication(grib_context* c, grib_accessor_bufr_data_array_t* sel return err; } -int encode_element(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, +static int encode_element(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex, grib_darray* dval, grib_sarray* sval) { @@ -1288,7 +1300,7 @@ int encode_element(grib_context* c, grib_accessor_bufr_data_array_t* self, int s return err; } -int encode_replication(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, +static int encode_replication(grib_context* c, grib_accessor_bufr_data_array_t* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions) { @@ -1304,7 +1316,7 @@ int encode_replication(grib_context* c, grib_accessor_bufr_data_array_t* self, i return encode_element(c, self, subsetIndex, buff, data, pos, i, 0, elementIndex, dval, 0); } -int build_bitmap(grib_accessor_bufr_data_array_t* self, unsigned char* data, long* pos, +static int build_bitmap(grib_accessor_bufr_data_array_t* self, unsigned char* data, long* pos, int iel, grib_iarray* elementsDescriptorsIndex, int iBitmapOperator) { int bitmapSize = 0, iDelayedReplication = 0; @@ -1402,7 +1414,8 @@ int build_bitmap(grib_accessor_bufr_data_array_t* self, unsigned char* data, lon return GRIB_SUCCESS; } -int consume_bitmap(grib_accessor_bufr_data_array_t* self, int iBitmapOperator){ +static int consume_bitmap(grib_accessor_bufr_data_array_t* self, int iBitmapOperator) +{ int bitmapSize = 0, iDelayedReplication; int i; bufr_descriptor** descriptors = self->expanded->v; @@ -1432,7 +1445,7 @@ int consume_bitmap(grib_accessor_bufr_data_array_t* self, int iBitmapOperator){ return GRIB_SUCCESS; } -int build_bitmap_new_data(grib_accessor_bufr_data_array_t* self, unsigned char* data, long* pos, +static int build_bitmap_new_data(grib_accessor_bufr_data_array_t* self, unsigned char* data, long* pos, int iel, grib_iarray* elementsDescriptorsIndex, int iBitmapOperator) { int bitmapSize = 0, iDelayedReplication = 0; @@ -1519,7 +1532,8 @@ int build_bitmap_new_data(grib_accessor_bufr_data_array_t* self, unsigned char* } /* ECC-1304: Will return an index if successful. In case of an error, a negative number is returned e.g. GRIB_WRONG_BITMAP_SIZE */ -int get_next_bitmap_descriptor_index_new_bitmap(grib_accessor_bufr_data_array_t* self, grib_iarray* elementsDescriptorsIndex, int compressedData){ +static int get_next_bitmap_descriptor_index_new_bitmap(grib_accessor_bufr_data_array_t* self, grib_iarray* elementsDescriptorsIndex, int compressedData) +{ int i; bufr_descriptor** descriptors = self->expanded->v; @@ -1556,7 +1570,8 @@ int get_next_bitmap_descriptor_index_new_bitmap(grib_accessor_bufr_data_array_t* } /* ECC-1304: Will return an index if successful. In case of an error, a negative number is returned e.g. GRIB_WRONG_BITMAP_SIZE */ -int get_next_bitmap_descriptor_index(grib_accessor_bufr_data_array_t* self, grib_iarray* elementsDescriptorsIndex, grib_darray* numericValues){ +static int get_next_bitmap_descriptor_index(grib_accessor_bufr_data_array_t* self, grib_iarray* elementsDescriptorsIndex, grib_darray* numericValues) +{ int i; bufr_descriptor** descriptors = self->expanded->v; @@ -1597,7 +1612,8 @@ int get_next_bitmap_descriptor_index(grib_accessor_bufr_data_array_t* self, grib return elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]; } -void push_zero_element(grib_accessor_bufr_data_array_t* self, grib_darray* dval){ +static void push_zero_element(grib_accessor_bufr_data_array_t* self, grib_darray* dval) +{ grib_darray* d = 0; grib_accessor* a = (grib_accessor*)self; grib_context* c = a->context; @@ -1611,7 +1627,7 @@ void push_zero_element(grib_accessor_bufr_data_array_t* self, grib_darray* dval) } } -grib_accessor* create_attribute_variable(const char* name, grib_section* section, int type, char* sval, double dval, long lval, unsigned long flags) +static grib_accessor* create_attribute_variable(const char* name, grib_section* section, int type, char* sval, double dval, long lval, unsigned long flags) { grib_accessor* a = NULL; grib_action creator = {0,}; @@ -1644,7 +1660,8 @@ grib_accessor* create_attribute_variable(const char* name, grib_section* section return a; } -void set_creator_name(grib_action* creator, int code){ +static void set_creator_name(grib_action* creator, int code) +{ switch (code) { case 222000: creator->name = (char*)"qualityInformationFollows"; @@ -1716,7 +1733,8 @@ void set_creator_name(grib_action* creator, int code){ } /* See ECC-741 */ -int adding_extra_key_attributes(grib_handle* h){ +static int adding_extra_key_attributes(grib_handle* h) +{ long skip = 0; /* default is to add */ int err = 0; err = grib_get_long(h, "skipExtraKeyAttributes", &skip); @@ -1725,7 +1743,7 @@ int adding_extra_key_attributes(grib_handle* h){ return (!skip); } -grib_accessor* create_accessor_from_descriptor(const grib_accessor* a, grib_accessor* attribute, grib_section* section, +static grib_accessor* create_accessor_from_descriptor(const grib_accessor* a, grib_accessor* attribute, grib_section* section, long ide, long subset, int add_dump_flag, int add_coord_flag, int count, int add_extra_attributes) { @@ -1978,7 +1996,8 @@ static grib_accessor* get_element_from_bitmap(const grib_accessor* a, bitmap_s* // significanceQualifierGroup[i]=0; // } -void grib_convert_to_attribute(grib_accessor* a){ +static void grib_convert_to_attribute(grib_accessor* a) +{ if (a->h == NULL && a->parent != NULL) { a->h = grib_handle_of_accessor(a); a->parent = NULL; @@ -2025,7 +2044,8 @@ static grib_iarray* set_subset_list( return list; } -int bitmap_ref_skip(grib_accessors_list* al, int* err){ +static int bitmap_ref_skip(grib_accessors_list* al, int* err) +{ grib_accessor* acode = NULL; long code[1]; size_t l = 1; @@ -2057,7 +2077,8 @@ int bitmap_ref_skip(grib_accessors_list* al, int* err){ } /* Return 1 if the descriptor is an operator marking the start of a bitmap */ -int is_bitmap_start_descriptor(grib_accessors_list* al, int* err){ +static int is_bitmap_start_descriptor(grib_accessors_list* al, int* err) +{ grib_accessor* acode = NULL; long code[1]; size_t l = 1; @@ -2089,7 +2110,8 @@ int is_bitmap_start_descriptor(grib_accessors_list* al, int* err){ return 0; } -void print_bitmap_debug_info(grib_context* c, bitmap_s* bitmap, grib_accessors_list* bitmapStart, int bitmapSize){ +static void print_bitmap_debug_info(grib_context* c, bitmap_s* bitmap, grib_accessors_list* bitmapStart, int bitmapSize) +{ int i = 0, ret = 0; fprintf(stderr, "ECCODES DEBUG: bitmap_init: bitmapSize=%d\n", bitmapSize); bitmap->cursor = bitmapStart->next_; @@ -2180,11 +2202,13 @@ static grib_accessor* accessor_or_attribute_with_same_name(grib_accessor* a, con // return *r; // } -int grib_data_accessors_trie_push(grib_trie_with_rank* accessorsTrie, grib_accessor* a){ +int grib_data_accessors_trie_push(grib_trie_with_rank* accessorsTrie, grib_accessor* a) +{ return grib_trie_with_rank_insert(accessorsTrie, a->name, a); } -int create_keys(const grib_accessor* a, long onlySubset, long startSubset, long endSubset){ +static int create_keys(const grib_accessor* a, long onlySubset, long startSubset, long endSubset) +{ grib_accessor_bufr_data_array_t* self = (grib_accessor_bufr_data_array_t*)a; int err = 0; int rank; @@ -2509,7 +2533,8 @@ int create_keys(const grib_accessor* a, long onlySubset, long startSubset, long return err; } -void set_input_replications(grib_handle* h, grib_accessor_bufr_data_array_t* self){ +static void set_input_replications(grib_handle* h, grib_accessor_bufr_data_array_t* self) +{ size_t nInputReplications; size_t nInputExtendedReplications; size_t nInputShortReplications; @@ -2554,7 +2579,8 @@ void set_input_replications(grib_handle* h, grib_accessor_bufr_data_array_t* sel } } -void set_input_bitmap(grib_handle* h, grib_accessor_bufr_data_array_t* self){ +static void set_input_bitmap(grib_handle* h, grib_accessor_bufr_data_array_t* self) +{ size_t nInputBitmap; self->nInputBitmap = -1; self->iInputBitmap = 0; @@ -2571,7 +2597,8 @@ void set_input_bitmap(grib_handle* h, grib_accessor_bufr_data_array_t* self){ } } -int set_to_missing_if_out_of_range(grib_handle* h){ +static int set_to_missing_if_out_of_range(grib_handle* h) +{ /* First check if the transient key is set */ long setToMissingIfOutOfRange = 0; if (grib_get_long(h, "setToMissingIfOutOfRange", &setToMissingIfOutOfRange) == GRIB_SUCCESS && @@ -2582,7 +2609,8 @@ int set_to_missing_if_out_of_range(grib_handle* h){ return h->context->bufr_set_to_missing_if_out_of_range; } -int process_elements(grib_accessor* a, int flag, long onlySubset, long startSubset, long endSubset){ +static int process_elements(grib_accessor* a, int flag, long onlySubset, long startSubset, long endSubset) +{ int err = 0; long inr, innr, ir, ip; long n[MAX_NESTED_REPLICATIONS] = {0,}; diff --git a/src/accessor/grib_accessor_class_bufr_elements_table.cc b/src/accessor/grib_accessor_class_bufr_elements_table.cc index 42e7a1324..ddd055544 100644 --- a/src/accessor/grib_accessor_class_bufr_elements_table.cc +++ b/src/accessor/grib_accessor_class_bufr_elements_table.cc @@ -41,13 +41,14 @@ void thread_init() #endif -grib_accessor_class_bufr_elements_table_t _grib_accessor_class_bufr_elements_table{"bufr_elements_table"}; +grib_accessor_class_bufr_elements_table_t _grib_accessor_class_bufr_elements_table{ "bufr_elements_table" }; grib_accessor_class* grib_accessor_class_bufr_elements_table = &_grib_accessor_class_bufr_elements_table; -void grib_accessor_class_bufr_elements_table_t::init(grib_accessor* a, const long len, grib_arguments* params){ +void grib_accessor_class_bufr_elements_table_t::init(grib_accessor* a, const long len, grib_arguments* params) +{ grib_accessor_class_gen_t::init(a, len, params); - int n = 0; + int n = 0; grib_accessor_bufr_elements_table_t* self = (grib_accessor_bufr_elements_table_t*)a; self->dictionary = grib_arguments_get_string(grib_handle_of_accessor(a), params, n++); @@ -68,7 +69,9 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) char localDir[1024] = {0,}; char dictName[1024] = {0,}; char masterRecomposed[1024] = {0,}; /*e.g. bufr/tables/0/wmo/36/element.table */ - char localRecomposed[1024] = {0,}; /*e.g. bufr/tables/0/local/0/98/0/element.table */ + char localRecomposed[1024] = { + 0, + }; /*e.g. bufr/tables/0/local/0/98/0/element.table */ char* localFilename = 0; char** list = 0; char** cached_list = 0; @@ -113,9 +116,9 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) if (!filename) { grib_context_log(c, GRIB_LOG_ERROR, "Unable to find definition file %s", self->dictionary); - if (strlen(masterRecomposed) > 0) grib_context_log(c, GRIB_LOG_DEBUG,"master path=%s", masterRecomposed); + if (strlen(masterRecomposed) > 0) grib_context_log(c, GRIB_LOG_DEBUG, "master path=%s", masterRecomposed); if (strlen(localRecomposed) > 0) grib_context_log(c, GRIB_LOG_DEBUG, "local path=%s", localRecomposed); - *err = GRIB_FILE_NOT_FOUND; + *err = GRIB_FILE_NOT_FOUND; dictionary = NULL; goto the_end; } @@ -139,7 +142,7 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) dictionary = grib_trie_new(c); while (fgets(line, sizeof(line) - 1, f)) { - DEBUG_ASSERT( strlen(line) > 0 ); + DEBUG_ASSERT(strlen(line) > 0); if (line[0] == '#') continue; /* Ignore first line with column titles */ list = string_split(line, "|"); grib_trie_insert(dictionary, list[0], list); @@ -156,14 +159,15 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) } while (fgets(line, sizeof(line) - 1, f)) { - DEBUG_ASSERT( strlen(line) > 0 ); - if (line[0] == '#') continue; /* Ignore first line with column titles */ + DEBUG_ASSERT(strlen(line) > 0); + if (line[0] == '#') continue; /* Ignore first line with column titles */ list = string_split(line, "|"); /* Look for the descriptor code in the trie. It might be there from before */ cached_list = (char**)grib_trie_get(dictionary, list[0]); if (cached_list) { /* If found, we are about to overwrite it. So free memory */ int i; - for (i = 0; cached_list[i] != NULL; ++i) free(cached_list[i]); + for (i = 0; cached_list[i] != NULL; ++i) + free(cached_list[i]); free(cached_list); } grib_trie_insert(dictionary, list[0], list); @@ -178,7 +182,8 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) return dictionary; } -int convert_type(const char* stype){ +static int convert_type(const char* stype) +{ int ret = BUFR_DESCRIPTOR_TYPE_UNKNOWN; switch (stype[0]) { case 's': @@ -208,16 +213,18 @@ int convert_type(const char* stype){ return ret; } -long atol_fast(const char* input){ +long atol_fast(const char* input) +{ if (strcmp(input, "0") == 0) return 0; return atol(input); } -int bufr_get_from_table(grib_accessor* a, bufr_descriptor* v){ - int ret = 0; - char** list = 0; - char code[7] = { 0 }; +int bufr_get_from_table(grib_accessor* a, bufr_descriptor* v) +{ + int ret = 0; + char** list = 0; + char code[7] = { 0 }; const size_t codeLen = sizeof(code); grib_trie* table = load_bufr_elements_table(a, &ret); @@ -235,8 +242,8 @@ int bufr_get_from_table(grib_accessor* a, bufr_descriptor* v){ /* ECC-1137: check descriptor key name and unit lengths */ const size_t maxlen_shortName = sizeof(v->shortName); const size_t maxlen_units = sizeof(v->units); - Assert( strlen(list[1]) < maxlen_shortName ); - Assert( strlen(list[4]) < maxlen_units ); + Assert(strlen(list[1]) < maxlen_shortName); + Assert(strlen(list[4]) < maxlen_units); } #endif @@ -310,23 +317,28 @@ bufr_descriptor* accessor_bufr_elements_table_get_descriptor(grib_accessor* a, i return v; } -int grib_accessor_class_bufr_elements_table_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ +int grib_accessor_class_bufr_elements_table_t::unpack_string(grib_accessor* a, char* buffer, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } -int grib_accessor_class_bufr_elements_table_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_bufr_elements_table_t::value_count(grib_accessor* a, long* count) +{ *count = 1; return 0; } -int grib_accessor_class_bufr_elements_table_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_bufr_elements_table_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_STRING; } -int grib_accessor_class_bufr_elements_table_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_bufr_elements_table_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } -int grib_accessor_class_bufr_elements_table_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_bufr_elements_table_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } diff --git a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc index 9a2310635..91a34c72c 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc +++ b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.cc @@ -11,15 +11,16 @@ #include "grib_accessor_class_bufr_extract_area_subsets.h" -grib_accessor_class_bufr_extract_area_subsets_t _grib_accessor_class_bufr_extract_area_subsets{"bufr_extract_area_subsets"}; +grib_accessor_class_bufr_extract_area_subsets_t _grib_accessor_class_bufr_extract_area_subsets{ "bufr_extract_area_subsets" }; grib_accessor_class* grib_accessor_class_bufr_extract_area_subsets = &_grib_accessor_class_bufr_extract_area_subsets; -void grib_accessor_class_bufr_extract_area_subsets_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_bufr_extract_area_subsets_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_bufr_extract_area_subsets_t* self = (grib_accessor_bufr_extract_area_subsets_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - int n = 0; + grib_handle* h = grib_handle_of_accessor(a); + int n = 0; a->length = 0; self->doExtractSubsets = grib_arguments_get_name(h, arg, n++); @@ -36,23 +37,26 @@ void grib_accessor_class_bufr_extract_area_subsets_t::init(grib_accessor* a, con a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; } -int grib_accessor_class_bufr_extract_area_subsets_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_bufr_extract_area_subsets_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_LONG; } /* Copy first element of array into all others */ -void fill_in(double a[], long length){ +static void fill_in(double a[], long length) +{ long i; for (i = 1; i < length; ++i) a[i] = a[0]; } -int select_area(grib_accessor* a){ +static int select_area(grib_accessor* a) +{ grib_accessor_bufr_extract_area_subsets_t* self = (grib_accessor_bufr_extract_area_subsets_t*)a; - int ret = 0; + int ret = 0; long compressed = 0; - grib_handle* h = grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); grib_context* c = h->context; double* lat = NULL; @@ -61,8 +65,8 @@ int select_area(grib_accessor* a){ double lonWest, lonEast, latNorth, latSouth; long numberOfSubsets, i, latRank, lonRank; grib_iarray* subsets = NULL; - size_t nsubsets = 0; - char latstr[32] = {0,}; + size_t nsubsets = 0; + char latstr[32] = {0,}; char lonstr[32] = {0,}; ret = grib_get_long(h, "compressedData", &compressed); @@ -160,7 +164,7 @@ int select_area(grib_accessor* a){ if (nsubsets != 0) { long* subsets_ar = grib_iarray_get_array(subsets); - ret = grib_set_long_array(h, self->extractSubsetList, subsets_ar, nsubsets); + ret = grib_set_long_array(h, self->extractSubsetList, subsets_ar, nsubsets); grib_context_free(c, subsets_ar); if (ret) return ret; @@ -176,7 +180,8 @@ int select_area(grib_accessor* a){ return ret; } -int grib_accessor_class_bufr_extract_area_subsets_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_bufr_extract_area_subsets_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ /*grib_accessor_bufr_extract_area_subsets_t *self =(grib_accessor_bufr_extract_area_subsets_t*)a;*/ if (*len == 0) diff --git a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc index 368f49f0c..d47652984 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc +++ b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.cc @@ -11,13 +11,14 @@ #include "grib_accessor_class_bufr_extract_datetime_subsets.h" -grib_accessor_class_bufr_extract_datetime_subsets_t _grib_accessor_class_bufr_extract_datetime_subsets{"bufr_extract_datetime_subsets"}; +grib_accessor_class_bufr_extract_datetime_subsets_t _grib_accessor_class_bufr_extract_datetime_subsets{ "bufr_extract_datetime_subsets" }; grib_accessor_class* grib_accessor_class_bufr_extract_datetime_subsets = &_grib_accessor_class_bufr_extract_datetime_subsets; -void grib_accessor_class_bufr_extract_datetime_subsets_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_bufr_extract_datetime_subsets_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_gen_t::init(a, len, arg); - int n = 0; + int n = 0; grib_accessor_bufr_extract_datetime_subsets_t* self = (grib_accessor_bufr_extract_datetime_subsets_t*)a; a->length = 0; @@ -28,12 +29,14 @@ void grib_accessor_class_bufr_extract_datetime_subsets_t::init(grib_accessor* a, a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; } -int grib_accessor_class_bufr_extract_datetime_subsets_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_bufr_extract_datetime_subsets_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_LONG; } /* Convert input date to Julian number. If date is invalid, return -1 */ -double date_to_julian(long year, long month, long day, long hour, long minute, double second){ +double date_to_julian(long year, long month, long day, long hour, long minute, double second) +{ double result = 0; /* Julian number in units of days */ /* For validating the date/time, we specify seconds as an integer */ @@ -85,7 +88,9 @@ static int build_long_array(grib_context* c, grib_handle* h, int compressed, } else { /* uncompressed */ - char keystr[32] = {0,}; + char keystr[32] = { + 0, + }; size_t values_len = 0; for (i = 0; i < numberOfSubsets; ++i) { long lVal = 0; @@ -104,15 +109,24 @@ static int build_long_array(grib_context* c, grib_handle* h, int compressed, return err; } -int select_datetime(grib_accessor* a){ - int ret = 0; - long compressed = 0; +static int select_datetime(grib_accessor* a) +{ + int ret = 0; + long compressed = 0; grib_accessor_bufr_extract_datetime_subsets_t* self = (grib_accessor_bufr_extract_datetime_subsets_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - grib_context* c = h->context; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; size_t n; double julianStart = 0, julianEnd = 0, julianDT = 0; - char start_str[80] = {0,}, end_str[80] = {0,}, datetime_str[80] = {0,}; + char start_str[80] = { + 0, + }, + end_str[80] = { + 0, + }, + datetime_str[80] = { + 0, + }; long yearRank, monthRank, dayRank, hourRank, minuteRank, secondRank; long yearStart, monthStart, dayStart, hourStart, minuteStart, secondStart; long yearEnd, monthEnd, dayEnd, hourEnd, minuteEnd, secondEnd; @@ -120,13 +134,13 @@ int select_datetime(grib_accessor* a){ double* second = NULL; long numberOfSubsets, i; grib_iarray* subsets = NULL; - size_t nsubsets = 0; - char yearstr[32] = "year"; - char monthstr[32] = "month"; - char daystr[32] = "day"; - char hourstr[32] = "hour"; - char minutestr[32] = "minute"; - char secondstr[32] = "second"; + size_t nsubsets = 0; + char yearstr[32] = "year"; + char monthstr[32] = "month"; + char daystr[32] = "day"; + char hourstr[32] = "hour"; + char minutestr[32] = "minute"; + char secondstr[32] = "second"; ret = grib_get_long(h, "compressedData", &compressed); if (ret) return ret; @@ -265,7 +279,7 @@ int select_datetime(grib_accessor* a){ if (ret) secondEnd = 0; snprintf(end_str, sizeof(end_str), "%04ld/%02ld/%02ld %02ld:%02ld:%02ld", - yearEnd, monthEnd, dayEnd, hourEnd, minuteEnd, secondEnd); + yearEnd, monthEnd, dayEnd, hourEnd, minuteEnd, secondEnd); if (c->debug) fprintf(stderr, "ECCODES DEBUG bufr_extract_datetime_subsets: end =%s\n", end_str); julianEnd = date_to_julian(yearEnd, monthEnd, dayEnd, hourEnd, minuteEnd, secondEnd); if (julianEnd == -1) { @@ -311,7 +325,7 @@ int select_datetime(grib_accessor* a){ if (nsubsets != 0) { long* subsets_ar = grib_iarray_get_array(subsets); - ret = grib_set_long_array(h, self->extractSubsetList, subsets_ar, nsubsets); + ret = grib_set_long_array(h, self->extractSubsetList, subsets_ar, nsubsets); grib_context_free(c, subsets_ar); if (ret) return ret; @@ -332,7 +346,8 @@ int select_datetime(grib_accessor* a){ return ret; } -int grib_accessor_class_bufr_extract_datetime_subsets_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_bufr_extract_datetime_subsets_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ /*grib_accessor_bufr_extract_datetime_subsets_t *self =(grib_accessor_bufr_extract_datetime_subsets_t*)a;*/ if (*len == 0) diff --git a/src/accessor/grib_accessor_class_bufr_simple_thinning.cc b/src/accessor/grib_accessor_class_bufr_simple_thinning.cc index 2c66d4585..a74d7a74c 100644 --- a/src/accessor/grib_accessor_class_bufr_simple_thinning.cc +++ b/src/accessor/grib_accessor_class_bufr_simple_thinning.cc @@ -11,15 +11,16 @@ #include "grib_accessor_class_bufr_simple_thinning.h" -grib_accessor_class_bufr_simple_thinning_t _grib_accessor_class_bufr_simple_thinning{"bufr_simple_thinning"}; +grib_accessor_class_bufr_simple_thinning_t _grib_accessor_class_bufr_simple_thinning{ "bufr_simple_thinning" }; grib_accessor_class* grib_accessor_class_bufr_simple_thinning = &_grib_accessor_class_bufr_simple_thinning; -void grib_accessor_class_bufr_simple_thinning_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_bufr_simple_thinning_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_bufr_simple_thinning_t* self = (grib_accessor_bufr_simple_thinning_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - int n = 0; + grib_handle* h = grib_handle_of_accessor(a); + int n = 0; a->length = 0; self->doExtractSubsets = grib_arguments_get_name(h, arg, n++); @@ -32,11 +33,13 @@ void grib_accessor_class_bufr_simple_thinning_t::init(grib_accessor* a, const lo a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; } -int grib_accessor_class_bufr_simple_thinning_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_bufr_simple_thinning_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_LONG; } -int apply_thinning(grib_accessor* a){ +static int apply_thinning(grib_accessor* a) +{ const grib_accessor_bufr_simple_thinning_t* self = (grib_accessor_bufr_simple_thinning_t*)a; long skip; @@ -101,7 +104,8 @@ int apply_thinning(grib_accessor* a){ return ret; } -int grib_accessor_class_bufr_simple_thinning_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_bufr_simple_thinning_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ const grib_accessor_bufr_simple_thinning_t* self = (grib_accessor_bufr_simple_thinning_t*)a; if (*len == 0) diff --git a/src/accessor/grib_accessor_class_codeflag.cc b/src/accessor/grib_accessor_class_codeflag.cc index 75b73aca4..6cfda6942 100644 --- a/src/accessor/grib_accessor_class_codeflag.cc +++ b/src/accessor/grib_accessor_class_codeflag.cc @@ -11,11 +11,12 @@ #include "grib_accessor_class_codeflag.h" -grib_accessor_class_codeflag_t _grib_accessor_class_codeflag{"codeflag"}; +grib_accessor_class_codeflag_t _grib_accessor_class_codeflag{ "codeflag" }; grib_accessor_class* grib_accessor_class_codeflag = &_grib_accessor_class_codeflag; -void grib_accessor_class_codeflag_t::init(grib_accessor* a, const long len, grib_arguments* param){ +void grib_accessor_class_codeflag_t::init(grib_accessor* a, const long len, grib_arguments* param) +{ grib_accessor_class_unsigned_t::init(a, len, param); grib_accessor_codeflag_t* self = (grib_accessor_codeflag_t*)a; a->length = len; @@ -23,12 +24,14 @@ void grib_accessor_class_codeflag_t::init(grib_accessor* a, const long len, grib Assert(a->length >= 0); } -int test_bit(long a, long b){ - DEBUG_ASSERT(b>=0); +static int test_bit(long a, long b) +{ + DEBUG_ASSERT(b >= 0); return a & (1 << b); } -int grib_get_codeflag(grib_accessor* a, long code, char* codename){ +static int grib_get_codeflag(grib_accessor* a, long code, char* codename) +{ const grib_accessor_codeflag_t* self = (grib_accessor_codeflag_t*)a; FILE* f = NULL; char fname[1024]; @@ -42,8 +45,8 @@ int grib_get_codeflag(grib_accessor* a, long code, char* codename){ err = grib_recompose_name(grib_handle_of_accessor(a), NULL, self->tablename, fname, 1); if (err) { - strncpy(fname, self->tablename, sizeof(fname)-1); - fname[sizeof(fname)-1] = '\0'; + strncpy(fname, self->tablename, sizeof(fname) - 1); + fname[sizeof(fname) - 1] = '\0'; } if ((filename = grib_context_full_defs_path(a->context, fname)) == NULL) { @@ -98,12 +101,14 @@ int grib_get_codeflag(grib_accessor* a, long code, char* codename){ return GRIB_SUCCESS; } -int grib_accessor_class_codeflag_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_codeflag_t::value_count(grib_accessor* a, long* count) +{ *count = 1; return 0; } -void grib_accessor_class_codeflag_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_codeflag_t::dump(grib_accessor* a, grib_dumper* dumper) +{ const grib_accessor_codeflag_t* self = (grib_accessor_codeflag_t*)a; long v = 0; char flagname[1024] = {0,}; diff --git a/src/accessor/grib_accessor_class_codetable.cc b/src/accessor/grib_accessor_class_codetable.cc index 552274e75..f21ef0f86 100644 --- a/src/accessor/grib_accessor_class_codetable.cc +++ b/src/accessor/grib_accessor_class_codetable.cc @@ -44,10 +44,7 @@ void thread_init() } #endif - - - -int grib_load_codetable(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_codetable* t); +static int grib_load_codetable(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_codetable* t); void grib_accessor_class_codetable_t::init(grib_accessor* a, const long len, grib_arguments* params) { @@ -145,6 +142,7 @@ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) return (*a == 0 && *b == 0) ? 0 : 1; } +// Cater for parameters being NULL static int str_eq(const char* a, const char* b) { if (a && b && (grib_inline_strcmp(a, b) == 0)) @@ -267,7 +265,7 @@ static grib_codetable* load_table(grib_accessor* a) return t; } -int grib_load_codetable(grib_context* c, const char* filename, +static int grib_load_codetable(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_codetable* t) { char line[1024]; diff --git a/src/accessor/grib_accessor_class_concept.cc b/src/accessor/grib_accessor_class_concept.cc index a4261f8ee..98f0fb35c 100644 --- a/src/accessor/grib_accessor_class_concept.cc +++ b/src/accessor/grib_accessor_class_concept.cc @@ -11,7 +11,7 @@ #include "grib_accessor_class_concept.h" -grib_accessor_class_concept_t _grib_accessor_class_concept{"concept"}; +grib_accessor_class_concept_t _grib_accessor_class_concept{ "concept" }; grib_accessor_class* grib_accessor_class_concept = &_grib_accessor_class_concept; @@ -33,17 +33,20 @@ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) return (*a == 0 && *b == 0) ? 0 : 1; } -void grib_accessor_class_concept_t::init(grib_accessor* a, const long len, grib_arguments* args){ +void grib_accessor_class_concept_t::init(grib_accessor* a, const long len, grib_arguments* args) +{ grib_accessor_class_gen_t::init(a, len, args); a->length = 0; } -void grib_accessor_class_concept_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_concept_t::dump(grib_accessor* a, grib_dumper* dumper) +{ grib_dump_string(dumper, a, NULL); } /* Return 1 (=True) or 0 (=False) */ -int concept_condition_expression_true(grib_handle* h, grib_concept_condition* c){ +static int concept_condition_expression_true(grib_handle* h, grib_concept_condition* c) +{ long lval; long lres = 0; int ok = FALSE; /* Boolean */ @@ -87,8 +90,9 @@ int concept_condition_expression_true(grib_handle* h, grib_concept_condition* c) } /* Return 1 (=True) or 0 (=False) */ -int concept_condition_iarray_true(grib_handle* h, grib_concept_condition* c){ - long* val = NULL; +static int concept_condition_iarray_true(grib_handle* h, grib_concept_condition* c) +{ + long* val = NULL; size_t size = 0, i; int ret; /* Boolean */ int err = 0; @@ -117,7 +121,8 @@ int concept_condition_iarray_true(grib_handle* h, grib_concept_condition* c){ } /* Return 1 (=True) or 0 (=False) */ -int concept_condition_true(grib_handle* h, grib_concept_condition* c){ +static int concept_condition_true(grib_handle* h, grib_concept_condition* c) +{ if (c->expression == NULL) return concept_condition_iarray_true(h, c); else @@ -158,8 +163,8 @@ static const char* concept_evaluate(grib_accessor* a) } #define MAX_NUM_CONCEPT_VALUES 40 - -int concept_conditions_expression_apply(grib_handle* h, grib_concept_condition* e, grib_values* values, grib_sarray* sa, int* n){ +static int concept_conditions_expression_apply(grib_handle* h, grib_concept_condition* e, grib_values* values, grib_sarray* sa, int* n) +{ long lres = 0; double dres = 0.0; int count = *n; @@ -190,27 +195,31 @@ int concept_conditions_expression_apply(grib_handle* h, grib_concept_condition* return err; } -int concept_conditions_iarray_apply(grib_handle* h, grib_concept_condition* c){ +static int concept_conditions_iarray_apply(grib_handle* h, grib_concept_condition* c) +{ size_t size = grib_iarray_used_size(c->iarray); return grib_set_long_array(h, c->name, c->iarray->v, size); } -int concept_conditions_apply(grib_handle* h, grib_concept_condition* c, grib_values* values, grib_sarray* sa, int* n){ +static int concept_conditions_apply(grib_handle* h, grib_concept_condition* c, grib_values* values, grib_sarray* sa, int* n) +{ if (c->expression == NULL) return concept_conditions_iarray_apply(h, c); else return concept_conditions_expression_apply(h, c, values, sa, n); } -int cmpstringp(const void* p1, const void* p2){ +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 */ return strcmp(*(char* const*)p1, *(char* const*)p2); } -bool blacklisted(grib_handle* h, long edition, const char* concept_name, const char* concept_value){ - if ( strcmp(concept_name, "packingType")==0 ) { +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")) { @@ -226,17 +235,18 @@ bool blacklisted(grib_handle* h, long edition, const char* concept_name, const c return true; } grib_get_string(h, "packingType", input_packing_type, &len); - if (strstr(input_packing_type,"grid_") && !strstr(concept_value,"grid_")) { + if (strstr(input_packing_type, "grid_") && !strstr(concept_value, "grid_")) { return true; } - if (strstr(input_packing_type,"spectral_") && !strstr(concept_value,"spectral_")) { + if (strstr(input_packing_type, "spectral_") && !strstr(concept_value, "spectral_")) { return true; } } return false; } -int grib_concept_apply(grib_accessor* a, const char* name){ +static int grib_concept_apply(grib_accessor* a, const char* name) +{ int err = 0; int count = 0; grib_concept_condition* e = NULL; @@ -261,8 +271,10 @@ int grib_concept_apply(grib_accessor* a, const char* name){ size_t i = 0, concept_count = 0; long dummy = 0, editionNumber = 0; char centre_s[32] = {0,}; - size_t centre_len = sizeof(centre_s); - char* all_concept_vals[MAX_NUM_CONCEPT_VALUES] = {NULL,}; /* sorted array containing concept values */ + size_t centre_len = sizeof(centre_s); + char* all_concept_vals[MAX_NUM_CONCEPT_VALUES] = { + NULL, + }; /* sorted array containing concept values */ grib_concept_value* pCon = concepts; grib_context_log(h->context, GRIB_LOG_ERROR, "concept: no match for %s=%s", act->name, name); @@ -279,11 +291,12 @@ int grib_concept_apply(grib_accessor* a, const char* name){ if (string_to_long(name, &dummy, 1) == GRIB_SUCCESS) { // The paramId value is an integer. Show them the param DB grib_context_log(h->context, GRIB_LOG_ERROR, - "Please check the Parameter Database 'https://codes.ecmwf.int/grib/param-db/?id=%s'", name); - } else { + "Please check the Parameter Database 'https://codes.ecmwf.int/grib/param-db/?id=%s'", name); + } + else { // paramId being set to a non-integer grib_context_log(h->context, GRIB_LOG_ERROR, - "The paramId value should be an integer. Are you trying to set the shortName?"); + "The paramId value should be an integer. Are you trying to set the shortName?"); } } if (strcmp(act->name, "shortName") == 0) { @@ -335,29 +348,31 @@ int grib_concept_apply(grib_accessor* a, const char* name){ return err; } -int grib_accessor_class_concept_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_concept_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } -int grib_accessor_class_concept_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_concept_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ char buf[80]; size_t s; snprintf(buf, sizeof(buf), "%ld", *val); - //if(*len > 1) - // return GRIB_NOT_IMPLEMENTED; + // if(*len > 1) + // return GRIB_NOT_IMPLEMENTED; // ECC-1806: GRIB: Change of paramId in conversion from GRIB1 to GRIB2 if (STR_EQUAL(a->name, "paramId")) { grib_handle* h = grib_handle_of_accessor(a); - long edition = 0; + long edition = 0; if (grib_get_long(h, "edition", &edition) == GRIB_SUCCESS && edition == 2) { long newParamId = 0; if (grib_get_long(h, "paramIdForConversion", &newParamId) == GRIB_SUCCESS && newParamId > 0) { if (a->context->debug) { const char* cclass_name = a->cclass->name; fprintf(stderr, "ECCODES DEBUG %s::%s: Changing %s from %ld to %ld\n", - cclass_name, __func__, a->name, *val, newParamId); + cclass_name, __func__, a->name, *val, newParamId); } snprintf(buf, sizeof(buf), "%ld", newParamId); } @@ -368,7 +383,8 @@ int grib_accessor_class_concept_t::pack_long(grib_accessor* a, const long* val, return pack_string(a, buf, &s); } -int grib_accessor_class_concept_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_concept_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ /* * If we want to have a condition which contains tests for paramId as well * as a floating point key, then need to be able to evaluate paramId as a @@ -400,7 +416,8 @@ int grib_accessor_class_concept_t::unpack_double(grib_accessor* a, double* val, return ret; } -int grib_accessor_class_concept_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_concept_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ const char* p = concept_evaluate(a); if (!p) { @@ -419,14 +436,14 @@ int grib_accessor_class_concept_t::unpack_long(grib_accessor* a, long* val, size * Keep this check in DEBUG mode only */ { - char *endptr; + char* endptr; *val = strtol(p, &endptr, 10); if (endptr == p || *endptr != '\0') { /* Failed to convert string into integer */ int type = GRIB_TYPE_UNDEFINED; - grib_context_log(a->context,GRIB_LOG_ERROR,"Cannot unpack %s as long",a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack %s as long", 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)); + grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try unpacking as %s", grib_get_type_name(type)); } return GRIB_DECODING_ERROR; } @@ -435,7 +452,8 @@ int grib_accessor_class_concept_t::unpack_long(grib_accessor* a, long* val, size return GRIB_SUCCESS; } -int grib_accessor_class_concept_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_concept_t::get_native_type(grib_accessor* a) +{ int type = GRIB_TYPE_STRING; if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) type = GRIB_TYPE_LONG; @@ -443,13 +461,15 @@ int grib_accessor_class_concept_t::get_native_type(grib_accessor* a){ return type; } -void grib_accessor_class_concept_t::destroy(grib_context* c, grib_accessor* a){ - //grib_accessor_concept_t *self = (grib_accessor_concept_t*)a; - //grib_context_free(c,self->cval); +void grib_accessor_class_concept_t::destroy(grib_context* c, grib_accessor* a) +{ + // grib_accessor_concept_t *self = (grib_accessor_concept_t*)a; + // grib_context_free(c,self->cval); grib_accessor_class_gen_t::destroy(c, a); } -int grib_accessor_class_concept_t::unpack_string(grib_accessor* a, char* val, size_t* len){ +int grib_accessor_class_concept_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ size_t slen; const char* p = concept_evaluate(a); @@ -464,7 +484,7 @@ int grib_accessor_class_concept_t::unpack_string(grib_accessor* a, char* val, si slen = strlen(p) + 1; if (*len < slen) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Concept unpack_string. Buffer too small for %s, value='%s' which requires %lu bytes (len=%lu)", + "Concept unpack_string. Buffer too small for %s, value='%s' which requires %lu bytes (len=%lu)", a->name, p, slen, *len); *len = slen; return GRIB_BUFFER_TOO_SMALL; @@ -472,30 +492,34 @@ int grib_accessor_class_concept_t::unpack_string(grib_accessor* a, char* val, si strcpy(val, p); /* NOLINT: CWE-119 clang-analyzer-security.insecureAPI.strcpy */ *len = slen; -// if (a->context->debug==1) { -// int err = 0; -// char result[1024] = {0,}; -// err = get_concept_condition_string(grib_handle_of_accessor(a), a->name, val, result); -// if (!err) fprintf(stderr, "ECCODES DEBUG concept name=%s, value=%s, conditions=%s\n", a->name, val, result); -// } + // if (a->context->debug==1) { + // int err = 0; + // char result[1024] = {0,}; + // err = get_concept_condition_string(grib_handle_of_accessor(a), a->name, val, result); + // if (!err) fprintf(stderr, "ECCODES DEBUG concept name=%s, value=%s, conditions=%s\n", a->name, val, result); + // } return GRIB_SUCCESS; } -int grib_accessor_class_concept_t::pack_string(grib_accessor* a, const char* val, size_t* len){ +int grib_accessor_class_concept_t::pack_string(grib_accessor* a, const char* val, size_t* len) +{ return grib_concept_apply(a, val); } -size_t grib_accessor_class_concept_t::string_length(grib_accessor* a){ +size_t grib_accessor_class_concept_t::string_length(grib_accessor* a) +{ return MAX_CONCEPT_STRING_LENGTH; } -int grib_accessor_class_concept_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_concept_t::value_count(grib_accessor* a, long* count) +{ *count = 1; return 0; } -int grib_accessor_class_concept_t::compare(grib_accessor* a, grib_accessor* b){ +int grib_accessor_class_concept_t::compare(grib_accessor* a, grib_accessor* b) +{ int retval = 0; char* aval = 0; char* bval = 0; @@ -505,10 +529,12 @@ int grib_accessor_class_concept_t::compare(grib_accessor* a, grib_accessor* b){ int err = 0; long count = 0; - err = a->value_count(&count); if (err) return err; + err = a->value_count(&count); + if (err) return err; alen = count; - err = b->value_count(&count); if (err) return err; + err = b->value_count(&count); + if (err) return err; blen = count; if (alen != blen) @@ -519,8 +545,10 @@ int grib_accessor_class_concept_t::compare(grib_accessor* a, grib_accessor* b){ aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - err = a->unpack_string(aval, &alen); if (err) return err; - err = b->unpack_string(bval, &blen); if (err) return err; + err = a->unpack_string(aval, &alen); + if (err) return err; + err = b->unpack_string(bval, &blen); + if (err) return err; retval = GRIB_SUCCESS; if (!aval || !bval || grib_inline_strcmp(aval, bval)) diff --git a/src/accessor/grib_accessor_class_count_missing.cc b/src/accessor/grib_accessor_class_count_missing.cc index c381be043..7a3232175 100644 --- a/src/accessor/grib_accessor_class_count_missing.cc +++ b/src/accessor/grib_accessor_class_count_missing.cc @@ -11,7 +11,7 @@ #include "grib_accessor_class_count_missing.h" -grib_accessor_class_count_missing_t _grib_accessor_class_count_missing{"count_missing"}; +grib_accessor_class_count_missing_t _grib_accessor_class_count_missing{ "count_missing" }; grib_accessor_class* grib_accessor_class_count_missing = &_grib_accessor_class_count_missing; @@ -34,22 +34,24 @@ static const unsigned char bitsoff[] = { 0 }; -void grib_accessor_class_count_missing_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_count_missing_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_long_t::init(a, len, arg); - int n = 0; + int n = 0; grib_accessor_count_missing_t* self = (grib_accessor_count_missing_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - a->length = 0; + grib_handle* h = grib_handle_of_accessor(a); + a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - self->bitmap = grib_arguments_get_name(h, arg, n++); - self->unusedBitsInBitmap = grib_arguments_get_name(h, arg, n++); - self->numberOfDataPoints = grib_arguments_get_name(h, arg, n++); + self->bitmap = grib_arguments_get_name(h, arg, n++); + self->unusedBitsInBitmap = grib_arguments_get_name(h, arg, n++); + self->numberOfDataPoints = grib_arguments_get_name(h, arg, n++); self->missingValueManagementUsed = grib_arguments_get_name(h, arg, n++); /* Can be NULL */ } static const int used[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 }; -int get_count_of_missing_values(grib_handle* h, long* p_count_of_missing){ +static int get_count_of_missing_values(grib_handle* h, long* p_count_of_missing) +{ int err = 0; long count_of_missing = 0; size_t vsize = 0, ii = 0; @@ -72,7 +74,8 @@ int get_count_of_missing_values(grib_handle* h, long* p_count_of_missing){ return GRIB_SUCCESS; } -int grib_accessor_class_count_missing_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_count_missing_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_count_missing_t* self = (grib_accessor_count_missing_t*)a; unsigned char* p; int i; @@ -88,11 +91,10 @@ int grib_accessor_class_count_missing_t::unpack_long(grib_accessor* a, long* val if (!bitmap) { long mvmu = 0; if (self->missingValueManagementUsed && - grib_get_long(h, self->missingValueManagementUsed, &mvmu) == GRIB_SUCCESS && mvmu != 0) - { + grib_get_long(h, self->missingValueManagementUsed, &mvmu) == GRIB_SUCCESS && mvmu != 0) { /* ECC-523: No bitmap. Missing values are encoded in the Data Section. * So we must decode all the data values and count how many are missing - */ + */ long count_of_missing = 0; if (get_count_of_missing_values(h, &count_of_missing) == GRIB_SUCCESS) { *val = count_of_missing; @@ -101,7 +103,8 @@ int grib_accessor_class_count_missing_t::unpack_long(grib_accessor* a, long* val return GRIB_SUCCESS; } - size = bitmap->byte_count(); offset = bitmap->byte_offset(); + size = bitmap->byte_count(); + offset = bitmap->byte_offset(); if (grib_get_long(h, self->unusedBitsInBitmap, &unusedBitsInBitmap) != GRIB_SUCCESS) { if (grib_get_long(h, self->numberOfDataPoints, &numberOfDataPoints) != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to count missing values"); @@ -110,7 +113,7 @@ int grib_accessor_class_count_missing_t::unpack_long(grib_accessor* a, long* val unusedBitsInBitmap = size * 8 - numberOfDataPoints; if (unusedBitsInBitmap < 0) { grib_context_log(a->context, GRIB_LOG_ERROR, "Inconsistent number of bitmap points: Check the bitmap and data sections!"); - grib_context_log(a->context, GRIB_LOG_ERROR, "Bitmap size=%ld, numberOfDataPoints=%ld", size*8, numberOfDataPoints); + grib_context_log(a->context, GRIB_LOG_ERROR, "Bitmap size=%ld, numberOfDataPoints=%ld", size * 8, numberOfDataPoints); return GRIB_DECODING_ERROR; } } @@ -128,7 +131,8 @@ int grib_accessor_class_count_missing_t::unpack_long(grib_accessor* a, long* val return GRIB_SUCCESS; } -int grib_accessor_class_count_missing_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_count_missing_t::value_count(grib_accessor* a, long* count) +{ *count = 1; return 0; } diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc index a5c1084ac..f78bb1806 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.cc @@ -12,12 +12,12 @@ #include "grib_accessor_class_data_g1second_order_general_extended_packing.h" #include "grib_scaling.h" -grib_accessor_class_data_g1second_order_general_extended_packing_t _grib_accessor_class_data_g1second_order_general_extended_packing{"data_g1second_order_general_extended_packing"}; +grib_accessor_class_data_g1second_order_general_extended_packing_t _grib_accessor_class_data_g1second_order_general_extended_packing{ "data_g1second_order_general_extended_packing" }; grib_accessor_class* grib_accessor_class_data_g1second_order_general_extended_packing = &_grib_accessor_class_data_g1second_order_general_extended_packing; #define MAX_NUMBER_OF_GROUPS 65534 -#define EFDEBUG 0 +#define EFDEBUG 0 static const unsigned long nbits[64] = { 0x1, 0x2, 0x4, 0x8, @@ -38,7 +38,8 @@ static const unsigned long nbits[64] = { 0x1000000000000000, 0x2000000000000000, 0x4000000000000000, 0x8000000000000000 }; -long number_of_bits(grib_handle* h, unsigned long x){ +long number_of_bits(grib_handle* h, unsigned long x) +{ const unsigned long* n = nbits; const int count = sizeof(nbits) / sizeof(nbits[0]); long i = 0; @@ -54,10 +55,11 @@ long number_of_bits(grib_handle* h, unsigned long x){ return i; } -void grib_accessor_class_data_g1second_order_general_extended_packing_t::init(grib_accessor* a, const long v, grib_arguments* args){ +void grib_accessor_class_data_g1second_order_general_extended_packing_t::init(grib_accessor* a, const long v, grib_arguments* args) +{ grib_accessor_class_data_simple_packing_t::init(a, v, args); grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; - grib_handle* handle = grib_handle_of_accessor(a); + grib_handle* handle = grib_handle_of_accessor(a); self->half_byte = grib_arguments_get_name(handle, args, self->carg++); self->packingType = grib_arguments_get_name(handle, args, self->carg++); @@ -83,17 +85,18 @@ void grib_accessor_class_data_g1second_order_general_extended_packing_t::init(gr self->dataFlag = grib_arguments_get_name(handle, args, self->carg++); self->edition = 1; self->dirty = 1; - self->dvalues = NULL; - self->fvalues = NULL; + self->dvalues = NULL; + self->fvalues = NULL; self->double_dirty = self->float_dirty = 1; - self->size = 0; + self->size = 0; a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -int grib_accessor_class_data_g1second_order_general_extended_packing_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::value_count(grib_accessor* a, long* count) +{ grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; - long numberOfCodedValues = 0; - long numberOfGroups = 0; + long numberOfCodedValues = 0; + long numberOfGroups = 0; size_t ngroups; long* groupLengths; long orderOfSPD = 0; @@ -126,7 +129,8 @@ int grib_accessor_class_data_g1second_order_general_extended_packing_t::value_co return err; } -int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_double_element(grib_accessor* a, size_t idx, double* val) +{ size_t size; double* values; int err = 0; @@ -149,7 +153,8 @@ int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_d return GRIB_SUCCESS; } -int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array){ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array) +{ size_t size = 0, i = 0; double* values; int err = 0; @@ -176,9 +181,10 @@ int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_d return GRIB_SUCCESS; } -int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack(grib_accessor* a, double* dvalues, float* fvalues, size_t* len){ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack(grib_accessor* a, double* dvalues, float* fvalues, size_t* len) +{ grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; - int ret = 0; + int ret = 0; long numberOfGroups, numberOfSecondOrderPackedValues; long* firstOrderValues = 0; long* X = 0; @@ -292,14 +298,13 @@ int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack(g n++; } -// for (j=0;jdvalues) { if (numberOfValues != self->size) { grib_context_free(a->context, self->dvalues); @@ -396,11 +401,13 @@ int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack(g return ret; } -int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_float(grib_accessor* a, float* values, size_t* len){ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_float(grib_accessor* a, float* values, size_t* len) +{ return unpack(a, NULL, values, len); } -int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_double(grib_accessor* a, double* values, size_t* len){ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::unpack_double(grib_accessor* a, double* values, size_t* len) +{ return unpack(a, values, NULL, len); } @@ -513,7 +520,8 @@ static void grib_split_long_groups(grib_handle* hand, grib_context* c, long* num grib_context_free(c, localFirstOrderValues); } -int get_bits_per_value(grib_handle* h, const char* bits_per_value_str, long* bits_per_value){ +static int get_bits_per_value(grib_handle* h, const char* bits_per_value_str, long* bits_per_value) +{ int err = 0; if ((err = grib_get_long_internal(h, bits_per_value_str, bits_per_value)) != GRIB_SUCCESS) return err; @@ -526,7 +534,8 @@ int get_bits_per_value(grib_handle* h, const char* bits_per_value_str, long* bit /* Note: on a 32bit system, the most significant bit is for signedness, so we have to drop one bit */ if (sizeof(long) == 4) { *bits_per_value = 31; - } else { + } + else { *bits_per_value = 32; } } @@ -536,10 +545,11 @@ int get_bits_per_value(grib_handle* h, const char* bits_per_value_str, long* bit // For the old implementation of pack_double, see // src/deprecated/grib_accessor_class_data_g1second_order_general_extended_packing.pack_double.cc // See ECC-441 and ECC-261 -int grib_accessor_class_data_g1second_order_general_extended_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_data_g1second_order_general_extended_packing_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; - int ret = 0; - int grib2 = 0; + int ret = 0; + int grib2 = 0; long bits_per_value, orderOfSPD, binary_scale_factor; long numberOfValues; double max, min; @@ -1130,7 +1140,9 @@ int grib_accessor_class_data_g1second_order_general_extended_packing_t::pack_dou pos = 0; if (orderOfSPD) { - long SPD[4] = {0,}; + long SPD[4] = { + 0, + }; size_t nSPD = orderOfSPD + 1; Assert(orderOfSPD <= 3); for (i = 0; i < orderOfSPD; i++) @@ -1192,7 +1204,8 @@ int grib_accessor_class_data_g1second_order_general_extended_packing_t::pack_dou return GRIB_SUCCESS; } -void grib_accessor_class_data_g1second_order_general_extended_packing_t::destroy(grib_context* context, grib_accessor* a){ +void grib_accessor_class_data_g1second_order_general_extended_packing_t::destroy(grib_context* context, grib_accessor* a) +{ grib_accessor_data_g1second_order_general_extended_packing_t* self = (grib_accessor_data_g1second_order_general_extended_packing_t*)a; if (self->dvalues != NULL) { grib_context_free(context, self->dvalues); diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.cc b/src/accessor/grib_accessor_class_data_g22order_packing.cc index 43fbce6ba..bbc698100 100644 --- a/src/accessor/grib_accessor_class_data_g22order_packing.cc +++ b/src/accessor/grib_accessor_class_data_g22order_packing.cc @@ -130,7 +130,7 @@ void add_bitstream(bitstream_context* ctx, grib_accessor* a, int t, int n_bits) // find min/max of an integer array // return 0: if min max found // return 1: if min max not found, min = max = 0 -int int_min_max_array(int* data, unsigned int n, int* min, int* max) +static int int_min_max_array(int* data, unsigned int n, int* min, int* max) { unsigned int first; int mn, mx; @@ -172,7 +172,7 @@ int int_min_max_array(int* data, unsigned int n, int* min, int* max) return 0; } -double Int_Power(double x, int y) +static double Int_Power(double x, int y) { double value; @@ -192,7 +192,7 @@ double Int_Power(double x, int y) return value; } -int min_max_array(double* data, unsigned int n, double* min, double* max) +static int min_max_array(double* data, unsigned int n, double* min, double* max) { unsigned int first; double mn, mx; @@ -366,7 +366,7 @@ static int post_process(grib_context* c, long* vals, long len, long order, long return GRIB_SUCCESS; } -int find_nbits(unsigned int i) +static int find_nbits(unsigned int i) { #if !defined __GNUC__ || __GNUC__ < 4 int j; @@ -405,7 +405,7 @@ struct section struct section *head, *tail; }; -int sizeofsection(struct section* s, int ref_bits, int width_bits, int has_undef) +static int sizeofsection(struct section* s, int ref_bits, int width_bits, int has_undef) { if (s->mn == INT_MAX) { // all undef return ref_bits + width_bits; @@ -434,7 +434,7 @@ static int sizeofsection2(int mn, int mx, int n, int ref_bits, int width_bits, return find_nbits(mx - mn + has_undef) * n + ref_bits + width_bits; } -int size_all(struct section* s, int ref_bits, int width_bits, int has_undef) +static int size_all(struct section* s, int ref_bits, int width_bits, int has_undef) { int bits; @@ -446,7 +446,7 @@ int size_all(struct section* s, int ref_bits, int width_bits, int has_undef) return (bits + 7) / 8; } -void move_one_left(struct section* s, int* v) +static void move_one_left(struct section* s, int* v) { struct section* t; int val, i, j, k; @@ -512,7 +512,7 @@ void move_one_left(struct section* s, int* v) } } -void move_one_right(struct section* s, int* v) +static void move_one_right(struct section* s, int* v) { struct section* t; int val, i, j, k; @@ -594,7 +594,7 @@ void move_one_right(struct section* s, int* v) return; } -void exchange(struct section* s, int* v, int has_undef, int LEN_SEC_MAX) +static void exchange(struct section* s, int* v, int has_undef, int LEN_SEC_MAX) { struct section* t; int val0, val1, nbit_s, nbit_t; @@ -670,7 +670,7 @@ void exchange(struct section* s, int* v, int has_undef, int LEN_SEC_MAX) } } -void merge_j(struct section* h, int ref_bits, int width_bits, int has_undef, int param, int LEN_SEC_MAX) +static void merge_j(struct section* h, int ref_bits, int width_bits, int has_undef, int param, int LEN_SEC_MAX) { struct section *t, *m; int size_head, size_mid, size_tail, saving_mt, saving_hm; diff --git a/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc b/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc index 60cf8e0f9..a014ef3c2 100644 --- a/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc @@ -50,7 +50,8 @@ int grib_accessor_class_data_g2bifourier_packing_t::value_count(grib_accessor* a return grib_get_long_internal(gh, self->number_of_values, numberOfValues); } -void ellipse(long ni, long nj, long itrunc[], long jtrunc[]){ +static void ellipse(long ni, long nj, long itrunc[], long jtrunc[]) +{ const double zeps = 1.E-10; const double zauxil = 0.; int i, j; @@ -91,7 +92,8 @@ void ellipse(long ni, long nj, long itrunc[], long jtrunc[]){ } } -void rectangle(long ni, long nj, long itrunc[], long jtrunc[]){ +static void rectangle(long ni, long nj, long itrunc[], long jtrunc[]) +{ int i, j; /* @@ -109,7 +111,8 @@ void rectangle(long ni, long nj, long itrunc[], long jtrunc[]){ jtrunc[i] = nj; } -void diamond(long ni, long nj, long itrunc[], long jtrunc[]){ +static void diamond(long ni, long nj, long itrunc[], long jtrunc[]) +{ int i, j; if (nj == 0) @@ -171,7 +174,8 @@ typedef struct bif_trunc_t /* * Total number of coefficients */ -size_t size_bif(bif_trunc_t* bt){ +static size_t size_bif(bif_trunc_t* bt) +{ size_t n_vals = 0; int j; for (j = 0; j <= bt->bif_j; j++) @@ -182,7 +186,8 @@ size_t size_bif(bif_trunc_t* bt){ /* * Number of unpacked coefficients */ -size_t size_sub(bif_trunc_t* bt){ +static size_t size_sub(bif_trunc_t* bt) +{ size_t n_vals = 0; int i, j; for_ij() @@ -197,7 +202,8 @@ size_t size_sub(bif_trunc_t* bt){ return n_vals; } -double laplam(bif_trunc_t* bt, const double val[]){ +static double laplam(bif_trunc_t* bt, const double val[]) +{ /* * For bi-Fourier spectral fields, the Laplacian operator is a multiplication by (i*i+j*j) */ @@ -333,7 +339,8 @@ double laplam(bif_trunc_t* bt, const double val[]){ return zp; } -void free_bif_trunc(bif_trunc_t* bt, grib_accessor* a){ +static void free_bif_trunc(bif_trunc_t* bt, grib_accessor* a) +{ grib_handle* gh = grib_handle_of_accessor(a); if (bt == NULL) return; diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc index fa653c0cb..fc87df231 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc +++ b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.cc @@ -13,11 +13,12 @@ #define DIRECT 0 #define INVERSE 1 -grib_accessor_class_data_g2simple_packing_with_preprocessing_t _grib_accessor_class_data_g2simple_packing_with_preprocessing{"data_g2simple_packing_with_preprocessing"}; +grib_accessor_class_data_g2simple_packing_with_preprocessing_t _grib_accessor_class_data_g2simple_packing_with_preprocessing{ "data_g2simple_packing_with_preprocessing" }; grib_accessor_class* grib_accessor_class_data_g2simple_packing_with_preprocessing = &_grib_accessor_class_data_g2simple_packing_with_preprocessing; -void grib_accessor_class_data_g2simple_packing_with_preprocessing_t::init(grib_accessor* a, const long v, grib_arguments* args){ +void grib_accessor_class_data_g2simple_packing_with_preprocessing_t::init(grib_accessor* a, const long v, grib_arguments* args) +{ grib_accessor_class_data_g2simple_packing_t::init(a, v, args); grib_accessor_data_g2simple_packing_with_preprocessing_t* self = (grib_accessor_data_g2simple_packing_with_preprocessing_t*)a; self->pre_processing = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); @@ -25,7 +26,8 @@ void grib_accessor_class_data_g2simple_packing_with_preprocessing_t::init(grib_a a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::value_count(grib_accessor* a, long* n_vals){ +int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::value_count(grib_accessor* a, long* n_vals) +{ grib_accessor_data_g2simple_packing_with_preprocessing_t* self = (grib_accessor_data_g2simple_packing_with_preprocessing_t*)a; *n_vals = 0; @@ -35,7 +37,7 @@ int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::value_count( static int pre_processing_func(double* values, long length, long pre_processing, double* pre_processing_parameter, int mode) { - int i = 0, ret = 0; + int i = 0, ret = 0; double min = values[0]; double next_min = values[0]; Assert(length > 0); @@ -96,10 +98,9 @@ static int pre_processing_func(double* values, long length, long pre_processing, return ret; } -int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_data_g2simple_packing_with_preprocessing_t* self = (grib_accessor_data_g2simple_packing_with_preprocessing_t*)a; - //grib_accessor_class* super = *(a->cclass->super); - //grib_accessor_class* super2 = NULL; size_t n_vals = 0; long nn = 0; @@ -108,7 +109,8 @@ int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::unpack_doubl long pre_processing; double pre_processing_parameter; - err = a->value_count(&nn); n_vals = nn; + err = a->value_count(&nn); + n_vals = nn; if (err) return err; @@ -140,7 +142,8 @@ int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::unpack_doubl return err; } -int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_data_g2simple_packing_with_preprocessing_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_data_g2simple_packing_with_preprocessing_t* self = (grib_accessor_data_g2simple_packing_with_preprocessing_t*)a; size_t n_vals = *len; diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc index a68a3eae7..5ce5ae154 100644 --- a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc @@ -428,7 +428,7 @@ int grib_accessor_class_data_jpeg2000_packing_t::pack_double(grib_accessor* a, c } #else -void print_error_feature_not_enabled(grib_context* c){ +static void print_error_feature_not_enabled(grib_context* c){ grib_context_log(c, GRIB_LOG_ERROR, "JPEG support not enabled. Please rebuild with -DENABLE_JPG=ON"); } diff --git a/src/accessor/grib_accessor_class_data_png_packing.cc b/src/accessor/grib_accessor_class_data_png_packing.cc index 8db2e5b3b..690070214 100644 --- a/src/accessor/grib_accessor_class_data_png_packing.cc +++ b/src/accessor/grib_accessor_class_data_png_packing.cc @@ -53,14 +53,16 @@ typedef struct png_read_callback_data size_t offset; } png_read_callback_data; -void png_read_callback(png_structp png, png_bytep data, png_size_t length){ +static void png_read_callback(png_structp png, png_bytep data, png_size_t length) +{ png_read_callback_data* p = (png_read_callback_data*)png_get_io_ptr(png); Assert(p->offset + length <= p->length); memcpy(data, p->buffer + p->offset, length); p->offset += length; } -void png_write_callback(png_structp png, png_bytep data, png_size_t length){ +static void png_write_callback(png_structp png, png_bytep data, png_size_t length) +{ png_read_callback_data* p = (png_read_callback_data*)png_get_io_ptr(png); /* printf("p.offset=%zu len=%zu p.len=%zu\n", p->offset, length, p->length); */ /* Assert(p->offset + length <= p->length); */ @@ -73,7 +75,8 @@ void png_write_callback(png_structp png, png_bytep data, png_size_t length){ p->offset += length; } -void png_flush_callback(png_structp png){ +static void png_flush_callback(png_structp png) +{ /* Empty */ } @@ -218,7 +221,8 @@ int grib_accessor_class_data_png_packing_t::unpack_double(grib_accessor* a, doub return err; } -bool is_constant(const double* values, size_t n_vals){ +static bool is_constant(const double* values, size_t n_vals) +{ bool isConstant = true; double v = 0; size_t i; diff --git a/src/accessor/grib_accessor_class_element.cc b/src/accessor/grib_accessor_class_element.cc index eb2a874f2..3d150d79e 100644 --- a/src/accessor/grib_accessor_class_element.cc +++ b/src/accessor/grib_accessor_class_element.cc @@ -15,7 +15,8 @@ grib_accessor_class_element_t _grib_accessor_class_element{"element"}; grib_accessor_class* grib_accessor_class_element = &_grib_accessor_class_element; -void grib_accessor_class_element_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_element_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_element_t* self = (grib_accessor_element_t*)a; grib_handle* hand = grib_handle_of_accessor(a); @@ -25,7 +26,8 @@ void grib_accessor_class_element_t::init(grib_accessor* a, const long l, grib_ar self->element = grib_arguments_get_long(hand, c, n++); } -int check_element_index(const char* func, const char* array_name, long index, size_t size){ +static int check_element_index(const char* func, const char* array_name, long index, size_t size) +{ const grib_context* c = grib_context_get_default(); if (index < 0 || index >= size) { grib_context_log(c, GRIB_LOG_ERROR, "%s: Invalid element index %ld for array '%s'. Value must be between 0 and %zu", @@ -35,7 +37,8 @@ int check_element_index(const char* func, const char* array_name, long index, si return GRIB_SUCCESS; } -int grib_accessor_class_element_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_element_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_element_t* self = (grib_accessor_element_t*)a; int ret = 0; size_t size = 0; @@ -77,7 +80,8 @@ int grib_accessor_class_element_t::unpack_long(grib_accessor* a, long* val, size return ret; } -int grib_accessor_class_element_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_element_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_element_t* self = (grib_accessor_element_t*)a; int ret = 0; size_t size = 0; @@ -124,7 +128,8 @@ int grib_accessor_class_element_t::pack_long(grib_accessor* a, const long* val, return ret; } -int grib_accessor_class_element_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_element_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_element_t* self = (grib_accessor_element_t*)a; int ret = 0; size_t size = 0; diff --git a/src/accessor/grib_accessor_class_expanded_descriptors.cc b/src/accessor/grib_accessor_class_expanded_descriptors.cc index ff91dbc6f..b30e745a9 100644 --- a/src/accessor/grib_accessor_class_expanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_expanded_descriptors.cc @@ -41,7 +41,8 @@ typedef struct change_coding_params result = grib_bufr_descriptors_array_pop_front(array); \ } -void grib_accessor_class_expanded_descriptors_t::init(grib_accessor* a, const long len, grib_arguments* args){ +void grib_accessor_class_expanded_descriptors_t::init(grib_accessor* a, const long len, grib_arguments* args) +{ grib_accessor_class_long_t::init(a, len, args); grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; int n = 0; @@ -88,7 +89,8 @@ static char* descriptor_type_name(int dtype) } #endif -void __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_descriptors_array* expanded, change_coding_params* ccp, int* err){ +static void __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_descriptors_array* expanded, change_coding_params* ccp, int* err) +{ int k, j, i; grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; size_t size = 0; @@ -463,7 +465,8 @@ static bufr_descriptors_array* do_expand(grib_accessor* a, bufr_descriptors_arra return expanded; } -int expand(grib_accessor* a){ +static int expand(grib_accessor* a) +{ grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; int err = 0; size_t unexpandedSize = 0; @@ -599,7 +602,8 @@ bufr_descriptors_array* grib_accessor_class_expanded_descriptors_get_expanded(gr return self->expanded; } -int grib_accessor_class_expanded_descriptors_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_expanded_descriptors_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; int ret = 0; size_t i = 0; @@ -633,7 +637,8 @@ int grib_accessor_class_expanded_descriptors_t::unpack_double(grib_accessor* a, return ret; } -int grib_accessor_class_expanded_descriptors_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_expanded_descriptors_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; int ret = 0; size_t rlen = 0; @@ -678,7 +683,8 @@ int grib_accessor_class_expanded_descriptors_t::unpack_long(grib_accessor* a, lo return GRIB_SUCCESS; } -int grib_accessor_class_expanded_descriptors_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len){ +int grib_accessor_class_expanded_descriptors_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len) +{ int err = 0; long* v = NULL; char buf[25] = {0,}; @@ -702,13 +708,15 @@ int grib_accessor_class_expanded_descriptors_t::unpack_string_array(grib_accesso return GRIB_NOT_IMPLEMENTED; } -int grib_accessor_class_expanded_descriptors_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_expanded_descriptors_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; self->do_expand = 1; return GRIB_NOT_IMPLEMENTED; } -int grib_accessor_class_expanded_descriptors_t::value_count(grib_accessor* a, long* rlen){ +int grib_accessor_class_expanded_descriptors_t::value_count(grib_accessor* a, long* rlen) +{ grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; int err = 0; *rlen = 0; @@ -723,14 +731,16 @@ int grib_accessor_class_expanded_descriptors_t::value_count(grib_accessor* a, lo return err; } -void grib_accessor_class_expanded_descriptors_t::destroy(grib_context* c, grib_accessor* a){ +void grib_accessor_class_expanded_descriptors_t::destroy(grib_context* c, grib_accessor* a) +{ grib_accessor_class_long_t::destroy(c, a); // grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; // if (self->rank==0 && self->expanded) // grib_bufr_descriptors_array_delete(self->expanded); } -int grib_accessor_class_expanded_descriptors_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_expanded_descriptors_t::get_native_type(grib_accessor* a) +{ grib_accessor_expanded_descriptors_t* self = (grib_accessor_expanded_descriptors_t*)a; if (self->rank == 2) return GRIB_TYPE_DOUBLE; diff --git a/src/accessor/grib_accessor_class_g1forecastmonth.cc b/src/accessor/grib_accessor_class_g1forecastmonth.cc index 7da455773..7ec448cf6 100644 --- a/src/accessor/grib_accessor_class_g1forecastmonth.cc +++ b/src/accessor/grib_accessor_class_g1forecastmonth.cc @@ -11,11 +11,12 @@ #include "grib_accessor_class_g1forecastmonth.h" -grib_accessor_class_g1forecastmonth_t _grib_accessor_class_g1forecastmonth{"g1forecastmonth"}; +grib_accessor_class_g1forecastmonth_t _grib_accessor_class_g1forecastmonth{ "g1forecastmonth" }; grib_accessor_class* grib_accessor_class_g1forecastmonth = &_grib_accessor_class_g1forecastmonth; -void grib_accessor_class_g1forecastmonth_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_g1forecastmonth_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_g1forecastmonth_t* self = (grib_accessor_g1forecastmonth_t*)a; grib_handle* h = grib_handle_of_accessor(a); @@ -31,17 +32,19 @@ void grib_accessor_class_g1forecastmonth_t::init(grib_accessor* a, const long l, } } -void grib_accessor_class_g1forecastmonth_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_g1forecastmonth_t::dump(grib_accessor* a, grib_dumper* dumper) +{ grib_dump_long(dumper, a, NULL); } -int calculate_fcmonth(grib_accessor* a, long verification_yearmonth, long base_date, long day, long hour, long* result){ +static int calculate_fcmonth(grib_accessor* a, long verification_yearmonth, long base_date, long day, long hour, long* result) +{ long base_yearmonth = 0; - long vyear = 0; - long vmonth = 0; - long byear = 0; - long bmonth = 0; - long fcmonth = 0; + long vyear = 0; + long vmonth = 0; + long byear = 0; + long bmonth = 0; + long fcmonth = 0; base_yearmonth = base_date / 100; @@ -58,7 +61,8 @@ int calculate_fcmonth(grib_accessor* a, long verification_yearmonth, long base_d return GRIB_SUCCESS; } -int unpack_long_edition2(grib_accessor* a, long* val, size_t* len){ +static int unpack_long_edition2(grib_accessor* a, long* val, size_t* len) +{ int err = 0; grib_handle* h = grib_handle_of_accessor(a); long dataDate, verification_yearmonth; @@ -67,10 +71,10 @@ int unpack_long_edition2(grib_accessor* a, long* val, size_t* len){ long forecastTime, indicatorOfUnitOfTimeRange; double jul_base, jul2, dstep; - if ((err = grib_get_long(h, "year", &year)) != GRIB_SUCCESS) return err; + if ((err = grib_get_long(h, "year", &year)) != GRIB_SUCCESS) return err; if ((err = grib_get_long(h, "month", &month)) != GRIB_SUCCESS) return err; - if ((err = grib_get_long(h, "day", &day)) != GRIB_SUCCESS) return err; - if ((err = grib_get_long(h, "hour", &hour)) != GRIB_SUCCESS) return err; + if ((err = grib_get_long(h, "day", &day)) != GRIB_SUCCESS) return err; + if ((err = grib_get_long(h, "hour", &hour)) != GRIB_SUCCESS) return err; if ((err = grib_get_long(h, "minute", &minute)) != GRIB_SUCCESS) return err; if ((err = grib_get_long(h, "second", &second)) != GRIB_SUCCESS) return err; @@ -90,19 +94,20 @@ int unpack_long_edition2(grib_accessor* a, long* val, size_t* len){ return err; dstep = (((double)forecastTime) * 3600) / 86400; /* as a fraction of a day */ - jul2 = jul_base + dstep; + jul2 = jul_base + dstep; if ((err = grib_julian_to_datetime(jul2, &year2, &month2, &day2, &hour2, &minute2, &second2)) != GRIB_SUCCESS) return err; - verification_yearmonth = year2*100 + month2; + verification_yearmonth = year2 * 100 + month2; if ((err = calculate_fcmonth(a, verification_yearmonth, dataDate, day, hour, val)) != GRIB_SUCCESS) return err; return GRIB_SUCCESS; } -int unpack_long_edition1(grib_accessor* a, long* val, size_t* len){ +int unpack_long_edition1(grib_accessor* a, long* val, size_t* len) +{ int err = 0; grib_accessor_g1forecastmonth_t* self = (grib_accessor_g1forecastmonth_t*)a; @@ -110,9 +115,9 @@ int unpack_long_edition1(grib_accessor* a, long* val, size_t* len){ long base_date = 0; long day = 0; long hour = 0; - long gribForecastMonth = 0; - long check = 0; - long fcmonth = 0; + long gribForecastMonth = 0; + long check = 0; + long fcmonth = 0; if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->verification_yearmonth, &verification_yearmonth)) != GRIB_SUCCESS) @@ -148,10 +153,11 @@ int unpack_long_edition1(grib_accessor* a, long* val, size_t* len){ return GRIB_SUCCESS; } -int grib_accessor_class_g1forecastmonth_t::unpack_long(grib_accessor* a, long* val, size_t* len){ - int err = 0; +int grib_accessor_class_g1forecastmonth_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ + int err = 0; grib_handle* hand = grib_handle_of_accessor(a); - long edition = 0; + long edition = 0; if ((err = grib_get_long(hand, "edition", &edition)) != GRIB_SUCCESS) return err; @@ -165,7 +171,8 @@ int grib_accessor_class_g1forecastmonth_t::unpack_long(grib_accessor* a, long* v } /* TODO: Check for a valid date */ -int grib_accessor_class_g1forecastmonth_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_g1forecastmonth_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_g1forecastmonth_t* self = (grib_accessor_g1forecastmonth_t*)a; return grib_set_long_internal(grib_handle_of_accessor(a), self->fcmonth, *val); } diff --git a/src/accessor/grib_accessor_class_g2_mars_labeling.cc b/src/accessor/grib_accessor_class_g2_mars_labeling.cc index 4ea0f5e7c..b9059220f 100644 --- a/src/accessor/grib_accessor_class_g2_mars_labeling.cc +++ b/src/accessor/grib_accessor_class_g2_mars_labeling.cc @@ -11,15 +11,16 @@ #include "grib_accessor_class_g2_mars_labeling.h" -grib_accessor_class_g2_mars_labeling_t _grib_accessor_class_g2_mars_labeling{"g2_mars_labeling"}; +grib_accessor_class_g2_mars_labeling_t _grib_accessor_class_g2_mars_labeling{ "g2_mars_labeling" }; grib_accessor_class* grib_accessor_class_g2_mars_labeling = &_grib_accessor_class_g2_mars_labeling; -void grib_accessor_class_g2_mars_labeling_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_g2_mars_labeling_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_gen_t::init(a, l, c); grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; - int n = 0; - grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); self->index = grib_arguments_get_long(hand, c, n++); self->the_class = grib_arguments_get_name(hand, c, n++); @@ -33,9 +34,10 @@ void grib_accessor_class_g2_mars_labeling_t::init(grib_accessor* a, const long l self->typeOfGeneratingProcess = grib_arguments_get_name(hand, c, n++); } -int grib_accessor_class_g2_mars_labeling_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_g2_mars_labeling_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; - char* key = NULL; + char* key = NULL; switch (self->index) { case 0: @@ -56,9 +58,10 @@ int grib_accessor_class_g2_mars_labeling_t::unpack_long(grib_accessor* a, long* return grib_get_long(grib_handle_of_accessor(a), key, val); } -int grib_accessor_class_g2_mars_labeling_t::unpack_string(grib_accessor* a, char* val, size_t* len){ +int grib_accessor_class_g2_mars_labeling_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; - char* key = NULL; + char* key = NULL; switch (self->index) { case 0: @@ -79,11 +82,12 @@ int grib_accessor_class_g2_mars_labeling_t::unpack_string(grib_accessor* a, char return grib_get_string(grib_handle_of_accessor(a), key, val, len); } -int extra_set(grib_accessor* a, long val){ - int ret = 0; +static int extra_set(grib_accessor* a, long val) +{ + int ret = 0; grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - char stepType[30] = {0,}; + grib_handle* hand = grib_handle_of_accessor(a); + char stepType[30] = {0,}; size_t stepTypelen = 30; long derivedForecast = -1; long productDefinitionTemplateNumberNew = -1; @@ -301,11 +305,12 @@ int extra_set(grib_accessor* a, long val){ return ret; } -int grib_accessor_class_g2_mars_labeling_t::pack_string(grib_accessor* a, const char* val, size_t* len){ +int grib_accessor_class_g2_mars_labeling_t::pack_string(grib_accessor* a, const char* val, size_t* len) +{ grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; - char* key = NULL; - int ret = 0; - long lval = 0; + char* key = NULL; + int ret = 0; + long lval = 0; switch (self->index) { case 0: @@ -334,10 +339,11 @@ int grib_accessor_class_g2_mars_labeling_t::pack_string(grib_accessor* a, const return extra_set(a, lval); } -int grib_accessor_class_g2_mars_labeling_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_g2_mars_labeling_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; - char* key = NULL; - int ret = 0; + char* key = NULL; + int ret = 0; switch (self->index) { case 0: @@ -362,16 +368,18 @@ int grib_accessor_class_g2_mars_labeling_t::pack_long(grib_accessor* a, const lo return extra_set(a, *val); } -int grib_accessor_class_g2_mars_labeling_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_g2_mars_labeling_t::value_count(grib_accessor* a, long* count) +{ *count = 1; return 0; } -int grib_accessor_class_g2_mars_labeling_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_g2_mars_labeling_t::get_native_type(grib_accessor* a) +{ grib_accessor_g2_mars_labeling_t* self = (grib_accessor_g2_mars_labeling_t*)a; - char* key = NULL; - int ret = 0; - int type = 0; + char* key = NULL; + int ret = 0; + int type = 0; switch (self->index) { case 0: @@ -389,7 +397,8 @@ int grib_accessor_class_g2_mars_labeling_t::get_native_type(grib_accessor* a){ return GRIB_INTERNAL_ERROR; } - ret = grib_get_native_type(grib_handle_of_accessor(a), key, &type); if (ret) + ret = grib_get_native_type(grib_handle_of_accessor(a), key, &type); + if (ret) grib_context_log(a->context, GRIB_LOG_ERROR, "unable to get native type for %s", key); return type; diff --git a/src/accessor/grib_accessor_class_g2end_step.cc b/src/accessor/grib_accessor_class_g2end_step.cc index 70fb9451c..6e8cfcda3 100644 --- a/src/accessor/grib_accessor_class_g2end_step.cc +++ b/src/accessor/grib_accessor_class_g2end_step.cc @@ -14,15 +14,16 @@ #include "step_utilities.h" #include -grib_accessor_class_g2end_step_t _grib_accessor_class_g2end_step{"g2end_step"}; +grib_accessor_class_g2end_step_t _grib_accessor_class_g2end_step{ "g2end_step" }; grib_accessor_class* grib_accessor_class_g2end_step = &_grib_accessor_class_g2end_step; -void grib_accessor_class_g2end_step_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_g2end_step_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; - int n = 0; - grib_handle* h = grib_handle_of_accessor(a); + int n = 0; + grib_handle* h = grib_handle_of_accessor(a); self->start_step_value = grib_arguments_get_name(h, c, n++); self->step_units = grib_arguments_get_name(h, c, n++); @@ -41,29 +42,31 @@ void grib_accessor_class_g2end_step_t::init(grib_accessor* a, const long l, grib self->minute_of_end_of_interval = grib_arguments_get_name(h, c, n++); self->second_of_end_of_interval = grib_arguments_get_name(h, c, n++); - self->time_range_unit = grib_arguments_get_name(h, c, n++); + self->time_range_unit = grib_arguments_get_name(h, c, n++); self->time_range_value = grib_arguments_get_name(h, c, n++); self->typeOfTimeIncrement = grib_arguments_get_name(h, c, n++); self->numberOfTimeRange = grib_arguments_get_name(h, c, n++); } -void grib_accessor_class_g2end_step_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_g2end_step_t::dump(grib_accessor* a, grib_dumper* dumper) +{ grib_dump_double(dumper, a, NULL); } // See GRIB-488 -bool is_special_expver(const grib_handle* h){ - int ret = 0; +bool is_special_expver(const grib_handle* h) +{ + int ret = 0; char strMarsExpVer[50] = {0,}; char strMarsClass[50] = {0,}; size_t slen = 50; - ret = grib_get_string(h, "mars.class", strMarsClass, &slen); + ret = grib_get_string(h, "mars.class", strMarsClass, &slen); if (ret == GRIB_SUCCESS && STR_EQUAL(strMarsClass, "em")) { // em = ERA-CLIM model integration for the 20th-century (ERA-20CM) slen = 50; - ret = grib_get_string(h, "experimentVersionNumber", strMarsExpVer, &slen); + ret = grib_get_string(h, "experimentVersionNumber", strMarsExpVer, &slen); if (ret == GRIB_SUCCESS && STR_EQUAL(strMarsExpVer, "1605")) { - return true; // Special case of expVer 1605 in class "em" + return true; // Special case of expVer 1605 in class "em" } } @@ -80,8 +83,8 @@ static int convert_time_range_long_( Assert(lengthOfTimeRange != NULL); if (indicatorOfUnitForTimeRange != stepUnits) { - eccodes::Step time_range{*lengthOfTimeRange, indicatorOfUnitForTimeRange}; - time_range.set_unit(eccodes::Unit{stepUnits}); + eccodes::Step time_range{ *lengthOfTimeRange, indicatorOfUnitForTimeRange }; + time_range.set_unit(eccodes::Unit{ stepUnits }); if (time_range.value() != time_range.value()) { return GRIB_DECODING_ERROR; } @@ -91,9 +94,10 @@ static int convert_time_range_long_( return GRIB_SUCCESS; } -int unpack_one_time_range_long_(grib_accessor* a, long* val, size_t* len){ +static int unpack_one_time_range_long_(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; - int err = 0; + int err = 0; long start_step_value; long step_units; long time_range_unit; @@ -139,9 +143,10 @@ int unpack_one_time_range_long_(grib_accessor* a, long* val, size_t* len){ return GRIB_SUCCESS; } -int unpack_one_time_range_double_(grib_accessor* a, double *val , size_t* len){ +static int unpack_one_time_range_double_(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; - int err = 0; + int err = 0; double start_step_value; long start_step_unit; long step_units; @@ -165,8 +170,8 @@ int unpack_one_time_range_double_(grib_accessor* a, double *val , size_t* len){ if ((err = grib_get_long_internal(h, self->typeOfTimeIncrement, &typeOfTimeIncrement))) return err; - eccodes::Step start_step{start_step_value, start_step_unit}; - eccodes::Step time_range{time_range_value, time_range_unit}; + eccodes::Step start_step{ start_step_value, start_step_unit }; + eccodes::Step time_range{ time_range_value, time_range_unit }; if (typeOfTimeIncrement == 1) { /* See GRIB-488 */ @@ -191,16 +196,23 @@ int unpack_one_time_range_double_(grib_accessor* a, double *val , size_t* len){ } #define MAX_NUM_TIME_RANGES 16 /* maximum number of time range specifications */ -int unpack_multiple_time_ranges_long_(grib_accessor* a, long* val, size_t* len){ +static int unpack_multiple_time_ranges_long_(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; int i = 0, err = 0; - grib_handle* h = grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); long numberOfTimeRange = 0, step_units = 0, start_step_value = 0; - size_t count = 0; - long arr_typeOfTimeIncrement[MAX_NUM_TIME_RANGES] = {0,}; - long arr_coded_unit[MAX_NUM_TIME_RANGES] = {0,}; - long arr_coded_time_range[MAX_NUM_TIME_RANGES] = {0,}; + size_t count = 0; + long arr_typeOfTimeIncrement[MAX_NUM_TIME_RANGES] = { + 0, + }; + long arr_coded_unit[MAX_NUM_TIME_RANGES] = { + 0, + }; + long arr_coded_time_range[MAX_NUM_TIME_RANGES] = { + 0, + }; if ((err = grib_get_long_internal(h, self->start_step_value, &start_step_value))) return err; @@ -243,30 +255,37 @@ int unpack_multiple_time_ranges_long_(grib_accessor* a, long* val, size_t* len){ return GRIB_DECODING_ERROR; } -int unpack_multiple_time_ranges_double_(grib_accessor* a, double* val, size_t* len){ +static int unpack_multiple_time_ranges_double_(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; int i = 0, err = 0; - grib_handle* h = grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); long numberOfTimeRange = 0; - long step_units = 0; - long start_step_value = 0; - long start_step_unit = 0; - - size_t count = 0; - long arr_typeOfTimeIncrement[MAX_NUM_TIME_RANGES] = {0, }; - long arr_coded_unit[MAX_NUM_TIME_RANGES] = {0, }; - long arr_coded_time_range[MAX_NUM_TIME_RANGES] = {0, }; + long step_units = 0; + long start_step_value = 0; + long start_step_unit = 0; + + size_t count = 0; + long arr_typeOfTimeIncrement[MAX_NUM_TIME_RANGES] = { + 0, + }; + long arr_coded_unit[MAX_NUM_TIME_RANGES] = { + 0, + }; + long arr_coded_time_range[MAX_NUM_TIME_RANGES] = { + 0, + }; if ((err = grib_get_long_internal(h, self->start_step_value, &start_step_value))) return err; if ((err = grib_get_long_internal(h, "startStepUnit", &start_step_unit))) return err; - eccodes::Step start_step{start_step_value, start_step_unit}; + eccodes::Step start_step{ start_step_value, start_step_unit }; if ((err = grib_get_long_internal(h, self->step_units, &step_units))) return err; - + if ((err = grib_get_long_internal(h, self->numberOfTimeRange, &numberOfTimeRange))) return err; if (numberOfTimeRange > MAX_NUM_TIME_RANGES) { @@ -290,7 +309,7 @@ int unpack_multiple_time_ranges_double_(grib_accessor* a, double* val, size_t* l long the_coded_unit = arr_coded_unit[i]; long the_coded_time_range = arr_coded_time_range[i]; - eccodes::Step time_range{the_coded_unit, the_coded_time_range}; + eccodes::Step time_range{ the_coded_unit, the_coded_time_range }; *val = (start_step + time_range).value(eccodes::Unit(step_units)); return GRIB_SUCCESS; @@ -305,10 +324,11 @@ int unpack_multiple_time_ranges_double_(grib_accessor* a, double* val, size_t* l // For the old implementation of unpack_long, see // src/deprecated/grib_accessor_class_g2end_step.unpack_long.cc // -int grib_accessor_class_g2end_step_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_g2end_step_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; + grib_handle* h = grib_handle_of_accessor(a); + int ret = 0; long start_step_value; long start_step_unit; long numberOfTimeRange; @@ -333,7 +353,7 @@ int grib_accessor_class_g2end_step_t::unpack_long(grib_accessor* a, long* val, s try { if (numberOfTimeRange == 1) { - ret = unpack_one_time_range_long_(a, val, len); + ret = unpack_one_time_range_long_(a, val, len); } else { ret = unpack_multiple_time_ranges_long_(a, val, len); @@ -347,10 +367,11 @@ int grib_accessor_class_g2end_step_t::unpack_long(grib_accessor* a, long* val, s return ret; } -int grib_accessor_class_g2end_step_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_g2end_step_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; + grib_handle* h = grib_handle_of_accessor(a); + int ret = 0; long start_step_value; long start_step_unit; long numberOfTimeRange; @@ -375,7 +396,7 @@ int grib_accessor_class_g2end_step_t::unpack_double(grib_accessor* a, double* va try { if (numberOfTimeRange == 1) { - ret = unpack_one_time_range_double_(a, val, len); + ret = unpack_one_time_range_double_(a, val, len); } else { ret = unpack_multiple_time_ranges_double_(a, val, len); @@ -389,10 +410,11 @@ int grib_accessor_class_g2end_step_t::unpack_double(grib_accessor* a, double* va return ret; } -int pack_long_(grib_accessor* a, const long end_step_value, const long end_step_unit){ +static int pack_long_(grib_accessor* a, const long end_step_value, const long end_step_unit) +{ grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - int err = 0; + grib_handle* h = grib_handle_of_accessor(a); + int err = 0; long year; long month; @@ -415,7 +437,7 @@ int pack_long_(grib_accessor* a, const long end_step_value, const long end_step_ double dend, dstep; const int show_units_for_hours = a->context->grib_hourly_steps_with_units; - eccodes::Step end_step{end_step_value, end_step_unit}; + eccodes::Step end_step{ end_step_value, end_step_unit }; /*point in time */ if (self->year == NULL) { @@ -446,10 +468,10 @@ int pack_long_(grib_accessor* a, const long end_step_value, const long end_step_ return err; long force_step_units; - if ((err= grib_get_long_internal(h, "forceStepUnits", &force_step_units)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(h, "forceStepUnits", &force_step_units)) != GRIB_SUCCESS) return err; - if (eccodes::Unit{start_step_unit} == eccodes::Unit{eccodes::Unit::Value::MISSING}) { + if (eccodes::Unit{ start_step_unit } == eccodes::Unit{ eccodes::Unit::Value::MISSING }) { grib_context_log(h->context, GRIB_LOG_ERROR, "missing start step unit"); return GRIB_WRONG_STEP_UNIT; @@ -458,7 +480,7 @@ int pack_long_(grib_accessor* a, const long end_step_value, const long end_step_ if ((err = grib_get_long_internal(h, self->typeOfTimeIncrement, &typeOfTimeIncrement))) return err; - eccodes::Step start_step{start_step_value, start_step_unit}; + eccodes::Step start_step{ start_step_value, start_step_unit }; eccodes::Step time_range = end_step - start_step; if (time_range.value() < 0) { @@ -473,7 +495,7 @@ int pack_long_(grib_accessor* a, const long end_step_value, const long end_step_ if (err != GRIB_SUCCESS) return err; - dstep = end_step.value(eccodes::Unit{eccodes::Unit::Value::DAY}); + dstep = end_step.value(eccodes::Unit{ eccodes::Unit::Value::DAY }); dend += dstep; err = grib_julian_to_datetime(dend, &year_of_end_of_interval, &month_of_end_of_interval, @@ -496,15 +518,15 @@ int pack_long_(grib_accessor* a, const long end_step_value, const long end_step_ return err; const char* forecast_time_value_key = "forecastTime"; - const char* forecast_time_unit_key = "indicatorOfUnitOfTimeRange"; + const char* forecast_time_unit_key = "indicatorOfUnitOfTimeRange"; eccodes::Step forecast_time_opt; eccodes::Step time_range_opt; - if (eccodes::Unit{force_step_units} == eccodes::Unit{eccodes::Unit::Value::MISSING}) { + if (eccodes::Unit{ force_step_units } == eccodes::Unit{ eccodes::Unit::Value::MISSING }) { std::tie(forecast_time_opt, time_range_opt) = find_common_units(start_step.optimize_unit(), time_range.optimize_unit()); } else { - forecast_time_opt = eccodes::Step{start_step.value(eccodes::Unit{force_step_units}), eccodes::Unit{force_step_units}}; - time_range_opt = eccodes::Step{time_range.value(eccodes::Unit{force_step_units}), eccodes::Unit{force_step_units}}; + forecast_time_opt = eccodes::Step{ start_step.value(eccodes::Unit{ force_step_units }), eccodes::Unit{ force_step_units } }; + time_range_opt = eccodes::Step{ time_range.value(eccodes::Unit{ force_step_units }), eccodes::Unit{ force_step_units } }; } if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->time_range_value, time_range_opt.value())) != GRIB_SUCCESS) @@ -519,13 +541,14 @@ int pack_long_(grib_accessor* a, const long end_step_value, const long end_step_ return GRIB_SUCCESS; } -int grib_accessor_class_g2end_step_t::unpack_string(grib_accessor* a, char* val, size_t* len){ +int grib_accessor_class_g2end_step_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ grib_accessor_g2end_step_t* self = (grib_accessor_g2end_step_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; - char fp_format[128] = "%g"; - size_t fp_format_len = sizeof(fp_format); - size_t step_len = 0; + grib_handle* h = grib_handle_of_accessor(a); + int ret = 0; + char fp_format[128] = "%g"; + size_t fp_format_len = sizeof(fp_format); + size_t step_len = 0; long step_value; long step_units; const int show_units_for_hours = a->context->grib_hourly_steps_with_units; @@ -562,7 +585,8 @@ int grib_accessor_class_g2end_step_t::unpack_string(grib_accessor* a, char* val, return GRIB_SUCCESS; } -int grib_accessor_class_g2end_step_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_g2end_step_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_handle* h = grib_handle_of_accessor(a); int ret; @@ -572,12 +596,12 @@ int grib_accessor_class_g2end_step_t::pack_long(grib_accessor* a, const long* va try { long end_step_unit; - if (eccodes::Unit{force_step_units} == eccodes::Unit{eccodes::Unit::Value::MISSING}) { + if (eccodes::Unit{ force_step_units } == eccodes::Unit{ eccodes::Unit::Value::MISSING }) { if ((ret = grib_get_long_internal(h, "endStepUnit", &end_step_unit)) != GRIB_SUCCESS) return ret; - if (eccodes::Unit{end_step_unit} == eccodes::Unit{eccodes::Unit::Value::MISSING}) - end_step_unit = eccodes::Unit{eccodes::Unit::Value::HOUR}.value(); + if (eccodes::Unit{ end_step_unit } == eccodes::Unit{ eccodes::Unit::Value::MISSING }) + end_step_unit = eccodes::Unit{ eccodes::Unit::Value::HOUR }.value(); } else { end_step_unit = force_step_units; @@ -591,15 +615,16 @@ int grib_accessor_class_g2end_step_t::pack_long(grib_accessor* a, const long* va return ret; } -int grib_accessor_class_g2end_step_t::pack_string(grib_accessor* a, const char* val, size_t* len){ +int grib_accessor_class_g2end_step_t::pack_string(grib_accessor* a, const char* val, size_t* len) +{ grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; + int ret = 0; long force_step_units; if ((ret = grib_get_long_internal(h, "forceStepUnits", &force_step_units)) != GRIB_SUCCESS) return ret; try { - eccodes::Step end_step = step_from_string(val, eccodes::Unit{force_step_units}); + eccodes::Step end_step = step_from_string(val, eccodes::Unit{ force_step_units }); end_step.optimize_unit(); if ((ret = grib_set_long_internal(h, "endStepUnit", end_step.unit().value())) != GRIB_SUCCESS) @@ -615,15 +640,16 @@ int grib_accessor_class_g2end_step_t::pack_string(grib_accessor* a, const char* return GRIB_SUCCESS; } -int grib_accessor_class_g2end_step_t::get_native_type(grib_accessor* a){ - grib_handle* h = grib_handle_of_accessor(a); +int grib_accessor_class_g2end_step_t::get_native_type(grib_accessor* a) +{ + grib_handle* h = grib_handle_of_accessor(a); const int show_units_for_hours = a->context->grib_hourly_steps_with_units; if (!show_units_for_hours) { long step_units = 0; if (grib_get_long_internal(h, "stepUnits", &step_units) == GRIB_SUCCESS) { - if (eccodes::Unit{step_units} == eccodes::Unit::Value::HOUR) { - return GRIB_TYPE_LONG; // For backward compatibility + if (eccodes::Unit{ step_units } == eccodes::Unit::Value::HOUR) { + return GRIB_TYPE_LONG; // For backward compatibility } } } diff --git a/src/accessor/grib_accessor_class_g2grid.cc b/src/accessor/grib_accessor_class_g2grid.cc index 8f0bee1e5..3bc0a9a22 100644 --- a/src/accessor/grib_accessor_class_g2grid.cc +++ b/src/accessor/grib_accessor_class_g2grid.cc @@ -19,8 +19,8 @@ void grib_accessor_class_g2grid_t::init(grib_accessor* a, const long l, grib_arg { grib_accessor_class_double_t::init(a, l, c); grib_accessor_g2grid_t* self = (grib_accessor_g2grid_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; self->latitude_first = grib_arguments_get_name(hand, c, n++); self->longitude_first = grib_arguments_get_name(hand, c, n++); @@ -108,7 +108,7 @@ int grib_accessor_class_g2grid_t::unpack_double(grib_accessor* a, double* val, s return GRIB_SUCCESS; } -long gcd(long a, long b) +static long gcd(long a, long b) { if (b > a) return gcd(b, a); @@ -117,12 +117,12 @@ long gcd(long a, long b) return gcd(b, a % b); } -long lcm(long a, long b) +static long lcm(long a, long b) { return a * b / gcd(a, b); } -int is_ok(const double* val, long v[6], double basic_angle, double sub_division) +static int is_ok(const double* val, long v[6], double basic_angle, double sub_division) { int i; int ok = 1; @@ -147,7 +147,7 @@ int is_ok(const double* val, long v[6], double basic_angle, double sub_division) return ok; } -int trial(const double* val, long v[6], long* basic_angle, long* sub_division) +static int trial(const double* val, long v[6], long* basic_angle, long* sub_division) { int i = 0; long ni, nj; diff --git a/src/accessor/grib_accessor_class_longitudes.cc b/src/accessor/grib_accessor_class_longitudes.cc index 72b96aaf9..a9ae31309 100644 --- a/src/accessor/grib_accessor_class_longitudes.cc +++ b/src/accessor/grib_accessor_class_longitudes.cc @@ -15,7 +15,6 @@ grib_accessor_class_longitudes_t _grib_accessor_class_longitudes{"longitudes"}; grib_accessor_class* grib_accessor_class_longitudes = &_grib_accessor_class_longitudes; - static int get_distinct(grib_accessor* a, double** val, long* len); int compare_doubles(const void* a, const void* b); void grib_accessor_class_longitudes_t::init(grib_accessor* a, const long l, grib_arguments* c){ diff --git a/src/accessor/grib_accessor_class_number_of_points_gaussian.cc b/src/accessor/grib_accessor_class_number_of_points_gaussian.cc index 9cabea10c..39324fbd3 100644 --- a/src/accessor/grib_accessor_class_number_of_points_gaussian.cc +++ b/src/accessor/grib_accessor_class_number_of_points_gaussian.cc @@ -11,27 +11,29 @@ #include "grib_accessor_class_number_of_points_gaussian.h" -grib_accessor_class_number_of_points_gaussian_t _grib_accessor_class_number_of_points_gaussian{"number_of_points_gaussian"}; +grib_accessor_class_number_of_points_gaussian_t _grib_accessor_class_number_of_points_gaussian{ "number_of_points_gaussian" }; grib_accessor_class* grib_accessor_class_number_of_points_gaussian = &_grib_accessor_class_number_of_points_gaussian; #define EFDEBUG 0 -void grib_accessor_class_number_of_points_gaussian_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_number_of_points_gaussian_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); - int n = 0; - grib_handle* h = grib_handle_of_accessor(a); + int n = 0; + grib_handle* h = grib_handle_of_accessor(a); grib_accessor_number_of_points_gaussian_t* self = (grib_accessor_number_of_points_gaussian_t*)a; - self->ni = grib_arguments_get_name(h, c, n++); - self->nj = grib_arguments_get_name(h, c, n++); - self->plpresent = grib_arguments_get_name(h, c, n++); - self->pl = grib_arguments_get_name(h, c, n++); - self->order = grib_arguments_get_name(h, c, n++); - self->lat_first = grib_arguments_get_name(h, c, n++); - self->lon_first = grib_arguments_get_name(h, c, n++); - self->lat_last = grib_arguments_get_name(h, c, n++); - self->lon_last = grib_arguments_get_name(h, c, n++); - self->support_legacy = grib_arguments_get_name(h, c, n++); + + self->ni = grib_arguments_get_name(h, c, n++); + self->nj = grib_arguments_get_name(h, c, n++); + self->plpresent = grib_arguments_get_name(h, c, n++); + self->pl = grib_arguments_get_name(h, c, n++); + self->order = grib_arguments_get_name(h, c, n++); + self->lat_first = grib_arguments_get_name(h, c, n++); + self->lon_first = grib_arguments_get_name(h, c, n++); + self->lat_last = grib_arguments_get_name(h, c, n++); + self->lon_last = grib_arguments_get_name(h, c, n++); + self->support_legacy = grib_arguments_get_name(h, c, n++); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->length = 0; @@ -40,12 +42,13 @@ void grib_accessor_class_number_of_points_gaussian_t::init(grib_accessor* a, con // Old implementation of num_points_reduced_gauss_old // See src/deprecated/grib_accessor_class_number_of_points_gaussian.cc // - -int angleApproximatelyEqual(double A, double B, double angular_precision){ +static int angleApproximatelyEqual(double A, double B, double angular_precision) +{ return angular_precision > 0 ? (fabs(A - B) <= angular_precision) : (A == B); } -double longitude_normalise(double lon, double minimum){ +static double longitude_normalise(double lon, double minimum) +{ while (lon < minimum) { lon += 360; } @@ -55,7 +58,8 @@ double longitude_normalise(double lon, double minimum){ return lon; } -void correctWestEast(long max_pl, double angular_precision, double* pWest, double* pEast){ +static void correctWestEast(long max_pl, double angular_precision, double* pWest, double* pEast) +{ double w, e; const double inc = 360.0 / max_pl; /*smallest increment*/ if (*pWest > *pEast) @@ -76,7 +80,8 @@ void correctWestEast(long max_pl, double angular_precision, double* pWest, doubl } } -int get_number_of_data_values(grib_handle* h, size_t* numDataValues){ +static int get_number_of_data_values(grib_handle* h, size_t* numDataValues) +{ int err = 0; long bpv = 0, bitmapPresent = 0; size_t bitmapLength = 0; @@ -110,11 +115,12 @@ int get_number_of_data_values(grib_handle* h, size_t* numDataValues){ int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len); int unpack_long_new(grib_accessor* a, long* val, size_t* len); -int grib_accessor_class_number_of_points_gaussian_t::unpack_long(grib_accessor* a, long* val, size_t* len){ - int err = GRIB_SUCCESS; - long support_legacy = 1; +int grib_accessor_class_number_of_points_gaussian_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ + int err = GRIB_SUCCESS; + long support_legacy = 1; grib_accessor_number_of_points_gaussian_t* self = (grib_accessor_number_of_points_gaussian_t*)a; - grib_handle* h = grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); if ((err = grib_get_long_internal(h, self->support_legacy, &support_legacy)) != GRIB_SUCCESS) return err; @@ -126,7 +132,8 @@ int grib_accessor_class_number_of_points_gaussian_t::unpack_long(grib_accessor* } /* New algorithm */ -int unpack_long_new(grib_accessor* a, long* val, size_t* len){ +int unpack_long_new(grib_accessor* a, long* val, size_t* len) +{ int err = GRIB_SUCCESS; int is_global = 0; long ni = 0, nj = 0, plpresent = 0, order = 0; @@ -141,7 +148,7 @@ int unpack_long_new(grib_accessor* a, long* val, size_t* len){ grib_handle* h = grib_handle_of_accessor(a); grib_accessor_number_of_points_gaussian_t* self = (grib_accessor_number_of_points_gaussian_t*)a; - grib_context* c = a->context; + grib_context* c = a->context; if ((err = grib_get_long_internal(h, self->ni, &ni)) != GRIB_SUCCESS) return err; @@ -161,8 +168,8 @@ int unpack_long_new(grib_accessor* a, long* val, size_t* len){ } if (plpresent) { - long max_pl = 0; - int j = 0; + long max_pl = 0; + int j = 0; // double lon_first_row = 0, lon_last_row = 0; /*reduced*/ @@ -211,8 +218,8 @@ int unpack_long_new(grib_accessor* a, long* val, size_t* len){ 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]; + // lon_first_row = ((ilon_first)*360.0) / pl[j]; + // lon_last_row = ((ilon_last)*360.0) / pl[j]; *val += row_count; } } @@ -234,7 +241,8 @@ int unpack_long_new(grib_accessor* a, long* val, size_t* len){ } /* With Legacy support */ -int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len){ +int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len) +{ int err = GRIB_SUCCESS; int is_global = 0; long ni = 0, nj = 0, plpresent = 0, order = 0; @@ -250,7 +258,7 @@ int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len){ size_t numDataValues = 0; grib_accessor_number_of_points_gaussian_t* self = (grib_accessor_number_of_points_gaussian_t*)a; - grib_context* c = a->context; + grib_context* c = a->context; if ((err = grib_get_long_internal(h, self->ni, &ni)) != GRIB_SUCCESS) return err; @@ -271,7 +279,7 @@ int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len){ if (plpresent) { long max_pl = 0; - int j = 0; + int j = 0; // double lon_first_row = 0, lon_last_row = 0; /*reduced*/ @@ -333,9 +341,9 @@ int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len){ } grib_get_reduced_row_wrapper(h, pl[j], lon_first, lon_last, &row_count, &ilon_first, &ilon_last); -// if ( row_count != pl[j] ) { -// printf("oops...... rc=%ld but pl[%d]=%ld\n", row_count, j,pl[j]); -// } + // if ( row_count != pl[j] ) { + // printf("oops...... rc=%ld but pl[%d]=%ld\n", row_count, j,pl[j]); + // } // lon_first_row = ((ilon_first)*360.0) / pl[j]; // lon_last_row = ((ilon_last)*360.0) / pl[j]; *val += row_count; diff --git a/src/accessor/grib_accessor_class_octahedral_gaussian.cc b/src/accessor/grib_accessor_class_octahedral_gaussian.cc index ca106dd4a..8c556e84a 100644 --- a/src/accessor/grib_accessor_class_octahedral_gaussian.cc +++ b/src/accessor/grib_accessor_class_octahedral_gaussian.cc @@ -36,7 +36,7 @@ void grib_accessor_class_octahedral_gaussian_t::init(grib_accessor* a, const lon * -4 ..-4 All below equator * Anything else is considered not octahedral */ -int is_pl_octahedral(const long pl[], size_t size){ +static int is_pl_octahedral(const long pl[], size_t size){ long i; long prev_diff = -1; for (i = 1; i < size; ++i) { diff --git a/src/accessor/grib_accessor_class_second_order_bits_per_value.cc b/src/accessor/grib_accessor_class_second_order_bits_per_value.cc index 1c253764a..ea7c4c931 100644 --- a/src/accessor/grib_accessor_class_second_order_bits_per_value.cc +++ b/src/accessor/grib_accessor_class_second_order_bits_per_value.cc @@ -35,7 +35,7 @@ static const size_t nbits[64] = { 0x1000000000000000, 0x2000000000000000, 0x4000000000000000, 0x8000000000000000 }; -int number_of_bits(size_t x, long* result){ +static int number_of_bits(size_t x, long* result){ const size_t* n = nbits; const int count = sizeof(nbits) / sizeof(nbits[0]); *result = 0; diff --git a/src/accessor/grib_accessor_class_smart_table.cc b/src/accessor/grib_accessor_class_smart_table.cc index b08e8b13b..1c49f2ab0 100644 --- a/src/accessor/grib_accessor_class_smart_table.cc +++ b/src/accessor/grib_accessor_class_smart_table.cc @@ -42,7 +42,7 @@ void thread_init() } #endif -int grib_load_smart_table(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_smart_table* t); +static int grib_load_smart_table(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_smart_table* t); void grib_accessor_class_smart_table_t::init(grib_accessor* a, const long len, grib_arguments* params) { @@ -162,7 +162,7 @@ grib_smart_table* load_table(grib_accessor* a) return t; } -int grib_load_smart_table(grib_context* c, const char* filename, +static int grib_load_smart_table(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_smart_table* t) { char line[1024] = {0,}; @@ -324,7 +324,7 @@ int grib_accessor_class_smart_table_t::unpack_string(grib_accessor* a, char* buf return GRIB_SUCCESS; } -int get_table_codes(grib_accessor* a) +static int get_table_codes(grib_accessor* a) { grib_accessor_smart_table_t* self = (grib_accessor_smart_table_t*)a; size_t size = 0; diff --git a/src/accessor/grib_accessor_class_step_human_readable.cc b/src/accessor/grib_accessor_class_step_human_readable.cc index ea5280632..929733705 100644 --- a/src/accessor/grib_accessor_class_step_human_readable.cc +++ b/src/accessor/grib_accessor_class_step_human_readable.cc @@ -11,28 +11,31 @@ #include "grib_accessor_class_step_human_readable.h" -grib_accessor_class_step_human_readable_t _grib_accessor_class_step_human_readable{"step_human_readable"}; +grib_accessor_class_step_human_readable_t _grib_accessor_class_step_human_readable{ "step_human_readable" }; grib_accessor_class* grib_accessor_class_step_human_readable = &_grib_accessor_class_step_human_readable; -void grib_accessor_class_step_human_readable_t::init(grib_accessor* a, const long len, grib_arguments* params){ +void grib_accessor_class_step_human_readable_t::init(grib_accessor* a, const long len, grib_arguments* params) +{ grib_accessor_class_gen_t::init(a, len, params); grib_accessor_step_human_readable_t* self = (grib_accessor_step_human_readable_t*)a; - int n = 0; + int n = 0; grib_handle* h = grib_handle_of_accessor(a); - self->stepUnits = grib_arguments_get_name(h, params, n++); - self->step = grib_arguments_get_name(h, params, n++); - a->length = 0; + self->stepUnits = grib_arguments_get_name(h, params, n++); + self->step = grib_arguments_get_name(h, params, n++); + a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -int grib_accessor_class_step_human_readable_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_step_human_readable_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_STRING; } -int get_step_human_readable(grib_handle* h, char* result, size_t* length){ - int err = 0; +static int get_step_human_readable(grib_handle* h, char* result, size_t* length) +{ + int err = 0; size_t slen = 2; long step, hour, minute, second; @@ -41,29 +44,33 @@ int get_step_human_readable(grib_handle* h, char* result, size_t* length){ */ if ((err = grib_set_string(h, "stepUnits", "s", &slen)) != GRIB_SUCCESS) return err; - if ((err = grib_get_long(h, "step", &step)) != GRIB_SUCCESS) + if ((err = grib_get_long(h, "step", &step)) != GRIB_SUCCESS) return err; - hour = step/3600; - minute = step/60 % 60; + hour = step / 3600; + minute = step / 60 % 60; second = step % 60; /* sprintf(result, "%ld:%ld:%ld", hour, minute, second); */ if (second) { snprintf(result, 1024, "%ldh %ldm %lds", hour, minute, second); - } else { - if (minute) snprintf(result, 1024, "%ldh %ldm", hour, minute); - else snprintf(result, 1024, "%ldh", hour); + } + else { + if (minute) + snprintf(result, 1024, "%ldh %ldm", hour, minute); + else + snprintf(result, 1024, "%ldh", hour); } *length = strlen(result); return GRIB_SUCCESS; } -int grib_accessor_class_step_human_readable_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ +int grib_accessor_class_step_human_readable_t::unpack_string(grib_accessor* a, char* buffer, size_t* len) +{ grib_accessor_step_human_readable_t* self = (grib_accessor_step_human_readable_t*)a; grib_handle* h = grib_handle_of_accessor(a); - long stepUnits; + long stepUnits = 0; int err = 0; /* Save the current value of stepUnits */ diff --git a/src/accessor/grib_accessor_class_suppressed.cc b/src/accessor/grib_accessor_class_suppressed.cc index 14d5932bc..10a99ee64 100644 --- a/src/accessor/grib_accessor_class_suppressed.cc +++ b/src/accessor/grib_accessor_class_suppressed.cc @@ -11,23 +11,25 @@ #include "grib_accessor_class_suppressed.h" -grib_accessor_class_suppressed_t _grib_accessor_class_suppressed{"suppressed"}; +grib_accessor_class_suppressed_t _grib_accessor_class_suppressed{ "suppressed" }; grib_accessor_class* grib_accessor_class_suppressed = &_grib_accessor_class_suppressed; -void grib_accessor_class_suppressed_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_suppressed_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_suppressed_t* self = (grib_accessor_suppressed_t*)a; - self->args = c; + self->args = c; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->length = 0; } -void log_message(grib_accessor* a){ +static void log_message(grib_accessor* a) +{ grib_accessor_suppressed_t* self = (grib_accessor_suppressed_t*)a; - int i = 0; - grib_handle* hand = grib_handle_of_accessor(a); + int i = 0; + grib_handle* hand = grib_handle_of_accessor(a); grib_context_log(a->context, GRIB_LOG_ERROR, "key '%s' is unavailable in this version.", a->name); @@ -40,26 +42,31 @@ void log_message(grib_accessor* a){ } } -int grib_accessor_class_suppressed_t::unpack_string(grib_accessor* a, char* val, size_t* len){ +int grib_accessor_class_suppressed_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ log_message(a); return GRIB_NOT_FOUND; } -int grib_accessor_class_suppressed_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_suppressed_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ log_message(a); return GRIB_NOT_FOUND; } -int grib_accessor_class_suppressed_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_suppressed_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ log_message(a); return GRIB_NOT_FOUND; } -int grib_accessor_class_suppressed_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_suppressed_t::value_count(grib_accessor* a, long* count) +{ *count = 1; return 0; } -int grib_accessor_class_suppressed_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_suppressed_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_STRING; } From d6562ddcd6a29f5bcc0d945e10893be622d65b34 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 8 May 2024 15:55:54 +0000 Subject: [PATCH 135/196] ECC-1823: GRIB2: Add climatological albedo local ECMWF parameter to pseudocentre ERA6 --- definitions/grib2/localConcepts/era6/cfName.def | 8 ++++++++ definitions/grib2/localConcepts/era6/name.def | 8 ++++++++ definitions/grib2/localConcepts/era6/paramId.def | 8 ++++++++ definitions/grib2/localConcepts/era6/shortName.def | 8 ++++++++ definitions/grib2/localConcepts/era6/units.def | 8 ++++++++ 5 files changed, 40 insertions(+) diff --git a/definitions/grib2/localConcepts/era6/cfName.def b/definitions/grib2/localConcepts/era6/cfName.def index b4593411b..04675741a 100644 --- a/definitions/grib2/localConcepts/era6/cfName.def +++ b/definitions/grib2/localConcepts/era6/cfName.def @@ -42,6 +42,14 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Albedo (climatological) +'surface_albedo' = { + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 193 ; + typeOfGeneratingProcess = 9 ; + } #Evaporation 'lwe_thickness_of_water_evaporation_amount' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/era6/name.def b/definitions/grib2/localConcepts/era6/name.def index a716f4abd..b5c4fefb8 100644 --- a/definitions/grib2/localConcepts/era6/name.def +++ b/definitions/grib2/localConcepts/era6/name.def @@ -124,6 +124,14 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Albedo (climatological) +'Albedo (climatological)' = { + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 193 ; + typeOfGeneratingProcess = 9 ; + } #Evaporation 'Evaporation' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/era6/paramId.def b/definitions/grib2/localConcepts/era6/paramId.def index 48ebc11f2..85dc31997 100644 --- a/definitions/grib2/localConcepts/era6/paramId.def +++ b/definitions/grib2/localConcepts/era6/paramId.def @@ -124,6 +124,14 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Albedo (climatological) +'174' = { + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 193 ; + typeOfGeneratingProcess = 9 ; + } #Evaporation '182' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/era6/shortName.def b/definitions/grib2/localConcepts/era6/shortName.def index 02efcff3c..0b9c836b9 100644 --- a/definitions/grib2/localConcepts/era6/shortName.def +++ b/definitions/grib2/localConcepts/era6/shortName.def @@ -124,6 +124,14 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Albedo (climatological) +'al' = { + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 193 ; + typeOfGeneratingProcess = 9 ; + } #Evaporation 'e' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/era6/units.def b/definitions/grib2/localConcepts/era6/units.def index 828da275e..699b0c19a 100644 --- a/definitions/grib2/localConcepts/era6/units.def +++ b/definitions/grib2/localConcepts/era6/units.def @@ -124,6 +124,14 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Albedo (climatological) +'(0 - 1)' = { + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 193 ; + typeOfGeneratingProcess = 9 ; + } #Evaporation 'm of water equivalent' = { localTablesVersion = 1 ; From e47f0922f42e4eb328782c5ceaa3df69dcc79849 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 9 May 2024 12:51:25 +0100 Subject: [PATCH 136/196] Move functions from header to local static. Use 'pragma once' --- src/accessor/grib_accessor_class_ibmfloat.cc | 91 ++++++++++++++----- src/accessor/grib_accessor_class_ibmfloat.h | 36 +------- src/accessor/grib_accessor_class_ieeefloat.cc | 74 +++++++++++---- src/accessor/grib_accessor_class_ieeefloat.h | 34 +------ 4 files changed, 124 insertions(+), 111 deletions(-) diff --git a/src/accessor/grib_accessor_class_ibmfloat.cc b/src/accessor/grib_accessor_class_ibmfloat.cc index f3b0f8b98..c5766db01 100644 --- a/src/accessor/grib_accessor_class_ibmfloat.cc +++ b/src/accessor/grib_accessor_class_ibmfloat.cc @@ -11,37 +11,72 @@ #include "grib_accessor_class_ibmfloat.h" -grib_accessor_class_ibmfloat_t _grib_accessor_class_ibmfloat{"ibmfloat"}; +grib_accessor_class_ibmfloat_t _grib_accessor_class_ibmfloat{ "ibmfloat" }; grib_accessor_class* grib_accessor_class_ibmfloat = &_grib_accessor_class_ibmfloat; -void grib_accessor_class_ibmfloat_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_ibmfloat_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_double_t::init(a, len, arg); grib_accessor_ibmfloat_t* self = (grib_accessor_ibmfloat_t*)a; - long count = 0; + long count = 0; self->arg = arg; - a->value_count(&count); a->length = 4 * count; + a->value_count(&count); + a->length = 4 * count; Assert(a->length >= 0); } -int grib_accessor_class_ibmfloat_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +template +static int unpack(grib_accessor* a, T* val, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + unsigned long rlen = 0; + long count = 0; + int err = 0; + unsigned long i = 0; + long bitp = a->offset * 8; + grib_handle* hand = grib_handle_of_accessor(a); + + err = a->value_count(&count); + if (err) + return err; + rlen = count; + + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %lu values", *len, a->name, rlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < rlen; i++) + val[i] = (T)grib_long_to_ibm(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); + + *len = rlen; + return GRIB_SUCCESS; +} + +int grib_accessor_class_ibmfloat_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_ibmfloat_t::unpack_float(grib_accessor* a, float* val, size_t* len){ +int grib_accessor_class_ibmfloat_t::unpack_float(grib_accessor* a, float* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_ibmfloat_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_ibmfloat_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_ibmfloat_t* self = (grib_accessor_ibmfloat_t*)a; - int ret = 0; - unsigned long i = 0; - unsigned long rlen = *len; - size_t buflen = 0; - unsigned char* buf = NULL; - long off = 0; + + int ret = 0; + unsigned long i = 0; + unsigned long rlen = *len; + size_t buflen = 0; + unsigned char* buf = NULL; + long off = 0; if (*len < 1) { grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it packs at least 1 value", a->name); @@ -50,11 +85,10 @@ int grib_accessor_class_ibmfloat_t::pack_double(grib_accessor* a, const double* } if (rlen == 1) { - - //double x = 0; - //grib_nearest_smaller_ibm_float(val[0],&x); - //double y = grib_long_to_ibm(grib_ibm_to_long(val[0])); - //printf("IBMFLOAT val=%.20f nearest_smaller_ibm_float=%.20f long_to_ibm=%.20f\n",val[0],x ,y); + // double x = 0; + // grib_nearest_smaller_ibm_float(val[0],&x); + // double y = grib_long_to_ibm(grib_ibm_to_long(val[0])); + // printf("IBMFLOAT val=%.20f nearest_smaller_ibm_float=%.20f long_to_ibm=%.20f\n",val[0],x ,y); off = a->byte_offset() * 8; ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, grib_ibm_to_long(val[0]), &off, 32); @@ -87,11 +121,13 @@ int grib_accessor_class_ibmfloat_t::pack_double(grib_accessor* a, const double* return ret; } -long grib_accessor_class_ibmfloat_t::byte_count(grib_accessor* a){ +long grib_accessor_class_ibmfloat_t::byte_count(grib_accessor* a) +{ return a->length; } -int grib_accessor_class_ibmfloat_t::value_count(grib_accessor* a, long* len){ +int grib_accessor_class_ibmfloat_t::value_count(grib_accessor* a, long* len) +{ grib_accessor_ibmfloat_t* self = (grib_accessor_ibmfloat_t*)a; *len = 0; if (!self->arg) { @@ -101,19 +137,24 @@ int grib_accessor_class_ibmfloat_t::value_count(grib_accessor* a, long* len){ return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); } -long grib_accessor_class_ibmfloat_t::byte_offset(grib_accessor* a){ +long grib_accessor_class_ibmfloat_t::byte_offset(grib_accessor* a) +{ return a->offset; } -void grib_accessor_class_ibmfloat_t::update_size(grib_accessor* a, size_t s){ +void grib_accessor_class_ibmfloat_t::update_size(grib_accessor* a, size_t s) +{ a->length = (long)s; Assert(a->length >= 0); } -long grib_accessor_class_ibmfloat_t::next_offset(grib_accessor* a){ - return a->byte_offset() + a->byte_count();} +long grib_accessor_class_ibmfloat_t::next_offset(grib_accessor* a) +{ + return a->byte_offset() + a->byte_count(); +} -int grib_accessor_class_ibmfloat_t::nearest_smaller_value(grib_accessor* a, double val, double* nearest){ +int grib_accessor_class_ibmfloat_t::nearest_smaller_value(grib_accessor* a, double val, double* nearest) +{ int ret = 0; if (grib_nearest_smaller_ibm_float(val, nearest) == GRIB_INTERNAL_ERROR) { grib_context_log(a->context, GRIB_LOG_ERROR, "ibm_float:nearest_smaller_value overflow value=%g", val); diff --git a/src/accessor/grib_accessor_class_ibmfloat.h b/src/accessor/grib_accessor_class_ibmfloat.h index 9291d30a3..66bd01132 100644 --- a/src/accessor/grib_accessor_class_ibmfloat.h +++ b/src/accessor/grib_accessor_class_ibmfloat.h @@ -8,10 +8,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_ibmfloat_h -#define eccodes_accessor_ibmfloat_h +#pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_double.h" class grib_accessor_ibmfloat_t : public grib_accessor_double_t @@ -36,36 +34,4 @@ class grib_accessor_class_ibmfloat_t : public grib_accessor_class_double_t void init(grib_accessor*, const long, grib_arguments*) override; void update_size(grib_accessor*, size_t) override; int nearest_smaller_value(grib_accessor*, double, double*) override; -private: - template int unpack(grib_accessor*, T*, size_t*); }; - - -template -int grib_accessor_class_ibmfloat_t::unpack(grib_accessor* a, T* val, size_t* len){ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - unsigned long rlen = 0; - long count = 0; - int err = 0; - unsigned long i = 0; - long bitp = a->offset * 8; - grib_handle* hand = grib_handle_of_accessor(a); - - err = a->value_count(&count); if (err) - return err; - rlen = count; - - if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %lu values", *len, a->name, rlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < rlen; i++) - val[i] = (T)grib_long_to_ibm(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); - - *len = rlen; - return GRIB_SUCCESS; -} - -#endif /* eccodes_accessor_ibmfloat_h */ diff --git a/src/accessor/grib_accessor_class_ieeefloat.cc b/src/accessor/grib_accessor_class_ieeefloat.cc index 53894a8a6..64b08fe50 100644 --- a/src/accessor/grib_accessor_class_ieeefloat.cc +++ b/src/accessor/grib_accessor_class_ieeefloat.cc @@ -11,20 +11,23 @@ #include "grib_accessor_class_ieeefloat.h" -grib_accessor_class_ieeefloat_t _grib_accessor_class_ieeefloat{"ieeefloat"}; +grib_accessor_class_ieeefloat_t _grib_accessor_class_ieeefloat{ "ieeefloat" }; grib_accessor_class* grib_accessor_class_ieeefloat = &_grib_accessor_class_ieeefloat; -void grib_accessor_class_ieeefloat_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_ieeefloat_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_double_t::init(a, len, arg); grib_accessor_ieeefloat_t* self = (grib_accessor_ieeefloat_t*)a; - long count = 0; - self->arg = arg; - a->value_count(&count); a->length = 4 * count; + long count = 0; + self->arg = arg; + a->value_count(&count); + a->length = 4 * count; Assert(a->length >= 0); } -int grib_accessor_class_ieeefloat_t::value_count(grib_accessor* a, long* len){ +int grib_accessor_class_ieeefloat_t::value_count(grib_accessor* a, long* len) +{ grib_accessor_ieeefloat_t* self = (grib_accessor_ieeefloat_t*)a; *len = 0; @@ -35,14 +38,16 @@ int grib_accessor_class_ieeefloat_t::value_count(grib_accessor* a, long* len){ return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); } -int grib_accessor_class_ieeefloat_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_ieeefloat_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_ieeefloat_t* self = (grib_accessor_ieeefloat_t*)a; - int ret = 0; - unsigned long i = 0; - unsigned long rlen = (unsigned long)*len; - size_t buflen = 0; - unsigned char* buf = NULL; - long off = 0; + + int ret = 0; + unsigned long i = 0; + unsigned long rlen = (unsigned long)*len; + size_t buflen = 0; + unsigned char* buf = NULL; + long off = 0; if (*len < 1) { grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it packs at least 1 value", a->name); @@ -55,7 +60,7 @@ int grib_accessor_class_ieeefloat_t::pack_double(grib_accessor* a, const double* ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, grib_ieee_to_long(val[0]), &off, 32); if (*len > 1) grib_context_log(a->context, GRIB_LOG_WARNING, "ieeefloat: Trying to pack %zu values in a scalar %s, packing first value", - *len, a->name); + *len, a->name); if (ret == GRIB_SUCCESS) len[0] = 1; return ret; @@ -80,19 +85,52 @@ int grib_accessor_class_ieeefloat_t::pack_double(grib_accessor* a, const double* return ret; } -int grib_accessor_class_ieeefloat_t::unpack_double(grib_accessor* a, double* val, size_t* len){ + +template +static int unpack(grib_accessor* a, T* val, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + + long rlen = 0; + int err = 0; + long i = 0; + long bitp = a->offset * 8; + grib_handle* hand = grib_handle_of_accessor(a); + + err = a->value_count(&rlen); + if (err) + return err; + + if (*len < (size_t)rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %ld values", *len, a->name, rlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < rlen; i++) + val[i] = (T)grib_long_to_ieee(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); + + *len = rlen; + return GRIB_SUCCESS; +} + +int grib_accessor_class_ieeefloat_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ return unpack(a, val, len); } -int grib_accessor_class_ieeefloat_t::unpack_float(grib_accessor* a, float* val, size_t* len){ +int grib_accessor_class_ieeefloat_t::unpack_float(grib_accessor* a, float* val, size_t* len) +{ return unpack(a, val, len); } -void grib_accessor_class_ieeefloat_t::update_size(grib_accessor* a, size_t s){ +void grib_accessor_class_ieeefloat_t::update_size(grib_accessor* a, size_t s) +{ a->length = (long)s; Assert(a->length >= 0); } -int grib_accessor_class_ieeefloat_t::nearest_smaller_value(grib_accessor* a, double val, double* nearest){ +int grib_accessor_class_ieeefloat_t::nearest_smaller_value(grib_accessor* a, double val, double* nearest) +{ return grib_nearest_smaller_ieee_float(val, nearest); } diff --git a/src/accessor/grib_accessor_class_ieeefloat.h b/src/accessor/grib_accessor_class_ieeefloat.h index 100b2ad6a..27536169f 100644 --- a/src/accessor/grib_accessor_class_ieeefloat.h +++ b/src/accessor/grib_accessor_class_ieeefloat.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_ieeefloat_h -#define eccodes_accessor_ieeefloat_h +#pragma once #include "grib_accessor_class_double.h" @@ -32,35 +31,4 @@ class grib_accessor_class_ieeefloat_t : public grib_accessor_class_double_t void init(grib_accessor*, const long, grib_arguments*) override; void update_size(grib_accessor*, size_t) override; int nearest_smaller_value(grib_accessor* a, double val, double* nearest) override; - -private: - template int unpack(grib_accessor*, T*, size_t*); }; - - -template -int grib_accessor_class_ieeefloat_t::unpack(grib_accessor* a, T* val, size_t* len){ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - long rlen = 0; - int err = 0; - long i = 0; - long bitp = a->offset * 8; - grib_handle* hand = grib_handle_of_accessor(a); - - err = a->value_count(&rlen); if (err) - return err; - - if (*len < (size_t)rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%zu) for %s, it contains %ld values", *len, a->name, rlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < rlen; i++) - val[i] = (T)grib_long_to_ieee(grib_decode_unsigned_long(hand->buffer->data, &bitp, 32)); - - *len = rlen; - return GRIB_SUCCESS; -} - -#endif /* eccodes_accessor_ieeefloat_h */ From afb4271f49de142e6659a6be07a7d88bd0298c37 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 9 May 2024 13:23:08 +0100 Subject: [PATCH 137/196] Cosmetics --- src/accessor/grib_accessor_class_data_ccsds_packing.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.h b/src/accessor/grib_accessor_class_data_ccsds_packing.h index c93c0d24c..d4d97bede 100644 --- a/src/accessor/grib_accessor_class_data_ccsds_packing.h +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.h @@ -31,7 +31,6 @@ class grib_accessor_data_ccsds_packing_t : public grib_accessor_values_t }; -// TODO(maee): if libaec is not available, this class should not be defined class grib_accessor_class_data_ccsds_packing_t : public grib_accessor_class_values_t { public: From 56617003675e6ba6b5e10bc5853c6f289e714792 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 10 May 2024 11:05:29 +0000 Subject: [PATCH 138/196] ECC-1820: Use 'pragma once' in all header files --- src/accessor/grib_accessor_class_abstract_long_vector.h | 4 +--- src/accessor/grib_accessor_class_abstract_vector.h | 4 +--- src/accessor/grib_accessor_class_ascii.h | 4 +--- src/accessor/grib_accessor_class_bit.h | 4 +--- src/accessor/grib_accessor_class_bitmap.h | 4 +--- src/accessor/grib_accessor_class_bits.h | 4 +--- src/accessor/grib_accessor_class_bits_per_value.h | 4 +--- src/accessor/grib_accessor_class_blob.h | 4 +--- src/accessor/grib_accessor_class_budgdate.h | 4 +--- src/accessor/grib_accessor_class_bufr_data_array.h | 5 +---- src/accessor/grib_accessor_class_bufr_data_element.h | 4 +--- src/accessor/grib_accessor_class_bufr_elements_table.h | 4 +--- src/accessor/grib_accessor_class_bufr_extract_area_subsets.h | 4 +--- .../grib_accessor_class_bufr_extract_datetime_subsets.h | 4 +--- src/accessor/grib_accessor_class_bufr_extract_subsets.h | 4 +--- src/accessor/grib_accessor_class_bufr_group.h | 4 +--- src/accessor/grib_accessor_class_bufr_simple_thinning.h | 4 +--- src/accessor/grib_accessor_class_bufr_string_values.h | 4 +--- .../grib_accessor_class_bufrdc_expanded_descriptors.h | 4 +--- src/accessor/grib_accessor_class_bytes.h | 4 +--- .../grib_accessor_class_change_alternative_row_scanning.h | 4 +--- src/accessor/grib_accessor_class_change_scanning_direction.h | 4 +--- src/accessor/grib_accessor_class_check_internal_version.h | 4 +--- src/accessor/grib_accessor_class_closest_date.h | 4 +--- src/accessor/grib_accessor_class_codeflag.h | 4 +--- src/accessor/grib_accessor_class_codetable_title.h | 4 +--- src/accessor/grib_accessor_class_codetable_units.h | 4 +--- src/accessor/grib_accessor_class_concept.h | 4 +--- src/accessor/grib_accessor_class_count_file.h | 4 +--- src/accessor/grib_accessor_class_count_missing.h | 4 +--- src/accessor/grib_accessor_class_count_total.h | 4 +--- src/accessor/grib_accessor_class_data_apply_bitmap.h | 1 - .../grib_accessor_class_data_apply_boustrophedonic.h | 1 - .../grib_accessor_class_data_apply_boustrophedonic_bitmap.h | 5 +---- src/accessor/grib_accessor_class_data_ccsds_packing.h | 1 - src/accessor/grib_accessor_class_data_complex_packing.h | 1 - src/accessor/grib_accessor_class_data_dummy_field.h | 5 +---- src/accessor/grib_accessor_class_data_g1complex_packing.h | 1 - ...cessor_class_data_g1second_order_constant_width_packing.h | 1 - ...ssor_class_data_g1second_order_general_extended_packing.h | 1 - ...grib_accessor_class_data_g1second_order_general_packing.h | 1 - ...b_accessor_class_data_g1second_order_row_by_row_packing.h | 1 - src/accessor/grib_accessor_class_data_g1secondary_bitmap.h | 1 - src/accessor/grib_accessor_class_data_g1shsimple_packing.h | 1 - src/accessor/grib_accessor_class_data_g1simple_packing.h | 1 - src/accessor/grib_accessor_class_data_g22order_packing.h | 1 - src/accessor/grib_accessor_class_data_g2bifourier_packing.h | 1 - src/accessor/grib_accessor_class_data_g2complex_packing.h | 1 - src/accessor/grib_accessor_class_data_g2secondary_bitmap.h | 1 - src/accessor/grib_accessor_class_data_g2shsimple_packing.h | 1 - src/accessor/grib_accessor_class_data_g2simple_packing.h | 4 +--- ...accessor_class_data_g2simple_packing_with_preprocessing.h | 1 - src/accessor/grib_accessor_class_data_jpeg2000_packing.h | 1 - src/accessor/grib_accessor_class_data_raw_packing.h | 1 - src/accessor/grib_accessor_class_data_run_length_packing.h | 1 - src/accessor/grib_accessor_class_data_secondary_bitmap.h | 1 - src/accessor/grib_accessor_class_data_sh_packed.h | 1 - src/accessor/grib_accessor_class_data_sh_unpacked.h | 1 - src/accessor/grib_accessor_class_data_shsimple_packing.h | 1 - src/accessor/grib_accessor_class_data_simple_packing.h | 1 - src/accessor/grib_accessor_class_decimal_precision.h | 5 +---- src/accessor/grib_accessor_class_dictionary.h | 5 +---- src/accessor/grib_accessor_class_dirty.h | 5 +---- src/accessor/grib_accessor_class_divdouble.h | 5 +---- src/accessor/grib_accessor_class_double.h | 5 +---- src/accessor/grib_accessor_class_element.h | 5 +---- src/accessor/grib_accessor_class_evaluate.h | 5 +---- src/accessor/grib_accessor_class_expanded_descriptors.h | 5 +---- .../grib_accessor_class_from_scale_factor_scaled_value.h | 4 +--- src/accessor/grib_accessor_class_g1_half_byte_codeflag.h | 4 +--- src/accessor/grib_accessor_class_g1_message_length.h | 4 +--- src/accessor/grib_accessor_class_g1_section4_length.h | 4 +--- src/accessor/grib_accessor_class_g1bitmap.h | 4 +--- src/accessor/grib_accessor_class_g1date.h | 4 +--- src/accessor/grib_accessor_class_g1day_of_the_year_date.h | 4 +--- src/accessor/grib_accessor_class_g1end_of_interval_monthly.h | 4 +--- src/accessor/grib_accessor_class_g1fcperiod.h | 4 +--- src/accessor/grib_accessor_class_g1forecastmonth.h | 4 +--- src/accessor/grib_accessor_class_g1monthlydate.h | 4 +--- ...grib_accessor_class_g1number_of_coded_values_sh_complex.h | 4 +--- .../grib_accessor_class_g1number_of_coded_values_sh_simple.h | 4 +--- src/accessor/grib_accessor_class_g1step_range.h | 4 +--- src/accessor/grib_accessor_class_g1verificationdate.h | 4 +--- src/accessor/grib_accessor_class_g2_aerosol.h | 4 +--- src/accessor/grib_accessor_class_g2_chemical.h | 4 +--- src/accessor/grib_accessor_class_g2_eps.h | 4 +--- src/accessor/grib_accessor_class_g2_mars_labeling.h | 4 +--- src/accessor/grib_accessor_class_g2bitmap.h | 4 +--- src/accessor/grib_accessor_class_g2bitmap_present.h | 4 +--- src/accessor/grib_accessor_class_g2date.h | 4 +--- src/accessor/grib_accessor_class_g2end_step.h | 4 +--- src/accessor/grib_accessor_class_g2grid.h | 4 +--- src/accessor/grib_accessor_class_g2latlon.h | 4 +--- src/accessor/grib_accessor_class_g2level.h | 4 +--- src/accessor/grib_accessor_class_g2lon.h | 4 +--- src/accessor/grib_accessor_class_g2step_range.h | 4 +--- src/accessor/grib_accessor_class_gaussian_grid_name.h | 4 +--- src/accessor/grib_accessor_class_gds_is_present.h | 4 +--- src/accessor/grib_accessor_class_gds_not_present_bitmap.h | 4 +--- src/accessor/grib_accessor_class_getenv.h | 4 +--- src/accessor/grib_accessor_class_global_gaussian.h | 4 +--- src/accessor/grib_accessor_class_group.h | 4 +--- src/accessor/grib_accessor_class_gts_header.h | 4 +--- src/accessor/grib_accessor_class_hash_array.h | 4 +--- src/accessor/grib_accessor_class_headers_only.h | 4 +--- src/accessor/grib_accessor_class_ifs_param.h | 4 +--- src/accessor/grib_accessor_class_julian_date.h | 4 +--- src/accessor/grib_accessor_class_julian_day.h | 4 +--- src/accessor/grib_accessor_class_ksec1expver.h | 4 +--- src/accessor/grib_accessor_class_label.h | 4 +--- src/accessor/grib_accessor_class_latitudes.h | 4 +--- src/accessor/grib_accessor_class_latlon_increment.h | 4 +--- src/accessor/grib_accessor_class_latlonvalues.h | 4 +--- src/accessor/grib_accessor_class_library_version.h | 4 +--- src/accessor/grib_accessor_class_local_definition.h | 4 +--- src/accessor/grib_accessor_class_long_vector.h | 4 +--- src/accessor/grib_accessor_class_longitudes.h | 4 +--- src/accessor/grib_accessor_class_lookup.h | 4 +--- src/accessor/grib_accessor_class_mars_param.h | 4 +--- src/accessor/grib_accessor_class_mars_step.h | 4 +--- src/accessor/grib_accessor_class_md5.h | 4 +--- src/accessor/grib_accessor_class_message.h | 4 +--- src/accessor/grib_accessor_class_message_copy.h | 4 +--- src/accessor/grib_accessor_class_multdouble.h | 4 +--- src/accessor/grib_accessor_class_non_alpha.h | 4 +--- src/accessor/grib_accessor_class_number_of_coded_values.h | 4 +--- src/accessor/grib_accessor_class_number_of_points.h | 4 +--- src/accessor/grib_accessor_class_number_of_points_gaussian.h | 4 +--- src/accessor/grib_accessor_class_number_of_values.h | 4 +--- .../grib_accessor_class_number_of_values_data_raw_packing.h | 4 +--- src/accessor/grib_accessor_class_octahedral_gaussian.h | 4 +--- src/accessor/grib_accessor_class_octet_number.h | 4 +--- src/accessor/grib_accessor_class_offset_file.h | 4 +--- src/accessor/grib_accessor_class_offset_values.h | 4 +--- src/accessor/grib_accessor_class_optimal_step_units.h | 4 +--- src/accessor/grib_accessor_class_pack_bufr_values.h | 4 +--- src/accessor/grib_accessor_class_packing_type.h | 4 +--- src/accessor/grib_accessor_class_pad.h | 4 +--- src/accessor/grib_accessor_class_padding.h | 4 +--- src/accessor/grib_accessor_class_padto.h | 4 +--- src/accessor/grib_accessor_class_padtoeven.h | 4 +--- src/accessor/grib_accessor_class_padtomultiple.h | 4 +--- src/accessor/grib_accessor_class_position.h | 4 +--- src/accessor/grib_accessor_class_proj_string.h | 4 +--- src/accessor/grib_accessor_class_raw.h | 4 +--- src/accessor/grib_accessor_class_rdbtime_guess_date.h | 4 +--- src/accessor/grib_accessor_class_reference_value_error.h | 4 +--- src/accessor/grib_accessor_class_round.h | 4 +--- src/accessor/grib_accessor_class_scale.h | 4 +--- src/accessor/grib_accessor_class_scale_values.h | 4 +--- .../grib_accessor_class_second_order_bits_per_value.h | 4 +--- src/accessor/grib_accessor_class_section.h | 4 +--- src/accessor/grib_accessor_class_section_length.h | 4 +--- src/accessor/grib_accessor_class_section_padding.h | 4 +--- src/accessor/grib_accessor_class_section_pointer.h | 4 +--- src/accessor/grib_accessor_class_select_step_template.h | 4 +--- src/accessor/grib_accessor_class_sexagesimal2decimal.h | 4 +--- src/accessor/grib_accessor_class_signed.h | 4 +--- src/accessor/grib_accessor_class_signed_bits.h | 4 +--- src/accessor/grib_accessor_class_simple_packing_error.h | 4 +--- src/accessor/grib_accessor_class_size.h | 4 +--- src/accessor/grib_accessor_class_smart_table_column.h | 4 +--- src/accessor/grib_accessor_class_spd.h | 4 +--- src/accessor/grib_accessor_class_spectral_truncation.h | 4 +--- src/accessor/grib_accessor_class_sprintf.h | 4 +--- src/accessor/grib_accessor_class_statistics.h | 4 +--- src/accessor/grib_accessor_class_statistics_spectral.h | 4 +--- src/accessor/grib_accessor_class_step_human_readable.h | 4 +--- src/accessor/grib_accessor_class_step_in_units.h | 4 +--- src/accessor/grib_accessor_class_sum.h | 4 +--- src/accessor/grib_accessor_class_suppressed.h | 4 +--- src/accessor/grib_accessor_class_time.h | 4 +--- src/accessor/grib_accessor_class_to_double.h | 4 +--- src/accessor/grib_accessor_class_to_integer.h | 4 +--- src/accessor/grib_accessor_class_to_string.h | 4 +--- src/accessor/grib_accessor_class_transient_darray.h | 4 +--- src/accessor/grib_accessor_class_trim.h | 4 +--- src/accessor/grib_accessor_class_uint16.h | 4 +--- src/accessor/grib_accessor_class_uint32.h | 4 +--- src/accessor/grib_accessor_class_uint32_little_endian.h | 4 +--- src/accessor/grib_accessor_class_uint64.h | 4 +--- src/accessor/grib_accessor_class_uint64_little_endian.h | 4 +--- src/accessor/grib_accessor_class_uint8.h | 4 +--- src/accessor/grib_accessor_class_unexpanded_descriptors.h | 4 +--- src/accessor/grib_accessor_class_unpack_bufr_values.h | 4 +--- src/accessor/grib_accessor_class_unsigned_bits.h | 4 +--- src/accessor/grib_accessor_class_validity_date.h | 4 +--- src/accessor/grib_accessor_class_validity_time.h | 4 +--- src/accessor/grib_accessor_class_vector.h | 4 +--- src/accessor/grib_accessor_class_when.h | 4 +--- 190 files changed, 164 insertions(+), 529 deletions(-) diff --git a/src/accessor/grib_accessor_class_abstract_long_vector.h b/src/accessor/grib_accessor_class_abstract_long_vector.h index 0585a5819..94ed9d636 100644 --- a/src/accessor/grib_accessor_class_abstract_long_vector.h +++ b/src/accessor/grib_accessor_class_abstract_long_vector.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_abstract_long_vector_h -#define eccodes_accessor_abstract_long_vector_h +#pragma once #include "grib_accessor_class_gen.h" @@ -29,4 +28,3 @@ class grib_accessor_class_abstract_long_vector_t : public grib_accessor_class_ge grib_accessor_class_abstract_long_vector_t(const char* name) : grib_accessor_class_gen_t(name) {} grib_accessor* create_empty_accessor() override { return new grib_accessor_abstract_long_vector_t{}; } }; -#endif /* eccodes_accessor_abstract_long_vector_h */ diff --git a/src/accessor/grib_accessor_class_abstract_vector.h b/src/accessor/grib_accessor_class_abstract_vector.h index 7d5dd13df..b721a3adb 100644 --- a/src/accessor/grib_accessor_class_abstract_vector.h +++ b/src/accessor/grib_accessor_class_abstract_vector.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_abstract_vector_h -#define eccodes_accessor_abstract_vector_h +#pragma once #include "grib_accessor_class_double.h" @@ -28,4 +27,3 @@ class grib_accessor_class_abstract_vector_t : public grib_accessor_class_double_ grib_accessor_class_abstract_vector_t(const char* name) : grib_accessor_class_double_t(name) {} grib_accessor* create_empty_accessor() override { return new grib_accessor_abstract_vector_t{}; } }; -#endif /* eccodes_accessor_abstract_vector_h */ diff --git a/src/accessor/grib_accessor_class_ascii.h b/src/accessor/grib_accessor_class_ascii.h index 1fa848236..8bef5eaac 100644 --- a/src/accessor/grib_accessor_class_ascii.h +++ b/src/accessor/grib_accessor_class_ascii.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_ascii_h -#define eccodes_accessor_ascii_h +#pragma once #include "grib_accessor_class_gen.h" @@ -38,4 +37,3 @@ class grib_accessor_class_ascii_t : public grib_accessor_class_gen_t void init(grib_accessor*, const long, grib_arguments*) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_ascii_h */ diff --git a/src/accessor/grib_accessor_class_bit.h b/src/accessor/grib_accessor_class_bit.h index 7ad258b03..188d5e370 100644 --- a/src/accessor/grib_accessor_class_bit.h +++ b/src/accessor/grib_accessor_class_bit.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bit_h -#define eccodes_accessor_bit_h +#pragma once #include "grib_accessor_class_long.h" @@ -31,4 +30,3 @@ class grib_accessor_class_bit_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_bit_h */ diff --git a/src/accessor/grib_accessor_class_bitmap.h b/src/accessor/grib_accessor_class_bitmap.h index 599e8c7ab..4f07f3a6c 100644 --- a/src/accessor/grib_accessor_class_bitmap.h +++ b/src/accessor/grib_accessor_class_bitmap.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bitmap_h -#define eccodes_accessor_bitmap_h +#pragma once #include "grib_accessor_class_bytes.h" @@ -41,4 +40,3 @@ class grib_accessor_class_bitmap_t : public grib_accessor_class_bytes_t int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; }; -#endif /* eccodes_accessor_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_bits.h b/src/accessor/grib_accessor_class_bits.h index 2508e5ba0..19ec26b35 100644 --- a/src/accessor/grib_accessor_class_bits.h +++ b/src/accessor/grib_accessor_class_bits.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bits_h -#define eccodes_accessor_bits_h +#pragma once #include "grib_accessor_class_gen.h" @@ -41,4 +40,3 @@ class grib_accessor_class_bits_t : public grib_accessor_class_gen_t long byte_count(grib_accessor*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_bits_h */ diff --git a/src/accessor/grib_accessor_class_bits_per_value.h b/src/accessor/grib_accessor_class_bits_per_value.h index dee7f76e3..741ecd0e5 100644 --- a/src/accessor/grib_accessor_class_bits_per_value.h +++ b/src/accessor/grib_accessor_class_bits_per_value.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bits_per_value_h -#define eccodes_accessor_bits_per_value_h +#pragma once #include "grib_accessor_class_long.h" @@ -31,4 +30,3 @@ class grib_accessor_class_bits_per_value_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_bits_per_value_h */ diff --git a/src/accessor/grib_accessor_class_blob.h b/src/accessor/grib_accessor_class_blob.h index 9743ca17b..10dad4b7b 100644 --- a/src/accessor/grib_accessor_class_blob.h +++ b/src/accessor/grib_accessor_class_blob.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_blob_h -#define eccodes_accessor_blob_h +#pragma once #include "grib_accessor_class_gen.h" @@ -30,4 +29,3 @@ class grib_accessor_class_blob_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_blob_h */ diff --git a/src/accessor/grib_accessor_class_budgdate.h b/src/accessor/grib_accessor_class_budgdate.h index 1b8103a03..ee18250e2 100644 --- a/src/accessor/grib_accessor_class_budgdate.h +++ b/src/accessor/grib_accessor_class_budgdate.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_budgdate_h -#define eccodes_accessor_budgdate_h +#pragma once #include "grib_accessor_class_long.h" @@ -32,4 +31,3 @@ class grib_accessor_class_budgdate_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_budgdate_h */ diff --git a/src/accessor/grib_accessor_class_bufr_data_array.h b/src/accessor/grib_accessor_class_bufr_data_array.h index c6089fa63..75d02b9b4 100644 --- a/src/accessor/grib_accessor_class_bufr_data_array.h +++ b/src/accessor/grib_accessor_class_bufr_data_array.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bufr_data_array_h -#define eccodes_accessor_bufr_data_array_h +#pragma once #include "grib_accessor_class_gen.h" @@ -89,4 +87,3 @@ 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); -#endif /* eccodes_accessor_bufr_data_array_h */ diff --git a/src/accessor/grib_accessor_class_bufr_data_element.h b/src/accessor/grib_accessor_class_bufr_data_element.h index 4dd22a7d5..bbed1785b 100644 --- a/src/accessor/grib_accessor_class_bufr_data_element.h +++ b/src/accessor/grib_accessor_class_bufr_data_element.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bufr_data_element_h -#define eccodes_accessor_bufr_data_element_h +#pragma once #include "grib_accessor_class_gen.h" @@ -53,4 +52,3 @@ class grib_accessor_class_bufr_data_element_t : public grib_accessor_class_gen_t int unpack_double_element(grib_accessor*, size_t i, double* val) override; grib_accessor* make_clone(grib_accessor*, grib_section*, int*) override; }; -#endif /* eccodes_accessor_bufr_data_element_h */ diff --git a/src/accessor/grib_accessor_class_bufr_elements_table.h b/src/accessor/grib_accessor_class_bufr_elements_table.h index d29bc9192..4f133c9e4 100644 --- a/src/accessor/grib_accessor_class_bufr_elements_table.h +++ b/src/accessor/grib_accessor_class_bufr_elements_table.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bufr_elements_table_h -#define eccodes_accessor_bufr_elements_table_h +#pragma once #include "grib_accessor_class_gen.h" @@ -35,4 +34,3 @@ class grib_accessor_class_bufr_elements_table_t : public grib_accessor_class_gen int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_bufr_elements_table_h */ diff --git a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h index b22452490..941f38ac0 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h +++ b/src/accessor/grib_accessor_class_bufr_extract_area_subsets.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bufr_extract_area_subsets_h -#define eccodes_accessor_bufr_extract_area_subsets_h +#pragma once #include "grib_accessor_class_gen.h" @@ -39,4 +38,3 @@ class grib_accessor_class_bufr_extract_area_subsets_t : public grib_accessor_cla int pack_long(grib_accessor*, const long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_bufr_extract_area_subsets_h */ diff --git a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h index 5f4bf9dd7..765786cd2 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h +++ b/src/accessor/grib_accessor_class_bufr_extract_datetime_subsets.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bufr_extract_datetime_subsets_h -#define eccodes_accessor_bufr_extract_datetime_subsets_h +#pragma once #include "grib_accessor_class_gen.h" @@ -32,4 +31,3 @@ class grib_accessor_class_bufr_extract_datetime_subsets_t : public grib_accessor int pack_long(grib_accessor*, const long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_bufr_extract_datetime_subsets_h */ diff --git a/src/accessor/grib_accessor_class_bufr_extract_subsets.h b/src/accessor/grib_accessor_class_bufr_extract_subsets.h index 0d0f60fd7..3015d87ae 100644 --- a/src/accessor/grib_accessor_class_bufr_extract_subsets.h +++ b/src/accessor/grib_accessor_class_bufr_extract_subsets.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bufr_extract_subsets_h -#define eccodes_accessor_bufr_extract_subsets_h +#pragma once #include "grib_accessor_class_gen.h" @@ -33,4 +32,3 @@ class grib_accessor_class_bufr_extract_subsets_t : public grib_accessor_class_ge int pack_long(grib_accessor*, const long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_bufr_extract_subsets_h */ diff --git a/src/accessor/grib_accessor_class_bufr_group.h b/src/accessor/grib_accessor_class_bufr_group.h index 87f060282..758c5c772 100644 --- a/src/accessor/grib_accessor_class_bufr_group.h +++ b/src/accessor/grib_accessor_class_bufr_group.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bufr_group_h -#define eccodes_accessor_bufr_group_h +#pragma once #include "grib_accessor_class_variable.h" @@ -28,4 +27,3 @@ class grib_accessor_class_bufr_group_t : public grib_accessor_class_variable_t void dump(grib_accessor*, grib_dumper*) override; grib_accessor* next(grib_accessor* a, int explore) override; }; -#endif /* eccodes_accessor_bufr_group_h */ diff --git a/src/accessor/grib_accessor_class_bufr_simple_thinning.h b/src/accessor/grib_accessor_class_bufr_simple_thinning.h index 5cb9f6144..9b7467914 100644 --- a/src/accessor/grib_accessor_class_bufr_simple_thinning.h +++ b/src/accessor/grib_accessor_class_bufr_simple_thinning.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bufr_simple_thinning_h -#define eccodes_accessor_bufr_simple_thinning_h +#pragma once #include "grib_accessor_class_gen.h" @@ -35,4 +34,3 @@ class grib_accessor_class_bufr_simple_thinning_t : public grib_accessor_class_ge int pack_long(grib_accessor*, const long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_bufr_simple_thinning_h */ diff --git a/src/accessor/grib_accessor_class_bufr_string_values.h b/src/accessor/grib_accessor_class_bufr_string_values.h index 387bafd1e..fe6c2acb7 100644 --- a/src/accessor/grib_accessor_class_bufr_string_values.h +++ b/src/accessor/grib_accessor_class_bufr_string_values.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bufr_string_values_h -#define eccodes_accessor_bufr_string_values_h +#pragma once #include "grib_accessor_class_ascii.h" @@ -34,4 +33,3 @@ class grib_accessor_class_bufr_string_values_t : public grib_accessor_class_asci void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_bufr_string_values_h */ diff --git a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h index fcc08fc91..92cf595ad 100644 --- a/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h +++ b/src/accessor/grib_accessor_class_bufrdc_expanded_descriptors.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bufrdc_expanded_descriptors_h -#define eccodes_accessor_bufrdc_expanded_descriptors_h +#pragma once #include "grib_accessor_class_long.h" @@ -33,4 +32,3 @@ class grib_accessor_class_bufrdc_expanded_descriptors_t : public grib_accessor_c void destroy(grib_context*, grib_accessor*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_bufrdc_expanded_descriptors_h */ diff --git a/src/accessor/grib_accessor_class_bytes.h b/src/accessor/grib_accessor_class_bytes.h index 558d52018..676cf55c4 100644 --- a/src/accessor/grib_accessor_class_bytes.h +++ b/src/accessor/grib_accessor_class_bytes.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_bytes_h -#define eccodes_accessor_bytes_h +#pragma once #include "grib_accessor_class_gen.h" @@ -31,4 +30,3 @@ class grib_accessor_class_bytes_t : public grib_accessor_class_gen_t void init(grib_accessor*, const long, grib_arguments*) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_bytes_h */ diff --git a/src/accessor/grib_accessor_class_change_alternative_row_scanning.h b/src/accessor/grib_accessor_class_change_alternative_row_scanning.h index e2ecc7994..f889931a0 100644 --- a/src/accessor/grib_accessor_class_change_alternative_row_scanning.h +++ b/src/accessor/grib_accessor_class_change_alternative_row_scanning.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_change_alternative_row_scanning_h -#define eccodes_accessor_change_alternative_row_scanning_h +#pragma once #include "grib_accessor_class_gen.h" @@ -34,4 +33,3 @@ class grib_accessor_class_change_alternative_row_scanning_t : public grib_access int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_change_alternative_row_scanning_h */ diff --git a/src/accessor/grib_accessor_class_change_scanning_direction.h b/src/accessor/grib_accessor_class_change_scanning_direction.h index 0dae34341..ead274485 100644 --- a/src/accessor/grib_accessor_class_change_scanning_direction.h +++ b/src/accessor/grib_accessor_class_change_scanning_direction.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_change_scanning_direction_h -#define eccodes_accessor_change_scanning_direction_h +#pragma once #include "grib_accessor_class_gen.h" @@ -38,4 +37,3 @@ class grib_accessor_class_change_scanning_direction_t : public grib_accessor_cla int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_change_scanning_direction_h */ diff --git a/src/accessor/grib_accessor_class_check_internal_version.h b/src/accessor/grib_accessor_class_check_internal_version.h index 46f9a29d5..d37b57282 100644 --- a/src/accessor/grib_accessor_class_check_internal_version.h +++ b/src/accessor/grib_accessor_class_check_internal_version.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_check_internal_version_h -#define eccodes_accessor_check_internal_version_h +#pragma once #include "grib_accessor_class_ascii.h" @@ -29,4 +28,3 @@ class grib_accessor_class_check_internal_version_t : public grib_accessor_class_ int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_check_internal_version_h */ diff --git a/src/accessor/grib_accessor_class_closest_date.h b/src/accessor/grib_accessor_class_closest_date.h index e5b65c683..ebd3cb6d4 100644 --- a/src/accessor/grib_accessor_class_closest_date.h +++ b/src/accessor/grib_accessor_class_closest_date.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_closest_date_h -#define eccodes_accessor_closest_date_h +#pragma once #include "grib_accessor_class_double.h" @@ -39,4 +38,3 @@ class grib_accessor_class_closest_date_t : public grib_accessor_class_double_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_closest_date_h */ diff --git a/src/accessor/grib_accessor_class_codeflag.h b/src/accessor/grib_accessor_class_codeflag.h index f9465f703..82c8cc77b 100644 --- a/src/accessor/grib_accessor_class_codeflag.h +++ b/src/accessor/grib_accessor_class_codeflag.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_codeflag_h -#define eccodes_accessor_codeflag_h +#pragma once #include "grib_accessor_class_unsigned.h" @@ -30,4 +29,3 @@ class grib_accessor_class_codeflag_t : public grib_accessor_class_unsigned_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_codeflag_h */ diff --git a/src/accessor/grib_accessor_class_codetable_title.h b/src/accessor/grib_accessor_class_codetable_title.h index 4a2114579..f820c585c 100644 --- a/src/accessor/grib_accessor_class_codetable_title.h +++ b/src/accessor/grib_accessor_class_codetable_title.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_codetable_title_h -#define eccodes_accessor_codetable_title_h +#pragma once #include "grib_accessor_class_gen.h" @@ -30,4 +29,3 @@ class grib_accessor_class_codetable_title_t : public grib_accessor_class_gen_t int unpack_string(grib_accessor*, char*, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_codetable_title_h */ diff --git a/src/accessor/grib_accessor_class_codetable_units.h b/src/accessor/grib_accessor_class_codetable_units.h index d5207f532..0a8c9389d 100644 --- a/src/accessor/grib_accessor_class_codetable_units.h +++ b/src/accessor/grib_accessor_class_codetable_units.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_codetable_units_h -#define eccodes_accessor_codetable_units_h +#pragma once #include "grib_accessor_class_gen.h" @@ -30,4 +29,3 @@ class grib_accessor_class_codetable_units_t : public grib_accessor_class_gen_t int unpack_string(grib_accessor*, char*, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_codetable_units_h */ diff --git a/src/accessor/grib_accessor_class_concept.h b/src/accessor/grib_accessor_class_concept.h index e2d9b8474..7b9ea11d0 100644 --- a/src/accessor/grib_accessor_class_concept.h +++ b/src/accessor/grib_accessor_class_concept.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_concept_h -#define eccodes_accessor_concept_h +#pragma once #include "grib_accessor_class_gen.h" @@ -39,4 +38,3 @@ class grib_accessor_class_concept_t : public grib_accessor_class_gen_t void init(grib_accessor*, const long, grib_arguments*) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_concept_h */ diff --git a/src/accessor/grib_accessor_class_count_file.h b/src/accessor/grib_accessor_class_count_file.h index 727df09c2..25092b0a4 100644 --- a/src/accessor/grib_accessor_class_count_file.h +++ b/src/accessor/grib_accessor_class_count_file.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_count_file_h -#define eccodes_accessor_count_file_h +#pragma once #include "grib_accessor_class_long.h" @@ -28,4 +27,3 @@ class grib_accessor_class_count_file_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_count_file_h */ diff --git a/src/accessor/grib_accessor_class_count_missing.h b/src/accessor/grib_accessor_class_count_missing.h index 405456843..3e2cf7330 100644 --- a/src/accessor/grib_accessor_class_count_missing.h +++ b/src/accessor/grib_accessor_class_count_missing.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_count_missing_h -#define eccodes_accessor_count_missing_h +#pragma once #include "grib_accessor_class_long.h" @@ -33,4 +32,3 @@ class grib_accessor_class_count_missing_t : public grib_accessor_class_long_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_count_missing_h */ diff --git a/src/accessor/grib_accessor_class_count_total.h b/src/accessor/grib_accessor_class_count_total.h index 4518f9703..6fa89df0e 100644 --- a/src/accessor/grib_accessor_class_count_total.h +++ b/src/accessor/grib_accessor_class_count_total.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_count_total_h -#define eccodes_accessor_count_total_h +#pragma once #include "grib_accessor_class_long.h" @@ -28,4 +27,3 @@ class grib_accessor_class_count_total_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_count_total_h */ diff --git a/src/accessor/grib_accessor_class_data_apply_bitmap.h b/src/accessor/grib_accessor_class_data_apply_bitmap.h index a2d724ed7..f3bed1166 100644 --- a/src/accessor/grib_accessor_class_data_apply_bitmap.h +++ b/src/accessor/grib_accessor_class_data_apply_bitmap.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h index 9b101e7ed..97987d217 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h index 5b26b3a4f..fee603876 100644 --- a/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h +++ b/src/accessor/grib_accessor_class_data_apply_boustrophedonic_bitmap.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_apply_boustrophedonic_bitmap_h -#define eccodes_accessor_data_apply_boustrophedonic_bitmap_h +#pragma once #include "grib_accessor_class_gen.h" @@ -41,4 +39,3 @@ class grib_accessor_class_data_apply_boustrophedonic_bitmap_t : public grib_acce int unpack_double_element(grib_accessor*, size_t i, double* val) override; int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array) override; }; -#endif /* eccodes_accessor_data_apply_boustrophedonic_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.h b/src/accessor/grib_accessor_class_data_ccsds_packing.h index d4d97bede..0f9430232 100644 --- a/src/accessor/grib_accessor_class_data_ccsds_packing.h +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_complex_packing.h b/src/accessor/grib_accessor_class_data_complex_packing.h index a8276311a..ee19b195c 100644 --- a/src/accessor/grib_accessor_class_data_complex_packing.h +++ b/src/accessor/grib_accessor_class_data_complex_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_dummy_field.h b/src/accessor/grib_accessor_class_data_dummy_field.h index 2fac95235..c846abb98 100644 --- a/src/accessor/grib_accessor_class_data_dummy_field.h +++ b/src/accessor/grib_accessor_class_data_dummy_field.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_dummy_field_h -#define eccodes_accessor_data_dummy_field_h +#pragma once #include "grib_accessor_class_data_g1simple_packing.h" @@ -33,4 +31,3 @@ class grib_accessor_class_data_dummy_field_t : public grib_accessor_class_data_g int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_dummy_field_h */ diff --git a/src/accessor/grib_accessor_class_data_g1complex_packing.h b/src/accessor/grib_accessor_class_data_g1complex_packing.h index 75ad18d66..51457e40e 100644 --- a/src/accessor/grib_accessor_class_data_g1complex_packing.h +++ b/src/accessor/grib_accessor_class_data_g1complex_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h index 0da32c286..8d2d53f0a 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h index 4bb6c061c..4bb50ae34 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_extended_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h index 2e8bb3620..95295dae1 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_general_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h index 9b274a408..eca551669 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h +++ b/src/accessor/grib_accessor_class_data_g1second_order_row_by_row_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h index 562108986..63ee792ae 100644 --- a/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h +++ b/src/accessor/grib_accessor_class_data_g1secondary_bitmap.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g1shsimple_packing.h b/src/accessor/grib_accessor_class_data_g1shsimple_packing.h index 56e1ee47b..c852c7213 100644 --- a/src/accessor/grib_accessor_class_data_g1shsimple_packing.h +++ b/src/accessor/grib_accessor_class_data_g1shsimple_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g1simple_packing.h b/src/accessor/grib_accessor_class_data_g1simple_packing.h index 2dfedd6c9..c82532361 100644 --- a/src/accessor/grib_accessor_class_data_g1simple_packing.h +++ b/src/accessor/grib_accessor_class_data_g1simple_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.h b/src/accessor/grib_accessor_class_data_g22order_packing.h index 39d01a70b..329823633 100644 --- a/src/accessor/grib_accessor_class_data_g22order_packing.h +++ b/src/accessor/grib_accessor_class_data_g22order_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g2bifourier_packing.h b/src/accessor/grib_accessor_class_data_g2bifourier_packing.h index b3ca0176a..2fd7378a5 100644 --- a/src/accessor/grib_accessor_class_data_g2bifourier_packing.h +++ b/src/accessor/grib_accessor_class_data_g2bifourier_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g2complex_packing.h b/src/accessor/grib_accessor_class_data_g2complex_packing.h index cfa0f8116..49f33a711 100644 --- a/src/accessor/grib_accessor_class_data_g2complex_packing.h +++ b/src/accessor/grib_accessor_class_data_g2complex_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h index 64428a4ce..f981e1e6c 100644 --- a/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h +++ b/src/accessor/grib_accessor_class_data_g2secondary_bitmap.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g2shsimple_packing.h b/src/accessor/grib_accessor_class_data_g2shsimple_packing.h index c0189ae66..02da8345e 100644 --- a/src/accessor/grib_accessor_class_data_g2shsimple_packing.h +++ b/src/accessor/grib_accessor_class_data_g2shsimple_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing.h b/src/accessor/grib_accessor_class_data_g2simple_packing.h index 4f27ab87c..a88cccac0 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing.h +++ b/src/accessor/grib_accessor_class_data_g2simple_packing.h @@ -8,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_data_g2simple_packing_h -#define eccodes_accessor_data_g2simple_packing_h +#pragma once #include "grib_accessor_class_data_simple_packing.h" @@ -25,4 +24,3 @@ class grib_accessor_class_data_g2simple_packing_t : public grib_accessor_class_d int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_data_g2simple_packing_h */ diff --git a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h index 5825b9d16..4e2437e8b 100644 --- a/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h +++ b/src/accessor/grib_accessor_class_data_g2simple_packing_with_preprocessing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.h b/src/accessor/grib_accessor_class_data_jpeg2000_packing.h index 6fc01b977..54dcc457c 100644 --- a/src/accessor/grib_accessor_class_data_jpeg2000_packing.h +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_raw_packing.h b/src/accessor/grib_accessor_class_data_raw_packing.h index 8012c1f51..b84650f28 100644 --- a/src/accessor/grib_accessor_class_data_raw_packing.h +++ b/src/accessor/grib_accessor_class_data_raw_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_run_length_packing.h b/src/accessor/grib_accessor_class_data_run_length_packing.h index c35689abf..5a69a7ba0 100644 --- a/src/accessor/grib_accessor_class_data_run_length_packing.h +++ b/src/accessor/grib_accessor_class_data_run_length_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_secondary_bitmap.h b/src/accessor/grib_accessor_class_data_secondary_bitmap.h index 8bc156ef5..a24772be4 100644 --- a/src/accessor/grib_accessor_class_data_secondary_bitmap.h +++ b/src/accessor/grib_accessor_class_data_secondary_bitmap.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_sh_packed.h b/src/accessor/grib_accessor_class_data_sh_packed.h index 377db9ab4..bbe3caafe 100644 --- a/src/accessor/grib_accessor_class_data_sh_packed.h +++ b/src/accessor/grib_accessor_class_data_sh_packed.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_sh_unpacked.h b/src/accessor/grib_accessor_class_data_sh_unpacked.h index b201e3dd3..7907b8c68 100644 --- a/src/accessor/grib_accessor_class_data_sh_unpacked.h +++ b/src/accessor/grib_accessor_class_data_sh_unpacked.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_shsimple_packing.h b/src/accessor/grib_accessor_class_data_shsimple_packing.h index e77612ddd..7b1620141 100644 --- a/src/accessor/grib_accessor_class_data_shsimple_packing.h +++ b/src/accessor/grib_accessor_class_data_shsimple_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_simple_packing.h b/src/accessor/grib_accessor_class_data_simple_packing.h index 52761202d..3e50239a0 100644 --- a/src/accessor/grib_accessor_class_data_simple_packing.h +++ b/src/accessor/grib_accessor_class_data_simple_packing.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_decimal_precision.h b/src/accessor/grib_accessor_class_decimal_precision.h index 741e32e83..a6b6d4839 100644 --- a/src/accessor/grib_accessor_class_decimal_precision.h +++ b/src/accessor/grib_accessor_class_decimal_precision.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_decimal_precision_h -#define eccodes_accessor_decimal_precision_h +#pragma once #include "grib_accessor_class_long.h" @@ -33,4 +31,3 @@ class grib_accessor_class_decimal_precision_t : public grib_accessor_class_long_ int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_decimal_precision_h */ diff --git a/src/accessor/grib_accessor_class_dictionary.h b/src/accessor/grib_accessor_class_dictionary.h index 327c6fc72..8dc976e51 100644 --- a/src/accessor/grib_accessor_class_dictionary.h +++ b/src/accessor/grib_accessor_class_dictionary.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_dictionary_h -#define eccodes_accessor_dictionary_h +#pragma once #include "grib_accessor_class_gen.h" @@ -38,4 +36,3 @@ class grib_accessor_class_dictionary_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_dictionary_h */ diff --git a/src/accessor/grib_accessor_class_dirty.h b/src/accessor/grib_accessor_class_dirty.h index 1e49bf0a4..b024b69f7 100644 --- a/src/accessor/grib_accessor_class_dirty.h +++ b/src/accessor/grib_accessor_class_dirty.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_dirty_h -#define eccodes_accessor_dirty_h +#pragma once #include "grib_accessor_class_long.h" @@ -30,4 +28,3 @@ class grib_accessor_class_dirty_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_dirty_h */ diff --git a/src/accessor/grib_accessor_class_divdouble.h b/src/accessor/grib_accessor_class_divdouble.h index bc61e4012..9408b073a 100644 --- a/src/accessor/grib_accessor_class_divdouble.h +++ b/src/accessor/grib_accessor_class_divdouble.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_divdouble_h -#define eccodes_accessor_divdouble_h +#pragma once #include "grib_accessor_class_double.h" @@ -30,4 +28,3 @@ class grib_accessor_class_divdouble_t : public grib_accessor_class_double_t int unpack_double(grib_accessor*, double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_divdouble_h */ diff --git a/src/accessor/grib_accessor_class_double.h b/src/accessor/grib_accessor_class_double.h index 1c1e2fb4f..7ad9771c2 100644 --- a/src/accessor/grib_accessor_class_double.h +++ b/src/accessor/grib_accessor_class_double.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_double_h -#define eccodes_accessor_double_h +#pragma once #include "grib_accessor_class_gen.h" @@ -27,4 +25,3 @@ class grib_accessor_class_double_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_double_h */ diff --git a/src/accessor/grib_accessor_class_element.h b/src/accessor/grib_accessor_class_element.h index 20fa07fcc..220b8ff84 100644 --- a/src/accessor/grib_accessor_class_element.h +++ b/src/accessor/grib_accessor_class_element.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_element_h -#define eccodes_accessor_element_h +#pragma once #include "grib_accessor_class_long.h" @@ -32,4 +30,3 @@ class grib_accessor_class_element_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_element_h */ diff --git a/src/accessor/grib_accessor_class_evaluate.h b/src/accessor/grib_accessor_class_evaluate.h index d3a856881..0e40cf206 100644 --- a/src/accessor/grib_accessor_class_evaluate.h +++ b/src/accessor/grib_accessor_class_evaluate.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_evaluate_h -#define eccodes_accessor_evaluate_h +#pragma once #include "grib_accessor_class_long.h" @@ -29,4 +27,3 @@ class grib_accessor_class_evaluate_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_evaluate_h */ diff --git a/src/accessor/grib_accessor_class_expanded_descriptors.h b/src/accessor/grib_accessor_class_expanded_descriptors.h index b359a829f..7e42ad28c 100644 --- a/src/accessor/grib_accessor_class_expanded_descriptors.h +++ b/src/accessor/grib_accessor_class_expanded_descriptors.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * @@ -9,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_expanded_descriptors_h -#define eccodes_accessor_expanded_descriptors_h +#pragma once #include "grib_accessor_class_long.h" @@ -43,4 +41,3 @@ class grib_accessor_class_expanded_descriptors_t : public grib_accessor_class_lo void destroy(grib_context*, grib_accessor*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_expanded_descriptors_h */ diff --git a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h index d73bffe02..d8dc1bcb8 100644 --- a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h +++ b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_from_scale_factor_scaled_value_h -#define eccodes_accessor_from_scale_factor_scaled_value_h +#pragma once #include "grib_accessor_class_double.h" @@ -33,4 +32,3 @@ class grib_accessor_class_from_scale_factor_scaled_value_t : public grib_accesso int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_from_scale_factor_scaled_value_h */ diff --git a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h index 765ddeb0b..662a75569 100644 --- a/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h +++ b/src/accessor/grib_accessor_class_g1_half_byte_codeflag.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1_half_byte_codeflag_h -#define eccodes_accessor_g1_half_byte_codeflag_h +#pragma once #include "grib_accessor_class_gen.h" @@ -31,4 +30,3 @@ class grib_accessor_class_g1_half_byte_codeflag_t : public grib_accessor_class_g void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1_half_byte_codeflag_h */ diff --git a/src/accessor/grib_accessor_class_g1_message_length.h b/src/accessor/grib_accessor_class_g1_message_length.h index 38e85365e..9a24e3213 100644 --- a/src/accessor/grib_accessor_class_g1_message_length.h +++ b/src/accessor/grib_accessor_class_g1_message_length.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1_message_length_h -#define eccodes_accessor_g1_message_length_h +#pragma once #include "grib_accessor_class_section_length.h" @@ -30,4 +29,3 @@ class grib_accessor_class_g1_message_length_t : public grib_accessor_class_secti int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1_message_length_h */ diff --git a/src/accessor/grib_accessor_class_g1_section4_length.h b/src/accessor/grib_accessor_class_g1_section4_length.h index 100f69157..9e805985c 100644 --- a/src/accessor/grib_accessor_class_g1_section4_length.h +++ b/src/accessor/grib_accessor_class_g1_section4_length.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1_section4_length_h -#define eccodes_accessor_g1_section4_length_h +#pragma once #include "grib_accessor_class_section_length.h" @@ -30,4 +29,3 @@ class grib_accessor_class_g1_section4_length_t : public grib_accessor_class_sect int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1_section4_length_h */ diff --git a/src/accessor/grib_accessor_class_g1bitmap.h b/src/accessor/grib_accessor_class_g1bitmap.h index 005114620..28914c591 100644 --- a/src/accessor/grib_accessor_class_g1bitmap.h +++ b/src/accessor/grib_accessor_class_g1bitmap.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1bitmap_h -#define eccodes_accessor_g1bitmap_h +#pragma once #include "grib_accessor_class_bitmap.h" @@ -31,4 +30,3 @@ class grib_accessor_class_g1bitmap_t : public grib_accessor_class_bitmap_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1bitmap_h */ diff --git a/src/accessor/grib_accessor_class_g1date.h b/src/accessor/grib_accessor_class_g1date.h index 6119ca99e..1195ac01c 100644 --- a/src/accessor/grib_accessor_class_g1date.h +++ b/src/accessor/grib_accessor_class_g1date.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1date_h -#define eccodes_accessor_g1date_h +#pragma once #include "grib_accessor_class_long.h" @@ -35,4 +34,3 @@ class grib_accessor_class_g1date_t : public grib_accessor_class_long_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1date_h */ diff --git a/src/accessor/grib_accessor_class_g1day_of_the_year_date.h b/src/accessor/grib_accessor_class_g1day_of_the_year_date.h index a5564f968..5e484686c 100644 --- a/src/accessor/grib_accessor_class_g1day_of_the_year_date.h +++ b/src/accessor/grib_accessor_class_g1day_of_the_year_date.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1day_of_the_year_date_h -#define eccodes_accessor_g1day_of_the_year_date_h +#pragma once #include "grib_accessor_class_g1date.h" @@ -29,4 +28,3 @@ class grib_accessor_class_g1day_of_the_year_date_t : public grib_accessor_class_ void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1day_of_the_year_date_h */ diff --git a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h index a37edfbcf..baaea5320 100644 --- a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h +++ b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1end_of_interval_monthly_h -#define eccodes_accessor_g1end_of_interval_monthly_h +#pragma once #include "grib_accessor_class_abstract_vector.h" @@ -32,4 +31,3 @@ class grib_accessor_class_g1end_of_interval_monthly_t : public grib_accessor_cla void init(grib_accessor*, const long, grib_arguments*) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_g1end_of_interval_monthly_h */ diff --git a/src/accessor/grib_accessor_class_g1fcperiod.h b/src/accessor/grib_accessor_class_g1fcperiod.h index 40810cb86..1b5b8dc7e 100644 --- a/src/accessor/grib_accessor_class_g1fcperiod.h +++ b/src/accessor/grib_accessor_class_g1fcperiod.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1fcperiod_h -#define eccodes_accessor_g1fcperiod_h +#pragma once #include "grib_accessor_class_g1step_range.h" @@ -27,4 +26,3 @@ class grib_accessor_class_g1fcperiod_t : public grib_accessor_class_g1step_range grib_accessor* create_empty_accessor() override { return new grib_accessor_g1fcperiod_t{}; } int unpack_string(grib_accessor*, char*, size_t* len) override; }; -#endif /* eccodes_accessor_g1fcperiod_h */ diff --git a/src/accessor/grib_accessor_class_g1forecastmonth.h b/src/accessor/grib_accessor_class_g1forecastmonth.h index ff268febc..cd3a6d5f6 100644 --- a/src/accessor/grib_accessor_class_g1forecastmonth.h +++ b/src/accessor/grib_accessor_class_g1forecastmonth.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1forecastmonth_h -#define eccodes_accessor_g1forecastmonth_h +#pragma once #include "grib_accessor_class_long.h" @@ -36,4 +35,3 @@ class grib_accessor_class_g1forecastmonth_t : public grib_accessor_class_long_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1forecastmonth_h */ diff --git a/src/accessor/grib_accessor_class_g1monthlydate.h b/src/accessor/grib_accessor_class_g1monthlydate.h index 6148e4307..8503fa0af 100644 --- a/src/accessor/grib_accessor_class_g1monthlydate.h +++ b/src/accessor/grib_accessor_class_g1monthlydate.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1monthlydate_h -#define eccodes_accessor_g1monthlydate_h +#pragma once #include "grib_accessor_class_long.h" @@ -29,4 +28,3 @@ class grib_accessor_class_g1monthlydate_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1monthlydate_h */ diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h index e8cdb50ca..97379631d 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1number_of_coded_values_sh_complex_h -#define eccodes_accessor_g1number_of_coded_values_sh_complex_h +#pragma once #include "grib_accessor_class_long.h" @@ -36,4 +35,3 @@ class grib_accessor_class_g1number_of_coded_values_sh_complex_t : public grib_ac int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1number_of_coded_values_sh_complex_h */ diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h index f5cc84b02..4dafe6b15 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1number_of_coded_values_sh_simple_h -#define eccodes_accessor_g1number_of_coded_values_sh_simple_h +#pragma once #include "grib_accessor_class_long.h" @@ -33,4 +32,3 @@ class grib_accessor_class_g1number_of_coded_values_sh_simple_t : public grib_acc int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1number_of_coded_values_sh_simple_h */ diff --git a/src/accessor/grib_accessor_class_g1step_range.h b/src/accessor/grib_accessor_class_g1step_range.h index 252a214ae..7ca19cb08 100644 --- a/src/accessor/grib_accessor_class_g1step_range.h +++ b/src/accessor/grib_accessor_class_g1step_range.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1step_range_h -#define eccodes_accessor_g1step_range_h +#pragma once #include "grib_accessor_class_abstract_long_vector.h" @@ -44,4 +43,3 @@ class grib_accessor_class_g1step_range_t : public grib_accessor_class_abstract_l void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1step_range_h */ diff --git a/src/accessor/grib_accessor_class_g1verificationdate.h b/src/accessor/grib_accessor_class_g1verificationdate.h index 1a97bf3c6..0e0469926 100644 --- a/src/accessor/grib_accessor_class_g1verificationdate.h +++ b/src/accessor/grib_accessor_class_g1verificationdate.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g1verificationdate_h -#define eccodes_accessor_g1verificationdate_h +#pragma once #include "grib_accessor_class_long.h" @@ -31,4 +30,3 @@ class grib_accessor_class_g1verificationdate_t : public grib_accessor_class_long int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g1verificationdate_h */ diff --git a/src/accessor/grib_accessor_class_g2_aerosol.h b/src/accessor/grib_accessor_class_g2_aerosol.h index 96c1b4b9e..9fbd0c79b 100644 --- a/src/accessor/grib_accessor_class_g2_aerosol.h +++ b/src/accessor/grib_accessor_class_g2_aerosol.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2_aerosol_h -#define eccodes_accessor_g2_aerosol_h +#pragma once #include "grib_accessor_class_unsigned.h" @@ -33,4 +32,3 @@ class grib_accessor_class_g2_aerosol_t : public grib_accessor_class_unsigned_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2_aerosol_h */ diff --git a/src/accessor/grib_accessor_class_g2_chemical.h b/src/accessor/grib_accessor_class_g2_chemical.h index 59df76928..66bf945aa 100644 --- a/src/accessor/grib_accessor_class_g2_chemical.h +++ b/src/accessor/grib_accessor_class_g2_chemical.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2_chemical_h -#define eccodes_accessor_g2_chemical_h +#pragma once #include "grib_accessor_class_unsigned.h" @@ -33,4 +32,3 @@ class grib_accessor_class_g2_chemical_t : public grib_accessor_class_unsigned_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2_chemical_h */ diff --git a/src/accessor/grib_accessor_class_g2_eps.h b/src/accessor/grib_accessor_class_g2_eps.h index b651985b1..8453387fa 100644 --- a/src/accessor/grib_accessor_class_g2_eps.h +++ b/src/accessor/grib_accessor_class_g2_eps.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2_eps_h -#define eccodes_accessor_g2_eps_h +#pragma once #include "grib_accessor_class_unsigned.h" @@ -35,4 +34,3 @@ class grib_accessor_class_g2_eps_t : public grib_accessor_class_unsigned_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2_eps_h */ diff --git a/src/accessor/grib_accessor_class_g2_mars_labeling.h b/src/accessor/grib_accessor_class_g2_mars_labeling.h index b3f7969bb..d47848565 100644 --- a/src/accessor/grib_accessor_class_g2_mars_labeling.h +++ b/src/accessor/grib_accessor_class_g2_mars_labeling.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2_mars_labeling_h -#define eccodes_accessor_g2_mars_labeling_h +#pragma once #include "grib_accessor_class_gen.h" @@ -43,4 +42,3 @@ class grib_accessor_class_g2_mars_labeling_t : public grib_accessor_class_gen_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2_mars_labeling_h */ diff --git a/src/accessor/grib_accessor_class_g2bitmap.h b/src/accessor/grib_accessor_class_g2bitmap.h index 3c6f3e39c..2276b702c 100644 --- a/src/accessor/grib_accessor_class_g2bitmap.h +++ b/src/accessor/grib_accessor_class_g2bitmap.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2bitmap_h -#define eccodes_accessor_g2bitmap_h +#pragma once #include "grib_accessor_class_bitmap.h" @@ -30,4 +29,3 @@ class grib_accessor_class_g2bitmap_t : public grib_accessor_class_bitmap_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2bitmap_h */ diff --git a/src/accessor/grib_accessor_class_g2bitmap_present.h b/src/accessor/grib_accessor_class_g2bitmap_present.h index 8ac86bbb4..87d603f54 100644 --- a/src/accessor/grib_accessor_class_g2bitmap_present.h +++ b/src/accessor/grib_accessor_class_g2bitmap_present.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2bitmap_present_h -#define eccodes_accessor_g2bitmap_present_h +#pragma once #include "grib_accessor_class_long.h" @@ -30,4 +29,3 @@ class grib_accessor_class_g2bitmap_present_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2bitmap_present_h */ diff --git a/src/accessor/grib_accessor_class_g2date.h b/src/accessor/grib_accessor_class_g2date.h index da4e6b379..e6981665c 100644 --- a/src/accessor/grib_accessor_class_g2date.h +++ b/src/accessor/grib_accessor_class_g2date.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2date_h -#define eccodes_accessor_g2date_h +#pragma once #include "grib_accessor_class_long.h" @@ -33,4 +32,3 @@ class grib_accessor_class_g2date_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2date_h */ diff --git a/src/accessor/grib_accessor_class_g2end_step.h b/src/accessor/grib_accessor_class_g2end_step.h index 756079631..d3a3b1433 100644 --- a/src/accessor/grib_accessor_class_g2end_step.h +++ b/src/accessor/grib_accessor_class_g2end_step.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2end_step_h -#define eccodes_accessor_g2end_step_h +#pragma once #include "grib_accessor_class_long.h" @@ -52,4 +51,3 @@ class grib_accessor_class_g2end_step_t : public grib_accessor_class_long_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2end_step_h */ diff --git a/src/accessor/grib_accessor_class_g2grid.h b/src/accessor/grib_accessor_class_g2grid.h index ca1ef3e6c..07c9f9862 100644 --- a/src/accessor/grib_accessor_class_g2grid.h +++ b/src/accessor/grib_accessor_class_g2grid.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2grid_h -#define eccodes_accessor_g2grid_h +#pragma once #include "grib_accessor_class_double.h" @@ -38,4 +37,3 @@ class grib_accessor_class_g2grid_t : public grib_accessor_class_double_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2grid_h */ diff --git a/src/accessor/grib_accessor_class_g2latlon.h b/src/accessor/grib_accessor_class_g2latlon.h index 519b63b57..f4733757e 100644 --- a/src/accessor/grib_accessor_class_g2latlon.h +++ b/src/accessor/grib_accessor_class_g2latlon.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2latlon_h -#define eccodes_accessor_g2latlon_h +#pragma once #include "grib_accessor_class_double.h" @@ -34,4 +33,3 @@ class grib_accessor_class_g2latlon_t : public grib_accessor_class_double_t int unpack_double(grib_accessor*, double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2latlon_h */ diff --git a/src/accessor/grib_accessor_class_g2level.h b/src/accessor/grib_accessor_class_g2level.h index f0abf7e6e..55511b8f0 100644 --- a/src/accessor/grib_accessor_class_g2level.h +++ b/src/accessor/grib_accessor_class_g2level.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2level_h -#define eccodes_accessor_g2level_h +#pragma once #include "grib_accessor_class_long.h" @@ -36,4 +35,3 @@ class grib_accessor_class_g2level_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2level_h */ diff --git a/src/accessor/grib_accessor_class_g2lon.h b/src/accessor/grib_accessor_class_g2lon.h index 409cc1297..d3f5bd8ff 100644 --- a/src/accessor/grib_accessor_class_g2lon.h +++ b/src/accessor/grib_accessor_class_g2lon.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2lon_h -#define eccodes_accessor_g2lon_h +#pragma once #include "grib_accessor_class_double.h" @@ -30,4 +29,3 @@ class grib_accessor_class_g2lon_t : public grib_accessor_class_double_t int unpack_double(grib_accessor*, double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2lon_h */ diff --git a/src/accessor/grib_accessor_class_g2step_range.h b/src/accessor/grib_accessor_class_g2step_range.h index d15fa5e36..ec44546b3 100644 --- a/src/accessor/grib_accessor_class_g2step_range.h +++ b/src/accessor/grib_accessor_class_g2step_range.h @@ -8,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_g2step_range_h -#define eccodes_accessor_g2step_range_h +#pragma once #include "grib_accessor_class_gen.h" @@ -36,4 +35,3 @@ class grib_accessor_class_g2step_range_t : public grib_accessor_class_gen_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_g2step_range_h */ diff --git a/src/accessor/grib_accessor_class_gaussian_grid_name.h b/src/accessor/grib_accessor_class_gaussian_grid_name.h index abb505cb5..d67f80aa5 100644 --- a/src/accessor/grib_accessor_class_gaussian_grid_name.h +++ b/src/accessor/grib_accessor_class_gaussian_grid_name.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_gaussian_grid_name_h -#define eccodes_accessor_gaussian_grid_name_h +#pragma once #include "grib_accessor_class_gen.h" @@ -33,4 +32,3 @@ class grib_accessor_class_gaussian_grid_name_t : public grib_accessor_class_gen_ size_t string_length(grib_accessor*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_gaussian_grid_name_h */ diff --git a/src/accessor/grib_accessor_class_gds_is_present.h b/src/accessor/grib_accessor_class_gds_is_present.h index b7617a64d..d69619d44 100644 --- a/src/accessor/grib_accessor_class_gds_is_present.h +++ b/src/accessor/grib_accessor_class_gds_is_present.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_gds_is_present_h -#define eccodes_accessor_gds_is_present_h +#pragma once #include "grib_accessor_class_long.h" @@ -33,4 +32,3 @@ class grib_accessor_class_gds_is_present_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_gds_is_present_h */ diff --git a/src/accessor/grib_accessor_class_gds_not_present_bitmap.h b/src/accessor/grib_accessor_class_gds_not_present_bitmap.h index 03750bb03..bf9c0c012 100644 --- a/src/accessor/grib_accessor_class_gds_not_present_bitmap.h +++ b/src/accessor/grib_accessor_class_gds_not_present_bitmap.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_gds_not_present_bitmap_h -#define eccodes_accessor_gds_not_present_bitmap_h +#pragma once #include "grib_accessor_class_gen.h" @@ -36,4 +35,3 @@ class grib_accessor_class_gds_not_present_bitmap_t : public grib_accessor_class_ int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_gds_not_present_bitmap_h */ diff --git a/src/accessor/grib_accessor_class_getenv.h b/src/accessor/grib_accessor_class_getenv.h index 5068dad2c..b04c58a4d 100644 --- a/src/accessor/grib_accessor_class_getenv.h +++ b/src/accessor/grib_accessor_class_getenv.h @@ -8,8 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_getenv_h -#define eccodes_accessor_getenv_h +#pragma once #include "grib_accessor_class_ascii.h" @@ -33,4 +32,3 @@ class grib_accessor_class_getenv_t : public grib_accessor_class_ascii_t void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_getenv_h */ diff --git a/src/accessor/grib_accessor_class_global_gaussian.h b/src/accessor/grib_accessor_class_global_gaussian.h index 8c9d37f13..1d49c0c32 100644 --- a/src/accessor/grib_accessor_class_global_gaussian.h +++ b/src/accessor/grib_accessor_class_global_gaussian.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_global_gaussian_h -#define eccodes_accessor_global_gaussian_h +#pragma once #include "grib_accessor_class_long.h" @@ -40,4 +39,3 @@ class grib_accessor_class_global_gaussian_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_global_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_group.h b/src/accessor/grib_accessor_class_group.h index 3d718fdfa..9f1c31a81 100644 --- a/src/accessor/grib_accessor_class_group.h +++ b/src/accessor/grib_accessor_class_group.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_group_h -#define eccodes_accessor_group_h +#pragma once #include "grib_accessor_class_gen.h" @@ -37,4 +36,3 @@ class grib_accessor_class_group_t : public grib_accessor_class_gen_t void init(grib_accessor*, const long, grib_arguments*) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_group_h */ diff --git a/src/accessor/grib_accessor_class_gts_header.h b/src/accessor/grib_accessor_class_gts_header.h index 3027def40..8072986a7 100644 --- a/src/accessor/grib_accessor_class_gts_header.h +++ b/src/accessor/grib_accessor_class_gts_header.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_gts_header_h -#define eccodes_accessor_gts_header_h +#pragma once #include "grib_accessor_class_ascii.h" @@ -32,4 +31,3 @@ class grib_accessor_class_gts_header_t : public grib_accessor_class_ascii_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_gts_header_h */ diff --git a/src/accessor/grib_accessor_class_hash_array.h b/src/accessor/grib_accessor_class_hash_array.h index f3791d91f..fa2732cac 100644 --- a/src/accessor/grib_accessor_class_hash_array.h +++ b/src/accessor/grib_accessor_class_hash_array.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_hash_array_h -#define eccodes_accessor_hash_array_h +#pragma once #include "grib_accessor_class_gen.h" @@ -41,4 +40,3 @@ class grib_accessor_class_hash_array_t : public grib_accessor_class_gen_t void init(grib_accessor*, const long, grib_arguments*) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_hash_array_h */ diff --git a/src/accessor/grib_accessor_class_headers_only.h b/src/accessor/grib_accessor_class_headers_only.h index d972319c5..a7dc81891 100644 --- a/src/accessor/grib_accessor_class_headers_only.h +++ b/src/accessor/grib_accessor_class_headers_only.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_headers_only_h -#define eccodes_accessor_headers_only_h +#pragma once #include "grib_accessor_class_gen.h" @@ -29,4 +28,3 @@ class grib_accessor_class_headers_only_t : public grib_accessor_class_gen_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_headers_only_h */ diff --git a/src/accessor/grib_accessor_class_ifs_param.h b/src/accessor/grib_accessor_class_ifs_param.h index 1c86b8561..2beb90925 100644 --- a/src/accessor/grib_accessor_class_ifs_param.h +++ b/src/accessor/grib_accessor_class_ifs_param.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_ifs_param_h -#define eccodes_accessor_ifs_param_h +#pragma once #include "grib_accessor_class_gen.h" @@ -32,4 +31,3 @@ class grib_accessor_class_ifs_param_t : public grib_accessor_class_gen_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_ifs_param_h */ diff --git a/src/accessor/grib_accessor_class_julian_date.h b/src/accessor/grib_accessor_class_julian_date.h index b555ee9dc..c52380e10 100644 --- a/src/accessor/grib_accessor_class_julian_date.h +++ b/src/accessor/grib_accessor_class_julian_date.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_julian_date_h -#define eccodes_accessor_julian_date_h +#pragma once #include "grib_accessor_class_double.h" @@ -44,4 +43,3 @@ class grib_accessor_class_julian_date_t : public grib_accessor_class_double_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_julian_date_h */ diff --git a/src/accessor/grib_accessor_class_julian_day.h b/src/accessor/grib_accessor_class_julian_day.h index 6bb48344f..5d06753b0 100644 --- a/src/accessor/grib_accessor_class_julian_day.h +++ b/src/accessor/grib_accessor_class_julian_day.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_julian_day_h -#define eccodes_accessor_julian_day_h +#pragma once #include "grib_accessor_class_double.h" @@ -36,4 +35,3 @@ class grib_accessor_class_julian_day_t : public grib_accessor_class_double_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_julian_day_h */ diff --git a/src/accessor/grib_accessor_class_ksec1expver.h b/src/accessor/grib_accessor_class_ksec1expver.h index 7225613a5..098a40a14 100644 --- a/src/accessor/grib_accessor_class_ksec1expver.h +++ b/src/accessor/grib_accessor_class_ksec1expver.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_ksec1expver_h -#define eccodes_accessor_ksec1expver_h +#pragma once #include "grib_accessor_class_ascii.h" @@ -30,4 +29,3 @@ class grib_accessor_class_ksec1expver_t : public grib_accessor_class_ascii_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_ksec1expver_h */ diff --git a/src/accessor/grib_accessor_class_label.h b/src/accessor/grib_accessor_class_label.h index 058ce9a11..59590e77c 100644 --- a/src/accessor/grib_accessor_class_label.h +++ b/src/accessor/grib_accessor_class_label.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_label_h -#define eccodes_accessor_label_h +#pragma once #include "grib_accessor_class_gen.h" @@ -30,4 +29,3 @@ class grib_accessor_class_label_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_label_h */ diff --git a/src/accessor/grib_accessor_class_latitudes.h b/src/accessor/grib_accessor_class_latitudes.h index 1b55b5210..cb1f6ada8 100644 --- a/src/accessor/grib_accessor_class_latitudes.h +++ b/src/accessor/grib_accessor_class_latitudes.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_latitudes_h -#define eccodes_accessor_latitudes_h +#pragma once #include "grib_accessor_class_double.h" @@ -34,4 +33,3 @@ class grib_accessor_class_latitudes_t : public grib_accessor_class_double_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_latitudes_h */ diff --git a/src/accessor/grib_accessor_class_latlon_increment.h b/src/accessor/grib_accessor_class_latlon_increment.h index 3c189450d..8dfa7cb93 100644 --- a/src/accessor/grib_accessor_class_latlon_increment.h +++ b/src/accessor/grib_accessor_class_latlon_increment.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_latlon_increment_h -#define eccodes_accessor_latlon_increment_h +#pragma once #include "grib_accessor_class_double.h" @@ -39,4 +38,3 @@ class grib_accessor_class_latlon_increment_t : public grib_accessor_class_double int unpack_double(grib_accessor*, double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_latlon_increment_h */ diff --git a/src/accessor/grib_accessor_class_latlonvalues.h b/src/accessor/grib_accessor_class_latlonvalues.h index 0109e7e86..7328688c6 100644 --- a/src/accessor/grib_accessor_class_latlonvalues.h +++ b/src/accessor/grib_accessor_class_latlonvalues.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_latlonvalues_h -#define eccodes_accessor_latlonvalues_h +#pragma once #include "grib_accessor_class_double.h" @@ -30,4 +29,3 @@ class grib_accessor_class_latlonvalues_t : public grib_accessor_class_double_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_latlonvalues_h */ diff --git a/src/accessor/grib_accessor_class_library_version.h b/src/accessor/grib_accessor_class_library_version.h index d4c56b52c..cb2a45f04 100644 --- a/src/accessor/grib_accessor_class_library_version.h +++ b/src/accessor/grib_accessor_class_library_version.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_library_version_h -#define eccodes_accessor_library_version_h +#pragma once #include "grib_accessor_class_ascii.h" @@ -29,4 +28,3 @@ class grib_accessor_class_library_version_t : public grib_accessor_class_ascii_t size_t string_length(grib_accessor*) override; int value_count(grib_accessor*, long*) override; }; -#endif /* eccodes_accessor_library_version_h */ diff --git a/src/accessor/grib_accessor_class_local_definition.h b/src/accessor/grib_accessor_class_local_definition.h index 6ca10add6..f91ebbef4 100644 --- a/src/accessor/grib_accessor_class_local_definition.h +++ b/src/accessor/grib_accessor_class_local_definition.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_local_definition_h -#define eccodes_accessor_local_definition_h +#pragma once #include "grib_accessor_class_unsigned.h" @@ -39,4 +38,3 @@ class grib_accessor_class_local_definition_t : public grib_accessor_class_unsign int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_local_definition_h */ diff --git a/src/accessor/grib_accessor_class_long_vector.h b/src/accessor/grib_accessor_class_long_vector.h index aacd5e06e..010a4ed7e 100644 --- a/src/accessor/grib_accessor_class_long_vector.h +++ b/src/accessor/grib_accessor_class_long_vector.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_long_vector_h -#define eccodes_accessor_long_vector_h +#pragma once #include "grib_accessor_class_abstract_long_vector.h" @@ -33,4 +32,3 @@ class grib_accessor_class_long_vector_t : public grib_accessor_class_abstract_lo int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_long_vector_h */ diff --git a/src/accessor/grib_accessor_class_longitudes.h b/src/accessor/grib_accessor_class_longitudes.h index a1964ea51..def174a74 100644 --- a/src/accessor/grib_accessor_class_longitudes.h +++ b/src/accessor/grib_accessor_class_longitudes.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_longitudes_h -#define eccodes_accessor_longitudes_h +#pragma once #include "grib_accessor_class_double.h" @@ -34,4 +33,3 @@ class grib_accessor_class_longitudes_t : public grib_accessor_class_double_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_longitudes_h */ diff --git a/src/accessor/grib_accessor_class_lookup.h b/src/accessor/grib_accessor_class_lookup.h index 1fba42fe5..be1663ae7 100644 --- a/src/accessor/grib_accessor_class_lookup.h +++ b/src/accessor/grib_accessor_class_lookup.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_lookup_h -#define eccodes_accessor_lookup_h +#pragma once #include "grib_accessor_class_long.h" @@ -37,4 +36,3 @@ class grib_accessor_class_lookup_t : public grib_accessor_class_long_t void post_init(grib_accessor*) override; int notify_change(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_lookup_h */ diff --git a/src/accessor/grib_accessor_class_mars_param.h b/src/accessor/grib_accessor_class_mars_param.h index d56488c0a..1eab50fb6 100644 --- a/src/accessor/grib_accessor_class_mars_param.h +++ b/src/accessor/grib_accessor_class_mars_param.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_mars_param_h -#define eccodes_accessor_mars_param_h +#pragma once #include "grib_accessor_class_ascii.h" @@ -32,4 +31,3 @@ class grib_accessor_class_mars_param_t : public grib_accessor_class_ascii_t size_t string_length(grib_accessor*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_mars_param_h */ diff --git a/src/accessor/grib_accessor_class_mars_step.h b/src/accessor/grib_accessor_class_mars_step.h index 5a570203f..8a49f56a6 100644 --- a/src/accessor/grib_accessor_class_mars_step.h +++ b/src/accessor/grib_accessor_class_mars_step.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_mars_step_h -#define eccodes_accessor_mars_step_h +#pragma once #include "grib_accessor_class_ascii.h" @@ -36,4 +35,3 @@ class grib_accessor_class_mars_step_t : public grib_accessor_class_ascii_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_mars_step_h */ diff --git a/src/accessor/grib_accessor_class_md5.h b/src/accessor/grib_accessor_class_md5.h index fdfc70718..ae66f397f 100644 --- a/src/accessor/grib_accessor_class_md5.h +++ b/src/accessor/grib_accessor_class_md5.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_md5_h -#define eccodes_accessor_md5_h +#pragma once #include "grib_accessor_class_gen.h" @@ -35,4 +34,3 @@ class grib_accessor_class_md5_t : public grib_accessor_class_gen_t void init(grib_accessor*, const long, grib_arguments*) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_md5_h */ diff --git a/src/accessor/grib_accessor_class_message.h b/src/accessor/grib_accessor_class_message.h index 478c01964..2e29d6ebd 100644 --- a/src/accessor/grib_accessor_class_message.h +++ b/src/accessor/grib_accessor_class_message.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_message_h -#define eccodes_accessor_message_h +#pragma once #include "grib_accessor_class_bytes.h" @@ -32,4 +31,3 @@ class grib_accessor_class_message_t : public grib_accessor_class_bytes_t void update_size(grib_accessor*, size_t) override; void resize(grib_accessor*,size_t) override; }; -#endif /* eccodes_accessor_message_h */ diff --git a/src/accessor/grib_accessor_class_message_copy.h b/src/accessor/grib_accessor_class_message_copy.h index fa4110a1c..608817a93 100644 --- a/src/accessor/grib_accessor_class_message_copy.h +++ b/src/accessor/grib_accessor_class_message_copy.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_message_copy_h -#define eccodes_accessor_message_copy_h +#pragma once #include "grib_accessor_class_gen.h" @@ -32,4 +31,3 @@ class grib_accessor_class_message_copy_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_message_copy_h */ diff --git a/src/accessor/grib_accessor_class_multdouble.h b/src/accessor/grib_accessor_class_multdouble.h index 5cc218aac..025daf903 100644 --- a/src/accessor/grib_accessor_class_multdouble.h +++ b/src/accessor/grib_accessor_class_multdouble.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_multdouble_h -#define eccodes_accessor_multdouble_h +#pragma once #include "grib_accessor_class_double.h" @@ -30,4 +29,3 @@ class grib_accessor_class_multdouble_t : public grib_accessor_class_double_t int unpack_double(grib_accessor*, double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_multdouble_h */ diff --git a/src/accessor/grib_accessor_class_non_alpha.h b/src/accessor/grib_accessor_class_non_alpha.h index 72674ac5d..83b1ca9ba 100644 --- a/src/accessor/grib_accessor_class_non_alpha.h +++ b/src/accessor/grib_accessor_class_non_alpha.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_non_alpha_h -#define eccodes_accessor_non_alpha_h +#pragma once #include "grib_accessor_class_gen.h" @@ -35,4 +34,3 @@ class grib_accessor_class_non_alpha_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_non_alpha_h */ diff --git a/src/accessor/grib_accessor_class_number_of_coded_values.h b/src/accessor/grib_accessor_class_number_of_coded_values.h index 1d46cdd6b..6578e1dcf 100644 --- a/src/accessor/grib_accessor_class_number_of_coded_values.h +++ b/src/accessor/grib_accessor_class_number_of_coded_values.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_number_of_coded_values_h -#define eccodes_accessor_number_of_coded_values_h +#pragma once #include "grib_accessor_class_long.h" @@ -33,4 +32,3 @@ class grib_accessor_class_number_of_coded_values_t : public grib_accessor_class_ int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_number_of_coded_values_h */ diff --git a/src/accessor/grib_accessor_class_number_of_points.h b/src/accessor/grib_accessor_class_number_of_points.h index 4adaddaa2..f55d9bbeb 100644 --- a/src/accessor/grib_accessor_class_number_of_points.h +++ b/src/accessor/grib_accessor_class_number_of_points.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_number_of_points_h -#define eccodes_accessor_number_of_points_h +#pragma once #include "grib_accessor_class_long.h" @@ -32,4 +31,3 @@ class grib_accessor_class_number_of_points_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_number_of_points_h */ diff --git a/src/accessor/grib_accessor_class_number_of_points_gaussian.h b/src/accessor/grib_accessor_class_number_of_points_gaussian.h index 48e63d28c..d00fb5b6e 100644 --- a/src/accessor/grib_accessor_class_number_of_points_gaussian.h +++ b/src/accessor/grib_accessor_class_number_of_points_gaussian.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_number_of_points_gaussian_h -#define eccodes_accessor_number_of_points_gaussian_h +#pragma once #include "grib_accessor_class_long.h" @@ -38,4 +37,3 @@ class grib_accessor_class_number_of_points_gaussian_t : public grib_accessor_cla int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_number_of_points_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_number_of_values.h b/src/accessor/grib_accessor_class_number_of_values.h index 8b6418a9c..895669f34 100644 --- a/src/accessor/grib_accessor_class_number_of_values.h +++ b/src/accessor/grib_accessor_class_number_of_values.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_number_of_values_h -#define eccodes_accessor_number_of_values_h +#pragma once #include "grib_accessor_class_long.h" @@ -34,4 +33,3 @@ class grib_accessor_class_number_of_values_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_number_of_values_h */ diff --git a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h index 0a4601852..798f428f5 100644 --- a/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h +++ b/src/accessor/grib_accessor_class_number_of_values_data_raw_packing.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_number_of_values_data_raw_packing_h -#define eccodes_accessor_number_of_values_data_raw_packing_h +#pragma once #include "grib_accessor_class_gen.h" @@ -31,4 +30,3 @@ class grib_accessor_class_number_of_values_data_raw_packing_t : public grib_acce int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_number_of_values_data_raw_packing_h */ diff --git a/src/accessor/grib_accessor_class_octahedral_gaussian.h b/src/accessor/grib_accessor_class_octahedral_gaussian.h index f9c540018..cc7f52a25 100644 --- a/src/accessor/grib_accessor_class_octahedral_gaussian.h +++ b/src/accessor/grib_accessor_class_octahedral_gaussian.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_octahedral_gaussian_h -#define eccodes_accessor_octahedral_gaussian_h +#pragma once #include "grib_accessor_class_long.h" @@ -33,4 +32,3 @@ class grib_accessor_class_octahedral_gaussian_t : public grib_accessor_class_lon int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_octahedral_gaussian_h */ diff --git a/src/accessor/grib_accessor_class_octet_number.h b/src/accessor/grib_accessor_class_octet_number.h index 35f536214..691dcb564 100644 --- a/src/accessor/grib_accessor_class_octet_number.h +++ b/src/accessor/grib_accessor_class_octet_number.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_octet_number_h -#define eccodes_accessor_octet_number_h +#pragma once #include "grib_accessor_class_long.h" @@ -31,4 +30,3 @@ class grib_accessor_class_octet_number_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_octet_number_h */ diff --git a/src/accessor/grib_accessor_class_offset_file.h b/src/accessor/grib_accessor_class_offset_file.h index 326559d81..6cb25b864 100644 --- a/src/accessor/grib_accessor_class_offset_file.h +++ b/src/accessor/grib_accessor_class_offset_file.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_offset_file_h -#define eccodes_accessor_offset_file_h +#pragma once #include "grib_accessor_class_double.h" @@ -29,4 +28,3 @@ class grib_accessor_class_offset_file_t : public grib_accessor_class_double_t int unpack_string(grib_accessor*, char*, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_offset_file_h */ diff --git a/src/accessor/grib_accessor_class_offset_values.h b/src/accessor/grib_accessor_class_offset_values.h index 4fe2fc779..702e48da7 100644 --- a/src/accessor/grib_accessor_class_offset_values.h +++ b/src/accessor/grib_accessor_class_offset_values.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_offset_values_h -#define eccodes_accessor_offset_values_h +#pragma once #include "grib_accessor_class_double.h" @@ -31,4 +30,3 @@ class grib_accessor_class_offset_values_t : public grib_accessor_class_double_t int unpack_double(grib_accessor*, double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_offset_values_h */ diff --git a/src/accessor/grib_accessor_class_optimal_step_units.h b/src/accessor/grib_accessor_class_optimal_step_units.h index a62759390..e7aa35247 100644 --- a/src/accessor/grib_accessor_class_optimal_step_units.h +++ b/src/accessor/grib_accessor_class_optimal_step_units.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_optimal_step_units_h -#define eccodes_accessor_optimal_step_units_h +#pragma once #include "grib_accessor_class_gen.h" @@ -41,4 +40,3 @@ class grib_accessor_class_optimal_step_units_t : public grib_accessor_class_gen_ void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_optimal_step_units_h */ diff --git a/src/accessor/grib_accessor_class_pack_bufr_values.h b/src/accessor/grib_accessor_class_pack_bufr_values.h index 8cb218129..0a59a5141 100644 --- a/src/accessor/grib_accessor_class_pack_bufr_values.h +++ b/src/accessor/grib_accessor_class_pack_bufr_values.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_pack_bufr_values_h -#define eccodes_accessor_pack_bufr_values_h +#pragma once #include "grib_accessor_class_gen.h" @@ -38,4 +37,3 @@ class grib_accessor_class_pack_bufr_values_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_pack_bufr_values_h */ diff --git a/src/accessor/grib_accessor_class_packing_type.h b/src/accessor/grib_accessor_class_packing_type.h index 2a454c1f4..7deb8f4cf 100644 --- a/src/accessor/grib_accessor_class_packing_type.h +++ b/src/accessor/grib_accessor_class_packing_type.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_packing_type_h -#define eccodes_accessor_packing_type_h +#pragma once #include "grib_accessor_class_gen.h" @@ -33,4 +32,3 @@ class grib_accessor_class_packing_type_t : public grib_accessor_class_gen_t size_t string_length(grib_accessor*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_packing_type_h */ diff --git a/src/accessor/grib_accessor_class_pad.h b/src/accessor/grib_accessor_class_pad.h index 08bf09727..5234e73a5 100644 --- a/src/accessor/grib_accessor_class_pad.h +++ b/src/accessor/grib_accessor_class_pad.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_pad_h -#define eccodes_accessor_pad_h +#pragma once #include "grib_accessor_class_padding.h" @@ -30,4 +29,3 @@ class grib_accessor_class_pad_t : public grib_accessor_class_padding_t void init(grib_accessor*, const long, grib_arguments*) override; size_t preferred_size(grib_accessor*, int) override; }; -#endif /* eccodes_accessor_pad_h */ diff --git a/src/accessor/grib_accessor_class_padding.h b/src/accessor/grib_accessor_class_padding.h index 7544987e0..6d4175de3 100644 --- a/src/accessor/grib_accessor_class_padding.h +++ b/src/accessor/grib_accessor_class_padding.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_padding_h -#define eccodes_accessor_padding_h +#pragma once #include "grib_accessor_class_bytes.h" @@ -33,4 +32,3 @@ class grib_accessor_class_padding_t : public grib_accessor_class_bytes_t void resize(grib_accessor*,size_t) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_padding_h */ diff --git a/src/accessor/grib_accessor_class_padto.h b/src/accessor/grib_accessor_class_padto.h index fde8ebbef..a1b7b398a 100644 --- a/src/accessor/grib_accessor_class_padto.h +++ b/src/accessor/grib_accessor_class_padto.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_padto_h -#define eccodes_accessor_padto_h +#pragma once #include "grib_accessor_class_padding.h" @@ -30,4 +29,3 @@ class grib_accessor_class_padto_t : public grib_accessor_class_padding_t void init(grib_accessor*, const long, grib_arguments*) override; size_t preferred_size(grib_accessor*, int) override; }; -#endif /* eccodes_accessor_padto_h */ diff --git a/src/accessor/grib_accessor_class_padtoeven.h b/src/accessor/grib_accessor_class_padtoeven.h index 5dff5ba39..9f42f5880 100644 --- a/src/accessor/grib_accessor_class_padtoeven.h +++ b/src/accessor/grib_accessor_class_padtoeven.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_padtoeven_h -#define eccodes_accessor_padtoeven_h +#pragma once #include "grib_accessor_class_padding.h" @@ -30,4 +29,3 @@ class grib_accessor_class_padtoeven_t : public grib_accessor_class_padding_t void init(grib_accessor*, const long, grib_arguments*) override; size_t preferred_size(grib_accessor*, int) override; }; -#endif /* eccodes_accessor_padtoeven_h */ diff --git a/src/accessor/grib_accessor_class_padtomultiple.h b/src/accessor/grib_accessor_class_padtomultiple.h index 5bcb0ea71..1de8e4059 100644 --- a/src/accessor/grib_accessor_class_padtomultiple.h +++ b/src/accessor/grib_accessor_class_padtomultiple.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_padtomultiple_h -#define eccodes_accessor_padtomultiple_h +#pragma once #include "grib_accessor_class_padding.h" @@ -30,4 +29,3 @@ class grib_accessor_class_padtomultiple_t : public grib_accessor_class_padding_t void init(grib_accessor*, const long, grib_arguments*) override; size_t preferred_size(grib_accessor*, int) override; }; -#endif /* eccodes_accessor_padtomultiple_h */ diff --git a/src/accessor/grib_accessor_class_position.h b/src/accessor/grib_accessor_class_position.h index 5597940b4..58e5beb24 100644 --- a/src/accessor/grib_accessor_class_position.h +++ b/src/accessor/grib_accessor_class_position.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_position_h -#define eccodes_accessor_position_h +#pragma once #include "grib_accessor_class_gen.h" @@ -30,4 +29,3 @@ class grib_accessor_class_position_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_position_h */ diff --git a/src/accessor/grib_accessor_class_proj_string.h b/src/accessor/grib_accessor_class_proj_string.h index 7205a8942..e214c32a9 100644 --- a/src/accessor/grib_accessor_class_proj_string.h +++ b/src/accessor/grib_accessor_class_proj_string.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_proj_string_h -#define eccodes_accessor_proj_string_h +#pragma once #include "grib_accessor_class_gen.h" @@ -31,4 +30,3 @@ class grib_accessor_class_proj_string_t : public grib_accessor_class_gen_t int unpack_string(grib_accessor*, char*, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_proj_string_h */ diff --git a/src/accessor/grib_accessor_class_raw.h b/src/accessor/grib_accessor_class_raw.h index 5f4cc36ef..8a588ac61 100644 --- a/src/accessor/grib_accessor_class_raw.h +++ b/src/accessor/grib_accessor_class_raw.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_raw_h -#define eccodes_accessor_raw_h +#pragma once #include "grib_accessor_class_gen.h" @@ -37,4 +36,3 @@ class grib_accessor_class_raw_t : public grib_accessor_class_gen_t void update_size(grib_accessor*, size_t) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_raw_h */ diff --git a/src/accessor/grib_accessor_class_rdbtime_guess_date.h b/src/accessor/grib_accessor_class_rdbtime_guess_date.h index 9cef89877..739c95e8d 100644 --- a/src/accessor/grib_accessor_class_rdbtime_guess_date.h +++ b/src/accessor/grib_accessor_class_rdbtime_guess_date.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_rdbtime_guess_date_h -#define eccodes_accessor_rdbtime_guess_date_h +#pragma once #include "grib_accessor_class_long.h" @@ -34,4 +33,3 @@ class grib_accessor_class_rdbtime_guess_date_t : public grib_accessor_class_long int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_rdbtime_guess_date_h */ diff --git a/src/accessor/grib_accessor_class_reference_value_error.h b/src/accessor/grib_accessor_class_reference_value_error.h index bac786ca6..2a470562e 100644 --- a/src/accessor/grib_accessor_class_reference_value_error.h +++ b/src/accessor/grib_accessor_class_reference_value_error.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_reference_value_error_h -#define eccodes_accessor_reference_value_error_h +#pragma once #include "grib_accessor_class_double.h" @@ -30,4 +29,3 @@ class grib_accessor_class_reference_value_error_t : public grib_accessor_class_d int unpack_double(grib_accessor*, double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_reference_value_error_h */ diff --git a/src/accessor/grib_accessor_class_round.h b/src/accessor/grib_accessor_class_round.h index e235dfd85..364e24b34 100644 --- a/src/accessor/grib_accessor_class_round.h +++ b/src/accessor/grib_accessor_class_round.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_round_h -#define eccodes_accessor_round_h +#pragma once #include "grib_accessor_class_evaluate.h" @@ -28,4 +27,3 @@ class grib_accessor_class_round_t : public grib_accessor_class_evaluate_t int unpack_double(grib_accessor*, double* val, size_t* len) override; int unpack_string(grib_accessor*, char*, size_t* len) override; }; -#endif /* eccodes_accessor_round_h */ diff --git a/src/accessor/grib_accessor_class_scale.h b/src/accessor/grib_accessor_class_scale.h index e75fdb021..29b65f34b 100644 --- a/src/accessor/grib_accessor_class_scale.h +++ b/src/accessor/grib_accessor_class_scale.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_scale_h -#define eccodes_accessor_scale_h +#pragma once #include "grib_accessor_class_double.h" @@ -35,4 +34,3 @@ class grib_accessor_class_scale_t : public grib_accessor_class_double_t int unpack_double(grib_accessor*, double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_scale_h */ diff --git a/src/accessor/grib_accessor_class_scale_values.h b/src/accessor/grib_accessor_class_scale_values.h index 4c807f696..f004db30e 100644 --- a/src/accessor/grib_accessor_class_scale_values.h +++ b/src/accessor/grib_accessor_class_scale_values.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_scale_values_h -#define eccodes_accessor_scale_values_h +#pragma once #include "grib_accessor_class_double.h" @@ -31,4 +30,3 @@ class grib_accessor_class_scale_values_t : public grib_accessor_class_double_t int unpack_double(grib_accessor*, double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_scale_values_h */ diff --git a/src/accessor/grib_accessor_class_second_order_bits_per_value.h b/src/accessor/grib_accessor_class_second_order_bits_per_value.h index b5a38b417..c3459db41 100644 --- a/src/accessor/grib_accessor_class_second_order_bits_per_value.h +++ b/src/accessor/grib_accessor_class_second_order_bits_per_value.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_second_order_bits_per_value_h -#define eccodes_accessor_second_order_bits_per_value_h +#pragma once #include "grib_accessor_class_long.h" @@ -33,4 +32,3 @@ class grib_accessor_class_second_order_bits_per_value_t : public grib_accessor_c int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_second_order_bits_per_value_h */ diff --git a/src/accessor/grib_accessor_class_section.h b/src/accessor/grib_accessor_class_section.h index b1905b182..8dbd831cc 100644 --- a/src/accessor/grib_accessor_class_section.h +++ b/src/accessor/grib_accessor_class_section.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_section_h -#define eccodes_accessor_section_h +#pragma once #include "grib_accessor_class_gen.h" @@ -31,4 +30,3 @@ class grib_accessor_class_section_t : public grib_accessor_class_gen_t grib_section* sub_section(grib_accessor*) override; grib_accessor* next(grib_accessor*, int) override; }; -#endif /* eccodes_accessor_section_h */ diff --git a/src/accessor/grib_accessor_class_section_length.h b/src/accessor/grib_accessor_class_section_length.h index 0c56b4cb0..e7965b9b1 100644 --- a/src/accessor/grib_accessor_class_section_length.h +++ b/src/accessor/grib_accessor_class_section_length.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_section_length_h -#define eccodes_accessor_section_length_h +#pragma once #include "grib_accessor_class_unsigned.h" @@ -29,4 +28,3 @@ class grib_accessor_class_section_length_t : public grib_accessor_class_unsigned void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_section_length_h */ diff --git a/src/accessor/grib_accessor_class_section_padding.h b/src/accessor/grib_accessor_class_section_padding.h index f3ea9c821..f35da4977 100644 --- a/src/accessor/grib_accessor_class_section_padding.h +++ b/src/accessor/grib_accessor_class_section_padding.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_section_padding_h -#define eccodes_accessor_section_padding_h +#pragma once #include "grib_accessor_class_padding.h" @@ -29,4 +28,3 @@ class grib_accessor_class_section_padding_t : public grib_accessor_class_padding void init(grib_accessor*, const long, grib_arguments*) override; size_t preferred_size(grib_accessor*, int) override; }; -#endif /* eccodes_accessor_section_padding_h */ diff --git a/src/accessor/grib_accessor_class_section_pointer.h b/src/accessor/grib_accessor_class_section_pointer.h index e34125800..569e20201 100644 --- a/src/accessor/grib_accessor_class_section_pointer.h +++ b/src/accessor/grib_accessor_class_section_pointer.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_section_pointer_h -#define eccodes_accessor_section_pointer_h +#pragma once #include "grib_accessor_class_gen.h" @@ -34,4 +33,3 @@ class grib_accessor_class_section_pointer_t : public grib_accessor_class_gen_t long byte_offset(grib_accessor*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_section_pointer_h */ diff --git a/src/accessor/grib_accessor_class_select_step_template.h b/src/accessor/grib_accessor_class_select_step_template.h index d2e58c757..e327a99da 100644 --- a/src/accessor/grib_accessor_class_select_step_template.h +++ b/src/accessor/grib_accessor_class_select_step_template.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_select_step_template_h -#define eccodes_accessor_select_step_template_h +#pragma once #include "grib_accessor_class_unsigned.h" @@ -32,4 +31,3 @@ class grib_accessor_class_select_step_template_t : public grib_accessor_class_un int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_select_step_template_h */ diff --git a/src/accessor/grib_accessor_class_sexagesimal2decimal.h b/src/accessor/grib_accessor_class_sexagesimal2decimal.h index 0dec18f2c..d9051bca9 100644 --- a/src/accessor/grib_accessor_class_sexagesimal2decimal.h +++ b/src/accessor/grib_accessor_class_sexagesimal2decimal.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_sexagesimal2decimal_h -#define eccodes_accessor_sexagesimal2decimal_h +#pragma once #include "grib_accessor_class_to_double.h" @@ -30,4 +29,3 @@ class grib_accessor_class_sexagesimal2decimal_t : public grib_accessor_class_to_ void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_sexagesimal2decimal_h */ diff --git a/src/accessor/grib_accessor_class_signed.h b/src/accessor/grib_accessor_class_signed.h index 72d3c6657..9fbb6f8d2 100644 --- a/src/accessor/grib_accessor_class_signed.h +++ b/src/accessor/grib_accessor_class_signed.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_signed_h -#define eccodes_accessor_signed_h +#pragma once #include "grib_accessor_class_long.h" @@ -38,4 +37,3 @@ class grib_accessor_class_signed_t : public grib_accessor_class_long_t void init(grib_accessor*, const long, grib_arguments*) override; void update_size(grib_accessor*, size_t) override; }; -#endif /* eccodes_accessor_signed_h */ diff --git a/src/accessor/grib_accessor_class_signed_bits.h b/src/accessor/grib_accessor_class_signed_bits.h index d70a9a27a..dd49c5c75 100644 --- a/src/accessor/grib_accessor_class_signed_bits.h +++ b/src/accessor/grib_accessor_class_signed_bits.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_signed_bits_h -#define eccodes_accessor_signed_bits_h +#pragma once #include "grib_accessor_class_long.h" @@ -36,4 +35,3 @@ class grib_accessor_class_signed_bits_t : public grib_accessor_class_long_t void init(grib_accessor*, const long, grib_arguments*) override; void update_size(grib_accessor*, size_t) override; }; -#endif /* eccodes_accessor_signed_bits_h */ diff --git a/src/accessor/grib_accessor_class_simple_packing_error.h b/src/accessor/grib_accessor_class_simple_packing_error.h index 55f720b78..f0c005e03 100644 --- a/src/accessor/grib_accessor_class_simple_packing_error.h +++ b/src/accessor/grib_accessor_class_simple_packing_error.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_simple_packing_error_h -#define eccodes_accessor_simple_packing_error_h +#pragma once #include "grib_accessor_class_double.h" @@ -33,4 +32,3 @@ class grib_accessor_class_simple_packing_error_t : public grib_accessor_class_do int unpack_double(grib_accessor*, double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_simple_packing_error_h */ diff --git a/src/accessor/grib_accessor_class_size.h b/src/accessor/grib_accessor_class_size.h index 12914616e..9901c479e 100644 --- a/src/accessor/grib_accessor_class_size.h +++ b/src/accessor/grib_accessor_class_size.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_size_h -#define eccodes_accessor_size_h +#pragma once #include "grib_accessor_class_long.h" @@ -29,4 +28,3 @@ class grib_accessor_class_size_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_size_h */ diff --git a/src/accessor/grib_accessor_class_smart_table_column.h b/src/accessor/grib_accessor_class_smart_table_column.h index f5787f780..9e1edcd2a 100644 --- a/src/accessor/grib_accessor_class_smart_table_column.h +++ b/src/accessor/grib_accessor_class_smart_table_column.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_smart_table_column_h -#define eccodes_accessor_smart_table_column_h +#pragma once #include "grib_accessor_class_gen.h" @@ -34,4 +33,3 @@ class grib_accessor_class_smart_table_column_t : public grib_accessor_class_gen_ void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_smart_table_column_h */ diff --git a/src/accessor/grib_accessor_class_spd.h b/src/accessor/grib_accessor_class_spd.h index 17ebb9b15..ee4fa5d12 100644 --- a/src/accessor/grib_accessor_class_spd.h +++ b/src/accessor/grib_accessor_class_spd.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_spd_h -#define eccodes_accessor_spd_h +#pragma once #include "grib_accessor_class_long.h" @@ -36,4 +35,3 @@ class grib_accessor_class_spd_t : public grib_accessor_class_long_t void init(grib_accessor*, const long, grib_arguments*) override; void update_size(grib_accessor*, size_t) override; }; -#endif /* eccodes_accessor_spd_h */ diff --git a/src/accessor/grib_accessor_class_spectral_truncation.h b/src/accessor/grib_accessor_class_spectral_truncation.h index fb43b42d1..c9f85b9f8 100644 --- a/src/accessor/grib_accessor_class_spectral_truncation.h +++ b/src/accessor/grib_accessor_class_spectral_truncation.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_spectral_truncation_h -#define eccodes_accessor_spectral_truncation_h +#pragma once #include "grib_accessor_class_long.h" @@ -32,4 +31,3 @@ class grib_accessor_class_spectral_truncation_t : public grib_accessor_class_lon int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_spectral_truncation_h */ diff --git a/src/accessor/grib_accessor_class_sprintf.h b/src/accessor/grib_accessor_class_sprintf.h index c183db830..36d5f3e10 100644 --- a/src/accessor/grib_accessor_class_sprintf.h +++ b/src/accessor/grib_accessor_class_sprintf.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_sprintf_h -#define eccodes_accessor_sprintf_h +#pragma once #include "grib_accessor_class_ascii.h" @@ -31,4 +30,3 @@ class grib_accessor_class_sprintf_t : public grib_accessor_class_ascii_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_sprintf_h */ diff --git a/src/accessor/grib_accessor_class_statistics.h b/src/accessor/grib_accessor_class_statistics.h index fcc866ca8..63d7cbc00 100644 --- a/src/accessor/grib_accessor_class_statistics.h +++ b/src/accessor/grib_accessor_class_statistics.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_statistics_h -#define eccodes_accessor_statistics_h +#pragma once #include "grib_accessor_class_abstract_vector.h" @@ -34,4 +33,3 @@ class grib_accessor_class_statistics_t : public grib_accessor_class_abstract_vec void init(grib_accessor*, const long, grib_arguments*) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_statistics_h */ diff --git a/src/accessor/grib_accessor_class_statistics_spectral.h b/src/accessor/grib_accessor_class_statistics_spectral.h index 1451a0d2e..41846c5c7 100644 --- a/src/accessor/grib_accessor_class_statistics_spectral.h +++ b/src/accessor/grib_accessor_class_statistics_spectral.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_statistics_spectral_h -#define eccodes_accessor_statistics_spectral_h +#pragma once #include "grib_accessor_class_abstract_vector.h" @@ -36,4 +35,3 @@ class grib_accessor_class_statistics_spectral_t : public grib_accessor_class_abs void init(grib_accessor*, const long, grib_arguments*) override; int compare(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_statistics_spectral_h */ diff --git a/src/accessor/grib_accessor_class_step_human_readable.h b/src/accessor/grib_accessor_class_step_human_readable.h index 4100f6008..cbd61ed31 100644 --- a/src/accessor/grib_accessor_class_step_human_readable.h +++ b/src/accessor/grib_accessor_class_step_human_readable.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_step_human_readable_h -#define eccodes_accessor_step_human_readable_h +#pragma once #include "grib_accessor_class_gen.h" @@ -31,4 +30,3 @@ class grib_accessor_class_step_human_readable_t : public grib_accessor_class_gen int unpack_string(grib_accessor*, char*, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_step_human_readable_h */ diff --git a/src/accessor/grib_accessor_class_step_in_units.h b/src/accessor/grib_accessor_class_step_in_units.h index 0f8036d13..66f4b2b44 100644 --- a/src/accessor/grib_accessor_class_step_in_units.h +++ b/src/accessor/grib_accessor_class_step_in_units.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_step_in_units_h -#define eccodes_accessor_step_in_units_h +#pragma once #include "grib_accessor_class_long.h" @@ -39,4 +38,3 @@ class grib_accessor_class_step_in_units_t : public grib_accessor_class_long_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_step_in_units_h */ diff --git a/src/accessor/grib_accessor_class_sum.h b/src/accessor/grib_accessor_class_sum.h index 5ee44d7a0..5667d8da9 100644 --- a/src/accessor/grib_accessor_class_sum.h +++ b/src/accessor/grib_accessor_class_sum.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_sum_h -#define eccodes_accessor_sum_h +#pragma once #include "grib_accessor_class_double.h" @@ -31,4 +30,3 @@ class grib_accessor_class_sum_t : public grib_accessor_class_double_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_sum_h */ diff --git a/src/accessor/grib_accessor_class_suppressed.h b/src/accessor/grib_accessor_class_suppressed.h index 5de58f430..5d764be35 100644 --- a/src/accessor/grib_accessor_class_suppressed.h +++ b/src/accessor/grib_accessor_class_suppressed.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_suppressed_h -#define eccodes_accessor_suppressed_h +#pragma once #include "grib_accessor_class_long.h" @@ -33,4 +32,3 @@ class grib_accessor_class_suppressed_t : public grib_accessor_class_long_t int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_suppressed_h */ diff --git a/src/accessor/grib_accessor_class_time.h b/src/accessor/grib_accessor_class_time.h index c343872b8..dee0325a9 100644 --- a/src/accessor/grib_accessor_class_time.h +++ b/src/accessor/grib_accessor_class_time.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_time_h -#define eccodes_accessor_time_h +#pragma once #include "grib_accessor_class_long.h" @@ -33,4 +32,3 @@ class grib_accessor_class_time_t : public grib_accessor_class_long_t int unpack_string(grib_accessor*, char*, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_time_h */ diff --git a/src/accessor/grib_accessor_class_to_double.h b/src/accessor/grib_accessor_class_to_double.h index 8b3d861e0..c8755c90f 100644 --- a/src/accessor/grib_accessor_class_to_double.h +++ b/src/accessor/grib_accessor_class_to_double.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_to_double_h -#define eccodes_accessor_to_double_h +#pragma once #include "grib_accessor_class_gen.h" @@ -39,4 +38,3 @@ class grib_accessor_class_to_double_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_to_double_h */ diff --git a/src/accessor/grib_accessor_class_to_integer.h b/src/accessor/grib_accessor_class_to_integer.h index 38f909248..da8334e4f 100644 --- a/src/accessor/grib_accessor_class_to_integer.h +++ b/src/accessor/grib_accessor_class_to_integer.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_to_integer_h -#define eccodes_accessor_to_integer_h +#pragma once #include "grib_accessor_class_gen.h" @@ -41,4 +40,3 @@ class grib_accessor_class_to_integer_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_to_integer_h */ diff --git a/src/accessor/grib_accessor_class_to_string.h b/src/accessor/grib_accessor_class_to_string.h index 0a5077eb0..ea6981276 100644 --- a/src/accessor/grib_accessor_class_to_string.h +++ b/src/accessor/grib_accessor_class_to_string.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_to_string_h -#define eccodes_accessor_to_string_h +#pragma once #include "grib_accessor_class_gen.h" @@ -38,4 +37,3 @@ class grib_accessor_class_to_string_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_to_string_h */ diff --git a/src/accessor/grib_accessor_class_transient_darray.h b/src/accessor/grib_accessor_class_transient_darray.h index a1142dbe3..230dfa1a1 100644 --- a/src/accessor/grib_accessor_class_transient_darray.h +++ b/src/accessor/grib_accessor_class_transient_darray.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_transient_darray_h -#define eccodes_accessor_transient_darray_h +#pragma once #include "grib_accessor_class_gen.h" @@ -37,4 +36,3 @@ class grib_accessor_class_transient_darray_t : public grib_accessor_class_gen_t void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_transient_darray_h */ diff --git a/src/accessor/grib_accessor_class_trim.h b/src/accessor/grib_accessor_class_trim.h index df06a277f..d5c029a78 100644 --- a/src/accessor/grib_accessor_class_trim.h +++ b/src/accessor/grib_accessor_class_trim.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_trim_h -#define eccodes_accessor_trim_h +#pragma once #include "grib_accessor_class_ascii.h" @@ -33,4 +32,3 @@ class grib_accessor_class_trim_t : public grib_accessor_class_ascii_t size_t string_length(grib_accessor*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_trim_h */ diff --git a/src/accessor/grib_accessor_class_uint16.h b/src/accessor/grib_accessor_class_uint16.h index d77d2b6f6..05818ebbd 100644 --- a/src/accessor/grib_accessor_class_uint16.h +++ b/src/accessor/grib_accessor_class_uint16.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_uint16_h -#define eccodes_accessor_uint16_h +#pragma once #include "grib_accessor_class_gen.h" @@ -28,4 +27,3 @@ class grib_accessor_class_uint16_t : public grib_accessor_class_gen_t int get_native_type(grib_accessor*) override; int unpack_long(grib_accessor*, long* val, size_t* len) override; }; -#endif /* eccodes_accessor_uint16_h */ diff --git a/src/accessor/grib_accessor_class_uint32.h b/src/accessor/grib_accessor_class_uint32.h index e327b275e..143dfc809 100644 --- a/src/accessor/grib_accessor_class_uint32.h +++ b/src/accessor/grib_accessor_class_uint32.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_uint32_h -#define eccodes_accessor_uint32_h +#pragma once #include "grib_accessor_class_gen.h" @@ -28,4 +27,3 @@ class grib_accessor_class_uint32_t : public grib_accessor_class_gen_t int get_native_type(grib_accessor*) override; int unpack_long(grib_accessor*, long* val, size_t* len) override; }; -#endif /* eccodes_accessor_uint32_h */ diff --git a/src/accessor/grib_accessor_class_uint32_little_endian.h b/src/accessor/grib_accessor_class_uint32_little_endian.h index 554ea6a93..83e808bc5 100644 --- a/src/accessor/grib_accessor_class_uint32_little_endian.h +++ b/src/accessor/grib_accessor_class_uint32_little_endian.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_uint32_little_endian_h -#define eccodes_accessor_uint32_little_endian_h +#pragma once #include "grib_accessor_class_gen.h" @@ -28,4 +27,3 @@ class grib_accessor_class_uint32_little_endian_t : public grib_accessor_class_ge int get_native_type(grib_accessor*) override; int unpack_long(grib_accessor*, long* val, size_t* len) override; }; -#endif /* eccodes_accessor_uint32_little_endian_h */ diff --git a/src/accessor/grib_accessor_class_uint64.h b/src/accessor/grib_accessor_class_uint64.h index 3e7779fa3..d442b736d 100644 --- a/src/accessor/grib_accessor_class_uint64.h +++ b/src/accessor/grib_accessor_class_uint64.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_uint64_h -#define eccodes_accessor_uint64_h +#pragma once #include "grib_accessor_class_gen.h" @@ -28,4 +27,3 @@ class grib_accessor_class_uint64_t : public grib_accessor_class_gen_t int get_native_type(grib_accessor*) override; int unpack_long(grib_accessor*, long* val, size_t* len) override; }; -#endif /* eccodes_accessor_uint64_h */ diff --git a/src/accessor/grib_accessor_class_uint64_little_endian.h b/src/accessor/grib_accessor_class_uint64_little_endian.h index e2e1774b1..9e8f4327e 100644 --- a/src/accessor/grib_accessor_class_uint64_little_endian.h +++ b/src/accessor/grib_accessor_class_uint64_little_endian.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_uint64_little_endian_h -#define eccodes_accessor_uint64_little_endian_h +#pragma once #include "grib_accessor_class_gen.h" @@ -28,4 +27,3 @@ class grib_accessor_class_uint64_little_endian_t : public grib_accessor_class_ge int get_native_type(grib_accessor*) override; int unpack_long(grib_accessor*, long* val, size_t* len) override; }; -#endif /* eccodes_accessor_uint64_little_endian_h */ diff --git a/src/accessor/grib_accessor_class_uint8.h b/src/accessor/grib_accessor_class_uint8.h index fb18550e6..8a58b27f3 100644 --- a/src/accessor/grib_accessor_class_uint8.h +++ b/src/accessor/grib_accessor_class_uint8.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_uint8_h -#define eccodes_accessor_uint8_h +#pragma once #include "grib_accessor_class_gen.h" @@ -28,4 +27,3 @@ class grib_accessor_class_uint8_t : public grib_accessor_class_gen_t int get_native_type(grib_accessor*) override; int unpack_long(grib_accessor*, long* val, size_t* len) override; }; -#endif /* eccodes_accessor_uint8_h */ diff --git a/src/accessor/grib_accessor_class_unexpanded_descriptors.h b/src/accessor/grib_accessor_class_unexpanded_descriptors.h index eac0dbf6a..f9a016c1e 100644 --- a/src/accessor/grib_accessor_class_unexpanded_descriptors.h +++ b/src/accessor/grib_accessor_class_unexpanded_descriptors.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_unexpanded_descriptors_h -#define eccodes_accessor_unexpanded_descriptors_h +#pragma once #include "grib_accessor_class_long.h" @@ -35,4 +34,3 @@ class grib_accessor_class_unexpanded_descriptors_t : public grib_accessor_class_ void init(grib_accessor*, const long, grib_arguments*) override; void update_size(grib_accessor*, size_t) override; }; -#endif /* eccodes_accessor_unexpanded_descriptors_h */ diff --git a/src/accessor/grib_accessor_class_unpack_bufr_values.h b/src/accessor/grib_accessor_class_unpack_bufr_values.h index dde08dc9b..46dd91ec5 100644 --- a/src/accessor/grib_accessor_class_unpack_bufr_values.h +++ b/src/accessor/grib_accessor_class_unpack_bufr_values.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_unpack_bufr_values_h -#define eccodes_accessor_unpack_bufr_values_h +#pragma once #include "grib_accessor_class_gen.h" @@ -38,4 +37,3 @@ class grib_accessor_class_unpack_bufr_values_t : public grib_accessor_class_gen_ void dump(grib_accessor*, grib_dumper*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_unpack_bufr_values_h */ diff --git a/src/accessor/grib_accessor_class_unsigned_bits.h b/src/accessor/grib_accessor_class_unsigned_bits.h index 3042ea3fa..52528ab83 100644 --- a/src/accessor/grib_accessor_class_unsigned_bits.h +++ b/src/accessor/grib_accessor_class_unsigned_bits.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_unsigned_bits_h -#define eccodes_accessor_unsigned_bits_h +#pragma once #include "grib_accessor_class_long.h" @@ -36,4 +35,3 @@ class grib_accessor_class_unsigned_bits_t : public grib_accessor_class_long_t void init(grib_accessor*, const long, grib_arguments*) override; void update_size(grib_accessor*, size_t) override; }; -#endif /* eccodes_accessor_unsigned_bits_h */ diff --git a/src/accessor/grib_accessor_class_validity_date.h b/src/accessor/grib_accessor_class_validity_date.h index ca2efb7c4..ca87b3282 100644 --- a/src/accessor/grib_accessor_class_validity_date.h +++ b/src/accessor/grib_accessor_class_validity_date.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_validity_date_h -#define eccodes_accessor_validity_date_h +#pragma once #include "grib_accessor_class_long.h" @@ -35,4 +34,3 @@ class grib_accessor_class_validity_date_t : public grib_accessor_class_long_t int unpack_long(grib_accessor*, long* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_validity_date_h */ diff --git a/src/accessor/grib_accessor_class_validity_time.h b/src/accessor/grib_accessor_class_validity_time.h index 7b998e595..023c3e30a 100644 --- a/src/accessor/grib_accessor_class_validity_time.h +++ b/src/accessor/grib_accessor_class_validity_time.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_validity_time_h -#define eccodes_accessor_validity_time_h +#pragma once #include "grib_accessor_class_long.h" @@ -35,4 +34,3 @@ class grib_accessor_class_validity_time_t : public grib_accessor_class_long_t int unpack_string(grib_accessor*, char*, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_validity_time_h */ diff --git a/src/accessor/grib_accessor_class_vector.h b/src/accessor/grib_accessor_class_vector.h index 12871fcc9..92dc6a13e 100644 --- a/src/accessor/grib_accessor_class_vector.h +++ b/src/accessor/grib_accessor_class_vector.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_vector_h -#define eccodes_accessor_vector_h +#pragma once #include "grib_accessor_class_abstract_vector.h" @@ -30,4 +29,3 @@ class grib_accessor_class_vector_t : public grib_accessor_class_abstract_vector_ int unpack_double(grib_accessor*, double* val, size_t* len) override; void init(grib_accessor*, const long, grib_arguments*) override; }; -#endif /* eccodes_accessor_vector_h */ diff --git a/src/accessor/grib_accessor_class_when.h b/src/accessor/grib_accessor_class_when.h index 22c5bee97..515afb4b1 100644 --- a/src/accessor/grib_accessor_class_when.h +++ b/src/accessor/grib_accessor_class_when.h @@ -9,8 +9,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#ifndef eccodes_accessor_when_h -#define eccodes_accessor_when_h +#pragma once #include "grib_accessor_class_gen.h" @@ -30,4 +29,3 @@ class grib_accessor_class_when_t : public grib_accessor_class_gen_t void init(grib_accessor*, const long, grib_arguments*) override; int notify_change(grib_accessor*, grib_accessor*) override; }; -#endif /* eccodes_accessor_when_h */ From 9d53a9e120b3468128f59f24d1bc8253f607bf0a Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 10 May 2024 12:35:43 +0100 Subject: [PATCH 139/196] Compiler warnings re sprintf --- fortran/grib_fortran.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fortran/grib_fortran.c b/fortran/grib_fortran.c index 3cb17739a..f5427df83 100644 --- a/fortran/grib_fortran.c +++ b/fortran/grib_fortran.c @@ -986,7 +986,7 @@ void grib_f_write_on_fail(int* gid) { file_count++; GRIB_MUTEX_UNLOCK(&handle_mutex) - sprintf(filename,"%ld_%d_error.grib",(long)pid,file_count); + snprintf(filename, sizeof(filename), "%ld_%d_error.grib",(long)pid,file_count); h=get_handle(*gid); if (h) grib_write_message(h,filename,"w"); @@ -1249,7 +1249,7 @@ int grib_f_keys_iterator_get_name_(int* iterid,char* name,int len) fort_char_clean(name, len); - sprintf(buf,"%s",grib_keys_iterator_get_name(kiter)); + snprintf(buf, sizeof(buf), "%s",grib_keys_iterator_get_name(kiter)); lsize = strlen(buf); if (input_len < lsize) return GRIB_ARRAY_TOO_SMALL; @@ -1321,7 +1321,7 @@ int codes_f_bufr_keys_iterator_get_name_(int* iterid, char* name, int len) fort_char_clean(name, len); - sprintf(buf, "%s", codes_bufr_keys_iterator_get_name(kiter)); + snprintf(buf, sizeof(buf), "%s", codes_bufr_keys_iterator_get_name(kiter)); lsize = strlen(buf); if (input_len < lsize) return GRIB_ARRAY_TOO_SMALL; From 98cf979823559e656bcdc1bd6bd88e1785c455fb Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 10 May 2024 15:59:41 +0100 Subject: [PATCH 140/196] ECC-1820: grib_accessors_list.rank made private --- src/accessor/grib_accessors_list.cc | 10 +++++----- src/accessor/grib_accessors_list.h | 5 ++++- src/grib_query.cc | 6 +++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/accessor/grib_accessors_list.cc b/src/accessor/grib_accessors_list.cc index 3ff166e42..c0114b255 100644 --- a/src/accessor/grib_accessors_list.cc +++ b/src/accessor/grib_accessors_list.cc @@ -46,14 +46,14 @@ void grib_accessors_list::push(grib_accessor* a, int rank) if (last && last->accessor) { last->next_ = (grib_accessors_list*)grib_context_malloc_clear(c, sizeof(grib_accessors_list)); last->next_->accessor = a; - last->next_->prev_ = last; - last->next_->rank = rank; - this->last_ = last->next_; + last->next_->prev_ = last; + last->next_->rank_ = rank; + this->last_ = last->next_; } else { this->accessor = a; - this->rank = rank; - this->last_ = this; + this->rank_ = rank; + this->last_ = this; } } diff --git a/src/accessor/grib_accessors_list.h b/src/accessor/grib_accessors_list.h index 2bdd29de7..e136d955a 100644 --- a/src/accessor/grib_accessors_list.h +++ b/src/accessor/grib_accessors_list.h @@ -26,11 +26,14 @@ class grib_accessors_list int unpack_float(float* val, size_t* buffer_len); int unpack_string(char** val, size_t* buffer_len); + int rank() const { return rank_; } + grib_accessor* accessor = nullptr; - int rank = 0; grib_accessors_list* next_ = nullptr; grib_accessors_list* prev_ = nullptr; grib_accessors_list* last_ = nullptr; +private: + int rank_ = 0; }; grib_accessors_list* grib_accessors_list_create(grib_context* c); diff --git a/src/grib_query.cc b/src/grib_query.cc index 29e3e1322..a1209efaf 100644 --- a/src/grib_query.cc +++ b/src/grib_query.cc @@ -384,7 +384,7 @@ static void search_from_accessors_list(grib_accessors_list* al, const grib_acces accessor_result = al->accessor; } if (accessor_result) { - result->push(accessor_result, al->rank); + result->push(accessor_result, al->rank()); } } al = al->next_; @@ -398,7 +398,7 @@ static void search_from_accessors_list(grib_accessors_list* al, const grib_acces accessor_result = al->accessor; } if (accessor_result) { - result->push(accessor_result, al->rank); + result->push(accessor_result, al->rank()); } } } @@ -453,7 +453,7 @@ static void grib_find_same_and_push(grib_accessors_list* al, grib_accessor* a) { if (a) { grib_find_same_and_push(al, a->same); - al->push(a, al->rank); + al->push(a, al->rank()); } } From 80d3a68ad1247ff8b459d0c46629dec209253fd4 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 10 May 2024 16:05:15 +0100 Subject: [PATCH 141/196] Cosmetics --- src/accessor/grib_accessor_class_iterator.h | 6 ------ src/accessor/grib_accessor_class_nearest.h | 1 - src/accessor/grib_accessors_list.cc | 5 +++-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/accessor/grib_accessor_class_iterator.h b/src/accessor/grib_accessor_class_iterator.h index 5f809c90e..03fbdf5b6 100644 --- a/src/accessor/grib_accessor_class_iterator.h +++ b/src/accessor/grib_accessor_class_iterator.h @@ -8,13 +8,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************** - * Enrico Fucile - *************************/ - #pragma once -#include "grib_api_internal.h" #include "grib_accessor_class_gen.h" class grib_accessor_iterator_t : public grib_accessor_gen_t @@ -32,5 +27,4 @@ class grib_accessor_class_iterator_t : public grib_accessor_class_gen_t void dump(grib_accessor* a, grib_dumper* dumper) override; }; - //grib_iterator* grib_iterator_new(const grib_handle* ch, unsigned long flags, int* error) diff --git a/src/accessor/grib_accessor_class_nearest.h b/src/accessor/grib_accessor_class_nearest.h index efc7ebfc4..3ac4fdae2 100644 --- a/src/accessor/grib_accessor_class_nearest.h +++ b/src/accessor/grib_accessor_class_nearest.h @@ -28,5 +28,4 @@ class grib_accessor_class_nearest_t : public grib_accessor_class_gen_t void dump(grib_accessor* a, grib_dumper* dumper) override; }; - //grib_nearest* grib_nearest_new(const grib_handle* ch, int* error); diff --git a/src/accessor/grib_accessors_list.cc b/src/accessor/grib_accessors_list.cc index c0114b255..173077e69 100644 --- a/src/accessor/grib_accessors_list.cc +++ b/src/accessor/grib_accessors_list.cc @@ -15,7 +15,8 @@ grib_accessors_list* grib_accessors_list_create(grib_context* c) return (grib_accessors_list*)grib_context_malloc_clear(c, sizeof(grib_accessors_list)); } -void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al) { +void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al) +{ grib_accessors_list* tmp; while (al) { tmp = al->next_; @@ -70,7 +71,7 @@ grib_accessors_list::~grib_accessors_list() grib_accessors_list* al = this; while (al) { tmp = al->next_; - //grib_accessor_delete(c, al->accessor); + // grib_accessor_delete(c, al->accessor); grib_context_free(c, al); al = tmp; } From ac80478fa4b8380915efd97b9ee084155920a485 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 10 May 2024 16:15:08 +0100 Subject: [PATCH 142/196] Cosmetics --- src/accessor/grib_accessor_class_position.cc | 16 +-- .../grib_accessor_class_proj_string.cc | 80 ++++++++------ src/accessor/grib_accessor_class_raw.cc | 33 +++--- .../grib_accessor_class_rdbtime_guess_date.cc | 16 +-- ...ib_accessor_class_reference_value_error.cc | 14 +-- src/accessor/grib_accessor_class_round.cc | 8 +- src/accessor/grib_accessor_class_scale.cc | 31 +++--- .../grib_accessor_class_scale_values.cc | 23 ++-- src/accessor/grib_accessor_class_signed.cc | 102 ++++++++++-------- src/accessor/grib_accessor_class_size.cc | 20 ++-- 10 files changed, 201 insertions(+), 142 deletions(-) diff --git a/src/accessor/grib_accessor_class_position.cc b/src/accessor/grib_accessor_class_position.cc index f1a429270..a2c3daacd 100644 --- a/src/accessor/grib_accessor_class_position.cc +++ b/src/accessor/grib_accessor_class_position.cc @@ -11,11 +11,12 @@ #include "grib_accessor_class_position.h" -grib_accessor_class_position_t _grib_accessor_class_position{"position"}; +grib_accessor_class_position_t _grib_accessor_class_position{ "position" }; grib_accessor_class* grib_accessor_class_position = &_grib_accessor_class_position; -void grib_accessor_class_position_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_position_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_gen_t::init(a, len, arg); a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; @@ -23,17 +24,20 @@ void grib_accessor_class_position_t::init(grib_accessor* a, const long len, grib a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } -int grib_accessor_class_position_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_position_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_LONG; } -void grib_accessor_class_position_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_position_t::dump(grib_accessor* a, grib_dumper* dumper) +{ grib_dump_long(dumper, a, NULL); } -int grib_accessor_class_position_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_position_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/accessor/grib_accessor_class_proj_string.cc b/src/accessor/grib_accessor_class_proj_string.cc index f8c8e127f..03866753d 100644 --- a/src/accessor/grib_accessor_class_proj_string.cc +++ b/src/accessor/grib_accessor_class_proj_string.cc @@ -11,14 +11,15 @@ #include "grib_accessor_class_proj_string.h" -grib_accessor_class_proj_string_t _grib_accessor_class_proj_string{"proj_string"}; +grib_accessor_class_proj_string_t _grib_accessor_class_proj_string{ "proj_string" }; grib_accessor_class* grib_accessor_class_proj_string = &_grib_accessor_class_proj_string; -void grib_accessor_class_proj_string_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_proj_string_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_gen_t::init(a, len, arg); grib_accessor_proj_string_t* self = (grib_accessor_proj_string_t*)a; - grib_handle* h = grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); self->grid_type = grib_arguments_get_name(h, arg, 0); self->endpoint = grib_arguments_get_long(h, arg, 1); @@ -27,7 +28,8 @@ void grib_accessor_class_proj_string_t::init(grib_accessor* a, const long len, g a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } -int grib_accessor_class_proj_string_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_proj_string_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_STRING; } @@ -35,13 +37,14 @@ int grib_accessor_class_proj_string_t::get_native_type(grib_accessor* a){ 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) -static int get_major_minor_axes(grib_handle* h, double* pMajor, double* pMinor){ +static int get_major_minor_axes(grib_handle* h, double* pMajor, double* pMinor) +{ int err = 0; if (grib_is_earth_oblate(h)) { if ((err = grib_get_double_internal(h, "earthMinorAxisInMetres", pMinor)) != GRIB_SUCCESS) return err; @@ -56,19 +59,21 @@ static int get_major_minor_axes(grib_handle* h, double* pMajor, double* pMinor){ } // Caller must have allocated enough space in the 'result' argument -static int get_earth_shape(grib_handle* h, char* result){ +static int get_earth_shape(grib_handle* h, char* result) +{ int err = 0; double major = 0, minor = 0; 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; } -static int proj_space_view(grib_handle* h, char* result){ +static int proj_space_view(grib_handle* h, char* result) +{ return GRIB_NOT_IMPLEMENTED; // int err = 0; // char shape[128] = {0,}; @@ -84,18 +89,22 @@ static int proj_space_view(grib_handle* h, char* result){ // return err; } -static int proj_albers(grib_handle* h, char* result){ +static int proj_albers(grib_handle* h, char* result) +{ return GRIB_NOT_IMPLEMENTED; } -static int proj_transverse_mercator(grib_handle* h, char* result){ +static int proj_transverse_mercator(grib_handle* h, char* result) +{ return GRIB_NOT_IMPLEMENTED; } -static int proj_equatorial_azimuthal_equidistant(grib_handle* h, char* result){ +static int proj_equatorial_azimuthal_equidistant(grib_handle* h, char* result) +{ return GRIB_NOT_IMPLEMENTED; } -static int proj_lambert_conformal(grib_handle* h, char* result){ - int err = 0; +static int proj_lambert_conformal(grib_handle* h, char* result) +{ + int err = 0; char shape[128] = {0,}; double LoVInDegrees = 0, LaDInDegrees = 0, Latin1InDegrees = 0, Latin2InDegrees = 0; @@ -110,12 +119,13 @@ static int proj_lambert_conformal(grib_handle* h, char* result){ if ((err = grib_get_double_internal(h, "LaDInDegrees", &LaDInDegrees)) != GRIB_SUCCESS) return err; snprintf(result, 1024, "+proj=lcc +lon_0=%lf +lat_0=%lf +lat_1=%lf +lat_2=%lf %s", - LoVInDegrees, LaDInDegrees, Latin1InDegrees, Latin2InDegrees, shape); + LoVInDegrees, LaDInDegrees, Latin1InDegrees, Latin2InDegrees, shape); return err; } -static int proj_lambert_azimuthal_equal_area(grib_handle* h, char* result){ - int err = 0; +static int proj_lambert_azimuthal_equal_area(grib_handle* h, char* result) +{ + int err = 0; char shape[128] = {0,}; double standardParallel = 0, centralLongitude = 0; @@ -126,11 +136,12 @@ static int proj_lambert_azimuthal_equal_area(grib_handle* h, char* result){ if ((err = grib_get_double_internal(h, "centralLongitudeInDegrees", ¢ralLongitude)) != GRIB_SUCCESS) return err; snprintf(result, 1024, "+proj=laea +lon_0=%lf +lat_0=%lf %s", - centralLongitude, standardParallel, shape); + centralLongitude, standardParallel, shape); return err; } -static int proj_polar_stereographic(grib_handle* h, char* result){ +static int proj_polar_stereographic(grib_handle* h, char* result) +{ int err = 0; double centralLongitude = 0, centralLatitude = 0; int has_northPole = 0; @@ -147,33 +158,35 @@ static int proj_polar_stereographic(grib_handle* h, char* result){ return err; has_northPole = ((projectionCentreFlag & 128) == 0); snprintf(result, 1024, "+proj=stere +lat_ts=%lf +lat_0=%s +lon_0=%lf +k_0=1 +x_0=0 +y_0=0 %s", - centralLatitude, has_northPole ? "90" : "-90", centralLongitude, shape); + centralLatitude, has_northPole ? "90" : "-90", centralLongitude, shape); return err; } // ECC-1552: This is for regular_ll, regular_gg, reduced_ll, reduced_gg // These are not 'projected' grids! -static int proj_unprojected(grib_handle* h, char* result){ +static int proj_unprojected(grib_handle* h, char* result) +{ int err = 0; - //char shape[128] = {0,}; - //if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) return err; - //snprintf(result, 1024, "+proj=longlat %s", shape); + // char shape[128] = {0,}; + // if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) return err; + // snprintf(result, 1024, "+proj=longlat %s", shape); snprintf(result, 1024, "+proj=longlat +datum=WGS84 +no_defs +type=crs"); return err; } -static int proj_mercator(grib_handle* h, char* result){ +static int proj_mercator(grib_handle* h, char* result) +{ int err = 0; double LaDInDegrees = 0; - char shape[128] = {0,}; + char shape[128] = {0,}; if ((err = grib_get_double_internal(h, "LaDInDegrees", &LaDInDegrees)) != GRIB_SUCCESS) return err; if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) return err; snprintf(result, 1024, "+proj=merc +lat_ts=%lf +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 %s", - LaDInDegrees, shape); + LaDInDegrees, shape); return err; } @@ -195,17 +208,18 @@ static proj_mapping proj_mappings[] = { #define ENDPOINT_SOURCE 0 #define ENDPOINT_TARGET 1 -int grib_accessor_class_proj_string_t::unpack_string(grib_accessor* a, char* v, size_t* len){ +int grib_accessor_class_proj_string_t::unpack_string(grib_accessor* a, char* v, size_t* len) +{ grib_accessor_proj_string_t* self = (grib_accessor_proj_string_t*)a; int err = 0, found = 0; - size_t i = 0; + size_t i = 0; char grid_type[64] = {0,}; grib_handle* h = grib_handle_of_accessor(a); - size_t size = sizeof(grid_type) / sizeof(*grid_type); + size_t size = sizeof(grid_type) / sizeof(*grid_type); Assert(self->endpoint == ENDPOINT_SOURCE || self->endpoint == ENDPOINT_TARGET); - size_t l = 100; // Safe bet + size_t l = 100; // Safe bet if (*len < l) { const char* cclass_name = a->cclass->name; grib_context_log(a->context, GRIB_LOG_ERROR, diff --git a/src/accessor/grib_accessor_class_raw.cc b/src/accessor/grib_accessor_class_raw.cc index 4a80b772a..cf1f502c7 100644 --- a/src/accessor/grib_accessor_class_raw.cc +++ b/src/accessor/grib_accessor_class_raw.cc @@ -11,11 +11,12 @@ #include "grib_accessor_class_raw.h" -grib_accessor_class_raw_t _grib_accessor_class_raw{"raw"}; +grib_accessor_class_raw_t _grib_accessor_class_raw{ "raw" }; grib_accessor_class* grib_accessor_class_raw = &_grib_accessor_class_raw; -void grib_accessor_class_raw_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_raw_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_gen_t::init(a, len, arg); int n = 0; int err = 0; @@ -42,31 +43,37 @@ void grib_accessor_class_raw_t::init(grib_accessor* a, const long len, grib_argu /* Assert(a->length>=0); */ } -int grib_accessor_class_raw_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_raw_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_BYTES; } -int grib_accessor_class_raw_t::compare(grib_accessor* a, grib_accessor* b){ +int grib_accessor_class_raw_t::compare(grib_accessor* a, grib_accessor* b) +{ int retval = GRIB_SUCCESS; - size_t alen = (size_t)a->byte_count(); size_t blen = (size_t)b->byte_count(); + size_t alen = (size_t)a->byte_count(); + size_t blen = (size_t)b->byte_count(); if (alen != blen) return GRIB_COUNT_MISMATCH; return retval; } -long grib_accessor_class_raw_t::byte_count(grib_accessor* a){ +long grib_accessor_class_raw_t::byte_count(grib_accessor* a) +{ return a->length; } -int grib_accessor_class_raw_t::value_count(grib_accessor* a, long* len){ +int grib_accessor_class_raw_t::value_count(grib_accessor* a, long* len) +{ *len = a->length; return 0; } -int grib_accessor_class_raw_t::unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len){ +int grib_accessor_class_raw_t::unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len) +{ if (*len < a->length) { *len = a->length; return GRIB_ARRAY_TOO_SMALL; @@ -78,7 +85,8 @@ int grib_accessor_class_raw_t::unpack_bytes(grib_accessor* a, unsigned char* buf return GRIB_SUCCESS; } -void grib_accessor_class_raw_t::update_size(grib_accessor* a, size_t s){ +void grib_accessor_class_raw_t::update_size(grib_accessor* a, size_t s) +{ grib_context_log(a->context, GRIB_LOG_DEBUG, "updating size of %s old %ld new %ld", a->name, a->length, s); a->length = s; Assert(a->length >= 0); @@ -94,13 +102,14 @@ long accessor_raw_get_offset(grib_accessor* a) return a->offset; } -int grib_accessor_class_raw_t::pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len){ +int grib_accessor_class_raw_t::pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len) +{ size_t length = *len; long totalLength; long sectionLength; - grib_handle* h = grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); grib_accessor_raw_t* self = (grib_accessor_raw_t*)a; - long dlen = length - a->length; + long dlen = length - a->length; grib_get_long(h, self->totalLength, &totalLength); totalLength += dlen; diff --git a/src/accessor/grib_accessor_class_rdbtime_guess_date.cc b/src/accessor/grib_accessor_class_rdbtime_guess_date.cc index 173e0a3dc..f4b317daa 100644 --- a/src/accessor/grib_accessor_class_rdbtime_guess_date.cc +++ b/src/accessor/grib_accessor_class_rdbtime_guess_date.cc @@ -15,10 +15,11 @@ grib_accessor_class_rdbtime_guess_date_t _grib_accessor_class_rdbtime_guess_date grib_accessor_class* grib_accessor_class_rdbtime_guess_date = &_grib_accessor_class_rdbtime_guess_date; -void grib_accessor_class_rdbtime_guess_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_rdbtime_guess_date_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_rdbtime_guess_date_t* self = (grib_accessor_rdbtime_guess_date_t*)a; - int n = 0; + int n = 0; self->typicalYear = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); self->typicalMonth = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); @@ -29,14 +30,14 @@ void grib_accessor_class_rdbtime_guess_date_t::init(grib_accessor* a, const long /* a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; */ } -int grib_accessor_class_rdbtime_guess_date_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_rdbtime_guess_date_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_rdbtime_guess_date_t* self = (grib_accessor_rdbtime_guess_date_t*)a; - grib_handle* h = grib_handle_of_accessor(a); - int ret = 0; + grib_handle* h = grib_handle_of_accessor(a); long typicalYear, typicalMonth, typicalDay, rdbDay; long rdbYear, rdbMonth; - ret = grib_get_long(h, self->typicalYear, &typicalYear); + int ret = grib_get_long(h, self->typicalYear, &typicalYear); if (ret) return ret; ret = grib_get_long(h, self->typicalMonth, &typicalMonth); @@ -70,7 +71,8 @@ int grib_accessor_class_rdbtime_guess_date_t::unpack_long(grib_accessor* a, long return GRIB_SUCCESS; } -int grib_accessor_class_rdbtime_guess_date_t::pack_long(grib_accessor* a, const long* v, size_t* len){ +int grib_accessor_class_rdbtime_guess_date_t::pack_long(grib_accessor* a, const long* v, size_t* len) +{ /* do nothing*/ return GRIB_SUCCESS; } diff --git a/src/accessor/grib_accessor_class_reference_value_error.cc b/src/accessor/grib_accessor_class_reference_value_error.cc index 9a1dba20b..fbf1a1c1b 100644 --- a/src/accessor/grib_accessor_class_reference_value_error.cc +++ b/src/accessor/grib_accessor_class_reference_value_error.cc @@ -11,14 +11,15 @@ #include "grib_accessor_class_reference_value_error.h" -grib_accessor_class_reference_value_error_t _grib_accessor_class_reference_value_error{"reference_value_error"}; +grib_accessor_class_reference_value_error_t _grib_accessor_class_reference_value_error{ "reference_value_error" }; grib_accessor_class* grib_accessor_class_reference_value_error = &_grib_accessor_class_reference_value_error; -void grib_accessor_class_reference_value_error_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_reference_value_error_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_double_t::init(a, l, c); grib_accessor_reference_value_error_t* self = (grib_accessor_reference_value_error_t*)a; - int n = 0; + int n = 0; self->referenceValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); self->floatType = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); @@ -27,10 +28,11 @@ void grib_accessor_class_reference_value_error_t::init(grib_accessor* a, const l a->length = 0; } -int grib_accessor_class_reference_value_error_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_reference_value_error_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_reference_value_error_t* self = (grib_accessor_reference_value_error_t*)a; - int ret = 0; - double referenceValue = 0; + int ret = GRIB_SUCCESS; + double referenceValue = 0; if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->referenceValue, &referenceValue)) != GRIB_SUCCESS) diff --git a/src/accessor/grib_accessor_class_round.cc b/src/accessor/grib_accessor_class_round.cc index f56fa4a1c..e1d6aaeda 100644 --- a/src/accessor/grib_accessor_class_round.cc +++ b/src/accessor/grib_accessor_class_round.cc @@ -11,11 +11,12 @@ #include "grib_accessor_class_round.h" -grib_accessor_class_round_t _grib_accessor_class_round{"round"}; +grib_accessor_class_round_t _grib_accessor_class_round{ "round" }; grib_accessor_class* grib_accessor_class_round = &_grib_accessor_class_round; -int grib_accessor_class_round_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_round_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_round_t* self = (grib_accessor_round_t*)a; int ret = GRIB_SUCCESS; @@ -42,7 +43,8 @@ int grib_accessor_class_round_t::unpack_double(grib_accessor* a, double* val, si return ret; } -int grib_accessor_class_round_t::unpack_string(grib_accessor* a, char* val, size_t* len){ +int grib_accessor_class_round_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ char result[1024]; int ret = GRIB_SUCCESS; size_t replen = 1; diff --git a/src/accessor/grib_accessor_class_scale.cc b/src/accessor/grib_accessor_class_scale.cc index eb01412d2..59ab7bfb4 100644 --- a/src/accessor/grib_accessor_class_scale.cc +++ b/src/accessor/grib_accessor_class_scale.cc @@ -11,14 +11,15 @@ #include "grib_accessor_class_scale.h" -grib_accessor_class_scale_t _grib_accessor_class_scale{"scale"}; +grib_accessor_class_scale_t _grib_accessor_class_scale{ "scale" }; grib_accessor_class* grib_accessor_class_scale = &_grib_accessor_class_scale; -void grib_accessor_class_scale_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_scale_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_double_t::init(a, l, c); grib_accessor_scale_t* self = (grib_accessor_scale_t*)a; - int n = 0; + int n = 0; self->value = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); self->multiplier = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); @@ -26,12 +27,13 @@ void grib_accessor_class_scale_t::init(grib_accessor* a, const long l, grib_argu self->truncating = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -int grib_accessor_class_scale_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_scale_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_scale_t* self = (grib_accessor_scale_t*)a; - int ret = 0; - long value = 0; - long multiplier = 0; - long divisor = 0; + int ret = 0; + long value = 0; + long multiplier = 0; + long divisor = 0; if (*len < 1) { ret = GRIB_ARRAY_TOO_SMALL; @@ -61,14 +63,16 @@ int grib_accessor_class_scale_t::unpack_double(grib_accessor* a, double* val, si return ret; } -int grib_accessor_class_scale_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_scale_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ const double dval = (double)*val; return pack_double(a, &dval, len); } -int grib_accessor_class_scale_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_scale_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_scale_t* self = (grib_accessor_scale_t*)a; - int ret = 0; + int ret = 0; long value = 0; long divisor = 0; @@ -115,9 +119,10 @@ int grib_accessor_class_scale_t::pack_double(grib_accessor* a, const double* val return ret; } -int grib_accessor_class_scale_t::is_missing(grib_accessor* a){ +int grib_accessor_class_scale_t::is_missing(grib_accessor* a) +{ grib_accessor_scale_t* self = (grib_accessor_scale_t*)a; - grib_accessor* av = grib_find_accessor(grib_handle_of_accessor(a), self->value); + grib_accessor* av = grib_find_accessor(grib_handle_of_accessor(a), self->value); if (!av) return GRIB_NOT_FOUND; diff --git a/src/accessor/grib_accessor_class_scale_values.cc b/src/accessor/grib_accessor_class_scale_values.cc index 03c5e0de2..03072311d 100644 --- a/src/accessor/grib_accessor_class_scale_values.cc +++ b/src/accessor/grib_accessor_class_scale_values.cc @@ -11,36 +11,39 @@ #include "grib_accessor_class_scale_values.h" -grib_accessor_class_scale_values_t _grib_accessor_class_scale_values{"scale_values"}; +grib_accessor_class_scale_values_t _grib_accessor_class_scale_values{ "scale_values" }; grib_accessor_class* grib_accessor_class_scale_values = &_grib_accessor_class_scale_values; -void grib_accessor_class_scale_values_t::init(grib_accessor* a, const long l, grib_arguments* args){ +void grib_accessor_class_scale_values_t::init(grib_accessor* a, const long l, grib_arguments* args) +{ grib_accessor_class_double_t::init(a, l, args); - int n = 0; + int n = 0; grib_accessor_scale_values_t* self = (grib_accessor_scale_values_t*)a; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->missingValue = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->missingValue = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->length = 0; } -int grib_accessor_class_scale_values_t::unpack_double(grib_accessor* a, double* val, size_t* len){ - int ret = 0; +int grib_accessor_class_scale_values_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ + int ret = GRIB_SUCCESS; *val = 1; *len = 1; return ret; } -int grib_accessor_class_scale_values_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_scale_values_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ double* values = NULL; double missingValue = 0; long missingValuesPresent = 0; size_t size = 0; int ret = 0, i = 0; grib_accessor_scale_values_t* self = (grib_accessor_scale_values_t*)a; - const grib_context* c = a->context; - grib_handle* h = grib_handle_of_accessor(a); + const grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); if (*val == 1) return GRIB_SUCCESS; diff --git a/src/accessor/grib_accessor_class_signed.cc b/src/accessor/grib_accessor_class_signed.cc index dea029231..36c20bd59 100644 --- a/src/accessor/grib_accessor_class_signed.cc +++ b/src/accessor/grib_accessor_class_signed.cc @@ -11,24 +11,28 @@ #include "grib_accessor_class_signed.h" -grib_accessor_class_signed_t _grib_accessor_class_signed{"signed"}; +grib_accessor_class_signed_t _grib_accessor_class_signed{ "signed" }; grib_accessor_class* grib_accessor_class_signed = &_grib_accessor_class_signed; -void grib_accessor_class_signed_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_signed_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_long_t::init(a, len, arg); grib_accessor_signed_t* self = (grib_accessor_signed_t*)a; - long count = 0; + long count = 0; self->arg = arg; - a->value_count(&count); a->length = len * count; + a->value_count(&count); + a->length = len * count; self->nbytes = len; Assert(a->length >= 0); } -void grib_accessor_class_signed_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_signed_t::dump(grib_accessor* a, grib_dumper* dumper) +{ long rlen = 0; - a->value_count(&rlen); if (rlen == 1) + a->value_count(&rlen); + if (rlen == 1) grib_dump_long(dumper, a, NULL); else grib_dump_values(dumper, a); @@ -42,17 +46,19 @@ static const long ones[] = { -0x7fffffff, }; -int grib_accessor_class_signed_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_signed_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_signed_t* self = (grib_accessor_signed_t*)a; - unsigned long rlen = 0; - int err = 0; - long count = 0; - unsigned long i = 0; - grib_handle* hand = grib_handle_of_accessor(a); - long pos = a->offset; - long missing = 0; - - err = a->value_count(&count); if (err) + unsigned long rlen = 0; + int err = 0; + long count = 0; + unsigned long i = 0; + grib_handle* hand = grib_handle_of_accessor(a); + long pos = a->offset; + long missing = 0; + + err = a->value_count(&count); + if (err) return err; rlen = count; @@ -79,19 +85,21 @@ int grib_accessor_class_signed_t::unpack_long(grib_accessor* a, long* val, size_ return GRIB_SUCCESS; } -int grib_accessor_class_signed_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_signed_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_signed_t* self = (grib_accessor_signed_t*)a; - int ret = 0; - long off = 0; - unsigned long rlen = 0; - int err = 0; - long count = 0; - size_t buflen = 0; - unsigned char* buf = NULL; - unsigned long i = 0; - long missing = 0; - - err = a->value_count(&count); if (err) + + int ret = 0; + long off = 0; + unsigned long rlen = 0; + long count = 0; + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned long i = 0; + long missing = 0; + + int err = a->value_count(&count); + if (err) return err; rlen = count; @@ -111,16 +119,17 @@ int grib_accessor_class_signed_t::pack_long(grib_accessor* a, const long* val, s if (missing) { if (v == GRIB_MISSING_LONG) v = missing; - } else { + } + else { // ECC-1605: Check overflow/underflow - const int nbits = self->nbytes * 8; - const long minval = -(1L << (nbits-1)) + 1; - const long maxval = (1L << (nbits-1)) - 1; - //printf(" key=%s: v=%ld (minval=%ld maxval=%ld)\n", a->name, v, minval, maxval); + const int nbits = self->nbytes * 8; + const long minval = -(1L << (nbits - 1)) + 1; + const long maxval = (1L << (nbits - 1)) - 1; + // printf(" key=%s: v=%ld (minval=%ld maxval=%ld)\n", a->name, v, minval, maxval); if (v > maxval || v < minval) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Key \"%s\": Trying to encode value of %ld but the allowable range is %ld to %ld (number of bits=%d)", - a->name, v, minval, maxval, nbits); + "Key \"%s\": Trying to encode value of %ld but the allowable range is %ld to %ld (number of bits=%d)", + a->name, v, minval, maxval, nbits); return GRIB_ENCODING_ERROR; } } @@ -156,13 +165,15 @@ int grib_accessor_class_signed_t::pack_long(grib_accessor* a, const long* val, s return ret; } -long grib_accessor_class_signed_t::byte_count(grib_accessor* a){ +long grib_accessor_class_signed_t::byte_count(grib_accessor* a) +{ return a->length; } -int grib_accessor_class_signed_t::value_count(grib_accessor* a, long* len){ +int grib_accessor_class_signed_t::value_count(grib_accessor* a, long* len) +{ grib_accessor_signed_t* self = (grib_accessor_signed_t*)a; - *len = 0; + *len = 0; if (!self->arg) { *len = 1; return 0; @@ -170,19 +181,24 @@ int grib_accessor_class_signed_t::value_count(grib_accessor* a, long* len){ return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); } -long grib_accessor_class_signed_t::byte_offset(grib_accessor* a){ +long grib_accessor_class_signed_t::byte_offset(grib_accessor* a) +{ return a->offset; } -void grib_accessor_class_signed_t::update_size(grib_accessor* a, size_t s){ +void grib_accessor_class_signed_t::update_size(grib_accessor* a, size_t s) +{ a->length = s; Assert(a->length >= 0); } -long grib_accessor_class_signed_t::next_offset(grib_accessor* a){ - return a->byte_offset() + a->byte_count();} +long grib_accessor_class_signed_t::next_offset(grib_accessor* a) +{ + return a->byte_offset() + a->byte_count(); +} -int grib_accessor_class_signed_t::is_missing(grib_accessor* a){ +int grib_accessor_class_signed_t::is_missing(grib_accessor* a) +{ int i = 0; unsigned char ff = 0xff; unsigned long offset = a->offset; diff --git a/src/accessor/grib_accessor_class_size.cc b/src/accessor/grib_accessor_class_size.cc index a9aa37f06..71c0dd947 100644 --- a/src/accessor/grib_accessor_class_size.cc +++ b/src/accessor/grib_accessor_class_size.cc @@ -11,25 +11,27 @@ #include "grib_accessor_class_size.h" -grib_accessor_class_size_t _grib_accessor_class_size{"size"}; +grib_accessor_class_size_t _grib_accessor_class_size{ "size" }; grib_accessor_class* grib_accessor_class_size = &_grib_accessor_class_size; -void grib_accessor_class_size_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_size_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_size_t* self = (grib_accessor_size_t*)a; - self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); + self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->length = 0; } -int grib_accessor_class_size_t::unpack_long(grib_accessor* a, long* val, size_t* len){ - int ret = 0; - size_t size = 0; +int grib_accessor_class_size_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_size_t* self = (grib_accessor_size_t*)a; - ret = grib_get_size(grib_handle_of_accessor(a), self->accessor, &size); - *val = (long)size; - *len = 1; + + size_t size = 0; + int ret = grib_get_size(grib_handle_of_accessor(a), self->accessor, &size); + *val = (long)size; + *len = 1; return ret; } From 22bd62c27647d85759c9f531a874992c99c222b3 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 10 May 2024 16:53:58 +0100 Subject: [PATCH 143/196] Cosmetics --- src/accessor/grib_accessor_class_bitmap.cc | 2 +- src/accessor/grib_accessor_class_blob.cc | 17 +- .../grib_accessor_class_bufr_data_element.cc | 169 ++++++++++-------- .../grib_accessor_class_bufr_string_values.cc | 33 ++-- .../grib_accessor_class_codetable_title.cc | 21 ++- .../grib_accessor_class_codetable_units.cc | 13 +- .../grib_accessor_class_count_file.cc | 8 +- .../grib_accessor_class_count_total.cc | 8 +- src/accessor/grib_accessor_class_dirty.cc | 17 +- src/accessor/grib_accessor_class_evaluate.cc | 16 +- src/accessor/grib_accessor_class_mars_step.cc | 49 +++-- ...grib_accessor_class_step_human_readable.cc | 3 +- .../grib_accessor_class_step_in_units.cc | 28 +-- ...b_accessor_class_unexpanded_descriptors.cc | 52 +++--- .../grib_accessor_class_unpack_bufr_values.cc | 73 +++++--- src/accessor/grib_accessor_class_unsigned.cc | 32 ++-- .../grib_accessor_class_unsigned_bits.cc | 62 ++++--- .../grib_accessor_class_validity_date.cc | 24 +-- .../grib_accessor_class_validity_time.cc | 31 ++-- src/accessor/grib_accessor_class_values.cc | 30 ++-- src/accessor/grib_accessor_class_vector.cc | 17 +- src/accessor/grib_accessor_class_when.cc | 14 +- 22 files changed, 425 insertions(+), 294 deletions(-) diff --git a/src/accessor/grib_accessor_class_bitmap.cc b/src/accessor/grib_accessor_class_bitmap.cc index 505871a3a..05d9db3bf 100644 --- a/src/accessor/grib_accessor_class_bitmap.cc +++ b/src/accessor/grib_accessor_class_bitmap.cc @@ -104,7 +104,7 @@ int grib_accessor_class_bitmap_t::unpack_long(grib_accessor* a, long* val, size_ } template -int unpack(grib_accessor* a, T* val, size_t* len) +static 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; diff --git a/src/accessor/grib_accessor_class_blob.cc b/src/accessor/grib_accessor_class_blob.cc index ca7b21f24..4629de93a 100644 --- a/src/accessor/grib_accessor_class_blob.cc +++ b/src/accessor/grib_accessor_class_blob.cc @@ -11,21 +11,25 @@ #include "grib_accessor_class_blob.h" -grib_accessor_class_blob_t _grib_accessor_class_blob{"blob"}; +grib_accessor_class_blob_t _grib_accessor_class_blob{ "blob" }; grib_accessor_class* grib_accessor_class_blob = &_grib_accessor_class_blob; -void grib_accessor_class_blob_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_blob_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_gen_t::init(a, len, arg); - grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, arg, 0), &a->length); + grib_get_long_internal(grib_handle_of_accessor(a), + grib_arguments_get_name(a->parent->h, arg, 0), &a->length); Assert(a->length >= 0); } -int grib_accessor_class_blob_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_blob_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_BYTES; } -int grib_accessor_class_blob_t::unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len){ +int grib_accessor_class_blob_t::unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len) +{ if (*len < (size_t)a->length) { *len = a->length; return GRIB_ARRAY_TOO_SMALL; @@ -37,6 +41,7 @@ int grib_accessor_class_blob_t::unpack_bytes(grib_accessor* a, unsigned char* bu return GRIB_SUCCESS; } -void grib_accessor_class_blob_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_blob_t::dump(grib_accessor* a, grib_dumper* dumper) +{ grib_dump_bytes(dumper, a, NULL); } diff --git a/src/accessor/grib_accessor_class_bufr_data_element.cc b/src/accessor/grib_accessor_class_bufr_data_element.cc index e2c9eafbe..8d483b96d 100644 --- a/src/accessor/grib_accessor_class_bufr_data_element.cc +++ b/src/accessor/grib_accessor_class_bufr_data_element.cc @@ -10,7 +10,7 @@ #include "grib_accessor_class_bufr_data_element.h" -grib_accessor_class_bufr_data_element_t _grib_accessor_class_bufr_data_element{"bufr_data_element"}; +grib_accessor_class_bufr_data_element_t _grib_accessor_class_bufr_data_element{ "bufr_data_element" }; grib_accessor_class* grib_accessor_class_bufr_data_element = &_grib_accessor_class_bufr_data_element; grib_accessor* grib_accessor_class_bufr_data_element_t::make_clone(grib_accessor* a, grib_section* s, int* err) @@ -21,7 +21,9 @@ grib_accessor* grib_accessor_class_bufr_data_element_t::make_clone(grib_accessor grib_accessor_bufr_data_element_t* self; char* copied_name = NULL; int i; - grib_action creator = {0,}; + grib_action creator = { + 0, + }; creator.op = (char*)"bufr_data_element"; creator.name_space = (char*)""; creator.set = 0; @@ -64,67 +66,69 @@ grib_accessor* grib_accessor_class_bufr_data_element_t::make_clone(grib_accessor void accessor_bufr_data_element_set_index(grib_accessor* a, long index) { grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - self->index = index; + self->index = index; } void accessor_bufr_data_element_set_type(grib_accessor* a, int type) { grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - self->type = type; + self->type = type; } void accessor_bufr_data_element_set_numberOfSubsets(grib_accessor* a, long numberOfSubsets) { grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - self->numberOfSubsets = numberOfSubsets; + self->numberOfSubsets = numberOfSubsets; } void accessor_bufr_data_element_set_subsetNumber(grib_accessor* a, long subsetNumber) { grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - self->subsetNumber = subsetNumber; + self->subsetNumber = subsetNumber; } void accessor_bufr_data_element_set_compressedData(grib_accessor* a, int compressedData) { grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - self->compressedData = compressedData; + self->compressedData = compressedData; } void accessor_bufr_data_element_set_descriptors(grib_accessor* a, bufr_descriptors_array* descriptors) { grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - self->descriptors = descriptors; + self->descriptors = descriptors; } void accessor_bufr_data_element_set_numericValues(grib_accessor* a, grib_vdarray* numericValues) { grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - self->numericValues = numericValues; + self->numericValues = numericValues; } void accessor_bufr_data_element_set_stringValues(grib_accessor* a, grib_vsarray* stringValues) { grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - self->stringValues = stringValues; + self->stringValues = stringValues; } void accessor_bufr_data_element_set_elementsDescriptorsIndex(grib_accessor* a, grib_viarray* elementsDescriptorsIndex) { grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - self->elementsDescriptorsIndex = elementsDescriptorsIndex; + self->elementsDescriptorsIndex = elementsDescriptorsIndex; } -void grib_accessor_class_bufr_data_element_t::init(grib_accessor* a, const long len, grib_arguments* params){ +void grib_accessor_class_bufr_data_element_t::init(grib_accessor* a, const long len, grib_arguments* params) +{ grib_accessor_class_gen_t::init(a, len, params); grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - a->length = 0; + a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_BUFR_DATA; /* a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; */ self->cname = NULL; } -void grib_accessor_class_bufr_data_element_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_bufr_data_element_t::dump(grib_accessor* a, grib_dumper* dumper) +{ int type = get_native_type(a); switch (type) { @@ -140,7 +144,8 @@ void grib_accessor_class_bufr_data_element_t::dump(grib_accessor* a, grib_dumper } } -int grib_accessor_class_bufr_data_element_t::unpack_string_array(grib_accessor* a, char** val, size_t* len){ +int grib_accessor_class_bufr_data_element_t::unpack_string_array(grib_accessor* a, char** val, size_t* len) +{ grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = 0, idx = 0; @@ -160,7 +165,7 @@ int grib_accessor_class_bufr_data_element_t::unpack_string_array(grib_accessor* else { DEBUG_ASSERT(self->subsetNumber < self->numericValues->n); DEBUG_ASSERT(self->index < self->numericValues->v[self->subsetNumber]->n); - idx = (int)self->numericValues->v[self->subsetNumber]->v[self->index] / 1000 - 1; + idx = (int)self->numericValues->v[self->subsetNumber]->v[self->index] / 1000 - 1; val[0] = grib_context_strdup(c, self->stringValues->v[idx]->v[0]); *len = 1; } @@ -168,12 +173,13 @@ int grib_accessor_class_bufr_data_element_t::unpack_string_array(grib_accessor* return ret; } -int grib_accessor_class_bufr_data_element_t::pack_string_array(grib_accessor* a, const char** v, size_t* len){ +int grib_accessor_class_bufr_data_element_t::pack_string_array(grib_accessor* a, const char** v, size_t* len) +{ grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = GRIB_SUCCESS, idx = 0; - size_t i = 0; - char* s = NULL; + size_t i = 0; + char* s = NULL; grib_context* c = a->context; if (self->compressedData) { @@ -192,31 +198,32 @@ int grib_accessor_class_bufr_data_element_t::pack_string_array(grib_accessor* a, } } else { - //ECC-1623 + // ECC-1623 if (*len != (size_t)self->numberOfSubsets) { grib_context_log(c, GRIB_LOG_ERROR, - "Number of values mismatch for '%s': %zu strings provided but expected %ld (=number of subsets)", - a->name, *len, self->numberOfSubsets); + "Number of values mismatch for '%s': %zu strings provided but expected %ld (=number of subsets)", + a->name, *len, self->numberOfSubsets); return GRIB_WRONG_ARRAY_SIZE; } for (i = 0; i < *len; i++) { - //idx = (int)self->numericValues->v[self->subsetNumber]->v[self->index] / 1000 - 1; - idx = (int)self->numericValues->v[i]->v[self->index] / 1000 - 1; + // idx = (int)self->numericValues->v[self->subsetNumber]->v[self->index] / 1000 - 1; + idx = (int)self->numericValues->v[i]->v[self->index] / 1000 - 1; self->stringValues->v[idx]->v[0] = strdup(v[i]); } - *len=1; + *len = 1; } return ret; } -int grib_accessor_class_bufr_data_element_t::unpack_string(grib_accessor* a, char* val, size_t* len){ +int grib_accessor_class_bufr_data_element_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - char* str = NULL; - char* p = 0; - size_t slen = 0; - double dval = 0; - size_t dlen = 1; + char* str = NULL; + char* p = 0; + size_t slen = 0; + double dval = 0; + size_t dlen = 1; int idx = 0, err = 0; grib_context* c = a->context; @@ -278,11 +285,12 @@ int grib_accessor_class_bufr_data_element_t::unpack_string(grib_accessor* a, cha return GRIB_SUCCESS; } -int grib_accessor_class_bufr_data_element_t::pack_string(grib_accessor* a, const char* val, size_t* len){ +int grib_accessor_class_bufr_data_element_t::pack_string(grib_accessor* a, const char* val, size_t* len) +{ grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; int ret = GRIB_SUCCESS, idx = 0; - char* s = NULL; + char* s = NULL; grib_context* c = a->context; if (self->compressedData) { @@ -294,15 +302,16 @@ int grib_accessor_class_bufr_data_element_t::pack_string(grib_accessor* a, const grib_sarray_delete_content(c, self->stringValues->v[idx]); /* ECC-1172 */ grib_sarray_delete(c, self->stringValues->v[idx]); self->stringValues->v[idx] = grib_sarray_new(c, 1, 1); - s = grib_context_strdup(c, val); + s = grib_context_strdup(c, val); grib_sarray_push(c, self->stringValues->v[idx], s); return ret; } -int grib_accessor_class_bufr_data_element_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_bufr_data_element_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - int ret = GRIB_SUCCESS; + int ret = GRIB_SUCCESS; long count = 0, i = 0; value_count(a, &count); @@ -328,9 +337,10 @@ int grib_accessor_class_bufr_data_element_t::unpack_long(grib_accessor* a, long* return ret; } -int grib_accessor_class_bufr_data_element_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_bufr_data_element_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - int ret = GRIB_SUCCESS; + int ret = GRIB_SUCCESS; long count = 0, i = 0; value_count(a, &count); @@ -356,9 +366,10 @@ int grib_accessor_class_bufr_data_element_t::unpack_double(grib_accessor* a, dou return ret; } -int grib_accessor_class_bufr_data_element_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_bufr_data_element_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - int ret = GRIB_SUCCESS; + int ret = GRIB_SUCCESS; size_t count = 1, i = 0; grib_context* c = a->context; @@ -379,15 +390,16 @@ int grib_accessor_class_bufr_data_element_t::pack_double(grib_accessor* a, const } else { self->numericValues->v[self->subsetNumber]->v[self->index] = val[0]; - *len = 1; + *len = 1; } return ret; } -int grib_accessor_class_bufr_data_element_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_bufr_data_element_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - int ret = 0; + int ret = 0; size_t count = 1, i = 0; grib_context* c = a->context; @@ -408,15 +420,16 @@ int grib_accessor_class_bufr_data_element_t::pack_long(grib_accessor* a, const l } else { self->numericValues->v[self->subsetNumber]->v[self->index] = val[0] == GRIB_MISSING_LONG ? GRIB_MISSING_DOUBLE : val[0]; - *len = 1; + *len = 1; } return ret; } -int grib_accessor_class_bufr_data_element_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_bufr_data_element_t::value_count(grib_accessor* a, long* count) +{ int ret = 0, type = 0, idx = 0; - size_t size = 0; + size_t size = 0; grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; if (!self->compressedData) { @@ -440,11 +453,12 @@ int grib_accessor_class_bufr_data_element_t::value_count(grib_accessor* a, long* return ret; } -int grib_accessor_class_bufr_data_element_t::unpack_double_element(grib_accessor* a, size_t idx, double* val){ +int grib_accessor_class_bufr_data_element_t::unpack_double_element(grib_accessor* a, size_t idx, double* val) +{ /* ECC-415 */ grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - int ret = GRIB_SUCCESS; - long count = 0; + int ret = GRIB_SUCCESS; + long count = 0; value_count(a, &count); if (idx >= (size_t)count) { @@ -460,9 +474,10 @@ int grib_accessor_class_bufr_data_element_t::unpack_double_element(grib_accessor return ret; } -int grib_accessor_class_bufr_data_element_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_bufr_data_element_t::get_native_type(grib_accessor* a) +{ grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - int ret = GRIB_TYPE_DOUBLE; + int ret = GRIB_TYPE_DOUBLE; DEBUG_ASSERT(self); switch (self->type) { case BUFR_DESCRIPTOR_TYPE_STRING: @@ -485,9 +500,10 @@ int grib_accessor_class_bufr_data_element_t::get_native_type(grib_accessor* a){ return ret; } -void grib_accessor_class_bufr_data_element_t::destroy(grib_context* ct, grib_accessor* a){ +void grib_accessor_class_bufr_data_element_t::destroy(grib_context* ct, grib_accessor* a) +{ grib_accessor_bufr_data_element_t* self = (grib_accessor_bufr_data_element_t*)a; - int i = 0; + int i = 0; if (self->cname) grib_context_free(ct, self->cname); /* ECC-765 */ while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { @@ -502,7 +518,8 @@ void grib_accessor_class_bufr_data_element_t::destroy(grib_context* ct, grib_acc #define MAX_STRING_SIZE 4096 /* Return 1 if BUFR element(s) is/are missing, 0 otherwise. In case of decoding errors, also return 0 */ -int grib_accessor_class_bufr_data_element_t::is_missing(grib_accessor* a){ +int grib_accessor_class_bufr_data_element_t::is_missing(grib_accessor* a) +{ const int ktype = get_native_type(a); int err = 0, result = 1; /* default: assume all are missing */ long count = 0; @@ -511,15 +528,17 @@ int grib_accessor_class_bufr_data_element_t::is_missing(grib_accessor* a){ if (ktype == GRIB_TYPE_LONG) { long* values = NULL; - long value = 0; + long value = 0; value_count(a, &count); size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(c, sizeof(long) * size); - err = a->unpack_long(values, &size2); } + err = a->unpack_long(values, &size2); + } else { - err = a->unpack_long(&value, &size2); } + err = a->unpack_long(&value, &size2); + } if (err) return 0; /* TODO: no way of propagating the error up */ Assert(size2 == size); if (size > 1) { @@ -530,21 +549,24 @@ int grib_accessor_class_bufr_data_element_t::is_missing(grib_accessor* a){ } } grib_context_free(c, values); - } else { + } + else { result = grib_is_missing_long(a, value); } } else if (ktype == GRIB_TYPE_DOUBLE) { - double value = 0; + double value = 0; double* values = NULL; value_count(a, &count); size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = a->unpack_double(values, &size2); } + err = a->unpack_double(values, &size2); + } else { - err = a->unpack_double(&value, &size2); } + err = a->unpack_double(&value, &size2); + } if (err) return 0; /* TODO: no way of propagating the error up */ Assert(size2 == size); if (size > 1) { @@ -566,19 +588,23 @@ int grib_accessor_class_bufr_data_element_t::is_missing(grib_accessor* a){ size = count; if (size > 1) { values = (char**)grib_context_malloc_clear(a->context, size * sizeof(char*)); - err = a->unpack_string_array(values, &size); if (err) return 0; /* TODO: no way of propagating the error up */ + err = a->unpack_string_array(values, &size); + if (err) return 0; /* TODO: no way of propagating the error up */ for (i = 0; i < size; i++) { if (!grib_is_missing_string(a, (unsigned char*)values[i], size)) { result = 0; break; } } - for (i = 0; i < size; i++) grib_context_free(c, values[i]); + for (i = 0; i < size; i++) + grib_context_free(c, values[i]); grib_context_free(c, values); - } else { + } + else { char value[MAX_STRING_SIZE] = {0,}; /* See ECC-710 */ size = MAX_STRING_SIZE; - err = a->unpack_string(value, &size); if (err) return 0; /* TODO: no way of propagating the error up */ + err = a->unpack_string(value, &size); + if (err) return 0; /* TODO: no way of propagating the error up */ result = grib_is_missing_string(a, (unsigned char*)value, size); } } @@ -588,10 +614,11 @@ int grib_accessor_class_bufr_data_element_t::is_missing(grib_accessor* a){ return result; } -int grib_accessor_class_bufr_data_element_t::pack_missing(grib_accessor* a){ - int ktype = GRIB_TYPE_UNDEFINED; - int err = 0; - size_t size = 1; +int grib_accessor_class_bufr_data_element_t::pack_missing(grib_accessor* a) +{ + int ktype = GRIB_TYPE_UNDEFINED; + int err = 0; + size_t size = 1; const int can_be_missing = (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING); if (!can_be_missing) return GRIB_VALUE_CANNOT_BE_MISSING; @@ -599,11 +626,11 @@ int grib_accessor_class_bufr_data_element_t::pack_missing(grib_accessor* a){ ktype = get_native_type(a); if (ktype == GRIB_TYPE_LONG) { long missing = GRIB_MISSING_LONG; - err = pack_long(a, &missing, &size); + err = pack_long(a, &missing, &size); } else if (ktype == GRIB_TYPE_DOUBLE) { double missing = GRIB_MISSING_DOUBLE; - err = pack_double(a, &missing, &size); + err = pack_double(a, &missing, &size); } else if (ktype == GRIB_TYPE_STRING) { err = pack_string(a, "", &size); diff --git a/src/accessor/grib_accessor_class_bufr_string_values.cc b/src/accessor/grib_accessor_class_bufr_string_values.cc index eb76f6fb9..31e616b6f 100644 --- a/src/accessor/grib_accessor_class_bufr_string_values.cc +++ b/src/accessor/grib_accessor_class_bufr_string_values.cc @@ -12,21 +12,23 @@ #include "grib_accessor_class_bufr_string_values.h" #include "grib_accessor_class_bufr_data_array.h" -grib_accessor_class_bufr_string_values_t _grib_accessor_class_bufr_string_values{"bufr_string_values"}; +grib_accessor_class_bufr_string_values_t _grib_accessor_class_bufr_string_values{ "bufr_string_values" }; grib_accessor_class* grib_accessor_class_bufr_string_values = &_grib_accessor_class_bufr_string_values; -void grib_accessor_class_bufr_string_values_t::init(grib_accessor* a, const long len, grib_arguments* args){ +void grib_accessor_class_bufr_string_values_t::init(grib_accessor* a, const long len, grib_arguments* args) +{ grib_accessor_class_ascii_t::init(a, len, args); grib_accessor_bufr_string_values_t* self = (grib_accessor_bufr_string_values_t*)a; - int n = 0; - self->dataAccessorName = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->dataAccessor = NULL; - a->length = 0; + int n = 0; + self->dataAccessorName = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->dataAccessor = NULL; + a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -void grib_accessor_class_bufr_string_values_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_bufr_string_values_t::dump(grib_accessor* a, grib_dumper* dumper) +{ grib_dump_string_array(dumper, a, NULL); } @@ -39,11 +41,12 @@ static grib_accessor* get_accessor(grib_accessor* a) return self->dataAccessor; } -int grib_accessor_class_bufr_string_values_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len){ +int grib_accessor_class_bufr_string_values_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len) +{ grib_accessor* data = 0; grib_context* c = a->context; grib_vsarray* stringValues = NULL; - size_t l = 0, tl; + size_t l = 0, tl; size_t i, j, n = 0; char** b = buffer; @@ -72,14 +75,18 @@ int grib_accessor_class_bufr_string_values_t::unpack_string_array(grib_accessor* return GRIB_SUCCESS; } -int grib_accessor_class_bufr_string_values_t::unpack_string(grib_accessor* a, char* val, size_t* len){ +int grib_accessor_class_bufr_string_values_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } -int grib_accessor_class_bufr_string_values_t::value_count(grib_accessor* a, long* rlen){ +int grib_accessor_class_bufr_string_values_t::value_count(grib_accessor* a, long* rlen) +{ grib_accessor* descriptors = get_accessor(a); - return descriptors->value_count(rlen);} + return descriptors->value_count(rlen); +} -void grib_accessor_class_bufr_string_values_t::destroy(grib_context* c, grib_accessor* a){ +void grib_accessor_class_bufr_string_values_t::destroy(grib_context* c, grib_accessor* a) +{ grib_accessor_class_ascii_t::destroy(c, a); } diff --git a/src/accessor/grib_accessor_class_codetable_title.cc b/src/accessor/grib_accessor_class_codetable_title.cc index d124ee75f..2bcdfd215 100644 --- a/src/accessor/grib_accessor_class_codetable_title.cc +++ b/src/accessor/grib_accessor_class_codetable_title.cc @@ -12,31 +12,34 @@ #include "grib_accessor_class_codetable_title.h" #include "grib_accessor_class_codetable.h" -grib_accessor_class_codetable_title_t _grib_accessor_class_codetable_title{"codetable_title"}; +grib_accessor_class_codetable_title_t _grib_accessor_class_codetable_title{ "codetable_title" }; grib_accessor_class* grib_accessor_class_codetable_title = &_grib_accessor_class_codetable_title; -void grib_accessor_class_codetable_title_t::init(grib_accessor* a, const long len, grib_arguments* params){ +void grib_accessor_class_codetable_title_t::init(grib_accessor* a, const long len, grib_arguments* params) +{ grib_accessor_class_gen_t::init(a, len, params); grib_accessor_codetable_title_t* self = (grib_accessor_codetable_title_t*)a; - int n = 0; - self->codetable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); - a->length = 0; + int n = 0; + self->codetable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -int grib_accessor_class_codetable_title_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_codetable_title_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_STRING; } -int grib_accessor_class_codetable_title_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ +int grib_accessor_class_codetable_title_t::unpack_string(grib_accessor* a, char* buffer, size_t* len) +{ grib_accessor_codetable_title_t* self = (grib_accessor_codetable_title_t*)a; - grib_codetable* table = NULL; + grib_codetable* table = NULL; size_t size = 1; long value; int err = GRIB_SUCCESS; char tmp[1024]; - size_t l = 1024; + size_t l = 1024; grib_accessor_codetable_t* ca = (grib_accessor_codetable_t*)grib_find_accessor(grib_handle_of_accessor(a), self->codetable); if ((err = ((grib_accessor*)ca)->unpack_long(&value, &size)) != GRIB_SUCCESS) diff --git a/src/accessor/grib_accessor_class_codetable_units.cc b/src/accessor/grib_accessor_class_codetable_units.cc index 2e7ccda61..cc91ae2e2 100644 --- a/src/accessor/grib_accessor_class_codetable_units.cc +++ b/src/accessor/grib_accessor_class_codetable_units.cc @@ -12,10 +12,11 @@ #include "grib_accessor_class_codetable_units.h" #include "grib_accessor_class_codetable.h" -grib_accessor_class_codetable_units_t _grib_accessor_class_codetable_units{"codetable_units"}; +grib_accessor_class_codetable_units_t _grib_accessor_class_codetable_units{ "codetable_units" }; grib_accessor_class* grib_accessor_class_codetable_units = &_grib_accessor_class_codetable_units; -void grib_accessor_class_codetable_units_t::init(grib_accessor* a, const long len, grib_arguments* params){ +void grib_accessor_class_codetable_units_t::init(grib_accessor* a, const long len, grib_arguments* params) +{ grib_accessor_class_gen_t::init(a, len, params); grib_accessor_codetable_units_t* self = (grib_accessor_codetable_units_t*)a; @@ -25,13 +26,15 @@ void grib_accessor_class_codetable_units_t::init(grib_accessor* a, const long le a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -int grib_accessor_class_codetable_units_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_codetable_units_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_STRING; } -int grib_accessor_class_codetable_units_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ +int grib_accessor_class_codetable_units_t::unpack_string(grib_accessor* a, char* buffer, size_t* len) +{ grib_accessor_codetable_units_t* self = (grib_accessor_codetable_units_t*)a; - grib_codetable* table = NULL; + grib_codetable* table = NULL; size_t size = 1; long value; diff --git a/src/accessor/grib_accessor_class_count_file.cc b/src/accessor/grib_accessor_class_count_file.cc index a347e49ff..268ba8051 100644 --- a/src/accessor/grib_accessor_class_count_file.cc +++ b/src/accessor/grib_accessor_class_count_file.cc @@ -11,17 +11,19 @@ #include "grib_accessor_class_count_file.h" -grib_accessor_class_count_file_t _grib_accessor_class_count_file{"count_file"}; +grib_accessor_class_count_file_t _grib_accessor_class_count_file{ "count_file" }; grib_accessor_class* grib_accessor_class_count_file = &_grib_accessor_class_count_file; -void grib_accessor_class_count_file_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_count_file_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->length = 0; } -int grib_accessor_class_count_file_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_count_file_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ *val = grib_context_get_handle_file_count(a->context); *len = 1; return 0; diff --git a/src/accessor/grib_accessor_class_count_total.cc b/src/accessor/grib_accessor_class_count_total.cc index 561a8743d..dc708b4b6 100644 --- a/src/accessor/grib_accessor_class_count_total.cc +++ b/src/accessor/grib_accessor_class_count_total.cc @@ -11,17 +11,19 @@ #include "grib_accessor_class_count_total.h" -grib_accessor_class_count_total_t _grib_accessor_class_count_total{"count_total"}; +grib_accessor_class_count_total_t _grib_accessor_class_count_total{ "count_total" }; grib_accessor_class* grib_accessor_class_count_total = &_grib_accessor_class_count_total; -void grib_accessor_class_count_total_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_count_total_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->length = 0; } -int grib_accessor_class_count_total_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_count_total_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ *val = grib_context_get_handle_total_count(a->context); *len = 1; return 0; diff --git a/src/accessor/grib_accessor_class_dirty.cc b/src/accessor/grib_accessor_class_dirty.cc index 39df7e450..73f11c9d7 100644 --- a/src/accessor/grib_accessor_class_dirty.cc +++ b/src/accessor/grib_accessor_class_dirty.cc @@ -11,22 +11,24 @@ #include "grib_accessor_class_dirty.h" -grib_accessor_class_dirty_t _grib_accessor_class_dirty{"dirty"}; +grib_accessor_class_dirty_t _grib_accessor_class_dirty{ "dirty" }; grib_accessor_class* grib_accessor_class_dirty = &_grib_accessor_class_dirty; -void grib_accessor_class_dirty_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_dirty_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_dirty_t* self = (grib_accessor_dirty_t*)a; - self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); + self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; a->length = 0; } -int grib_accessor_class_dirty_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_dirty_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_dirty_t* self = (grib_accessor_dirty_t*)a; - grib_accessor* x = grib_find_accessor(grib_handle_of_accessor(a), self->accessor); + grib_accessor* x = grib_find_accessor(grib_handle_of_accessor(a), self->accessor); if (x) x->dirty = *val; @@ -34,9 +36,10 @@ int grib_accessor_class_dirty_t::pack_long(grib_accessor* a, const long* val, si return GRIB_SUCCESS; } -int grib_accessor_class_dirty_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_dirty_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_dirty_t* self = (grib_accessor_dirty_t*)a; - grib_accessor* x = grib_find_accessor(grib_handle_of_accessor(a), self->accessor); + grib_accessor* x = grib_find_accessor(grib_handle_of_accessor(a), self->accessor); if (x) x->dirty = 1; diff --git a/src/accessor/grib_accessor_class_evaluate.cc b/src/accessor/grib_accessor_class_evaluate.cc index efed99598..0312107a4 100644 --- a/src/accessor/grib_accessor_class_evaluate.cc +++ b/src/accessor/grib_accessor_class_evaluate.cc @@ -11,23 +11,25 @@ #include "grib_accessor_class_evaluate.h" -grib_accessor_class_evaluate_t _grib_accessor_class_evaluate{"evaluate"}; +grib_accessor_class_evaluate_t _grib_accessor_class_evaluate{ "evaluate" }; grib_accessor_class* grib_accessor_class_evaluate = &_grib_accessor_class_evaluate; -void grib_accessor_class_evaluate_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_evaluate_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_evaluate_t* self = (grib_accessor_evaluate_t*)a; - self->arg = c; + self->arg = c; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -int grib_accessor_class_evaluate_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_evaluate_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_evaluate_t* self = (grib_accessor_evaluate_t*)a; - grib_expression* e = grib_arguments_get_expression(grib_handle_of_accessor(a), self->arg, 0); + grib_expression* e = grib_arguments_get_expression(grib_handle_of_accessor(a), self->arg, 0); - int ret = grib_expression_evaluate_long(grib_handle_of_accessor(a), e, val); - *len = 1; + int ret = grib_expression_evaluate_long(grib_handle_of_accessor(a), e, val); + *len = 1; return ret; } diff --git a/src/accessor/grib_accessor_class_mars_step.cc b/src/accessor/grib_accessor_class_mars_step.cc index 34d245998..8fd9f9dfa 100644 --- a/src/accessor/grib_accessor_class_mars_step.cc +++ b/src/accessor/grib_accessor_class_mars_step.cc @@ -11,25 +11,27 @@ #include "grib_accessor_class_mars_step.h" -grib_accessor_class_mars_step_t _grib_accessor_class_mars_step{"mars_step"}; +grib_accessor_class_mars_step_t _grib_accessor_class_mars_step{ "mars_step" }; grib_accessor_class* grib_accessor_class_mars_step = &_grib_accessor_class_mars_step; -void grib_accessor_class_mars_step_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_mars_step_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_ascii_t::init(a, l, c); - int n = 0; + int n = 0; grib_accessor_mars_step_t* self = (grib_accessor_mars_step_t*)a; - self->stepRange = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->stepType = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->stepRange = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->stepType = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -int grib_accessor_class_mars_step_t::pack_string(grib_accessor* a, const char* val, size_t* len){ +int grib_accessor_class_mars_step_t::pack_string(grib_accessor* a, const char* val, size_t* len) +{ char stepType[100]; size_t stepTypeLen = 100; char buf[100] = {0,}; int ret; grib_accessor_mars_step_t* self = (grib_accessor_mars_step_t*)a; - grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); + grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); if (!stepRangeAcc) { grib_context_log(a->context, GRIB_LOG_ERROR, "%s not found", self->stepRange); @@ -44,17 +46,20 @@ int grib_accessor_class_mars_step_t::pack_string(grib_accessor* a, const char* v else snprintf(buf, sizeof(buf), "0-%s", val); - return stepRangeAcc->pack_string(buf, len);} + return stepRangeAcc->pack_string(buf, len); +} -int grib_accessor_class_mars_step_t::unpack_string(grib_accessor* a, char* val, size_t* len){ - int ret = 0; +int grib_accessor_class_mars_step_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ grib_accessor_mars_step_t* self = (grib_accessor_mars_step_t*)a; - char buf[100] = {0,}; + + int ret = 0; + char buf[100] = {0,}; char* p = NULL; size_t buflen = 100; long step; grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); - const char* cclass_name = a->cclass->name; + const char* cclass_name = a->cclass->name; if (!stepRangeAcc) { grib_context_log(a->context, GRIB_LOG_ERROR, "%s: %s not found", cclass_name, self->stepRange); @@ -83,7 +88,8 @@ int grib_accessor_class_mars_step_t::unpack_string(grib_accessor* a, char* val, return ret; } -int grib_accessor_class_mars_step_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_mars_step_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ char buff[100] = {0,}; size_t bufflen = 100; @@ -92,24 +98,29 @@ int grib_accessor_class_mars_step_t::pack_long(grib_accessor* a, const long* val return pack_string(a, buff, &bufflen); } -int grib_accessor_class_mars_step_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_mars_step_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_mars_step_t* self = (grib_accessor_mars_step_t*)a; - grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); + grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); if (!stepRangeAcc) return GRIB_NOT_FOUND; - return stepRangeAcc->unpack_long(val, len);} + return stepRangeAcc->unpack_long(val, len); +} -int grib_accessor_class_mars_step_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_mars_step_t::value_count(grib_accessor* a, long* count) +{ *count = 1; return 0; } -size_t grib_accessor_class_mars_step_t::string_length(grib_accessor* a){ +size_t grib_accessor_class_mars_step_t::string_length(grib_accessor* a) +{ return 16; } -int grib_accessor_class_mars_step_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_mars_step_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_LONG; } diff --git a/src/accessor/grib_accessor_class_step_human_readable.cc b/src/accessor/grib_accessor_class_step_human_readable.cc index 929733705..18dec9c14 100644 --- a/src/accessor/grib_accessor_class_step_human_readable.cc +++ b/src/accessor/grib_accessor_class_step_human_readable.cc @@ -69,9 +69,10 @@ static int get_step_human_readable(grib_handle* h, char* result, size_t* length) int grib_accessor_class_step_human_readable_t::unpack_string(grib_accessor* a, char* buffer, size_t* len) { grib_accessor_step_human_readable_t* self = (grib_accessor_step_human_readable_t*)a; + grib_handle* h = grib_handle_of_accessor(a); long stepUnits = 0; - int err = 0; + int err = 0; /* Save the current value of stepUnits */ err = grib_get_long_internal(h, self->stepUnits, &stepUnits); diff --git a/src/accessor/grib_accessor_class_step_in_units.cc b/src/accessor/grib_accessor_class_step_in_units.cc index 3bbdba009..52086d700 100644 --- a/src/accessor/grib_accessor_class_step_in_units.cc +++ b/src/accessor/grib_accessor_class_step_in_units.cc @@ -17,8 +17,8 @@ grib_accessor_class_step_in_units_t _grib_accessor_class_step_in_units{"step_in_units"}; grib_accessor_class* grib_accessor_class_step_in_units = &_grib_accessor_class_step_in_units; - -void grib_accessor_class_step_in_units_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_step_in_units_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_step_in_units_t* self = (grib_accessor_step_in_units_t*)a; grib_handle* hand = grib_handle_of_accessor(a); @@ -31,11 +31,13 @@ void grib_accessor_class_step_in_units_t::init(grib_accessor* a, const long l, g self->time_range_value = grib_arguments_get_name(hand, c, n++); } -void grib_accessor_class_step_in_units_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_step_in_units_t::dump(grib_accessor* a, grib_dumper* dumper) +{ grib_dump_double(dumper, a, NULL); } -int grib_accessor_class_step_in_units_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_step_in_units_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ const grib_accessor_step_in_units_t* self = (grib_accessor_step_in_units_t*)a; int err = 0; long forecast_time_value, forecast_time_unit, step_units; @@ -65,7 +67,8 @@ int grib_accessor_class_step_in_units_t::unpack_long(grib_accessor* a, long* val return GRIB_SUCCESS; } -int grib_accessor_class_step_in_units_t::unpack_double(grib_accessor* a, double * val, size_t* len){ +int grib_accessor_class_step_in_units_t::unpack_double(grib_accessor* a, double * val, size_t* len) +{ const grib_accessor_step_in_units_t* self = (grib_accessor_step_in_units_t*)a; int err = 0; long forecast_time_value, forecast_time_unit, step_units; @@ -94,7 +97,8 @@ int grib_accessor_class_step_in_units_t::unpack_double(grib_accessor* a, double return GRIB_SUCCESS; } -int pack_long_new_(grib_accessor* a, const long start_step_value, const long start_step_unit, const long force_step_units){ +int pack_long_new_(grib_accessor* a, const long start_step_value, const long start_step_unit, const long force_step_units) +{ const grib_accessor_step_in_units_t* self = (grib_accessor_step_in_units_t*)a; grib_handle* h = grib_handle_of_accessor(a); int err = 0; @@ -143,7 +147,8 @@ int pack_long_new_(grib_accessor* a, const long start_step_value, const long sta return GRIB_SUCCESS; } -int grib_accessor_class_step_in_units_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_step_in_units_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_handle* h = grib_handle_of_accessor(a); int ret = GRIB_SUCCESS; @@ -174,7 +179,8 @@ int grib_accessor_class_step_in_units_t::pack_long(grib_accessor* a, const long* return ret; } -int grib_accessor_class_step_in_units_t::pack_string(grib_accessor* a, const char* val, size_t* len){ +int grib_accessor_class_step_in_units_t::pack_string(grib_accessor* a, const char* val, size_t* len) +{ grib_handle* h = grib_handle_of_accessor(a); //long force_step_units = eccodes::Unit(eccodes::Unit::Value::MISSING).value(); int ret = GRIB_SUCCESS; @@ -195,7 +201,8 @@ int grib_accessor_class_step_in_units_t::pack_string(grib_accessor* a, const cha return GRIB_SUCCESS; } -int grib_accessor_class_step_in_units_t::unpack_string(grib_accessor* a, char* val, size_t* len){ +int grib_accessor_class_step_in_units_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ const grib_accessor_step_in_units_t* self = (grib_accessor_step_in_units_t*)a; grib_handle* h = grib_handle_of_accessor(a); int ret = GRIB_SUCCESS; @@ -238,7 +245,8 @@ int grib_accessor_class_step_in_units_t::unpack_string(grib_accessor* a, char* v return GRIB_SUCCESS; } -int grib_accessor_class_step_in_units_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_step_in_units_t::get_native_type(grib_accessor* a) +{ grib_handle* h = grib_handle_of_accessor(a); const int show_units_for_hours = a->context->grib_hourly_steps_with_units; diff --git a/src/accessor/grib_accessor_class_unexpanded_descriptors.cc b/src/accessor/grib_accessor_class_unexpanded_descriptors.cc index f430b4864..5c9402360 100644 --- a/src/accessor/grib_accessor_class_unexpanded_descriptors.cc +++ b/src/accessor/grib_accessor_class_unexpanded_descriptors.cc @@ -11,25 +11,28 @@ #include "grib_accessor_class_unexpanded_descriptors.h" -grib_accessor_class_unexpanded_descriptors_t _grib_accessor_class_unexpanded_descriptors{"unexpanded_descriptors"}; +grib_accessor_class_unexpanded_descriptors_t _grib_accessor_class_unexpanded_descriptors{ "unexpanded_descriptors" }; grib_accessor_class* grib_accessor_class_unexpanded_descriptors = &_grib_accessor_class_unexpanded_descriptors; -void grib_accessor_class_unexpanded_descriptors_t::init(grib_accessor* a, const long len, grib_arguments* args){ +void grib_accessor_class_unexpanded_descriptors_t::init(grib_accessor* a, const long len, grib_arguments* args) +{ grib_accessor_class_long_t::init(a, len, args); grib_accessor_unexpanded_descriptors_t* self = (grib_accessor_unexpanded_descriptors_t*)a; - int n = 0; - grib_handle* hand = grib_handle_of_accessor(a); - self->unexpandedDescriptorsEncoded = grib_find_accessor(hand, grib_arguments_get_name(hand, args, n++)); - self->createNewData = grib_arguments_get_name(hand, args, n++); - a->length = 0; + + int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + self->unexpandedDescriptorsEncoded = grib_find_accessor(hand, grib_arguments_get_name(hand, args, n++)); + self->createNewData = grib_arguments_get_name(hand, args, n++); + a->length = 0; } -int grib_accessor_class_unexpanded_descriptors_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_unexpanded_descriptors_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_unexpanded_descriptors_t* self = (grib_accessor_unexpanded_descriptors_t*)a; - int ret = 0; - long pos = 0; - long rlen = 0; + int ret = 0; + long pos = 0; + long rlen = 0; long f, x, y; long* v = val; long i; @@ -64,10 +67,11 @@ int grib_accessor_class_unexpanded_descriptors_t::unpack_long(grib_accessor* a, return GRIB_SUCCESS; } -int grib_accessor_class_unexpanded_descriptors_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_unexpanded_descriptors_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_unexpanded_descriptors_t* self = (grib_accessor_unexpanded_descriptors_t*)a; - int ret = 0; - long pos = 0; + int ret = 0; + long pos = 0; unsigned long f, x, y; unsigned char* buf = NULL; grib_accessor* expanded = NULL; @@ -90,7 +94,8 @@ int grib_accessor_class_unexpanded_descriptors_t::pack_long(grib_accessor* a, co grib_encode_unsigned_longb(buf, y, &pos, 8); } - self->unexpandedDescriptorsEncoded->pack_bytes(buf, &buflen); grib_context_free(hand->context, buf); + self->unexpandedDescriptorsEncoded->pack_bytes(buf, &buflen); + grib_context_free(hand->context, buf); if (createNewData == 0) return ret; @@ -110,23 +115,28 @@ int grib_accessor_class_unexpanded_descriptors_t::pack_long(grib_accessor* a, co return ret; } -int grib_accessor_class_unexpanded_descriptors_t::value_count(grib_accessor* a, long* numberOfUnexpandedDescriptors){ +int grib_accessor_class_unexpanded_descriptors_t::value_count(grib_accessor* a, long* numberOfUnexpandedDescriptors) +{ grib_accessor_unexpanded_descriptors_t* self = (grib_accessor_unexpanded_descriptors_t*)a; - long n = 0; + long n = 0; - self->unexpandedDescriptorsEncoded->value_count(&n); *numberOfUnexpandedDescriptors = n / 2; + self->unexpandedDescriptorsEncoded->value_count(&n); + *numberOfUnexpandedDescriptors = n / 2; return 0; } -long grib_accessor_class_unexpanded_descriptors_t::byte_offset(grib_accessor* a){ +long grib_accessor_class_unexpanded_descriptors_t::byte_offset(grib_accessor* a) +{ return a->offset; } -void grib_accessor_class_unexpanded_descriptors_t::update_size(grib_accessor* a, size_t s){ +void grib_accessor_class_unexpanded_descriptors_t::update_size(grib_accessor* a, size_t s) +{ a->length = s; } -long grib_accessor_class_unexpanded_descriptors_t::next_offset(grib_accessor* a){ +long grib_accessor_class_unexpanded_descriptors_t::next_offset(grib_accessor* a) +{ return a->byte_offset() + a->length; } diff --git a/src/accessor/grib_accessor_class_unpack_bufr_values.cc b/src/accessor/grib_accessor_class_unpack_bufr_values.cc index 9942a64a8..3497bbbe2 100644 --- a/src/accessor/grib_accessor_class_unpack_bufr_values.cc +++ b/src/accessor/grib_accessor_class_unpack_bufr_values.cc @@ -12,58 +12,71 @@ #include "grib_accessor_class_unpack_bufr_values.h" #include "grib_accessor_class_bufr_data_array.h" -grib_accessor_class_unpack_bufr_values_t _grib_accessor_class_unpack_bufr_values{"unpack_bufr_values"}; +grib_accessor_class_unpack_bufr_values_t _grib_accessor_class_unpack_bufr_values{ "unpack_bufr_values" }; grib_accessor_class* grib_accessor_class_unpack_bufr_values = &_grib_accessor_class_unpack_bufr_values; -void grib_accessor_class_unpack_bufr_values_t::init(grib_accessor* a, const long len, grib_arguments* params){ +void grib_accessor_class_unpack_bufr_values_t::init(grib_accessor* a, const long len, grib_arguments* params) +{ grib_accessor_class_gen_t::init(a, len, params); char* key; grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; - key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), params, 0); - self->data_accessor = grib_find_accessor(grib_handle_of_accessor(a), key); + key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), params, 0); + self->data_accessor = grib_find_accessor(grib_handle_of_accessor(a), key); a->length = 0; } -void grib_accessor_class_unpack_bufr_values_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_unpack_bufr_values_t::dump(grib_accessor* a, grib_dumper* dumper) +{ } -int grib_accessor_class_unpack_bufr_values_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len){ +int grib_accessor_class_unpack_bufr_values_t::unpack_string_array(grib_accessor* a, char** buffer, size_t* len) +{ grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - return data->unpack_double(0, 0);} + return data->unpack_double(0, 0); +} -int grib_accessor_class_unpack_bufr_values_t::unpack_string(grib_accessor* a, char* buffer, size_t* len){ +int grib_accessor_class_unpack_bufr_values_t::unpack_string(grib_accessor* a, char* buffer, size_t* len) +{ grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; strcpy(buffer, "0"); - *len=1; + *len = 1; - return data->unpack_double(0, 0);} + return data->unpack_double(0, 0); +} -int grib_accessor_class_unpack_bufr_values_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_unpack_bufr_values_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - return data->unpack_double(0, 0);} + return data->unpack_double(0, 0); +} -int grib_accessor_class_unpack_bufr_values_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_unpack_bufr_values_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - return data->unpack_double(0, 0);} + return data->unpack_double(0, 0); +} -int grib_accessor_class_unpack_bufr_values_t::value_count(grib_accessor* a, long* count){ +int grib_accessor_class_unpack_bufr_values_t::value_count(grib_accessor* a, long* count) +{ *count = 1; return 0; } -void grib_accessor_class_unpack_bufr_values_t::destroy(grib_context* context, grib_accessor* a){ +void grib_accessor_class_unpack_bufr_values_t::destroy(grib_context* context, grib_accessor* a) +{ grib_accessor_class_gen_t::destroy(context, a); } -int grib_accessor_class_unpack_bufr_values_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_unpack_bufr_values_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_LONG; } @@ -75,10 +88,11 @@ int grib_accessor_class_unpack_bufr_values_t::get_native_type(grib_accessor* a){ // return "unknown proc flag"; // } -int grib_accessor_class_unpack_bufr_values_t::pack_long(grib_accessor* a, const long* val, size_t* len){ - int unpackMode = CODES_BUFR_UNPACK_STRUCTURE; +int grib_accessor_class_unpack_bufr_values_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ + int unpackMode = CODES_BUFR_UNPACK_STRUCTURE; grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; if (*val == 2) unpackMode = CODES_BUFR_UNPACK_FLAT; @@ -87,10 +101,13 @@ int grib_accessor_class_unpack_bufr_values_t::pack_long(grib_accessor* a, const accessor_bufr_data_array_set_unpackMode(data, unpackMode); - return data->unpack_double(0, 0);} + return data->unpack_double(0, 0); +} -int grib_accessor_class_unpack_bufr_values_t::pack_double(grib_accessor* a, const double* val, size_t* len){ +int grib_accessor_class_unpack_bufr_values_t::pack_double(grib_accessor* a, const double* val, size_t* len) +{ grib_accessor_unpack_bufr_values_t* self = (grib_accessor_unpack_bufr_values_t*)a; - grib_accessor* data = (grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - return data->unpack_double(0, 0);} + return data->unpack_double(0, 0); +} diff --git a/src/accessor/grib_accessor_class_unsigned.cc b/src/accessor/grib_accessor_class_unsigned.cc index 0a60e809c..8093e3a6a 100644 --- a/src/accessor/grib_accessor_class_unsigned.cc +++ b/src/accessor/grib_accessor_class_unsigned.cc @@ -19,8 +19,8 @@ void grib_accessor_class_unsigned_t::init(grib_accessor* a, const long len, grib { grib_accessor_class_long_t::init(a, len, arg); grib_accessor_unsigned_t* self = (grib_accessor_unsigned_t*)a; - self->arg = arg; - self->nbytes = len; + self->arg = arg; + self->nbytes = len; if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { a->length = 0; @@ -67,10 +67,10 @@ int value_is_missing(long val) int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t* len, int check) { grib_accessor_unsigned_t* self = (grib_accessor_unsigned_t*)a; - int ret = 0; - long off = 0; - long rlen = 0; - int err = 0; + int ret = 0; + long off = 0; + long rlen = 0; + int err = 0; size_t buflen = 0; unsigned char* buf = NULL; @@ -114,7 +114,7 @@ int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t* len, in if (check) { if (val[0] < 0) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Key \"%s\": Trying to encode a negative value of %ld for key of type unsigned", a->name, val[0]); + "Key \"%s\": Trying to encode a negative value of %ld for key of type unsigned", a->name, val[0]); return GRIB_ENCODING_ERROR; } /* See GRIB-23 and GRIB-262 */ @@ -124,8 +124,8 @@ int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t* len, in unsigned long maxval = (1UL << nbits) - 1; if (maxval > 0 && v > maxval) { /* See ECC-1002 */ grib_context_log(a->context, GRIB_LOG_ERROR, - "Key \"%s\": Trying to encode value of %ld but the maximum allowable value is %lu (number of bits=%ld)", - a->name, v, maxval, nbits); + "Key \"%s\": Trying to encode value of %ld but the maximum allowable value is %lu (number of bits=%ld)", + a->name, v, maxval, nbits); return GRIB_ENCODING_ERROR; } } @@ -164,13 +164,13 @@ int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t* len, in int grib_accessor_class_unsigned_t::unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_unsigned_t* self = (grib_accessor_unsigned_t*)a; - long rlen = 0; - unsigned long i = 0; - unsigned long missing = 0; - long count = 0; - int err = 0; - long pos = a->offset * 8; - grib_handle* hand = grib_handle_of_accessor(a); + long rlen = 0; + unsigned long i = 0; + unsigned long missing = 0; + long count = 0; + int err = 0; + long pos = a->offset * 8; + grib_handle* hand = grib_handle_of_accessor(a); err = a->value_count(&count); if (err) diff --git a/src/accessor/grib_accessor_class_unsigned_bits.cc b/src/accessor/grib_accessor_class_unsigned_bits.cc index 40088c17d..44873938a 100644 --- a/src/accessor/grib_accessor_class_unsigned_bits.cc +++ b/src/accessor/grib_accessor_class_unsigned_bits.cc @@ -11,12 +11,12 @@ #include "grib_accessor_class_unsigned_bits.h" -grib_accessor_class_unsigned_bits_t _grib_accessor_class_unsigned_bits{"unsigned_bits"}; +grib_accessor_class_unsigned_bits_t _grib_accessor_class_unsigned_bits{ "unsigned_bits" }; grib_accessor_class* grib_accessor_class_unsigned_bits = &_grib_accessor_class_unsigned_bits; - -static long compute_byte_count(grib_accessor* a){ +static long compute_byte_count(grib_accessor* a) +{ grib_accessor_unsigned_bits_t* self = (grib_accessor_unsigned_bits_t*)a; long numberOfBits; long numberOfElements; @@ -40,21 +40,23 @@ static long compute_byte_count(grib_accessor* a){ } -void grib_accessor_class_unsigned_bits_t::init(grib_accessor* a, const long len, grib_arguments* args){ +void grib_accessor_class_unsigned_bits_t::init(grib_accessor* a, const long len, grib_arguments* args) +{ grib_accessor_class_long_t::init(a, len, args); grib_accessor_unsigned_bits_t* self = (grib_accessor_unsigned_bits_t*)a; - int n = 0; - self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - self->numberOfElements = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); - a->length = compute_byte_count(a); + int n = 0; + self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->numberOfElements = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->length = compute_byte_count(a); } -int grib_accessor_class_unsigned_bits_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_unsigned_bits_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_unsigned_bits_t* self = (grib_accessor_unsigned_bits_t*)a; - int ret = 0; - long pos = a->offset * 8; - long rlen = 0; - long numberOfBits = 0; + int ret = 0; + long pos = a->offset * 8; + long rlen = 0; + long numberOfBits = 0; ret = value_count(a, &rlen); if (ret) @@ -84,16 +86,17 @@ int grib_accessor_class_unsigned_bits_t::unpack_long(grib_accessor* a, long* val return GRIB_SUCCESS; } -int grib_accessor_class_unsigned_bits_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_unsigned_bits_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_unsigned_bits_t* self = (grib_accessor_unsigned_bits_t*)a; - int ret = 0; - long off = 0; - long numberOfBits = 0; - size_t buflen = 0; - unsigned char* buf = NULL; - unsigned long i = 0; - long rlen = 0; - ret = value_count(a, &rlen); + int ret = 0; + long off = 0; + long numberOfBits = 0; + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned long i = 0; + long rlen = 0; + ret = value_count(a, &rlen); if (ret) return ret; /* @@ -128,11 +131,13 @@ int grib_accessor_class_unsigned_bits_t::pack_long(grib_accessor* a, const long* return ret; } -long grib_accessor_class_unsigned_bits_t::byte_count(grib_accessor* a){ +long grib_accessor_class_unsigned_bits_t::byte_count(grib_accessor* a) +{ return a->length; } -int grib_accessor_class_unsigned_bits_t::value_count(grib_accessor* a, long* numberOfElements){ +int grib_accessor_class_unsigned_bits_t::value_count(grib_accessor* a, long* numberOfElements) +{ grib_accessor_unsigned_bits_t* self = (grib_accessor_unsigned_bits_t*)a; int ret; *numberOfElements = 0; @@ -146,14 +151,17 @@ int grib_accessor_class_unsigned_bits_t::value_count(grib_accessor* a, long* num return ret; } -long grib_accessor_class_unsigned_bits_t::byte_offset(grib_accessor* a){ +long grib_accessor_class_unsigned_bits_t::byte_offset(grib_accessor* a) +{ return a->offset; } -void grib_accessor_class_unsigned_bits_t::update_size(grib_accessor* a, size_t s){ +void grib_accessor_class_unsigned_bits_t::update_size(grib_accessor* a, size_t s) +{ a->length = s; } -long grib_accessor_class_unsigned_bits_t::next_offset(grib_accessor* a){ +long grib_accessor_class_unsigned_bits_t::next_offset(grib_accessor* a) +{ return a->byte_offset() + a->length; } diff --git a/src/accessor/grib_accessor_class_validity_date.cc b/src/accessor/grib_accessor_class_validity_date.cc index 19c26bf48..331c4ec82 100644 --- a/src/accessor/grib_accessor_class_validity_date.cc +++ b/src/accessor/grib_accessor_class_validity_date.cc @@ -12,14 +12,15 @@ #include "grib_accessor_class_validity_date.h" #include "shared_functions.h" -grib_accessor_class_validity_date_t _grib_accessor_class_validity_date{"validity_date"}; +grib_accessor_class_validity_date_t _grib_accessor_class_validity_date{ "validity_date" }; grib_accessor_class* grib_accessor_class_validity_date = &_grib_accessor_class_validity_date; -void grib_accessor_class_validity_date_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_validity_date_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_validity_date_t* self = (grib_accessor_validity_date_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; self->date = grib_arguments_get_name(hand, c, n++); self->time = grib_arguments_get_name(hand, c, n++); @@ -32,14 +33,15 @@ void grib_accessor_class_validity_date_t::init(grib_accessor* a, const long l, g a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -int grib_accessor_class_validity_date_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_validity_date_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_validity_date_t* self = (grib_accessor_validity_date_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret = 0; - long date = 0; - long time = 0; - long step = 0; - long stepUnits = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; + long date = 0; + long time = 0; + long step = 0; + long stepUnits = 0; long hours = 0, minutes = 0, step_mins = 0, tmp, tmp_hrs; if (self->year) { diff --git a/src/accessor/grib_accessor_class_validity_time.cc b/src/accessor/grib_accessor_class_validity_time.cc index 9cbc445cb..350a19e92 100644 --- a/src/accessor/grib_accessor_class_validity_time.cc +++ b/src/accessor/grib_accessor_class_validity_time.cc @@ -12,15 +12,16 @@ #include "grib_accessor_class_validity_time.h" #include "shared_functions.h" -grib_accessor_class_validity_time_t _grib_accessor_class_validity_time{"validity_time"}; +grib_accessor_class_validity_time_t _grib_accessor_class_validity_time{ "validity_time" }; grib_accessor_class* grib_accessor_class_validity_time = &_grib_accessor_class_validity_time; -void grib_accessor_class_validity_time_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_validity_time_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_long_t::init(a, l, c); grib_accessor_validity_time_t* self = (grib_accessor_validity_time_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; self->date = grib_arguments_get_name(hand, c, n++); self->time = grib_arguments_get_name(hand, c, n++); @@ -32,14 +33,15 @@ void grib_accessor_class_validity_time_t::init(grib_accessor* a, const long l, g a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -int grib_accessor_class_validity_time_t::unpack_long(grib_accessor* a, long* val, size_t* len){ +int grib_accessor_class_validity_time_t::unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_validity_time_t* self = (grib_accessor_validity_time_t*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret = 0; - long date = 0; - long time = 0; - long step = 0; - long stepUnits = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; + long date = 0; + long time = 0; + long step = 0; + long stepUnits = 0; long hours = 0, minutes = 0, step_mins = 0, tmp, tmp_hrs, tmp_mins; if (self->hours) { @@ -92,9 +94,10 @@ int grib_accessor_class_validity_time_t::unpack_long(grib_accessor* a, long* val return GRIB_SUCCESS; } -int grib_accessor_class_validity_time_t::unpack_string(grib_accessor* a, char* val, size_t* len){ - int err = 0; - long v = 0; +int grib_accessor_class_validity_time_t::unpack_string(grib_accessor* a, char* val, size_t* len) +{ + int err = 0; + long v = 0; size_t lsize = 1, lmin = 5; err = unpack_long(a, &v, &lsize); diff --git a/src/accessor/grib_accessor_class_values.cc b/src/accessor/grib_accessor_class_values.cc index 5aa172a05..cd2107559 100644 --- a/src/accessor/grib_accessor_class_values.cc +++ b/src/accessor/grib_accessor_class_values.cc @@ -14,7 +14,8 @@ grib_accessor_class_values_t _grib_accessor_class_values{"values"}; grib_accessor_class* grib_accessor_class_values = &_grib_accessor_class_values; -long init_length(grib_accessor* a){ +long init_length(grib_accessor* a) +{ grib_accessor_values_t* self = (grib_accessor_values_t*)a; int ret = 0; @@ -46,7 +47,8 @@ long init_length(grib_accessor* a){ return seclen - (offsetdata - offsetsection); } -void grib_accessor_class_values_t::init(grib_accessor* a, const long v, grib_arguments* params){ +void grib_accessor_class_values_t::init(grib_accessor* a, const long v, grib_arguments* params) +{ grib_accessor_class_gen_t::init(a, v, params); grib_accessor_values_t* self = (grib_accessor_values_t*)a; self->carg = 0; @@ -60,34 +62,41 @@ void grib_accessor_class_values_t::init(grib_accessor* a, const long v, grib_arg /* Assert(a->length>=0); */ } -int grib_accessor_class_values_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_values_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_DOUBLE; } -void grib_accessor_class_values_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_values_t::dump(grib_accessor* a, grib_dumper* dumper) +{ grib_dump_values(dumper, a); } -long grib_accessor_class_values_t::byte_count(grib_accessor* a){ +long grib_accessor_class_values_t::byte_count(grib_accessor* a) +{ grib_context_log(a->context, GRIB_LOG_DEBUG, "byte_count of %s = %ld", a->name, a->length); return a->length; } -long grib_accessor_class_values_t::byte_offset(grib_accessor* a){ +long grib_accessor_class_values_t::byte_offset(grib_accessor* a) +{ return a->offset; } -long grib_accessor_class_values_t::next_offset(grib_accessor* a){ +long grib_accessor_class_values_t::next_offset(grib_accessor* a) +{ return a->offset + a->length; } -void grib_accessor_class_values_t::update_size(grib_accessor* a, size_t s){ +void grib_accessor_class_values_t::update_size(grib_accessor* a, size_t s) +{ grib_context_log(a->context, GRIB_LOG_DEBUG, "updating size of %s old %ld new %ld", a->name, a->length, s); a->length = s; Assert(a->length >= 0); } -int grib_accessor_class_values_t::compare(grib_accessor* a, grib_accessor* b){ +int grib_accessor_class_values_t::compare(grib_accessor* a, grib_accessor* b) +{ int retval = 0; double* aval = 0; double* bval = 0; @@ -123,7 +132,8 @@ int grib_accessor_class_values_t::compare(grib_accessor* a, grib_accessor* b){ return retval; } -int grib_accessor_class_values_t::pack_long(grib_accessor* a, const long* val, size_t* len){ +int grib_accessor_class_values_t::pack_long(grib_accessor* a, const long* val, size_t* len) +{ grib_accessor_values_t* self = (grib_accessor_values_t*)a; double* dval = (double*)grib_context_malloc(a->context, *len * sizeof(double)); diff --git a/src/accessor/grib_accessor_class_vector.cc b/src/accessor/grib_accessor_class_vector.cc index bd0185d73..f08809f6f 100644 --- a/src/accessor/grib_accessor_class_vector.cc +++ b/src/accessor/grib_accessor_class_vector.cc @@ -12,14 +12,15 @@ #include "grib_accessor_class_vector.h" #include "grib_accessor_class_abstract_vector.h" -grib_accessor_class_vector_t _grib_accessor_class_vector{"vector"}; +grib_accessor_class_vector_t _grib_accessor_class_vector{ "vector" }; grib_accessor_class* grib_accessor_class_vector = &_grib_accessor_class_vector; -void grib_accessor_class_vector_t::init(grib_accessor* a, const long l, grib_arguments* c){ +void grib_accessor_class_vector_t::init(grib_accessor* a, const long l, grib_arguments* c) +{ grib_accessor_class_abstract_vector_t::init(a, l, c); grib_accessor_vector_t* self = (grib_accessor_vector_t*)a; - int n = 0; + int n = 0; self->vector = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); self->index = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); @@ -28,12 +29,13 @@ void grib_accessor_class_vector_t::init(grib_accessor* a, const long l, grib_arg a->length = 0; } -int grib_accessor_class_vector_t::unpack_double(grib_accessor* a, double* val, size_t* len){ +int grib_accessor_class_vector_t::unpack_double(grib_accessor* a, double* val, size_t* len) +{ int err = 0; size_t size = 0; double* stat; - grib_accessor_vector_t* self = (grib_accessor_vector_t*)a; - grib_accessor* va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); + grib_accessor_vector_t* self = (grib_accessor_vector_t*)a; + grib_accessor* va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); grib_accessor_abstract_vector_t* v = (grib_accessor_abstract_vector_t*)va; Assert(self->index >= 0); @@ -46,7 +48,8 @@ int grib_accessor_class_vector_t::unpack_double(grib_accessor* a, double* val, s if (va->dirty) { grib_get_size(grib_handle_of_accessor(a), self->vector, &size); stat = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); - err = va->unpack_double(stat, &size); grib_context_free(a->context, stat); + err = va->unpack_double(stat, &size); + grib_context_free(a->context, stat); if (err) return err; } diff --git a/src/accessor/grib_accessor_class_when.cc b/src/accessor/grib_accessor_class_when.cc index 2ab2652f0..48db76803 100644 --- a/src/accessor/grib_accessor_class_when.cc +++ b/src/accessor/grib_accessor_class_when.cc @@ -11,25 +11,29 @@ #include "grib_accessor_class_when.h" -grib_accessor_class_when_t _grib_accessor_class_when{"when"}; +grib_accessor_class_when_t _grib_accessor_class_when{ "when" }; grib_accessor_class* grib_accessor_class_when = &_grib_accessor_class_when; -void grib_accessor_class_when_t::init(grib_accessor* a, const long len, grib_arguments* arg){ +void grib_accessor_class_when_t::init(grib_accessor* a, const long len, grib_arguments* arg) +{ grib_accessor_class_gen_t::init(a, len, arg); a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -void grib_accessor_class_when_t::dump(grib_accessor* a, grib_dumper* dumper){ +void grib_accessor_class_when_t::dump(grib_accessor* a, grib_dumper* dumper) +{ /* grib_dump_when(dumper,a,NULL); */ } -int grib_accessor_class_when_t::notify_change(grib_accessor* a, grib_accessor* changed){ +int grib_accessor_class_when_t::notify_change(grib_accessor* a, grib_accessor* changed) +{ return grib_action_notify_change(a->creator, a, changed); } -int grib_accessor_class_when_t::get_native_type(grib_accessor* a){ +int grib_accessor_class_when_t::get_native_type(grib_accessor* a) +{ return GRIB_TYPE_UNDEFINED; } From 769d5dcbfec381d1e42fb3792d13138861d95dba Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 13 May 2024 10:57:39 +0100 Subject: [PATCH 144/196] ECC-1709: GRIB2: Rename indicatorOfUnitOfTimeRange to indicatorOfUnitForForecastTime --- definitions/grib2/template.4.20.def | 40 +++++++++---------- .../grib2/template.4.forecast_time.def | 4 +- .../grib2/template.4.forecast_time_44.def | 4 +- definitions/grib2/template.4.localtime.def | 4 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/definitions/grib2/template.4.20.def b/definitions/grib2/template.4.20.def index b739bf6bb..882691250 100644 --- a/definitions/grib2/template.4.20.def +++ b/definitions/grib2/template.4.20.def @@ -1,60 +1,60 @@ # (C) Copyright 2005- ECMWF. # TEMPLATE 4.20, Radar product -codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir) : dump; +codetable[1] parameterCategory('4.1.[discipline:l].table',masterDir,localDir) : dump; # Parameter number -codetable[1] parameterNumber ('4.2.[discipline:l].[parameterCategory:l].table',masterDir,localDir) : dump; +codetable[1] parameterNumber('4.2.[discipline:l].[parameterCategory:l].table',masterDir,localDir) : dump; meta parameterUnits codetable_units(parameterNumber) : dump; meta parameterName codetable_title(parameterNumber) : dump; -codetable[1] typeOfGeneratingProcess ('4.3.table',masterDir,localDir) : dump; +codetable[1] typeOfGeneratingProcess('4.3.table',masterDir,localDir) : dump; # Number of radar sites used -unsigned[1] numberOfRadarSitesUsed : dump; +unsigned[1] numberOfRadarSitesUsed : dump; -codetable[1] indicatorOfUnitOfTimeRange ('4.4.table',masterDir,localDir) : dump; -alias indicatorOfUnitForForecastTime = indicatorOfUnitOfTimeRange; +codetable[1] indicatorOfUnitForForecastTime('4.4.table',masterDir,localDir) : dump; +alias indicatorOfUnitOfTimeRange = indicatorOfUnitForForecastTime; include "grib2/stepUnits.def" # Site latitude (in microdegrees) -unsigned[4] siteLatitude : dump; +unsigned[4] siteLatitude : dump; # Site longitude (in microdegrees) -unsigned[4] siteLongitude : dump; +unsigned[4] siteLongitude : dump; # Site elevation (meters) -unsigned[2] siteElevation : dump; +unsigned[2] siteElevation : dump; # Site ID (alphanumeric) -unsigned[4] siteId : dump; +unsigned[4] siteId : dump; # Site ID (numeric) -unsigned[2] siteId : dump; +unsigned[2] siteId : dump; # Operating mode -codetable[1] operatingMode ('4.12.table',masterDir,localDir) : dump; +codetable[1] operatingMode('4.12.table',masterDir,localDir) : dump; # Reflectivity calibration constant (tenths of dB) -unsigned[1] reflectivityCalibrationConstant : dump; +unsigned[1] reflectivityCalibrationConstant : dump; # Quality control indicator -codetable[1] qualityControlIndicator ('4.13.table',masterDir,localDir) : dump; +codetable[1] qualityControlIndicator('4.13.table',masterDir,localDir) : dump; # Clutter filter indicator -codetable[1] clutterFilterIndicator ('4.14.table',masterDir,localDir) : dump; +codetable[1] clutterFilterIndicator('4.14.table',masterDir,localDir) : dump; # Constant antenna elevation angle (tenths of degree true) -unsigned[1] constantAntennaElevationAngle : dump; +unsigned[1] constantAntennaElevationAngle : dump; # Accumulation interval (minutes) -unsigned[2] accumulationInterval : dump; +unsigned[2] accumulationInterval : dump; # Reference reflectivity for echo top (dB) -unsigned[1] referenceReflectivityForEchoTop : dump; +unsigned[1] referenceReflectivityForEchoTop : dump; # Range bin spacing (meters) -unsigned[3] rangeBinSpacing : dump; +unsigned[3] rangeBinSpacing : dump; # Radial angular spacing (tenths of degree true) -unsigned[2] radialAngularSpacing : dump; +unsigned[2] radialAngularSpacing : dump; diff --git a/definitions/grib2/template.4.forecast_time.def b/definitions/grib2/template.4.forecast_time.def index c12da70e3..e1c2822d9 100644 --- a/definitions/grib2/template.4.forecast_time.def +++ b/definitions/grib2/template.4.forecast_time.def @@ -9,8 +9,8 @@ unsigned[1] minutesAfterDataCutoff = missing() : edition_specific,can_be_missin alias minutesAfterReferenceTimeOfDataCutoff=minutesAfterDataCutoff; # Indicator of unit for forecastTime (ECC-1709) -codetable[1] indicatorOfUnitOfTimeRange ('4.4.table',masterDir,localDir) : dump; -alias indicatorOfUnitForForecastTime = indicatorOfUnitOfTimeRange; +codetable[1] indicatorOfUnitForForecastTime ('4.4.table',masterDir,localDir) : dump; +alias indicatorOfUnitOfTimeRange = indicatorOfUnitForForecastTime; include "grib2/stepUnits.def" diff --git a/definitions/grib2/template.4.forecast_time_44.def b/definitions/grib2/template.4.forecast_time_44.def index 0b4ad445b..30723622e 100644 --- a/definitions/grib2/template.4.forecast_time_44.def +++ b/definitions/grib2/template.4.forecast_time_44.def @@ -11,8 +11,8 @@ unsigned[1] minutesAfterDataCutoff = missing() : edition_specific,can_be_missin alias minutesAfterReferenceTimeOfDataCutoff=minutesAfterDataCutoff; # Indicator of unit for forecastTime (ECC-1709) -codetable[1] indicatorOfUnitOfTimeRange ('4.4.table',masterDir,localDir) : dump; -alias indicatorOfUnitForForecastTime = indicatorOfUnitOfTimeRange; +codetable[1] indicatorOfUnitForForecastTime ('4.4.table',masterDir,localDir) : dump; +alias indicatorOfUnitOfTimeRange = indicatorOfUnitForForecastTime; include "grib2/stepUnits.def" diff --git a/definitions/grib2/template.4.localtime.def b/definitions/grib2/template.4.localtime.def index 96d655d68..336d90068 100644 --- a/definitions/grib2/template.4.localtime.def +++ b/definitions/grib2/template.4.localtime.def @@ -34,7 +34,7 @@ localTimeForecastList list(numberOfForecastsUsedInLocalTime) unsigned[1] secondOfForecastUsedInLocalTime=0 : dump, edition_specific; # Indicator of unit of time for ForecastTime - codetable[1] indicatorOfUnitForForecastTime ('4.4.table',masterDir,localDir)=1 : dump; + codetable[1] indicatorOfUnitForForecastTime('4.4.table',masterDir,localDir)=1 : dump; # Length of the time range over which statistical processing is done, in units defined by the previous octet unsigned[4] forecastTime=0 : dump; @@ -43,7 +43,7 @@ localTimeForecastList list(numberOfForecastsUsedInLocalTime) unsigned[1] numberOfTimeIncrementsOfForecastsUsedInLocalTime=1 : dump; # Indicator of unit of time for the increment between the successive steps used - codetable[1] indicatorOfUnitForTimeIncrement ('4.4.table',masterDir,localDir)=255 : dump; + codetable[1] indicatorOfUnitForTimeIncrement('4.4.table',masterDir,localDir)=255 : dump; # Time increment between successive fields, in units defined by the previous octet unsigned[4] timeIncrement=0 : dump; From 501dc2c125296fa5b2746df01da6e49e16d9dbbf Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 May 2024 11:17:11 +0000 Subject: [PATCH 145/196] ECC-1824: GRIB2: Correct shortName for recently added time-mean parameters --- definitions/grib2/cfVarName.def | 70 +++++++++---------- .../grib2/localConcepts/cerise/cfVarName.def | 10 +-- .../grib2/localConcepts/cerise/shortName.def | 10 +-- .../grib2/localConcepts/ecmf/cfVarName.def | 10 +-- .../grib2/localConcepts/ecmf/shortName.def | 10 +-- definitions/grib2/shortName.def | 70 +++++++++---------- tests/grib_ecc-1806.sh | 4 +- 7 files changed, 92 insertions(+), 92 deletions(-) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 33c22592d..0893cd19c 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -4795,28 +4795,28 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean snow density -'mrsn' = { +'avg_rsn' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 61 ; typeOfStatisticalProcessing = 0 ; } #Time-mean low vegetation cover -'mcvl' = { +'avg_cvl' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 53 ; typeOfStatisticalProcessing = 0 ; } #Time-mean high vegetation cover -'mcvh' = { +'avg_cvh' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 54 ; typeOfStatisticalProcessing = 0 ; } #Time-mean sea ice area fraction -'mci' = { +'avg_ci' = { discipline = 10 ; parameterCategory = 2 ; parameterNumber = 0 ; @@ -4824,7 +4824,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean sea surface temperature -'msst' = { +'avg_sst' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 0 ; @@ -4832,21 +4832,21 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean leaf area index, low vegetation -'mlai_lv' = { +'avg_lai_lv' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 55 ; typeOfStatisticalProcessing = 0 ; } #Time-mean leaf area index, high vegetation -'mlai_hv' = { +'avg_lai_hv' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 56 ; typeOfStatisticalProcessing = 0 ; } #Time-mean total column liquid water -'mtclw' = { +'avg_tclw' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 69 ; @@ -4855,7 +4855,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean total column cloud ice water -'mtciw' = { +'avg_tciw' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 70 ; @@ -4864,7 +4864,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean 2 metre specific humidity -'m2sh' = { +'avg_2sh' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 0 ; @@ -4875,7 +4875,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean lake mix-layer temperature -'mlmlt' = { +'avg_lmlt' = { discipline = 1 ; parameterCategory = 2 ; parameterNumber = 1 ; @@ -4884,7 +4884,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean lake mix-layer depth -'mlmld' = { +'avg_lmld' = { discipline = 1 ; parameterCategory = 2 ; parameterNumber = 0 ; @@ -4893,7 +4893,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean 2 metre relative humidity -'m2r' = { +'avg_2r' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 1 ; @@ -4903,70 +4903,70 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean fraction of snow cover -'mfscov' = { +'avg_fscov' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 121 ; typeOfStatisticalProcessing = 0 ; } #Time-mean soil temperature -'msot' = { +'avg_sot' = { discipline = 2 ; parameterCategory = 3 ; parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } #Time-mean snow depth -'msde' = { +'avg_sde' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 11 ; typeOfStatisticalProcessing = 0 ; } #Time-mean snow cover -'msnowc' = { +'avg_snowc' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 42 ; typeOfStatisticalProcessing = 0 ; } #Time-mean geopotential -'mz' = { +'avg_z' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 4 ; typeOfStatisticalProcessing = 0 ; } #Time-mean temperature -'mt' = { +'avg_t' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfStatisticalProcessing = 0 ; } #Time-mean U component of wind -'mu' = { +'avg_u' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 2 ; typeOfStatisticalProcessing = 0 ; } #Time-mean V component of wind -'mv' = { +'avg_v' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } #Time-mean specific humidity -'mq' = { +'avg_q' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 0 ; typeOfStatisticalProcessing = 0 ; } #Time-mean surface pressure -'msp' = { +'avg_sp' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 0 ; @@ -4974,14 +4974,14 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean vertical velocity -'mw' = { +'avg_w' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 8 ; typeOfStatisticalProcessing = 0 ; } #Time-mean total column water -'mtcw' = { +'avg_tcw' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 51 ; @@ -4990,7 +4990,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean total column vertically-integrated water vapour -'mtcwv' = { +'avg_tcwv' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 64 ; @@ -4999,7 +4999,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean mean sea level pressure -'mmsl' = { +'avg_msl' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 0 ; @@ -5007,21 +5007,21 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean relative humidity -'mr' = { +'avg_r' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 1 ; typeOfStatisticalProcessing = 0 ; } #Time-mean boundary layer height -'mblh' = { +'avg_blh' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } #Time-mean 10 metre U wind component -'m10u' = { +'avg_10u' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 2 ; @@ -5031,7 +5031,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean 10 metre V wind component -'m10v' = { +'avg_10v' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 3 ; @@ -5041,7 +5041,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean 2 metre dewpoint temperature -'m2d' = { +'avg_2d' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 6 ; @@ -5051,14 +5051,14 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean temperature of snow layer -'mtsn' = { +'avg_tsn' = { discipline = 2 ; parameterCategory = 3 ; parameterNumber = 28 ; typeOfStatisticalProcessing = 0 ; } #Time-mean forecast surface roughness -'mfsr' = { +'avg_fsr' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 1 ; @@ -5066,7 +5066,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean forecast logarithm of surface roughness for heat -'mflsr' = { +'avg_flsr' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 54 ; diff --git a/definitions/grib2/localConcepts/cerise/cfVarName.def b/definitions/grib2/localConcepts/cerise/cfVarName.def index 0ccc6c90f..dfb69cc17 100644 --- a/definitions/grib2/localConcepts/cerise/cfVarName.def +++ b/definitions/grib2/localConcepts/cerise/cfVarName.def @@ -153,7 +153,7 @@ typeOfStatisticalProcessing = 1 ; } #Time-mean snow depth -'msd_m' = { +'avg_sd_m' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 1 ; @@ -161,7 +161,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean low cloud cover -'mlcc_frac' = { +'avg_lcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -169,7 +169,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean medium cloud cover -'mmcc_frac' = { +'avg_mcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -177,7 +177,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean high cloud cover -'mhcc_frac' = { +'avg_hcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -185,7 +185,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean forecast albedo -'mfal_frac' = { +'avg_fal_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 19 ; diff --git a/definitions/grib2/localConcepts/cerise/shortName.def b/definitions/grib2/localConcepts/cerise/shortName.def index 0ccc6c90f..dfb69cc17 100644 --- a/definitions/grib2/localConcepts/cerise/shortName.def +++ b/definitions/grib2/localConcepts/cerise/shortName.def @@ -153,7 +153,7 @@ typeOfStatisticalProcessing = 1 ; } #Time-mean snow depth -'msd_m' = { +'avg_sd_m' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 1 ; @@ -161,7 +161,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean low cloud cover -'mlcc_frac' = { +'avg_lcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -169,7 +169,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean medium cloud cover -'mmcc_frac' = { +'avg_mcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -177,7 +177,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean high cloud cover -'mhcc_frac' = { +'avg_hcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -185,7 +185,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean forecast albedo -'mfal_frac' = { +'avg_fal_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 19 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.def b/definitions/grib2/localConcepts/ecmf/cfVarName.def index 6794b74a6..7efe686a0 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.def @@ -13832,7 +13832,7 @@ typeOfStatisticalProcessing = 1 ; } #Time-mean snow depth -'msd_m' = { +'avg_sd_m' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 1 ; @@ -13840,7 +13840,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean low cloud cover -'mlcc_frac' = { +'avg_lcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -13848,7 +13848,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean medium cloud cover -'mmcc_frac' = { +'avg_mcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -13856,7 +13856,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean high cloud cover -'mhcc_frac' = { +'avg_hcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -13864,7 +13864,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean forecast albedo -'mfal_frac' = { +'avg_fal_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 19 ; diff --git a/definitions/grib2/localConcepts/ecmf/shortName.def b/definitions/grib2/localConcepts/ecmf/shortName.def index b476da6d8..b7e53c29d 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.def @@ -13832,7 +13832,7 @@ typeOfStatisticalProcessing = 1 ; } #Time-mean snow depth -'msd_m' = { +'avg_sd_m' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 1 ; @@ -13840,7 +13840,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean low cloud cover -'mlcc_frac' = { +'avg_lcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -13848,7 +13848,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean medium cloud cover -'mmcc_frac' = { +'avg_mcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -13856,7 +13856,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean high cloud cover -'mhcc_frac' = { +'avg_hcc_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 6 ; @@ -13864,7 +13864,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean forecast albedo -'mfal_frac' = { +'avg_fal_frac' = { localTablesVersion = 1 ; discipline = 0 ; parameterCategory = 19 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index fbecc6945..fb3e581c8 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -4795,28 +4795,28 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean snow density -'mrsn' = { +'avg_rsn' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 61 ; typeOfStatisticalProcessing = 0 ; } #Time-mean low vegetation cover -'mcvl' = { +'avg_cvl' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 53 ; typeOfStatisticalProcessing = 0 ; } #Time-mean high vegetation cover -'mcvh' = { +'avg_cvh' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 54 ; typeOfStatisticalProcessing = 0 ; } #Time-mean sea ice area fraction -'mci' = { +'avg_ci' = { discipline = 10 ; parameterCategory = 2 ; parameterNumber = 0 ; @@ -4824,7 +4824,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean sea surface temperature -'msst' = { +'avg_sst' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 0 ; @@ -4832,21 +4832,21 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean leaf area index, low vegetation -'mlai_lv' = { +'avg_lai_lv' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 55 ; typeOfStatisticalProcessing = 0 ; } #Time-mean leaf area index, high vegetation -'mlai_hv' = { +'avg_lai_hv' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 56 ; typeOfStatisticalProcessing = 0 ; } #Time-mean total column liquid water -'mtclw' = { +'avg_tclw' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 69 ; @@ -4855,7 +4855,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean total column cloud ice water -'mtciw' = { +'avg_tciw' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 70 ; @@ -4864,7 +4864,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean 2 metre specific humidity -'m2sh' = { +'avg_2sh' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 0 ; @@ -4875,7 +4875,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean lake mix-layer temperature -'mlmlt' = { +'avg_lmlt' = { discipline = 1 ; parameterCategory = 2 ; parameterNumber = 1 ; @@ -4884,7 +4884,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean lake mix-layer depth -'mlmld' = { +'avg_lmld' = { discipline = 1 ; parameterCategory = 2 ; parameterNumber = 0 ; @@ -4893,7 +4893,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean 2 metre relative humidity -'m2r' = { +'avg_2r' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 1 ; @@ -4903,70 +4903,70 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean fraction of snow cover -'mfscov' = { +'avg_fscov' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 121 ; typeOfStatisticalProcessing = 0 ; } #Time-mean soil temperature -'msot' = { +'avg_sot' = { discipline = 2 ; parameterCategory = 3 ; parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } #Time-mean snow depth -'msde' = { +'avg_sde' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 11 ; typeOfStatisticalProcessing = 0 ; } #Time-mean snow cover -'msnowc' = { +'avg_snowc' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 42 ; typeOfStatisticalProcessing = 0 ; } #Time-mean geopotential -'mz' = { +'avg_z' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 4 ; typeOfStatisticalProcessing = 0 ; } #Time-mean temperature -'mt' = { +'avg_t' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfStatisticalProcessing = 0 ; } #Time-mean U component of wind -'mu' = { +'avg_u' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 2 ; typeOfStatisticalProcessing = 0 ; } #Time-mean V component of wind -'mv' = { +'avg_v' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 3 ; typeOfStatisticalProcessing = 0 ; } #Time-mean specific humidity -'mq' = { +'avg_q' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 0 ; typeOfStatisticalProcessing = 0 ; } #Time-mean surface pressure -'msp' = { +'avg_sp' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 0 ; @@ -4974,14 +4974,14 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean vertical velocity -'mw' = { +'avg_w' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 8 ; typeOfStatisticalProcessing = 0 ; } #Time-mean total column water -'mtcw' = { +'avg_tcw' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 51 ; @@ -4990,7 +4990,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean total column vertically-integrated water vapour -'mtcwv' = { +'avg_tcwv' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 64 ; @@ -4999,7 +4999,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean mean sea level pressure -'mmsl' = { +'avg_msl' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 0 ; @@ -5007,21 +5007,21 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean relative humidity -'mr' = { +'avg_r' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 1 ; typeOfStatisticalProcessing = 0 ; } #Time-mean boundary layer height -'mblh' = { +'avg_blh' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } #Time-mean 10 metre U wind component -'m10u' = { +'avg_10u' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 2 ; @@ -5031,7 +5031,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean 10 metre V wind component -'m10v' = { +'avg_10v' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 3 ; @@ -5041,7 +5041,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean 2 metre dewpoint temperature -'m2d' = { +'avg_2d' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 6 ; @@ -5051,14 +5051,14 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean temperature of snow layer -'mtsn' = { +'avg_tsn' = { discipline = 2 ; parameterCategory = 3 ; parameterNumber = 28 ; typeOfStatisticalProcessing = 0 ; } #Time-mean forecast surface roughness -'mfsr' = { +'avg_fsr' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 1 ; @@ -5066,7 +5066,7 @@ typeOfStatisticalProcessing = 0 ; } #Time-mean forecast logarithm of surface roughness for heat -'mflsr' = { +'avg_flsr' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 54 ; diff --git a/tests/grib_ecc-1806.sh b/tests/grib_ecc-1806.sh index fcd4684f2..e08f667a6 100755 --- a/tests/grib_ecc-1806.sh +++ b/tests/grib_ecc-1806.sh @@ -42,11 +42,11 @@ test_conversion() test_conversion 174098 262000 sithick test_conversion 151163 262104 t20d test_conversion 151145 262124 zos -test_conversion 130232 235135 mw +test_conversion 130232 235135 avg_w test_conversion 172146 235033 msshf test_conversion 172147 235034 mslhf test_conversion 55 228004 mean2t -test_conversion 56 235168 m2d +test_conversion 56 235168 avg_2d test_conversion 172169 235035 msdwswrf test_conversion 172175 235036 msdwlwrf test_conversion 172176 235037 msnswrf From 0ce9327cb493fb2c197c3d42c799d1e4edd8233e Mon Sep 17 00:00:00 2001 From: Robert Osinski Date: Mon, 13 May 2024 13:17:41 +0000 Subject: [PATCH 146/196] New templates 4.124-127 added --- definitions/grib2/template.4.124.def | 12 +++++++ definitions/grib2/template.4.125.def | 13 ++++++++ definitions/grib2/template.4.126.def | 12 +++++++ definitions/grib2/template.4.127.def | 14 +++++++++ .../grib2/template.4.radionuclides.def | 31 +++++++++++++++++++ 5 files changed, 82 insertions(+) create mode 100644 definitions/grib2/template.4.124.def create mode 100644 definitions/grib2/template.4.125.def create mode 100644 definitions/grib2/template.4.126.def create mode 100644 definitions/grib2/template.4.127.def create mode 100644 definitions/grib2/template.4.radionuclides.def diff --git a/definitions/grib2/template.4.124.def b/definitions/grib2/template.4.124.def new file mode 100644 index 000000000..a3b83980e --- /dev/null +++ b/definitions/grib2/template.4.124.def @@ -0,0 +1,12 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.124, Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for radionuclides + +include "grib2/template.4.parameter.def" +include "grib2/template.4.chemical.def" +include "grib2/template.4.source.def" +include "grib2/template.4.radionuclides.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.125.def b/definitions/grib2/template.4.125.def new file mode 100644 index 000000000..88ebd7894 --- /dev/null +++ b/definitions/grib2/template.4.125.def @@ -0,0 +1,13 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.125, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for radionuclides + +include "grib2/template.4.parameter.def" +include "grib2/template.4.chemical.def" +include "grib2/template.4.source.def" +include "grib2/template.4.radionuclides.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.126.def b/definitions/grib2/template.4.126.def new file mode 100644 index 000000000..fed3fbac1 --- /dev/null +++ b/definitions/grib2/template.4.126.def @@ -0,0 +1,12 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.126, 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 radionuclides + +include "grib2/template.4.parameter.def" +include "grib2/template.4.chemical.def" +include "grib2/template.4.source.def" +include "grib2/template.4.radionuclides.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.127.def b/definitions/grib2/template.4.127.def new file mode 100644 index 000000000..baa754fca --- /dev/null +++ b/definitions/grib2/template.4.127.def @@ -0,0 +1,14 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.127, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides + +include "grib2/template.4.parameter.def" +include "grib2/template.4.chemical.def" +include "grib2/template.4.source.def" +include "grib2/template.4.radionuclides.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" + diff --git a/definitions/grib2/template.4.radionuclides.def b/definitions/grib2/template.4.radionuclides.def new file mode 100644 index 000000000..0e55346ab --- /dev/null +++ b/definitions/grib2/template.4.radionuclides.def @@ -0,0 +1,31 @@ +codetable[2] transportModelUsed ('4.333.table',masterDir,localDir) : edition_specific; + +codetable[2] requestedByEntity 'common/c-11.table' : dump,string_type; + +codetable[2] scenarioOrigin ('4.335.table',masterDir,localDir) : edition_specific; + +codetable[2] NWPused ('4.336.table',masterDir,localDir) : edition_specific; + +unsigned[2] releaseStartYear : edition_specific; + +unsigned[1] releaseStartMonth : edition_specific; + +unsigned[1] releaseStartDay : edition_specific; + +unsigned[1] releaseStartHour : edition_specific; + +unsigned[1] releaseStartMinute : edition_specific; + +unsigned[1] releaseStartSecond : edition_specific; + +unsigned[2] WallClockInitialTimeOfExecutionYear : edition_specific; + +unsigned[1] WallClockInitialTimeOfExecutionMonth : edition_specific; + +unsigned[1] WallClockInitialTimeOfExecutionDay : edition_specific; + +unsigned[1] WallClockInitialTimeOfExecutionHour : edition_specific; + +unsigned[1] WallClockInitialTimeOfExecutionMinute : edition_specific; + +unsigned[1] WallClockInitialTimeOfExecutionSecond : edition_specific; From a46b75d1445ed77e6e89cf020d5502fa305ea0f6 Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 13 May 2024 17:04:12 +0100 Subject: [PATCH 147/196] Definitions: Cleanup --- .../grib2/template.4.focalStatistics.def | 1 + .../grib2/template.4.radionuclides.def | 42 ++++++++----------- .../grib2/template.4.referenceperiod.def | 9 ++-- definitions/grib2/template.4.reforecast.def | 1 + definitions/grib2/template.4.wave.def | 1 + .../grib2/template.4.wave_period_range.def | 1 + .../grib2/template.4.wave_spectra_formula.def | 1 + .../grib2/template.4.wave_spectra_list.def | 2 + 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/definitions/grib2/template.4.focalStatistics.def b/definitions/grib2/template.4.focalStatistics.def index 8aa8d2a33..490919bbc 100644 --- a/definitions/grib2/template.4.focalStatistics.def +++ b/definitions/grib2/template.4.focalStatistics.def @@ -1,3 +1,4 @@ +# (C) Copyright 2005- ECMWF. codetable[1] spatialVicinityType ('4.103.table',masterDir,localDir)=255 ; unsigned[1] numberOfSpatialVicinityValues = 1 : edition_specific; diff --git a/definitions/grib2/template.4.radionuclides.def b/definitions/grib2/template.4.radionuclides.def index 0e55346ab..c51ffa6c1 100644 --- a/definitions/grib2/template.4.radionuclides.def +++ b/definitions/grib2/template.4.radionuclides.def @@ -1,31 +1,23 @@ -codetable[2] transportModelUsed ('4.333.table',masterDir,localDir) : edition_specific; +# (C) Copyright 2005- ECMWF -codetable[2] requestedByEntity 'common/c-11.table' : dump,string_type; - -codetable[2] scenarioOrigin ('4.335.table',masterDir,localDir) : edition_specific; - -codetable[2] NWPused ('4.336.table',masterDir,localDir) : edition_specific; - -unsigned[2] releaseStartYear : edition_specific; - -unsigned[1] releaseStartMonth : edition_specific; - -unsigned[1] releaseStartDay : edition_specific; +codetable[2] transportModelUsed ('4.333.table',masterDir,localDir) = 255 : dump; -unsigned[1] releaseStartHour : edition_specific; - -unsigned[1] releaseStartMinute : edition_specific; - -unsigned[1] releaseStartSecond : edition_specific; - -unsigned[2] WallClockInitialTimeOfExecutionYear : edition_specific; - -unsigned[1] WallClockInitialTimeOfExecutionMonth : edition_specific; +codetable[2] requestedByEntity 'common/c-11.table' : dump,string_type; -unsigned[1] WallClockInitialTimeOfExecutionDay : edition_specific; +codetable[2] scenarioOrigin ('4.335.table',masterDir,localDir) = 255 : dump; -unsigned[1] WallClockInitialTimeOfExecutionHour : edition_specific; +codetable[2] NWPused ('4.336.table',masterDir,localDir) = 255 : dump; -unsigned[1] WallClockInitialTimeOfExecutionMinute : edition_specific; +unsigned[2] releaseStartYear : dump; +unsigned[1] releaseStartMonth : dump; +unsigned[1] releaseStartDay : dump; +unsigned[1] releaseStartHour : dump; +unsigned[1] releaseStartMinute : dump; +unsigned[1] releaseStartSecond : dump; -unsigned[1] WallClockInitialTimeOfExecutionSecond : edition_specific; +unsigned[2] wallClockInitialTimeOfExecutionYear : dump; +unsigned[1] wallClockInitialTimeOfExecutionMonth : dump; +unsigned[1] wallClockInitialTimeOfExecutionDay : dump; +unsigned[1] wallClockInitialTimeOfExecutionHour : dump; +unsigned[1] wallClockInitialTimeOfExecutionMinute : dump; +unsigned[1] wallClockInitialTimeOfExecutionSecond : dump; diff --git a/definitions/grib2/template.4.referenceperiod.def b/definitions/grib2/template.4.referenceperiod.def index 90c05351f..49a45d571 100644 --- a/definitions/grib2/template.4.referenceperiod.def +++ b/definitions/grib2/template.4.referenceperiod.def @@ -1,10 +1,11 @@ -# Type of reference dataset +# (C) Copyright 2005- ECMWF. +# Type of reference dataset codetable[1] typeOfReferenceDataset ('4.100.table',masterDir,localDir) = 255 : dump,edition_specific; -# Type of relation to reference dataset +# Type of relation to reference dataset codetable[1] typeOfRelationToReferenceDataset ('4.101.table',masterDir,localDir) = 255 : dump,edition_specific; -# number of additional parameters +# Number of additional parameters unsigned[1] numberOfAdditionalParametersForReferencePeriod=0 ; additionalParameter list(numberOfAdditionalParametersForReferencePeriod) { @@ -32,7 +33,7 @@ meta startDateOfReferencePeriod g2date(yearOfStartOfReferencePeriod,monthOfStart unsigned[4] sampleSizeOfReferencePeriod = 0; -# n - number of time range specifications describing the time intervals used to calculate the statistically-processed field +# Number of time range specifications describing the time intervals used to calculate the statistically-processed field unsigned[1] numberOfReferencePeriodTimeRanges = 1 : edition_specific; alias nref = numberOfReferencePeriodTimeRanges; diff --git a/definitions/grib2/template.4.reforecast.def b/definitions/grib2/template.4.reforecast.def index f415ce80a..a8a431936 100644 --- a/definitions/grib2/template.4.reforecast.def +++ b/definitions/grib2/template.4.reforecast.def @@ -1,3 +1,4 @@ +# (C) Copyright 2005- ECMWF. # The Model Version Date # This is the date when the reforecast is produced with a particular version of the model diff --git a/definitions/grib2/template.4.wave.def b/definitions/grib2/template.4.wave.def index 37c3f4523..742c0ece4 100644 --- a/definitions/grib2/template.4.wave.def +++ b/definitions/grib2/template.4.wave.def @@ -1,3 +1,4 @@ +# (C) Copyright 2005- ECMWF. # Template for wave parameters ## Direction part diff --git a/definitions/grib2/template.4.wave_period_range.def b/definitions/grib2/template.4.wave_period_range.def index 3bd02fa4f..278ddf689 100644 --- a/definitions/grib2/template.4.wave_period_range.def +++ b/definitions/grib2/template.4.wave_period_range.def @@ -1,3 +1,4 @@ +# (C) Copyright 2005- ECMWF. # Template for wave parameters defined on a certain period range # Type of period interval diff --git a/definitions/grib2/template.4.wave_spectra_formula.def b/definitions/grib2/template.4.wave_spectra_formula.def index c0893da1a..4a5e61fdd 100644 --- a/definitions/grib2/template.4.wave_spectra_formula.def +++ b/definitions/grib2/template.4.wave_spectra_formula.def @@ -1,3 +1,4 @@ +# (C) Copyright 2005- ECMWF. # Template for wave spectra defined using a formula for frequency and direction ## Direction part diff --git a/definitions/grib2/template.4.wave_spectra_list.def b/definitions/grib2/template.4.wave_spectra_list.def index 85fa6fc7d..ca7768604 100644 --- a/definitions/grib2/template.4.wave_spectra_list.def +++ b/definitions/grib2/template.4.wave_spectra_list.def @@ -1,3 +1,5 @@ +# (C) Copyright 2005- ECMWF. + # Template for wave spectra defined using an array of frequencies and directions ## Direction part From 54cb58bf31283864e779c2b40441fc85461ae0e7 Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 14 May 2024 15:52:29 +0100 Subject: [PATCH 148/196] ECC-1706: Definitions: Align WMO Common Code Table 11 with ecCodes c-11 table --- definitions/common/c-11.table | 109 ++++++++++++++++++++++++++++++++-- tests/bufr_extract_headers.sh | 2 +- 2 files changed, 106 insertions(+), 5 deletions(-) diff --git a/definitions/common/c-11.table b/definitions/common/c-11.table index 778001045..6750fda58 100644 --- a/definitions/common/c-11.table +++ b/definitions/common/c-11.table @@ -23,6 +23,7 @@ 22 22 ACMAD 23 23 Mozambique (NMC) 24 fapr Pretoria (RSMC) +25 25 La Reunion (RSMC) 26 26 Khabarovsk (RSMC) 28 vabb New Delhi (IMD) 29 dems New Delhi (NCMRWF) @@ -58,12 +59,14 @@ 64 64 Honolulu 65 65 Darwin (RSMC) 67 67 Melbourne (RSMC) +# 68 Reserved 69 nzkl Wellington (RSMC/RAFC) 71 71 Nadi (RSMC) 72 72 Singapore 73 73 Malaysia (NMC) 74 egrr U.K. Met Office - Exeter 76 76 Moscow (RSMC/RAFC) +# 77 Reserved 78 edzw Offenbach (RSMC) 80 cnmc Rome (RSMC) 82 eswi Norrkoping @@ -93,15 +96,68 @@ 107 107 Uganda (NMC) 108 108 United Republic of Tanzania (NMC) 109 109 Zimbabwe (NMC) -110 110 Hong-Kong +110 110 Hong Kong +111 111 Afghanistan (NMC) +112 112 Bahrain (NMC) +113 113 Bangladesh (NMC) +114 114 Bhutan (NMC) +115 115 Cambodia (NMC) +116 116 Democratic People's Republic of Korea (NMC) +117 117 Islamic Republic of Iran (NMC) +118 118 Iraq (NMC) +119 119 Kazakhstan (NMC) +120 120 Kuwait (NMC) +121 121 Kyrgyzstan (NMC) +122 122 Lao People's Democratic Republic (NMC) +123 123 "Macao China" +124 124 Maldives (NMC) +125 125 Myanmar (NMC) +126 126 Nepal (NMC) +127 127 Oman (NMC) +128 128 Pakistan (NMC) +129 129 Qatar (NMC) +130 130 Yemen (NMC) +131 131 Sri Lanka (NMC) +132 132 Tajikistan (NMC) +133 133 Turkmenistan (NMC) +134 134 United Arab Emirates (NMC) +135 135 Uzbekistan (NMC) +136 136 Viet Nam (NMC) +# 137-139 Reserved for other centres +140 140 Bolivia (Plurinational State of) (NMC) +141 141 Guyana (NMC) +142 142 Paraguay (NMC) +143 143 Suriname (NMC) +144 144 Uruguay (NMC) 145 145 French Guiana 146 146 Brazilian Navy Hydrographic Centre 147 147 National Commission on Space Activities (CONAE) - Argentina 148 148 Brazilian Department of Airspace Control - DECEA +# 149 Reserved for other centres +150 150 Antigua and Barbuda (NMC) +151 151 Bahamas (NMC) +152 152 Barbados (NMC) +153 153 Belize (NMC) +154 154 British Caribbean Territories Centre +155 155 San Jose +156 156 Cuba (NMC) +157 157 Dominica (NMC) +158 158 Dominican Republic (NMC) +159 159 El Salvador (NMC) 160 160 US NOAA/NESDIS 161 161 US NOAA Office of Oceanic and Atmospheric Research +162 162 Guatemala (NMC) +163 163 Haiti (NMC) +164 164 Honduras (NMC) +165 165 Jamaica (NMC) +166 166 Mexico +167 167 Curacao and Sint Maarten (NMC) +168 168 Nicaragua (NMC) +169 169 Panama (NMC) +170 170 Saint Lucia (NMC) +171 171 Trinidad and Tobago (NMC) +172 172 French Departments in RA IV 173 nasa US National Aeronautics and Space Administration (NASA) - 174 174 Integrated Science Data Management/Marine Environmental Data Service (ISDM/MEDS - Canada) 175 175 University Corporation for Atmospheric Research (UCAR) - United States 176 176 Cooperative Institute for Meteorological Satellite Studies (CIMSS) - United States @@ -110,9 +166,23 @@ 179 179 GeoOptics, Inc. 180 180 PlanetiQ 181 181 Atmospheric and Environmental Research (AER) - +# 182-189 Reserved for other centres +190 190 Cook Islands (NMC) +191 191 French Polynesia (NMC) +192 192 Tonga (NMC) +193 193 Vanuatu (NMC) +194 194 Brunei Darussalam (NMC) 195 wiix Indonesia (NMC) +196 196 Kiribati (NMC) +197 197 Federated States of Micronesia (NMC) +198 198 New Caledonia (NMC) +199 199 Niue +200 200 Papua New Guinea (NMC) +201 201 Philippines (NMC) +202 202 Samoa (NMC) +203 203 Solomon Islands (NMC) 204 niwa National Institute of Water and Atmospheric Research (NIWA - New Zealand) +# 205-209 Reserved for other centres 210 210 Frascati (ESA/ESRIN) 211 211 Lannion 212 212 Lisboa @@ -139,18 +209,24 @@ 233 eidb Dublin 234 234 Israel (NMC) 235 ingv INGV +236 236 Latvia (NMC) +237 237 Lebanon (NMC) 238 238 Lithuania (NMC) 239 crfc CERFAX 240 240 Malta (NMC) 241 241 Monaco 242 242 Romania (NMC) +243 243 Syrian Arab Republic (NMC) 244 vuwien VUWien 245 knmi KNMI 246 ifmk IfM-Kiel 247 hadc Hadley Centre +248 248 Montenegro (NMC) +249 249 Barcelona Dust Forecast Center 250 cosmo COnsortium for Small scale MOdelling (COSMO) 251 251 Meteorological Cooperation on Operational NWP (MetCoOp) 252 mpim Max Planck Institute for Meteorology (MPI-M) +253 253 Alfred Wegener Institute (AWI) 254 eums EUMETSAT Operation Centre 255 consensus Consensus 256 256 Angola (NMC) @@ -184,9 +260,10 @@ 284 284 Sierra Leone (NMC) 285 285 Somalia (NMC) 286 286 Sudan (NMC) -287 287 Swaziland (NMC) +287 287 Eswatini (NMC) 288 288 Togo (NMC) 289 289 Zambia (NMC) +290 290 EUMETNET E-Profile 291 anso Alliance of International Science Organizations (Beijing, China) 292 ufz Helmholtz Centre for Environmental Research 293 293 University of Bremen @@ -196,4 +273,28 @@ 297 297 The Nanjing Institute of Environmental Sciences (NIES) 298 298 Dynamic Meteorology Laboratory (LMD) 299 299 The Rutherford Appleton Laboratory (RAL) +300 300 Greek Atomic Energy Commission (Greece) +301 301 United Stated Environmental Protection Agency (USA) +302 302 Autralian Radiation Protection and Nuclear Safety (Australia) +303 303 Authority for Nuclear Safety and Radiation Protection (The Netherlands) +304 304 Autorite de Surete Nucleaire (France) +305 305 Bundesamt für Strahlenschutz (Germany) +306 306 National Commission for Nuclear Activities Control (Romania) +307 307 Consejo de Seguridad Nuclear (Spain) +308 308 Danish Emergency Management Agency (Denmark) +309 309 Norwegian Radiation Protection Agency (Norway) +310 310 Federal Agency for Nuclear Control (Belgium) +311 311 Institute of Radiation Protection and Dosimetry (Brazil) +312 312 National Inspectorate for Nuclear Safety and Radiation Protection (Italy) +313 313 Nuclear Regulatory Authority (Turkiye) +314 314 Nuclear Regulation Authority (Japan) +315 315 Nuclear Regulatory Agency (Bulgaria) +316 316 Ukrainian Radiation Protection Institute (Ukriane) +317 317 Health Canada Radio Protection Bureau (Canada) +318 318 Portuguese Society for Radiation Protection (Portugal) +319 319 Swedish Radiation Safety Authority (Sweden) +320 320 Radiation and Nuclear Safety Authority (Finland) +321 321 State Office for Nuclear Safety (Czechia) +322 322 Nuclear Regulation Authority (Slovakia) +# 323-65534 Reserved for other centres 65535 65535 Missing value diff --git a/tests/bufr_extract_headers.sh b/tests/bufr_extract_headers.sh index 481a5cd2f..4b2b92b08 100755 --- a/tests/bufr_extract_headers.sh +++ b/tests/bufr_extract_headers.sh @@ -64,7 +64,7 @@ r=`${test_dir}/bufr_extract_headers centre ${data_dir}/bufr/israel_observations_ # Check all centres with an abbreviation centre_table=${ECCODES_DEFINITION_PATH}/common/c-11.table -centres=`awk 'NR > 1 {print $2}' < $centre_table` +centres=`awk 'NR > 1 && $1 !~ /#/ {print $2}' < $centre_table` for c in $centres; do ${tools_dir}/bufr_set -s centre=$c $ECCODES_SAMPLES_PATH/BUFR4.tmpl $temp1 r=`${test_dir}/bufr_extract_headers centre $temp1` From b9de295b4b62228cdd6368378e7858145b1dcec4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 May 2024 09:52:37 +0000 Subject: [PATCH 149/196] ECC-1828: GRIB2: Add new FT2024-1 parameters from issue #221 --- definitions/grib2/cfVarName.def | 42 +++++++++++++++++++++++++++++++++ definitions/grib2/name.def | 42 +++++++++++++++++++++++++++++++++ definitions/grib2/paramId.def | 42 +++++++++++++++++++++++++++++++++ definitions/grib2/shortName.def | 42 +++++++++++++++++++++++++++++++++ definitions/grib2/units.def | 42 +++++++++++++++++++++++++++++++++ 5 files changed, 210 insertions(+) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 0893cd19c..d72793b3b 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -7168,6 +7168,48 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Standardised Precipitation Index (SPI) +'spi' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 0 ; + } +#Standardised Precipitation Evapotranspiration Index (SPEI) +'spei' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 1 ; + } +#Standardised Streamflow Index (SSFI) +'ssfi' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 2 ; + } +#Standardised Reservoir Supply Index (SRSI) +'srsi' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 3 ; + } +#Standardised Water-level Index (SWI) +'swi' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 4 ; + } +#Standardised Snowmelt and Rain Index (SMRI) +'smri' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 5 ; + } +#Streamflow Drought Index (SDI) +'sdi' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 6 ; + } #Universal thermal climate index 'utci' = { discipline = 20 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index ad51e0531..a64e2c630 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -7168,6 +7168,48 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Standardised Precipitation Index (SPI) +'Standardised Precipitation Index (SPI)' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 0 ; + } +#Standardised Precipitation Evapotranspiration Index (SPEI) +'Standardised Precipitation Evapotranspiration Index (SPEI)' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 1 ; + } +#Standardised Streamflow Index (SSFI) +'Standardised Streamflow Index (SSFI)' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 2 ; + } +#Standardised Reservoir Supply Index (SRSI) +'Standardised Reservoir Supply Index (SRSI)' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 3 ; + } +#Standardised Water-level Index (SWI) +'Standardised Water-level Index (SWI)' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 4 ; + } +#Standardised Snowmelt and Rain Index (SMRI) +'Standardised Snowmelt and Rain Index (SMRI)' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 5 ; + } +#Streamflow Drought Index (SDI) +'Streamflow Drought Index (SDI)' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 6 ; + } #Universal thermal climate index 'Universal thermal climate index' = { discipline = 20 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index ebd8fa26b..a9f5f256e 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -7168,6 +7168,48 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Standardised Precipitation Index (SPI) +'260658' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 0 ; + } +#Standardised Precipitation Evapotranspiration Index (SPEI) +'260659' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 1 ; + } +#Standardised Streamflow Index (SSFI) +'260660' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 2 ; + } +#Standardised Reservoir Supply Index (SRSI) +'260661' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 3 ; + } +#Standardised Water-level Index (SWI) +'260662' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 4 ; + } +#Standardised Snowmelt and Rain Index (SMRI) +'260663' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 5 ; + } +#Streamflow Drought Index (SDI) +'260664' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 6 ; + } #Universal thermal climate index '261001' = { discipline = 20 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index fb3e581c8..4d68cb57c 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -7168,6 +7168,48 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Standardised Precipitation Index (SPI) +'spi' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 0 ; + } +#Standardised Precipitation Evapotranspiration Index (SPEI) +'spei' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 1 ; + } +#Standardised Streamflow Index (SSFI) +'ssfi' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 2 ; + } +#Standardised Reservoir Supply Index (SRSI) +'srsi' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 3 ; + } +#Standardised Water-level Index (SWI) +'swi' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 4 ; + } +#Standardised Snowmelt and Rain Index (SMRI) +'smri' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 5 ; + } +#Streamflow Drought Index (SDI) +'sdi' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 6 ; + } #Universal thermal climate index 'utci' = { discipline = 20 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index e1ef35857..4a6bde706 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -7168,6 +7168,48 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Standardised Precipitation Index (SPI) +'Numeric' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 0 ; + } +#Standardised Precipitation Evapotranspiration Index (SPEI) +'Numeric' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 1 ; + } +#Standardised Streamflow Index (SSFI) +'Numeric' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 2 ; + } +#Standardised Reservoir Supply Index (SRSI) +'Numeric' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 3 ; + } +#Standardised Water-level Index (SWI) +'Numeric' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 4 ; + } +#Standardised Snowmelt and Rain Index (SMRI) +'Numeric' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 5 ; + } +#Streamflow Drought Index (SDI) +'Numeric' = { + discipline = 0 ; + parameterCategory = 22 ; + parameterNumber = 6 ; + } #Universal thermal climate index 'K' = { discipline = 20 ; From d34b870a595ea0b87a57ea559b3f8fcf3445c0c5 Mon Sep 17 00:00:00 2001 From: Sebastien Villaume Date: Wed, 15 May 2024 11:45:23 +0100 Subject: [PATCH 150/196] ECC-1821 adding configurations for mmsf/an --- definitions/mars/grib.mmsf.an.def | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 definitions/mars/grib.mmsf.an.def diff --git a/definitions/mars/grib.mmsf.an.def b/definitions/mars/grib.mmsf.an.def new file mode 100644 index 000000000..c002f9d76 --- /dev/null +++ b/definitions/mars/grib.mmsf.an.def @@ -0,0 +1,26 @@ +if (levtype is "o2d" || levtype is "o3d") { + alias mars.step = stepRange; +} else { + alias mars.step = endStep; +} + +if (class is "od") { alias mars.system = systemNumber; } +if (class is "me") { alias mars.system = systemNumber; } +if (class is "en") { alias mars.system = systemNumber; } +if (class is "c3") { alias mars.system = systemNumber; } +if (class is "ci") { alias mars.system = systemNumber; } +alias mars.number = perturbationNumber; +alias mars.method = methodNumber; + +if (!(class is "gw")) { # ECC-1448 + alias mars.origin = centre; +} + +# See ECC-624 +if (centre == 80 && subCentre == 98 && class is "c3") { + constant cnmc_cmcc = 'cmcc'; + alias mars.origin = cnmc_cmcc; +} + +if (class is "ci") { unalias mars.method; } + From b8fbaeeb8b4e3f2ada644d62235760396a0f1f36 Mon Sep 17 00:00:00 2001 From: Sebastien Villaume Date: Wed, 15 May 2024 14:48:36 +0100 Subject: [PATCH 151/196] unalias step as type an do not have steps --- definitions/mars/grib.mmsf.an.def | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/definitions/mars/grib.mmsf.an.def b/definitions/mars/grib.mmsf.an.def index c002f9d76..0a489319c 100644 --- a/definitions/mars/grib.mmsf.an.def +++ b/definitions/mars/grib.mmsf.an.def @@ -1,8 +1,5 @@ -if (levtype is "o2d" || levtype is "o3d") { - alias mars.step = stepRange; -} else { - alias mars.step = endStep; -} +#no step in type an +unalias mars.step; if (class is "od") { alias mars.system = systemNumber; } if (class is "me") { alias mars.system = systemNumber; } From 34346119200a1b1546f13fd792559e223727f2fc Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 May 2024 14:15:24 +0000 Subject: [PATCH 152/196] ECC-1827: GRIB2: Add new FT2024-1 parameters from issue #227 (Make 140254 legacy) --- definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def | 6 ++++++ definitions/grib2/localConcepts/ecmf/name.legacy.def | 6 ++++++ definitions/grib2/localConcepts/ecmf/paramId.legacy.def | 6 ++++++ definitions/grib2/localConcepts/ecmf/shortName.legacy.def | 6 ++++++ definitions/grib2/localConcepts/ecmf/units.legacy.def | 6 ++++++ 5 files changed, 30 insertions(+) diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def index c1c9099b5..cb38cc6e2 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def @@ -1771,3 +1771,9 @@ parameterCategory = 172 ; parameterNumber = 212 ; } +#Wave spectral peakedness +'wsp' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 254 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/name.legacy.def b/definitions/grib2/localConcepts/ecmf/name.legacy.def index 7a451911c..28b2586ef 100644 --- a/definitions/grib2/localConcepts/ecmf/name.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/name.legacy.def @@ -1771,3 +1771,9 @@ parameterCategory = 172 ; parameterNumber = 212 ; } +#Wave spectral peakedness +'Wave spectral peakedness' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 254 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def index 4413e87b9..df813254f 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def @@ -1771,3 +1771,9 @@ parameterCategory = 172 ; parameterNumber = 212 ; } +#Wave spectral peakedness +'140254' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 254 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def index 1a5608823..498f6a3c1 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def @@ -1771,3 +1771,9 @@ parameterCategory = 172 ; parameterNumber = 212 ; } +#Wave spectral peakedness +'wsp' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 254 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/units.legacy.def b/definitions/grib2/localConcepts/ecmf/units.legacy.def index b6a28f51b..d7675c4d6 100644 --- a/definitions/grib2/localConcepts/ecmf/units.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/units.legacy.def @@ -1771,3 +1771,9 @@ parameterCategory = 172 ; parameterNumber = 212 ; } +#Wave spectral peakedness +'dimensionless' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 254 ; +} From 2f86e13c7858186a81e6e789591028dc4650c8ae Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 May 2024 14:28:55 +0000 Subject: [PATCH 153/196] ECC-1827: GRIB2: Add new FT2024-1 parameters from issue #227 --- definitions/grib2/cfVarName.def | 48 +++++++++++++++++++ .../grib2/localConcepts/ecmf/cfVarName.def | 6 --- definitions/grib2/localConcepts/ecmf/name.def | 6 --- .../grib2/localConcepts/ecmf/paramId.def | 6 --- .../grib2/localConcepts/ecmf/shortName.def | 6 --- .../grib2/localConcepts/ecmf/units.def | 6 --- definitions/grib2/name.def | 48 +++++++++++++++++++ definitions/grib2/paramId.def | 48 +++++++++++++++++++ definitions/grib2/shortName.def | 48 +++++++++++++++++++ definitions/grib2/units.def | 48 +++++++++++++++++++ 10 files changed, 240 insertions(+), 30 deletions(-) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index d72793b3b..468304658 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -5211,6 +5211,48 @@ parameterCategory = 0 ; parameterNumber = 19 ; } +#Floodplain depth +'flddep' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + } +#Floodplain flooded fraction +'fldffr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + } +#Floodplain flooded area +'fldfar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + } +#River fraction +'rivfr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + } +#River area +'rivar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + } +#Fraction of river coverage plus river related flooding +'rivcffr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + } +#Area of river coverage plus river related flooding +'rivcfar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + } #Latitude 'lat' = { discipline = 0 ; @@ -10602,6 +10644,12 @@ parameterCategory = 0 ; parameterNumber = 44 ; } +#Wave spectral peakedness +'wsp' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 98 ; + } #Skin reservoir content 'srcrea' = { discipline = 2 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.def b/definitions/grib2/localConcepts/ecmf/cfVarName.def index 7efe686a0..e99c871c7 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.def @@ -16607,12 +16607,6 @@ parameterCategory = 140 ; parameterNumber = 250 ; } -#Wave spectral peakedness -'wsp' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 254 ; - } #Indicates a missing value 'p255.140' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/name.def b/definitions/grib2/localConcepts/ecmf/name.def index c5d77647c..e70af2e1b 100644 --- a/definitions/grib2/localConcepts/ecmf/name.def +++ b/definitions/grib2/localConcepts/ecmf/name.def @@ -16607,12 +16607,6 @@ parameterCategory = 140 ; parameterNumber = 250 ; } -#Wave spectral peakedness -'Wave spectral peakedness' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 254 ; - } #Indicates a missing value 'Indicates a missing value' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/paramId.def b/definitions/grib2/localConcepts/ecmf/paramId.def index 12fe43ab4..04d3a8625 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.def @@ -16607,12 +16607,6 @@ parameterCategory = 140 ; parameterNumber = 250 ; } -#Wave spectral peakedness -'140254' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 254 ; - } #Indicates a missing value '140255' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/shortName.def b/definitions/grib2/localConcepts/ecmf/shortName.def index b7e53c29d..dd15a6b74 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.def @@ -16607,12 +16607,6 @@ parameterCategory = 140 ; parameterNumber = 250 ; } -#Wave spectral peakedness -'wsp' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 254 ; - } #Indicates a missing value '~' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/units.def b/definitions/grib2/localConcepts/ecmf/units.def index 1629e52b0..9b73ff42a 100644 --- a/definitions/grib2/localConcepts/ecmf/units.def +++ b/definitions/grib2/localConcepts/ecmf/units.def @@ -16607,12 +16607,6 @@ parameterCategory = 140 ; parameterNumber = 250 ; } -#Wave spectral peakedness -'dimensionless' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 254 ; - } #Indicates a missing value '~' = { discipline = 192 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index a64e2c630..f281ae65d 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -5211,6 +5211,48 @@ parameterCategory = 0 ; parameterNumber = 19 ; } +#Floodplain depth +'Floodplain depth' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + } +#Floodplain flooded fraction +'Floodplain flooded fraction' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + } +#Floodplain flooded area +'Floodplain flooded area' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + } +#River fraction +'River fraction' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + } +#River area +'River area' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + } +#Fraction of river coverage plus river related flooding +'Fraction of river coverage plus river related flooding' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + } +#Area of river coverage plus river related flooding +'Area of river coverage plus river related flooding' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + } #Latitude 'Latitude' = { discipline = 0 ; @@ -10602,6 +10644,12 @@ parameterCategory = 0 ; parameterNumber = 44 ; } +#Wave spectral peakedness +'Wave spectral peakedness' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 98 ; + } #Skin reservoir content 'Skin reservoir content' = { discipline = 2 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index a9f5f256e..7f2556ee7 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -5211,6 +5211,48 @@ parameterCategory = 0 ; parameterNumber = 19 ; } +#Floodplain depth +'240035' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + } +#Floodplain flooded fraction +'240036' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + } +#Floodplain flooded area +'240037' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + } +#River fraction +'240038' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + } +#River area +'240039' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + } +#Fraction of river coverage plus river related flooding +'240040' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + } +#Area of river coverage plus river related flooding +'240041' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + } #Latitude '250001' = { discipline = 0 ; @@ -10602,6 +10644,12 @@ parameterCategory = 0 ; parameterNumber = 44 ; } +#Wave spectral peakedness +'140254' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 98 ; + } #Skin reservoir content '160198' = { discipline = 2 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 4d68cb57c..18e2dc8a7 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -5211,6 +5211,48 @@ parameterCategory = 0 ; parameterNumber = 19 ; } +#Floodplain depth +'flddep' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + } +#Floodplain flooded fraction +'fldffr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + } +#Floodplain flooded area +'fldfar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + } +#River fraction +'rivfr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + } +#River area +'rivar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + } +#Fraction of river coverage plus river related flooding +'rivcffr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + } +#Area of river coverage plus river related flooding +'rivcfar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + } #Latitude 'lat' = { discipline = 0 ; @@ -10602,6 +10644,12 @@ parameterCategory = 0 ; parameterNumber = 44 ; } +#Wave spectral peakedness +'wsp' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 98 ; + } #Skin reservoir content 'srcrea' = { discipline = 2 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 4a6bde706..6aaba2634 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -5211,6 +5211,48 @@ parameterCategory = 0 ; parameterNumber = 19 ; } +#Floodplain depth +'m' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + } +#Floodplain flooded fraction +'Proportion' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + } +#Floodplain flooded area +'m**2' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + } +#River fraction +'Proportion' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + } +#River area +'m**2' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + } +#Fraction of river coverage plus river related flooding +'Proportion' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + } +#Area of river coverage plus river related flooding +'m**2' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + } #Latitude 'Degree N' = { discipline = 0 ; @@ -10602,6 +10644,12 @@ parameterCategory = 0 ; parameterNumber = 44 ; } +#Wave spectral peakedness +'dimensionless' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 98 ; + } #Skin reservoir content 'kg m**-2' = { discipline = 2 ; From bfd47cf18b739dc40cd300efc079767c0e771452 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 16 May 2024 14:48:05 +0100 Subject: [PATCH 154/196] ECC-782: Multi-field GRIB: crash in grib_handle_new_from_file_multi --- src/grib_handle.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/grib_handle.cc b/src/grib_handle.cc index 1bbcef4ae..a1801650a 100644 --- a/src/grib_handle.cc +++ b/src/grib_handle.cc @@ -637,7 +637,6 @@ static grib_handle* grib_handle_new_multi(grib_context* c, unsigned char** data, while (grib2_get_next_section((unsigned char*)message, olen, &secbegin, &seclen, &secnum, &err)) { // seccount++; /*printf(" - %d - section %d length=%d\n",(int)seccount,(int)secnum,(int)seclen);*/ - gm->sections[secnum] = secbegin; gm->sections_length[secnum] = seclen; @@ -686,6 +685,11 @@ static grib_handle* grib_handle_new_multi(grib_context* c, unsigned char** data, break; } } + // ECC-782 + if (err == GRIB_INVALID_SECTION_NUMBER) { + grib_context_log(c, GRIB_LOG_ERROR, "%s: Failed to get section info (%s)", __func__, grib_get_error_message(err)); + return NULL; + } } else if (edition == 3) { *error = GRIB_UNSUPPORTED_EDITION; @@ -840,6 +844,11 @@ static grib_handle* grib_handle_new_from_file_multi(grib_context* c, FILE* f, in break; } } + // ECC-782 + if (err == GRIB_INVALID_SECTION_NUMBER) { + grib_context_log(c, GRIB_LOG_ERROR, "%s: Failed to get section info (%s)", __func__, grib_get_error_message(err)); + return NULL; + } } else if (edition == 3) { /* GRIB3: Multi-field mode not yet supported */ From dfdb16b3377abfc179cf10d693ee9691429ca970 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Wed, 15 May 2024 09:51:39 +0000 Subject: [PATCH 155/196] ECC-1829: Added oper pf by combining oper.fc and enfo.pf. --- definitions/mars/grib.oper.pf.def | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 definitions/mars/grib.oper.pf.def diff --git a/definitions/mars/grib.oper.pf.def b/definitions/mars/grib.oper.pf.def new file mode 100644 index 000000000..48f64b0d4 --- /dev/null +++ b/definitions/mars/grib.oper.pf.def @@ -0,0 +1,7 @@ +if (levtype is "o2d" || levtype is "o3d") { + alias mars.step = stepRange; +} else { + alias mars.step = endStep; +} + +alias mars.number = perturbationNumber; \ No newline at end of file From 6882914944a7d392f2c60e695697ffc13118ca0d Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Wed, 15 May 2024 10:56:08 +0000 Subject: [PATCH 156/196] ECC-1829: Test for introduction of grib.oper.pf.def. --- tests/CMakeLists.txt | 1 + tests/grib_ecc-1829.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 tests/grib_ecc-1829.sh diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ac0f133de..71116ab24 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -148,6 +148,7 @@ if( HAVE_BUILD_TOOLS ) grib_ecc-1691 grib_ecc-1766 grib_ecc-1806 + grib_ecc-1829 bufr_ecc-1028 bufr_ecc-1195 bufr_ecc-1259 diff --git a/tests/grib_ecc-1829.sh b/tests/grib_ecc-1829.sh new file mode 100755 index 000000000..971660a71 --- /dev/null +++ b/tests/grib_ecc-1829.sh @@ -0,0 +1,38 @@ +#!/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 + +REDIRECT=/dev/null + +# ECC-1829: Add MARS support for stream & type combinations required for AIFS ensemble + +label="grib_ecc-1829_test" +temp_grib=temp.$label.grib +mars_sample=temp.$label.mars.grib +sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + +# Setup ensemble GRIB2 message with MARS keys +${tools_dir}/grib_set -s setLocalDefinition=1,grib2LocalSectionNumber=1 $sample_grib2 $mars_sample + +# Set ensemble related keys and check number key is present +${tools_dir}/grib_set -s productDefinitionTemplateNumber=1,stream=oper,type=pf $mars_sample $temp_grib +grib_check_key_exists $temp_grib mars.number + +# Now check stepRange is used for mars.step for o2d and o3d fields, and that number is still present +${tools_dir}/grib_set -s productDefinitionTemplateNumber=11,stream=oper,type=pf,param=263101,typeOfLevel=oceanSurface,startStep=0,endStep=6 $mars_sample $temp_grib +grib_check_key_exists $temp_grib mars.number +grib_check_key_equals $temp_grib "step" "0-6" +${tools_dir}/grib_set -s productDefinitionTemplateNumber=11,stream=oper,type=pf,param=263501,typeOfLevel=oceanModel,level=1,startStep=0,endStep=6 $mars_sample $temp_grib +grib_check_key_exists $temp_grib mars.number +grib_check_key_equals $temp_grib "step" "0-6" + +# Clean up +rm -f $temp_grib $mars_sample From cf2a975b311e3cfe265b4c080b1d8b90353acffa Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 16 May 2024 15:03:51 +0000 Subject: [PATCH 157/196] ECC-1829: Added efi, es and em types to oper stream plus added to test Remaining to decide is behaviour between using endStep vs. using stepRange consistently and consequences. --- definitions/mars/grib.oper.efi.def | 1 + definitions/mars/grib.oper.em.def | 1 + definitions/mars/grib.oper.es.def | 1 + tests/grib_ecc-1829.sh | 24 ++++++++++++++++++------ 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 definitions/mars/grib.oper.efi.def create mode 100644 definitions/mars/grib.oper.em.def create mode 100644 definitions/mars/grib.oper.es.def diff --git a/definitions/mars/grib.oper.efi.def b/definitions/mars/grib.oper.efi.def new file mode 100644 index 000000000..a4cef5d68 --- /dev/null +++ b/definitions/mars/grib.oper.efi.def @@ -0,0 +1 @@ +alias mars.step = stepRange; diff --git a/definitions/mars/grib.oper.em.def b/definitions/mars/grib.oper.em.def new file mode 100644 index 000000000..a4cef5d68 --- /dev/null +++ b/definitions/mars/grib.oper.em.def @@ -0,0 +1 @@ +alias mars.step = stepRange; diff --git a/definitions/mars/grib.oper.es.def b/definitions/mars/grib.oper.es.def new file mode 100644 index 000000000..a4cef5d68 --- /dev/null +++ b/definitions/mars/grib.oper.es.def @@ -0,0 +1 @@ +alias mars.step = stepRange; diff --git a/tests/grib_ecc-1829.sh b/tests/grib_ecc-1829.sh index 971660a71..9e075e6b8 100755 --- a/tests/grib_ecc-1829.sh +++ b/tests/grib_ecc-1829.sh @@ -19,20 +19,32 @@ temp_grib=temp.$label.grib mars_sample=temp.$label.mars.grib sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl -# Setup ensemble GRIB2 message with MARS keys +# Setup GRIB2 message with MARS keys ${tools_dir}/grib_set -s setLocalDefinition=1,grib2LocalSectionNumber=1 $sample_grib2 $mars_sample -# Set ensemble related keys and check number key is present -${tools_dir}/grib_set -s productDefinitionTemplateNumber=1,stream=oper,type=pf $mars_sample $temp_grib +# Now set ensemble related keys and check number key is present +${tools_dir}/grib_set -s stream=oper,type=pf,productDefinitionTemplateNumber=1 $mars_sample $temp_grib grib_check_key_exists $temp_grib mars.number -# Now check stepRange is used for mars.step for o2d and o3d fields, and that number is still present -${tools_dir}/grib_set -s productDefinitionTemplateNumber=11,stream=oper,type=pf,param=263101,typeOfLevel=oceanSurface,startStep=0,endStep=6 $mars_sample $temp_grib +# Now set keys and check stepRange is used for mars.step for o2d and o3d fields, and that number is still present +${tools_dir}/grib_set -s stream=oper,type=pf,productDefinitionTemplateNumber=11,param=263101,typeOfLevel=oceanSurface,startStep=0,endStep=6 $mars_sample $temp_grib grib_check_key_exists $temp_grib mars.number grib_check_key_equals $temp_grib "step" "0-6" -${tools_dir}/grib_set -s productDefinitionTemplateNumber=11,stream=oper,type=pf,param=263501,typeOfLevel=oceanModel,level=1,startStep=0,endStep=6 $mars_sample $temp_grib +${tools_dir}/grib_set -s stream=oper,type=pf,productDefinitionTemplateNumber=11,param=263501,typeOfLevel=oceanModel,level=1,startStep=0,endStep=6 $mars_sample $temp_grib grib_check_key_exists $temp_grib mars.number grib_check_key_equals $temp_grib "step" "0-6" +# Now set keys and check stepRange is used for type efi data (just need any template with stat proc keys) +${tools_dir}/grib_set -s stream=oper,type=efi,productDefinitionTemplateNumber=12,startStep=0,endStep=6 $mars_sample $temp_grib +grib_check_key_equals $temp_grib "step" "0-6" + +# Now set keys and check stepRange is used for type em data +${tools_dir}/grib_set -s stream=oper,type=em,productDefinitionTemplateNumber=12,startStep=0,endStep=6 $mars_sample $temp_grib +grib_check_key_equals $temp_grib "step" "0-6" + +# Now set keys and check stepRange is used for type es data +${tools_dir}/grib_set -s stream=oper,type=es,productDefinitionTemplateNumber=12,startStep=0,endStep=6 $mars_sample $temp_grib +grib_check_key_equals $temp_grib "step" "0-6" + # Clean up rm -f $temp_grib $mars_sample From b066a1a5c35e521f89a238ebdfd4dba57c07fa20 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 17 May 2024 09:54:45 +0000 Subject: [PATCH 158/196] ECC-1826: GRIB2: Add time-mean versions of hydro dis / swi parameters --- definitions/grib2/cfVarName.def | 54 ++++++++++++------- .../grib2/localConcepts/hydro/cfVarName.def | 20 +++++++ .../grib2/localConcepts/hydro/name.def | 20 +++++++ .../grib2/localConcepts/hydro/paramId.def | 20 +++++++ .../grib2/localConcepts/hydro/shortName.def | 20 +++++++ .../grib2/localConcepts/hydro/units.def | 20 +++++++ definitions/grib2/name.def | 54 ++++++++++++------- definitions/grib2/paramId.def | 54 ++++++++++++------- definitions/grib2/shortName.def | 54 ++++++++++++------- definitions/grib2/units.def | 54 ++++++++++++------- 10 files changed, 270 insertions(+), 100 deletions(-) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 468304658..79e815ce2 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -5073,6 +5073,40 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean discharge from rivers or streams +'avg_dis' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index (total layer) +'avg_swit' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 151 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index (root zone) +'avg_swir' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 167 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index(layer) +'avg_swil' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 151 ; + typeOfSecondFixedSurface = 151 ; + typeOfStatisticalProcessing = 0 ; + } #Cross sectional area of flow in channel 'chcross' = { discipline = 1 ; @@ -5139,26 +5173,6 @@ parameterCategory = 0 ; parameterNumber = 15 ; } -#Mean discharge in the last 6 hours -'dis06' = { - discipline = 1 ; - parameterCategory = 0 ; - parameterNumber = 7 ; - typeOfFirstFixedSurface = 1 ; - indicatorOfUnitForTimeRange = 1 ; - typeOfStatisticalProcessing = 0 ; - lengthOfTimeRange = 6 ; - } -#Mean discharge in the last 24 hours -'dis24' = { - discipline = 1 ; - parameterCategory = 0 ; - parameterNumber = 7 ; - typeOfFirstFixedSurface = 1 ; - indicatorOfUnitForTimeRange = 1 ; - typeOfStatisticalProcessing = 0 ; - lengthOfTimeRange = 24 ; - } #Snow depth at elevation bands 'sd_elev' = { discipline = 2 ; diff --git a/definitions/grib2/localConcepts/hydro/cfVarName.def b/definitions/grib2/localConcepts/hydro/cfVarName.def index 19b565498..a0f1b1f69 100644 --- a/definitions/grib2/localConcepts/hydro/cfVarName.def +++ b/definitions/grib2/localConcepts/hydro/cfVarName.def @@ -1,4 +1,24 @@ # Automatically generated by ./create_def.pl, do not edit +#Mean discharge in the last 6 hours +'dis06' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfFirstFixedSurface = 1 ; + indicatorOfUnitForTimeRange = 1 ; + typeOfStatisticalProcessing = 0 ; + lengthOfTimeRange = 6 ; + } +#Mean discharge in the last 24 hours +'dis24' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfFirstFixedSurface = 1 ; + indicatorOfUnitForTimeRange = 1 ; + typeOfStatisticalProcessing = 0 ; + lengthOfTimeRange = 24 ; + } #Total precipitation in the last 6 hours 'tp06' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/hydro/name.def b/definitions/grib2/localConcepts/hydro/name.def index 5390805f1..8becdbb9b 100644 --- a/definitions/grib2/localConcepts/hydro/name.def +++ b/definitions/grib2/localConcepts/hydro/name.def @@ -1,4 +1,24 @@ # Automatically generated by ./create_def.pl, do not edit +#Mean discharge in the last 6 hours +'Mean discharge in the last 6 hours' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfFirstFixedSurface = 1 ; + indicatorOfUnitForTimeRange = 1 ; + typeOfStatisticalProcessing = 0 ; + lengthOfTimeRange = 6 ; + } +#Mean discharge in the last 24 hours +'Mean discharge in the last 24 hours' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfFirstFixedSurface = 1 ; + indicatorOfUnitForTimeRange = 1 ; + typeOfStatisticalProcessing = 0 ; + lengthOfTimeRange = 24 ; + } #Total precipitation in the last 6 hours 'Total precipitation in the last 6 hours' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/hydro/paramId.def b/definitions/grib2/localConcepts/hydro/paramId.def index dfd704793..6f29e63ed 100644 --- a/definitions/grib2/localConcepts/hydro/paramId.def +++ b/definitions/grib2/localConcepts/hydro/paramId.def @@ -1,4 +1,24 @@ # Automatically generated by ./create_def.pl, do not edit +#Mean discharge in the last 6 hours +'240023' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfFirstFixedSurface = 1 ; + indicatorOfUnitForTimeRange = 1 ; + typeOfStatisticalProcessing = 0 ; + lengthOfTimeRange = 6 ; + } +#Mean discharge in the last 24 hours +'240024' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfFirstFixedSurface = 1 ; + indicatorOfUnitForTimeRange = 1 ; + typeOfStatisticalProcessing = 0 ; + lengthOfTimeRange = 24 ; + } #Total precipitation in the last 6 hours '260267' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/hydro/shortName.def b/definitions/grib2/localConcepts/hydro/shortName.def index 19b565498..a0f1b1f69 100644 --- a/definitions/grib2/localConcepts/hydro/shortName.def +++ b/definitions/grib2/localConcepts/hydro/shortName.def @@ -1,4 +1,24 @@ # Automatically generated by ./create_def.pl, do not edit +#Mean discharge in the last 6 hours +'dis06' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfFirstFixedSurface = 1 ; + indicatorOfUnitForTimeRange = 1 ; + typeOfStatisticalProcessing = 0 ; + lengthOfTimeRange = 6 ; + } +#Mean discharge in the last 24 hours +'dis24' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfFirstFixedSurface = 1 ; + indicatorOfUnitForTimeRange = 1 ; + typeOfStatisticalProcessing = 0 ; + lengthOfTimeRange = 24 ; + } #Total precipitation in the last 6 hours 'tp06' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/hydro/units.def b/definitions/grib2/localConcepts/hydro/units.def index 60d462f2d..11078673a 100644 --- a/definitions/grib2/localConcepts/hydro/units.def +++ b/definitions/grib2/localConcepts/hydro/units.def @@ -1,4 +1,24 @@ # Automatically generated by ./create_def.pl, do not edit +#Mean discharge in the last 6 hours +'m**3 s**-1' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfFirstFixedSurface = 1 ; + indicatorOfUnitForTimeRange = 1 ; + typeOfStatisticalProcessing = 0 ; + lengthOfTimeRange = 6 ; + } +#Mean discharge in the last 24 hours +'m**3 s**-1' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfFirstFixedSurface = 1 ; + indicatorOfUnitForTimeRange = 1 ; + typeOfStatisticalProcessing = 0 ; + lengthOfTimeRange = 24 ; + } #Total precipitation in the last 6 hours 'kg m**-2' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index f281ae65d..3c0160a0a 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -5073,6 +5073,40 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean discharge from rivers or streams +'Time-mean discharge from rivers or streams' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index (total layer) +'Time-mean soil wetness index (total layer)' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 151 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index (root zone) +'Time-mean soil wetness index (root zone)' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 167 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index(layer) +'Time-mean soil wetness index(layer)' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 151 ; + typeOfSecondFixedSurface = 151 ; + typeOfStatisticalProcessing = 0 ; + } #Cross sectional area of flow in channel 'Cross sectional area of flow in channel' = { discipline = 1 ; @@ -5139,26 +5173,6 @@ parameterCategory = 0 ; parameterNumber = 15 ; } -#Mean discharge in the last 6 hours -'Mean discharge in the last 6 hours' = { - discipline = 1 ; - parameterCategory = 0 ; - parameterNumber = 7 ; - typeOfFirstFixedSurface = 1 ; - indicatorOfUnitForTimeRange = 1 ; - typeOfStatisticalProcessing = 0 ; - lengthOfTimeRange = 6 ; - } -#Mean discharge in the last 24 hours -'Mean discharge in the last 24 hours' = { - discipline = 1 ; - parameterCategory = 0 ; - parameterNumber = 7 ; - typeOfFirstFixedSurface = 1 ; - indicatorOfUnitForTimeRange = 1 ; - typeOfStatisticalProcessing = 0 ; - lengthOfTimeRange = 24 ; - } #Snow depth at elevation bands 'Snow depth at elevation bands' = { discipline = 2 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 7f2556ee7..b8bd59db2 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -5073,6 +5073,40 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean discharge from rivers or streams +'235270' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index (total layer) +'235271' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 151 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index (root zone) +'235272' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 167 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index(layer) +'235273' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 151 ; + typeOfSecondFixedSurface = 151 ; + typeOfStatisticalProcessing = 0 ; + } #Cross sectional area of flow in channel '240011' = { discipline = 1 ; @@ -5139,26 +5173,6 @@ parameterCategory = 0 ; parameterNumber = 15 ; } -#Mean discharge in the last 6 hours -'240023' = { - discipline = 1 ; - parameterCategory = 0 ; - parameterNumber = 7 ; - typeOfFirstFixedSurface = 1 ; - indicatorOfUnitForTimeRange = 1 ; - typeOfStatisticalProcessing = 0 ; - lengthOfTimeRange = 6 ; - } -#Mean discharge in the last 24 hours -'240024' = { - discipline = 1 ; - parameterCategory = 0 ; - parameterNumber = 7 ; - typeOfFirstFixedSurface = 1 ; - indicatorOfUnitForTimeRange = 1 ; - typeOfStatisticalProcessing = 0 ; - lengthOfTimeRange = 24 ; - } #Snow depth at elevation bands '240026' = { discipline = 2 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 18e2dc8a7..bc55e8f9a 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -5073,6 +5073,40 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean discharge from rivers or streams +'avg_dis' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index (total layer) +'avg_swit' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 151 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index (root zone) +'avg_swir' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 167 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index(layer) +'avg_swil' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 151 ; + typeOfSecondFixedSurface = 151 ; + typeOfStatisticalProcessing = 0 ; + } #Cross sectional area of flow in channel 'chcross' = { discipline = 1 ; @@ -5139,26 +5173,6 @@ parameterCategory = 0 ; parameterNumber = 15 ; } -#Mean discharge in the last 6 hours -'dis06' = { - discipline = 1 ; - parameterCategory = 0 ; - parameterNumber = 7 ; - typeOfFirstFixedSurface = 1 ; - indicatorOfUnitForTimeRange = 1 ; - typeOfStatisticalProcessing = 0 ; - lengthOfTimeRange = 6 ; - } -#Mean discharge in the last 24 hours -'dis24' = { - discipline = 1 ; - parameterCategory = 0 ; - parameterNumber = 7 ; - typeOfFirstFixedSurface = 1 ; - indicatorOfUnitForTimeRange = 1 ; - typeOfStatisticalProcessing = 0 ; - lengthOfTimeRange = 24 ; - } #Snow depth at elevation bands 'sd_elev' = { discipline = 2 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 6aaba2634..00797338a 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -5073,6 +5073,40 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean discharge from rivers or streams +'m**3 s**-1' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 7 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index (total layer) +'Numeric' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 151 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index (root zone) +'Numeric' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 167 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean soil wetness index(layer) +'Numeric' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 151 ; + typeOfSecondFixedSurface = 151 ; + typeOfStatisticalProcessing = 0 ; + } #Cross sectional area of flow in channel 'm**2' = { discipline = 1 ; @@ -5139,26 +5173,6 @@ parameterCategory = 0 ; parameterNumber = 15 ; } -#Mean discharge in the last 6 hours -'m**3 s**-1' = { - discipline = 1 ; - parameterCategory = 0 ; - parameterNumber = 7 ; - typeOfFirstFixedSurface = 1 ; - indicatorOfUnitForTimeRange = 1 ; - typeOfStatisticalProcessing = 0 ; - lengthOfTimeRange = 6 ; - } -#Mean discharge in the last 24 hours -'m**3 s**-1' = { - discipline = 1 ; - parameterCategory = 0 ; - parameterNumber = 7 ; - typeOfFirstFixedSurface = 1 ; - indicatorOfUnitForTimeRange = 1 ; - typeOfStatisticalProcessing = 0 ; - lengthOfTimeRange = 24 ; - } #Snow depth at elevation bands 'kg m**-2' = { discipline = 2 ; From 1fdd7195c5893ec0126f9873b675f451dcc829c0 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 17 May 2024 11:04:34 +0000 Subject: [PATCH 159/196] ECC-1825: GRIB2: Add remaining time-mean parameter encodings related to ERA pseudo-centre --- definitions/grib2/cfVarName.def | 77 ++++++++++++++++ .../grib2/localConcepts/ecmf/cfVarName.def | 8 ++ definitions/grib2/localConcepts/ecmf/name.def | 8 ++ .../grib2/localConcepts/ecmf/paramId.def | 8 ++ .../grib2/localConcepts/ecmf/shortName.def | 8 ++ .../grib2/localConcepts/ecmf/units.def | 8 ++ .../grib2/localConcepts/era/cfName.def | 21 +++++ definitions/grib2/localConcepts/era/name.def | 92 +++++++++++++++++++ .../grib2/localConcepts/era/paramId.def | 92 +++++++++++++++++++ .../grib2/localConcepts/era/shortName.def | 92 +++++++++++++++++++ definitions/grib2/localConcepts/era/units.def | 92 +++++++++++++++++++ definitions/grib2/localConcepts/era6/name.def | 8 ++ .../grib2/localConcepts/era6/paramId.def | 8 ++ .../grib2/localConcepts/era6/shortName.def | 8 ++ .../grib2/localConcepts/era6/units.def | 8 ++ .../grib2/localConcepts/uerra/cfVarName.def | 35 +++++++ .../grib2/localConcepts/uerra/name.def | 35 +++++++ .../grib2/localConcepts/uerra/paramId.def | 35 +++++++ .../grib2/localConcepts/uerra/shortName.def | 35 +++++++ .../grib2/localConcepts/uerra/units.def | 35 +++++++ definitions/grib2/name.def | 77 ++++++++++++++++ definitions/grib2/paramId.def | 77 ++++++++++++++++ definitions/grib2/shortName.def | 77 ++++++++++++++++ definitions/grib2/units.def | 77 ++++++++++++++++ 24 files changed, 1021 insertions(+) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 79e815ce2..3e0b0f0f4 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -4930,6 +4930,27 @@ parameterNumber = 42 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific rain water content +'avg_crwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean specific snow water content +'avg_cswc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eta-coordinate vertical velocity +'avg_etadot' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean geopotential 'avg_z' = { discipline = 0 ; @@ -4998,6 +5019,13 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean vorticity (relative) +'avg_vo' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 12 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean mean sea level pressure 'avg_msl' = { discipline = 0 ; @@ -5006,6 +5034,13 @@ typeOfFirstFixedSurface = 101 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean divergence +'avg_d' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean relative humidity 'avg_r' = { discipline = 0 ; @@ -5050,6 +5085,13 @@ scaleFactorOfFirstFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean ozone mass mixing ratio +'avg_o3' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean temperature of snow layer 'avg_tsn' = { discipline = 2 ; @@ -5073,6 +5115,41 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific cloud liquid water content +'avg_clwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean specific cloud ice water content +'avg_ciwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fraction of cloud cover +'avg_cc' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean K index +'avg_kx' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total totals index +'avg_totalx' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean discharge from rivers or streams 'avg_dis' = { discipline = 1 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.def b/definitions/grib2/localConcepts/ecmf/cfVarName.def index e99c871c7..957489177 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.def @@ -13839,6 +13839,14 @@ parameterNumber = 254 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean logarithm of surface pressure +'avg_lnsp' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean low cloud cover 'avg_lcc_frac' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/ecmf/name.def b/definitions/grib2/localConcepts/ecmf/name.def index e70af2e1b..2f7444e2a 100644 --- a/definitions/grib2/localConcepts/ecmf/name.def +++ b/definitions/grib2/localConcepts/ecmf/name.def @@ -13839,6 +13839,14 @@ parameterNumber = 254 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean logarithm of surface pressure +'Time-mean logarithm of surface pressure' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean low cloud cover 'Time-mean low cloud cover' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/ecmf/paramId.def b/definitions/grib2/localConcepts/ecmf/paramId.def index 04d3a8625..109f9f001 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.def @@ -13839,6 +13839,14 @@ parameterNumber = 254 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean logarithm of surface pressure +'235152' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean low cloud cover '235186' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/ecmf/shortName.def b/definitions/grib2/localConcepts/ecmf/shortName.def index dd15a6b74..0c36a8dd0 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.def @@ -13839,6 +13839,14 @@ parameterNumber = 254 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean logarithm of surface pressure +'avg_lnsp' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean low cloud cover 'avg_lcc_frac' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/ecmf/units.def b/definitions/grib2/localConcepts/ecmf/units.def index 9b73ff42a..8a166eaa4 100644 --- a/definitions/grib2/localConcepts/ecmf/units.def +++ b/definitions/grib2/localConcepts/ecmf/units.def @@ -13839,6 +13839,14 @@ parameterNumber = 254 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean logarithm of surface pressure +'Numeric' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean low cloud cover '(0 - 1)' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/era/cfName.def b/definitions/grib2/localConcepts/era/cfName.def index f4a8abea5..8292efdd2 100644 --- a/definitions/grib2/localConcepts/era/cfName.def +++ b/definitions/grib2/localConcepts/era/cfName.def @@ -27,6 +27,27 @@ parameterNumber = 8 ; typeOfStatisticalProcessing = 0 ; } +#Vorticity (relative) +'atmosphere_relative_vorticity' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 12 ; + typeOfStatisticalProcessing = 0 ; + } +#Divergence +'divergence_of_wind' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfStatisticalProcessing = 0 ; + } +#Ozone mass mixing ratio +'mass_fraction_of_ozone_in_air' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Snow depth 'lwe_thickness_of_surface_snow_amount' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/era/name.def b/definitions/grib2/localConcepts/era/name.def index 78a476de6..82944f3b2 100644 --- a/definitions/grib2/localConcepts/era/name.def +++ b/definitions/grib2/localConcepts/era/name.def @@ -1,4 +1,25 @@ # Automatically generated by ./create_def.pl, do not edit +#Specific rain water content +'Specific rain water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific snow water content +'Specific snow water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } +#Eta-coordinate vertical velocity +'Eta-coordinate vertical velocity' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } #Geopotential 'Geopotential' = { discipline = 0 ; @@ -27,12 +48,62 @@ parameterNumber = 8 ; typeOfStatisticalProcessing = 0 ; } +#Vorticity (relative) +'Vorticity (relative)' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 12 ; + typeOfStatisticalProcessing = 0 ; + } +#Logarithm of surface pressure +'Logarithm of surface pressure' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + } #Logarithm of surface pressure 'Logarithm of surface pressure' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 25 ; typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; + } +#Divergence +'Divergence' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfStatisticalProcessing = 0 ; + } +#Ozone mass mixing ratio +'Ozone mass mixing ratio' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud liquid water content +'Specific cloud liquid water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud ice water content +'Specific cloud ice water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } +#Fraction of cloud cover +'Fraction of cloud cover' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; } #Temperature difference 'Temperature difference' = { @@ -479,6 +550,13 @@ parameterCategory = 228 ; parameterNumber = 103 ; } +#Precipitation type +'Precipitation type' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } #Snow cover 'Snow cover' = { discipline = 0 ; @@ -486,6 +564,20 @@ parameterNumber = 42 ; typeOfStatisticalProcessing = 0 ; } +#K index +'K index' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Total totals index +'Total totals index' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } #Sea water potential temperature 'Sea water potential temperature' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/era/paramId.def b/definitions/grib2/localConcepts/era/paramId.def index 31219cfa9..b4c978e14 100644 --- a/definitions/grib2/localConcepts/era/paramId.def +++ b/definitions/grib2/localConcepts/era/paramId.def @@ -1,4 +1,25 @@ # Automatically generated by ./create_def.pl, do not edit +#Specific rain water content +'75' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific snow water content +'76' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } +#Eta-coordinate vertical velocity +'77' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } #Geopotential '129' = { discipline = 0 ; @@ -27,12 +48,62 @@ parameterNumber = 8 ; typeOfStatisticalProcessing = 0 ; } +#Vorticity (relative) +'138' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 12 ; + typeOfStatisticalProcessing = 0 ; + } +#Logarithm of surface pressure +'152' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + } #Logarithm of surface pressure '152' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 25 ; typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; + } +#Divergence +'155' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfStatisticalProcessing = 0 ; + } +#Ozone mass mixing ratio +'203' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud liquid water content +'246' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud ice water content +'247' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } +#Fraction of cloud cover +'248' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; } #Temperature difference '200130' = { @@ -479,6 +550,13 @@ parameterCategory = 228 ; parameterNumber = 103 ; } +#Precipitation type +'260015' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } #Snow cover '260038' = { discipline = 0 ; @@ -486,6 +564,20 @@ parameterNumber = 42 ; typeOfStatisticalProcessing = 0 ; } +#K index +'260121' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Total totals index +'260123' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } #Sea water potential temperature '151129' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/era/shortName.def b/definitions/grib2/localConcepts/era/shortName.def index beb0f3d79..088ae3b62 100644 --- a/definitions/grib2/localConcepts/era/shortName.def +++ b/definitions/grib2/localConcepts/era/shortName.def @@ -1,4 +1,25 @@ # Automatically generated by ./create_def.pl, do not edit +#Specific rain water content +'crwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific snow water content +'cswc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } +#Eta-coordinate vertical velocity +'etadot' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } #Geopotential 'z' = { discipline = 0 ; @@ -27,12 +48,62 @@ parameterNumber = 8 ; typeOfStatisticalProcessing = 0 ; } +#Vorticity (relative) +'vo' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 12 ; + typeOfStatisticalProcessing = 0 ; + } +#Logarithm of surface pressure +'lnsp' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + } #Logarithm of surface pressure 'lnsp' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 25 ; typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; + } +#Divergence +'d' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfStatisticalProcessing = 0 ; + } +#Ozone mass mixing ratio +'o3' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud liquid water content +'clwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud ice water content +'ciwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } +#Fraction of cloud cover +'cc' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; } #Temperature difference 'tdiff' = { @@ -479,6 +550,13 @@ parameterCategory = 228 ; parameterNumber = 103 ; } +#Precipitation type +'ptype' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } #Snow cover 'snowc' = { discipline = 0 ; @@ -486,6 +564,20 @@ parameterNumber = 42 ; typeOfStatisticalProcessing = 0 ; } +#K index +'kx' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Total totals index +'totalx' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } #Sea water potential temperature 'thetao' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/era/units.def b/definitions/grib2/localConcepts/era/units.def index 95c5b4af8..01a6a7a9d 100644 --- a/definitions/grib2/localConcepts/era/units.def +++ b/definitions/grib2/localConcepts/era/units.def @@ -1,4 +1,25 @@ # Automatically generated by ./create_def.pl, do not edit +#Specific rain water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific snow water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } +#Eta-coordinate vertical velocity +'s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } #Geopotential 'm**2 s**-2' = { discipline = 0 ; @@ -27,6 +48,13 @@ parameterNumber = 8 ; typeOfStatisticalProcessing = 0 ; } +#Vorticity (relative) +'s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 12 ; + typeOfStatisticalProcessing = 0 ; + } #Logarithm of surface pressure 'Numeric' = { discipline = 0 ; @@ -34,6 +62,49 @@ parameterNumber = 25 ; typeOfFirstFixedSurface = 105 ; } +#Logarithm of surface pressure +'Numeric' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; + } +#Divergence +'s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfStatisticalProcessing = 0 ; + } +#Ozone mass mixing ratio +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud liquid water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud ice water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } +#Fraction of cloud cover +'(0 - 1)' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } #Temperature difference 'K' = { discipline = 192 ; @@ -479,6 +550,13 @@ parameterCategory = 228 ; parameterNumber = 103 ; } +#Precipitation type +'code table (4.201)' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } #Snow cover '%' = { discipline = 0 ; @@ -486,6 +564,20 @@ parameterNumber = 42 ; typeOfStatisticalProcessing = 0 ; } +#K index +'K' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Total totals index +'K' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } #Sea water potential temperature 'deg C' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/era6/name.def b/definitions/grib2/localConcepts/era6/name.def index b5c4fefb8..9505d62b1 100644 --- a/definitions/grib2/localConcepts/era6/name.def +++ b/definitions/grib2/localConcepts/era6/name.def @@ -408,4 +408,12 @@ constituentType = 3 ; typeOfStatisticalProcessing = 0 ; is_chemical = 1 ; + } +#Time-mean logarithm of surface pressure +'Time-mean logarithm of surface pressure' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; } diff --git a/definitions/grib2/localConcepts/era6/paramId.def b/definitions/grib2/localConcepts/era6/paramId.def index 85dc31997..fa04cbd0c 100644 --- a/definitions/grib2/localConcepts/era6/paramId.def +++ b/definitions/grib2/localConcepts/era6/paramId.def @@ -408,4 +408,12 @@ constituentType = 3 ; typeOfStatisticalProcessing = 0 ; is_chemical = 1 ; + } +#Time-mean logarithm of surface pressure +'235152' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; } diff --git a/definitions/grib2/localConcepts/era6/shortName.def b/definitions/grib2/localConcepts/era6/shortName.def index 0b9c836b9..31ab28239 100644 --- a/definitions/grib2/localConcepts/era6/shortName.def +++ b/definitions/grib2/localConcepts/era6/shortName.def @@ -408,4 +408,12 @@ constituentType = 3 ; typeOfStatisticalProcessing = 0 ; is_chemical = 1 ; + } +#Time-mean logarithm of surface pressure +'avg_lnsp' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; } diff --git a/definitions/grib2/localConcepts/era6/units.def b/definitions/grib2/localConcepts/era6/units.def index 699b0c19a..f80451dd4 100644 --- a/definitions/grib2/localConcepts/era6/units.def +++ b/definitions/grib2/localConcepts/era6/units.def @@ -408,4 +408,12 @@ constituentType = 3 ; typeOfStatisticalProcessing = 0 ; is_chemical = 1 ; + } +#Time-mean logarithm of surface pressure +'Numeric' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 105 ; + typeOfStatisticalProcessing = 0 ; } diff --git a/definitions/grib2/localConcepts/uerra/cfVarName.def b/definitions/grib2/localConcepts/uerra/cfVarName.def index 2242d96a0..2b45a70b1 100644 --- a/definitions/grib2/localConcepts/uerra/cfVarName.def +++ b/definitions/grib2/localConcepts/uerra/cfVarName.def @@ -75,6 +75,20 @@ indicatorOfUnitForTimeRange = 1 ; typeOfStatisticalProcessing = 2 ; } +#Specific rain water content +'crwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific snow water content +'cswc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } #Total column cloud liquid water 'tclw' = { discipline = 0 ; @@ -287,6 +301,20 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Specific cloud liquid water content +'clwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud ice water content +'ciwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } #2 metre specific humidity 'sh2' = { discipline = 0 ; @@ -298,6 +326,13 @@ scaleFactorOfFirstFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Precipitation type +'ptype' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } #Total column integrated water vapour 'tciwv' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/name.def b/definitions/grib2/localConcepts/uerra/name.def index 59a55bdf5..95013cab1 100644 --- a/definitions/grib2/localConcepts/uerra/name.def +++ b/definitions/grib2/localConcepts/uerra/name.def @@ -75,6 +75,20 @@ indicatorOfUnitForTimeRange = 1 ; typeOfStatisticalProcessing = 2 ; } +#Specific rain water content +'Specific rain water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific snow water content +'Specific snow water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } #Total column cloud liquid water 'Total column cloud liquid water' = { discipline = 0 ; @@ -287,6 +301,20 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Specific cloud liquid water content +'Specific cloud liquid water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud ice water content +'Specific cloud ice water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } #2 metre specific humidity '2 metre specific humidity' = { discipline = 0 ; @@ -298,6 +326,13 @@ scaleFactorOfFirstFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Precipitation type +'Precipitation type' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } #Total column integrated water vapour 'Total column integrated water vapour' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/paramId.def b/definitions/grib2/localConcepts/uerra/paramId.def index 8db696b0d..e7e0a9d65 100644 --- a/definitions/grib2/localConcepts/uerra/paramId.def +++ b/definitions/grib2/localConcepts/uerra/paramId.def @@ -75,6 +75,20 @@ indicatorOfUnitForTimeRange = 1 ; typeOfStatisticalProcessing = 2 ; } +#Specific rain water content +'75' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific snow water content +'76' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } #Total column cloud liquid water '78' = { discipline = 0 ; @@ -287,6 +301,20 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Specific cloud liquid water content +'246' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud ice water content +'247' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } #2 metre specific humidity '174096' = { discipline = 0 ; @@ -298,6 +326,13 @@ scaleFactorOfFirstFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Precipitation type +'260015' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } #Total column integrated water vapour '260057' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/shortName.def b/definitions/grib2/localConcepts/uerra/shortName.def index 9eefdd1fe..113e3e824 100644 --- a/definitions/grib2/localConcepts/uerra/shortName.def +++ b/definitions/grib2/localConcepts/uerra/shortName.def @@ -75,6 +75,20 @@ indicatorOfUnitForTimeRange = 1 ; typeOfStatisticalProcessing = 2 ; } +#Specific rain water content +'crwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific snow water content +'cswc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } #Total column cloud liquid water 'tclw' = { discipline = 0 ; @@ -287,6 +301,20 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Specific cloud liquid water content +'clwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud ice water content +'ciwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } #2 metre specific humidity '2sh' = { discipline = 0 ; @@ -298,6 +326,13 @@ scaleFactorOfFirstFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Precipitation type +'ptype' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } #Total column integrated water vapour 'tciwv' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/units.def b/definitions/grib2/localConcepts/uerra/units.def index 1abfdfd20..760c09d28 100644 --- a/definitions/grib2/localConcepts/uerra/units.def +++ b/definitions/grib2/localConcepts/uerra/units.def @@ -75,6 +75,20 @@ indicatorOfUnitForTimeRange = 1 ; typeOfStatisticalProcessing = 2 ; } +#Specific rain water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific snow water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } #Total column cloud liquid water 'kg m**-2' = { discipline = 0 ; @@ -287,6 +301,20 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Specific cloud liquid water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Specific cloud ice water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } #2 metre specific humidity 'kg kg**-1' = { discipline = 0 ; @@ -298,6 +326,13 @@ scaleFactorOfFirstFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Precipitation type +'code table (4.201)' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } #Total column integrated water vapour 'kg m**-2' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 3c0160a0a..ceddbd354 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -4930,6 +4930,27 @@ parameterNumber = 42 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific rain water content +'Time-mean specific rain water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean specific snow water content +'Time-mean specific snow water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eta-coordinate vertical velocity +'Time-mean eta-coordinate vertical velocity' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean geopotential 'Time-mean geopotential' = { discipline = 0 ; @@ -4998,6 +5019,13 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean vorticity (relative) +'Time-mean vorticity (relative)' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 12 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean mean sea level pressure 'Time-mean mean sea level pressure' = { discipline = 0 ; @@ -5006,6 +5034,13 @@ typeOfFirstFixedSurface = 101 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean divergence +'Time-mean divergence' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean relative humidity 'Time-mean relative humidity' = { discipline = 0 ; @@ -5050,6 +5085,13 @@ scaleFactorOfFirstFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean ozone mass mixing ratio +'Time-mean ozone mass mixing ratio' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean temperature of snow layer 'Time-mean temperature of snow layer' = { discipline = 2 ; @@ -5073,6 +5115,41 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific cloud liquid water content +'Time-mean specific cloud liquid water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean specific cloud ice water content +'Time-mean specific cloud ice water content' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fraction of cloud cover +'Time-mean fraction of cloud cover' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean K index +'Time-mean K index' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total totals index +'Time-mean total totals index' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean discharge from rivers or streams 'Time-mean discharge from rivers or streams' = { discipline = 1 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index b8bd59db2..9d5c36c08 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -4930,6 +4930,27 @@ parameterNumber = 42 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific rain water content +'235101' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean specific snow water content +'235102' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eta-coordinate vertical velocity +'235103' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean geopotential '235129' = { discipline = 0 ; @@ -4998,6 +5019,13 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean vorticity (relative) +'235138' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 12 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean mean sea level pressure '235151' = { discipline = 0 ; @@ -5006,6 +5034,13 @@ typeOfFirstFixedSurface = 101 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean divergence +'235155' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean relative humidity '235157' = { discipline = 0 ; @@ -5050,6 +5085,13 @@ scaleFactorOfFirstFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean ozone mass mixing ratio +'235203' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean temperature of snow layer '235238' = { discipline = 2 ; @@ -5073,6 +5115,41 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific cloud liquid water content +'235246' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean specific cloud ice water content +'235247' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fraction of cloud cover +'235248' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean K index +'235257' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total totals index +'235258' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean discharge from rivers or streams '235270' = { discipline = 1 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index bc55e8f9a..ef199a6b9 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -4930,6 +4930,27 @@ parameterNumber = 42 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific rain water content +'avg_crwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean specific snow water content +'avg_cswc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eta-coordinate vertical velocity +'avg_etadot' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean geopotential 'avg_z' = { discipline = 0 ; @@ -4998,6 +5019,13 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean vorticity (relative) +'avg_vo' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 12 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean mean sea level pressure 'avg_msl' = { discipline = 0 ; @@ -5006,6 +5034,13 @@ typeOfFirstFixedSurface = 101 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean divergence +'avg_d' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean relative humidity 'avg_r' = { discipline = 0 ; @@ -5050,6 +5085,13 @@ scaleFactorOfFirstFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean ozone mass mixing ratio +'avg_o3' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean temperature of snow layer 'avg_tsn' = { discipline = 2 ; @@ -5073,6 +5115,41 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific cloud liquid water content +'avg_clwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean specific cloud ice water content +'avg_ciwc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fraction of cloud cover +'avg_cc' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean K index +'avg_kx' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total totals index +'avg_totalx' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean discharge from rivers or streams 'avg_dis' = { discipline = 1 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 00797338a..bd2bb02d3 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -4930,6 +4930,27 @@ parameterNumber = 42 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific rain water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 85 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean specific snow water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 86 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eta-coordinate vertical velocity +'s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean geopotential 'm**2 s**-2' = { discipline = 0 ; @@ -4998,6 +5019,13 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean vorticity (relative) +'s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 12 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean mean sea level pressure 'Pa' = { discipline = 0 ; @@ -5006,6 +5034,13 @@ typeOfFirstFixedSurface = 101 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean divergence +'s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean relative humidity '%' = { discipline = 0 ; @@ -5050,6 +5085,13 @@ scaleFactorOfFirstFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean ozone mass mixing ratio +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean temperature of snow layer 'K' = { discipline = 2 ; @@ -5073,6 +5115,41 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean specific cloud liquid water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 83 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean specific cloud ice water content +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 84 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fraction of cloud cover +'(0 - 1)' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 32 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean K index +'K' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total totals index +'K' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean discharge from rivers or streams 'm**3 s**-1' = { discipline = 1 ; From ff790c48225c8878297df75fe99578b77ced17c4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 17 May 2024 15:10:47 +0000 Subject: [PATCH 160/196] ECC-1822: GRIB2: Modification of sea ice thickness parameters --- 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 deletions(-) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 3e0b0f0f4..d96c4f5f2 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -7480,12 +7480,6 @@ discipline = 10 ; parameterCategory = 2 ; parameterNumber = 1 ; - typeOfFirstFixedSurface = 174 ; - typeOfSecondFixedSurface = 176 ; - scaledValueOfFirstFixedSurface = missing() ; - scaleFactorOfFirstFixedSurface = missing() ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Sea ice area fraction 'siconc' = { @@ -8590,12 +8584,6 @@ 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 diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index ceddbd354..a429aa897 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -7480,12 +7480,6 @@ discipline = 10 ; parameterCategory = 2 ; parameterNumber = 1 ; - typeOfFirstFixedSurface = 174 ; - typeOfSecondFixedSurface = 176 ; - scaledValueOfFirstFixedSurface = missing() ; - scaleFactorOfFirstFixedSurface = missing() ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Sea ice area fraction 'Sea ice area fraction' = { @@ -8590,12 +8584,6 @@ 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 diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 9d5c36c08..3e534871d 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -7480,12 +7480,6 @@ discipline = 10 ; parameterCategory = 2 ; parameterNumber = 1 ; - typeOfFirstFixedSurface = 174 ; - typeOfSecondFixedSurface = 176 ; - scaledValueOfFirstFixedSurface = missing() ; - scaleFactorOfFirstFixedSurface = missing() ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Sea ice area fraction '262001' = { @@ -8590,12 +8584,6 @@ 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 diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index ef199a6b9..29c96c4c4 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -7480,12 +7480,6 @@ discipline = 10 ; parameterCategory = 2 ; parameterNumber = 1 ; - typeOfFirstFixedSurface = 174 ; - typeOfSecondFixedSurface = 176 ; - scaledValueOfFirstFixedSurface = missing() ; - scaleFactorOfFirstFixedSurface = missing() ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Sea ice area fraction 'siconc' = { @@ -8590,12 +8584,6 @@ 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 diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index bd2bb02d3..108e1fb71 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -7480,12 +7480,6 @@ discipline = 10 ; parameterCategory = 2 ; parameterNumber = 1 ; - typeOfFirstFixedSurface = 174 ; - typeOfSecondFixedSurface = 176 ; - scaledValueOfFirstFixedSurface = missing() ; - scaleFactorOfFirstFixedSurface = missing() ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Sea ice area fraction 'Fraction' = { @@ -8590,12 +8584,6 @@ 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 From a2761b997a887bcc678c2c36129b3e5a2d7f6381 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 18 May 2024 17:25:22 +0100 Subject: [PATCH 161/196] Testing: grib_to_netcdf options --- tests/grib_to_netcdf.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index f13d8475b..ba3589329 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -110,6 +110,14 @@ ${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib ${tools_dir}/grib_set -s productDefinitionTemplateNumber=31 $sample2 $tempGrib ${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib +ECCODES_DEBUG=-1 ${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib + + +# The -u option +input=${data_dir}/sample.grib2 +${tools_dir}/grib_to_netcdf -u time -o $tempNetcdf $input + + echo "Test different resolutions ..." # ------------------------------------ # This should fail as messages have different resolutions @@ -170,6 +178,26 @@ set -e grep -q "Wrong message length" $tempText +# Non-GRIB input +input=$data_dir/bufr/aaen_55.bufr +set +e +${tools_dir}/grib_to_netcdf -o $tempNetcdf $input > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Input does not contain any field" $tempText + + +# Bad reference date +input=$data_dir/sample.grib2 +set +e +${tools_dir}/grib_to_netcdf -Rxxx -o $tempNetcdf $input > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Invalid reference date" $tempText + + # Validity time check export GRIB_TO_NETCDF_CHECKVALIDTIME=0 ${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib From 404a72ceb5bb761e5b18842a0bc9d2beb138081b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 20 May 2024 15:44:09 +0000 Subject: [PATCH 162/196] ECC-1833: GRIB2: Move parameters to CERISE pseudocentre --- definitions/grib2/cfVarName.def | 14 -------------- .../grib2/localConcepts/cerise/cfVarName.def | 14 ++++++++++++++ definitions/grib2/localConcepts/cerise/name.def | 14 ++++++++++++++ definitions/grib2/localConcepts/cerise/paramId.def | 14 ++++++++++++++ .../grib2/localConcepts/cerise/shortName.def | 14 ++++++++++++++ definitions/grib2/localConcepts/cerise/units.def | 14 ++++++++++++++ definitions/grib2/name.def | 14 -------------- definitions/grib2/paramId.def | 14 -------------- definitions/grib2/shortName.def | 14 -------------- definitions/grib2/units.def | 14 -------------- 10 files changed, 70 insertions(+), 70 deletions(-) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index d96c4f5f2..79f723514 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -4916,20 +4916,6 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } -#Time-mean snow depth -'avg_sde' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 11 ; - typeOfStatisticalProcessing = 0 ; - } -#Time-mean snow cover -'avg_snowc' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 42 ; - typeOfStatisticalProcessing = 0 ; - } #Time-mean specific rain water content 'avg_crwc' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/cerise/cfVarName.def b/definitions/grib2/localConcepts/cerise/cfVarName.def index dfb69cc17..9d88fb46e 100644 --- a/definitions/grib2/localConcepts/cerise/cfVarName.def +++ b/definitions/grib2/localConcepts/cerise/cfVarName.def @@ -153,6 +153,20 @@ typeOfStatisticalProcessing = 1 ; } #Time-mean snow depth +'avg_sde' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow cover +'avg_snowc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow depth 'avg_sd_m' = { localTablesVersion = 1 ; discipline = 0 ; diff --git a/definitions/grib2/localConcepts/cerise/name.def b/definitions/grib2/localConcepts/cerise/name.def index cac36cdea..3d758e137 100644 --- a/definitions/grib2/localConcepts/cerise/name.def +++ b/definitions/grib2/localConcepts/cerise/name.def @@ -153,6 +153,20 @@ typeOfStatisticalProcessing = 1 ; } #Time-mean snow depth +'Time-mean snow depth' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow cover +'Time-mean snow cover' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow depth 'Time-mean snow depth' = { localTablesVersion = 1 ; discipline = 0 ; diff --git a/definitions/grib2/localConcepts/cerise/paramId.def b/definitions/grib2/localConcepts/cerise/paramId.def index c4af1e971..a3f2a3407 100644 --- a/definitions/grib2/localConcepts/cerise/paramId.def +++ b/definitions/grib2/localConcepts/cerise/paramId.def @@ -153,6 +153,20 @@ typeOfStatisticalProcessing = 1 ; } #Time-mean snow depth +'235095' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow cover +'235096' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow depth '235141' = { localTablesVersion = 1 ; discipline = 0 ; diff --git a/definitions/grib2/localConcepts/cerise/shortName.def b/definitions/grib2/localConcepts/cerise/shortName.def index dfb69cc17..9d88fb46e 100644 --- a/definitions/grib2/localConcepts/cerise/shortName.def +++ b/definitions/grib2/localConcepts/cerise/shortName.def @@ -153,6 +153,20 @@ typeOfStatisticalProcessing = 1 ; } #Time-mean snow depth +'avg_sde' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow cover +'avg_snowc' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow depth 'avg_sd_m' = { localTablesVersion = 1 ; discipline = 0 ; diff --git a/definitions/grib2/localConcepts/cerise/units.def b/definitions/grib2/localConcepts/cerise/units.def index afc663307..d5215c398 100644 --- a/definitions/grib2/localConcepts/cerise/units.def +++ b/definitions/grib2/localConcepts/cerise/units.def @@ -153,6 +153,20 @@ typeOfStatisticalProcessing = 1 ; } #Time-mean snow depth +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow cover +'%' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 42 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow depth 'm of water equivalent' = { localTablesVersion = 1 ; discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index a429aa897..9f853ca7d 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -4916,20 +4916,6 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } -#Time-mean snow depth -'Time-mean snow depth' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 11 ; - typeOfStatisticalProcessing = 0 ; - } -#Time-mean snow cover -'Time-mean snow cover' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 42 ; - typeOfStatisticalProcessing = 0 ; - } #Time-mean specific rain water content 'Time-mean specific rain water content' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 3e534871d..3c8dea65b 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -4916,20 +4916,6 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } -#Time-mean snow depth -'235095' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 11 ; - typeOfStatisticalProcessing = 0 ; - } -#Time-mean snow cover -'235096' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 42 ; - typeOfStatisticalProcessing = 0 ; - } #Time-mean specific rain water content '235101' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 29c96c4c4..cf8f6b8d1 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -4916,20 +4916,6 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } -#Time-mean snow depth -'avg_sde' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 11 ; - typeOfStatisticalProcessing = 0 ; - } -#Time-mean snow cover -'avg_snowc' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 42 ; - typeOfStatisticalProcessing = 0 ; - } #Time-mean specific rain water content 'avg_crwc' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 108e1fb71..d8b24c9c4 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -4916,20 +4916,6 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } -#Time-mean snow depth -'m' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 11 ; - typeOfStatisticalProcessing = 0 ; - } -#Time-mean snow cover -'%' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 42 ; - typeOfStatisticalProcessing = 0 ; - } #Time-mean specific rain water content 'kg kg**-1' = { discipline = 0 ; From 869c7cdb1cba3f177643ca519eeaca43cf4a3fb2 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 3 Jun 2024 09:11:28 +0000 Subject: [PATCH 163/196] ECC-1834: GRIB2: Add time-mean version of hydro parameters from WMO FT2024-1 --- definitions/grib2/cfVarName.def | 49 +++++++++++++++++++++++++++++++++ definitions/grib2/name.def | 49 +++++++++++++++++++++++++++++++++ definitions/grib2/paramId.def | 49 +++++++++++++++++++++++++++++++++ definitions/grib2/shortName.def | 49 +++++++++++++++++++++++++++++++++ definitions/grib2/units.def | 49 +++++++++++++++++++++++++++++++++ 5 files changed, 245 insertions(+) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 79f723514..ab2927b4a 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -5170,6 +5170,55 @@ typeOfSecondFixedSurface = 151 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean floodplain depth +'avg_flddep' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean floodplain flooded fraction +'avg_fldffr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean floodplain flooded area +'avg_fldfar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean river fraction +'avg_rivfr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean river area +'avg_rivar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fraction of river coverage plus river related flooding +'avg_rivcffr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean area of river coverage plus river related flooding +'avg_rivcfar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfStatisticalProcessing = 0 ; + } #Cross sectional area of flow in channel 'chcross' = { discipline = 1 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 9f853ca7d..3432f9662 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -5170,6 +5170,55 @@ typeOfSecondFixedSurface = 151 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean floodplain depth +'Time-mean floodplain depth' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean floodplain flooded fraction +'Time-mean floodplain flooded fraction' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean floodplain flooded area +'Time-mean floodplain flooded area' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean river fraction +'Time-mean river fraction' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean river area +'Time-mean river area' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fraction of river coverage plus river related flooding +'Time-mean fraction of river coverage plus river related flooding' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean area of river coverage plus river related flooding +'Time-mean area of river coverage plus river related flooding' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfStatisticalProcessing = 0 ; + } #Cross sectional area of flow in channel 'Cross sectional area of flow in channel' = { discipline = 1 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 3c8dea65b..8f88f9348 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -5170,6 +5170,55 @@ typeOfSecondFixedSurface = 151 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean floodplain depth +'235274' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean floodplain flooded fraction +'235275' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean floodplain flooded area +'235276' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean river fraction +'235277' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean river area +'235278' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fraction of river coverage plus river related flooding +'235279' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean area of river coverage plus river related flooding +'235280' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfStatisticalProcessing = 0 ; + } #Cross sectional area of flow in channel '240011' = { discipline = 1 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index cf8f6b8d1..31b6cf9fe 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -5170,6 +5170,55 @@ typeOfSecondFixedSurface = 151 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean floodplain depth +'avg_flddep' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean floodplain flooded fraction +'avg_fldffr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean floodplain flooded area +'avg_fldfar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean river fraction +'avg_rivfr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean river area +'avg_rivar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fraction of river coverage plus river related flooding +'avg_rivcffr' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean area of river coverage plus river related flooding +'avg_rivcfar' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfStatisticalProcessing = 0 ; + } #Cross sectional area of flow in channel 'chcross' = { discipline = 1 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index d8b24c9c4..90204df45 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -5170,6 +5170,55 @@ typeOfSecondFixedSurface = 151 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean floodplain depth +'m' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean floodplain flooded fraction +'Proportion' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean floodplain flooded area +'m**2' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean river fraction +'Proportion' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean river area +'m**2' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fraction of river coverage plus river related flooding +'Proportion' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean area of river coverage plus river related flooding +'m**2' = { + discipline = 1 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfStatisticalProcessing = 0 ; + } #Cross sectional area of flow in channel 'm**2' = { discipline = 1 ; From 0ced0096b17856f31c209ae42e358b62fc106c03 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 3 Jun 2024 10:20:05 +0000 Subject: [PATCH 164/196] ECC-1837: GRIB: Make code table units consistent --- .../grib1/localConcepts/ecmf/units.def | 4 +- .../grib1/localConcepts/rjtd/units.def | 2 +- definitions/grib2/localConcepts/era/units.def | 2 +- .../grib2/localConcepts/uerra/units.def | 2 +- definitions/grib2/units.def | 54 +++++++++---------- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/units.def b/definitions/grib1/localConcepts/ecmf/units.def index 193a0e3c6..a5789c54c 100644 --- a/definitions/grib1/localConcepts/ecmf/units.def +++ b/definitions/grib1/localConcepts/ecmf/units.def @@ -195,12 +195,12 @@ indicatorOfParameter = 28 ; } #Type of low vegetation -'(code table 4.234)' = { +'(Code table 4.234)' = { table2Version = 128 ; indicatorOfParameter = 29 ; } #Type of high vegetation -'(code table 4.234)' = { +'(Code table 4.234)' = { table2Version = 128 ; indicatorOfParameter = 30 ; } diff --git a/definitions/grib1/localConcepts/rjtd/units.def b/definitions/grib1/localConcepts/rjtd/units.def index 05a2a7758..8e177dd35 100644 --- a/definitions/grib1/localConcepts/rjtd/units.def +++ b/definitions/grib1/localConcepts/rjtd/units.def @@ -486,7 +486,7 @@ indicatorOfParameter = 253 ; } #Type of vegetation -'Code Table JMA-252' = { +'(Code table JMA-252)' = { table2Version = 200 ; indicatorOfParameter = 252 ; } diff --git a/definitions/grib2/localConcepts/era/units.def b/definitions/grib2/localConcepts/era/units.def index 01a6a7a9d..28ac983af 100644 --- a/definitions/grib2/localConcepts/era/units.def +++ b/definitions/grib2/localConcepts/era/units.def @@ -551,7 +551,7 @@ parameterNumber = 103 ; } #Precipitation type -'code table (4.201)' = { +'(Code table 4.201)' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 19 ; diff --git a/definitions/grib2/localConcepts/uerra/units.def b/definitions/grib2/localConcepts/uerra/units.def index 760c09d28..57ef3426f 100644 --- a/definitions/grib2/localConcepts/uerra/units.def +++ b/definitions/grib2/localConcepts/uerra/units.def @@ -327,7 +327,7 @@ typeOfStatisticalProcessing = 0 ; } #Precipitation type -'code table (4.201)' = { +'(Code table 4.201)' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 19 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 90204df45..3d9d63a65 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -194,13 +194,13 @@ parameterNumber = 54 ; } #Type of low vegetation -'(code table 4.234)' = { +'(Code table 4.234)' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 57 ; } #Type of high vegetation -'(code table 4.234)' = { +'(Code table 4.234)' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 58 ; @@ -3377,7 +3377,7 @@ parameterNumber = 45 ; } #Wetland type -'Code table 4.239' = { +'(Code table 4.239)' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 46 ; @@ -5552,7 +5552,7 @@ parameterNumber = 18 ; } #Precipitation type -'code table (4.201)' = { +'(Code table 4.201)' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 19 ; @@ -5620,7 +5620,7 @@ typeOfStatisticalProcessing = 1 ; } #Precipitable water category -'code table (4.202)' = { +'(Code table 4.202)' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 30 ; @@ -6037,7 +6037,7 @@ parameterNumber = 7 ; } #Cloud type -'code table (4.203)' = { +'(Code table 4.203)' = { discipline = 0 ; parameterCategory = 6 ; parameterNumber = 8 ; @@ -6049,7 +6049,7 @@ parameterNumber = 9 ; } #Thunderstorm coverage -'code table (4.204)' = { +'(Code table 4.204)' = { discipline = 0 ; parameterCategory = 6 ; parameterNumber = 10 ; @@ -6181,7 +6181,7 @@ parameterNumber = 11 ; } #Aerosol type -'code table (4.205)' = { +'(Code table 4.205)' = { discipline = 0 ; parameterCategory = 13 ; parameterNumber = 0 ; @@ -6291,7 +6291,7 @@ parameterNumber = 8 ; } #Volcanic ash -'code table (4.206)' = { +'(Code table 4.206)' = { discipline = 0 ; parameterCategory = 19 ; parameterNumber = 4 ; @@ -6309,7 +6309,7 @@ parameterNumber = 6 ; } #Icing -'code table (4.207)' = { +'(Code table 4.207)' = { discipline = 0 ; parameterCategory = 19 ; parameterNumber = 7 ; @@ -6327,7 +6327,7 @@ parameterNumber = 9 ; } #Turbulence -'code table (4.208)' = { +'(Code table 4.208)' = { discipline = 0 ; parameterCategory = 19 ; parameterNumber = 10 ; @@ -6339,19 +6339,19 @@ parameterNumber = 11 ; } #Planetary boundary layer regime -'code table (4.209)' = { +'(Code table 4.209)' = { discipline = 0 ; parameterCategory = 19 ; parameterNumber = 12 ; } #Contrail intensity -'code table (4.210)' = { +'(Code table 4.210)' = { discipline = 0 ; parameterCategory = 19 ; parameterNumber = 13 ; } #Contrail engine type -'code table (4.211)' = { +'(Code table 4.211)' = { discipline = 0 ; parameterCategory = 19 ; parameterNumber = 14 ; @@ -6429,13 +6429,13 @@ parameterNumber = 1 ; } #Remotely sensed snow cover -'(code table 4.215)' = { +'(Code table 4.215)' = { discipline = 1 ; parameterCategory = 0 ; parameterNumber = 2 ; } #Elevation of snow covered terrain -'(code table 4.216)' = { +'(Code table 4.216)' = { discipline = 1 ; parameterCategory = 0 ; parameterNumber = 3 ; @@ -6501,7 +6501,7 @@ parameterNumber = 7 ; } #Land use -'code table (4.212)' = { +'(Code table 4.212)' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 8 ; @@ -6669,7 +6669,7 @@ parameterNumber = 2 ; } #Cloud top height quality indicator -'Code table 4.219' = { +'(Code table 4.219)' = { discipline = 3 ; parameterCategory = 1 ; parameterNumber = 3 ; @@ -6875,7 +6875,7 @@ parameterNumber = 0 ; } #Precipitation type (most severe) in the last 1 hour -'code table (4.201)' = { +'(Code table 4.201)' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 19 ; @@ -6884,7 +6884,7 @@ lengthOfTimeRange = 1 ; } #Precipitation type (most severe) in the last 3 hours -'code table (4.201)' = { +'(Code table 4.201)' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 19 ; @@ -6893,7 +6893,7 @@ lengthOfTimeRange = 3 ; } #Precipitation type (most frequent) in the last 1 hour -'code table (4.201)' = { +'(Code table 4.201)' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 19 ; @@ -6902,7 +6902,7 @@ lengthOfTimeRange = 1 ; } #Precipitation type (most frequent) in the last 3 hours -'code table (4.201)' = { +'(Code table 4.201)' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 19 ; @@ -6911,7 +6911,7 @@ lengthOfTimeRange = 3 ; } #Precipitation type (most severe) in the last 6 hours -'code table (4.201)' = { +'(Code table 4.201)' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 19 ; @@ -6920,7 +6920,7 @@ lengthOfTimeRange = 6 ; } #Precipitation type (most frequent) in the last 6 hours -'code table (4.201)' = { +'(Code table 4.201)' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 19 ; @@ -7096,19 +7096,19 @@ parameterNumber = 6 ; } #Cloud mask -'Code table 4.217' = { +'(Code table 4.217)' = { discipline = 3 ; parameterCategory = 0 ; parameterNumber = 7 ; } #Pixel scene type -'Code table 4.218' = { +'(Code table 4.218)' = { discipline = 3 ; parameterCategory = 0 ; parameterNumber = 8 ; } #Fire detection indicator -'Code table 4.223' = { +'(Code table 4.223)' = { discipline = 3 ; parameterCategory = 0 ; parameterNumber = 9 ; From 2b0a0624ad4cc9a4f063cbe0cbb160c9aac98767 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 3 Jun 2024 15:13:39 +0000 Subject: [PATCH 165/196] ECC-1838: GRIB2: Aerosol diagnostics parameter --- definitions/grib2/cfVarName.def | 32 ++++++++++++++++++++++++++++++++ definitions/grib2/name.def | 32 ++++++++++++++++++++++++++++++++ definitions/grib2/paramId.def | 32 ++++++++++++++++++++++++++++++++ definitions/grib2/shortName.def | 32 ++++++++++++++++++++++++++++++++ definitions/grib2/units.def | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 160 insertions(+) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index ab2927b4a..68a976c5b 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -10230,6 +10230,38 @@ is_chemical_srcsink = 1 ; sourceSinkChemicalPhysicalProcess = 7 ; } +#Aerosol optical depth +'aod' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + } +#Single scattering albedo +'ssa' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 103 ; + } +#Asymmetry Factor +'asymf' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 104 ; + } +#Aerosol backscatter from top of atmosphere +'aerbscattoa' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 107 ; + typeOfFirstFixedSurface = 8 ; + } +#Aerosol backscatter from ground +'aerbscatgnd' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 108 ; + typeOfFirstFixedSurface = 1 ; + } #Pressure tendency 'ptend' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 3432f9662..d79232bcc 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -10230,6 +10230,38 @@ is_chemical_srcsink = 1 ; sourceSinkChemicalPhysicalProcess = 7 ; } +#Aerosol optical depth +'Aerosol optical depth' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + } +#Single scattering albedo +'Single scattering albedo' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 103 ; + } +#Asymmetry Factor +'Asymmetry Factor' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 104 ; + } +#Aerosol backscatter from top of atmosphere +'Aerosol backscatter from top of atmosphere' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 107 ; + typeOfFirstFixedSurface = 8 ; + } +#Aerosol backscatter from ground +'Aerosol backscatter from ground' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 108 ; + typeOfFirstFixedSurface = 1 ; + } #Pressure tendency 'Pressure tendency' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 8f88f9348..e819eb5ab 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -10230,6 +10230,38 @@ is_chemical_srcsink = 1 ; sourceSinkChemicalPhysicalProcess = 7 ; } +#Aerosol optical depth +'457000' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + } +#Single scattering albedo +'458000' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 103 ; + } +#Asymmetry Factor +'459000' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 104 ; + } +#Aerosol backscatter from top of atmosphere +'460000' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 107 ; + typeOfFirstFixedSurface = 8 ; + } +#Aerosol backscatter from ground +'461000' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 108 ; + typeOfFirstFixedSurface = 1 ; + } #Pressure tendency '3003' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 31b6cf9fe..3019ffd73 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -10230,6 +10230,38 @@ is_chemical_srcsink = 1 ; sourceSinkChemicalPhysicalProcess = 7 ; } +#Aerosol optical depth +'aod' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + } +#Single scattering albedo +'ssa' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 103 ; + } +#Asymmetry Factor +'asymf' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 104 ; + } +#Aerosol backscatter from top of atmosphere +'aerbscattoa' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 107 ; + typeOfFirstFixedSurface = 8 ; + } +#Aerosol backscatter from ground +'aerbscatgnd' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 108 ; + typeOfFirstFixedSurface = 1 ; + } #Pressure tendency 'ptend' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 3d9d63a65..175168e60 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -10230,6 +10230,38 @@ is_chemical_srcsink = 1 ; sourceSinkChemicalPhysicalProcess = 7 ; } +#Aerosol optical depth +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + } +#Single scattering albedo +'(0 - 1)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 103 ; + } +#Asymmetry Factor +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 104 ; + } +#Aerosol backscatter from top of atmosphere +'m**-1 sr**-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 107 ; + typeOfFirstFixedSurface = 8 ; + } +#Aerosol backscatter from ground +'m**-1 sr**-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 108 ; + typeOfFirstFixedSurface = 1 ; + } #Pressure tendency 'Pa s**-1' = { discipline = 0 ; From dbaaec7055ea795471b02a4977e44b2d3b1a8065 Mon Sep 17 00:00:00 2001 From: Sebastien Villaume Date: Mon, 3 Jun 2024 16:28:41 +0100 Subject: [PATCH 166/196] ECC-1831 remove the modelName concept --- .../grib2/localConcepts/cnmc/modelName.def | 7 -- .../grib2/localConcepts/edzw/modelName.def | 107 ------------------ .../grib2/localConcepts/lssw/modelName.def | 17 --- definitions/grib2/modelName.def | 43 ------- definitions/grib2/parameters.def | 3 - 5 files changed, 177 deletions(-) delete mode 100644 definitions/grib2/localConcepts/cnmc/modelName.def delete mode 100644 definitions/grib2/localConcepts/edzw/modelName.def delete mode 100644 definitions/grib2/localConcepts/lssw/modelName.def delete mode 100644 definitions/grib2/modelName.def diff --git a/definitions/grib2/localConcepts/cnmc/modelName.def b/definitions/grib2/localConcepts/cnmc/modelName.def deleted file mode 100644 index e7a85ed1f..000000000 --- a/definitions/grib2/localConcepts/cnmc/modelName.def +++ /dev/null @@ -1,7 +0,0 @@ -# modelName: Contribution from Daniel Lee @ DWD - -# defintions for Roma (COSMO LEPS) -'cosmo-leps' = { - subCentre=98; - grib2LocalSectionNumber=28; -} diff --git a/definitions/grib2/localConcepts/edzw/modelName.def b/definitions/grib2/localConcepts/edzw/modelName.def deleted file mode 100644 index 5af6fb6e6..000000000 --- a/definitions/grib2/localConcepts/edzw/modelName.def +++ /dev/null @@ -1,107 +0,0 @@ -# modelName: Contribution from Daniel Lee @ DWD - -# definitions for Offenbach -'cosmo_eu' = { - generatingProcessIdentifier=131; -} -'cosmo_eu' = { - generatingProcessIdentifier=132; -} -'cosmo_eu' = { - generatingProcessIdentifier=134; -} -'cosmo_eu' = { - generatingProcessIdentifier=135; -} -'cosmo_de' = { - generatingProcessIdentifier=137; -} -'cosmo_de' = { - generatingProcessIdentifier=138; -} -'cosmo_de-eps' = { - generatingProcessIdentifier=137; - typeOfEnsembleForecast=192; -} -'cosmo_de-eps' = { - generatingProcessIdentifier=138; - typeOfEnsembleForecast=192; -} - -#DWD model names for ICON -'icogl' = { - gridDefinitionTemplateNumber=101; - generatingProcessIdentifier=1; -} -'icogl130' = { - numberOfGridUsed=26; - generatingProcessIdentifier=1; -} -'icogl130l90' = { - numberOfGridUsed=26; - nlev=91; - generatingProcessIdentifier=1; -} -'icogl130p' = { - numberOfGridUsed=26; - typeOfFirstFixedSurface=100; - generatingProcessIdentifier=1; -} -'icoeu'= { - gridDefinitionTemplateNumber=101; - generatingProcessIdentifier=2; -} -'icoeu065' = { - numberOfGridUsed=27; - generatingProcessIdentifier=2; -} -'icoeu065l60' = { - numberOfGridUsed=27; - nlev=61; - generatingProcessIdentifier=2; -} -'icreu' = { - gridDefinitionTemplateNumber=0; - generatingProcessIdentifier=2; -} -'icreu_0.625' = { - gridDefinitionTemplateNumber=0; - Dx=62500; - Dy=62500; - generatingProcessIdentifier=2; -} -'icreu_0.625l60' = { - gridDefinitionTemplateNumber=0; - Dx=62500; - Dy=62500; - nlev=61; - generatingProcessIdentifier=2; -} -'icreu_0.625p' = { - gridDefinitionTemplateNumber=0; - Dx=62500; - Dy=62500; - typeOfFirstFixedSurface=100; - generatingProcessIdentifier=2; -} -'icreu_0.625z' = { - gridDefinitionTemplateNumber=0; - Dx=62500; - Dy=62500; - typeOfFirstFixedSurface=102; - generatingProcessIdentifier=2; -} -'icrde' = { - gridDefinitionTemplateNumber=0; - generatingProcessIdentifier=3; -} -'icrgl' = { - gridDefinitionTemplateNumber=0; - generatingProcessIdentifier=1; -} -'icrgl_0.25' = { - gridDefinitionTemplateNumber=0; - Dx=250000; - Dy=250000; - generatingProcessIdentifier=1; -} diff --git a/definitions/grib2/localConcepts/lssw/modelName.def b/definitions/grib2/localConcepts/lssw/modelName.def deleted file mode 100644 index 6413c0d1c..000000000 --- a/definitions/grib2/localConcepts/lssw/modelName.def +++ /dev/null @@ -1,17 +0,0 @@ -# modelName: Contribution from Daniel Lee @ DWD -# definitions for Zurich -'cosmo-1' = { - generatingProcessIdentifier=101; -} -'cosmo-2' = { - generatingProcessIdentifier=102; -} -'cosmo-7' = { - generatingProcessIdentifier=107; -} -'cosmo-e' = { - generatingProcessIdentifier=103; -} -'cosmo-e' = { - generatingProcessIdentifier=130; -} diff --git a/definitions/grib2/modelName.def b/definitions/grib2/modelName.def deleted file mode 100644 index 25b89c3d1..000000000 --- a/definitions/grib2/modelName.def +++ /dev/null @@ -1,43 +0,0 @@ -# modelName: Contribution from Daniel Lee @ DWD - -# COSMO -# general definition -'cosmo' = { originatingCentre=250; } -'cosmo' = { subCentre=250; } - -# definitions for ARPA-SIMC -'cosmo-i2' = { originatingCentre=200; - generatingProcessIdentifier=36; } -'cosmo-i2' = { originatingCentre=200; - generatingProcessIdentifier=139; } -'cosmo-i2' = { originatingCentre=200; - generatingProcessIdentifier=144; } -'cosmo-i2' = { originatingCentre=200; - generatingProcessIdentifier=148; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=31; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=32; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=34; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=38; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=42; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=46; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=131; } -# definitions for Moscow -'cosmo_ru' = { originatingCentre=76; - generatingProcessIdentifier=135; } -'cosmo_ru-eps' = { originatingCentre=76; - generatingProcessIdentifier=235;} - -# definitions for Athens -'cosmo-greece' = { originatingCentre=96;} -# definitions for Warsaw / Poland -'cosmo-poland' = { originatingCentre=220;} -# definitions for Romania -'cosmo-romania' = { originatingCentre=242;} - diff --git a/definitions/grib2/parameters.def b/definitions/grib2/parameters.def index 6ffe2fe0d..0ddf9f901 100644 --- a/definitions/grib2/parameters.def +++ b/definitions/grib2/parameters.def @@ -27,9 +27,6 @@ concept cfVarNameLegacyECMF(defaultShortName,"cfVarName.legacy.def",conceptsMast concept cfVarNameECMF (cfVarNameLegacyECMF,"cfVarName.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy; concept cfVarName (cfVarNameECMF,"cfVarName.def",conceptsDir2,conceptsDir1): no_copy,dump; -# modelName: Contribution from Daniel Lee @ DWD -concept modelName (defaultName,"modelName.def",conceptsDir2,conceptsDir1): no_copy,dump,read_only; - template_nofail names "grib2/products_[productionStatusOfProcessedData].def"; meta ifsParam ifs_param(paramId,type); From aecae70c75e931d639603333864eed3d52282601 Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 3 Jun 2024 17:13:01 +0100 Subject: [PATCH 167/196] ECC-1831: GRIB2: Remove the 'modelName' concept --- definitions/grib3/modelName.def | 43 -------------------------------- definitions/grib3/parameters.def | 3 --- 2 files changed, 46 deletions(-) delete mode 100644 definitions/grib3/modelName.def diff --git a/definitions/grib3/modelName.def b/definitions/grib3/modelName.def deleted file mode 100644 index 25b89c3d1..000000000 --- a/definitions/grib3/modelName.def +++ /dev/null @@ -1,43 +0,0 @@ -# modelName: Contribution from Daniel Lee @ DWD - -# COSMO -# general definition -'cosmo' = { originatingCentre=250; } -'cosmo' = { subCentre=250; } - -# definitions for ARPA-SIMC -'cosmo-i2' = { originatingCentre=200; - generatingProcessIdentifier=36; } -'cosmo-i2' = { originatingCentre=200; - generatingProcessIdentifier=139; } -'cosmo-i2' = { originatingCentre=200; - generatingProcessIdentifier=144; } -'cosmo-i2' = { originatingCentre=200; - generatingProcessIdentifier=148; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=31; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=32; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=34; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=38; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=42; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=46; } -'cosmo-i7' = { originatingCentre=200; - generatingProcessIdentifier=131; } -# definitions for Moscow -'cosmo_ru' = { originatingCentre=76; - generatingProcessIdentifier=135; } -'cosmo_ru-eps' = { originatingCentre=76; - generatingProcessIdentifier=235;} - -# definitions for Athens -'cosmo-greece' = { originatingCentre=96;} -# definitions for Warsaw / Poland -'cosmo-poland' = { originatingCentre=220;} -# definitions for Romania -'cosmo-romania' = { originatingCentre=242;} - diff --git a/definitions/grib3/parameters.def b/definitions/grib3/parameters.def index 907431c7b..322d0cd21 100644 --- a/definitions/grib3/parameters.def +++ b/definitions/grib3/parameters.def @@ -23,9 +23,6 @@ concept cfName (cfNameECMF,"cfName.def",conceptsMasterDir,conceptsLocalDirAll) : concept cfVarNameECMF (defaultShortName,"cfVarName.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy,dump; concept cfVarName (cfVarNameECMF,"cfVarName.def",conceptsMasterDir,conceptsLocalDirAll) : no_copy,dump; -# modelName: Contribution from Daniel Lee @ DWD -concept modelName (defaultName,"modelName.def",conceptsMasterDir,conceptsLocalDirAll): no_copy,dump,read_only; - template_nofail names "grib3/products_[productionStatusOfProcessedData].def"; meta ifsParam ifs_param(paramId,type); From df5896e885f499ba54e9e0519aa52d851e21d058 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 5 Jun 2024 15:32:21 +0000 Subject: [PATCH 168/196] ECC-1839: GRIB2: Add encoding for aerosol extinction coefficient --- definitions/grib2/cfVarName.def | 6 ++++++ definitions/grib2/name.def | 6 ++++++ definitions/grib2/paramId.def | 6 ++++++ definitions/grib2/shortName.def | 6 ++++++ definitions/grib2/units.def | 6 ++++++ 5 files changed, 30 insertions(+) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 68a976c5b..23f21f92b 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -10262,6 +10262,12 @@ parameterNumber = 108 ; typeOfFirstFixedSurface = 1 ; } +#Aerosol extinction coefficient +'aerext' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 105 ; + } #Pressure tendency 'ptend' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index d79232bcc..28662c804 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -10262,6 +10262,12 @@ parameterNumber = 108 ; typeOfFirstFixedSurface = 1 ; } +#Aerosol extinction coefficient +'Aerosol extinction coefficient' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 105 ; + } #Pressure tendency 'Pressure tendency' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index e819eb5ab..79cac4f50 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -10262,6 +10262,12 @@ parameterNumber = 108 ; typeOfFirstFixedSurface = 1 ; } +#Aerosol extinction coefficient +'462000' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 105 ; + } #Pressure tendency '3003' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 3019ffd73..0069ad87e 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -10262,6 +10262,12 @@ parameterNumber = 108 ; typeOfFirstFixedSurface = 1 ; } +#Aerosol extinction coefficient +'aerext' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 105 ; + } #Pressure tendency 'ptend' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 175168e60..fe33403b3 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -10262,6 +10262,12 @@ parameterNumber = 108 ; typeOfFirstFixedSurface = 1 ; } +#Aerosol extinction coefficient +'m**-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 105 ; + } #Pressure tendency 'Pa s**-1' = { discipline = 0 ; From 7ac53385ae002ea52c166c3538fdd68bd2e9e0ff Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 6 Jun 2024 11:11:16 +0000 Subject: [PATCH 169/196] ECC-1836: GRIB2: Add correct unit to paramId 43 --- definitions/grib1/localConcepts/ecmf/units.def | 2 +- definitions/grib2/units.def | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/units.def b/definitions/grib1/localConcepts/ecmf/units.def index a5789c54c..bc63e7cd7 100644 --- a/definitions/grib1/localConcepts/ecmf/units.def +++ b/definitions/grib1/localConcepts/ecmf/units.def @@ -265,7 +265,7 @@ indicatorOfParameter = 42 ; } #Soil type -'~' = { +'(Code table 4.213)' = { table2Version = 128 ; indicatorOfParameter = 43 ; } diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index fe33403b3..3822020b3 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -226,7 +226,7 @@ typeOfFirstFixedSurface = 1 ; } #Soil type -'~' = { +'(Code table 4.213)' = { discipline = 2 ; parameterCategory = 3 ; parameterNumber = 0 ; From 2faecdb54b77b79ed448faad616b2bb0c56df7c0 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 6 Jun 2024 12:35:28 +0000 Subject: [PATCH 170/196] ECC-1835: GRIB2: Time-mean parameters for ERA6 on pressure levels --- definitions/grib2/cfVarName.def | 28 ++++++++++++++++++++++++++++ definitions/grib2/name.def | 28 ++++++++++++++++++++++++++++ definitions/grib2/paramId.def | 28 ++++++++++++++++++++++++++++ definitions/grib2/shortName.def | 28 ++++++++++++++++++++++++++++ definitions/grib2/units.def | 28 ++++++++++++++++++++++++++++ 5 files changed, 140 insertions(+) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 23f21f92b..b8f5167ce 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -4916,6 +4916,27 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean wind speed +'avg_ws' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean pressure +'avg_pres' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean potential vorticity +'avg_pv' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 14 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean specific rain water content 'avg_crwc' = { discipline = 0 ; @@ -5136,6 +5157,13 @@ parameterNumber = 4 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean clear air turbulence (CAT) +'avg_cat' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 29 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean discharge from rivers or streams 'avg_dis' = { discipline = 1 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 28662c804..5549e2347 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -4916,6 +4916,27 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean wind speed +'Time-mean wind speed' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean pressure +'Time-mean pressure' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean potential vorticity +'Time-mean potential vorticity' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 14 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean specific rain water content 'Time-mean specific rain water content' = { discipline = 0 ; @@ -5136,6 +5157,13 @@ parameterNumber = 4 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean clear air turbulence (CAT) +'Time-mean clear air turbulence (CAT)' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 29 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean discharge from rivers or streams 'Time-mean discharge from rivers or streams' = { discipline = 1 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 79cac4f50..d46e87724 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -4916,6 +4916,27 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean wind speed +'235097' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean pressure +'235098' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean potential vorticity +'235100' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 14 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean specific rain water content '235101' = { discipline = 0 ; @@ -5136,6 +5157,13 @@ parameterNumber = 4 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean clear air turbulence (CAT) +'235262' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 29 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean discharge from rivers or streams '235270' = { discipline = 1 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 0069ad87e..98e7bfd79 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -4916,6 +4916,27 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean wind speed +'avg_ws' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean pressure +'avg_pres' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean potential vorticity +'avg_pv' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 14 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean specific rain water content 'avg_crwc' = { discipline = 0 ; @@ -5136,6 +5157,13 @@ parameterNumber = 4 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean clear air turbulence (CAT) +'avg_cat' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 29 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean discharge from rivers or streams 'avg_dis' = { discipline = 1 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 3822020b3..23520ecec 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -4916,6 +4916,27 @@ parameterNumber = 18 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean wind speed +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean pressure +'Pa' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean potential vorticity +'K m**2 kg**-1 s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 14 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean specific rain water content 'kg kg**-1' = { discipline = 0 ; @@ -5136,6 +5157,13 @@ parameterNumber = 4 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean clear air turbulence (CAT) +'m**2/3 s**-1' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 29 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean discharge from rivers or streams 'm**3 s**-1' = { discipline = 1 ; From 76179dc5183bd34083fa9497b2a0b7e630894f67 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 6 Jun 2024 12:49:11 +0000 Subject: [PATCH 171/196] ECC-1835: GRIB2: Time-mean parameters for ERA6 on pressure levels (part 2) --- .../grib2/localConcepts/uerra/cfVarName.def | 41 +++++++++++++++++++ .../grib2/localConcepts/uerra/name.def | 41 +++++++++++++++++++ .../grib2/localConcepts/uerra/paramId.def | 41 +++++++++++++++++++ .../grib2/localConcepts/uerra/shortName.def | 41 +++++++++++++++++++ .../grib2/localConcepts/uerra/units.def | 41 +++++++++++++++++++ 5 files changed, 205 insertions(+) diff --git a/definitions/grib2/localConcepts/uerra/cfVarName.def b/definitions/grib2/localConcepts/uerra/cfVarName.def index 2b45a70b1..f7f2d915c 100644 --- a/definitions/grib2/localConcepts/uerra/cfVarName.def +++ b/definitions/grib2/localConcepts/uerra/cfVarName.def @@ -17,6 +17,33 @@ scaledValueOfFirstFixedSurface = 200 ; scaleFactorOfFirstFixedSurface = 0 ; } +#Wind speed +'ws' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Wind speed +'ws' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Wind speed +'ws' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Sea ice area fraction 'ci' = { discipline = 10 ; @@ -75,6 +102,20 @@ indicatorOfUnitForTimeRange = 1 ; typeOfStatisticalProcessing = 2 ; } +#Pressure +'pres' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Potential vorticity +'pv' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 14 ; + typeOfStatisticalProcessing = 0 ; + } #Specific rain water content 'crwc' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/name.def b/definitions/grib2/localConcepts/uerra/name.def index 95013cab1..da1a828b1 100644 --- a/definitions/grib2/localConcepts/uerra/name.def +++ b/definitions/grib2/localConcepts/uerra/name.def @@ -17,6 +17,33 @@ scaledValueOfFirstFixedSurface = 200 ; scaleFactorOfFirstFixedSurface = 0 ; } +#Wind speed +'Wind speed' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Wind speed +'Wind speed' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Wind speed +'Wind speed' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Sea ice area fraction 'Sea ice area fraction' = { discipline = 10 ; @@ -75,6 +102,20 @@ indicatorOfUnitForTimeRange = 1 ; typeOfStatisticalProcessing = 2 ; } +#Pressure +'Pressure' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Potential vorticity +'Potential vorticity' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 14 ; + typeOfStatisticalProcessing = 0 ; + } #Specific rain water content 'Specific rain water content' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/paramId.def b/definitions/grib2/localConcepts/uerra/paramId.def index e7e0a9d65..729478df6 100644 --- a/definitions/grib2/localConcepts/uerra/paramId.def +++ b/definitions/grib2/localConcepts/uerra/paramId.def @@ -17,6 +17,33 @@ scaledValueOfFirstFixedSurface = 200 ; scaleFactorOfFirstFixedSurface = 0 ; } +#Wind speed +'10' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Wind speed +'10' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Wind speed +'10' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Sea ice area fraction '31' = { discipline = 10 ; @@ -75,6 +102,20 @@ indicatorOfUnitForTimeRange = 1 ; typeOfStatisticalProcessing = 2 ; } +#Pressure +'54' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Potential vorticity +'60' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 14 ; + typeOfStatisticalProcessing = 0 ; + } #Specific rain water content '75' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/shortName.def b/definitions/grib2/localConcepts/uerra/shortName.def index 113e3e824..b16b48100 100644 --- a/definitions/grib2/localConcepts/uerra/shortName.def +++ b/definitions/grib2/localConcepts/uerra/shortName.def @@ -17,6 +17,33 @@ scaledValueOfFirstFixedSurface = 200 ; scaleFactorOfFirstFixedSurface = 0 ; } +#Wind speed +'ws' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Wind speed +'ws' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Wind speed +'ws' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Sea ice area fraction 'ci' = { discipline = 10 ; @@ -75,6 +102,20 @@ indicatorOfUnitForTimeRange = 1 ; typeOfStatisticalProcessing = 2 ; } +#Pressure +'pres' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Potential vorticity +'pv' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 14 ; + typeOfStatisticalProcessing = 0 ; + } #Specific rain water content 'crwc' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/units.def b/definitions/grib2/localConcepts/uerra/units.def index 57ef3426f..f86099f59 100644 --- a/definitions/grib2/localConcepts/uerra/units.def +++ b/definitions/grib2/localConcepts/uerra/units.def @@ -17,6 +17,33 @@ scaledValueOfFirstFixedSurface = 200 ; scaleFactorOfFirstFixedSurface = 0 ; } +#Wind speed +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Wind speed +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Wind speed +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Sea ice area fraction '(0 - 1)' = { discipline = 10 ; @@ -75,6 +102,20 @@ indicatorOfUnitForTimeRange = 1 ; typeOfStatisticalProcessing = 2 ; } +#Pressure +'Pa' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Potential vorticity +'K m**2 kg**-1 s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 14 ; + typeOfStatisticalProcessing = 0 ; + } #Specific rain water content 'kg kg**-1' = { discipline = 0 ; From 9cd97a7d73c79255a30021047dd2edf517947e25 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 6 Jun 2024 15:22:06 +0100 Subject: [PATCH 172/196] ECC-1840: BUFR: Problem with edition 3 typicalDate and typicalTime --- definitions/bufr/section.1.3.def | 3 ++- tests/CMakeLists.txt | 1 + tests/bufr_ecc-1840.sh | 35 ++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100755 tests/bufr_ecc-1840.sh diff --git a/definitions/bufr/section.1.3.def b/definitions/bufr/section.1.3.def index 84ac947b0..811b0955a 100644 --- a/definitions/bufr/section.1.3.def +++ b/definitions/bufr/section.1.3.def @@ -20,7 +20,8 @@ unsigned[1] localTablesVersionNumber : dump; transient typicalCentury=21; unsigned[1] typicalYearOfCentury : dump; -transient typicalYear = (typicalCentury - 1) * 100 + typicalYearOfCentury : no_copy; +# ECC-1840: Use the 'evaluate' accessor so typicalYear is updated if user changes typicalCentury +meta typicalYear evaluate( (typicalCentury - 1) * 100 + typicalYearOfCentury ) : no_copy; unsigned[1] typicalMonth : dump; unsigned[1] typicalDay : dump; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 71116ab24..0169e4986 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -156,6 +156,7 @@ if( HAVE_BUILD_TOOLS ) bufr_ecc-1304 bufr_ecc-1347 bufr_ecc-1395 + bufr_ecc-1840 bufr_json_samples bufr_ecc-359 bufr_ecc-517 diff --git a/tests/bufr_ecc-1840.sh b/tests/bufr_ecc-1840.sh new file mode 100755 index 000000000..34acb5bf6 --- /dev/null +++ b/tests/bufr_ecc-1840.sh @@ -0,0 +1,35 @@ +#!/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 + +REDIRECT=/dev/null + +label="bufr_ecc-1840_test" +tempBufr=temp.$label.bufr +tempFilt=temp.$label.filt +tempLog=temp.$label.log +tempOut=temp.$label.txt +tempRef=temp.$label.ref + +sample_bufr3=$ECCODES_SAMPLES_PATH/BUFR3.tmpl + +# This sample has: +# typicalYearOfCentury = 12 +# typicalMonth = 10 +# typicalDay = 31 +result=$(${tools_dir}/bufr_get -p typicalYear,typicalDate $sample_bufr3) +[ "$result" = "2012 20121031" ] +result=$(${tools_dir}/bufr_get -p typicalYear,typicalDate -s typicalCentury=20 $sample_bufr3) +[ "$result" = "1912 19121031" ] + + +# Clean up +rm -f $tempBufr $tempFilt $tempLog $tempOut $tempRef From fda9677fd9ee1f6c8805721578cf8c84fedd7a3d Mon Sep 17 00:00:00 2001 From: Philipp Geier Date: Fri, 7 Jun 2024 09:20:57 +0200 Subject: [PATCH 173/196] Update ci.yml to fix notification The notify step was skipped on failing jobs because the `always()` was not handled properly. Instead of `always() && ${{ ... }}` we have to pull in the always `${{ always() && .. }}` --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16c400bec..17873147b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: - private-downstream-ci - downstream-ci-hpc - private-downstream-ci-hpc - if: always() && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} + if: ${{ always() && !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} steps: - name: Trigger Teams notification uses: ecmwf-actions/notify-teams@v1 From ca0c5f100504d8e1e128cfca2e56bb45be806a5c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 7 Jun 2024 13:41:26 +0000 Subject: [PATCH 174/196] ECC-1841: GRIB2: Overload wind components/speed for ERA6 with heights... --- .../grib2/localConcepts/era6/cfName.def | 36 +++++++++++++ definitions/grib2/localConcepts/era6/name.def | 54 +++++++++++++++++++ .../grib2/localConcepts/era6/paramId.def | 54 +++++++++++++++++++ .../grib2/localConcepts/era6/shortName.def | 54 +++++++++++++++++++ .../grib2/localConcepts/era6/units.def | 54 +++++++++++++++++++ 5 files changed, 252 insertions(+) diff --git a/definitions/grib2/localConcepts/era6/cfName.def b/definitions/grib2/localConcepts/era6/cfName.def index 04675741a..e86ee85d4 100644 --- a/definitions/grib2/localConcepts/era6/cfName.def +++ b/definitions/grib2/localConcepts/era6/cfName.def @@ -1,4 +1,40 @@ # Automatically generated by ./create_def.pl, do not edit +#U component of wind +'eastward_wind' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#U component of wind +'eastward_wind' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#V component of wind +'northward_wind' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#V component of wind +'northward_wind' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #Snow depth 'lwe_thickness_of_surface_snow_amount' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/era6/name.def b/definitions/grib2/localConcepts/era6/name.def index 9505d62b1..af79f7845 100644 --- a/definitions/grib2/localConcepts/era6/name.def +++ b/definitions/grib2/localConcepts/era6/name.def @@ -17,6 +17,24 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Wind speed +'Wind speed' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Wind speed +'Wind speed' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #UV visible albedo for direct radiation (climatological) 'UV visible albedo for direct radiation (climatological)' = { localTablesVersion = 1 ; @@ -74,6 +92,42 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#U component of wind +'U component of wind' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#U component of wind +'U component of wind' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#V component of wind +'V component of wind' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#V component of wind +'V component of wind' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #Snow depth 'Snow depth' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/era6/paramId.def b/definitions/grib2/localConcepts/era6/paramId.def index fa04cbd0c..efa120d15 100644 --- a/definitions/grib2/localConcepts/era6/paramId.def +++ b/definitions/grib2/localConcepts/era6/paramId.def @@ -17,6 +17,24 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Wind speed +'10' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Wind speed +'10' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #UV visible albedo for direct radiation (climatological) '15' = { localTablesVersion = 1 ; @@ -74,6 +92,42 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#U component of wind +'131' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#U component of wind +'131' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#V component of wind +'132' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#V component of wind +'132' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #Snow depth '141' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/era6/shortName.def b/definitions/grib2/localConcepts/era6/shortName.def index 31ab28239..118656c0f 100644 --- a/definitions/grib2/localConcepts/era6/shortName.def +++ b/definitions/grib2/localConcepts/era6/shortName.def @@ -17,6 +17,24 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Wind speed +'ws' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Wind speed +'ws' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #UV visible albedo for direct radiation (climatological) 'aluvp' = { localTablesVersion = 1 ; @@ -74,6 +92,42 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#U component of wind +'u' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#U component of wind +'u' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#V component of wind +'v' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#V component of wind +'v' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #Snow depth 'sd' = { localTablesVersion = 1 ; diff --git a/definitions/grib2/localConcepts/era6/units.def b/definitions/grib2/localConcepts/era6/units.def index f80451dd4..edd86225f 100644 --- a/definitions/grib2/localConcepts/era6/units.def +++ b/definitions/grib2/localConcepts/era6/units.def @@ -17,6 +17,24 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Wind speed +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Wind speed +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #UV visible albedo for direct radiation (climatological) '(0 - 1)' = { localTablesVersion = 1 ; @@ -74,6 +92,42 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#U component of wind +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#U component of wind +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#V component of wind +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 100 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#V component of wind +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 200 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #Snow depth 'm of water equivalent' = { localTablesVersion = 1 ; From 3699fac49ef51b5ea1cf325ff6b0b798e61a49fb Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 24 Apr 2024 10:59:01 +0000 Subject: [PATCH 175/196] ECC-1802: Relaxed step units rule --- src/step.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/step.cc b/src/step.cc index 81bdaeeb3..90c8ea2e1 100644 --- a/src/step.cc +++ b/src/step.cc @@ -32,10 +32,15 @@ Step step_from_string(const std::string& step, const Unit& force_unit) std::string unit_str = match[2]; Unit unit; if (unit_str.size() != 0) { - if (force_unit == Unit{Unit::Value::MISSING}) + if (force_unit == Unit{Unit::Value::MISSING}) { unit = Unit{unit_str}; - else - throw std::runtime_error("Cannot force unit when unit is specified in step string"); + } + else { + if (Unit{unit_str} == force_unit) + unit = Unit{unit_str}; + else + throw std::runtime_error("Cannot force unit when unit is specified in step string"); + } } else { if (force_unit == Unit{Unit::Value::MISSING}) From 57026bcd0184d0f0a495bab18ade80abd8f5edd3 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 11 Jun 2024 09:14:33 +0000 Subject: [PATCH 176/196] ECC-1802: Add tests --- tests/grib_sub_hourly.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/grib_sub_hourly.sh b/tests/grib_sub_hourly.sh index bb7bac891..dfbf145f5 100755 --- a/tests/grib_sub_hourly.sh +++ b/tests/grib_sub_hourly.sh @@ -62,6 +62,37 @@ fi instantaneous_field=$data_dir/reduced_gaussian_surface.grib2 accumulated_field=$data_dir/reduced_gaussian_sub_area.grib2 +# ECC-1802: Relaxation of the "Step Units Rule": +# The updated rule permits the simultaneous assignment of the same step unit to both 'stepUnits' and 'step*' keys +in="$instantaneous_field" +low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s" +${tools_dir}/grib_set -s stepUnits=s,step=11s $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 s" +${tools_dir}/grib_set -s stepUnits=m,step=11m $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 m" +${tools_dir}/grib_set -s stepUnits=h,step=11h $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 h" +${tools_dir}/grib_set -s step=11s,stepUnits=s $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 s" +${tools_dir}/grib_set -s step=11m,stepUnits=m $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 m" +${tools_dir}/grib_set -s step=11h,stepUnits=h $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 h" + +in="$accumulated_field" +low_level_keys="forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s" +${tools_dir}/grib_set -s stepUnits=s,stepRange=11s-181s $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 s 170 s" +${tools_dir}/grib_set -s stepUnits=m,stepRange=11m-181m $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 m 170 m" +${tools_dir}/grib_set -s stepUnits=h,stepRange=11h-181h $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 h 170 h" +${tools_dir}/grib_set -s stepRange=11s-181s,stepUnits=s $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 s 170 s" +${tools_dir}/grib_set -s stepRange=11m-181m,stepUnits=m $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 m 170 m" +${tools_dir}/grib_set -s stepRange=11h-181h,stepUnits=h $in $temp +grib_check_key_equals $temp "-p $low_level_keys" "11 h 170 h" # ECC-1813: Test that we can set the stepUnits without setting the step in="$instantaneous_field" From eb0080fe0dd5fc1c8caebfa2f2ff46aecf5c5078 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 12 Jun 2024 10:58:49 +0100 Subject: [PATCH 177/196] ECC-1706: KNMI fixed --- definitions/common/c-1.table | 4 ++-- definitions/common/c-11.table | 4 ++-- definitions/grib3/centre.table | 4 ++-- src/bufr_util.cc | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/definitions/common/c-1.table b/definitions/common/c-1.table index c50d48251..cfe62d96e 100644 --- a/definitions/common/c-1.table +++ b/definitions/common/c-1.table @@ -64,7 +64,7 @@ 96 96 Athens 97 97 European Space Agency (ESA) 98 ecmf European Centre for Medium-Range Weather Forecasts -99 99 DeBilt, Netherlands +99 knmi DeBilt, Netherlands 110 110 Hong-Kong 160 160 US NOAA/NESDIS 173 nasa US National Aeronautics and Space Administration (NASA) @@ -85,7 +85,7 @@ 235 ingv INGV 239 crfc CERFAX 244 vuwien VUWien -245 knmi KNMI +245 245 Ukraine (NMC) 246 ifmk IfM-Kiel 247 hadc Hadley Centre 250 cosmo COnsortium for Small scale MOdelling (COSMO) diff --git a/definitions/common/c-11.table b/definitions/common/c-11.table index 6750fda58..776b69bf4 100644 --- a/definitions/common/c-11.table +++ b/definitions/common/c-11.table @@ -85,7 +85,7 @@ 96 96 Athens 97 97 European Space Agency (ESA) 98 ecmf European Centre for Medium-Range Weather Forecasts -99 99 DeBilt, Netherlands +99 knmi DeBilt, Netherlands 100 100 Brazzaville 101 101 Abidjan 102 102 Libya (NMC) @@ -218,7 +218,7 @@ 242 242 Romania (NMC) 243 243 Syrian Arab Republic (NMC) 244 vuwien VUWien -245 knmi KNMI +245 245 Ukraine (NMC) 246 ifmk IfM-Kiel 247 hadc Hadley Centre 248 248 Montenegro (NMC) diff --git a/definitions/grib3/centre.table b/definitions/grib3/centre.table index 206305d7b..69059e951 100644 --- a/definitions/grib3/centre.table +++ b/definitions/grib3/centre.table @@ -63,7 +63,7 @@ 96 96 Athens 97 97 European Space Agency (ESA) 98 ecmf European Centre for Medium-Range Weather Forecasts -99 99 DeBilt, Netherlands +99 knmi DeBilt, Netherlands #100 to 109 Reserved for centres in Region I which are not in the list above 110 110 Hong-Kong #111 to 133 Reserved for centres in Region II which are not in the list above @@ -104,7 +104,7 @@ 241 241 Monaco 242 242 Romania (NMC) 244 vuwien VUWien -245 knmi KNMI +245 245 Ukraine (NMC) 246 ifmk IfM-Kiel 247 hadc Hadley Centre 250 cosmo COnsortium for Small scale MOdelling (COSMO) diff --git a/src/bufr_util.cc b/src/bufr_util.cc index 95ff8eeb2..22874a3b5 100644 --- a/src/bufr_util.cc +++ b/src/bufr_util.cc @@ -760,7 +760,7 @@ static const char* codes_bufr_header_get_centre_name(long edition, long centre_c return "crfc"; case 244: return "vuwien"; - case 245: + case 99: return "knmi"; case 246: return "ifmk"; From 411b76211ae62a637766d94f6664acfe7f8638dd Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 12 Jun 2024 11:11:53 +0100 Subject: [PATCH 178/196] ECC-1706: Hadley Centre --- definitions/common/c-1.table | 2 +- definitions/common/c-11.table | 2 +- definitions/grib3/centre.table | 2 +- src/bufr_util.cc | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/definitions/common/c-1.table b/definitions/common/c-1.table index cfe62d96e..408af498d 100644 --- a/definitions/common/c-1.table +++ b/definitions/common/c-1.table @@ -87,7 +87,7 @@ 244 vuwien VUWien 245 245 Ukraine (NMC) 246 ifmk IfM-Kiel -247 hadc Hadley Centre +247 247 Operational Programme for the Exchange of weather RAdar information (OPERA) - EUMETNET 250 cosmo COnsortium for Small scale MOdelling (COSMO) 251 251 Meteorological Cooperation on Operational NWP (MetCoOp) 252 mpim Max Planck Institute for Meteorology (MPI-M) diff --git a/definitions/common/c-11.table b/definitions/common/c-11.table index 776b69bf4..47769ffb9 100644 --- a/definitions/common/c-11.table +++ b/definitions/common/c-11.table @@ -220,7 +220,7 @@ 244 vuwien VUWien 245 245 Ukraine (NMC) 246 ifmk IfM-Kiel -247 hadc Hadley Centre +247 247 Operational Programme for the Exchange of weather RAdar information (OPERA) - EUMETNET 248 248 Montenegro (NMC) 249 249 Barcelona Dust Forecast Center 250 cosmo COnsortium for Small scale MOdelling (COSMO) diff --git a/definitions/grib3/centre.table b/definitions/grib3/centre.table index 69059e951..59bb85cec 100644 --- a/definitions/grib3/centre.table +++ b/definitions/grib3/centre.table @@ -106,7 +106,7 @@ 244 vuwien VUWien 245 245 Ukraine (NMC) 246 ifmk IfM-Kiel -247 hadc Hadley Centre +247 247 Operational Programme for the Exchange of weather RAdar information (OPERA) - EUMETNET 250 cosmo COnsortium for Small scale MOdelling (COSMO) 251 251 Meteorological Cooperation on Operational NWP (MetCoOp) 252 mpim Max Planck Institute for Meteorology (MPI-M) diff --git a/src/bufr_util.cc b/src/bufr_util.cc index 22874a3b5..7f84d7ab7 100644 --- a/src/bufr_util.cc +++ b/src/bufr_util.cc @@ -764,8 +764,6 @@ static const char* codes_bufr_header_get_centre_name(long edition, long centre_c return "knmi"; case 246: return "ifmk"; - case 247: - return "hadc"; case 250: return "cosmo"; case 252: From d5ecfd8743b83ec20414e712909f908bb57007e2 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 12 Jun 2024 11:50:53 +0100 Subject: [PATCH 179/196] ECC-1706 --- definitions/common/c-1.table | 4 ++-- definitions/common/c-11.table | 4 ++-- src/bufr_util.cc | 9 ++------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/definitions/common/c-1.table b/definitions/common/c-1.table index 408af498d..2d9954a38 100644 --- a/definitions/common/c-1.table +++ b/definitions/common/c-1.table @@ -84,9 +84,9 @@ 233 eidb Dublin 235 ingv INGV 239 crfc CERFAX -244 vuwien VUWien +244 244 The former Yugoslav Republic of Macedonia (NMC) 245 245 Ukraine (NMC) -246 ifmk IfM-Kiel +246 246 Republic of Moldova (NMC) 247 247 Operational Programme for the Exchange of weather RAdar information (OPERA) - EUMETNET 250 cosmo COnsortium for Small scale MOdelling (COSMO) 251 251 Meteorological Cooperation on Operational NWP (MetCoOp) diff --git a/definitions/common/c-11.table b/definitions/common/c-11.table index 47769ffb9..d96d7e267 100644 --- a/definitions/common/c-11.table +++ b/definitions/common/c-11.table @@ -217,9 +217,9 @@ 241 241 Monaco 242 242 Romania (NMC) 243 243 Syrian Arab Republic (NMC) -244 vuwien VUWien +244 244 The former Yugoslav Republic of Macedonia (NMC) 245 245 Ukraine (NMC) -246 ifmk IfM-Kiel +246 246 Republic of Moldova (NMC) 247 247 Operational Programme for the Exchange of weather RAdar information (OPERA) - EUMETNET 248 248 Montenegro (NMC) 249 249 Barcelona Dust Forecast Center diff --git a/src/bufr_util.cc b/src/bufr_util.cc index 7f84d7ab7..56a4977c0 100644 --- a/src/bufr_util.cc +++ b/src/bufr_util.cc @@ -682,9 +682,8 @@ int codes_bufr_extract_headers_malloc(grib_context* c, const char* filename, cod return GRIB_SUCCESS; } -static const char* codes_bufr_header_get_centre_name(long edition, long centre_code) +static const char* codes_bufr_header_get_centre_name(long centre_code) { - (void)edition; switch (centre_code) { case 1: return "ammc"; @@ -758,12 +757,8 @@ static const char* codes_bufr_header_get_centre_name(long edition, long centre_c return "ingv"; case 239: return "crfc"; - case 244: - return "vuwien"; case 99: return "knmi"; - case 246: - return "ifmk"; case 250: return "cosmo"; case 252: @@ -869,7 +864,7 @@ int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char* v *len = snprintf(val, 32, "%ld", bh->bufrHeaderCentre); else if (strcmp(key, "centre") == 0) { - const char* centre_str = codes_bufr_header_get_centre_name(bh->edition, bh->bufrHeaderCentre); + const char* centre_str = codes_bufr_header_get_centre_name(bh->bufrHeaderCentre); if (centre_str) *len = snprintf(val, 32, "%s", centre_str); else From 1f2e30f60369867c417a9a833108dfe2abca2ebb Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 14 Jun 2024 16:36:03 +0100 Subject: [PATCH 180/196] Tools: Fix case with bitmap --- tests/grib_check_gaussian_grids.sh | 2 +- tools/grib_check_gaussian_grid.cc | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/grib_check_gaussian_grids.sh b/tests/grib_check_gaussian_grids.sh index 4f16966e4..21d639291 100755 --- a/tests/grib_check_gaussian_grids.sh +++ b/tests/grib_check_gaussian_grids.sh @@ -91,7 +91,7 @@ ${tools_dir}/grib_check_gaussian_grid -f -v $tempGrib 2> $tempText status=$? set -e [ $status -eq 1 ] -grep -q "Error: Sum of pl array 50662 does not match numberOfValues 44" $tempText +grep -q "Error: Sum of pl array 50662 does not match size of values array 44" $tempText # Octahedral # set +e diff --git a/tools/grib_check_gaussian_grid.cc b/tools/grib_check_gaussian_grid.cc index 9c0e8ab2a..9fb0ddc9b 100644 --- a/tools/grib_check_gaussian_grid.cc +++ b/tools/grib_check_gaussian_grid.cc @@ -86,7 +86,8 @@ 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, angleSubdivisions; + long edition = 0, N = 0, Nj = 0, numberOfDataPoints, angleSubdivisions; + size_t numberOfValues = 0; size_t len = 0, sizeOfValuesArray = 0; double* lats = NULL; long* pl = NULL; @@ -117,7 +118,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_size(h, "values", &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); @@ -208,8 +209,8 @@ 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); + if ( (size_t)pl_sum != numberOfValues ) { + error(filename, msg_num, "Sum of pl array %ld does not match size of values array %zu\n", pl_sum, numberOfValues); } GRIB_CHECK(grib_get_long(h, "isOctahedral", &is_octahedral), 0); if (is_octahedral) { @@ -233,7 +234,7 @@ static int process_file(const char* filename) GRIB_CHECK(grib_get_size(h, "values", &sizeOfValuesArray), 0); if (sizeOfValuesArray != (size_t)numberOfDataPoints) { - error(filename, msg_num, "Number of data points %d different from size of values array %d\n", + error(filename, msg_num, "Number of data points %ld different from size of values array %zu\n", numberOfDataPoints, sizeOfValuesArray); } From 99cfebb1aaaef858f6443241f3c4ba6b4f54c938 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 15 Jun 2024 13:21:06 +0100 Subject: [PATCH 181/196] Tools: Deal with input being a directory --- tests/grib_check_gaussian_grids.sh | 2 +- tools/grib_check_gaussian_grid.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/grib_check_gaussian_grids.sh b/tests/grib_check_gaussian_grids.sh index 21d639291..3abf03942 100755 --- a/tests/grib_check_gaussian_grids.sh +++ b/tests/grib_check_gaussian_grids.sh @@ -112,7 +112,7 @@ set -e [ $status -eq 1 ] ${tools_dir}/grib_check_gaussian_grid -v $data_dir > $tempText -grep -q "not a regular file" $tempText +grep -q "is a directory" $tempText ${tools_dir}/grib_check_gaussian_grid -v $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempText grep -q "ignoring" $tempText diff --git a/tools/grib_check_gaussian_grid.cc b/tools/grib_check_gaussian_grid.cc index 9fb0ddc9b..666658490 100644 --- a/tools/grib_check_gaussian_grid.cc +++ b/tools/grib_check_gaussian_grid.cc @@ -69,9 +69,9 @@ static int process_file(const char* filename) grib_handle* h = NULL; FILE* in = NULL; - if (!path_is_regular_file(filename)) { + if (path_is_directory(filename)) { if (verbose) - printf(" WARNING: '%s' not a regular file! Ignoring\n", filename); + printf(" WARNING: '%s' is a directory! Ignoring\n", filename); return GRIB_IO_PROBLEM; } From 3b7abcf0e7dc8048b243ac043396784731571e85 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 20 Jun 2024 10:36:50 +0000 Subject: [PATCH 182/196] ECC-1842: GRIB2: Modification of ocean parameter encodings to support multiple typeOfLevel entries --- definitions/grib2/cfName.def | 12 ----- definitions/grib2/cfVarName.def | 96 --------------------------------- definitions/grib2/name.def | 96 --------------------------------- definitions/grib2/paramId.def | 96 --------------------------------- definitions/grib2/shortName.def | 96 --------------------------------- definitions/grib2/units.def | 96 --------------------------------- 6 files changed, 492 deletions(-) diff --git a/definitions/grib2/cfName.def b/definitions/grib2/cfName.def index a3105477e..c48900633 100644 --- a/definitions/grib2/cfName.def +++ b/definitions/grib2/cfName.def @@ -282,12 +282,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Depth of 20 C isotherm 'depth_of_isosurface_of_sea_water_potential_temperature' = { @@ -318,12 +312,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 1 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Heat flux correction 'heat_flux_correction' = { diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index b8f5167ce..a0d19c0d9 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -7807,12 +7807,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Sea surface temperature 'tos' = { @@ -7903,36 +7897,18 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 4 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Northward surface stress 'tauvon' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 6 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Eastward surface stress 'tauuoe' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 5 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Y-component of surface stress 'tauvo' = { @@ -8095,12 +8071,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 1 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Steric change in sea surface height 'stheig' = { @@ -8275,24 +8245,12 @@ 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' = { @@ -8341,12 +8299,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 21 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Vertically integrated sea water practical salinity in the upper 300 m 'sc300v' = { @@ -8934,12 +8886,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean sea surface temperature @@ -9038,12 +8984,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 4 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean northward surface stress @@ -9051,12 +8991,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 6 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean eastward surface stress @@ -9064,12 +8998,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 5 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time mean Y-component of surface stress @@ -9246,12 +9174,6 @@ 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 @@ -9441,12 +9363,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 15 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean eastward surface sea water velocity @@ -9454,12 +9370,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 14 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean heat content surface to 26C isotherm @@ -9513,12 +9423,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 21 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean vertically integrated sea water practical salinity in the upper 300 m diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 5549e2347..2bd18768e 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -7807,12 +7807,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Sea surface temperature 'Sea surface temperature' = { @@ -7903,36 +7897,18 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 4 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Northward surface stress 'Northward surface stress' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 6 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Eastward surface stress 'Eastward surface stress' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 5 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Y-component of surface stress 'Y-component of surface stress' = { @@ -8095,12 +8071,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 1 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Steric change in sea surface height 'Steric change in sea surface height' = { @@ -8275,24 +8245,12 @@ 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' = { @@ -8341,12 +8299,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 21 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Vertically integrated sea water practical salinity in the upper 300 m 'Vertically integrated sea water practical salinity in the upper 300 m' = { @@ -8934,12 +8886,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean sea surface temperature @@ -9038,12 +8984,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 4 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean northward surface stress @@ -9051,12 +8991,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 6 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean eastward surface stress @@ -9064,12 +8998,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 5 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time mean Y-component of surface stress @@ -9246,12 +9174,6 @@ 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 @@ -9441,12 +9363,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 15 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean eastward surface sea water velocity @@ -9454,12 +9370,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 14 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean heat content surface to 26C isotherm @@ -9513,12 +9423,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 21 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean vertically integrated sea water practical salinity in the upper 300 m diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index d46e87724..9249969df 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -7807,12 +7807,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Sea surface temperature '262101' = { @@ -7903,36 +7897,18 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 4 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Northward surface stress '262109' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 6 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Eastward surface stress '262110' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 5 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Y-component of surface stress '262111' = { @@ -8095,12 +8071,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 1 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Steric change in sea surface height '262125' = { @@ -8275,24 +8245,12 @@ 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' = { @@ -8341,12 +8299,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 21 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Vertically integrated sea water practical salinity in the upper 300 m '262146' = { @@ -8934,12 +8886,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean sea surface temperature @@ -9038,12 +8984,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 4 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean northward surface stress @@ -9051,12 +8991,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 6 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean eastward surface stress @@ -9064,12 +8998,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 5 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time mean Y-component of surface stress @@ -9246,12 +9174,6 @@ 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 @@ -9441,12 +9363,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 15 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean eastward surface sea water velocity @@ -9454,12 +9370,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 14 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean heat content surface to 26C isotherm @@ -9513,12 +9423,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 21 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean vertically integrated sea water practical salinity in the upper 300 m diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 98e7bfd79..6713cd0fa 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -7807,12 +7807,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Sea surface temperature 'tos' = { @@ -7903,36 +7897,18 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 4 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Northward surface stress 'tauvon' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 6 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Eastward surface stress 'tauuoe' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 5 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Y-component of surface stress 'tauvo' = { @@ -8095,12 +8071,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 1 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Steric change in sea surface height 'stheig' = { @@ -8275,24 +8245,12 @@ 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' = { @@ -8341,12 +8299,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 21 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Vertically integrated sea water practical salinity in the upper 300 m 'sc300v' = { @@ -8934,12 +8886,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean sea surface temperature @@ -9038,12 +8984,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 4 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean northward surface stress @@ -9051,12 +8991,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 6 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean eastward surface stress @@ -9064,12 +8998,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 5 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time mean Y-component of surface stress @@ -9246,12 +9174,6 @@ 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 @@ -9441,12 +9363,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 15 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean eastward surface sea water velocity @@ -9454,12 +9370,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 14 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean heat content surface to 26C isotherm @@ -9513,12 +9423,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 21 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean vertically integrated sea water practical salinity in the upper 300 m diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 23520ecec..121d74eca 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -7807,12 +7807,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Sea surface temperature 'K' = { @@ -7903,36 +7897,18 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 4 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Northward surface stress 'N m**-2' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 6 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Eastward surface stress 'N m**-2' = { discipline = 10 ; parameterCategory = 3 ; parameterNumber = 5 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Y-component of surface stress 'N m**-2' = { @@ -8095,12 +8071,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 1 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Steric change in sea surface height 'm' = { @@ -8275,24 +8245,12 @@ 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' = { @@ -8341,12 +8299,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 21 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; } #Vertically integrated sea water practical salinity in the upper 300 m 'g kg**-1 m' = { @@ -8934,12 +8886,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 3 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean sea surface temperature @@ -9038,12 +8984,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 4 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean northward surface stress @@ -9051,12 +8991,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 6 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean eastward surface stress @@ -9064,12 +8998,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 5 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time mean Y-component of surface stress @@ -9246,12 +9174,6 @@ 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 @@ -9441,12 +9363,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 15 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean eastward surface sea water velocity @@ -9454,12 +9370,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 14 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean heat content surface to 26C isotherm @@ -9513,12 +9423,6 @@ discipline = 10 ; parameterCategory = 3 ; parameterNumber = 21 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = missing() ; - scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } #Time-mean vertically integrated sea water practical salinity in the upper 300 m From a0acf47527e2a187ebb74b9e4cf880ca53edf5f9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 20 Jun 2024 11:00:28 +0000 Subject: [PATCH 183/196] ECC-1844: MARS: Add new class 'ng' for nextGEMS --- definitions/mars/class.table | 1 + 1 file changed, 1 insertion(+) diff --git a/definitions/mars/class.table b/definitions/mars/class.table index bb740e63a..046db71d6 100644 --- a/definitions/mars/class.table +++ b/definitions/mars/class.table @@ -51,6 +51,7 @@ 50 ci CERISE project 51 ai Operational AIFS 52 ed EERIE project +53 ng nextGEMS project 99 te Test 100 at Austria 101 be Belgium From 19e15f8cb0f52b17db34976dfd9c8c1c983fa89c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 21 Jun 2024 09:12:13 +0000 Subject: [PATCH 184/196] ECC-1845: GRIB2: Time processed parameters for volumetric soil moisture --- definitions/grib2/cfVarName.def | 21 +++++++++++++++++++++ definitions/grib2/name.def | 21 +++++++++++++++++++++ definitions/grib2/paramId.def | 21 +++++++++++++++++++++ definitions/grib2/shortName.def | 21 +++++++++++++++++++++ definitions/grib2/units.def | 21 +++++++++++++++++++++ 5 files changed, 105 insertions(+) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index a0d19c0d9..59d5cb399 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -5247,6 +5247,27 @@ parameterNumber = 23 ; typeOfStatisticalProcessing = 0 ; } +#Time-maximum volumetric soil moisture +'max_vsw' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 2 ; + } +#Time-minimum volumetric soil moisture +'min_vsw' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 3 ; + } +#Time-standard-deviation volumetric soil moisture +'std_vsw' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 6 ; + } #Cross sectional area of flow in channel 'chcross' = { discipline = 1 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 2bd18768e..1ebf330ac 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -5247,6 +5247,27 @@ parameterNumber = 23 ; typeOfStatisticalProcessing = 0 ; } +#Time-maximum volumetric soil moisture +'Time-maximum volumetric soil moisture' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 2 ; + } +#Time-minimum volumetric soil moisture +'Time-minimum volumetric soil moisture' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 3 ; + } +#Time-standard-deviation volumetric soil moisture +'Time-standard-deviation volumetric soil moisture' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 6 ; + } #Cross sectional area of flow in channel 'Cross sectional area of flow in channel' = { discipline = 1 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 9249969df..440df8d15 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -5247,6 +5247,27 @@ parameterNumber = 23 ; typeOfStatisticalProcessing = 0 ; } +#Time-maximum volumetric soil moisture +'237077' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 2 ; + } +#Time-minimum volumetric soil moisture +'238077' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 3 ; + } +#Time-standard-deviation volumetric soil moisture +'239077' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 6 ; + } #Cross sectional area of flow in channel '240011' = { discipline = 1 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 6713cd0fa..c49d61bba 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -5247,6 +5247,27 @@ parameterNumber = 23 ; typeOfStatisticalProcessing = 0 ; } +#Time-maximum volumetric soil moisture +'max_vsw' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 2 ; + } +#Time-minimum volumetric soil moisture +'min_vsw' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 3 ; + } +#Time-standard-deviation volumetric soil moisture +'std_vsw' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 6 ; + } #Cross sectional area of flow in channel 'chcross' = { discipline = 1 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 121d74eca..eceea516a 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -5247,6 +5247,27 @@ parameterNumber = 23 ; typeOfStatisticalProcessing = 0 ; } +#Time-maximum volumetric soil moisture +'m**3 m**-3' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 2 ; + } +#Time-minimum volumetric soil moisture +'m**3 m**-3' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 3 ; + } +#Time-standard-deviation volumetric soil moisture +'m**3 m**-3' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 25 ; + typeOfStatisticalProcessing = 6 ; + } #Cross sectional area of flow in channel 'm**2' = { discipline = 1 ; From fbd128f54cfd9b659ed6c3c1e9900e1a5352c1f9 Mon Sep 17 00:00:00 2001 From: Sebastien Villaume Date: Fri, 26 Jan 2024 08:47:49 +0000 Subject: [PATCH 185/196] working on model name and version mapping --- definitions/grib2/local/ecmf/parameters_extras.def | 8 ++++++++ definitions/grib2/local/ecmf/section4_extras.def | 8 ++++++++ definitions/grib2/localConcepts/ecmf/modelNameConcept.def | 8 ++++++++ .../grib2/localConcepts/ecmf/modelVersionConcept_AIFS.def | 2 ++ .../grib2/localConcepts/ecmf/modelVersionConcept_IFS.def | 2 ++ definitions/grib2/section.4.def | 4 ++++ 6 files changed, 32 insertions(+) create mode 100644 definitions/grib2/local/ecmf/parameters_extras.def create mode 100644 definitions/grib2/local/ecmf/section4_extras.def create mode 100644 definitions/grib2/localConcepts/ecmf/modelNameConcept.def create mode 100644 definitions/grib2/localConcepts/ecmf/modelVersionConcept_AIFS.def create mode 100644 definitions/grib2/localConcepts/ecmf/modelVersionConcept_IFS.def diff --git a/definitions/grib2/local/ecmf/parameters_extras.def b/definitions/grib2/local/ecmf/parameters_extras.def new file mode 100644 index 000000000..18f8c8f04 --- /dev/null +++ b/definitions/grib2/local/ecmf/parameters_extras.def @@ -0,0 +1,8 @@ +# (C) Copyright 2005- ECMWF. + +#concept modelName ("unknown", "modelNameConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; + +#if (!(modelName is "unknown")) { +# concept modelVersion ("unknown", "modelVersionConcept.[modelName].def",conceptsDir2,conceptsDir1): no_copy, dump; +# alias mars.model = modelName; +#} diff --git a/definitions/grib2/local/ecmf/section4_extras.def b/definitions/grib2/local/ecmf/section4_extras.def new file mode 100644 index 000000000..18f8c8f04 --- /dev/null +++ b/definitions/grib2/local/ecmf/section4_extras.def @@ -0,0 +1,8 @@ +# (C) Copyright 2005- ECMWF. + +#concept modelName ("unknown", "modelNameConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; + +#if (!(modelName is "unknown")) { +# concept modelVersion ("unknown", "modelVersionConcept.[modelName].def",conceptsDir2,conceptsDir1): no_copy, dump; +# alias mars.model = modelName; +#} diff --git a/definitions/grib2/localConcepts/ecmf/modelNameConcept.def b/definitions/grib2/localConcepts/ecmf/modelNameConcept.def new file mode 100644 index 000000000..6deecd5ec --- /dev/null +++ b/definitions/grib2/localConcepts/ecmf/modelNameConcept.def @@ -0,0 +1,8 @@ +'IFS' = { + backgroundProcess = 255; +} +'IFS' = { + backgroundProcess = 255; +} +'AIFS' = { + backgroundProcess = 1; diff --git a/definitions/grib2/localConcepts/ecmf/modelVersionConcept_AIFS.def b/definitions/grib2/localConcepts/ecmf/modelVersionConcept_AIFS.def new file mode 100644 index 000000000..b06e75f21 --- /dev/null +++ b/definitions/grib2/localConcepts/ecmf/modelVersionConcept_AIFS.def @@ -0,0 +1,2 @@ +'v1' = { generatingProcessIdentifier = 1; } +'v2' = { generatingProcessIdentifier = 2; } diff --git a/definitions/grib2/localConcepts/ecmf/modelVersionConcept_IFS.def b/definitions/grib2/localConcepts/ecmf/modelVersionConcept_IFS.def new file mode 100644 index 000000000..38757a209 --- /dev/null +++ b/definitions/grib2/localConcepts/ecmf/modelVersionConcept_IFS.def @@ -0,0 +1,2 @@ +'cy48r1' = { generatingProcessIdentifier = 154; } +'cy47r3' = { generatingProcessIdentifier = 153; } diff --git a/definitions/grib2/section.4.def b/definitions/grib2/section.4.def index 0c45720b1..410e7bcdc 100644 --- a/definitions/grib2/section.4.def +++ b/definitions/grib2/section.4.def @@ -77,6 +77,10 @@ if (defined(marsStream) && defined(marsType)) { template parameters "grib2/parameters.def"; + +#adding hook for local extras +template_nofail section4_extras "grib2/local/[centreForLocal]/section4_extras.def"; + # Detect if this is for Generalized vertical height coordinates if (defined(typeOfFirstFixedSurface)) { if (typeOfFirstFixedSurface == 150) { From 9346a8d3989891b04641610b7bfcfd8be116d3f4 Mon Sep 17 00:00:00 2001 From: Sebastien Villaume Date: Fri, 26 Jan 2024 08:48:19 +0000 Subject: [PATCH 186/196] working on model name and version mapping --- definitions/grib2/local/ecmf/parameters_extras.def | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 definitions/grib2/local/ecmf/parameters_extras.def diff --git a/definitions/grib2/local/ecmf/parameters_extras.def b/definitions/grib2/local/ecmf/parameters_extras.def deleted file mode 100644 index 18f8c8f04..000000000 --- a/definitions/grib2/local/ecmf/parameters_extras.def +++ /dev/null @@ -1,8 +0,0 @@ -# (C) Copyright 2005- ECMWF. - -#concept modelName ("unknown", "modelNameConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; - -#if (!(modelName is "unknown")) { -# concept modelVersion ("unknown", "modelVersionConcept.[modelName].def",conceptsDir2,conceptsDir1): no_copy, dump; -# alias mars.model = modelName; -#} From eb010e9009839bc51fb1ffe247a43ac9b35fd9fa Mon Sep 17 00:00:00 2001 From: Sebastien Villaume Date: Thu, 20 Jun 2024 12:48:10 +0000 Subject: [PATCH 187/196] work on modelName and modelVersion --- definitions/grib2/local/ecmf/section4_extras.def | 11 ++++++----- .../grib2/localConcepts/ecmf/modelNameConcept.def | 3 --- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/definitions/grib2/local/ecmf/section4_extras.def b/definitions/grib2/local/ecmf/section4_extras.def index 18f8c8f04..2211aa216 100644 --- a/definitions/grib2/local/ecmf/section4_extras.def +++ b/definitions/grib2/local/ecmf/section4_extras.def @@ -1,8 +1,9 @@ # (C) Copyright 2005- ECMWF. -#concept modelName ("unknown", "modelNameConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; +concept modelName ("unknown", "modelNameConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; -#if (!(modelName is "unknown")) { -# concept modelVersion ("unknown", "modelVersionConcept.[modelName].def",conceptsDir2,conceptsDir1): no_copy, dump; -# alias mars.model = modelName; -#} +if (!(modelName is "unknown")) { + concept modelVersion ("unknown", "modelVersionConcept_[modelName].def",conceptsDir2,conceptsDir1): no_copy, dump; + alias ls.model = modelName; + alias mars.model = modelName; +} diff --git a/definitions/grib2/localConcepts/ecmf/modelNameConcept.def b/definitions/grib2/localConcepts/ecmf/modelNameConcept.def index 6deecd5ec..55b261707 100644 --- a/definitions/grib2/localConcepts/ecmf/modelNameConcept.def +++ b/definitions/grib2/localConcepts/ecmf/modelNameConcept.def @@ -1,8 +1,5 @@ 'IFS' = { backgroundProcess = 255; } -'IFS' = { - backgroundProcess = 255; -} 'AIFS' = { backgroundProcess = 1; From 5d3aa53437426eff7a144893233160d4a052fdc5 Mon Sep 17 00:00:00 2001 From: Sebastien Villaume Date: Fri, 21 Jun 2024 08:50:04 +0000 Subject: [PATCH 188/196] working on modelName/modelVersion implementation --- definitions/grib2/local/ecmf/section4_extras.def | 7 +++++-- definitions/grib2/localConcepts/era6/modelNameConcept.def | 6 ++++++ .../grib2/localConcepts/era6/modelVersionConcept_AIFS.def | 2 ++ .../grib2/localConcepts/era6/modelVersionConcept_IFS.def | 2 ++ definitions/grib2/modelNameConcept.def | 0 5 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 definitions/grib2/localConcepts/era6/modelNameConcept.def create mode 100644 definitions/grib2/localConcepts/era6/modelVersionConcept_AIFS.def create mode 100644 definitions/grib2/localConcepts/era6/modelVersionConcept_IFS.def create mode 100644 definitions/grib2/modelNameConcept.def diff --git a/definitions/grib2/local/ecmf/section4_extras.def b/definitions/grib2/local/ecmf/section4_extras.def index 2211aa216..05934e068 100644 --- a/definitions/grib2/local/ecmf/section4_extras.def +++ b/definitions/grib2/local/ecmf/section4_extras.def @@ -1,9 +1,12 @@ # (C) Copyright 2005- ECMWF. -concept modelName ("unknown", "modelNameConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; +constant modelNameDefault = "unknown"; +constant modelVersionDefault = "unknown"; + +concept_nofail modelName (modelNameDefault, "modelNameConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; if (!(modelName is "unknown")) { - concept modelVersion ("unknown", "modelVersionConcept_[modelName].def",conceptsDir2,conceptsDir1): no_copy, dump; + concept_nofail modelVersion (modelVersionDefault, "modelVersionConcept_[modelName].def",conceptsDir2,conceptsDir1): no_copy, dump; alias ls.model = modelName; alias mars.model = modelName; } diff --git a/definitions/grib2/localConcepts/era6/modelNameConcept.def b/definitions/grib2/localConcepts/era6/modelNameConcept.def new file mode 100644 index 000000000..5a7742c41 --- /dev/null +++ b/definitions/grib2/localConcepts/era6/modelNameConcept.def @@ -0,0 +1,6 @@ +'IFS' = { + backgroundProcess = 255; +} +'AIFS' = { + backgroundProcess = 1; +} diff --git a/definitions/grib2/localConcepts/era6/modelVersionConcept_AIFS.def b/definitions/grib2/localConcepts/era6/modelVersionConcept_AIFS.def new file mode 100644 index 000000000..b06e75f21 --- /dev/null +++ b/definitions/grib2/localConcepts/era6/modelVersionConcept_AIFS.def @@ -0,0 +1,2 @@ +'v1' = { generatingProcessIdentifier = 1; } +'v2' = { generatingProcessIdentifier = 2; } diff --git a/definitions/grib2/localConcepts/era6/modelVersionConcept_IFS.def b/definitions/grib2/localConcepts/era6/modelVersionConcept_IFS.def new file mode 100644 index 000000000..38757a209 --- /dev/null +++ b/definitions/grib2/localConcepts/era6/modelVersionConcept_IFS.def @@ -0,0 +1,2 @@ +'cy48r1' = { generatingProcessIdentifier = 154; } +'cy47r3' = { generatingProcessIdentifier = 153; } diff --git a/definitions/grib2/modelNameConcept.def b/definitions/grib2/modelNameConcept.def new file mode 100644 index 000000000..e69de29bb From ece5366be634d16933521c113d1fdff16caa72fe Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 21 Jun 2024 11:21:26 +0100 Subject: [PATCH 189/196] ECC-1846: Fix syntax --- definitions/grib2/localConcepts/ecmf/modelNameConcept.def | 1 + definitions/grib2/modelNameConcept.def | 1 + 2 files changed, 2 insertions(+) diff --git a/definitions/grib2/localConcepts/ecmf/modelNameConcept.def b/definitions/grib2/localConcepts/ecmf/modelNameConcept.def index 55b261707..5a7742c41 100644 --- a/definitions/grib2/localConcepts/ecmf/modelNameConcept.def +++ b/definitions/grib2/localConcepts/ecmf/modelNameConcept.def @@ -3,3 +3,4 @@ } 'AIFS' = { backgroundProcess = 1; +} diff --git a/definitions/grib2/modelNameConcept.def b/definitions/grib2/modelNameConcept.def index e69de29bb..6c68ab7da 100644 --- a/definitions/grib2/modelNameConcept.def +++ b/definitions/grib2/modelNameConcept.def @@ -0,0 +1 @@ +"unknown" = {dummy=0;} From d284535229d419d09a9bba0bbfdc53f00e0b0784 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 21 Jun 2024 11:21:49 +0100 Subject: [PATCH 190/196] ECC-1846: Make loading modelNameConcept.def optional --- definitions/grib2/local/ecmf/section4_extras.def | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/definitions/grib2/local/ecmf/section4_extras.def b/definitions/grib2/local/ecmf/section4_extras.def index 05934e068..4639e1fa8 100644 --- a/definitions/grib2/local/ecmf/section4_extras.def +++ b/definitions/grib2/local/ecmf/section4_extras.def @@ -3,10 +3,12 @@ constant modelNameDefault = "unknown"; constant modelVersionDefault = "unknown"; -concept_nofail modelName (modelNameDefault, "modelNameConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; +if (centre is "ecmf" or datasetForLocal is "era6") { + concept_nofail modelName (modelNameDefault, "modelNameConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; -if (!(modelName is "unknown")) { + if (!(modelName is "unknown")) { concept_nofail modelVersion (modelVersionDefault, "modelVersionConcept_[modelName].def",conceptsDir2,conceptsDir1): no_copy, dump; alias ls.model = modelName; alias mars.model = modelName; + } } From 2efe189895a05d0c23647fa53f45284d4ab523d4 Mon Sep 17 00:00:00 2001 From: Sebastien Villaume Date: Fri, 21 Jun 2024 11:44:12 +0100 Subject: [PATCH 191/196] ECC-1846 working on modelName and modelVersion --- definitions/grib2/local/ecmf/section4_extras.def | 4 ++-- .../grib2/localConcepts/ecmf/modelVersionConcept_IFS.def | 8 ++++++++ definitions/grib2/section.4.def | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/definitions/grib2/local/ecmf/section4_extras.def b/definitions/grib2/local/ecmf/section4_extras.def index 4639e1fa8..11cec8f50 100644 --- a/definitions/grib2/local/ecmf/section4_extras.def +++ b/definitions/grib2/local/ecmf/section4_extras.def @@ -4,10 +4,10 @@ constant modelNameDefault = "unknown"; constant modelVersionDefault = "unknown"; if (centre is "ecmf" or datasetForLocal is "era6") { - concept_nofail modelName (modelNameDefault, "modelNameConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; + concept_nofail modelName (modelNameDefault, "modelNameConcept.def",conceptsMasterDir,conceptsLocalDirAll): no_copy, dump; if (!(modelName is "unknown")) { - concept_nofail modelVersion (modelVersionDefault, "modelVersionConcept_[modelName].def",conceptsDir2,conceptsDir1): no_copy, dump; + concept_nofail modelVersion (modelVersionDefault, "modelVersionConcept_[modelName].def",conceptsMasterDir,conceptsLocalDirAll): no_copy, dump; alias ls.model = modelName; alias mars.model = modelName; } diff --git a/definitions/grib2/localConcepts/ecmf/modelVersionConcept_IFS.def b/definitions/grib2/localConcepts/ecmf/modelVersionConcept_IFS.def index 38757a209..8445b7489 100644 --- a/definitions/grib2/localConcepts/ecmf/modelVersionConcept_IFS.def +++ b/definitions/grib2/localConcepts/ecmf/modelVersionConcept_IFS.def @@ -1,2 +1,10 @@ +'cy49r1' = { generatingProcessIdentifier = 155; } 'cy48r1' = { generatingProcessIdentifier = 154; } 'cy47r3' = { generatingProcessIdentifier = 153; } +'cy47r2' = { generatingProcessIdentifier = 152; } +'cy47r1' = { generatingProcessIdentifier = 151; } +'cy46r1' = { generatingProcessIdentifier = 150; } +'cy45r1' = { generatingProcessIdentifier = 149; } +'cy43r3' = { generatingProcessIdentifier = 148; } +'cy43r1' = { generatingProcessIdentifier = 147; } +'cy41r2' = { generatingProcessIdentifier = 146; } diff --git a/definitions/grib2/section.4.def b/definitions/grib2/section.4.def index 410e7bcdc..19a9cad2f 100644 --- a/definitions/grib2/section.4.def +++ b/definitions/grib2/section.4.def @@ -79,7 +79,7 @@ template parameters "grib2/parameters.def"; #adding hook for local extras -template_nofail section4_extras "grib2/local/[centreForLocal]/section4_extras.def"; +template_nofail section4_extras "grib2/local/[centre]/section4_extras.def"; # Detect if this is for Generalized vertical height coordinates if (defined(typeOfFirstFixedSurface)) { From 1609e68f548f1a573a212730a37c3b8b70513845 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 21 Jun 2024 12:07:38 +0100 Subject: [PATCH 192/196] ECC-1846: All tests pass now --- definitions/grib2/local/ecmf/section4_extras.def | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/definitions/grib2/local/ecmf/section4_extras.def b/definitions/grib2/local/ecmf/section4_extras.def index 11cec8f50..e64ab0f48 100644 --- a/definitions/grib2/local/ecmf/section4_extras.def +++ b/definitions/grib2/local/ecmf/section4_extras.def @@ -1,14 +1,12 @@ # (C) Copyright 2005- ECMWF. -constant modelNameDefault = "unknown"; -constant modelVersionDefault = "unknown"; - +# See ECC-1846 if (centre is "ecmf" or datasetForLocal is "era6") { - concept_nofail modelName (modelNameDefault, "modelNameConcept.def",conceptsMasterDir,conceptsLocalDirAll): no_copy, dump; + concept_nofail modelName (unknown, "modelNameConcept.def",conceptsMasterDir,conceptsLocalDirAll): no_copy, dump; if (!(modelName is "unknown")) { - concept_nofail modelVersion (modelVersionDefault, "modelVersionConcept_[modelName].def",conceptsMasterDir,conceptsLocalDirAll): no_copy, dump; - alias ls.model = modelName; - alias mars.model = modelName; + concept_nofail modelVersion (unknown, "modelVersionConcept_[modelName].def",conceptsMasterDir,conceptsLocalDirAll): no_copy, dump; + # alias ls.model = modelName; + # alias mars.model = modelName; } } From d3924cb9192e06008f2e3585363b3694f02e3bb8 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 21 Jun 2024 12:12:13 +0100 Subject: [PATCH 193/196] ECC-1846: Cosmetics --- definitions/grib2/section.4.def | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/definitions/grib2/section.4.def b/definitions/grib2/section.4.def index 19a9cad2f..0ab17e24b 100644 --- a/definitions/grib2/section.4.def +++ b/definitions/grib2/section.4.def @@ -78,8 +78,8 @@ if (defined(marsStream) && defined(marsType)) { template parameters "grib2/parameters.def"; -#adding hook for local extras -template_nofail section4_extras "grib2/local/[centre]/section4_extras.def"; +# Hook for local extras +template_nofail section4Extras "grib2/local/[centre]/section4_extras.def"; # Detect if this is for Generalized vertical height coordinates if (defined(typeOfFirstFixedSurface)) { From e4e91e7a48d112c8d3e7bf994ed3c5e79acabac4 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 21 Jun 2024 12:31:19 +0100 Subject: [PATCH 194/196] ECC-1846: Added test --- .../grib2/local/ecmf/section4_extras.def | 4 +-- tests/CMakeLists.txt | 1 + tests/grib_ecc-1846.sh | 32 +++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100755 tests/grib_ecc-1846.sh diff --git a/definitions/grib2/local/ecmf/section4_extras.def b/definitions/grib2/local/ecmf/section4_extras.def index e64ab0f48..23b304b7d 100644 --- a/definitions/grib2/local/ecmf/section4_extras.def +++ b/definitions/grib2/local/ecmf/section4_extras.def @@ -2,10 +2,10 @@ # See ECC-1846 if (centre is "ecmf" or datasetForLocal is "era6") { - concept_nofail modelName (unknown, "modelNameConcept.def",conceptsMasterDir,conceptsLocalDirAll): no_copy, dump; + concept_nofail modelName(unknown, "modelNameConcept.def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump; if (!(modelName is "unknown")) { - concept_nofail modelVersion (unknown, "modelVersionConcept_[modelName].def",conceptsMasterDir,conceptsLocalDirAll): no_copy, dump; + concept_nofail modelVersion(unknown, "modelVersionConcept_[modelName].def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump; # alias ls.model = modelName; # alias mars.model = modelName; } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0169e4986..1c6cad8d9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -279,6 +279,7 @@ if( HAVE_BUILD_TOOLS ) grib_ecc-1467 grib_ecc-1764 grib_ecc-1792 + grib_ecc-1846 grib_sub_hourly grib_set_bytes grib_set_force diff --git a/tests/grib_ecc-1846.sh b/tests/grib_ecc-1846.sh new file mode 100755 index 000000000..270579ad0 --- /dev/null +++ b/tests/grib_ecc-1846.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 + +label="grib_ecc-1846_test" +tempGrib=temp.$label.grib +tempFilt=temp.$label.filt +tempLog=temp.$label.log +tempOut=temp.$label.txt +tempRef=temp.$label.ref + +sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + +${tools_dir}/grib_set -s generatingProcessIdentifier=1,backgroundProcess=1 $sample $tempGrib +grib_check_key_equals $tempGrib modelName,modelVersion "AIFS v1" + +${tools_dir}/grib_set -s generatingProcessIdentifier=154 $sample $tempGrib +grib_check_key_equals $tempGrib modelName,modelVersion "IFS cy48r1" + +${tools_dir}/grib_set -s generatingProcessIdentifier=100 $sample $tempGrib +grib_check_key_equals $tempGrib modelName,modelVersion "IFS unknown" + +# Clean up +rm -f $tempGrib $tempFilt $tempLog $tempOut $tempRef From 807602d7d6102d172d4182f2450964295b4509fd Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 21 Jun 2024 13:00:21 +0100 Subject: [PATCH 195/196] ECC-1846: Rename template so grib_dump does not show it (cannot start with 'section') --- definitions/grib2/section.4.def | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/definitions/grib2/section.4.def b/definitions/grib2/section.4.def index 0ab17e24b..c40709877 100644 --- a/definitions/grib2/section.4.def +++ b/definitions/grib2/section.4.def @@ -77,9 +77,8 @@ if (defined(marsStream) && defined(marsType)) { template parameters "grib2/parameters.def"; - -# Hook for local extras -template_nofail section4Extras "grib2/local/[centre]/section4_extras.def"; +# Hook for local extras +template_nofail extras "grib2/local/[centre]/section4_extras.def"; # Detect if this is for Generalized vertical height coordinates if (defined(typeOfFirstFixedSurface)) { From 0f3a74620ad02b85a6324e2527cd8c7973dc528f Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 21 Jun 2024 13:51:03 +0100 Subject: [PATCH 196/196] ECC-1846: Make keys read-only --- definitions/grib2/local/ecmf/section4_extras.def | 4 ++-- tests/grib_ecc-1846.sh | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/definitions/grib2/local/ecmf/section4_extras.def b/definitions/grib2/local/ecmf/section4_extras.def index 23b304b7d..0727c4b9a 100644 --- a/definitions/grib2/local/ecmf/section4_extras.def +++ b/definitions/grib2/local/ecmf/section4_extras.def @@ -2,10 +2,10 @@ # See ECC-1846 if (centre is "ecmf" or datasetForLocal is "era6") { - concept_nofail modelName(unknown, "modelNameConcept.def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump; + concept_nofail modelName(unknown, "modelNameConcept.def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump, read_only; if (!(modelName is "unknown")) { - concept_nofail modelVersion(unknown, "modelVersionConcept_[modelName].def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump; + concept_nofail modelVersion(unknown, "modelVersionConcept_[modelName].def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump, read_only; # alias ls.model = modelName; # alias mars.model = modelName; } diff --git a/tests/grib_ecc-1846.sh b/tests/grib_ecc-1846.sh index 270579ad0..1416cf1e7 100755 --- a/tests/grib_ecc-1846.sh +++ b/tests/grib_ecc-1846.sh @@ -28,5 +28,21 @@ grib_check_key_equals $tempGrib modelName,modelVersion "IFS cy48r1" ${tools_dir}/grib_set -s generatingProcessIdentifier=100 $sample $tempGrib grib_check_key_equals $tempGrib modelName,modelVersion "IFS unknown" +# Keys are read-only (may change this later) +set +e +${tools_dir}/grib_set -s modelName=AIFS $sample $tempGrib 2>$tempLog +status=$? +set -e +[ $status -ne 0 ] +grep -q "Value is read only" $tempLog + +set +e +${tools_dir}/grib_set -s modelVersion=cy48r1 $sample $tempGrib 2>$tempLog +status=$? +set -e +[ $status -ne 0 ] +grep -q "Value is read only" $tempLog + + # Clean up rm -f $tempGrib $tempFilt $tempLog $tempOut $tempRef