From 3b7abcf0e7dc8048b243ac043396784731571e85 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 20 Jun 2024 10:36:50 +0000 Subject: [PATCH 01/28] 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 02/28] 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 03/28] 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 04/28] 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 05/28] 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 06/28] 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 07/28] 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 08/28] 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 09/28] 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 10/28] 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 11/28] 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 12/28] 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 13/28] 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 14/28] 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 15/28] 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 From 8f90238d73c9da9afcd7844d1704c6906ea03045 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 22 Jun 2024 13:41:31 +0100 Subject: [PATCH 16/28] ECC-1847: GRIB: Setting invalid value for 'typeOfLevel' does not fail --- definitions/grib1/local.98.2.def | 2 +- definitions/grib1/ls_labeling.82.def | 12 +++++------- definitions/grib1/mars_labeling.82.def | 2 +- definitions/grib1/section.1.def | 4 ++-- .../grib2/local/ecmf/section4_extras.def | 4 ++-- definitions/grib2/ls_labeling.82.def | 11 +++++------ definitions/grib2/mars_labeling.82.def | 2 +- definitions/grib2/template.4.horizontal.def | 2 +- definitions/grib3/ls_labeling.82.def | 12 ++++-------- definitions/grib3/mars_labeling.82.def | 2 +- definitions/grib3/template.4.horizontal.def | 2 +- definitions/grib3/template.component.5.0.def | 2 +- definitions/grib3/template.component.5.1.def | 2 +- tests/grib_typeOfLevel.sh | 18 +++++++++++++++++- 14 files changed, 43 insertions(+), 34 deletions(-) diff --git a/definitions/grib1/local.98.2.def b/definitions/grib1/local.98.2.def index df56d0ad6..6e96be41e 100644 --- a/definitions/grib1/local.98.2.def +++ b/definitions/grib1/local.98.2.def @@ -41,6 +41,6 @@ padto padding_loc2_2(offsetSection1 + 328); constant unknown="-"; -concept_nofail clusteringDomain(unknown,"cluster_domain.def",conceptsMasterDir,conceptsLocalDirAll); +concept clusteringDomain(unknown,"cluster_domain.def",conceptsMasterDir,conceptsLocalDirAll); alias number = clusterNumber; alias domain = clusteringDomain; diff --git a/definitions/grib1/ls_labeling.82.def b/definitions/grib1/ls_labeling.82.def index a76689eaa..94fb3511f 100644 --- a/definitions/grib1/ls_labeling.82.def +++ b/definitions/grib1/ls_labeling.82.def @@ -2,14 +2,12 @@ # created: 6 Oct 2011 # modified: 13 Sep 2013 # - -alias ls.dataType = marsType; +alias ls.dataType = marsType; if (localDefinitionNumber == 83 ) { - - concept_nofail ls.timerepres (unknown,"timeRepresConcept.def",conceptsLocalDirAll,conceptsMasterDir); - concept_nofail ls.sort (unknown,"sortConcept.def",conceptsLocalDirAll,conceptsMasterDir); - concept_nofail ls.landtype (unknown,"landTypeConcept.def",conceptsLocalDirAll,conceptsMasterDir); - concept_nofail ls.aerosolbinnumber (unknown,"aerosolConcept.def",conceptsLocalDirAll,conceptsMasterDir); + concept ls.timerepres (unknown,"timeRepresConcept.def",conceptsLocalDirAll,conceptsMasterDir); + concept ls.sort (unknown,"sortConcept.def",conceptsLocalDirAll,conceptsMasterDir); + concept ls.landtype (unknown,"landTypeConcept.def",conceptsLocalDirAll,conceptsMasterDir); + concept ls.aerosolbinnumber (unknown,"aerosolConcept.def",conceptsLocalDirAll,conceptsMasterDir); } diff --git a/definitions/grib1/mars_labeling.82.def b/definitions/grib1/mars_labeling.82.def index c38a8bfe1..3a38c3ee5 100644 --- a/definitions/grib1/mars_labeling.82.def +++ b/definitions/grib1/mars_labeling.82.def @@ -24,6 +24,6 @@ if ( localDefinitionNumber == 83 ) { alias mars.landtype = matchLandType; alias mars.aerosolbinnumber = matchAerosolBinNumber; - concept_nofail matchAerosolPacking (unknown,"aerosolPackingConcept.def",conceptsLocalMarsDirAll,conceptsMasterMarsDir); + concept matchAerosolPacking (unknown,"aerosolPackingConcept.def",conceptsLocalMarsDirAll,conceptsMasterMarsDir); alias mars.aerosolpacking = matchAerosolPacking; } diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index d62300f27..1c3edb5ac 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -58,8 +58,8 @@ alias levelType=indicatorOfTypeOfLevel; transient pressureUnits="hPa"; -concept_nofail typeOfLevelECMF (unknown, "typeOfLevel.def",conceptsMasterDir,conceptsLocalDirECMF); -concept_nofail vertical.typeOfLevel (typeOfLevelECMF, "typeOfLevel.def",conceptsDir2,conceptsDir1); +concept typeOfLevelECMF (unknown, "typeOfLevel.def",conceptsMasterDir,conceptsLocalDirECMF); +concept vertical.typeOfLevel (typeOfLevelECMF, "typeOfLevel.def",conceptsDir2,conceptsDir1); when ( typeOfLevel is "isobaricInPa" ) { set pressureUnits="Pa"; } else { set pressureUnits="hPa";} diff --git a/definitions/grib2/local/ecmf/section4_extras.def b/definitions/grib2/local/ecmf/section4_extras.def index 0727c4b9a..2477b2481 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, read_only; + concept 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, read_only; + concept modelVersion(unknown, "modelVersionConcept_[modelName].def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump, read_only; # alias ls.model = modelName; # alias mars.model = modelName; } diff --git a/definitions/grib2/ls_labeling.82.def b/definitions/grib2/ls_labeling.82.def index 42f68e0ea..2207abc7f 100644 --- a/definitions/grib2/ls_labeling.82.def +++ b/definitions/grib2/ls_labeling.82.def @@ -1,16 +1,15 @@ # author: Sebastien Villaume # created: 14 Feb 2014 # - constant g1conceptsMasterDir="grib1" : hidden; constant g1conceptsLocalDirAll="grib1/localConcepts/[centre:s]" : hidden; -alias ls.dataType = marsType; +alias ls.dataType = marsType; if (localDefinitionNumber == 83 ) { - concept_nofail ls.timerepres (unknown,"timeRepresConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); - concept_nofail ls.sort (unknown,"sortConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); - concept_nofail ls.landtype (unknown,"landTypeConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); - concept_nofail ls.aerosolbinnumber (unknown,"aerosolConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); + concept ls.timerepres (unknown,"timeRepresConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); + concept ls.sort (unknown,"sortConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); + concept ls.landtype (unknown,"landTypeConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); + concept ls.aerosolbinnumber (unknown,"aerosolConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); } diff --git a/definitions/grib2/mars_labeling.82.def b/definitions/grib2/mars_labeling.82.def index 13942b638..4621e581d 100644 --- a/definitions/grib2/mars_labeling.82.def +++ b/definitions/grib2/mars_labeling.82.def @@ -22,7 +22,7 @@ if ( localDefinitionNumber == 83 ) { alias mars.landtype = matchLandType; alias mars.aerosolbinnumber = matchAerosolBinNumber; - concept_nofail matchAerosolPacking (unknown,"aerosolPackingConcept.def",conceptsLocalMarsDirAll,conceptsMasterMarsDir); + concept matchAerosolPacking (unknown,"aerosolPackingConcept.def",conceptsLocalMarsDirAll,conceptsMasterMarsDir); alias mars.aerosolpacking = matchAerosolPacking; } diff --git a/definitions/grib2/template.4.horizontal.def b/definitions/grib2/template.4.horizontal.def index 2dc64c033..4702e0319 100644 --- a/definitions/grib2/template.4.horizontal.def +++ b/definitions/grib2/template.4.horizontal.def @@ -24,7 +24,7 @@ unsigned[4] scaledValueOfSecondFixedSurface = missing() : can_be_missing,dump,ed transient pressureUnits="hPa"; -concept_nofail vertical.typeOfLevel (unknown,"typeOfLevelConcept.def",conceptsDir2,conceptsDir1); +concept vertical.typeOfLevel (unknown,"typeOfLevelConcept.def",conceptsDir2,conceptsDir1); alias levelType=typeOfFirstFixedSurface; diff --git a/definitions/grib3/ls_labeling.82.def b/definitions/grib3/ls_labeling.82.def index d0eb0a320..1c22b9c75 100644 --- a/definitions/grib3/ls_labeling.82.def +++ b/definitions/grib3/ls_labeling.82.def @@ -4,19 +4,15 @@ # created: 14 Feb 2014 # ######################### - constant g1conceptsMasterDir="grib1" : hidden; constant g1conceptsLocalDirAll="grib1/localConcepts/[centre:s]" : hidden; - alias ls.dataType = marsType; if (localDefinitionNumber == 83 ) { - - concept_nofail ls.timerepres (unknown,"timeRepresConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); - concept_nofail ls.sort (unknown,"sortConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); - concept_nofail ls.landtype (unknown,"landTypeConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); - concept_nofail ls.aerosolbinnumber (unknown,"aerosolConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); - + concept ls.timerepres (unknown,"timeRepresConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); + concept ls.sort (unknown,"sortConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); + concept ls.landtype (unknown,"landTypeConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); + concept ls.aerosolbinnumber (unknown,"aerosolConcept.def",g1conceptsLocalDirAll,g1conceptsMasterDir); } diff --git a/definitions/grib3/mars_labeling.82.def b/definitions/grib3/mars_labeling.82.def index 88328c1a2..be488f14a 100644 --- a/definitions/grib3/mars_labeling.82.def +++ b/definitions/grib3/mars_labeling.82.def @@ -40,7 +40,7 @@ if ( localDefinitionNumber == 83 ) { alias mars.landtype = matchLandType; alias mars.aerosolbinnumber = matchAerosolBinNumber; - concept_nofail matchAerosolPacking (unknown,"aerosolPackingConcept.def",conceptsLocalMarsDirAll,conceptsMasterMarsDir); + concept matchAerosolPacking (unknown,"aerosolPackingConcept.def",conceptsLocalMarsDirAll,conceptsMasterMarsDir); alias mars.aerosolpacking = matchAerosolPacking; } diff --git a/definitions/grib3/template.4.horizontal.def b/definitions/grib3/template.4.horizontal.def index ed1bc6025..01ae2be22 100644 --- a/definitions/grib3/template.4.horizontal.def +++ b/definitions/grib3/template.4.horizontal.def @@ -24,7 +24,7 @@ unsigned[4] scaledValueOfSecondFixedSurface = missing() : can_be_missing,dump,ed transient pressureUnits="hPa"; -concept_nofail vertical.typeOfLevel (unknown) { +concept vertical.typeOfLevel (unknown) { #set uses the last one #get returns the first match 'surface' = { typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=255; } diff --git a/definitions/grib3/template.component.5.0.def b/definitions/grib3/template.component.5.0.def index 0170577a6..e97bf4a17 100644 --- a/definitions/grib3/template.component.5.0.def +++ b/definitions/grib3/template.component.5.0.def @@ -14,7 +14,7 @@ unsigned[4] scaledValueOfFirstFixedSurface = missing() : can_be_missing,dump,ed #### transient pressureUnits="hPa"; -concept_nofail vertical.typeOfLevel (unknown) { +concept vertical.typeOfLevel (unknown) { #set uses the last one #get returns the first match 'surface' = { typeOfFirstFixedSurface=1; } diff --git a/definitions/grib3/template.component.5.1.def b/definitions/grib3/template.component.5.1.def index dc3b84ac8..edd4add36 100644 --- a/definitions/grib3/template.component.5.1.def +++ b/definitions/grib3/template.component.5.1.def @@ -26,7 +26,7 @@ unsigned[4] scaledValueOfSecondFixedSurface = missing() : can_be_missing,dump,ed ####### transient pressureUnits="hPa"; -concept_nofail vertical.typeOfLevel (unknown) { +concept vertical.typeOfLevel (unknown) { #set uses the last one #get returns the first match 'surface' = { typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=255; } diff --git a/tests/grib_typeOfLevel.sh b/tests/grib_typeOfLevel.sh index fa9a7634d..54d12dee2 100755 --- a/tests/grib_typeOfLevel.sh +++ b/tests/grib_typeOfLevel.sh @@ -12,12 +12,16 @@ label="grib_typeOfLevel_test" temp=temp.$label.txt +tempGrib=temp.$label.grib if [ ! -d "$ECCODES_DEFINITION_PATH" ]; then echo "Test $0 disabled. No definitions directory" exit 0 fi +sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + # Make sure all typeOfLevel values are unique def_file="$ECCODES_DEFINITION_PATH/grib2/typeOfLevelConcept.def" @@ -35,4 +39,16 @@ else echo "No duplicates in $def_file" fi -rm -f $temp +# ECC-1847: Setting invalid value for 'typeOfLevel' does not fail +for sample in $sample_g1 $sample_g2; do + set +e + ${tools_dir}/grib_set -s typeOfLevel=rubbish $sample $tempGrib 2>$temp + status=$? + set -e + [ $status -ne 0 ] + grep -q "Concept no match" $temp +done + + +# Clean up +rm -f $temp $tempGrib From 142601f603e5049b70110f7d4017e6a893694b96 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 22 Jun 2024 13:41:52 +0100 Subject: [PATCH 17/28] Bump up version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3a05135cd..c94fd315f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.36.0 +2.37.0 From 19d71254f75c826cec4838581c27840fbe5cf199 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 22 Jun 2024 13:58:24 +0100 Subject: [PATCH 18/28] ECC-1847: Fix padding test --- definitions/grib1/local.98.2.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/grib1/local.98.2.def b/definitions/grib1/local.98.2.def index 6e96be41e..df56d0ad6 100644 --- a/definitions/grib1/local.98.2.def +++ b/definitions/grib1/local.98.2.def @@ -41,6 +41,6 @@ padto padding_loc2_2(offsetSection1 + 328); constant unknown="-"; -concept clusteringDomain(unknown,"cluster_domain.def",conceptsMasterDir,conceptsLocalDirAll); +concept_nofail clusteringDomain(unknown,"cluster_domain.def",conceptsMasterDir,conceptsLocalDirAll); alias number = clusterNumber; alias domain = clusteringDomain; From 97dd1741aa1974f8651c99b1bd19627bd58f4342 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 22 Jun 2024 15:02:57 +0100 Subject: [PATCH 19/28] ECC-1847: Fix case when input has typeOfLevel=unknown --- definitions/grib2/typeOfLevelConcept.def | 1 + tests/grib_typeOfLevel.sh | 27 ++++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/definitions/grib2/typeOfLevelConcept.def b/definitions/grib2/typeOfLevelConcept.def index a32abd7e0..2f350d663 100644 --- a/definitions/grib2/typeOfLevelConcept.def +++ b/definitions/grib2/typeOfLevelConcept.def @@ -97,3 +97,4 @@ 'road' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=255;} 'roadLayer' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=187;} 'urbanCanyon' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=185;} +'unknown' = {dummy=0;} diff --git a/tests/grib_typeOfLevel.sh b/tests/grib_typeOfLevel.sh index 54d12dee2..a036f3e72 100755 --- a/tests/grib_typeOfLevel.sh +++ b/tests/grib_typeOfLevel.sh @@ -11,8 +11,9 @@ . ./include.ctest.sh label="grib_typeOfLevel_test" -temp=temp.$label.txt -tempGrib=temp.$label.grib +tempText=temp.$label.txt +tempGribA=temp.$label.A.grib +tempGribB=temp.$label.B.grib if [ ! -d "$ECCODES_DEFINITION_PATH" ]; then echo "Test $0 disabled. No definitions directory" @@ -23,32 +24,40 @@ sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl # Make sure all typeOfLevel values are unique +# -------------------------------------------- def_file="$ECCODES_DEFINITION_PATH/grib2/typeOfLevelConcept.def" -rm -f $temp +rm -f $tempText # uniq -d outputs a single copy of each line that is repeated in the input -grep "^'" $def_file | awk -F= '{print $1}' | tr -d "' " | sort | uniq -d > $temp +grep "^'" $def_file | awk -F= '{print $1}' | tr -d "' " | sort | uniq -d > $tempText -if [ -s "$temp" ]; then +if [ -s "$tempText" ]; then # File exists and has a size greater than zero echo "ERROR: Duplicates found in $def_file" >&2 - cat $temp + cat $tempText exit 1 else echo "No duplicates in $def_file" fi # ECC-1847: Setting invalid value for 'typeOfLevel' does not fail +# ---------------------------------------------------------------- for sample in $sample_g1 $sample_g2; do set +e - ${tools_dir}/grib_set -s typeOfLevel=rubbish $sample $tempGrib 2>$temp + ${tools_dir}/grib_set -s typeOfLevel=rubbish $sample $tempGribA 2>$tempText status=$? set -e [ $status -ne 0 ] - grep -q "Concept no match" $temp + grep -q "Concept no match" $tempText done +# Change of PDT with typeOfLevel=unknown +${tools_dir}/grib_set -s productDefinitionTemplateNumber=0,typeOfFirstFixedSurface=0 $sample_g2 $tempGribA +grib_check_key_equals $tempGribA typeOfLevel 'unknown' +${tools_dir}/grib_set -s productDefinitionTemplateNumber=1 $tempGribA $tempGribB +grib_check_key_equals $tempGribB typeOfLevel,productDefinitionTemplateNumber 'unknown 1' + # Clean up -rm -f $temp $tempGrib +rm -f $tempText $tempGribA $tempGribB From afa948a180d6bc205cd3585ad154accaa2016f2b Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 24 Jun 2024 13:19:08 +0100 Subject: [PATCH 20/28] ECC-1848: Tools: Deprecate grib_merge, gg_sub_area_check and big2gribex --- tests/CMakeLists.txt | 3 --- tools/CMakeLists.txt | 4 +--- tools/{ => deprecated}/big2gribex.cc | 0 tools/{ => deprecated}/gg_sub_area_check.cc | 0 tools/{ => deprecated}/grib_merge.cc | 0 5 files changed, 1 insertion(+), 6 deletions(-) rename tools/{ => deprecated}/big2gribex.cc (100%) rename tools/{ => deprecated}/gg_sub_area_check.cc (100%) rename tools/{ => deprecated}/grib_merge.cc (100%) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1c6cad8d9..9a4464136 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -230,9 +230,6 @@ if( HAVE_BUILD_TOOLS ) grib_geo_iter grib_to_json grib_to_ppm - grib_merge - big2gribex - grib_sub_area_check grib_list_keys grib_histogram bufr_get_element diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index cddce7c33..d4b256770 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -28,7 +28,7 @@ ecbuild_add_library( TARGET ecc_tools # tools binaries list( APPEND ecc_tools_binaries codes_info codes_count codes_split_file - grib_histogram grib_filter grib_ls grib_dump grib_merge + grib_histogram grib_filter grib_ls grib_dump grib2ppm grib_set grib_get grib_get_data grib_copy grib_compare codes_parser grib_index_build bufr_index_build bufr_ls bufr_dump bufr_set bufr_get @@ -37,8 +37,6 @@ list( APPEND ecc_tools_binaries metar_dump metar_ls metar_compare metar_get metar_filter metar_copy ) list( APPEND ecc_tools_binaries_extra - big2gribex - gg_sub_area_check grib_repair grib_to_json codes_export_resource diff --git a/tools/big2gribex.cc b/tools/deprecated/big2gribex.cc similarity index 100% rename from tools/big2gribex.cc rename to tools/deprecated/big2gribex.cc diff --git a/tools/gg_sub_area_check.cc b/tools/deprecated/gg_sub_area_check.cc similarity index 100% rename from tools/gg_sub_area_check.cc rename to tools/deprecated/gg_sub_area_check.cc diff --git a/tools/grib_merge.cc b/tools/deprecated/grib_merge.cc similarity index 100% rename from tools/grib_merge.cc rename to tools/deprecated/grib_merge.cc From 79c27d0ae2915611169a25bdc253b57c9a18d468 Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 25 Jun 2024 12:01:22 +0100 Subject: [PATCH 21/28] Testing: Check sections in grib_dump output --- tests/grib_dump.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/grib_dump.sh b/tests/grib_dump.sh index c413f93f1..00a6412c0 100755 --- a/tests/grib_dump.sh +++ b/tests/grib_dump.sh @@ -82,6 +82,7 @@ done # Test for dumping a section +# --------------------------- if [ $HAVE_JPEG -eq 0 ]; then # No JPEG decoding enabled so dumping section 7 will issue errors # but dumping non-data sections should work @@ -110,6 +111,27 @@ ${tools_dir}/grib_dump -w count=4 $file > $temp 2>&1 file=$data_dir/sample.grib2 ECCODES_DEBUG=1 ${tools_dir}/grib_dump $file > $temp 2>&1 +# Check the right number of sections are listed in the dump +# --------------------------------------------------------- +file=$data_dir/sample.grib2 +${tools_dir}/grib_dump -O $file > $temp +count=$(grep -c SECTION_ $temp) +[ $count -eq 8 ] + +file=$data_dir/test_uuid.grib2 +${tools_dir}/grib_dump -wcount=1 -O $file > $temp +count=$(grep -c SECTION_ $temp) +[ $count -eq 7 ] + +file=$data_dir/regular_gaussian_model_level.grib1 +${tools_dir}/grib_dump -O $file > $temp +count=$(grep -c SECTION_ $temp) +[ $count -eq 4 ] + +file=$data_dir/missing_field.grib1 +${tools_dir}/grib_dump -O $file > $temp +count=$(grep -c SECTION_ $temp) +[ $count -eq 5 ] # Repeated key numberOfSection file=$data_dir/sample.grib2 From 12c078566f335a997ee118a3fa324ce5b9e4cf3b Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 25 Jun 2024 12:28:40 +0100 Subject: [PATCH 22/28] Testing: Function to check GRIB key is scalar --- tests/utils.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/utils.sh b/tests/utils.sh index d51373a3d..a1de94279 100644 --- a/tests/utils.sh +++ b/tests/utils.sh @@ -38,3 +38,14 @@ grib_check_key_exists() # grib_get will fail if the key is not found $tools_dir/grib_get -p $a_key $a_file >/dev/null } + +# This is useful in situations where we intend a key to have +# a single value (size=1). For example when we redefine a transient +grib_check_key_is_scalar() +{ + a_file=$1 + a_key=$2 + a_val=$3 + result=$(echo "print '|[$a_key]|';" | ${tools_dir}/grib_filter - $a_file) + [ "$result" = "|$a_val|" ] +} From 8269f7f2753d059c889bde54dcdd6637fa6ee83b Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 26 Jun 2024 15:45:44 +0100 Subject: [PATCH 23/28] ECC-1808: Release candidate --- definitions/grib2/tables/33/4.2.0.17.table | 3 +++ definitions/grib2/tables/33/4.2.3.2.table | 3 +++ definitions/grib2/tables/33/4.2.3.3.table | 3 +++ definitions/grib2/tables/33/4.2.3.4.table | 3 +++ definitions/grib2/tables/33/4.2.3.5.table | 3 +++ definitions/grib2/tables/33/4.2.3.6.table | 3 +++ definitions/grib2/tables/33/4.252.table | 3 --- 7 files changed, 18 insertions(+), 3 deletions(-) diff --git a/definitions/grib2/tables/33/4.2.0.17.table b/definitions/grib2/tables/33/4.2.0.17.table index 90ef72d87..3c7b284f2 100644 --- a/definitions/grib2/tables/33/4.2.0.17.table +++ b/definitions/grib2/tables/33/4.2.0.17.table @@ -5,3 +5,6 @@ 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) +# 6-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 index a97ce4942..2471f0ba7 100644 --- a/definitions/grib2/tables/33/4.2.3.2.table +++ b/definitions/grib2/tables/33/4.2.3.2.table @@ -22,3 +22,6 @@ 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) +# 41-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.3.3.table b/definitions/grib2/tables/33/4.2.3.3.table index c487a578e..3a53cdc81 100644 --- a/definitions/grib2/tables/33/4.2.3.3.table +++ b/definitions/grib2/tables/33/4.2.3.3.table @@ -2,3 +2,6 @@ 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 (%) +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.3.4.table b/definitions/grib2/tables/33/4.2.3.4.table index 7f832ff3c..d26b12bd5 100644 --- a/definitions/grib2/tables/33/4.2.3.4.table +++ b/definitions/grib2/tables/33/4.2.3.4.table @@ -8,3 +8,6 @@ 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) +# 9-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.3.5.table b/definitions/grib2/tables/33/4.2.3.5.table index 58a3f12cb..ef8096f82 100644 --- a/definitions/grib2/tables/33/4.2.3.5.table +++ b/definitions/grib2/tables/33/4.2.3.5.table @@ -5,3 +5,6 @@ 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) +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/33/4.2.3.6.table b/definitions/grib2/tables/33/4.2.3.6.table index 62a5ba656..34a5c307c 100644 --- a/definitions/grib2/tables/33/4.2.3.6.table +++ b/definitions/grib2/tables/33/4.2.3.6.table @@ -5,3 +5,6 @@ 3 3 Direct solar exposure (J m-2) 4 4 Diffuse solar irradiance (W m-2) 5 5 Diffuse solar exposure (J m-2) +# 6-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 index 3baf4064c..187d3ee43 100644 --- a/definitions/grib2/tables/33/4.252.table +++ b/definitions/grib2/tables/33/4.252.table @@ -48,7 +48,6 @@ 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) @@ -64,7 +63,6 @@ 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) @@ -72,7 +70,6 @@ 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) From d857f4771b67d703191a49b6005bf2d6675e5c85 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Wed, 26 Jun 2024 11:08:55 +0000 Subject: [PATCH 24/28] ECC-1850: Extended metadata keys along with corresponding test. --- definitions/grib2/local.98.43.def | 15 ++++++++++++++- tests/grib_ecc-1766.sh | 11 +++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/definitions/grib2/local.98.43.def b/definitions/grib2/local.98.43.def index 3728cd185..2db85ceaf 100644 --- a/definitions/grib2/local.98.43.def +++ b/definitions/grib2/local.98.43.def @@ -10,12 +10,25 @@ alias mars.activity = activity; codetable[2] experiment "grib2/destine_experiment.table" ; alias mars.experiment = experiment; +# Generation keyword - synergise with DestinE ClimateDT and use this to version the dataset +unsigned[1] generation = 255 : dump; +alias mars.generation = generation; + +# Model keyword to index multiple models within EERIE +codetable[2] model "grib2/destine_model.table" : dump; +alias mars.model = model; + # Climate run realization keyword, which relates to an initial condition perturbation unsigned[1] realization = 255 ; alias mars.realization = realization; +# Allows simultaneous archiving of resolutions +# high resolution for best available vs standard resolution for quick access and plotting +codetable[2] resolution "grib2/destine_resolution.table" : dump; +alias mars.resolution = resolution; + # Remove mars domain from this data unalias mars.domain; # Add some padding just in case we want more keys in the future -pad padding_loc43(30); +pad padding_loc43(25); diff --git a/tests/grib_ecc-1766.sh b/tests/grib_ecc-1766.sh index 79e273b1d..172fdae9a 100755 --- a/tests/grib_ecc-1766.sh +++ b/tests/grib_ecc-1766.sh @@ -41,5 +41,16 @@ ${tools_dir}/grib_set -s activity=1,experiment=1,realization=1 $eerie_sample $te grib_check_key_equals $temp_grib "activity,experiment,realization" "1 1 1" grib_check_key_equals $temp_grib "activity:s,experiment:s" "CMIP6 hist" +# ECC-1850: Additional keys added +# Check additional keys are present and correct +grib_check_key_exists $eerie_sample generation,model,resolution +grib_check_key_equals $eerie_sample "generation,model,resolution" "255 0 0" + +# Check an example where a few additional things are set +${tools_dir}/grib_set -s generation=1,model=2,resolution=1 $eerie_sample $temp_grib + +grib_check_key_equals $temp_grib "generation,model,resolution" "1 2 1" +grib_check_key_equals $temp_grib "model:s,resolution:s" "IFS-NEMO standard" + # Clean up rm -f $temp_grib $eerie_sample From 38d7f8b9c03b2944b971530be94e995dd8cddcbc Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Wed, 26 Jun 2024 15:23:19 +0000 Subject: [PATCH 25/28] ECC-1850: Back to 30 octets of padding given old data will be discarded. --- definitions/grib2/local.98.43.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/grib2/local.98.43.def b/definitions/grib2/local.98.43.def index 2db85ceaf..18846b7f7 100644 --- a/definitions/grib2/local.98.43.def +++ b/definitions/grib2/local.98.43.def @@ -31,4 +31,4 @@ alias mars.resolution = resolution; unalias mars.domain; # Add some padding just in case we want more keys in the future -pad padding_loc43(25); +pad padding_loc43(30); From 0c2d677c33dfaefc73bca75ab959143fab4c83c1 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 26 Jun 2024 18:08:59 +0100 Subject: [PATCH 26/28] Use the better key name numberOfTimeRanges --- definitions/grib2/template.4.statistical.def | 14 +++--- .../grib_accessor_class_g2end_step.cc | 50 +++++++++---------- src/accessor/grib_accessor_class_g2end_step.h | 2 +- tests/grib_filter.sh | 2 +- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/definitions/grib2/template.4.statistical.def b/definitions/grib2/template.4.statistical.def index a2286e453..a98b8f212 100644 --- a/definitions/grib2/template.4.statistical.def +++ b/definitions/grib2/template.4.statistical.def @@ -19,12 +19,12 @@ unsigned[1] minuteOfEndOfOverallTimeInterval =0 : edition_specific; unsigned[1] secondOfEndOfOverallTimeInterval =0 : edition_specific; # Number of time range specifications describing the time intervals used to calculate the statistically-processed field -unsigned[1] numberOfTimeRange = 1 : edition_specific; -alias n = numberOfTimeRange; -alias numberOfTimeRanges = numberOfTimeRange; +unsigned[1] numberOfTimeRanges = 1 : edition_specific; +alias n = numberOfTimeRanges; +alias numberOfTimeRange = numberOfTimeRanges; # Total number of data values missing in statistical process -unsigned[4] numberOfMissingInStatisticalProcess = 0 : edition_specific; +unsigned[4] numberOfMissingInStatisticalProcess = 0 : edition_specific; alias totalNumberOfDataValuesMissingInStatisticalProcess=numberOfMissingInStatisticalProcess; statisticalProcessesList list(numberOfTimeRanges) @@ -33,17 +33,17 @@ statisticalProcessesList list(numberOfTimeRanges) codetable[1] typeOfStatisticalProcessing ('4.10.table',masterDir,localDir) : edition_specific; # Type of time increment between successive fields used in the statistical processing - codetable[1] typeOfTimeIncrement ('4.11.table',masterDir,localDir) = 2 : edition_specific; + codetable[1] typeOfTimeIncrement ('4.11.table',masterDir,localDir) = 2 : edition_specific; alias typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing=typeOfTimeIncrement; # Indicator of unit of time for time range over which statistical processing is done - codetable[1] indicatorOfUnitForTimeRange ('4.4.table',masterDir,localDir) =1 ; + codetable[1] indicatorOfUnitForTimeRange ('4.4.table',masterDir,localDir) =1 ; # Length of the time range over which statistical processing is done, in units defined by the previous octet unsigned[4] lengthOfTimeRange=0 ; # Indicator of unit of time for the increment between the successive fields used - codetable[1] indicatorOfUnitForTimeIncrement ('4.4.table',masterDir,localDir)=255 ; + codetable[1] indicatorOfUnitForTimeIncrement ('4.4.table',masterDir,localDir)=255 ; # Time increment between successive fields, in units defined by the previous octet unsigned[4] timeIncrement=0 ; diff --git a/src/accessor/grib_accessor_class_g2end_step.cc b/src/accessor/grib_accessor_class_g2end_step.cc index 6e8cfcda3..7d3c2c225 100644 --- a/src/accessor/grib_accessor_class_g2end_step.cc +++ b/src/accessor/grib_accessor_class_g2end_step.cc @@ -45,7 +45,7 @@ void grib_accessor_class_g2end_step_t::init(grib_accessor* a, const long l, grib 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++); + self->numberOfTimeRanges = grib_arguments_get_name(h, c, n++); } void grib_accessor_class_g2end_step_t::dump(grib_accessor* a, grib_dumper* dumper) @@ -201,7 +201,7 @@ static int unpack_multiple_time_ranges_long_(grib_accessor* a, long* val, size_t 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; + long numberOfTimeRanges = 0, step_units = 0, start_step_value = 0; size_t count = 0; long arr_typeOfTimeIncrement[MAX_NUM_TIME_RANGES] = { @@ -218,14 +218,14 @@ static int unpack_multiple_time_ranges_long_(grib_accessor* a, long* val, size_t return err; if ((err = grib_get_long_internal(h, self->step_units, &step_units))) return err; - if ((err = grib_get_long_internal(h, self->numberOfTimeRange, &numberOfTimeRange))) + if ((err = grib_get_long_internal(h, self->numberOfTimeRanges, &numberOfTimeRanges))) return err; - if (numberOfTimeRange > MAX_NUM_TIME_RANGES) { + if (numberOfTimeRanges > MAX_NUM_TIME_RANGES) { grib_context_log(h->context, GRIB_LOG_ERROR, "Too many time range specifications!"); return GRIB_DECODING_ERROR; } - count = numberOfTimeRange; + count = numberOfTimeRanges; /* Get the arrays for the N time ranges */ if ((err = grib_get_long_array(h, self->typeOfTimeIncrement, arr_typeOfTimeIncrement, &count))) return err; @@ -259,11 +259,11 @@ static int unpack_multiple_time_ranges_double_(grib_accessor* a, double* val, si { 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; - long step_units = 0; - long start_step_value = 0; - long start_step_unit = 0; + grib_handle* h = grib_handle_of_accessor(a); + long numberOfTimeRanges = 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] = { @@ -286,14 +286,14 @@ static int unpack_multiple_time_ranges_double_(grib_accessor* a, double* val, si if ((err = grib_get_long_internal(h, self->step_units, &step_units))) return err; - if ((err = grib_get_long_internal(h, self->numberOfTimeRange, &numberOfTimeRange))) + if ((err = grib_get_long_internal(h, self->numberOfTimeRanges, &numberOfTimeRanges))) return err; - if (numberOfTimeRange > MAX_NUM_TIME_RANGES) { + if (numberOfTimeRanges > MAX_NUM_TIME_RANGES) { grib_context_log(h->context, GRIB_LOG_ERROR, "Too many time range specifications!"); return GRIB_DECODING_ERROR; } - count = numberOfTimeRange; + count = numberOfTimeRanges; /* Get the arrays for the N time ranges */ if ((err = grib_get_long_array(h, self->typeOfTimeIncrement, arr_typeOfTimeIncrement, &count))) return err; @@ -329,9 +329,9 @@ int grib_accessor_class_g2end_step_t::unpack_long(grib_accessor* a, long* val, s 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; - long start_step_unit; - long numberOfTimeRange; + long start_step_value = 0; + long start_step_unit = 0; + long numberOfTimeRanges = 0; if ((ret = grib_get_long_internal(h, self->start_step_value, &start_step_value))) return ret; @@ -346,13 +346,13 @@ int grib_accessor_class_g2end_step_t::unpack_long(grib_accessor* a, long* val, s return 0; } - Assert(self->numberOfTimeRange); - if ((ret = grib_get_long_internal(h, self->numberOfTimeRange, &numberOfTimeRange))) + Assert(self->numberOfTimeRanges); + if ((ret = grib_get_long_internal(h, self->numberOfTimeRanges, &numberOfTimeRanges))) return ret; - Assert(numberOfTimeRange == 1 || numberOfTimeRange == 2); + Assert(numberOfTimeRanges == 1 || numberOfTimeRanges == 2); try { - if (numberOfTimeRange == 1) { + if (numberOfTimeRanges == 1) { ret = unpack_one_time_range_long_(a, val, len); } else { @@ -374,7 +374,7 @@ int grib_accessor_class_g2end_step_t::unpack_double(grib_accessor* a, double* va int ret = 0; long start_step_value; long start_step_unit; - long numberOfTimeRange; + long numberOfTimeRanges; if ((ret = grib_get_long_internal(h, self->start_step_value, &start_step_value))) return ret; @@ -389,13 +389,13 @@ int grib_accessor_class_g2end_step_t::unpack_double(grib_accessor* a, double* va return 0; } - Assert(self->numberOfTimeRange); - if ((ret = grib_get_long_internal(h, self->numberOfTimeRange, &numberOfTimeRange))) + Assert(self->numberOfTimeRanges); + if ((ret = grib_get_long_internal(h, self->numberOfTimeRanges, &numberOfTimeRanges))) return ret; - Assert(numberOfTimeRange == 1 || numberOfTimeRange == 2); + Assert(numberOfTimeRanges == 1 || numberOfTimeRanges == 2); try { - if (numberOfTimeRange == 1) { + if (numberOfTimeRanges == 1) { ret = unpack_one_time_range_double_(a, val, len); } else { diff --git a/src/accessor/grib_accessor_class_g2end_step.h b/src/accessor/grib_accessor_class_g2end_step.h index d3a3b1433..2a39aa1dd 100644 --- a/src/accessor/grib_accessor_class_g2end_step.h +++ b/src/accessor/grib_accessor_class_g2end_step.h @@ -34,7 +34,7 @@ public: const char* time_range_unit; const char* time_range_value; const char* typeOfTimeIncrement; - const char* numberOfTimeRange; + const char* numberOfTimeRanges; }; class grib_accessor_class_g2end_step_t : public grib_accessor_class_long_t diff --git a/tests/grib_filter.sh b/tests/grib_filter.sh index 42e4eccdf..2799c45de 100755 --- a/tests/grib_filter.sh +++ b/tests/grib_filter.sh @@ -148,7 +148,7 @@ echo "Test ECC-648: Set codetable key to array" # --------------------------------------------- cat >$tempFilt < Date: Thu, 21 Dec 2023 16:38:32 +0000 Subject: [PATCH 27/28] ECC-1228: Add support for step range for instantaneous data --- src/step.cc | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/src/step.cc b/src/step.cc index 90c8ea2e1..ff5560378 100644 --- a/src/step.cc +++ b/src/step.cc @@ -24,7 +24,7 @@ namespace eccodes { Step step_from_string(const std::string& step, const Unit& force_unit) { - std::regex re("([0-9.]+)([smhDMYC]?)"); + std::regex re("([-]?[0-9.]+)([smhDMYC]?)"); std::smatch match; if (std::regex_match(step, match, re)) { if (match.size() == 3) { @@ -52,19 +52,44 @@ Step step_from_string(const std::string& step, const Unit& force_unit) return ret; } } - throw std::runtime_error("Could not parse step: " + step); + throw std::runtime_error("Could not parse step: \"" + step + "\""); } std::vector parse_range(const std::string& range_str, const Unit& force_unit) { + std::regex re1("([-]?[0-9.]+[smhDMYC]?)-([-]?[0-9.]+[smhDMYC]?)"); + std::regex re2("[-]?[0-9.]+[smhDMYC]?"); + + std::smatch match; std::vector steps; - std::string::size_type pos = 0; - std::string::size_type prev = 0; - while ((pos = range_str.find("-", prev)) != std::string::npos) { - steps.push_back(step_from_string(range_str.substr(prev, pos - prev), force_unit)); - prev = pos + 1; + if (std::regex_match(range_str, match, re1)) { + if (match.size() == 3) { + std::string v1 = match[1]; + std::string v2 = match[2]; + steps.push_back(step_from_string(v1, force_unit)); + steps.push_back(step_from_string(v2, force_unit)); + } + else if (match.size() == 2) { + std::string v1 = match[1]; + steps.push_back(step_from_string(v1, force_unit)); + } + else { + throw std::runtime_error("Could not parse step range for accumulated data: \"" + range_str + "\""); + } } - steps.push_back(step_from_string(range_str.substr(prev), force_unit)); + else if(std::regex_match(range_str, match, re2)) { + if (match.size() == 1) { + std::string v1 = match[0]; + steps.push_back(step_from_string(v1, force_unit)); + } + else { + throw std::runtime_error("Could not parse step range for instantaneous data: \"" + range_str + "\""); + } + } + else { + throw std::runtime_error("Could not parse step range: \"" + range_str + "\""); + } + return steps; } From 8b275bce2cb11ed1c3aa6977dd65f277a8ef2824 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Thu, 27 Jun 2024 10:49:56 +0000 Subject: [PATCH 28/28] ECC-1228: Add test --- tests/grib_sub_hourly.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/grib_sub_hourly.sh b/tests/grib_sub_hourly.sh index dfbf145f5..a49a90a6a 100755 --- a/tests/grib_sub_hourly.sh +++ b/tests/grib_sub_hourly.sh @@ -62,6 +62,11 @@ fi instantaneous_field=$data_dir/reduced_gaussian_surface.grib2 accumulated_field=$data_dir/reduced_gaussian_sub_area.grib2 +# ECC-1228: Changing template with negative forecast time +${tools_dir}/grib_set -s stepRange=-48s--24s $accumulated_field $temp +${tools_dir}/grib_set -s productDefinitionTemplateNumber=8 $temp $temp2 +grib_check_key_equals $temp2 "-p forecastTime,indicatorOfUnitOfTimeRange,lengthOfTimeRange,indicatorOfUnitForTimeRange" "-48 13 24 13" + # 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"