From debc4b674adb1460c20599b91ae044085da41bee Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 10 Aug 2023 16:25:52 +0000 Subject: [PATCH 01/81] Added necessary local definition files to support new keys for Destination Earth layout. --- definitions/grib2/destineLocalVersion.table | 1 + definitions/grib2/destine_dataset.table | 3 + definitions/grib2/destine_model.table | 5 ++ definitions/grib2/local.destine.1.def | 10 +++ definitions/grib2/products_12.def | 7 +++ definitions/grib2/products_13.def | 7 +++ definitions/grib2/products_destine.def | 69 +++++++++++++++++++++ 7 files changed, 102 insertions(+) create mode 100644 definitions/grib2/destineLocalVersion.table create mode 100644 definitions/grib2/destine_dataset.table create mode 100644 definitions/grib2/destine_model.table create mode 100644 definitions/grib2/local.destine.1.def create mode 100644 definitions/grib2/products_12.def create mode 100644 definitions/grib2/products_13.def create mode 100644 definitions/grib2/products_destine.def diff --git a/definitions/grib2/destineLocalVersion.table b/definitions/grib2/destineLocalVersion.table new file mode 100644 index 000000000..5d488d2ae --- /dev/null +++ b/definitions/grib2/destineLocalVersion.table @@ -0,0 +1 @@ +1 1 MARS labeling diff --git a/definitions/grib2/destine_dataset.table b/definitions/grib2/destine_dataset.table new file mode 100644 index 000000000..851663dab --- /dev/null +++ b/definitions/grib2/destine_dataset.table @@ -0,0 +1,3 @@ +0 unknown unknown +1 climate-dt Climate change adaptation digital twin +2 extremes-dt Weather and geophysical extremes digital twin \ No newline at end of file diff --git a/definitions/grib2/destine_model.table b/definitions/grib2/destine_model.table new file mode 100644 index 000000000..4056c13f3 --- /dev/null +++ b/definitions/grib2/destine_model.table @@ -0,0 +1,5 @@ +0 unknown unknown +1 IFS-NEMO IFS with NEMO ocean model +2 IFS-FESOM IFS with FESOM ocean model +3 ICON ICON with no ocean model +4 ICON-FESOM ICON with FESOM ocean model \ No newline at end of file diff --git a/definitions/grib2/local.destine.1.def b/definitions/grib2/local.destine.1.def new file mode 100644 index 000000000..3b4f24795 --- /dev/null +++ b/definitions/grib2/local.destine.1.def @@ -0,0 +1,10 @@ +# DestinE MARS keywords + +ksec1expver[4] experimentVersionNumber = "zzzz" : dump; +alias marsExpver = experimentVersionNumber ; + +codetable[2] dataset "grib2/destine_dataset.table" : dump; +alias mars.dataset = dataset; + +codetable[2] model "grib2/destine_model.table" : dump; +alias mars.model = model; \ No newline at end of file diff --git a/definitions/grib2/products_12.def b/definitions/grib2/products_12.def new file mode 100644 index 000000000..569b90b65 --- /dev/null +++ b/definitions/grib2/products_12.def @@ -0,0 +1,7 @@ +# (C) Copyright 2005- ECMWF. + +# Destination Earth (DestinE) + +constant marsClass = 'd1'; + +include "grib2/products_destine.def" \ No newline at end of file diff --git a/definitions/grib2/products_13.def b/definitions/grib2/products_13.def new file mode 100644 index 000000000..eaca76a20 --- /dev/null +++ b/definitions/grib2/products_13.def @@ -0,0 +1,7 @@ +# (C) Copyright 2005- ECMWF. + +# Destination Earth (DestinE) + +constant marsClass = 'd2'; + +include "grib2/products_destine.def" \ No newline at end of file diff --git a/definitions/grib2/products_destine.def b/definitions/grib2/products_destine.def new file mode 100644 index 000000000..bba7f3bc1 --- /dev/null +++ b/definitions/grib2/products_destine.def @@ -0,0 +1,69 @@ +# (C) Copyright 2005- ECMWF. + +alias mars.expver = experimentVersionNumber; +alias parameter.paramId=paramId; +alias parameter.shortName=shortName; +alias parameter.units=units; +alias parameter.name=name; + +alias mars.class = marsClass; +alias mars.param = paramId; +alias mars.origin = centre; + +# Special UERRA rule for level type 103 'Specified height level above ground (m)' +if(typeOfFirstFixedSurface == 103) { + # only the parameters above 10m + if (level > 10) { + constant heightLevelName = 'hl'; + alias mars.levtype = heightLevelName; + # levelist was unaliased in template.4.horizontal.def so we must have it back + alias mars.levelist = level; + } +} + +concept marsType(unknown) { + + fc = { + typeOfProcessedData = 1; + } + "9" = { + typeOfProcessedData = 1; + } + + an = { + typeOfProcessedData = 0; + } + "2" = { + typeOfProcessedData = 0; + } + +} + +alias mars.type = marsType; + +concept marsStream(unknown) { + + oper = { + productDefinitionTemplateNumber = 8; + } + oper = { + productDefinitionTemplateNumber = 0; + } + + enda = { + productDefinitionTemplateNumber = 11; + } + enda = { + productDefinitionTemplateNumber = 1; + } +} : no_copy; + +alias mars.stream = marsStream; + +if (stepType is "avg" || stepType is "accum") { + alias mars.step = stepRange; +} +else { + alias mars.step = step; +} + From d18cc08955edc19c49a440eb1f31841033b20c16 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 10 Aug 2023 16:26:50 +0000 Subject: [PATCH 02/81] Added definitions of d1 and d2, destine and destine test where they are required. --- definitions/grib2/section.2.def | 6 ++++++ definitions/grib2/section.4.def | 2 ++ definitions/grib2/tables/31/1.3.table | 4 +++- definitions/mars/class.table | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/definitions/grib2/section.2.def b/definitions/grib2/section.2.def index f7da1537a..f6081b10b 100644 --- a/definitions/grib2/section.2.def +++ b/definitions/grib2/section.2.def @@ -34,6 +34,12 @@ if ( addEmptySection2 == 0 ) { template crraSection "grib2/local.crra.[crraLocalVersion:l].def"; } + if(productionStatusOfProcessedData == 12 || productionStatusOfProcessedData == 13) { + # destine = Destination Earth + codetable[2] destineLocalVersion 'grib2/destineLocalVersion.table' = 1 : dump; + template destineSection "grib2/local.destine.[destineLocalVersion:l].def"; + } + codetable[2] grib2LocalSectionNumber 'grib2/grib2LocalSectionNumber.[centreForLocal:l].table' = 1 : dump; if (grib2LocalSectionNumber!=0) { diff --git a/definitions/grib2/section.4.def b/definitions/grib2/section.4.def index b62a15329..70f321f19 100644 --- a/definitions/grib2/section.4.def +++ b/definitions/grib2/section.4.def @@ -36,6 +36,8 @@ concept datasetForLocal(unknown) { "uerra" = {productionStatusOfProcessedData=9;} # UERRA "uerra" = {productionStatusOfProcessedData=10;} # CARRA/CERRA "uerra" = {productionStatusOfProcessedData=11;} # CARRA/CERRA + "destine" = {productionStatusOfProcessedData=12;} # DestinE + "destine" = {productionStatusOfProcessedData=13;} # DestinE "unknown" = { dummy=1; } } diff --git a/definitions/grib2/tables/31/1.3.table b/definitions/grib2/tables/31/1.3.table index 5e2e59087..26005a4d0 100644 --- a/definitions/grib2/tables/31/1.3.table +++ b/definitions/grib2/tables/31/1.3.table @@ -11,6 +11,8 @@ 9 9 Uncertainties in Ensembles of Regional ReAnalyses project test (UERRA) 10 10 Copernicus regional reanalysis (CARRA/CERRA) 11 11 Copernicus regional reanalysis test (CARRA/CERRA) -# 12-191 Reserved +12 12 Destination Earth (DestinE) +13 13 Destination Earth test (DestinE) +# 14-191 Reserved # 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/mars/class.table b/definitions/mars/class.table index 6e8a0aa27..303adda1e 100644 --- a/definitions/mars/class.table +++ b/definitions/mars/class.table @@ -45,6 +45,7 @@ 44 gg Greenhouse Gases 45 ml Machine learning 46 d1 Destination Earth +47 d2 Destination Earth Test 99 te Test 100 at Austria 101 be Belgium From a25977ab0e709eec2041240cdf5bf593fae072ca Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Fri, 1 Sep 2023 10:26:49 +0000 Subject: [PATCH 03/81] Work to add additional concepts for DE layout --- definitions/common/c-12.98.table | 7 +++++++ definitions/grib2/destine_datasetVersion.table | 3 +++ definitions/grib2/destine_model.table | 9 +++++---- definitions/grib2/local.destine.1.def | 11 ++--------- definitions/grib2/local.destine.2.def | 4 ++++ definitions/grib2/local.destine.3.def | 3 +++ definitions/grib2/local.destine.base.def | 10 ++++++++++ definitions/grib2/local.destine.cmip.def | 4 ++++ .../localConcepts/destine/destineOriginConcept.def | 7 +++++++ .../destine/gridSpecificationConcept.def | 2 ++ .../localConcepts/destine/modelVersionConcept.def | 2 ++ definitions/grib2/section.1.def | 2 +- definitions/grib2/section.4.def | 2 +- definitions/grib2/section.6.hook.12.def | 13 +++++++++++++ definitions/grib2/sections.def | 2 ++ 15 files changed, 66 insertions(+), 15 deletions(-) create mode 100644 definitions/common/c-12.98.table create mode 100644 definitions/grib2/destine_datasetVersion.table create mode 100644 definitions/grib2/local.destine.2.def create mode 100644 definitions/grib2/local.destine.3.def create mode 100644 definitions/grib2/local.destine.base.def create mode 100644 definitions/grib2/local.destine.cmip.def create mode 100644 definitions/grib2/localConcepts/destine/destineOriginConcept.def create mode 100644 definitions/grib2/localConcepts/destine/gridSpecificationConcept.def create mode 100644 definitions/grib2/localConcepts/destine/modelVersionConcept.def create mode 100644 definitions/grib2/section.6.hook.12.def diff --git a/definitions/common/c-12.98.table b/definitions/common/c-12.98.table new file mode 100644 index 000000000..74883d603 --- /dev/null +++ b/definitions/common/c-12.98.table @@ -0,0 +1,7 @@ +# COMMON CODE TABLE C-12: Subcentres for originating/generating centre ECMF (98) (GRIB2, BUFR4) +78 edzw Offenbach (RSMC) +84 lfpw French Weather Service - Toulouse +1000 bsc Barcelona Supercomputing Centre (BSC) +1001 csc CSC – IT Center for Science LTD. +1002 dkrz German Climate Computation Center (DKRZ) +65535 65535 Missing \ No newline at end of file diff --git a/definitions/grib2/destine_datasetVersion.table b/definitions/grib2/destine_datasetVersion.table new file mode 100644 index 000000000..ecdb27737 --- /dev/null +++ b/definitions/grib2/destine_datasetVersion.table @@ -0,0 +1,3 @@ +0 unknown unknown +1 v20230701 v20230701 +2 v20230801 v20230801 \ No newline at end of file diff --git a/definitions/grib2/destine_model.table b/definitions/grib2/destine_model.table index 4056c13f3..5ba91003a 100644 --- a/definitions/grib2/destine_model.table +++ b/definitions/grib2/destine_model.table @@ -1,5 +1,6 @@ 0 unknown unknown -1 IFS-NEMO IFS with NEMO ocean model -2 IFS-FESOM IFS with FESOM ocean model -3 ICON ICON with no ocean model -4 ICON-FESOM ICON with FESOM ocean model \ No newline at end of file +1 IFS IFS with no ocean model +2 IFS-NEMO IFS with NEMO ocean model +3 IFS-FESOM IFS with FESOM ocean model +4 ICON ICON with no ocean model +5 ICON-FESOM ICON with FESOM ocean model \ No newline at end of file diff --git a/definitions/grib2/local.destine.1.def b/definitions/grib2/local.destine.1.def index 3b4f24795..c3cddfa13 100644 --- a/definitions/grib2/local.destine.1.def +++ b/definitions/grib2/local.destine.1.def @@ -1,10 +1,3 @@ -# DestinE MARS keywords +# DestinE MARS base keywords -ksec1expver[4] experimentVersionNumber = "zzzz" : dump; -alias marsExpver = experimentVersionNumber ; - -codetable[2] dataset "grib2/destine_dataset.table" : dump; -alias mars.dataset = dataset; - -codetable[2] model "grib2/destine_model.table" : dump; -alias mars.model = model; \ No newline at end of file +include "grib2/local.destine.base.def"; \ No newline at end of file diff --git a/definitions/grib2/local.destine.2.def b/definitions/grib2/local.destine.2.def new file mode 100644 index 000000000..aafa52d2b --- /dev/null +++ b/definitions/grib2/local.destine.2.def @@ -0,0 +1,4 @@ +# DestinE MARS ClimateDT keywords + +include "grib2/local.destine.base.def"; +include "grib2/local.destine.cmip.def"; \ No newline at end of file diff --git a/definitions/grib2/local.destine.3.def b/definitions/grib2/local.destine.3.def new file mode 100644 index 000000000..cb0443fdf --- /dev/null +++ b/definitions/grib2/local.destine.3.def @@ -0,0 +1,3 @@ +# DestinE MARS ExtremesDT keywords + +include "grib2/local.destine.base.def"; \ No newline at end of file diff --git a/definitions/grib2/local.destine.base.def b/definitions/grib2/local.destine.base.def new file mode 100644 index 000000000..6cbf8807c --- /dev/null +++ b/definitions/grib2/local.destine.base.def @@ -0,0 +1,10 @@ +# DestinE MARS base keywords + +ksec1expver[4] experimentVersionNumber = "zzzz" : dump; +alias marsExpver = experimentVersionNumber ; + +codetable[2] dataset "grib2/destine_dataset.table" : dump; +alias mars.dataset = dataset; + +codetable[2] model "grib2/destine_model.table" : dump; +alias mars.model = model; \ No newline at end of file diff --git a/definitions/grib2/local.destine.cmip.def b/definitions/grib2/local.destine.cmip.def new file mode 100644 index 000000000..fdf1d9342 --- /dev/null +++ b/definitions/grib2/local.destine.cmip.def @@ -0,0 +1,4 @@ +# DestinE MARS CMIP keywords + +codetable[2] datasetVersion "grib2/destine_datasetVersion.table" : dump; +alias mars.datasetVersion = datasetVersion; \ No newline at end of file diff --git a/definitions/grib2/localConcepts/destine/destineOriginConcept.def b/definitions/grib2/localConcepts/destine/destineOriginConcept.def new file mode 100644 index 000000000..1da6716b5 --- /dev/null +++ b/definitions/grib2/localConcepts/destine/destineOriginConcept.def @@ -0,0 +1,7 @@ +# Concept destineOrigin +'DWD' = {centre=98;subCentre=78} +'MeteoFrance' = {centre=98;subCentre=84;} +'BSC' = {centre=98;subCentre=1000;} +'CSC' = {centre=98;subCentre=1001;} +'DKRZ' = {centre=98;subCentre=1002;} + diff --git a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def new file mode 100644 index 000000000..8f87a1401 --- /dev/null +++ b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def @@ -0,0 +1,2 @@ +# Concept gridSpecification +'O1280' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=255;} \ No newline at end of file diff --git a/definitions/grib2/localConcepts/destine/modelVersionConcept.def b/definitions/grib2/localConcepts/destine/modelVersionConcept.def new file mode 100644 index 000000000..6b307d07f --- /dev/null +++ b/definitions/grib2/localConcepts/destine/modelVersionConcept.def @@ -0,0 +1,2 @@ +# Concept modelVersion +# '48r1' = {backgroundProcess = 255, generatingProcessIdentifier = ...} # TODO: Need to work out proper mapping and make those keys local \ No newline at end of file diff --git a/definitions/grib2/section.1.def b/definitions/grib2/section.1.def index 719a9399c..2fcac3a74 100644 --- a/definitions/grib2/section.1.def +++ b/definitions/grib2/section.1.def @@ -14,7 +14,7 @@ alias parameter.centre=centre; alias ls.centre=centre; alias originatingCentre=centre; -unsigned[2] subCentre : dump; +codetable[2] subCentre "common/c-12.[centre].def" : dump; _if (subCentre==98 ) { alias centreForLocal=subCentre; diff --git a/definitions/grib2/section.4.def b/definitions/grib2/section.4.def index 70f321f19..e78f8109c 100644 --- a/definitions/grib2/section.4.def +++ b/definitions/grib2/section.4.def @@ -37,7 +37,7 @@ concept datasetForLocal(unknown) { "uerra" = {productionStatusOfProcessedData=10;} # CARRA/CERRA "uerra" = {productionStatusOfProcessedData=11;} # CARRA/CERRA "destine" = {productionStatusOfProcessedData=12;} # DestinE - "destine" = {productionStatusOfProcessedData=13;} # DestinE + "destine" = {productionStatusOfProcessedData=13;} # DestinE Test "unknown" = { dummy=1; } } diff --git a/definitions/grib2/section.6.hook.12.def b/definitions/grib2/section.6.hook.12.def new file mode 100644 index 000000000..8afcbdc33 --- /dev/null +++ b/definitions/grib2/section.6.hook.12.def @@ -0,0 +1,13 @@ +# (C) Copyright 2005- ECMWF. +# Hooks after section 6 + + +# conceptsDir2 --> datasetForLocal +concept gridSpecification("unknown", "gridXYZConcept.def",conceptsDir2,conceptsDir1): no_copy; +alias mars.gridSpecification = gridSpecification + +concept destineOrigin("unknown", "destineOriginConcept.def",conceptsDir2,conceptsDir1): no_copy; +alias mars.origin = destineOrigin + +concept modelVersion("unknown", "modelVersionConcept.def",conceptsDir2,conceptsDir1): no_copy; +alias mars.modelVersion = modelVersion \ No newline at end of file diff --git a/definitions/grib2/sections.def b/definitions/grib2/sections.def index ed998ca61..61aff3f29 100644 --- a/definitions/grib2/sections.def +++ b/definitions/grib2/sections.def @@ -59,6 +59,8 @@ if (!headersOnly) { lookup[1] sectionNumber(4) ; + template_nofail hook_after_section_6 "grib2/section.6.hook.[productionStatusOfProcessedData].def"; + if (sectionNumber == 7 or new() ) { position sectionPosition; template section_7 "grib2/section.7.def"; From a7b9fc186a530e0ddd141c47a2143c875530b00b Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Fri, 1 Sep 2023 10:29:52 +0000 Subject: [PATCH 04/81] Missed file --- .../grib2/localConcepts/destine/gridSpecificationConcept.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def index 8f87a1401..e267bcb7a 100644 --- a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def +++ b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def @@ -1,2 +1,2 @@ # Concept gridSpecification -'O1280' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=255;} \ No newline at end of file +'O1280' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=255;} \ No newline at end of file From 0afe8de30ad792d019e12fc20f6fee183e8f752f Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Mon, 4 Sep 2023 12:36:06 +0000 Subject: [PATCH 05/81] Changed to using dataset specific def file; Commented out change to sections.def for now while debugging. --- definitions/grib2/local.destine.1.def | 10 ++++++++-- definitions/grib2/local.destine.2.def | 4 ---- definitions/grib2/local.destine.3.def | 3 --- ...l.destine.cmip.def => local.destine.climate-dt.def} | 2 +- definitions/grib2/sections.def | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 definitions/grib2/local.destine.2.def delete mode 100644 definitions/grib2/local.destine.3.def rename definitions/grib2/{local.destine.cmip.def => local.destine.climate-dt.def} (77%) diff --git a/definitions/grib2/local.destine.1.def b/definitions/grib2/local.destine.1.def index c3cddfa13..c159156e7 100644 --- a/definitions/grib2/local.destine.1.def +++ b/definitions/grib2/local.destine.1.def @@ -1,3 +1,9 @@ -# DestinE MARS base keywords +# DestinE MARS layout -include "grib2/local.destine.base.def"; \ No newline at end of file +include "grib2/local.destine.base.def" + +# <-- this adds mars.dataset keyword + +# Keywords based on dataset + +# include "grib2/local.destine.[dataset:s].def": no_fail \ No newline at end of file diff --git a/definitions/grib2/local.destine.2.def b/definitions/grib2/local.destine.2.def deleted file mode 100644 index aafa52d2b..000000000 --- a/definitions/grib2/local.destine.2.def +++ /dev/null @@ -1,4 +0,0 @@ -# DestinE MARS ClimateDT keywords - -include "grib2/local.destine.base.def"; -include "grib2/local.destine.cmip.def"; \ No newline at end of file diff --git a/definitions/grib2/local.destine.3.def b/definitions/grib2/local.destine.3.def deleted file mode 100644 index cb0443fdf..000000000 --- a/definitions/grib2/local.destine.3.def +++ /dev/null @@ -1,3 +0,0 @@ -# DestinE MARS ExtremesDT keywords - -include "grib2/local.destine.base.def"; \ No newline at end of file diff --git a/definitions/grib2/local.destine.cmip.def b/definitions/grib2/local.destine.climate-dt.def similarity index 77% rename from definitions/grib2/local.destine.cmip.def rename to definitions/grib2/local.destine.climate-dt.def index fdf1d9342..997d81f74 100644 --- a/definitions/grib2/local.destine.cmip.def +++ b/definitions/grib2/local.destine.climate-dt.def @@ -1,4 +1,4 @@ -# DestinE MARS CMIP keywords +# DestinE MARS ClimateDT keywords codetable[2] datasetVersion "grib2/destine_datasetVersion.table" : dump; alias mars.datasetVersion = datasetVersion; \ No newline at end of file diff --git a/definitions/grib2/sections.def b/definitions/grib2/sections.def index 61aff3f29..194255f40 100644 --- a/definitions/grib2/sections.def +++ b/definitions/grib2/sections.def @@ -59,7 +59,7 @@ if (!headersOnly) { lookup[1] sectionNumber(4) ; - template_nofail hook_after_section_6 "grib2/section.6.hook.[productionStatusOfProcessedData].def"; + # template_nofail hook_after_section_6 "grib2/section.6.hook.[productionStatusOfProcessedData].def"; if (sectionNumber == 7 or new() ) { position sectionPosition; From 2f7c58a626d307cf1ef3155c32abaa3e4f20bd98 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Wed, 13 Sep 2023 14:05:05 +0000 Subject: [PATCH 06/81] Clean up and fixing bugs --- definitions/grib2/local.destine.1.def | 8 +++----- definitions/grib2/local.destine.base.def | 3 --- .../grib2/localConcepts/destine/modelVersionConcept.def | 3 ++- definitions/grib2/section.1.def | 3 ++- definitions/grib2/section.6.hook.12.def | 2 +- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/definitions/grib2/local.destine.1.def b/definitions/grib2/local.destine.1.def index c159156e7..fc336b33a 100644 --- a/definitions/grib2/local.destine.1.def +++ b/definitions/grib2/local.destine.1.def @@ -1,9 +1,7 @@ # DestinE MARS layout -include "grib2/local.destine.base.def" - -# <-- this adds mars.dataset keyword +# Base keywords for all datasets +include "grib2/local.destine.base.def"; # Keywords based on dataset - -# include "grib2/local.destine.[dataset:s].def": no_fail \ No newline at end of file +template datasetTemplate "grib2/local.destine.[dataset:s].def"; diff --git a/definitions/grib2/local.destine.base.def b/definitions/grib2/local.destine.base.def index 6cbf8807c..185524c33 100644 --- a/definitions/grib2/local.destine.base.def +++ b/definitions/grib2/local.destine.base.def @@ -1,8 +1,5 @@ # DestinE MARS base keywords -ksec1expver[4] experimentVersionNumber = "zzzz" : dump; -alias marsExpver = experimentVersionNumber ; - codetable[2] dataset "grib2/destine_dataset.table" : dump; alias mars.dataset = dataset; diff --git a/definitions/grib2/localConcepts/destine/modelVersionConcept.def b/definitions/grib2/localConcepts/destine/modelVersionConcept.def index 6b307d07f..098deaa56 100644 --- a/definitions/grib2/localConcepts/destine/modelVersionConcept.def +++ b/definitions/grib2/localConcepts/destine/modelVersionConcept.def @@ -1,2 +1,3 @@ # Concept modelVersion -# '48r1' = {backgroundProcess = 255, generatingProcessIdentifier = ...} # TODO: Need to work out proper mapping and make those keys local \ No newline at end of file +# TODO: Need to work out proper mapping and make those keys local +'48r1' = {backgroundProcess = 255, generatingProcessIdentifier = 255} \ No newline at end of file diff --git a/definitions/grib2/section.1.def b/definitions/grib2/section.1.def index 2fcac3a74..c6c6c16b5 100644 --- a/definitions/grib2/section.1.def +++ b/definitions/grib2/section.1.def @@ -14,7 +14,8 @@ alias parameter.centre=centre; alias ls.centre=centre; alias originatingCentre=centre; -codetable[2] subCentre "common/c-12.[centre].def" : dump; +# codetable[2] subCentre "common/c-12.[centre].def" : dump; +unsigned[2] subCentre : dump; _if (subCentre==98 ) { alias centreForLocal=subCentre; diff --git a/definitions/grib2/section.6.hook.12.def b/definitions/grib2/section.6.hook.12.def index 8afcbdc33..93d8a8a6f 100644 --- a/definitions/grib2/section.6.hook.12.def +++ b/definitions/grib2/section.6.hook.12.def @@ -1,5 +1,5 @@ # (C) Copyright 2005- ECMWF. -# Hooks after section 6 +# Hooks after section 6 for DestinE (productionStatusOfProcessedData=12) # conceptsDir2 --> datasetForLocal From e8180539ec6292b0140c292566a0901bf11bcde2 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Wed, 13 Sep 2023 16:34:18 +0000 Subject: [PATCH 07/81] Bugs fixed! Added full functionality for ClimateDT --- definitions/grib2/destine_CMIPActivity.table | 4 ++++ definitions/grib2/destine_CMIPExperiment.table | 9 +++++++++ definitions/grib2/destine_CMIPGridLabel.table | 3 +++ definitions/grib2/destine_model.table | 3 ++- definitions/grib2/local.destine.1.def | 2 +- definitions/grib2/local.destine.climate-dt.def | 11 ++++++++++- .../localConcepts/destine/destineOriginConcept.def | 10 +++++----- .../localConcepts/destine/modelVersionConcept.def | 2 +- definitions/grib2/products_destine.def | 4 +++- definitions/grib2/section.6.hook.12.def | 12 +++++------- definitions/grib2/sections.def | 2 +- 11 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 definitions/grib2/destine_CMIPActivity.table create mode 100644 definitions/grib2/destine_CMIPExperiment.table create mode 100644 definitions/grib2/destine_CMIPGridLabel.table diff --git a/definitions/grib2/destine_CMIPActivity.table b/definitions/grib2/destine_CMIPActivity.table new file mode 100644 index 000000000..cfa3ac747 --- /dev/null +++ b/definitions/grib2/destine_CMIPActivity.table @@ -0,0 +1,4 @@ +0 unknown unknown +1 CMIP5 CMIP5 +2 CMIP6 CMIP6 +3 ScenarioMIP ScenarioMIP \ No newline at end of file diff --git a/definitions/grib2/destine_CMIPExperiment.table b/definitions/grib2/destine_CMIPExperiment.table new file mode 100644 index 000000000..1744f97bb --- /dev/null +++ b/definitions/grib2/destine_CMIPExperiment.table @@ -0,0 +1,9 @@ +0 unknown unknown +1 hist Historical +2 RCP2.6 RCP 2.6 +3 RCP4.5 RCP 4.5 +4 RCP8.5 RCP 8.5 +5 SSP1-2.6 SSP1-2.6 +6 SSP2-4.5 SSP2-4.5 +7 SSP3-7.0 SSP3-7.0 +8 SSP5-8.5 SSP5-8.5 \ No newline at end of file diff --git a/definitions/grib2/destine_CMIPGridLabel.table b/definitions/grib2/destine_CMIPGridLabel.table new file mode 100644 index 000000000..b3e9b279b --- /dev/null +++ b/definitions/grib2/destine_CMIPGridLabel.table @@ -0,0 +1,3 @@ +0 unknown unknown +1 gn Native grid +2 gr Regridded \ No newline at end of file diff --git a/definitions/grib2/destine_model.table b/definitions/grib2/destine_model.table index 5ba91003a..b1ec128de 100644 --- a/definitions/grib2/destine_model.table +++ b/definitions/grib2/destine_model.table @@ -3,4 +3,5 @@ 2 IFS-NEMO IFS with NEMO ocean model 3 IFS-FESOM IFS with FESOM ocean model 4 ICON ICON with no ocean model -5 ICON-FESOM ICON with FESOM ocean model \ No newline at end of file +5 ICON-NEMO IFS with NEMO ocean model +6 ICON-FESOM ICON with FESOM ocean model \ No newline at end of file diff --git a/definitions/grib2/local.destine.1.def b/definitions/grib2/local.destine.1.def index fc336b33a..db1f2f389 100644 --- a/definitions/grib2/local.destine.1.def +++ b/definitions/grib2/local.destine.1.def @@ -4,4 +4,4 @@ include "grib2/local.destine.base.def"; # Keywords based on dataset -template datasetTemplate "grib2/local.destine.[dataset:s].def"; +template_nofail datasetTemplate "grib2/local.destine.[dataset:s].def"; diff --git a/definitions/grib2/local.destine.climate-dt.def b/definitions/grib2/local.destine.climate-dt.def index 997d81f74..584d2f7ae 100644 --- a/definitions/grib2/local.destine.climate-dt.def +++ b/definitions/grib2/local.destine.climate-dt.def @@ -1,4 +1,13 @@ # DestinE MARS ClimateDT keywords codetable[2] datasetVersion "grib2/destine_datasetVersion.table" : dump; -alias mars.datasetVersion = datasetVersion; \ No newline at end of file +alias mars.datasetVersion = datasetVersion; + +codetable[2] CMIPActivity "grib2/destine_CMIPActivity.table" : dump; +alias mars.CMIPActivity = CMIPActivity; + +codetable[2] CMIPExperiment "grib2/destine_CMIPExperiment.table" : dump; +alias mars.CMIPExperiment = CMIPExperiment; + +codetable[2] CMIPGridLabel "grib2/destine_CMIPGridLabel.table" : dump; +alias mars.CMIPGridLabel = CMIPGridLabel; \ No newline at end of file diff --git a/definitions/grib2/localConcepts/destine/destineOriginConcept.def b/definitions/grib2/localConcepts/destine/destineOriginConcept.def index 1da6716b5..a013ee42f 100644 --- a/definitions/grib2/localConcepts/destine/destineOriginConcept.def +++ b/definitions/grib2/localConcepts/destine/destineOriginConcept.def @@ -1,7 +1,7 @@ # Concept destineOrigin -'DWD' = {centre=98;subCentre=78} -'MeteoFrance' = {centre=98;subCentre=84;} -'BSC' = {centre=98;subCentre=1000;} -'CSC' = {centre=98;subCentre=1001;} -'DKRZ' = {centre=98;subCentre=1002;} +"DWD" = { centre=98; subCentre=78; } +"MeteoFrance" = { centre=98; subCentre=84; } +"BSC" = { centre=98; subCentre=1000; } +"CSC" = { centre=98; subCentre=1001; } +"DKRZ" = { centre=98; subCentre=1002; } diff --git a/definitions/grib2/localConcepts/destine/modelVersionConcept.def b/definitions/grib2/localConcepts/destine/modelVersionConcept.def index 098deaa56..f55271cbd 100644 --- a/definitions/grib2/localConcepts/destine/modelVersionConcept.def +++ b/definitions/grib2/localConcepts/destine/modelVersionConcept.def @@ -1,3 +1,3 @@ # Concept modelVersion # TODO: Need to work out proper mapping and make those keys local -'48r1' = {backgroundProcess = 255, generatingProcessIdentifier = 255} \ No newline at end of file +"48r1" = { backgroundProcess = 255; generatingProcessIdentifier = 154; } \ No newline at end of file diff --git a/definitions/grib2/products_destine.def b/definitions/grib2/products_destine.def index bba7f3bc1..3a7cdd39c 100644 --- a/definitions/grib2/products_destine.def +++ b/definitions/grib2/products_destine.def @@ -10,7 +10,7 @@ alias mars.class = marsClass; alias mars.param = paramId; alias mars.origin = centre; -# Special UERRA rule for level type 103 'Specified height level above ground (m)' +# Special rule for level type 103 'Specified height level above ground (m)' if(typeOfFirstFixedSurface == 103) { # only the parameters above 10m if (level > 10) { @@ -21,6 +21,8 @@ if(typeOfFirstFixedSurface == 103) { } } +# Define marsType based on type of processed data + concept marsType(unknown) { fc = { diff --git a/definitions/grib2/section.6.hook.12.def b/definitions/grib2/section.6.hook.12.def index 93d8a8a6f..6e654b85d 100644 --- a/definitions/grib2/section.6.hook.12.def +++ b/definitions/grib2/section.6.hook.12.def @@ -1,13 +1,11 @@ # (C) Copyright 2005- ECMWF. # Hooks after section 6 for DestinE (productionStatusOfProcessedData=12) - # conceptsDir2 --> datasetForLocal -concept gridSpecification("unknown", "gridXYZConcept.def",conceptsDir2,conceptsDir1): no_copy; -alias mars.gridSpecification = gridSpecification +concept gridSpecification(unknown, "gridSpecificationConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; + +concept destineOrigin (unknown, "destineOriginConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; +alias mars.origin = destineOrigin; -concept destineOrigin("unknown", "destineOriginConcept.def",conceptsDir2,conceptsDir1): no_copy; -alias mars.origin = destineOrigin +concept modelVersion (unknown, "modelVersionConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; -concept modelVersion("unknown", "modelVersionConcept.def",conceptsDir2,conceptsDir1): no_copy; -alias mars.modelVersion = modelVersion \ No newline at end of file diff --git a/definitions/grib2/sections.def b/definitions/grib2/sections.def index 194255f40..61aff3f29 100644 --- a/definitions/grib2/sections.def +++ b/definitions/grib2/sections.def @@ -59,7 +59,7 @@ if (!headersOnly) { lookup[1] sectionNumber(4) ; - # template_nofail hook_after_section_6 "grib2/section.6.hook.[productionStatusOfProcessedData].def"; + template_nofail hook_after_section_6 "grib2/section.6.hook.[productionStatusOfProcessedData].def"; if (sectionNumber == 7 or new() ) { position sectionPosition; From 033a60d1efe636dbd6310805b1f33a48fee6b948 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 14 Sep 2023 16:08:34 +0000 Subject: [PATCH 08/81] New table entries and definition for ODEDT --- definitions/grib2/destine_dataset.table | 4 +++- definitions/grib2/destine_zoomRegion.table | 4 ++++ definitions/grib2/local.destine.on-demand-extremes-dt.def | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 definitions/grib2/destine_zoomRegion.table create mode 100644 definitions/grib2/local.destine.on-demand-extremes-dt.def diff --git a/definitions/grib2/destine_dataset.table b/definitions/grib2/destine_dataset.table index 851663dab..1b56cd8c8 100644 --- a/definitions/grib2/destine_dataset.table +++ b/definitions/grib2/destine_dataset.table @@ -1,3 +1,5 @@ 0 unknown unknown 1 climate-dt Climate change adaptation digital twin -2 extremes-dt Weather and geophysical extremes digital twin \ No newline at end of file +2 extremes-dt Weather and geophysical extremes digital twin +3 on-demand-climate-dt On-demand climate change adaptation digital twin +4 on-demand-extremes-dt On-demand weather and geophysical extremes digital twin \ No newline at end of file diff --git a/definitions/grib2/destine_zoomRegion.table b/definitions/grib2/destine_zoomRegion.table new file mode 100644 index 000000000..bb21d5600 --- /dev/null +++ b/definitions/grib2/destine_zoomRegion.table @@ -0,0 +1,4 @@ +0 unknown unknown +1 e Europe +2 uk United Kingdom +3 fr France \ No newline at end of file diff --git a/definitions/grib2/local.destine.on-demand-extremes-dt.def b/definitions/grib2/local.destine.on-demand-extremes-dt.def new file mode 100644 index 000000000..5117df354 --- /dev/null +++ b/definitions/grib2/local.destine.on-demand-extremes-dt.def @@ -0,0 +1,4 @@ +# DestinE MARS ClimateDT keywords + +codetable[2] zoomRegion "grib2/destine_zoomRegion.table" : dump; +alias mars.zoomRegion = zoomRegion; \ No newline at end of file From df615ca8e00d857b31ba3d378574c9907db9d249 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Fri, 15 Sep 2023 09:25:08 +0000 Subject: [PATCH 09/81] Added some grids to the gridSpecification --- .../grib2/localConcepts/destine/gridSpecificationConcept.def | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def index e267bcb7a..f983d219c 100644 --- a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def +++ b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def @@ -1,2 +1,4 @@ # Concept gridSpecification -'O1280' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=255;} \ No newline at end of file +'CARRA-East' = {numberOfDataPoints = 780321; gridDefinitionTemplateNumber=30; Nx=789; Ny=989;} +'O1280' = {numberOfDataPoints=6599680; gridDefinitionTemplateNumber=40; Nj=2560;} +'O8000' = {numberOfDataPoints=256288000; gridDefinitionTemplateNumber=40; Nj=16000;} \ No newline at end of file From e8f1a3f0807c4886be961f37a3fe8a58c3144f65 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Tue, 19 Sep 2023 14:49:48 +0000 Subject: [PATCH 10/81] Make grid_spec read_only; Remove origin from mars namespace; Remove CARRA-EAST grid_spec --- .../localConcepts/destine/gridSpecificationConcept.def | 8 +++++++- definitions/grib2/section.6.hook.12.def | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def index f983d219c..67f61c217 100644 --- a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def +++ b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def @@ -1,4 +1,10 @@ # Concept gridSpecification -'CARRA-East' = {numberOfDataPoints = 780321; gridDefinitionTemplateNumber=30; Nx=789; Ny=989;} +'H16' = {numberOfDataPoints=3072; gridDefinitionTemplateNumber=150;} +'H32' = {numberOfDataPoints=12288; gridDefinitionTemplateNumber=150;} +'H64' = {numberOfDataPoints=49152; gridDefinitionTemplateNumber=150;} +'H128' = {numberOfDataPoints=196608; gridDefinitionTemplateNumber=150;} +'H256' = {numberOfDataPoints=786432; gridDefinitionTemplateNumber=150;} +'H512 = {numberOfDataPoints=3145728; gridDefinitionTemplateNumber=150;} +'H1024' = {numberOfDataPoints=12582912; gridDefinitionTemplateNumber=150;} 'O1280' = {numberOfDataPoints=6599680; gridDefinitionTemplateNumber=40; Nj=2560;} 'O8000' = {numberOfDataPoints=256288000; gridDefinitionTemplateNumber=40; Nj=16000;} \ No newline at end of file diff --git a/definitions/grib2/section.6.hook.12.def b/definitions/grib2/section.6.hook.12.def index 6e654b85d..be89c2e5a 100644 --- a/definitions/grib2/section.6.hook.12.def +++ b/definitions/grib2/section.6.hook.12.def @@ -2,10 +2,9 @@ # Hooks after section 6 for DestinE (productionStatusOfProcessedData=12) # conceptsDir2 --> datasetForLocal -concept gridSpecification(unknown, "gridSpecificationConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; +concept gridSpecification(unknown, "gridSpecificationConcept.def",conceptsDir2,conceptsDir1): no_copy, read_only, dump; concept destineOrigin (unknown, "destineOriginConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; -alias mars.origin = destineOrigin; concept modelVersion (unknown, "modelVersionConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; From 6c693fbbd4b36620529308ad9349195d8af8dce1 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 21 Sep 2023 10:15:07 +0000 Subject: [PATCH 11/81] Remove reference to d2; This is not necessary at this stage --- definitions/grib2/products_13.def | 7 ------- definitions/mars/class.table | 1 - 2 files changed, 8 deletions(-) delete mode 100644 definitions/grib2/products_13.def diff --git a/definitions/grib2/products_13.def b/definitions/grib2/products_13.def deleted file mode 100644 index eaca76a20..000000000 --- a/definitions/grib2/products_13.def +++ /dev/null @@ -1,7 +0,0 @@ -# (C) Copyright 2005- ECMWF. - -# Destination Earth (DestinE) - -constant marsClass = 'd2'; - -include "grib2/products_destine.def" \ No newline at end of file diff --git a/definitions/mars/class.table b/definitions/mars/class.table index 9dda395f3..55b321573 100644 --- a/definitions/mars/class.table +++ b/definitions/mars/class.table @@ -46,7 +46,6 @@ 45 ml Machine learning 46 d1 Destination Earth 47 o6 ECMWF Ocean ReAnalysis version 6 (EORA6) -48 d2 Destination Earth Test 99 te Test 100 at Austria 101 be Belgium From f11d3057ce5240bba6035d48f221bdb17687c2c7 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 21 Sep 2023 10:37:07 +0000 Subject: [PATCH 12/81] Preparation for develop; Removing concepts which we don't need for ClimateDT; Modified tables based on feedback from ClimateDT modellers --- definitions/grib2/destine_CMIPActivity.table | 5 ++--- definitions/grib2/destine_CMIPExperiment.table | 13 ++++++------- definitions/grib2/destine_CMIPGridLabel.table | 3 --- definitions/grib2/destine_zoomRegion.table | 4 ---- definitions/grib2/local.destine.climate-dt.def | 4 ++-- .../grib2/local.destine.on-demand-extremes-dt.def | 4 ---- .../localConcepts/destine/modelVersionConcept.def | 3 --- definitions/grib2/section.6.hook.12.def | 3 --- 8 files changed, 10 insertions(+), 29 deletions(-) delete mode 100644 definitions/grib2/destine_CMIPGridLabel.table delete mode 100644 definitions/grib2/destine_zoomRegion.table delete mode 100644 definitions/grib2/local.destine.on-demand-extremes-dt.def delete mode 100644 definitions/grib2/localConcepts/destine/modelVersionConcept.def diff --git a/definitions/grib2/destine_CMIPActivity.table b/definitions/grib2/destine_CMIPActivity.table index cfa3ac747..49044d18b 100644 --- a/definitions/grib2/destine_CMIPActivity.table +++ b/definitions/grib2/destine_CMIPActivity.table @@ -1,4 +1,3 @@ 0 unknown unknown -1 CMIP5 CMIP5 -2 CMIP6 CMIP6 -3 ScenarioMIP ScenarioMIP \ No newline at end of file +1 CMIP6 CMIP6 +2 ScenarioMIP ScenarioMIP \ No newline at end of file diff --git a/definitions/grib2/destine_CMIPExperiment.table b/definitions/grib2/destine_CMIPExperiment.table index 1744f97bb..b8a21094b 100644 --- a/definitions/grib2/destine_CMIPExperiment.table +++ b/definitions/grib2/destine_CMIPExperiment.table @@ -1,9 +1,8 @@ 0 unknown unknown 1 hist Historical -2 RCP2.6 RCP 2.6 -3 RCP4.5 RCP 4.5 -4 RCP8.5 RCP 8.5 -5 SSP1-2.6 SSP1-2.6 -6 SSP2-4.5 SSP2-4.5 -7 SSP3-7.0 SSP3-7.0 -8 SSP5-8.5 SSP5-8.5 \ No newline at end of file +2 amip AMIP +3 SSP1-1.9 SSP1-1.9 +4 SSP1-2.6 SSP1-2.6 +5 SSP2-4.5 SSP2-4.5 +6 SSP3-7.0 SSP3-7.0 +7 SSP5-8.5 SSP5-8.5 \ No newline at end of file diff --git a/definitions/grib2/destine_CMIPGridLabel.table b/definitions/grib2/destine_CMIPGridLabel.table deleted file mode 100644 index b3e9b279b..000000000 --- a/definitions/grib2/destine_CMIPGridLabel.table +++ /dev/null @@ -1,3 +0,0 @@ -0 unknown unknown -1 gn Native grid -2 gr Regridded \ No newline at end of file diff --git a/definitions/grib2/destine_zoomRegion.table b/definitions/grib2/destine_zoomRegion.table deleted file mode 100644 index bb21d5600..000000000 --- a/definitions/grib2/destine_zoomRegion.table +++ /dev/null @@ -1,4 +0,0 @@ -0 unknown unknown -1 e Europe -2 uk United Kingdom -3 fr France \ No newline at end of file diff --git a/definitions/grib2/local.destine.climate-dt.def b/definitions/grib2/local.destine.climate-dt.def index 584d2f7ae..8a89017f7 100644 --- a/definitions/grib2/local.destine.climate-dt.def +++ b/definitions/grib2/local.destine.climate-dt.def @@ -9,5 +9,5 @@ alias mars.CMIPActivity = CMIPActivity; codetable[2] CMIPExperiment "grib2/destine_CMIPExperiment.table" : dump; alias mars.CMIPExperiment = CMIPExperiment; -codetable[2] CMIPGridLabel "grib2/destine_CMIPGridLabel.table" : dump; -alias mars.CMIPGridLabel = CMIPGridLabel; \ No newline at end of file +codetable[2] model "grib2/destine_model.table" : dump; +alias mars.model = model; \ No newline at end of file diff --git a/definitions/grib2/local.destine.on-demand-extremes-dt.def b/definitions/grib2/local.destine.on-demand-extremes-dt.def deleted file mode 100644 index 5117df354..000000000 --- a/definitions/grib2/local.destine.on-demand-extremes-dt.def +++ /dev/null @@ -1,4 +0,0 @@ -# DestinE MARS ClimateDT keywords - -codetable[2] zoomRegion "grib2/destine_zoomRegion.table" : dump; -alias mars.zoomRegion = zoomRegion; \ No newline at end of file diff --git a/definitions/grib2/localConcepts/destine/modelVersionConcept.def b/definitions/grib2/localConcepts/destine/modelVersionConcept.def deleted file mode 100644 index f55271cbd..000000000 --- a/definitions/grib2/localConcepts/destine/modelVersionConcept.def +++ /dev/null @@ -1,3 +0,0 @@ -# Concept modelVersion -# TODO: Need to work out proper mapping and make those keys local -"48r1" = { backgroundProcess = 255; generatingProcessIdentifier = 154; } \ No newline at end of file diff --git a/definitions/grib2/section.6.hook.12.def b/definitions/grib2/section.6.hook.12.def index be89c2e5a..2dd6f0a53 100644 --- a/definitions/grib2/section.6.hook.12.def +++ b/definitions/grib2/section.6.hook.12.def @@ -5,6 +5,3 @@ concept gridSpecification(unknown, "gridSpecificationConcept.def",conceptsDir2,conceptsDir1): no_copy, read_only, dump; concept destineOrigin (unknown, "destineOriginConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; - -concept modelVersion (unknown, "modelVersionConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; - From 172f1ed4e20383c72f38c455edaeffb7dad8ca85 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 21 Sep 2023 10:43:08 +0000 Subject: [PATCH 13/81] Moved model to climateDT only; Fixed typo; Removed reference to subCentre table for now which is in progress --- definitions/common/c-12.98.table | 7 ------- definitions/grib2/destine_model.table | 2 +- definitions/grib2/local.destine.base.def | 5 +---- definitions/grib2/section.1.def | 1 - 4 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 definitions/common/c-12.98.table diff --git a/definitions/common/c-12.98.table b/definitions/common/c-12.98.table deleted file mode 100644 index 74883d603..000000000 --- a/definitions/common/c-12.98.table +++ /dev/null @@ -1,7 +0,0 @@ -# COMMON CODE TABLE C-12: Subcentres for originating/generating centre ECMF (98) (GRIB2, BUFR4) -78 edzw Offenbach (RSMC) -84 lfpw French Weather Service - Toulouse -1000 bsc Barcelona Supercomputing Centre (BSC) -1001 csc CSC – IT Center for Science LTD. -1002 dkrz German Climate Computation Center (DKRZ) -65535 65535 Missing \ No newline at end of file diff --git a/definitions/grib2/destine_model.table b/definitions/grib2/destine_model.table index b1ec128de..1f0a7e01d 100644 --- a/definitions/grib2/destine_model.table +++ b/definitions/grib2/destine_model.table @@ -3,5 +3,5 @@ 2 IFS-NEMO IFS with NEMO ocean model 3 IFS-FESOM IFS with FESOM ocean model 4 ICON ICON with no ocean model -5 ICON-NEMO IFS with NEMO ocean model +5 ICON-NEMO ICON with NEMO ocean model 6 ICON-FESOM ICON with FESOM ocean model \ No newline at end of file diff --git a/definitions/grib2/local.destine.base.def b/definitions/grib2/local.destine.base.def index 185524c33..9a87b6b9a 100644 --- a/definitions/grib2/local.destine.base.def +++ b/definitions/grib2/local.destine.base.def @@ -1,7 +1,4 @@ # DestinE MARS base keywords codetable[2] dataset "grib2/destine_dataset.table" : dump; -alias mars.dataset = dataset; - -codetable[2] model "grib2/destine_model.table" : dump; -alias mars.model = model; \ No newline at end of file +alias mars.dataset = dataset; \ No newline at end of file diff --git a/definitions/grib2/section.1.def b/definitions/grib2/section.1.def index c6c6c16b5..719a9399c 100644 --- a/definitions/grib2/section.1.def +++ b/definitions/grib2/section.1.def @@ -14,7 +14,6 @@ alias parameter.centre=centre; alias ls.centre=centre; alias originatingCentre=centre; -# codetable[2] subCentre "common/c-12.[centre].def" : dump; unsigned[2] subCentre : dump; _if (subCentre==98 ) { From d145099ee828a3d72baab425ceada64a1e42c7d0 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 21 Sep 2023 11:15:04 +0000 Subject: [PATCH 14/81] ECC-1691: Commit to link branch to JIRA ticket --- definitions/grib2/products_destine.def | 1 - 1 file changed, 1 deletion(-) diff --git a/definitions/grib2/products_destine.def b/definitions/grib2/products_destine.def index 3a7cdd39c..c165e20a5 100644 --- a/definitions/grib2/products_destine.def +++ b/definitions/grib2/products_destine.def @@ -68,4 +68,3 @@ if (stepType is "avg" || stepType is "accum") { else { alias mars.step = step; } - From c3b9767c6a262e7d33b769331eb21db08ce056c3 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 21 Sep 2023 13:03:08 +0000 Subject: [PATCH 15/81] Missed quotation --- .../grib2/localConcepts/destine/gridSpecificationConcept.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def index 67f61c217..a1532afa3 100644 --- a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def +++ b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def @@ -4,7 +4,7 @@ 'H64' = {numberOfDataPoints=49152; gridDefinitionTemplateNumber=150;} 'H128' = {numberOfDataPoints=196608; gridDefinitionTemplateNumber=150;} 'H256' = {numberOfDataPoints=786432; gridDefinitionTemplateNumber=150;} -'H512 = {numberOfDataPoints=3145728; gridDefinitionTemplateNumber=150;} +'H512' = {numberOfDataPoints=3145728; gridDefinitionTemplateNumber=150;} 'H1024' = {numberOfDataPoints=12582912; gridDefinitionTemplateNumber=150;} 'O1280' = {numberOfDataPoints=6599680; gridDefinitionTemplateNumber=40; Nj=2560;} 'O8000' = {numberOfDataPoints=256288000; gridDefinitionTemplateNumber=40; Nj=16000;} \ No newline at end of file From 4df1188152cc468fdd3a67385fc6883bcb63fabb Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Mon, 25 Sep 2023 14:49:20 +0000 Subject: [PATCH 16/81] Reworking to accommodate PR comment; Also making a few other tweaks to bring closer to final form --- ...ctivity.table => destine_datasetActivity.table} | 0 ...iment.table => destine_datasetExperiment.table} | 0 definitions/grib2/local.destine.climate-dt.def | 8 ++++---- .../destine/gridSpecificationConcept.def | 14 +++++++------- ....12.def => post_meta_data.hook.products_12.def} | 10 +++++++++- definitions/grib2/sections.def | 4 ++-- 6 files changed, 22 insertions(+), 14 deletions(-) rename definitions/grib2/{destine_CMIPActivity.table => destine_datasetActivity.table} (100%) rename definitions/grib2/{destine_CMIPExperiment.table => destine_datasetExperiment.table} (100%) rename definitions/grib2/{section.6.hook.12.def => post_meta_data.hook.products_12.def} (60%) diff --git a/definitions/grib2/destine_CMIPActivity.table b/definitions/grib2/destine_datasetActivity.table similarity index 100% rename from definitions/grib2/destine_CMIPActivity.table rename to definitions/grib2/destine_datasetActivity.table diff --git a/definitions/grib2/destine_CMIPExperiment.table b/definitions/grib2/destine_datasetExperiment.table similarity index 100% rename from definitions/grib2/destine_CMIPExperiment.table rename to definitions/grib2/destine_datasetExperiment.table diff --git a/definitions/grib2/local.destine.climate-dt.def b/definitions/grib2/local.destine.climate-dt.def index 8a89017f7..596d7a9d5 100644 --- a/definitions/grib2/local.destine.climate-dt.def +++ b/definitions/grib2/local.destine.climate-dt.def @@ -3,11 +3,11 @@ codetable[2] datasetVersion "grib2/destine_datasetVersion.table" : dump; alias mars.datasetVersion = datasetVersion; -codetable[2] CMIPActivity "grib2/destine_CMIPActivity.table" : dump; -alias mars.CMIPActivity = CMIPActivity; +codetable[2] datasetActivity "grib2/destine_datasetActivity.table" : dump; +alias mars.datasetActivity = datasetActivity; -codetable[2] CMIPExperiment "grib2/destine_CMIPExperiment.table" : dump; -alias mars.CMIPExperiment = CMIPExperiment; +codetable[2] datasetExperiment "grib2/destine_datasetExperiment.table" : dump; +alias mars.datasetExperiment = datasetExperiment; codetable[2] model "grib2/destine_model.table" : dump; alias mars.model = model; \ No newline at end of file diff --git a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def index a1532afa3..28c7a5c47 100644 --- a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def +++ b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def @@ -1,10 +1,10 @@ # Concept gridSpecification -'H16' = {numberOfDataPoints=3072; gridDefinitionTemplateNumber=150;} -'H32' = {numberOfDataPoints=12288; gridDefinitionTemplateNumber=150;} -'H64' = {numberOfDataPoints=49152; gridDefinitionTemplateNumber=150;} -'H128' = {numberOfDataPoints=196608; gridDefinitionTemplateNumber=150;} -'H256' = {numberOfDataPoints=786432; gridDefinitionTemplateNumber=150;} -'H512' = {numberOfDataPoints=3145728; gridDefinitionTemplateNumber=150;} -'H1024' = {numberOfDataPoints=12582912; gridDefinitionTemplateNumber=150;} +'H16' = {numberOfDataPoints=3072; gridDefinitionTemplateNumber=150; Nside=16;} +'H32' = {numberOfDataPoints=12288; gridDefinitionTemplateNumber=150; Nside=32;} +'H64' = {numberOfDataPoints=49152; gridDefinitionTemplateNumber=150; Nside=64;} +'H128' = {numberOfDataPoints=196608; gridDefinitionTemplateNumber=150; Nside=128;} +'H256' = {numberOfDataPoints=786432; gridDefinitionTemplateNumber=150; Nside=256;} +'H512' = {numberOfDataPoints=3145728; gridDefinitionTemplateNumber=150; Nside=512;} +'H1024' = {numberOfDataPoints=12582912; gridDefinitionTemplateNumber=150; Nside=1024;} 'O1280' = {numberOfDataPoints=6599680; gridDefinitionTemplateNumber=40; Nj=2560;} 'O8000' = {numberOfDataPoints=256288000; gridDefinitionTemplateNumber=40; Nj=16000;} \ No newline at end of file diff --git a/definitions/grib2/section.6.hook.12.def b/definitions/grib2/post_meta_data.hook.products_12.def similarity index 60% rename from definitions/grib2/section.6.hook.12.def rename to definitions/grib2/post_meta_data.hook.products_12.def index 2dd6f0a53..d476197b3 100644 --- a/definitions/grib2/section.6.hook.12.def +++ b/definitions/grib2/post_meta_data.hook.products_12.def @@ -1,7 +1,15 @@ # (C) Copyright 2005- ECMWF. -# Hooks after section 6 for DestinE (productionStatusOfProcessedData=12) +# Hooks post meta-data for DestinE (productionStatusOfProcessedData=12) # conceptsDir2 --> datasetForLocal concept gridSpecification(unknown, "gridSpecificationConcept.def",conceptsDir2,conceptsDir1): no_copy, read_only, dump; concept destineOrigin (unknown, "destineOriginConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; + +if(dataset is "climate-dt") { + +alias mars.date = validityDate; +alias mars.time = validityTime; +unalias mars.step; + +} \ No newline at end of file diff --git a/definitions/grib2/sections.def b/definitions/grib2/sections.def index 61aff3f29..19f6b61db 100644 --- a/definitions/grib2/sections.def +++ b/definitions/grib2/sections.def @@ -44,6 +44,8 @@ meta md5Headers md5(startOfHeaders,lengthOfHeaders); lookup[1] sectionNumber(4) ; +template_nofail hook_post_meta_data "grib2/post_meta_data.hook.products_[productionStatusOfProcessedData].def"; + if (!headersOnly) { if (sectionNumber == 5 or new() ) { position sectionPosition; @@ -59,8 +61,6 @@ if (!headersOnly) { lookup[1] sectionNumber(4) ; - template_nofail hook_after_section_6 "grib2/section.6.hook.[productionStatusOfProcessedData].def"; - if (sectionNumber == 7 or new() ) { position sectionPosition; template section_7 "grib2/section.7.def"; From 98659cc99a3d7dc87ba35329d70b22af249c7864 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 27 Sep 2023 10:58:47 +0100 Subject: [PATCH 17/81] ECC-1691: Tests --- .../grib2/post_meta_data.hook.products_12.def | 10 +-- tests/CMakeLists.txt | 1 + tests/grib_ecc-1691.sh | 76 +++++++++++++++++++ 3 files changed, 81 insertions(+), 6 deletions(-) create mode 100755 tests/grib_ecc-1691.sh diff --git a/definitions/grib2/post_meta_data.hook.products_12.def b/definitions/grib2/post_meta_data.hook.products_12.def index d476197b3..c24b78c94 100644 --- a/definitions/grib2/post_meta_data.hook.products_12.def +++ b/definitions/grib2/post_meta_data.hook.products_12.def @@ -7,9 +7,7 @@ concept gridSpecification(unknown, "gridSpecificationConcept.def",conceptsDir2,c concept destineOrigin (unknown, "destineOriginConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; if(dataset is "climate-dt") { - -alias mars.date = validityDate; -alias mars.time = validityTime; -unalias mars.step; - -} \ No newline at end of file + alias mars.date = validityDate; + alias mars.time = validityTime; + unalias mars.step; +} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ad9f7c408..165a3bc5f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -126,6 +126,7 @@ if( HAVE_BUILD_TOOLS ) grib_ecc-1560 grib_ecc-1571 grib_ecc-1654 + grib_ecc-1691 bufr_ecc-1028 bufr_ecc-1195 bufr_ecc-1259 diff --git a/tests/grib_ecc-1691.sh b/tests/grib_ecc-1691.sh new file mode 100755 index 000000000..a00d417aa --- /dev/null +++ b/tests/grib_ecc-1691.sh @@ -0,0 +1,76 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.ctest.sh + +REDIRECT=/dev/null + +# ECC-1691: Destination Earth ClimateDT metadata support + +label="grib_ecc-1691_test" +temp_grib_a=temp.$label.a.grib +temp_grib_b=temp.$label.b.grib +destine_sample=temp.$label.destine.grib +sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + +tablesVersionLatest=$( ${tools_dir}/grib_get -p tablesVersionLatest ${sample_grib2} ) + +# Setup Destine pseudo-centre GRIB message +# First latest tables version and add local section with MARS labeling +${tools_dir}/grib_set -s tablesVersion=${tablesVersionLatest},setLocalDefinition=1,grib2LocalSectionNumber=1 ${sample_grib2} ${temp_grib_a} + +# Then change to processed data = 12 --> DestinE +${tools_dir}/grib_set -s productionStatusOfProcessedData=12 ${temp_grib_a} ${destine_sample} + +# Check DestinE base related keys are present and correct +grib_check_key_exists ${destine_sample} destineLocalVersion,dataset,marsClass,marsType,marsStream,experimentVersionNumber +grib_check_key_equals ${destine_sample} "marsClass,dataset,destineLocalVersion" "d1 0 1" + +# Check setting dataset to climate-dt (1). Check keys are present and equal defaults +${tools_dir}/grib_set -s dataset=1 ${destine_sample} ${temp_grib_a} + +grib_check_key_exists ${temp_grib_a} dataset,datasetVersion,datasetActivity,datasetExperiment,model +grib_check_key_equals ${temp_grib_a} "dataset,datasetVersion,datasetActivity,datasetExperiment,model" "1 0 0 0 0" + +# Check an example where a few additional things are set in climate-dt +${tools_dir}/grib_set -s dataset=1,datasetVersion=2,datasetActivity=1,datasetExperiment=1,model=2 ${destine_sample} ${temp_grib_a} + +grib_check_key_equals ${temp_grib_a} "dataset,datasetVersion,datasetActivity,datasetExperiment,model" "1 2 1 1 2" +grib_check_key_equals ${temp_grib_a} "dataset:s,datasetVersion:s,datasetActivity:s,datasetExperiment:s,model:s" "climate-dt v20230801 CMIP6 hist IFS-NEMO" + +# Check mars.date and mars.time are equal to validityDate and validityTime, and that mars.step has been unaliased +result1=$( ${tools_dir}/grib_get -p mars.date,mars.time $temp_grib_a ) +result2=$( ${tools_dir}/grib_get -p validityDate,validityTime $temp_grib_a ) +[ "$result1" = "$result2" ] + +# TODO: mars.step should be unaliased! this test is broken +# [ $( ${tools_dir}/grib_get -f -p mars.step ${temp_grib_a} ) = "not_found" ] + +# Check setting dataset to extremes-dt (2). This time we will check string also +${tools_dir}/grib_set -s dataset=2 ${destine_sample} ${temp_grib_a} + +grib_check_key_equals ${temp_grib_a} "dataset,dataset:s" "2 extremes-dt" + +# Check concepts. First check default value and then example of mapping +grib_check_key_exists ${destine_sample} destineOrigin,gridSpecification +grib_check_key_equals ${destine_sample} "destineOrigin,gridSpecification" "unknown unknown" + +# Below mapping is for MeteoFrance +${tools_dir}/grib_set -s centre=98,subCentre=84 ${destine_sample} ${temp_grib_a} + +grib_check_key_equals ${temp_grib_a} "destineOrigin" "MeteoFrance" + +# Below mapping is for H1024 +${tools_dir}/grib_set -s numberOfDataPoints=12582912,gridDefinitionTemplateNumber=150,Nside=1024 ${destine_sample} ${temp_grib_a} + +grib_check_key_equals ${temp_grib_a} "gridSpecification" "H1024" + +# Clean up +rm -f $temp_grib_a $temp_grib_b $destine_sample From 6554d0b193d3e1bbc584bac46f2454d8ccfe7f57 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 27 Sep 2023 10:41:34 +0000 Subject: [PATCH 18/81] ECC-1691: Fix test re mars.step --- .../grib2/post_meta_data.hook.products_12.def | 1 + tests/grib_ecc-1691.sh | 42 +++++++++---------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/definitions/grib2/post_meta_data.hook.products_12.def b/definitions/grib2/post_meta_data.hook.products_12.def index c24b78c94..b7ad96a12 100644 --- a/definitions/grib2/post_meta_data.hook.products_12.def +++ b/definitions/grib2/post_meta_data.hook.products_12.def @@ -7,6 +7,7 @@ concept gridSpecification(unknown, "gridSpecificationConcept.def",conceptsDir2,c concept destineOrigin (unknown, "destineOriginConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; if(dataset is "climate-dt") { + unalias mars.step; alias mars.date = validityDate; alias mars.time = validityTime; unalias mars.step; diff --git a/tests/grib_ecc-1691.sh b/tests/grib_ecc-1691.sh index a00d417aa..6d76a90b0 100755 --- a/tests/grib_ecc-1691.sh +++ b/tests/grib_ecc-1691.sh @@ -20,57 +20,57 @@ temp_grib_b=temp.$label.b.grib destine_sample=temp.$label.destine.grib sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl -tablesVersionLatest=$( ${tools_dir}/grib_get -p tablesVersionLatest ${sample_grib2} ) +tablesVersionLatest=$( ${tools_dir}/grib_get -p tablesVersionLatest $sample_grib2 ) # Setup Destine pseudo-centre GRIB message # First latest tables version and add local section with MARS labeling -${tools_dir}/grib_set -s tablesVersion=${tablesVersionLatest},setLocalDefinition=1,grib2LocalSectionNumber=1 ${sample_grib2} ${temp_grib_a} +${tools_dir}/grib_set -s tablesVersion=$tablesVersionLatest,setLocalDefinition=1,grib2LocalSectionNumber=1 $sample_grib2 $temp_grib_a # Then change to processed data = 12 --> DestinE -${tools_dir}/grib_set -s productionStatusOfProcessedData=12 ${temp_grib_a} ${destine_sample} +${tools_dir}/grib_set -s productionStatusOfProcessedData=12 $temp_grib_a $destine_sample # Check DestinE base related keys are present and correct -grib_check_key_exists ${destine_sample} destineLocalVersion,dataset,marsClass,marsType,marsStream,experimentVersionNumber -grib_check_key_equals ${destine_sample} "marsClass,dataset,destineLocalVersion" "d1 0 1" +grib_check_key_exists $destine_sample destineLocalVersion,dataset,marsClass,marsType,marsStream,experimentVersionNumber +grib_check_key_equals $destine_sample "marsClass,dataset,destineLocalVersion" "d1 0 1" # Check setting dataset to climate-dt (1). Check keys are present and equal defaults -${tools_dir}/grib_set -s dataset=1 ${destine_sample} ${temp_grib_a} +${tools_dir}/grib_set -s dataset=1 $destine_sample $temp_grib_a -grib_check_key_exists ${temp_grib_a} dataset,datasetVersion,datasetActivity,datasetExperiment,model -grib_check_key_equals ${temp_grib_a} "dataset,datasetVersion,datasetActivity,datasetExperiment,model" "1 0 0 0 0" +grib_check_key_exists $temp_grib_a dataset,datasetVersion,datasetActivity,datasetExperiment,model +grib_check_key_equals $temp_grib_a "dataset,datasetVersion,datasetActivity,datasetExperiment,model" "1 0 0 0 0" # Check an example where a few additional things are set in climate-dt -${tools_dir}/grib_set -s dataset=1,datasetVersion=2,datasetActivity=1,datasetExperiment=1,model=2 ${destine_sample} ${temp_grib_a} +${tools_dir}/grib_set -s dataset=1,datasetVersion=2,datasetActivity=1,datasetExperiment=1,model=2 $destine_sample $temp_grib_a -grib_check_key_equals ${temp_grib_a} "dataset,datasetVersion,datasetActivity,datasetExperiment,model" "1 2 1 1 2" -grib_check_key_equals ${temp_grib_a} "dataset:s,datasetVersion:s,datasetActivity:s,datasetExperiment:s,model:s" "climate-dt v20230801 CMIP6 hist IFS-NEMO" +grib_check_key_equals $temp_grib_a "dataset,datasetVersion,datasetActivity,datasetExperiment,model" "1 2 1 1 2" +grib_check_key_equals $temp_grib_a "dataset:s,datasetVersion:s,datasetActivity:s,datasetExperiment:s,model:s" "climate-dt v20230801 CMIP6 hist IFS-NEMO" # Check mars.date and mars.time are equal to validityDate and validityTime, and that mars.step has been unaliased result1=$( ${tools_dir}/grib_get -p mars.date,mars.time $temp_grib_a ) result2=$( ${tools_dir}/grib_get -p validityDate,validityTime $temp_grib_a ) [ "$result1" = "$result2" ] -# TODO: mars.step should be unaliased! this test is broken -# [ $( ${tools_dir}/grib_get -f -p mars.step ${temp_grib_a} ) = "not_found" ] +${tools_dir}/grib_ls -jm $temp_grib_a +[ $( ${tools_dir}/grib_get -f -p mars.step $temp_grib_a ) = "not_found" ] # Check setting dataset to extremes-dt (2). This time we will check string also -${tools_dir}/grib_set -s dataset=2 ${destine_sample} ${temp_grib_a} +${tools_dir}/grib_set -s dataset=2 $destine_sample $temp_grib_a -grib_check_key_equals ${temp_grib_a} "dataset,dataset:s" "2 extremes-dt" +grib_check_key_equals $temp_grib_a "dataset,dataset:s" "2 extremes-dt" # Check concepts. First check default value and then example of mapping -grib_check_key_exists ${destine_sample} destineOrigin,gridSpecification -grib_check_key_equals ${destine_sample} "destineOrigin,gridSpecification" "unknown unknown" +grib_check_key_exists $destine_sample destineOrigin,gridSpecification +grib_check_key_equals $destine_sample "destineOrigin,gridSpecification" "unknown unknown" # Below mapping is for MeteoFrance -${tools_dir}/grib_set -s centre=98,subCentre=84 ${destine_sample} ${temp_grib_a} +${tools_dir}/grib_set -s centre=98,subCentre=84 $destine_sample $temp_grib_a -grib_check_key_equals ${temp_grib_a} "destineOrigin" "MeteoFrance" +grib_check_key_equals $temp_grib_a "destineOrigin" "MeteoFrance" # Below mapping is for H1024 -${tools_dir}/grib_set -s numberOfDataPoints=12582912,gridDefinitionTemplateNumber=150,Nside=1024 ${destine_sample} ${temp_grib_a} +${tools_dir}/grib_set -s numberOfDataPoints=12582912,gridDefinitionTemplateNumber=150,Nside=1024 $destine_sample $temp_grib_a -grib_check_key_equals ${temp_grib_a} "gridSpecification" "H1024" +grib_check_key_equals $temp_grib_a "gridSpecification" "H1024" # Clean up rm -f $temp_grib_a $temp_grib_b $destine_sample From 8f84ece03c94331f0ecc67e5ee6ce5a279621cf7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 27 Sep 2023 18:10:33 +0100 Subject: [PATCH 19/81] ECC-1691: Additional modifications from Matthew --- definitions/grib2/destine_dataset.table | 3 ++- definitions/grib2/destine_datasetActivity.table | 5 +++-- .../grib2/destine_datasetExperiment.table | 13 +++++++------ definitions/grib2/destine_datasetVersion.table | 17 +++++++++++++++-- definitions/grib2/destine_model.table | 3 ++- .../destine/destineOriginConcept.def | 4 +++- .../grib2/post_meta_data.hook.products_12.def | 6 ------ definitions/grib2/products_destine.def | 11 ++++++----- tests/grib_ecc-1691.sh | 2 +- 9 files changed, 39 insertions(+), 25 deletions(-) diff --git a/definitions/grib2/destine_dataset.table b/definitions/grib2/destine_dataset.table index 1b56cd8c8..58b82fc41 100644 --- a/definitions/grib2/destine_dataset.table +++ b/definitions/grib2/destine_dataset.table @@ -2,4 +2,5 @@ 1 climate-dt Climate change adaptation digital twin 2 extremes-dt Weather and geophysical extremes digital twin 3 on-demand-climate-dt On-demand climate change adaptation digital twin -4 on-demand-extremes-dt On-demand weather and geophysical extremes digital twin \ No newline at end of file +4 on-demand-extremes-dt On-demand weather and geophysical extremes digital twin +65535 65535 Missing diff --git a/definitions/grib2/destine_datasetActivity.table b/definitions/grib2/destine_datasetActivity.table index 49044d18b..852b275df 100644 --- a/definitions/grib2/destine_datasetActivity.table +++ b/definitions/grib2/destine_datasetActivity.table @@ -1,3 +1,4 @@ 0 unknown unknown -1 CMIP6 CMIP6 -2 ScenarioMIP ScenarioMIP \ No newline at end of file +1 CMIP6 Coupled Model Intercomparison Project Phase 6 +2 ScenarioMIP Scenario Model Intercomparison Project +65535 65535 Missing diff --git a/definitions/grib2/destine_datasetExperiment.table b/definitions/grib2/destine_datasetExperiment.table index b8a21094b..1429f71ac 100644 --- a/definitions/grib2/destine_datasetExperiment.table +++ b/definitions/grib2/destine_datasetExperiment.table @@ -1,8 +1,9 @@ 0 unknown unknown 1 hist Historical -2 amip AMIP -3 SSP1-1.9 SSP1-1.9 -4 SSP1-2.6 SSP1-2.6 -5 SSP2-4.5 SSP2-4.5 -6 SSP3-7.0 SSP3-7.0 -7 SSP5-8.5 SSP5-8.5 \ No newline at end of file +2 amip Atmospheric Model Intercomparison Project +3 SSP1-1.9 Shared Socio-economic Pathways 1-1.9 +4 SSP1-2.6 Shared Socio-economic Pathways 1-2.6 +5 SSP2-4.5 Shared Socio-economic Pathways 2-4.5 +6 SSP3-7.0 Shared Socio-economic Pathways 3-7.0 +7 SSP5-8.5 Shared Socio-economic Pathways 5-8.5 +65535 65535 Missing diff --git a/definitions/grib2/destine_datasetVersion.table b/definitions/grib2/destine_datasetVersion.table index ecdb27737..0b2efc64e 100644 --- a/definitions/grib2/destine_datasetVersion.table +++ b/definitions/grib2/destine_datasetVersion.table @@ -1,3 +1,16 @@ 0 unknown unknown -1 v20230701 v20230701 -2 v20230801 v20230801 \ No newline at end of file +1 v20231001 v20231001 +2 v20231015 v20231015 +3 v20231101 v20231101 +4 v20231115 v20231115 +5 v20231201 v20231201 +6 v20231215 v20231215 +7 v20240101 v20240101 +8 v20240115 v20240115 +9 v20240201 v20240201 +10 v20240215 v20240215 +11 v20240301 v20240301 +12 v20240315 v20240315 +13 v20240401 v20240401 +14 v20240415 v20240415 +65535 65535 Missing diff --git a/definitions/grib2/destine_model.table b/definitions/grib2/destine_model.table index 1f0a7e01d..e0662ac43 100644 --- a/definitions/grib2/destine_model.table +++ b/definitions/grib2/destine_model.table @@ -4,4 +4,5 @@ 3 IFS-FESOM IFS with FESOM ocean model 4 ICON ICON with no ocean model 5 ICON-NEMO ICON with NEMO ocean model -6 ICON-FESOM ICON with FESOM ocean model \ No newline at end of file +6 ICON-FESOM ICON with FESOM ocean model +65535 65535 Missing diff --git a/definitions/grib2/localConcepts/destine/destineOriginConcept.def b/definitions/grib2/localConcepts/destine/destineOriginConcept.def index a013ee42f..9869ef9d0 100644 --- a/definitions/grib2/localConcepts/destine/destineOriginConcept.def +++ b/definitions/grib2/localConcepts/destine/destineOriginConcept.def @@ -1,7 +1,9 @@ # Concept destineOrigin "DWD" = { centre=98; subCentre=78; } "MeteoFrance" = { centre=98; subCentre=84; } +"MPI-M" = { centre=98; subCentre=252; } +"AWI" = { centre=98; subCentre=253; } "BSC" = { centre=98; subCentre=1000; } "CSC" = { centre=98; subCentre=1001; } "DKRZ" = { centre=98; subCentre=1002; } - +"Climate DT consortium (CSC,BSC,AWI,MPI-M)" = { centre=98; subCentre=1003; } diff --git a/definitions/grib2/post_meta_data.hook.products_12.def b/definitions/grib2/post_meta_data.hook.products_12.def index b7ad96a12..17a4c2001 100644 --- a/definitions/grib2/post_meta_data.hook.products_12.def +++ b/definitions/grib2/post_meta_data.hook.products_12.def @@ -6,9 +6,3 @@ concept gridSpecification(unknown, "gridSpecificationConcept.def",conceptsDir2,c concept destineOrigin (unknown, "destineOriginConcept.def",conceptsDir2,conceptsDir1): no_copy, dump; -if(dataset is "climate-dt") { - unalias mars.step; - alias mars.date = validityDate; - alias mars.time = validityTime; - unalias mars.step; -} diff --git a/definitions/grib2/products_destine.def b/definitions/grib2/products_destine.def index c165e20a5..4a02a6e76 100644 --- a/definitions/grib2/products_destine.def +++ b/definitions/grib2/products_destine.def @@ -62,9 +62,10 @@ concept marsStream(unknown) { alias mars.stream = marsStream; -if (stepType is "avg" || stepType is "accum") { - alias mars.step = stepRange; -} -else { - alias mars.step = step; +if(dataset is "climate-dt") { + +alias mars.date = validityDate; +alias mars.time = validityTime; +unalias mars.step; + } diff --git a/tests/grib_ecc-1691.sh b/tests/grib_ecc-1691.sh index 6d76a90b0..679732587 100755 --- a/tests/grib_ecc-1691.sh +++ b/tests/grib_ecc-1691.sh @@ -43,7 +43,7 @@ grib_check_key_equals $temp_grib_a "dataset,datasetVersion,datasetActivity,datas ${tools_dir}/grib_set -s dataset=1,datasetVersion=2,datasetActivity=1,datasetExperiment=1,model=2 $destine_sample $temp_grib_a grib_check_key_equals $temp_grib_a "dataset,datasetVersion,datasetActivity,datasetExperiment,model" "1 2 1 1 2" -grib_check_key_equals $temp_grib_a "dataset:s,datasetVersion:s,datasetActivity:s,datasetExperiment:s,model:s" "climate-dt v20230801 CMIP6 hist IFS-NEMO" +grib_check_key_equals $temp_grib_a "dataset:s,datasetVersion:s,datasetActivity:s,datasetExperiment:s,model:s" "climate-dt v20231015 CMIP6 hist IFS-NEMO" # Check mars.date and mars.time are equal to validityDate and validityTime, and that mars.step has been unaliased result1=$( ${tools_dir}/grib_get -p mars.date,mars.time $temp_grib_a ) From fd7ea997cd6d84b9baeb0e8b89034906363e9472 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 28 Sep 2023 16:29:24 +0100 Subject: [PATCH 20/81] ECC-1691: Formatting --- definitions/grib2/products_destine.def | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/definitions/grib2/products_destine.def b/definitions/grib2/products_destine.def index 4a02a6e76..3744612d4 100644 --- a/definitions/grib2/products_destine.def +++ b/definitions/grib2/products_destine.def @@ -22,7 +22,6 @@ if(typeOfFirstFixedSurface == 103) { } # Define marsType based on type of processed data - concept marsType(unknown) { fc = { @@ -38,7 +37,6 @@ concept marsType(unknown) { "2" = { typeOfProcessedData = 0; } - } alias mars.type = marsType; @@ -62,10 +60,8 @@ concept marsStream(unknown) { alias mars.stream = marsStream; -if(dataset is "climate-dt") { - -alias mars.date = validityDate; -alias mars.time = validityTime; -unalias mars.step; - +if (dataset is "climate-dt") { + alias mars.date = validityDate; + alias mars.time = validityTime; + unalias mars.step; } From 3f437f75a951e7441c6afa45ae93f8f79e986e02 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 29 Sep 2023 17:10:53 +0100 Subject: [PATCH 21/81] ECC-1691: Updates from Matt --- ...tActivity.table => destine_activity.table} | 0 .../grib2/destine_datasetVersion.table | 16 --------------- ...eriment.table => destine_experiment.table} | 0 definitions/grib2/destine_resolution.table | 4 ++++ .../grib2/local.destine.climate-dt.def | 20 ++++++++++++------- .../destine/destineOriginConcept.def | 2 +- .../destine/gridSpecificationConcept.def | 5 ++++- definitions/grib2/products_12.def | 4 +--- tests/grib_ecc-1691.sh | 12 +++++------ 9 files changed, 29 insertions(+), 34 deletions(-) rename definitions/grib2/{destine_datasetActivity.table => destine_activity.table} (100%) delete mode 100644 definitions/grib2/destine_datasetVersion.table rename definitions/grib2/{destine_datasetExperiment.table => destine_experiment.table} (100%) create mode 100644 definitions/grib2/destine_resolution.table diff --git a/definitions/grib2/destine_datasetActivity.table b/definitions/grib2/destine_activity.table similarity index 100% rename from definitions/grib2/destine_datasetActivity.table rename to definitions/grib2/destine_activity.table diff --git a/definitions/grib2/destine_datasetVersion.table b/definitions/grib2/destine_datasetVersion.table deleted file mode 100644 index 0b2efc64e..000000000 --- a/definitions/grib2/destine_datasetVersion.table +++ /dev/null @@ -1,16 +0,0 @@ -0 unknown unknown -1 v20231001 v20231001 -2 v20231015 v20231015 -3 v20231101 v20231101 -4 v20231115 v20231115 -5 v20231201 v20231201 -6 v20231215 v20231215 -7 v20240101 v20240101 -8 v20240115 v20240115 -9 v20240201 v20240201 -10 v20240215 v20240215 -11 v20240301 v20240301 -12 v20240315 v20240315 -13 v20240401 v20240401 -14 v20240415 v20240415 -65535 65535 Missing diff --git a/definitions/grib2/destine_datasetExperiment.table b/definitions/grib2/destine_experiment.table similarity index 100% rename from definitions/grib2/destine_datasetExperiment.table rename to definitions/grib2/destine_experiment.table diff --git a/definitions/grib2/destine_resolution.table b/definitions/grib2/destine_resolution.table new file mode 100644 index 000000000..cf3263497 --- /dev/null +++ b/definitions/grib2/destine_resolution.table @@ -0,0 +1,4 @@ +0 unknown unknown +1 standard Standard resolution model output with guaranteed availability +2 highres High resolution model output with limited availability +65535 65535 Missing \ No newline at end of file diff --git a/definitions/grib2/local.destine.climate-dt.def b/definitions/grib2/local.destine.climate-dt.def index 596d7a9d5..e1266ce6e 100644 --- a/definitions/grib2/local.destine.climate-dt.def +++ b/definitions/grib2/local.destine.climate-dt.def @@ -1,13 +1,19 @@ # DestinE MARS ClimateDT keywords -codetable[2] datasetVersion "grib2/destine_datasetVersion.table" : dump; -alias mars.datasetVersion = datasetVersion; +codetable[2] activity "grib2/destine_activity.table" : dump; +alias mars.activity = activity; -codetable[2] datasetActivity "grib2/destine_datasetActivity.table" : dump; -alias mars.datasetActivity = datasetActivity; +codetable[2] experiment "grib2/destine_experiment.table" : dump; +alias mars.study = experiment; -codetable[2] datasetExperiment "grib2/destine_datasetExperiment.table" : dump; -alias mars.datasetExperiment = datasetExperiment; +unsigned[1] generation = 255 : dump; +alias mars.generation = generation; codetable[2] model "grib2/destine_model.table" : dump; -alias mars.model = model; \ No newline at end of file +alias mars.model = model; + +unsigned[1] realisation = 255 : dump; +alias mars.realisation = realisation; + +codetable[2] resolution "grib2/destine_resolution.table" : dump; +alias mars.resolution = resolution; diff --git a/definitions/grib2/localConcepts/destine/destineOriginConcept.def b/definitions/grib2/localConcepts/destine/destineOriginConcept.def index 9869ef9d0..041905d77 100644 --- a/definitions/grib2/localConcepts/destine/destineOriginConcept.def +++ b/definitions/grib2/localConcepts/destine/destineOriginConcept.def @@ -6,4 +6,4 @@ "BSC" = { centre=98; subCentre=1000; } "CSC" = { centre=98; subCentre=1001; } "DKRZ" = { centre=98; subCentre=1002; } -"Climate DT consortium (CSC,BSC,AWI,MPI-M)" = { centre=98; subCentre=1003; } +"Climate DT consortium (CSC,AWI,BSC,MPI-M)" = { centre=98; subCentre=1003; } diff --git a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def index 28c7a5c47..1ae35446d 100644 --- a/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def +++ b/definitions/grib2/localConcepts/destine/gridSpecificationConcept.def @@ -7,4 +7,7 @@ 'H512' = {numberOfDataPoints=3145728; gridDefinitionTemplateNumber=150; Nside=512;} 'H1024' = {numberOfDataPoints=12582912; gridDefinitionTemplateNumber=150; Nside=1024;} 'O1280' = {numberOfDataPoints=6599680; gridDefinitionTemplateNumber=40; Nj=2560;} -'O8000' = {numberOfDataPoints=256288000; gridDefinitionTemplateNumber=40; Nj=16000;} \ No newline at end of file +'O2560' = {numberOfDataPoints=26306560; gridDefinitionTemplateNumber=40; Nj=5120;} +'O8000' = {numberOfDataPoints=256288000; gridDefinitionTemplateNumber=40; Nj=16000;} +'F90' = {numberOfDataPoints=65160; gridDefinitionTemplateNumber=0; Ni=360; Nj=181; } +'F360' = {numberOfDataPoints=1038240; gridDefinitionTemplateNumber=0; Ni=1440; Nj=721; } diff --git a/definitions/grib2/products_12.def b/definitions/grib2/products_12.def index 569b90b65..35c5f909c 100644 --- a/definitions/grib2/products_12.def +++ b/definitions/grib2/products_12.def @@ -2,6 +2,4 @@ # Destination Earth (DestinE) -constant marsClass = 'd1'; - -include "grib2/products_destine.def" \ No newline at end of file +include "grib2/products_destine.def" diff --git a/tests/grib_ecc-1691.sh b/tests/grib_ecc-1691.sh index 679732587..31d02884d 100755 --- a/tests/grib_ecc-1691.sh +++ b/tests/grib_ecc-1691.sh @@ -27,7 +27,7 @@ tablesVersionLatest=$( ${tools_dir}/grib_get -p tablesVersionLatest $sample_grib ${tools_dir}/grib_set -s tablesVersion=$tablesVersionLatest,setLocalDefinition=1,grib2LocalSectionNumber=1 $sample_grib2 $temp_grib_a # Then change to processed data = 12 --> DestinE -${tools_dir}/grib_set -s productionStatusOfProcessedData=12 $temp_grib_a $destine_sample +${tools_dir}/grib_set -s productionStatusOfProcessedData=12,class=d1 $temp_grib_a $destine_sample # Check DestinE base related keys are present and correct grib_check_key_exists $destine_sample destineLocalVersion,dataset,marsClass,marsType,marsStream,experimentVersionNumber @@ -36,14 +36,14 @@ grib_check_key_equals $destine_sample "marsClass,dataset,destineLocalVersion" "d # Check setting dataset to climate-dt (1). Check keys are present and equal defaults ${tools_dir}/grib_set -s dataset=1 $destine_sample $temp_grib_a -grib_check_key_exists $temp_grib_a dataset,datasetVersion,datasetActivity,datasetExperiment,model -grib_check_key_equals $temp_grib_a "dataset,datasetVersion,datasetActivity,datasetExperiment,model" "1 0 0 0 0" +grib_check_key_exists $temp_grib_a dataset,generation,activity,experiment,model,realisation,resolution +grib_check_key_equals $temp_grib_a "dataset,generation,activity,experiment,model,realisation,resolution" "1 255 0 0 0 255 0" # Check an example where a few additional things are set in climate-dt -${tools_dir}/grib_set -s dataset=1,datasetVersion=2,datasetActivity=1,datasetExperiment=1,model=2 $destine_sample $temp_grib_a +${tools_dir}/grib_set -s dataset=1,generation=2,activity=1,experiment=1,model=2,realisation=1,resolution=1 $destine_sample $temp_grib_a -grib_check_key_equals $temp_grib_a "dataset,datasetVersion,datasetActivity,datasetExperiment,model" "1 2 1 1 2" -grib_check_key_equals $temp_grib_a "dataset:s,datasetVersion:s,datasetActivity:s,datasetExperiment:s,model:s" "climate-dt v20231015 CMIP6 hist IFS-NEMO" +grib_check_key_equals $temp_grib_a "dataset,generation,activity,experiment,model,realisation,resolution" "1 2 1 1 2 1 1" +grib_check_key_equals $temp_grib_a "dataset:s,activity:s,experiment:s,model:s,resolution:s" "climate-dt CMIP6 hist IFS-NEMO standard" # Check mars.date and mars.time are equal to validityDate and validityTime, and that mars.step has been unaliased result1=$( ${tools_dir}/grib_get -p mars.date,mars.time $temp_grib_a ) From dc9067994b6b01328626665a59c984298ed6573b Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Mon, 9 Oct 2023 14:14:43 +0000 Subject: [PATCH 22/81] Added medium resolution to code table --- definitions/grib2/destine_resolution.table | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/definitions/grib2/destine_resolution.table b/definitions/grib2/destine_resolution.table index cf3263497..30e347f44 100644 --- a/definitions/grib2/destine_resolution.table +++ b/definitions/grib2/destine_resolution.table @@ -1,4 +1,5 @@ 0 unknown unknown 1 standard Standard resolution model output with guaranteed availability -2 highres High resolution model output with limited availability +2 mediumres Medium resolution model output with limited availability +3 highres High resolution model output with limited availability 65535 65535 Missing \ No newline at end of file From 979b52fb05385faec9988b367d894e9059973849 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 9 Oct 2023 16:56:40 +0100 Subject: [PATCH 23/81] ECC-1691: Remove future entries from GRIB2 table version 31 --- definitions/grib2/tables/31/1.3.table | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/definitions/grib2/tables/31/1.3.table b/definitions/grib2/tables/31/1.3.table index 26005a4d0..5e2e59087 100644 --- a/definitions/grib2/tables/31/1.3.table +++ b/definitions/grib2/tables/31/1.3.table @@ -11,8 +11,6 @@ 9 9 Uncertainties in Ensembles of Regional ReAnalyses project test (UERRA) 10 10 Copernicus regional reanalysis (CARRA/CERRA) 11 11 Copernicus regional reanalysis test (CARRA/CERRA) -12 12 Destination Earth (DestinE) -13 13 Destination Earth test (DestinE) -# 14-191 Reserved +# 12-191 Reserved # 192-254 Reserved for local use 255 255 Missing From 68d8bc0b1aa1dcaac2bcf9ae758b486a83a07848 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Mon, 9 Oct 2023 16:52:05 +0000 Subject: [PATCH 24/81] ECC-1691: Fixed a typo and reverted some changes --- definitions/grib2/destine_resolution.table | 5 ++--- definitions/grib2/local.destine.climate-dt.def | 2 +- definitions/grib2/tables/31/1.3.table | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/definitions/grib2/destine_resolution.table b/definitions/grib2/destine_resolution.table index 30e347f44..48d816018 100644 --- a/definitions/grib2/destine_resolution.table +++ b/definitions/grib2/destine_resolution.table @@ -1,5 +1,4 @@ 0 unknown unknown -1 standard Standard resolution model output with guaranteed availability -2 mediumres Medium resolution model output with limited availability -3 highres High resolution model output with limited availability +1 standard Standard resolution model output with longer availability +2 highres High resolution model output with limited availability 65535 65535 Missing \ No newline at end of file diff --git a/definitions/grib2/local.destine.climate-dt.def b/definitions/grib2/local.destine.climate-dt.def index e1266ce6e..f66c7378d 100644 --- a/definitions/grib2/local.destine.climate-dt.def +++ b/definitions/grib2/local.destine.climate-dt.def @@ -4,7 +4,7 @@ codetable[2] activity "grib2/destine_activity.table" : dump; alias mars.activity = activity; codetable[2] experiment "grib2/destine_experiment.table" : dump; -alias mars.study = experiment; +alias mars.experiment = experiment; unsigned[1] generation = 255 : dump; alias mars.generation = generation; diff --git a/definitions/grib2/tables/31/1.3.table b/definitions/grib2/tables/31/1.3.table index 26005a4d0..5e2e59087 100644 --- a/definitions/grib2/tables/31/1.3.table +++ b/definitions/grib2/tables/31/1.3.table @@ -11,8 +11,6 @@ 9 9 Uncertainties in Ensembles of Regional ReAnalyses project test (UERRA) 10 10 Copernicus regional reanalysis (CARRA/CERRA) 11 11 Copernicus regional reanalysis test (CARRA/CERRA) -12 12 Destination Earth (DestinE) -13 13 Destination Earth test (DestinE) -# 14-191 Reserved +# 12-191 Reserved # 192-254 Reserved for local use 255 255 Missing From 6f6f431490fe45f8b08fc8938e5d9be0647c1919 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Tue, 10 Oct 2023 10:38:17 +0000 Subject: [PATCH 25/81] ECC-1691: Removed type and stream from products; We don't want to define this in products_destine; It is added in mars_labeling. --- definitions/grib2/products_destine.def | 39 -------------------------- 1 file changed, 39 deletions(-) diff --git a/definitions/grib2/products_destine.def b/definitions/grib2/products_destine.def index 3744612d4..93c8b8f9d 100644 --- a/definitions/grib2/products_destine.def +++ b/definitions/grib2/products_destine.def @@ -21,45 +21,6 @@ if(typeOfFirstFixedSurface == 103) { } } -# Define marsType based on type of processed data -concept marsType(unknown) { - - fc = { - typeOfProcessedData = 1; - } - "9" = { - typeOfProcessedData = 1; - } - - an = { - typeOfProcessedData = 0; - } - "2" = { - typeOfProcessedData = 0; - } -} - -alias mars.type = marsType; - -concept marsStream(unknown) { - - oper = { - productDefinitionTemplateNumber = 8; - } - oper = { - productDefinitionTemplateNumber = 0; - } - - enda = { - productDefinitionTemplateNumber = 11; - } - enda = { - productDefinitionTemplateNumber = 1; - } -} : no_copy; - -alias mars.stream = marsStream; - if (dataset is "climate-dt") { alias mars.date = validityDate; alias mars.time = validityTime; From da51abe8755e0261c1aef1ee2132f2ea9112dc4a Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Tue, 10 Oct 2023 14:33:36 +0000 Subject: [PATCH 26/81] ECC-1691: Deleted some model entries --- definitions/grib2/destine_model.table | 2 -- 1 file changed, 2 deletions(-) diff --git a/definitions/grib2/destine_model.table b/definitions/grib2/destine_model.table index e0662ac43..1e33fbac1 100644 --- a/definitions/grib2/destine_model.table +++ b/definitions/grib2/destine_model.table @@ -3,6 +3,4 @@ 2 IFS-NEMO IFS with NEMO ocean model 3 IFS-FESOM IFS with FESOM ocean model 4 ICON ICON with no ocean model -5 ICON-NEMO ICON with NEMO ocean model -6 ICON-FESOM ICON with FESOM ocean model 65535 65535 Missing From ec0fd03b6ce0ed8a00685e59b3485cc207c2e23e Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 12 Oct 2023 16:33:41 +0000 Subject: [PATCH 27/81] ECC-1691: Added mars streams and definition files; Added destine sample GRIB2 file; Modified test to account for new streams. --- definitions/grib2/products_destine.def | 8 +----- definitions/mars/grib.clim.fc.def | 4 +++ definitions/mars/grib.clmn.fc.def | 6 +++++ definitions/mars/stream.table | 2 ++ samples/destine_grib2.tmpl | Bin 0 -> 200 bytes tests/grib_ecc-1691.sh | 35 +++++++++++++++++++------ 6 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 definitions/mars/grib.clim.fc.def create mode 100644 definitions/mars/grib.clmn.fc.def create mode 100644 samples/destine_grib2.tmpl diff --git a/definitions/grib2/products_destine.def b/definitions/grib2/products_destine.def index 93c8b8f9d..98788e64f 100644 --- a/definitions/grib2/products_destine.def +++ b/definitions/grib2/products_destine.def @@ -19,10 +19,4 @@ if(typeOfFirstFixedSurface == 103) { # levelist was unaliased in template.4.horizontal.def so we must have it back alias mars.levelist = level; } -} - -if (dataset is "climate-dt") { - alias mars.date = validityDate; - alias mars.time = validityTime; - unalias mars.step; -} +} \ No newline at end of file diff --git a/definitions/mars/grib.clim.fc.def b/definitions/mars/grib.clim.fc.def new file mode 100644 index 000000000..18cbc6f10 --- /dev/null +++ b/definitions/mars/grib.clim.fc.def @@ -0,0 +1,4 @@ +alias mars.date = validityDate; +alias mars.time = validityTime; +unalias mars.step; +unalias mars.domain; \ No newline at end of file diff --git a/definitions/mars/grib.clmn.fc.def b/definitions/mars/grib.clmn.fc.def new file mode 100644 index 000000000..34723b605 --- /dev/null +++ b/definitions/mars/grib.clmn.fc.def @@ -0,0 +1,6 @@ +alias mars.year = year; +alias mars.month = month; +unalias mars.date; +unalias mars.time; +unalias mars.step; +unalias mars.domain; \ No newline at end of file diff --git a/definitions/mars/stream.table b/definitions/mars/stream.table index a5d90c167..cde61acd5 100644 --- a/definitions/mars/stream.table +++ b/definitions/mars/stream.table @@ -69,6 +69,8 @@ 1095 wamf Wave monthly forecast 1096 wmfm Wave monthly forecast means 1097 smma Seasonal monthly means anomalies +1098 clim Climate run output +1099 clmn Climate run monthly means output 1110 seap Sensitive area prediction 1120 eefh Extended ensemble forecast hindcast 1121 eehs Extended ensemble forecast hindcast statistics diff --git a/samples/destine_grib2.tmpl b/samples/destine_grib2.tmpl new file mode 100644 index 0000000000000000000000000000000000000000..95154453c7d79748bd091682d633d23c1fb1607e GIT binary patch literal 200 zcmZ<{@^t$DpMi-10!{!aQAUO&1_pTsM)vE>;yertJRnI?CI&_z#mJz?z{J96U|?Vf z Date: Fri, 13 Oct 2023 11:06:11 +0000 Subject: [PATCH 28/81] ECC-1691: Validity time needs to be padded as str; --- definitions/mars/grib.clim.fc.def | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/definitions/mars/grib.clim.fc.def b/definitions/mars/grib.clim.fc.def index 18cbc6f10..f75dd3faf 100644 --- a/definitions/mars/grib.clim.fc.def +++ b/definitions/mars/grib.clim.fc.def @@ -1,4 +1,5 @@ alias mars.date = validityDate; -alias mars.time = validityTime; +meta padded_vtime sprintf("%.4d", validityTime): no_copy; +alias mars.time = padded_vtime; unalias mars.step; unalias mars.domain; \ No newline at end of file From 9d4ce9b613c63358179f6f4156455b67397bd5e5 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Fri, 13 Oct 2023 13:59:10 +0000 Subject: [PATCH 29/81] ECC-1691: Don't want origin in mars namespace --- definitions/grib2/products_destine.def | 1 - 1 file changed, 1 deletion(-) diff --git a/definitions/grib2/products_destine.def b/definitions/grib2/products_destine.def index 98788e64f..b1d0c4aee 100644 --- a/definitions/grib2/products_destine.def +++ b/definitions/grib2/products_destine.def @@ -8,7 +8,6 @@ alias parameter.name=name; alias mars.class = marsClass; alias mars.param = paramId; -alias mars.origin = centre; # Special rule for level type 103 'Specified height level above ground (m)' if(typeOfFirstFixedSurface == 103) { From e25954bc301e62a54958631b2fe44e6f59c900cb Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Fri, 13 Oct 2023 14:12:54 +0000 Subject: [PATCH 30/81] ECC-1691: Sticking to CMIP format we use US format; realisation --> realization --- definitions/grib2/local.destine.climate-dt.def | 4 ++-- tests/grib_ecc-1691.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/definitions/grib2/local.destine.climate-dt.def b/definitions/grib2/local.destine.climate-dt.def index f66c7378d..61df737fc 100644 --- a/definitions/grib2/local.destine.climate-dt.def +++ b/definitions/grib2/local.destine.climate-dt.def @@ -12,8 +12,8 @@ alias mars.generation = generation; codetable[2] model "grib2/destine_model.table" : dump; alias mars.model = model; -unsigned[1] realisation = 255 : dump; -alias mars.realisation = realisation; +unsigned[1] realization = 255 : dump; +alias mars.realization = realization; codetable[2] resolution "grib2/destine_resolution.table" : dump; alias mars.resolution = resolution; diff --git a/tests/grib_ecc-1691.sh b/tests/grib_ecc-1691.sh index 471de43ba..b02883e27 100755 --- a/tests/grib_ecc-1691.sh +++ b/tests/grib_ecc-1691.sh @@ -36,13 +36,13 @@ grib_check_key_equals $destine_sample "marsClass,dataset,destineLocalVersion" "d # Check setting dataset to climate-dt (1). Check keys are present and equal defaults ${tools_dir}/grib_set -s dataset=1 $destine_sample $temp_grib_a -grib_check_key_exists $temp_grib_a dataset,generation,activity,experiment,model,realisation,resolution -grib_check_key_equals $temp_grib_a "dataset,generation,activity,experiment,model,realisation,resolution" "1 255 0 0 0 255 0" +grib_check_key_exists $temp_grib_a dataset,generation,activity,experiment,model,realization,resolution +grib_check_key_equals $temp_grib_a "dataset,generation,activity,experiment,model,realization,resolution" "1 255 0 0 0 255 0" # Check an example where a few additional things are set in climate-dt -${tools_dir}/grib_set -s dataset=1,generation=2,activity=1,experiment=1,model=2,realisation=1,resolution=1 $destine_sample $temp_grib_a +${tools_dir}/grib_set -s dataset=1,generation=2,activity=1,experiment=1,model=2,realization=1,resolution=1 $destine_sample $temp_grib_a -grib_check_key_equals $temp_grib_a "dataset,generation,activity,experiment,model,realisation,resolution" "1 2 1 1 2 1 1" +grib_check_key_equals $temp_grib_a "dataset,generation,activity,experiment,model,realization,resolution" "1 2 1 1 2 1 1" grib_check_key_equals $temp_grib_a "dataset:s,activity:s,experiment:s,model:s,resolution:s" "climate-dt CMIP6 hist IFS-NEMO standard" # Check setting dataset to extremes-dt (2). This time we will check string also From 878b2bdb47a26c5ab5b5fd607cff4a75cd9a0429 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Fri, 13 Oct 2023 15:14:17 +0000 Subject: [PATCH 31/81] ECC-1691: Removed hyphen which fdb has issues with --- definitions/grib2/destine_dataset.table | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/grib2/destine_dataset.table b/definitions/grib2/destine_dataset.table index 58b82fc41..709cc74a2 100644 --- a/definitions/grib2/destine_dataset.table +++ b/definitions/grib2/destine_dataset.table @@ -1,5 +1,5 @@ 0 unknown unknown -1 climate-dt Climate change adaptation digital twin +1 climateDT Climate change adaptation digital twin 2 extremes-dt Weather and geophysical extremes digital twin 3 on-demand-climate-dt On-demand climate change adaptation digital twin 4 on-demand-extremes-dt On-demand weather and geophysical extremes digital twin From 64a3dc9d96846be5260f7df7167131c15eac91e8 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Fri, 13 Oct 2023 15:30:24 +0000 Subject: [PATCH 32/81] ECC-1691: Need to change climateDT related file --- .../{local.destine.climate-dt.def => local.destine.climateDT.def} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename definitions/grib2/{local.destine.climate-dt.def => local.destine.climateDT.def} (100%) diff --git a/definitions/grib2/local.destine.climate-dt.def b/definitions/grib2/local.destine.climateDT.def similarity index 100% rename from definitions/grib2/local.destine.climate-dt.def rename to definitions/grib2/local.destine.climateDT.def From 80e7e88b62a188eaf54528aa1c276da4fe79549a Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Fri, 13 Oct 2023 16:27:07 +0000 Subject: [PATCH 33/81] ECC-1691: Back to "climate-dt"; This is what we want for future, but had to change while doing fdb tests --- definitions/grib2/destine_dataset.table | 2 +- ...local.destine.climateDT.def => local.destine.climate-dt.def} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename definitions/grib2/{local.destine.climateDT.def => local.destine.climate-dt.def} (100%) diff --git a/definitions/grib2/destine_dataset.table b/definitions/grib2/destine_dataset.table index 709cc74a2..58b82fc41 100644 --- a/definitions/grib2/destine_dataset.table +++ b/definitions/grib2/destine_dataset.table @@ -1,5 +1,5 @@ 0 unknown unknown -1 climateDT Climate change adaptation digital twin +1 climate-dt Climate change adaptation digital twin 2 extremes-dt Weather and geophysical extremes digital twin 3 on-demand-climate-dt On-demand climate change adaptation digital twin 4 on-demand-extremes-dt On-demand weather and geophysical extremes digital twin diff --git a/definitions/grib2/local.destine.climateDT.def b/definitions/grib2/local.destine.climate-dt.def similarity index 100% rename from definitions/grib2/local.destine.climateDT.def rename to definitions/grib2/local.destine.climate-dt.def From 3cfccfddf6f332e7442eb26884ce9a27a403d2bb Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Mon, 16 Oct 2023 16:38:33 +0000 Subject: [PATCH 34/81] ECC-1691: Changed dash to underscores in dataset; This is because the values of these keys are used directly in the schema The fdb schema doesn't support hyphens currently --- definitions/grib2/destine_dataset.table | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/definitions/grib2/destine_dataset.table b/definitions/grib2/destine_dataset.table index 58b82fc41..4690b4bab 100644 --- a/definitions/grib2/destine_dataset.table +++ b/definitions/grib2/destine_dataset.table @@ -1,6 +1,6 @@ 0 unknown unknown -1 climate-dt Climate change adaptation digital twin -2 extremes-dt Weather and geophysical extremes digital twin -3 on-demand-climate-dt On-demand climate change adaptation digital twin -4 on-demand-extremes-dt On-demand weather and geophysical extremes digital twin +1 climate_dt Climate change adaptation digital twin +2 extremes_dt Weather and geophysical extremes digital twin +3 on_demand_climate_dt On-demand climate change adaptation digital twin +4 on_demand_extremes_dt On-demand weather and geophysical extremes digital twin 65535 65535 Missing From 0f5dde658d870e8dac1409c6e1e344e0667f7d5c Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Tue, 17 Oct 2023 08:11:45 +0000 Subject: [PATCH 35/81] ECC-1691: Tweaked test to change from "-" to "_". --- tests/grib_ecc-1691.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/grib_ecc-1691.sh b/tests/grib_ecc-1691.sh index b02883e27..f827d8108 100755 --- a/tests/grib_ecc-1691.sh +++ b/tests/grib_ecc-1691.sh @@ -33,22 +33,22 @@ ${tools_dir}/grib_set -s productionStatusOfProcessedData=12,class=d1 $temp_grib_ grib_check_key_exists $destine_sample destineLocalVersion,dataset,marsClass,marsType,marsStream,experimentVersionNumber grib_check_key_equals $destine_sample "marsClass,dataset,destineLocalVersion" "d1 0 1" -# Check setting dataset to climate-dt (1). Check keys are present and equal defaults +# Check setting dataset to climate_dt (1). Check keys are present and equal defaults ${tools_dir}/grib_set -s dataset=1 $destine_sample $temp_grib_a grib_check_key_exists $temp_grib_a dataset,generation,activity,experiment,model,realization,resolution grib_check_key_equals $temp_grib_a "dataset,generation,activity,experiment,model,realization,resolution" "1 255 0 0 0 255 0" -# Check an example where a few additional things are set in climate-dt +# Check an example where a few additional things are set in climate_dt ${tools_dir}/grib_set -s dataset=1,generation=2,activity=1,experiment=1,model=2,realization=1,resolution=1 $destine_sample $temp_grib_a grib_check_key_equals $temp_grib_a "dataset,generation,activity,experiment,model,realization,resolution" "1 2 1 1 2 1 1" -grib_check_key_equals $temp_grib_a "dataset:s,activity:s,experiment:s,model:s,resolution:s" "climate-dt CMIP6 hist IFS-NEMO standard" +grib_check_key_equals $temp_grib_a "dataset:s,activity:s,experiment:s,model:s,resolution:s" "climate_dt CMIP6 hist IFS-NEMO standard" -# Check setting dataset to extremes-dt (2). This time we will check string also +# Check setting dataset to extremes_dt (2). This time we will check string also ${tools_dir}/grib_set -s dataset=2 $destine_sample $temp_grib_a -grib_check_key_equals $temp_grib_a "dataset,dataset:s" "2 extremes-dt" +grib_check_key_equals $temp_grib_a "dataset,dataset:s" "2 extremes_dt" # Check concepts. First check default value and then example of mapping grib_check_key_exists $destine_sample destineOrigin,gridSpecification From 12a90946efa5cb107a2254e2c9d9e614c4bc0308 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Tue, 17 Oct 2023 08:56:19 +0000 Subject: [PATCH 36/81] ECC-1691: Update "-" to "_" in filename. --- ...{local.destine.climate-dt.def => local.destine.climate_dt.def} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename definitions/grib2/{local.destine.climate-dt.def => local.destine.climate_dt.def} (100%) diff --git a/definitions/grib2/local.destine.climate-dt.def b/definitions/grib2/local.destine.climate_dt.def similarity index 100% rename from definitions/grib2/local.destine.climate-dt.def rename to definitions/grib2/local.destine.climate_dt.def From df60ca871f96a302bbd15cebfb79a5eb037c145d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 19 Oct 2023 13:03:57 +0100 Subject: [PATCH 37/81] ECC-1707: GRIB2: Add support for two FESOM grids --- .../grib2/localConcepts/ecmf/unstructuredGridSubtype.def | 2 ++ definitions/grib2/localConcepts/ecmf/unstructuredGridType.def | 2 ++ 2 files changed, 4 insertions(+) diff --git a/definitions/grib2/localConcepts/ecmf/unstructuredGridSubtype.def b/definitions/grib2/localConcepts/ecmf/unstructuredGridSubtype.def index 3f93215f3..926277b83 100644 --- a/definitions/grib2/localConcepts/ecmf/unstructuredGridSubtype.def +++ b/definitions/grib2/localConcepts/ecmf/unstructuredGridSubtype.def @@ -4,3 +4,5 @@ 'V' = { numberOfGridInReference = 3; } 'W' = { numberOfGridInReference = 4; } 'F' = { numberOfGridInReference = 5; } +'E' = { numberOfGridInReference = 6; } +'N' = { numberOfGridInReference = 7; } diff --git a/definitions/grib2/localConcepts/ecmf/unstructuredGridType.def b/definitions/grib2/localConcepts/ecmf/unstructuredGridType.def index 33dcb3cac..dfcc93e2f 100644 --- a/definitions/grib2/localConcepts/ecmf/unstructuredGridType.def +++ b/definitions/grib2/localConcepts/ecmf/unstructuredGridType.def @@ -6,3 +6,5 @@ 'eORCA1' = { numberOfGridUsed = 5; } 'eORCA025' = { numberOfGridUsed = 6; } 'eORCA12' = { numberOfGridUsed = 7; } +'CORE2' = { numberOfGridUsed = 8; } +'NG5' = { numberOfGridUsed = 9; } From 86118f33e221b245110cc06e2a41df0be4702d21 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 19 Oct 2023 13:35:31 +0000 Subject: [PATCH 38/81] ECC-1691: Changed stream name from clim to clte; This avoids confusion with climatology --- definitions/mars/{grib.clim.fc.def => grib.clte.fc.def} | 0 definitions/mars/stream.table | 2 +- tests/grib_ecc-1691.sh | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename definitions/mars/{grib.clim.fc.def => grib.clte.fc.def} (100%) diff --git a/definitions/mars/grib.clim.fc.def b/definitions/mars/grib.clte.fc.def similarity index 100% rename from definitions/mars/grib.clim.fc.def rename to definitions/mars/grib.clte.fc.def diff --git a/definitions/mars/stream.table b/definitions/mars/stream.table index cde61acd5..446d5e6b0 100644 --- a/definitions/mars/stream.table +++ b/definitions/mars/stream.table @@ -69,7 +69,7 @@ 1095 wamf Wave monthly forecast 1096 wmfm Wave monthly forecast means 1097 smma Seasonal monthly means anomalies -1098 clim Climate run output +1098 clte Climate run output 1099 clmn Climate run monthly means output 1110 seap Sensitive area prediction 1120 eefh Extended ensemble forecast hindcast diff --git a/tests/grib_ecc-1691.sh b/tests/grib_ecc-1691.sh index f827d8108..13263cb69 100755 --- a/tests/grib_ecc-1691.sh +++ b/tests/grib_ecc-1691.sh @@ -65,10 +65,10 @@ ${tools_dir}/grib_set -s numberOfDataPoints=12582912,gridDefinitionTemplateNumbe grib_check_key_equals $temp_grib_a "gridSpecification" "H1024" # Now check streams. -# Setting stream clim and type fc should set mars.date and mars.time to validityDate and validityTime, +# Setting stream clte and type fc should set mars.date and mars.time to validityDate and validityTime, # and mars.step should be unaliased -${tools_dir}/grib_set -s stream=clim,type=fc $destine_sample $temp_grib_a +${tools_dir}/grib_set -s stream=clte,type=fc $destine_sample $temp_grib_a result1=$( ${tools_dir}/grib_get -p mars.date,mars.time $temp_grib_a ) result2=$( ${tools_dir}/grib_get -p validityDate,validityTime $temp_grib_a ) From 3864a91526f5eae5c2f5f2bf34cf3175e52f1ec9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 19 Oct 2023 15:57:56 +0100 Subject: [PATCH 39/81] ECC-1707: Modification --- .../grib2/localConcepts/ecmf/unstructuredGridSubtype.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/grib2/localConcepts/ecmf/unstructuredGridSubtype.def b/definitions/grib2/localConcepts/ecmf/unstructuredGridSubtype.def index 926277b83..0f9911a54 100644 --- a/definitions/grib2/localConcepts/ecmf/unstructuredGridSubtype.def +++ b/definitions/grib2/localConcepts/ecmf/unstructuredGridSubtype.def @@ -4,5 +4,5 @@ 'V' = { numberOfGridInReference = 3; } 'W' = { numberOfGridInReference = 4; } 'F' = { numberOfGridInReference = 5; } -'E' = { numberOfGridInReference = 6; } +'C' = { numberOfGridInReference = 6; } 'N' = { numberOfGridInReference = 7; } From 5a675bcafc9127222b4b039106fa88ff6481cfa4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 19 Oct 2023 17:50:50 +0100 Subject: [PATCH 40/81] Testing: GRIB1 stepRange --- tests/grib_step.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/grib_step.sh b/tests/grib_step.sh index 308a60170..741da1867 100755 --- a/tests/grib_step.sh +++ b/tests/grib_step.sh @@ -206,6 +206,21 @@ result=$(${tools_dir}/grib_get -w count=1 -p step -s stepUnits=D $input) result=$(${tools_dir}/grib_get -w count=1 -p step -s stepUnits=m $input) [ $result = 5760 ] +# GRIB1 stepRange and timeRangeIndicator=10 +# ----------------------------------------- +input=${data_dir}/reduced_latlon_surface.grib1 +grib_check_key_equals $input timeRangeIndicator,P1,P2 '10 0 0' +ECCODES_GRIBEX_MODE_ON=1 ${tools_dir}/grib_set -s stepRange=11-12 $input $temp +grib_check_key_equals $temp P1,P2 '0 11' + +set +e +${tools_dir}/grib_set -s stepRange=11-12 $input $temp 2>$templog +status=$? +set -e +[ $status -ne 0 ] +grep -q "Unable to set stepRange" $templog + + # Clean up rm -f $temp $templog rm -f $grib2File.p8tmp ${grib2File}.tmp x.grib From 72afc35a0e4df47609533ce70b1df8a8e8a0acc5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 19 Oct 2023 18:25:17 +0100 Subject: [PATCH 41/81] Cleanup --- src/action_class_if.cc | 2 +- src/action_class_section.cc | 7 ++----- src/eccodes_prototypes.h | 1 - src/grib_buffer.cc | 12 +----------- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/action_class_if.cc b/src/action_class_if.cc index a4da2f4be..4c94549af 100644 --- a/src/action_class_if.cc +++ b/src/action_class_if.cc @@ -272,7 +272,7 @@ static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit) if ((ret = grib_expression_evaluate_long(grib_handle_of_accessor(acc), self->expression, &lres)) != GRIB_SUCCESS) grib_context_log(acc->context, - GRIB_LOG_ERROR, "if reparse grib_expression_evaluate_long %s", + GRIB_LOG_ERROR, "action_class_if::reparse: grib_expression_evaluate_long failed: %s", grib_get_error_message(ret)); if (lres) diff --git a/src/action_class_section.cc b/src/action_class_section.cc index fc64351df..6f9cd5836 100644 --- a/src/action_class_section.cc +++ b/src/action_class_section.cc @@ -10,7 +10,6 @@ /*************************************************************************** * Jean Baptiste Filippi - 01.11.2005 * - * Enrico Fucile * ***************************************************************************/ #include "grib_api_internal.h" @@ -235,10 +234,8 @@ static int notify_change(grib_action* act, grib_accessor* notified, static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit) { - /* Should be inherited */ - printf("reparse should be inherited: %s\n", a->name); - - Assert(1 == 0); + fprintf(stderr, "action_class_section::reparse should be inherited: %s\n", a->name); + Assert(0); return 0; } diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 3b405a05a..cf0985e86 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -792,7 +792,6 @@ void grib_buffer_free(const grib_context* c, void* p); void* grib_buffer_realloc(const grib_context* c, void* p, size_t s); /* grib_buffer.cc*/ -void grib_get_buffer_ownership(const grib_context* c, grib_buffer* b); grib_buffer* grib_create_growable_buffer(const grib_context* c); grib_buffer* grib_new_buffer(const grib_context* c, const unsigned char* data, size_t buflen); void grib_buffer_delete(const grib_context* c, grib_buffer* b); diff --git a/src/grib_buffer.cc b/src/grib_buffer.cc index 370cafc13..548c546cc 100644 --- a/src/grib_buffer.cc +++ b/src/grib_buffer.cc @@ -13,7 +13,7 @@ ***************************************************************************/ #include "grib_api_internal.h" -void grib_get_buffer_ownership(const grib_context* c, grib_buffer* b) +static void grib_get_buffer_ownership(const grib_context* c, grib_buffer* b) { unsigned char* newdata; if (b->property == CODES_MY_BUFFER) @@ -137,23 +137,19 @@ static void update_offsets_after(grib_accessor* a, long len) } } -// /* new GCC compiler v4.5.0 complains function is defined but not used*/ // void grib_recompute_sections_lengths(grib_section* s) // { // if(s) // { // long plen = 0; // size_t len = 1; - // grib_accessor* a = s->block->first; - // while(a) // { // /* grib_recompute_sections_lengths(grib_get_sub_section(a)); */ // grib_recompute_sections_lengths(a->sub_section); // a = a->next; // } - // if(s->aclength) // { // int ret; @@ -161,10 +157,8 @@ static void update_offsets_after(grib_accessor* a, long len) // plen = grib_get_next_position_offset(s->block->last) - s->owner->offset; // else // plen = grib_get_next_position_offset(s->block->last); - // if((ret = grib_pack_long(s->aclength, &plen, &len)) != GRIB_SUCCESS) // ; - // // if(s->h->context->debug) // printf("SECTION updating length %ld .. %s\n",plen,s->owner->name); @@ -177,7 +171,6 @@ static void update_offsets_after(grib_accessor* a, long len) // { // long plen = 0; // size_t len = 1; - // if(!s) return; // if(s->aclength) // { @@ -186,14 +179,11 @@ static void update_offsets_after(grib_accessor* a, long len) // plen = grib_get_next_position_offset(s->block->last) - s->owner->offset; // else // plen = grib_get_next_position_offset(s->block->last); - // /* if(s->owner) */ // /* s->owner->length = plen; */ - // /* if(s->aclength) */ // if((ret = grib_pack_long(s->aclength, &plen, &len)) != GRIB_SUCCESS) // ; - // if(s->h->context->debug) // { // printf("SECTION updating length %ld .. %s\n",plen,s->owner->name); From 5bbde7f2f509753927006b3fd184b467c36b6b97 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 20 Oct 2023 11:29:52 +0000 Subject: [PATCH 42/81] ECC-1702: GRIB2: Add turbulent surface parameters --- .../grib1/localConcepts/ecmf/cfName.def | 14 +-- .../grib1/localConcepts/ecmf/cfVarName.def | 12 +-- definitions/grib1/localConcepts/ecmf/name.def | 24 +++--- .../grib1/localConcepts/ecmf/paramId.def | 12 +-- .../grib1/localConcepts/ecmf/shortName.def | 12 +-- .../grib1/localConcepts/ecmf/units.def | 12 +-- definitions/grib2/cfName.def | 8 +- definitions/grib2/cfVarName.def | 82 ++++++++++++++---- .../grib2/localConcepts/s2s/cfName.def | 16 ++++ .../grib2/localConcepts/s2s/cfVarName.def | 16 ++++ definitions/grib2/localConcepts/s2s/name.def | 16 ++++ .../grib2/localConcepts/s2s/paramId.def | 16 ++++ .../grib2/localConcepts/s2s/shortName.def | 16 ++++ definitions/grib2/localConcepts/s2s/units.def | 16 ++++ .../grib2/localConcepts/uerra/cfVarName.def | 12 +++ .../grib2/localConcepts/uerra/name.def | 12 +++ .../grib2/localConcepts/uerra/paramId.def | 12 +++ .../grib2/localConcepts/uerra/shortName.def | 12 +++ .../grib2/localConcepts/uerra/units.def | 12 +++ definitions/grib2/name.def | 86 +++++++++++++++---- definitions/grib2/paramId.def | 82 ++++++++++++++---- definitions/grib2/shortName.def | 82 ++++++++++++++---- definitions/grib2/units.def | 82 ++++++++++++++---- 23 files changed, 535 insertions(+), 129 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/cfName.def b/definitions/grib1/localConcepts/ecmf/cfName.def index 9868daef7..48b023899 100644 --- a/definitions/grib1/localConcepts/ecmf/cfName.def +++ b/definitions/grib1/localConcepts/ecmf/cfName.def @@ -589,32 +589,32 @@ table2Version = 190 ; indicatorOfParameter = 179 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'surface_downward_eastward_stress' = { table2Version = 128 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'surface_downward_eastward_stress' = { table2Version = 170 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'surface_downward_eastward_stress' = { table2Version = 180 ; indicatorOfParameter = 180 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'surface_downward_northward_stress' = { table2Version = 128 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'surface_downward_northward_stress' = { table2Version = 170 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'surface_downward_northward_stress' = { table2Version = 180 ; indicatorOfParameter = 181 ; @@ -959,7 +959,7 @@ table2Version = 174 ; indicatorOfParameter = 98 ; } -#Carbon Dioxide +#Carbon dioxide mass mixing ratio 'mass_fraction_of_carbon_dioxide_in_air' = { table2Version = 210 ; indicatorOfParameter = 61 ; diff --git a/definitions/grib1/localConcepts/ecmf/cfVarName.def b/definitions/grib1/localConcepts/ecmf/cfVarName.def index 36530b6f3..03a5530af 100644 --- a/definitions/grib1/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib1/localConcepts/ecmf/cfVarName.def @@ -1459,32 +1459,32 @@ table2Version = 190 ; indicatorOfParameter = 179 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'ewss' = { table2Version = 128 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'ewss' = { table2Version = 170 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'ewss' = { table2Version = 180 ; indicatorOfParameter = 180 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'nsss' = { table2Version = 128 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'nsss' = { table2Version = 170 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'nsss' = { table2Version = 180 ; indicatorOfParameter = 181 ; diff --git a/definitions/grib1/localConcepts/ecmf/name.def b/definitions/grib1/localConcepts/ecmf/name.def index 78ecaecad..5421b5ca8 100644 --- a/definitions/grib1/localConcepts/ecmf/name.def +++ b/definitions/grib1/localConcepts/ecmf/name.def @@ -1459,33 +1459,33 @@ table2Version = 190 ; indicatorOfParameter = 179 ; } -#Eastward turbulent surface stress -'Eastward turbulent surface stress' = { +#Time-integrated eastward turbulent surface stress +'Time-integrated eastward turbulent surface stress' = { table2Version = 128 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress -'Eastward turbulent surface stress' = { +#Time-integrated eastward turbulent surface stress +'Time-integrated eastward turbulent surface stress' = { table2Version = 170 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress -'Eastward turbulent surface stress' = { +#Time-integrated eastward turbulent surface stress +'Time-integrated eastward turbulent surface stress' = { table2Version = 180 ; indicatorOfParameter = 180 ; } -#Northward turbulent surface stress -'Northward turbulent surface stress' = { +#Time-integrated northward turbulent surface stress +'Time-integrated northward turbulent surface stress' = { table2Version = 128 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress -'Northward turbulent surface stress' = { +#Time-integrated northward turbulent surface stress +'Time-integrated northward turbulent surface stress' = { table2Version = 170 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress -'Northward turbulent surface stress' = { +#Time-integrated northward turbulent surface stress +'Time-integrated northward turbulent surface stress' = { table2Version = 180 ; indicatorOfParameter = 181 ; } diff --git a/definitions/grib1/localConcepts/ecmf/paramId.def b/definitions/grib1/localConcepts/ecmf/paramId.def index 572393e2e..3bd904fb6 100644 --- a/definitions/grib1/localConcepts/ecmf/paramId.def +++ b/definitions/grib1/localConcepts/ecmf/paramId.def @@ -1459,32 +1459,32 @@ table2Version = 190 ; indicatorOfParameter = 179 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress '180' = { table2Version = 128 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress '180' = { table2Version = 170 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress '180' = { table2Version = 180 ; indicatorOfParameter = 180 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress '181' = { table2Version = 128 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress '181' = { table2Version = 170 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress '181' = { table2Version = 180 ; indicatorOfParameter = 181 ; diff --git a/definitions/grib1/localConcepts/ecmf/shortName.def b/definitions/grib1/localConcepts/ecmf/shortName.def index 6fd82758e..02fc2cceb 100644 --- a/definitions/grib1/localConcepts/ecmf/shortName.def +++ b/definitions/grib1/localConcepts/ecmf/shortName.def @@ -1459,32 +1459,32 @@ table2Version = 190 ; indicatorOfParameter = 179 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'ewss' = { table2Version = 128 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'ewss' = { table2Version = 170 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'ewss' = { table2Version = 180 ; indicatorOfParameter = 180 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'nsss' = { table2Version = 128 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'nsss' = { table2Version = 170 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'nsss' = { table2Version = 180 ; indicatorOfParameter = 181 ; diff --git a/definitions/grib1/localConcepts/ecmf/units.def b/definitions/grib1/localConcepts/ecmf/units.def index 027242702..8eadf0ea3 100644 --- a/definitions/grib1/localConcepts/ecmf/units.def +++ b/definitions/grib1/localConcepts/ecmf/units.def @@ -1459,32 +1459,32 @@ table2Version = 190 ; indicatorOfParameter = 179 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'N m**-2 s' = { table2Version = 128 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'N m**-2 s' = { table2Version = 170 ; indicatorOfParameter = 180 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'N m**-2 s' = { table2Version = 180 ; indicatorOfParameter = 180 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'N m**-2 s' = { table2Version = 128 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'N m**-2 s' = { table2Version = 170 ; indicatorOfParameter = 181 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'N m**-2 s' = { table2Version = 180 ; indicatorOfParameter = 181 ; diff --git a/definitions/grib2/cfName.def b/definitions/grib2/cfName.def index c21d5b9ae..7e769ee34 100644 --- a/definitions/grib2/cfName.def +++ b/definitions/grib2/cfName.def @@ -45,19 +45,19 @@ typeOfFirstFixedSurface = 8 ; typeOfStatisticalProcessing = 1 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'surface_downward_eastward_stress' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 38 ; + parameterNumber = 62 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'surface_downward_northward_stress' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 37 ; + parameterNumber = 63 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 4234951b7..053b95478 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -382,19 +382,19 @@ typeOfFirstFixedSurface = 8 ; typeOfStatisticalProcessing = 1 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'ewss' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 38 ; + parameterNumber = 62 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'nsss' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 37 ; + parameterNumber = 63 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } @@ -724,6 +724,20 @@ parameterCategory = 0 ; parameterNumber = 89 ; } +#U-component of atmospheric surface momentum flux +'utaua' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 1 ; + } +#V-component of atmospheric surface momentum flux +'vtaua' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 1 ; + } #U-component of surface momentum flux into ocean 'utauo' = { discipline = 10 ; @@ -3745,6 +3759,22 @@ typeOfFirstFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Mean eastward turbulent surface stress +'metss' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 62 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Mean northward turbulent surface stress +'mntss' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 63 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Mean evaporation rate 'mer' = { discipline = 0 ; @@ -4735,6 +4765,38 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 255 ; } +#Time-integrated eastward turbulent surface stress due to orographic form drag +'etssofd' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 64 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress due to orographic form drag +'ntssofd' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 65 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated eastward turbulent surface stress due to surface roughness +'etsssr' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress due to surface roughness +'ntsssr' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 67 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Universal thermal climate index 'utci' = { discipline = 20 ; @@ -8715,18 +8777,6 @@ parameterCategory = 1 ; parameterNumber = 68 ; } -#Momentum flux, u component -'uflx' = { - discipline = 0 ; - parameterCategory = 2 ; - parameterNumber = 17 ; - } -#Momentum flux, v component -'vflx' = { - discipline = 0 ; - parameterCategory = 2 ; - parameterNumber = 18 ; - } #Maximum wind speed 'maxgust' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/s2s/cfName.def b/definitions/grib2/localConcepts/s2s/cfName.def index 140e70741..ae98cc52f 100644 --- a/definitions/grib2/localConcepts/s2s/cfName.def +++ b/definitions/grib2/localConcepts/s2s/cfName.def @@ -6,6 +6,22 @@ parameterNumber = 0 ; typeOfFirstFixedSurface = 1 ; } +#Time-integrated eastward turbulent surface stress +'surface_downward_eastward_stress' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress +'surface_downward_northward_stress' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Sea surface practical salinity 'sea_surface_salinity' = { discipline = 10 ; diff --git a/definitions/grib2/localConcepts/s2s/cfVarName.def b/definitions/grib2/localConcepts/s2s/cfVarName.def index d3598d7d0..b9900970b 100644 --- a/definitions/grib2/localConcepts/s2s/cfVarName.def +++ b/definitions/grib2/localConcepts/s2s/cfVarName.def @@ -57,6 +57,22 @@ scaledValueOfFirstFixedSurface = 15 ; scaleFactorOfFirstFixedSurface = 1 ; } +#Time-integrated eastward turbulent surface stress +'ewss' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress +'nsss' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Mean sea water potential temperature in the upper 300 m 'mswpt300m' = { discipline = 10 ; diff --git a/definitions/grib2/localConcepts/s2s/name.def b/definitions/grib2/localConcepts/s2s/name.def index 3821406fa..478e0a7fa 100644 --- a/definitions/grib2/localConcepts/s2s/name.def +++ b/definitions/grib2/localConcepts/s2s/name.def @@ -57,6 +57,22 @@ scaledValueOfFirstFixedSurface = 15 ; scaleFactorOfFirstFixedSurface = 1 ; } +#Time-integrated eastward turbulent surface stress +'Time-integrated eastward turbulent surface stress' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress +'Time-integrated northward turbulent surface stress' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Mean sea water potential temperature in the upper 300 m 'Mean sea water potential temperature in the upper 300 m' = { discipline = 10 ; diff --git a/definitions/grib2/localConcepts/s2s/paramId.def b/definitions/grib2/localConcepts/s2s/paramId.def index ecd296acf..f9800fd85 100644 --- a/definitions/grib2/localConcepts/s2s/paramId.def +++ b/definitions/grib2/localConcepts/s2s/paramId.def @@ -57,6 +57,22 @@ scaledValueOfFirstFixedSurface = 15 ; scaleFactorOfFirstFixedSurface = 1 ; } +#Time-integrated eastward turbulent surface stress +'180' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress +'181' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Mean sea water potential temperature in the upper 300 m '151126' = { discipline = 10 ; diff --git a/definitions/grib2/localConcepts/s2s/shortName.def b/definitions/grib2/localConcepts/s2s/shortName.def index a9f3910a6..e200e018b 100644 --- a/definitions/grib2/localConcepts/s2s/shortName.def +++ b/definitions/grib2/localConcepts/s2s/shortName.def @@ -57,6 +57,22 @@ scaledValueOfFirstFixedSurface = 15 ; scaleFactorOfFirstFixedSurface = 1 ; } +#Time-integrated eastward turbulent surface stress +'ewss' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress +'nsss' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Mean sea water potential temperature in the upper 300 m 'mswpt300m' = { discipline = 10 ; diff --git a/definitions/grib2/localConcepts/s2s/units.def b/definitions/grib2/localConcepts/s2s/units.def index 3dbb1d7e8..c40b4c966 100644 --- a/definitions/grib2/localConcepts/s2s/units.def +++ b/definitions/grib2/localConcepts/s2s/units.def @@ -57,6 +57,22 @@ scaledValueOfFirstFixedSurface = 15 ; scaleFactorOfFirstFixedSurface = 1 ; } +#Time-integrated eastward turbulent surface stress +'N m**-2 s' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress +'N m**-2 s' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Mean sea water potential temperature in the upper 300 m 'K' = { discipline = 10 ; diff --git a/definitions/grib2/localConcepts/uerra/cfVarName.def b/definitions/grib2/localConcepts/uerra/cfVarName.def index a77e854d9..2b23e1570 100644 --- a/definitions/grib2/localConcepts/uerra/cfVarName.def +++ b/definitions/grib2/localConcepts/uerra/cfVarName.def @@ -148,6 +148,18 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Momentum flux, u component +'uflx' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + } +#Momentum flux, v component +'vflx' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + } #Standard deviation of sub-grid scale orography 'sdsgso' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/name.def b/definitions/grib2/localConcepts/uerra/name.def index 938e1072a..5a5c6865e 100644 --- a/definitions/grib2/localConcepts/uerra/name.def +++ b/definitions/grib2/localConcepts/uerra/name.def @@ -148,6 +148,18 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Momentum flux, u component +'Momentum flux, u component' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + } +#Momentum flux, v component +'Momentum flux, v component' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + } #Standard deviation of sub-grid scale orography 'Standard deviation of sub-grid scale orography' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/paramId.def b/definitions/grib2/localConcepts/uerra/paramId.def index 3db8ad4fa..2bd651ace 100644 --- a/definitions/grib2/localConcepts/uerra/paramId.def +++ b/definitions/grib2/localConcepts/uerra/paramId.def @@ -148,6 +148,18 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Momentum flux, u component +'260062' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + } +#Momentum flux, v component +'260063' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + } #Standard deviation of sub-grid scale orography '260085' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/shortName.def b/definitions/grib2/localConcepts/uerra/shortName.def index 9cbb74cd7..3c73c0761 100644 --- a/definitions/grib2/localConcepts/uerra/shortName.def +++ b/definitions/grib2/localConcepts/uerra/shortName.def @@ -148,6 +148,18 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Momentum flux, u component +'uflx' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + } +#Momentum flux, v component +'vflx' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + } #Standard deviation of sub-grid scale orography 'sdsgso' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/uerra/units.def b/definitions/grib2/localConcepts/uerra/units.def index aa1f30814..b84fdc016 100644 --- a/definitions/grib2/localConcepts/uerra/units.def +++ b/definitions/grib2/localConcepts/uerra/units.def @@ -148,6 +148,18 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Momentum flux, u component +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + } +#Momentum flux, v component +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + } #Standard deviation of sub-grid scale orography 'm' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index d852effb4..fa7ac3ad4 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -382,19 +382,19 @@ typeOfFirstFixedSurface = 8 ; typeOfStatisticalProcessing = 1 ; } -#Eastward turbulent surface stress -'Eastward turbulent surface stress' = { +#Time-integrated eastward turbulent surface stress +'Time-integrated eastward turbulent surface stress' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 38 ; + parameterNumber = 62 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Northward turbulent surface stress -'Northward turbulent surface stress' = { +#Time-integrated northward turbulent surface stress +'Time-integrated northward turbulent surface stress' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 37 ; + parameterNumber = 63 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } @@ -724,6 +724,20 @@ parameterCategory = 0 ; parameterNumber = 89 ; } +#U-component of atmospheric surface momentum flux +'U-component of atmospheric surface momentum flux' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 1 ; + } +#V-component of atmospheric surface momentum flux +'V-component of atmospheric surface momentum flux' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 1 ; + } #U-component of surface momentum flux into ocean 'U-component of surface momentum flux into ocean' = { discipline = 10 ; @@ -3745,6 +3759,22 @@ typeOfFirstFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Mean eastward turbulent surface stress +'Mean eastward turbulent surface stress' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 62 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Mean northward turbulent surface stress +'Mean northward turbulent surface stress' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 63 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Mean evaporation rate 'Mean evaporation rate' = { discipline = 0 ; @@ -4735,6 +4765,38 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 255 ; } +#Time-integrated eastward turbulent surface stress due to orographic form drag +'Time-integrated eastward turbulent surface stress due to orographic form drag' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 64 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress due to orographic form drag +'Time-integrated northward turbulent surface stress due to orographic form drag' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 65 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated eastward turbulent surface stress due to surface roughness +'Time-integrated eastward turbulent surface stress due to surface roughness' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress due to surface roughness +'Time-integrated northward turbulent surface stress due to surface roughness' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 67 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Universal thermal climate index 'Universal thermal climate index' = { discipline = 20 ; @@ -8715,18 +8777,6 @@ parameterCategory = 1 ; parameterNumber = 68 ; } -#Momentum flux, u component -'Momentum flux, u component' = { - discipline = 0 ; - parameterCategory = 2 ; - parameterNumber = 17 ; - } -#Momentum flux, v component -'Momentum flux, v component' = { - discipline = 0 ; - parameterCategory = 2 ; - parameterNumber = 18 ; - } #Maximum wind speed 'Maximum wind speed' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 1d0daf539..fe6cc8d80 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -382,19 +382,19 @@ typeOfFirstFixedSurface = 8 ; typeOfStatisticalProcessing = 1 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress '180' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 38 ; + parameterNumber = 62 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress '181' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 37 ; + parameterNumber = 63 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } @@ -724,6 +724,20 @@ parameterCategory = 0 ; parameterNumber = 89 ; } +#U-component of atmospheric surface momentum flux +'140101' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 1 ; + } +#V-component of atmospheric surface momentum flux +'140102' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 1 ; + } #U-component of surface momentum flux into ocean '140103' = { discipline = 10 ; @@ -3745,6 +3759,22 @@ typeOfFirstFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Mean eastward turbulent surface stress +'235041' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 62 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Mean northward turbulent surface stress +'235042' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 63 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Mean evaporation rate '235043' = { discipline = 0 ; @@ -4735,6 +4765,38 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 255 ; } +#Time-integrated eastward turbulent surface stress due to orographic form drag +'260652' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 64 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress due to orographic form drag +'260653' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 65 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated eastward turbulent surface stress due to surface roughness +'260654' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress due to surface roughness +'260655' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 67 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Universal thermal climate index '261001' = { discipline = 20 ; @@ -8715,18 +8777,6 @@ parameterCategory = 1 ; parameterNumber = 68 ; } -#Momentum flux, u component -'260062' = { - discipline = 0 ; - parameterCategory = 2 ; - parameterNumber = 17 ; - } -#Momentum flux, v component -'260063' = { - discipline = 0 ; - parameterCategory = 2 ; - parameterNumber = 18 ; - } #Maximum wind speed '260064' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 5070fb459..fa8bce2b8 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -382,19 +382,19 @@ typeOfFirstFixedSurface = 8 ; typeOfStatisticalProcessing = 1 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'ewss' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 38 ; + parameterNumber = 62 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'nsss' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 37 ; + parameterNumber = 63 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } @@ -724,6 +724,20 @@ parameterCategory = 0 ; parameterNumber = 89 ; } +#U-component of atmospheric surface momentum flux +'utaua' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 1 ; + } +#V-component of atmospheric surface momentum flux +'vtaua' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 1 ; + } #U-component of surface momentum flux into ocean 'utauo' = { discipline = 10 ; @@ -3745,6 +3759,22 @@ typeOfFirstFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Mean eastward turbulent surface stress +'metss' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 62 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Mean northward turbulent surface stress +'mntss' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 63 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Mean evaporation rate 'mer' = { discipline = 0 ; @@ -4735,6 +4765,38 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 255 ; } +#Time-integrated eastward turbulent surface stress due to orographic form drag +'etssofd' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 64 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress due to orographic form drag +'ntssofd' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 65 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated eastward turbulent surface stress due to surface roughness +'etsssr' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress due to surface roughness +'ntsssr' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 67 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Universal thermal climate index 'utci' = { discipline = 20 ; @@ -8715,18 +8777,6 @@ parameterCategory = 1 ; parameterNumber = 68 ; } -#Momentum flux, u component -'uflx' = { - discipline = 0 ; - parameterCategory = 2 ; - parameterNumber = 17 ; - } -#Momentum flux, v component -'vflx' = { - discipline = 0 ; - parameterCategory = 2 ; - parameterNumber = 18 ; - } #Maximum wind speed 'maxgust' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 37540142d..01d3201e0 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -382,19 +382,19 @@ typeOfFirstFixedSurface = 8 ; typeOfStatisticalProcessing = 1 ; } -#Eastward turbulent surface stress +#Time-integrated eastward turbulent surface stress 'N m**-2 s' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 38 ; + parameterNumber = 62 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Northward turbulent surface stress +#Time-integrated northward turbulent surface stress 'N m**-2 s' = { discipline = 0 ; parameterCategory = 2 ; - parameterNumber = 37 ; + parameterNumber = 63 ; typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } @@ -724,6 +724,20 @@ parameterCategory = 0 ; parameterNumber = 89 ; } +#U-component of atmospheric surface momentum flux +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 1 ; + } +#V-component of atmospheric surface momentum flux +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 1 ; + } #U-component of surface momentum flux into ocean 'N m**-2' = { discipline = 10 ; @@ -3745,6 +3759,22 @@ typeOfFirstFixedSurface = 8 ; typeOfStatisticalProcessing = 0 ; } +#Mean eastward turbulent surface stress +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 62 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#Mean northward turbulent surface stress +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 63 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Mean evaporation rate 'kg m**-2 s**-1' = { discipline = 0 ; @@ -4735,6 +4765,38 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 255 ; } +#Time-integrated eastward turbulent surface stress due to orographic form drag +'N m**-2 s' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 64 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress due to orographic form drag +'N m**-2 s' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 65 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated eastward turbulent surface stress due to surface roughness +'N m**-2 s' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated northward turbulent surface stress due to surface roughness +'N m**-2 s' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 67 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Universal thermal climate index 'K' = { discipline = 20 ; @@ -8715,18 +8777,6 @@ parameterCategory = 1 ; parameterNumber = 68 ; } -#Momentum flux, u component -'N m**-2' = { - discipline = 0 ; - parameterCategory = 2 ; - parameterNumber = 17 ; - } -#Momentum flux, v component -'N m**-2' = { - discipline = 0 ; - parameterCategory = 2 ; - parameterNumber = 18 ; - } #Maximum wind speed 'm s**-1' = { discipline = 0 ; From 32d3ce7b90f118a4e2ca2a76cc167330965b38de Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Fri, 20 Oct 2023 15:00:37 +0000 Subject: [PATCH 43/81] ECC-1691: Edited destineOrigin concept Small tweak to destineOrigin concept and test as aresult. --- .../destine/destineOriginConcept.def | 15 ++++++++------- tests/grib_ecc-1691.sh | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/definitions/grib2/localConcepts/destine/destineOriginConcept.def b/definitions/grib2/localConcepts/destine/destineOriginConcept.def index 041905d77..aabe1dca6 100644 --- a/definitions/grib2/localConcepts/destine/destineOriginConcept.def +++ b/definitions/grib2/localConcepts/destine/destineOriginConcept.def @@ -1,9 +1,10 @@ # Concept destineOrigin -"DWD" = { centre=98; subCentre=78; } -"MeteoFrance" = { centre=98; subCentre=84; } -"MPI-M" = { centre=98; subCentre=252; } -"AWI" = { centre=98; subCentre=253; } -"BSC" = { centre=98; subCentre=1000; } -"CSC" = { centre=98; subCentre=1001; } -"DKRZ" = { centre=98; subCentre=1002; } +"DWD" = { centre=98; subCentre=78; } +"Meteo-France" = { centre=98; subCentre=84; } +"Meteo-France" = { centre=98; subCentre=85; } +"MPI-M" = { centre=98; subCentre=252; } +"AWI" = { centre=98; subCentre=253; } +"BSC" = { centre=98; subCentre=1000; } +"CSC" = { centre=98; subCentre=1001; } +"DKRZ" = { centre=98; subCentre=1002; } "Climate DT consortium (CSC,AWI,BSC,MPI-M)" = { centre=98; subCentre=1003; } diff --git a/tests/grib_ecc-1691.sh b/tests/grib_ecc-1691.sh index 13263cb69..98578d83e 100755 --- a/tests/grib_ecc-1691.sh +++ b/tests/grib_ecc-1691.sh @@ -55,9 +55,9 @@ grib_check_key_exists $destine_sample destineOrigin,gridSpecification grib_check_key_equals $destine_sample "destineOrigin,gridSpecification" "unknown unknown" # Below mapping is for MeteoFrance -${tools_dir}/grib_set -s centre=98,subCentre=84 $destine_sample $temp_grib_a +${tools_dir}/grib_set -s centre=98,subCentre=85 $destine_sample $temp_grib_a -grib_check_key_equals $temp_grib_a "destineOrigin" "MeteoFrance" +grib_check_key_equals $temp_grib_a "destineOrigin" "Meteo-France" # Below mapping is for H1024 ${tools_dir}/grib_set -s numberOfDataPoints=12582912,gridDefinitionTemplateNumber=150,Nside=1024 $destine_sample $temp_grib_a From 4d57fc79fd4f761ade2f434e451f4b6737c0badd Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 20 Oct 2023 20:14:32 +0100 Subject: [PATCH 44/81] Dead code removal --- src/action.cc | 43 ++++++++++++++-------------- src/action_class_alias.cc | 22 ++------------ src/action_class_gen.cc | 10 ++----- src/action_class_if.cc | 8 ++---- src/action_class_modify.cc | 8 ++---- src/action_class_noop.cc | 9 ++---- src/action_class_remove.cc | 8 ++---- src/action_class_rename.cc | 9 ++---- src/action_class_section.cc | 19 ++---------- src/action_class_set.cc | 12 ++------ src/action_class_set_darray.cc | 9 ++---- src/action_class_set_sarray.cc | 12 ++------ src/action_class_switch.cc | 12 ++------ src/action_class_transient_darray.cc | 13 ++------- src/action_class_when.cc | 9 ++---- src/eccodes_prototypes.h | 2 -- 16 files changed, 50 insertions(+), 155 deletions(-) diff --git a/src/action.cc b/src/action.cc index 847862edc..026bca74e 100644 --- a/src/action.cc +++ b/src/action.cc @@ -98,22 +98,21 @@ static void grib_dump(grib_action* a, FILE* f, int l) DEBUG_ASSERT(0); } -void grib_xref(grib_action* a, FILE* f, const char* path) -{ - grib_action_class* c = a->cclass; - init(c); - - while (c) { - if (c->xref) { - c->xref(a, f, path); - return; - } - c = c->super ? *(c->super) : NULL; - } - printf("xref not implemented for %s\n", a->cclass->name); - DEBUG_ASSERT(0); -} +// void grib_xref(grib_action* a, FILE* f, const char* path) +// { +// grib_action_class* c = a->cclass; +// init(c); +// while (c) { +// if (c->xref) { +// c->xref(a, f, path); +// return; +// } +// c = c->super ? *(c->super) : NULL; +// } +// printf("xref not implemented for %s\n", a->cclass->name); +// DEBUG_ASSERT(0); +// } void grib_action_delete(grib_context* context, grib_action* a) { @@ -214,10 +213,10 @@ void grib_dump_action_tree(grib_context* ctx, FILE* out) grib_dump_action_branch(out, ctx->grib_reader->first->root, 0); } -void grib_xref_action_branch(FILE* out, grib_action* a, const char* path) -{ - while (a) { - grib_xref(a, out, path); - a = a->next; - } -} +// void grib_xref_action_branch(FILE* out, grib_action* a, const char* path) +// { +// while (a) { +// grib_xref(a, out, path); +// a = a->next; +// } +// } diff --git a/src/action_class_alias.cc b/src/action_class_alias.cc index 945d3aa7a..014a3f47c 100644 --- a/src/action_class_alias.cc +++ b/src/action_class_alias.cc @@ -19,7 +19,7 @@ START_CLASS_DEF CLASS = action IMPLEMENTS = create_accessor - IMPLEMENTS = dump;xref + IMPLEMENTS = dump IMPLEMENTS = destroy MEMBERS = char* target END_CLASS_DEF @@ -38,7 +38,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int create_accessor(grib_section*,grib_action*,grib_loader*); @@ -60,7 +59,7 @@ static grib_action_class _grib_action_class_alias = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ &create_accessor, /* create_accessor*/ @@ -268,23 +267,6 @@ static void dump(grib_action* act, FILE* f, int lvl) grib_context_print(act->context, f, " unalias %s \n", act->name); } -static void xref(grib_action* act, FILE* f, const char* path) -{ - Assert(!"xref is disabled"); - - // grib_action_alias* a = (grib_action_alias*)act; - // if (a->target) { - // fprintf(f, "bless({name=>'%s', target=>'%s', path=>'%s'},'xref::alias'),\n", act->name, a->target, path); - // if (act->name_space) - // fprintf(f, "bless({name=>'%s.%s', target=>'%s', path=>'%s'},'xref::alias'),\n", act->name_space, act->name, a->target, path); - // } - // else { - // fprintf(f, "bless({name=>'%s', path=>'%s'},'xref::unalias'),\n", act->name, path); - // if (act->name_space) - // fprintf(f, "bless({name=>'%s.%s', path=>'%s'},'xref::unalias'),\n", act->name_space, act->name, path); - // } -} - static void destroy(grib_context* context, grib_action* act) { grib_action_alias* a = (grib_action_alias*)act; diff --git a/src/action_class_gen.cc b/src/action_class_gen.cc index 8c5945889..641aa3c92 100644 --- a/src/action_class_gen.cc +++ b/src/action_class_gen.cc @@ -19,7 +19,7 @@ START_CLASS_DEF CLASS = action IMPLEMENTS = create_accessor - IMPLEMENTS = dump;xref + IMPLEMENTS = dump IMPLEMENTS = destroy IMPLEMENTS = notify_change MEMBERS = long len @@ -40,7 +40,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int create_accessor(grib_section*,grib_action*,grib_loader*); static int notify_change(grib_action* a, grib_accessor* observer,grib_accessor* observed); @@ -64,7 +63,7 @@ static grib_action_class _grib_action_class_gen = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ &create_accessor, /* create_accessor*/ @@ -130,11 +129,6 @@ static void dump(grib_action* act, FILE* f, int lvl) // For xref implementation see // src/deprecated/action_class_gen.cc -static void xref(grib_action* act, FILE* f, const char* path) -{ - Assert(!"xref is disabled"); -} - static int create_accessor(grib_section* p, grib_action* act, grib_loader* loader) { grib_action_gen* a = (grib_action_gen*)act; diff --git a/src/action_class_if.cc b/src/action_class_if.cc index 4c94549af..a5d28725a 100644 --- a/src/action_class_if.cc +++ b/src/action_class_if.cc @@ -22,7 +22,6 @@ IMPLEMENTS = create_accessor IMPLEMENTS = dump IMPLEMENTS = destroy - IMPLEMENTS = xref IMPLEMENTS = reparse;execute MEMBERS = grib_expression *expression MEMBERS = grib_action *block_true @@ -44,7 +43,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int create_accessor(grib_section*,grib_action*,grib_loader*); static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit); @@ -73,7 +71,7 @@ static grib_action_class _grib_action_class_if = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ &create_accessor, /* create_accessor*/ @@ -86,6 +84,7 @@ grib_action_class* grib_action_class_if = &_grib_action_class_if; static void init_class(grib_action_class* c) { + c->xref = (*(c->super))->xref; c->notify_change = (*(c->super))->notify_change; } /* END_CLASS_IMP */ @@ -306,6 +305,3 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f, const char* path) -{ -} diff --git a/src/action_class_modify.cc b/src/action_class_modify.cc index c379d7300..ef09a3c96 100644 --- a/src/action_class_modify.cc +++ b/src/action_class_modify.cc @@ -17,7 +17,7 @@ START_CLASS_DEF CLASS = action - IMPLEMENTS = dump;xref + IMPLEMENTS = dump IMPLEMENTS = create_accessor IMPLEMENTS = destroy MEMBERS = long flags @@ -38,7 +38,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int create_accessor(grib_section*,grib_action*,grib_loader*); @@ -61,7 +60,7 @@ static grib_action_class _grib_action_class_modify = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ &create_accessor, /* create_accessor*/ @@ -128,6 +127,3 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f, const char* path) -{ -} diff --git a/src/action_class_noop.cc b/src/action_class_noop.cc index c2b3bc2f0..d4d2ff133 100644 --- a/src/action_class_noop.cc +++ b/src/action_class_noop.cc @@ -17,7 +17,7 @@ START_CLASS_DEF CLASS = action - IMPLEMENTS = dump;destroy;xref;execute + IMPLEMENTS = dump;destroy;execute END_CLASS_DEF */ @@ -34,7 +34,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int execute(grib_action* a,grib_handle* h); @@ -55,7 +54,7 @@ static grib_action_class _grib_action_class_noop = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ 0, /* create_accessor*/ @@ -101,10 +100,6 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f, const char* path) -{ -} - static int execute(grib_action* act, grib_handle* h) { return 0; diff --git a/src/action_class_remove.cc b/src/action_class_remove.cc index 853a1a648..26ab6760b 100644 --- a/src/action_class_remove.cc +++ b/src/action_class_remove.cc @@ -19,7 +19,7 @@ CLASS = action IMPLEMENTS = create_accessor IMPLEMENTS = dump - IMPLEMENTS = destroy; xref + IMPLEMENTS = destroy MEMBERS = grib_arguments* args END_CLASS_DEF @@ -37,7 +37,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int create_accessor(grib_section*,grib_action*,grib_loader*); @@ -59,7 +58,7 @@ static grib_action_class _grib_action_class_remove = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ &create_accessor, /* create_accessor*/ @@ -153,6 +152,3 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f, const char* path) -{ -} diff --git a/src/action_class_rename.cc b/src/action_class_rename.cc index 2666c4f75..b6533895e 100644 --- a/src/action_class_rename.cc +++ b/src/action_class_rename.cc @@ -19,7 +19,7 @@ CLASS = action IMPLEMENTS = create_accessor IMPLEMENTS = dump - IMPLEMENTS = destroy; xref + IMPLEMENTS = destroy MEMBERS = char* the_old MEMBERS = char* the_new END_CLASS_DEF @@ -38,7 +38,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int create_accessor(grib_section*,grib_action*,grib_loader*); @@ -61,7 +60,7 @@ static grib_action_class _grib_action_class_rename = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ &create_accessor, /* create_accessor*/ @@ -148,7 +147,3 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } - -static void xref(grib_action* d, FILE* f, const char* path) -{ -} diff --git a/src/action_class_section.cc b/src/action_class_section.cc index 6f9cd5836..9dda3dc30 100644 --- a/src/action_class_section.cc +++ b/src/action_class_section.cc @@ -19,8 +19,6 @@ START_CLASS_DEF CLASS = action IMPLEMENTS = notify_change - IMPLEMENTS = reparse - IMPLEMENTS = xref END_CLASS_DEF */ @@ -36,9 +34,7 @@ or edit "action.class" and rerun ./make_class.pl */ static void init_class (grib_action_class*); -static void xref (grib_action* d, FILE* f,const char* path); static int notify_change(grib_action* a, grib_accessor* observer,grib_accessor* observed); -static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit); typedef struct grib_action_section { @@ -57,12 +53,12 @@ static grib_action_class _grib_action_class_section = { 0, /* destroy */ 0, /* dump */ - &xref, /* xref */ + 0, /* xref */ 0, /* create_accessor*/ ¬ify_change, /* notify_change */ - &reparse, /* reparse */ + 0, /* reparse */ 0, /* execute */ }; @@ -231,14 +227,3 @@ static int notify_change(grib_action* act, grib_accessor* notified, return GRIB_SUCCESS; } - -static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit) -{ - fprintf(stderr, "action_class_section::reparse should be inherited: %s\n", a->name); - Assert(0); - return 0; -} - -static void xref(grib_action* d, FILE* f, const char* path) -{ -} diff --git a/src/action_class_set.cc b/src/action_class_set.cc index 8febce99d..1068181d5 100644 --- a/src/action_class_set.cc +++ b/src/action_class_set.cc @@ -8,16 +8,13 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************************************************************** - * Enrico Fucile * - ***************************************************************************/ #include "grib_api_internal.h" /* This is used by make_class.pl START_CLASS_DEF CLASS = action - IMPLEMENTS = dump;xref + IMPLEMENTS = dump IMPLEMENTS = destroy;execute MEMBERS = grib_expression *expression MEMBERS = char *name @@ -38,7 +35,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int execute(grib_action* a,grib_handle* h); @@ -62,7 +58,7 @@ static grib_action_class _grib_action_class_set = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ 0, /* create_accessor*/ @@ -135,7 +131,3 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } - -static void xref(grib_action* d, FILE* f, const char* path) -{ -} diff --git a/src/action_class_set_darray.cc b/src/action_class_set_darray.cc index 43d249594..97211a219 100644 --- a/src/action_class_set_darray.cc +++ b/src/action_class_set_darray.cc @@ -14,7 +14,7 @@ START_CLASS_DEF CLASS = action - IMPLEMENTS = dump;xref + IMPLEMENTS = dump IMPLEMENTS = destroy;execute MEMBERS = grib_darray *darray MEMBERS = char *name @@ -34,7 +34,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int execute(grib_action* a,grib_handle* h); @@ -57,7 +56,7 @@ static grib_action_class _grib_action_class_set_darray = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ 0, /* create_accessor*/ @@ -123,7 +122,3 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } - -static void xref(grib_action* d, FILE* f, const char* path) -{ -} diff --git a/src/action_class_set_sarray.cc b/src/action_class_set_sarray.cc index b12443f23..3b670aa87 100644 --- a/src/action_class_set_sarray.cc +++ b/src/action_class_set_sarray.cc @@ -8,16 +8,13 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************************************************************** - * Enrico Fucile * - ***************************************************************************/ #include "grib_api_internal.h" /* This is used by make_class.pl START_CLASS_DEF CLASS = action - IMPLEMENTS = dump;xref + IMPLEMENTS = dump IMPLEMENTS = destroy;execute MEMBERS = grib_sarray *sarray MEMBERS = char *name @@ -37,7 +34,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int execute(grib_action* a,grib_handle* h); @@ -60,7 +56,7 @@ static grib_action_class _grib_action_class_set_sarray = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ 0, /* create_accessor*/ @@ -127,7 +123,3 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } - -static void xref(grib_action* d, FILE* f, const char* path) -{ -} diff --git a/src/action_class_switch.cc b/src/action_class_switch.cc index 57e47dc89..b116aa846 100644 --- a/src/action_class_switch.cc +++ b/src/action_class_switch.cc @@ -8,9 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************************************************************** - * Enrico Fucile * - ***************************************************************************/ #include "grib_api_internal.h" /* This is used by make_class.pl @@ -19,7 +16,6 @@ CLASS = action SUPER = action_class_section IMPLEMENTS = destroy - IMPLEMENTS = xref IMPLEMENTS = execute MEMBERS = grib_arguments* args MEMBERS = grib_case *Case @@ -39,7 +35,6 @@ or edit "action.class" and rerun ./make_class.pl */ static void init_class (grib_action_class*); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int execute(grib_action* a,grib_handle* h); @@ -65,7 +60,7 @@ static grib_action_class _grib_action_class_switch = { &destroy, /* destroy */ 0, /* dump */ - &xref, /* xref */ + 0, /* xref */ 0, /* create_accessor*/ @@ -79,6 +74,7 @@ grib_action_class* grib_action_class_switch = &_grib_action_class_switch; static void init_class(grib_action_class* c) { c->dump = (*(c->super))->dump; + c->xref = (*(c->super))->xref; c->create_accessor = (*(c->super))->create_accessor; c->notify_change = (*(c->super))->notify_change; c->reparse = (*(c->super))->reparse; @@ -240,7 +236,3 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } - -static void xref(grib_action* d, FILE* f, const char* path) -{ -} diff --git a/src/action_class_transient_darray.cc b/src/action_class_transient_darray.cc index ce4e514f9..9990beb41 100644 --- a/src/action_class_transient_darray.cc +++ b/src/action_class_transient_darray.cc @@ -8,9 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************************************************************** - * Enrico Fucile * - ***************************************************************************/ #include "grib_api_internal.h" /* This is used by make_class.pl @@ -18,7 +15,7 @@ START_CLASS_DEF CLASS = action SUPER = action_class_gen - IMPLEMENTS = dump;xref + IMPLEMENTS = dump IMPLEMENTS = destroy;execute MEMBERS = grib_darray *darray MEMBERS = char *name @@ -38,7 +35,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int execute(grib_action* a,grib_handle* h); @@ -65,7 +61,7 @@ static grib_action_class _grib_action_class_transient_darray = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ 0, /* create_accessor*/ @@ -78,6 +74,7 @@ grib_action_class* grib_action_class_transient_darray = &_grib_action_class_tran static void init_class(grib_action_class* c) { + c->xref = (*(c->super))->xref; c->create_accessor = (*(c->super))->create_accessor; c->notify_change = (*(c->super))->notify_change; c->reparse = (*(c->super))->reparse; @@ -140,7 +137,3 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, a->name); grib_darray_delete(context, a->darray); } - -static void xref(grib_action* d, FILE* f, const char* path) -{ -} diff --git a/src/action_class_when.cc b/src/action_class_when.cc index a274a7c27..49fc325be 100644 --- a/src/action_class_when.cc +++ b/src/action_class_when.cc @@ -18,7 +18,7 @@ START_CLASS_DEF CLASS = action IMPLEMENTS = create_accessor - IMPLEMENTS = dump;xref + IMPLEMENTS = dump IMPLEMENTS = destroy;notify_change MEMBERS = grib_expression *expression MEMBERS = grib_action *block_true @@ -40,7 +40,6 @@ or edit "action.class" and rerun ./make_class.pl static void init_class (grib_action_class*); static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); static void destroy (grib_context*,grib_action*); static int create_accessor(grib_section*,grib_action*,grib_loader*); static int notify_change(grib_action* a, grib_accessor* observer,grib_accessor* observed); @@ -66,7 +65,7 @@ static grib_action_class _grib_action_class_when = { &destroy, /* destroy */ &dump, /* dump */ - &xref, /* xref */ + 0, /* xref */ &create_accessor, /* create_accessor*/ @@ -232,7 +231,3 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } - -static void xref(grib_action* d, FILE* f, const char* path) -{ -} diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index cf0985e86..ecdd83633 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -5,7 +5,6 @@ #endif /* action.cc */ -void grib_xref(grib_action* a, FILE* f, const char* path); void grib_action_delete(grib_context* context, grib_action* a); int grib_create_accessor(grib_section* p, grib_action* a, grib_loader* h); int grib_action_notify_change(grib_action* a, grib_accessor* observer, grib_accessor* observed); @@ -13,7 +12,6 @@ grib_action* grib_action_reparse(grib_action* a, grib_accessor* acc, int* doit); int grib_action_execute(grib_action* a, grib_handle* h); void grib_dump_action_branch(FILE* out, grib_action* a, int decay); void grib_dump_action_tree(grib_context* ctx, FILE* out); -void grib_xref_action_branch(FILE* out, grib_action* a, const char* path); /* action_class_alias.cc */ grib_action* grib_action_create_alias(grib_context* context, const char* name, const char* arg1, const char* name_space, int flags); From fbce17e52ba20200123576272a711f4395bca688 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 21 Oct 2023 13:55:27 +0100 Subject: [PATCH 45/81] Testing: Comparing thru indexes --- tests/grib_indexing.sh | 26 +++++++++++++++++++++++++- tools/grib_tools.cc | 20 ++++++++++---------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/tests/grib_indexing.sh b/tests/grib_indexing.sh index 453208f62..ee356393d 100755 --- a/tests/grib_indexing.sh +++ b/tests/grib_indexing.sh @@ -13,6 +13,7 @@ label="grib_indexing_test" temp=temp.$label.index.out infile=${data_dir}/index.grib +sample1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl # Writes to "out.gribidx" $EXEC ${test_dir}/grib_indexing ${infile} > $temp @@ -109,9 +110,32 @@ ${tools_dir}/grib_index_build -N -o $tempIndex2 $tempGribFile2 ${tools_dir}/grib_compare -v $tempIndex1 $tempIndex2 rm -f $tempIndex1 $tempIndex2 $tempGribFile1 $tempGribFile2 +# Indexes containing different keys +${tools_dir}/grib_index_build -k date,time -N -o $tempIndex1 $sample1 +${tools_dir}/grib_index_build -k level -N -o $tempIndex2 $sample1 +set +e +${tools_dir}/grib_compare -v $tempIndex1 $tempIndex2 2>$tempOut +status=$? +set -e +[ $status -ne 0 ] +cat $tempOut +grep -q "Indexes contained in the input files have different keys" $tempOut +rm -f $tempIndex1 $tempIndex2 $tempOut + + +${tools_dir}/grib_index_build -k date,time -N -o $tempIndex1 $sample1 +${tools_dir}/grib_index_build -k date,time,level -N -o $tempIndex2 $sample1 +set +e +${tools_dir}/grib_compare -v $tempIndex2 $tempIndex1 2>$tempOut +status=$? +set -e +[ $status -ne 0 ] +cat $tempOut +grep -q "Indexes contained in the input files have different keys" $tempOut +rm -f $tempIndex1 $tempIndex2 $tempOut + # ECC-1516 # --------- -sample1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl ${tools_dir}/grib_index_build -N -o $tempIndex1 $sample1 > /dev/null ${tools_dir}/grib_dump $tempIndex1 >/dev/null diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index ce038d07f..72122fbd1 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -511,17 +511,17 @@ static int grib_tool_index(grib_runtime_options* options) k2 = k2->next; } if (!found) { - printf("Indexes contained in the input files have different keys\n"); - printf("keys in file %s:\n", f1); + fprintf(stderr, "Indexes contained in the input files have different keys!\n"); + fprintf(stderr, "keys in file %s:\n", f1); k1 = options->index1->keys; while (k1) { - printf("\t%s\n", k1->name); + fprintf(stderr, "\t%s\n", k1->name); k1 = k1->next; } - printf("keys in file %s:\n", f2); + fprintf(stderr, "keys in file %s:\n", f2); k2 = options->index2->keys; while (k2) { - printf("\t%s\n", k2->name); + fprintf(stderr, "\t%s\n", k2->name); k2 = k2->next; } exit(1); @@ -543,17 +543,17 @@ static int grib_tool_index(grib_runtime_options* options) k1 = k1->next; } if (!found) { - printf("Indexes contained in the input files have different keys\n"); - printf("keys in file %s:\n", f2); + fprintf(stderr,"Indexes contained in the input files have different keys!\n"); + fprintf(stderr, "keys in file %s:\n", f2); k2 = options->index2->keys; while (k2) { - printf("\t%s\n", k2->name); + fprintf(stderr, "\t%s\n", k2->name); k2 = k2->next; } - printf("keys in file %s:\n", f1); + fprintf(stderr, "keys in file %s:\n", f1); k1 = options->index1->keys; while (k1) { - printf("\t%s\n", k1->name); + fprintf(stderr, "\t%s\n", k1->name); k1 = k1->next; } From b2039a90ac48b8c81f44de9081f7dafc38f3d114 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 21 Oct 2023 14:39:17 +0100 Subject: [PATCH 46/81] Testing: Indexing with directory traversal --- tests/grib_indexing.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/grib_indexing.sh b/tests/grib_indexing.sh index ee356393d..5fe1460ff 100755 --- a/tests/grib_indexing.sh +++ b/tests/grib_indexing.sh @@ -134,6 +134,22 @@ cat $tempOut grep -q "Indexes contained in the input files have different keys" $tempOut rm -f $tempIndex1 $tempIndex2 $tempOut +# Indexing with directory traversal +# ---------------------------------- +temp_dir_A=tempdir.$label +temp_dir_B=tempdir.$label/subdir.$label +rm -rf $temp_dir_A +mkdir $temp_dir_A +mkdir $temp_dir_B +cp ${data_dir}/tigge/tigge_rjtd_pl_*grib $temp_dir_A +cp ${data_dir}/tigge/tigge_rjtd_sfc_*grib $temp_dir_B + +${tools_dir}/grib_index_build -o $tempIndex1 $temp_dir_A +${tools_dir}/grib_dump $tempIndex1 + +rm -rf $temp_dir_A + + # ECC-1516 # --------- ${tools_dir}/grib_index_build -N -o $tempIndex1 $sample1 > /dev/null From 5be62bbcd2b5f4b6ccb2ca5240e1e4e37a60ce06 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 23 Oct 2023 16:04:01 +0100 Subject: [PATCH 47/81] Testing: string_compare --- tests/grib_filter.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/grib_filter.sh b/tests/grib_filter.sh index 6a7ebb38f..22a0158ac 100755 --- a/tests/grib_filter.sh +++ b/tests/grib_filter.sh @@ -383,9 +383,20 @@ cat >$tempFilt < $tempOut -cat $tempOut grep "MISSING" $tempOut +# Test string_compare +cat >$tempFilt < $tempOut 2>&1 +cat $tempOut +grep "rubbish must fail" $tempOut +grep "garbage must fail" $tempOut +grep "unable to get rubbish as string" $tempOut +grep "unable to get garbage as string" $tempOut + # Clean up rm -f $tempGrib $tempFilt $tempOut $tempRef From 0fc243aea74bde81f997a4301ec80618610bbf56 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 23 Oct 2023 16:32:56 +0100 Subject: [PATCH 48/81] Error messages --- src/grib_fieldset.cc | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/src/grib_fieldset.cc b/src/grib_fieldset.cc index 88eabeb7b..72cb928c6 100644 --- a/src/grib_fieldset.cc +++ b/src/grib_fieldset.cc @@ -73,8 +73,7 @@ int grib_fieldset_new_column(grib_fieldset* set, int id, char* key, int type) set->columns[id].long_values = (long*)grib_context_malloc_clear(c, sizeof(long) * GRIB_START_ARRAY_SIZE); if (!set->columns[id].long_values) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_new_column: Cannot malloc %ld bytes", - sizeof(long) * GRIB_START_ARRAY_SIZE); + "%s: Error allocating %zu bytes", __func__, sizeof(long) * GRIB_START_ARRAY_SIZE); err = GRIB_OUT_OF_MEMORY; return err; } @@ -83,8 +82,7 @@ int grib_fieldset_new_column(grib_fieldset* set, int id, char* key, int type) set->columns[id].double_values = (double*)grib_context_malloc_clear(c, sizeof(double) * GRIB_START_ARRAY_SIZE); if (!set->columns[id].double_values) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_new_column: Cannot malloc %ld bytes", - sizeof(double) * GRIB_START_ARRAY_SIZE); + "%s: Error allocating %zu bytes", __func__, sizeof(double) * GRIB_START_ARRAY_SIZE); err = GRIB_OUT_OF_MEMORY; return err; } @@ -93,8 +91,7 @@ int grib_fieldset_new_column(grib_fieldset* set, int id, char* key, int type) set->columns[id].string_values = (char**)grib_context_malloc_clear(c, sizeof(char*) * GRIB_START_ARRAY_SIZE); if (!set->columns[id].string_values) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_new_column: Cannot malloc %ld bytes", - sizeof(char*) * GRIB_START_ARRAY_SIZE); + "%s: Error allocating %zu bytes", __func__, sizeof(char*) * GRIB_START_ARRAY_SIZE); err = GRIB_OUT_OF_MEMORY; return err; } @@ -171,8 +168,7 @@ static int grib_fieldset_columns_resize(grib_fieldset* set, size_t newsize) newsize * sizeof(long)); if (!newlongs) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_columns_resize: Cannot malloc %ld bytes", - newsize - set->columns[i].values_array_size); + "%s: Error allocating %zu bytes", __func__, newsize - set->columns[i].values_array_size); return GRIB_OUT_OF_MEMORY; } else @@ -183,8 +179,7 @@ static int grib_fieldset_columns_resize(grib_fieldset* set, size_t newsize) newsize * sizeof(double)); if (!newdoubles) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_columns_resize: Cannot malloc %ld bytes", - newsize - set->columns[i].values_array_size); + "%s: Error allocating %zu bytes", __func__, newsize - set->columns[i].values_array_size); return GRIB_OUT_OF_MEMORY; } else @@ -195,8 +190,7 @@ static int grib_fieldset_columns_resize(grib_fieldset* set, size_t newsize) newsize * sizeof(char*)); if (!newstrings) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_columns_resize: Cannot malloc %ld bytes", - newsize - set->columns[i].values_array_size); + "%s: Error allocating %zu bytes", __func__, newsize - set->columns[i].values_array_size); return GRIB_OUT_OF_MEMORY; } else @@ -206,8 +200,7 @@ static int grib_fieldset_columns_resize(grib_fieldset* set, size_t newsize) newerrors = (int*)grib_context_realloc(c, set->columns[i].errors, newsize * sizeof(int)); if (!newerrors) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_columns_resize: Cannot malloc %ld bytes", - newsize * sizeof(int)); + "%s: Error allocating %zu bytes", __func__, newsize * sizeof(int)); return GRIB_OUT_OF_MEMORY; } else @@ -332,8 +325,7 @@ static grib_fieldset* grib_fieldset_create_from_keys(grib_context* c, const char msize = sizeof(grib_fieldset); set = (grib_fieldset*)grib_context_malloc_clear(c, msize); if (!set) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_create_from_keys: Cannot malloc %lu bytes", msize); + grib_context_log(c, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", __func__, msize); return NULL; } @@ -357,7 +349,7 @@ static grib_fieldset* grib_fieldset_create_from_keys(grib_context* c, const char set->columns = (grib_column*)grib_context_malloc_clear(c, sizeof(grib_column) * nkeys); if (!set->columns) { - grib_context_log(c, GRIB_LOG_ERROR, "grib_fieldset_create_from_keys: memory allocation error"); + grib_context_log(c, GRIB_LOG_ERROR, "%s: memory allocation error", __func__); *err = GRIB_OUT_OF_MEMORY; return NULL; } @@ -417,7 +409,6 @@ int grib_fieldset_apply_where(grib_fieldset* set, const char* where_string) // grib_math* m = NULL; // m = grib_math_new(set->context, where_string, &err); // if (err || !m) return err; - // print_math(m); // printf("\n"); // grib_math_delete(set->context, m); @@ -816,8 +807,7 @@ static int grib_fieldset_resize_int_array(grib_int_array* a, size_t newsize) el = (int*)grib_context_realloc(a->context, a->el, newsize); if (!el) { grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_fieldset_resize_int_array: Cannot malloc %lu bytes", - newsize); + "%s: Error allocating %zu bytes", __func__, newsize); return GRIB_OUT_OF_MEMORY; } else @@ -860,8 +850,7 @@ static int grib_fieldset_resize_fields(grib_fieldset* set, size_t newsize) fields = (grib_field**)grib_context_realloc(set->context, set->fields, newsize * sizeof(grib_field*)); if (!fields) { grib_context_log(set->context, GRIB_LOG_ERROR, - "grib_fieldset_resize_fields: Cannot malloc %lu bytes", - newsize * sizeof(grib_field*)); + "%s: Error allocating %zu bytes", __func__, newsize * sizeof(grib_field*)); return GRIB_OUT_OF_MEMORY; } else From 332461b3e66c1d43aed59c81ce08d72e74fdda5f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 24 Oct 2023 12:23:51 +0100 Subject: [PATCH 49/81] SUP-3879: Potential buffer overflow on projection functions --- src/grib_accessor_class_proj_string.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/grib_accessor_class_proj_string.cc b/src/grib_accessor_class_proj_string.cc index ffd5ed831..00b25c6a3 100644 --- a/src/grib_accessor_class_proj_string.cc +++ b/src/grib_accessor_class_proj_string.cc @@ -161,7 +161,7 @@ static int proj_space_view(grib_handle* h, char* result) { return GRIB_NOT_IMPLEMENTED; // int err = 0; - // char shape[64] = {0,}; + // char shape[128] = {0,}; // double latOfSubSatellitePointInDegrees, lonOfSubSatellitePointInDegrees; // if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) // return err; @@ -190,7 +190,7 @@ static int proj_equatorial_azimuthal_equidistant(grib_handle* h, char* result) static int proj_lambert_conformal(grib_handle* h, char* result) { int err = 0; - char shape[64] = {0,}; + char shape[128] = {0,}; double LoVInDegrees = 0, LaDInDegrees = 0, Latin1InDegrees = 0, Latin2InDegrees = 0; if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) @@ -211,7 +211,7 @@ static int proj_lambert_conformal(grib_handle* h, char* result) static int proj_lambert_azimuthal_equal_area(grib_handle* h, char* result) { int err = 0; - char shape[64] = {0,}; + char shape[128] = {0,}; double standardParallel = 0, centralLongitude = 0; if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) @@ -231,7 +231,7 @@ static int proj_polar_stereographic(grib_handle* h, char* result) double centralLongitude = 0, centralLatitude = 0; int has_northPole = 0; long projectionCentreFlag = 0; - char shape[64] = {0,}; + char shape[128] = {0,}; if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) return err; @@ -252,7 +252,7 @@ static int proj_polar_stereographic(grib_handle* h, char* result) static int proj_unprojected(grib_handle* h, char* result) { int err = 0; - //char shape[64] = {0,}; + //char shape[128] = {0,}; //if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) return err; //snprintf(result, 1024, "+proj=longlat %s", shape); snprintf(result, 1024, "+proj=longlat +datum=WGS84 +no_defs +type=crs"); @@ -264,7 +264,7 @@ static int proj_mercator(grib_handle* h, char* result) { int err = 0; double LaDInDegrees = 0; - char shape[64] = {0,}; + char shape[128] = {0,}; if ((err = grib_get_double_internal(h, "LaDInDegrees", &LaDInDegrees)) != GRIB_SUCCESS) return err; From b94723f9ea59ee46173a06221c1fa79d7756c316 Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Tue, 24 Oct 2023 12:39:51 +0000 Subject: [PATCH 50/81] ECC-1691: Revert underscores to dashes in dataset FDB will support this by the end of the week. --- definitions/grib2/destine_dataset.table | 8 ++++---- ...ine.climate_dt.def => local.destine.climate-dt.def} | 0 tests/grib_ecc-1691.sh | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) rename definitions/grib2/{local.destine.climate_dt.def => local.destine.climate-dt.def} (100%) diff --git a/definitions/grib2/destine_dataset.table b/definitions/grib2/destine_dataset.table index 4690b4bab..58b82fc41 100644 --- a/definitions/grib2/destine_dataset.table +++ b/definitions/grib2/destine_dataset.table @@ -1,6 +1,6 @@ 0 unknown unknown -1 climate_dt Climate change adaptation digital twin -2 extremes_dt Weather and geophysical extremes digital twin -3 on_demand_climate_dt On-demand climate change adaptation digital twin -4 on_demand_extremes_dt On-demand weather and geophysical extremes digital twin +1 climate-dt Climate change adaptation digital twin +2 extremes-dt Weather and geophysical extremes digital twin +3 on-demand-climate-dt On-demand climate change adaptation digital twin +4 on-demand-extremes-dt On-demand weather and geophysical extremes digital twin 65535 65535 Missing diff --git a/definitions/grib2/local.destine.climate_dt.def b/definitions/grib2/local.destine.climate-dt.def similarity index 100% rename from definitions/grib2/local.destine.climate_dt.def rename to definitions/grib2/local.destine.climate-dt.def diff --git a/tests/grib_ecc-1691.sh b/tests/grib_ecc-1691.sh index 98578d83e..38a9a1603 100755 --- a/tests/grib_ecc-1691.sh +++ b/tests/grib_ecc-1691.sh @@ -33,22 +33,22 @@ ${tools_dir}/grib_set -s productionStatusOfProcessedData=12,class=d1 $temp_grib_ grib_check_key_exists $destine_sample destineLocalVersion,dataset,marsClass,marsType,marsStream,experimentVersionNumber grib_check_key_equals $destine_sample "marsClass,dataset,destineLocalVersion" "d1 0 1" -# Check setting dataset to climate_dt (1). Check keys are present and equal defaults +# Check setting dataset to climate-dt (1). Check keys are present and equal defaults ${tools_dir}/grib_set -s dataset=1 $destine_sample $temp_grib_a grib_check_key_exists $temp_grib_a dataset,generation,activity,experiment,model,realization,resolution grib_check_key_equals $temp_grib_a "dataset,generation,activity,experiment,model,realization,resolution" "1 255 0 0 0 255 0" -# Check an example where a few additional things are set in climate_dt +# Check an example where a few additional things are set in climate-dt ${tools_dir}/grib_set -s dataset=1,generation=2,activity=1,experiment=1,model=2,realization=1,resolution=1 $destine_sample $temp_grib_a grib_check_key_equals $temp_grib_a "dataset,generation,activity,experiment,model,realization,resolution" "1 2 1 1 2 1 1" -grib_check_key_equals $temp_grib_a "dataset:s,activity:s,experiment:s,model:s,resolution:s" "climate_dt CMIP6 hist IFS-NEMO standard" +grib_check_key_equals $temp_grib_a "dataset:s,activity:s,experiment:s,model:s,resolution:s" "climate-dt CMIP6 hist IFS-NEMO standard" -# Check setting dataset to extremes_dt (2). This time we will check string also +# Check setting dataset to extremes-dt (2). This time we will check string also ${tools_dir}/grib_set -s dataset=2 $destine_sample $temp_grib_a -grib_check_key_equals $temp_grib_a "dataset,dataset:s" "2 extremes_dt" +grib_check_key_equals $temp_grib_a "dataset,dataset:s" "2 extremes-dt" # Check concepts. First check default value and then example of mapping grib_check_key_exists $destine_sample destineOrigin,gridSpecification From 5c177ae2dad1b03b5fcea94317e9e7d025218c3a Mon Sep 17 00:00:00 2001 From: Pedro Maciel Date: Tue, 24 Oct 2023 18:07:43 +0100 Subject: [PATCH 51/81] gridType=mercator fix --- src/grib_iterator_class_mercator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grib_iterator_class_mercator.cc b/src/grib_iterator_class_mercator.cc index 19d7195ff..ca94b3140 100644 --- a/src/grib_iterator_class_mercator.cc +++ b/src/grib_iterator_class_mercator.cc @@ -199,7 +199,7 @@ static int init_mercator(grib_handle* h, false_easting = x0; false_northing = y0; for (j = 0; j < ny; j++) { - y = j * DiInMetres; + y = j * DiInMetres;// DjInMetres for (i = 0; i < nx; i++) { const int index = i + j * nx; double _x, _y; From 0114346e4009649aefde8657283e730752c3a373 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 26 Oct 2023 15:42:51 +0100 Subject: [PATCH 52/81] Testing: element access for doubles --- src/grib_accessor_class_element.cc | 74 +++++++++++++++++++++++------- tests/CMakeLists.txt | 1 + tests/grib_ecc-1671.sh | 52 +++++++++++++++++++++ 3 files changed, 110 insertions(+), 17 deletions(-) create mode 100755 tests/grib_ecc-1671.sh diff --git a/src/grib_accessor_class_element.cc b/src/grib_accessor_class_element.cc index 5de471be4..78dd2a5ac 100644 --- a/src/grib_accessor_class_element.cc +++ b/src/grib_accessor_class_element.cc @@ -8,11 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************** - * Enrico Fucile - **************************************/ - - #include "grib_api_internal.h" /* This is used by make_class.pl @@ -21,6 +16,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long;pack_long; + IMPLEMENTS = unpack_double IMPLEMENTS = init MEMBERS=const char* array MEMBERS=long element @@ -39,6 +35,7 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); static void init(grib_accessor*, const long, grib_arguments*); @@ -77,7 +74,7 @@ static grib_accessor_class _grib_accessor_class_element = { &unpack_long, /* unpack_long */ 0, /* pack_double */ 0, /* pack_float */ - 0, /* unpack_double */ + &unpack_double, /* unpack_double */ 0, /* unpack_float */ 0, /* pack_string */ 0, /* unpack_string */ @@ -110,10 +107,11 @@ grib_accessor_class* grib_accessor_class_element = &_grib_accessor_class_element static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_element* self = (grib_accessor_element*)a; - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); - self->array = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->element = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); + int n = 0; + self->array = grib_arguments_get_name(hand, c, n++); + self->element = grib_arguments_get_long(hand, c, n++); } static int unpack_long(grib_accessor* a, long* val, size_t* len) @@ -123,26 +121,27 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) size_t size = 0; long* ar = NULL; grib_context* c = a->context; + grib_handle* hand = grib_handle_of_accessor(a); if (*len < 1) { ret = GRIB_ARRAY_TOO_SMALL; return ret; } - if ((ret = grib_get_size(grib_handle_of_accessor(a), self->array, &size)) != GRIB_SUCCESS) + if ((ret = grib_get_size(hand, self->array, &size)) != GRIB_SUCCESS) return ret; ar = (long*)grib_context_malloc_clear(c, size * sizeof(long)); if (!ar) { - grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %zu bytes", size * sizeof(long)); + grib_context_log(c, GRIB_LOG_ERROR, "Error allocating %zu bytes", size * sizeof(long)); return GRIB_OUT_OF_MEMORY; } - if ((ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->array, ar, &size)) != GRIB_SUCCESS) + if ((ret = grib_get_long_array_internal(hand, self->array, ar, &size)) != GRIB_SUCCESS) return ret; if (self->element < 0 || self->element >= size) { - grib_context_log(c, GRIB_LOG_ERROR, "Invalid element %ld for array '%s'. Value must be between 0 and %lu", + grib_context_log(c, GRIB_LOG_ERROR, "Invalid element %ld for array '%s'. Value must be between 0 and %zu", self->element, self->array, size - 1); ret = GRIB_INVALID_ARGUMENT; goto the_end; @@ -162,29 +161,70 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) size_t size = 0; long* ar = NULL; grib_context* c = a->context; + grib_handle* hand = grib_handle_of_accessor(a); if (*len < 1) { ret = GRIB_ARRAY_TOO_SMALL; return ret; } - if ((ret = grib_get_size(grib_handle_of_accessor(a), self->array, &size)) != GRIB_SUCCESS) + if ((ret = grib_get_size(hand, self->array, &size)) != GRIB_SUCCESS) return ret; ar = (long*)grib_context_malloc_clear(c, size * sizeof(long)); if (!ar) { - grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %zu bytes", size * sizeof(long)); + grib_context_log(c, GRIB_LOG_ERROR, "Error allocating %zu bytes", size * sizeof(long)); return GRIB_OUT_OF_MEMORY; } - if ((ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->array, ar, &size)) != GRIB_SUCCESS) + if ((ret = grib_get_long_array_internal(hand, self->array, ar, &size)) != GRIB_SUCCESS) return ret; ar[self->element] = *val; - if ((ret = grib_set_long_array_internal(grib_handle_of_accessor(a), self->array, ar, size)) != GRIB_SUCCESS) + if ((ret = grib_set_long_array_internal(hand, self->array, ar, size)) != GRIB_SUCCESS) + return ret; + + grib_context_free(c, ar); + return ret; +} + +static int unpack_double(grib_accessor* a, double* val, size_t* len) +{ + grib_accessor_element* self = (grib_accessor_element*)a; + int ret = 0; + size_t size = 0; + double* ar = NULL; + grib_context* c = a->context; + grib_handle* hand = grib_handle_of_accessor(a); + + if (*len < 1) { + ret = GRIB_ARRAY_TOO_SMALL; + return ret; + } + + if ((ret = grib_get_size(hand, self->array, &size)) != GRIB_SUCCESS) return ret; + ar = (double*)grib_context_malloc_clear(c, size * sizeof(double)); + if (!ar) { + grib_context_log(c, GRIB_LOG_ERROR, "Error allocating %zu bytes", size * sizeof(double)); + return GRIB_OUT_OF_MEMORY; + } + + if ((ret = grib_get_double_array_internal(hand, self->array, ar, &size)) != GRIB_SUCCESS) + return ret; + + if (self->element < 0 || self->element >= size) { + grib_context_log(c, GRIB_LOG_ERROR, "Invalid element %ld for array '%s'. Value must be between 0 and %zu", + self->element, self->array, size - 1); + ret = GRIB_INVALID_ARGUMENT; + goto the_end; + } + + *val = ar[self->element]; + +the_end: grib_context_free(c, ar); return ret; } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b5074a3ae..5cf56690a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -127,6 +127,7 @@ if( HAVE_BUILD_TOOLS ) grib_ecc-1560 grib_ecc-1571 grib_ecc-1654 + grib_ecc-1671 grib_ecc-1691 bufr_ecc-1028 bufr_ecc-1195 diff --git a/tests/grib_ecc-1671.sh b/tests/grib_ecc-1671.sh new file mode 100755 index 000000000..cbae9f2e8 --- /dev/null +++ b/tests/grib_ecc-1671.sh @@ -0,0 +1,52 @@ +#!/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-1671_test" + +tempGrib=temp.$label.grib +tempFilt=temp.${label}.filt +tempOut=temp.${label}.txt + +sample2="$samp_dir/GRIB2.tmpl" + +cat > $tempFilt < $tempFilt < 0.001 ) { + print "Error: last longitude is [last_elem:d] but should be 179.95"; + assert(0); + } +EOF +${tools_dir}/grib_filter $tempFilt $tempGrib + +# ${tools_dir}/grib_get_data $tempGrib > $tempOut +# cat $tempOut +# ${tools_dir}/grib_ls -l 37.5,16.0,1 $tempGrib > $tempOut + +rm -f $tempGrib $tempFilt $tempOut From 40c129eb06a239b7165ee34f01b3f1ea2ad391a4 Mon Sep 17 00:00:00 2001 From: Pedro Maciel Date: Thu, 26 Oct 2023 15:56:18 +0100 Subject: [PATCH 53/81] gridType=mercator fix --- src/grib_iterator_class_mercator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grib_iterator_class_mercator.cc b/src/grib_iterator_class_mercator.cc index ca94b3140..c4f668186 100644 --- a/src/grib_iterator_class_mercator.cc +++ b/src/grib_iterator_class_mercator.cc @@ -199,7 +199,7 @@ static int init_mercator(grib_handle* h, false_easting = x0; false_northing = y0; for (j = 0; j < ny; j++) { - y = j * DiInMetres;// DjInMetres + y = j * DjInMetres; for (i = 0; i < nx; i++) { const int index = i + j * nx; double _x, _y; From c32c4c5bfbd33e7bbe841e34e4ee67155f76406e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 27 Oct 2023 12:07:50 +0100 Subject: [PATCH 54/81] ECC-1708: grib_get_data returns offset longitudes in some cases --- src/grib_iterator_class_regular.cc | 12 +++++--- tests/CMakeLists.txt | 1 + tests/grib_ecc-1671.sh | 4 +-- tests/grib_ecc-1708.sh | 46 ++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 6 deletions(-) create mode 100755 tests/grib_ecc-1708.sh diff --git a/src/grib_iterator_class_regular.cc b/src/grib_iterator_class_regular.cc index 857112261..64033b8de 100644 --- a/src/grib_iterator_class_regular.cc +++ b/src/grib_iterator_class_regular.cc @@ -233,10 +233,14 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) self->los[loi] = lon1; lon1 += idir; } - /* ECC-1406: Due to rounding, errors can accumulate. - * So we ensure the last longitude is longitudeOfLastGridPointInDegrees - */ - self->los[Ni-1] = normalise_longitude_in_degrees(lon2); // Also see ECC-1671 + + // ECC-1406: Due to rounding, errors can accumulate. + // So we ensure the last longitude is longitudeOfLastGridPointInDegrees + // Also see ECC-1671, ECC-1708 + if (lon2 > 0) { + lon2 = normalise_longitude_in_degrees(lon2); + } + self->los[Ni-1] = lon2; return ret; } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5cf56690a..079da1a72 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -128,6 +128,7 @@ if( HAVE_BUILD_TOOLS ) grib_ecc-1571 grib_ecc-1654 grib_ecc-1671 + grib_ecc-1708 grib_ecc-1691 bufr_ecc-1028 bufr_ecc-1195 diff --git a/tests/grib_ecc-1671.sh b/tests/grib_ecc-1671.sh index cbae9f2e8..aa7a50bbc 100755 --- a/tests/grib_ecc-1671.sh +++ b/tests/grib_ecc-1671.sh @@ -16,7 +16,7 @@ tempGrib=temp.$label.grib tempFilt=temp.${label}.filt tempOut=temp.${label}.txt -sample2="$samp_dir/GRIB2.tmpl" +sample="$samp_dir/GRIB2.tmpl" cat > $tempFilt < $tempFilt < $tempFilt < $tempFilt < $tempFilt < 0.001 ) { + print "Error: last longitude is [last_elem:d] but should be -40"; + assert(0); + } +EOF +${tools_dir}/grib_filter $tempFilt $tempGrib + +rm -f $tempGrib $tempFilt $tempOut From ffda07db1afb9ad728829143ad9dbd5ff97553b4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 27 Oct 2023 13:31:13 +0100 Subject: [PATCH 55/81] Add abs functor (integer absolute value function) --- src/grib_expression_class_functor.cc | 22 +++++++++++++++------- tests/grib_filter.sh | 8 ++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/grib_expression_class_functor.cc b/src/grib_expression_class_functor.cc index c7ffc072e..89c4d8a6a 100644 --- a/src/grib_expression_class_functor.cc +++ b/src/grib_expression_class_functor.cc @@ -86,16 +86,24 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { grib_expression_functor* e = (grib_expression_functor*)g; - if (strcmp(e->name, "lookup") == 0) { + if (STR_EQUAL(e->name, "lookup")) { return GRIB_SUCCESS; } - if (strcmp(e->name, "new") == 0) { + if (STR_EQUAL(e->name, "new")) { *lres = h->loader != NULL; return GRIB_SUCCESS; } - if (strcmp(e->name, "missing") == 0) { + if (STR_EQUAL(e->name, "abs")) { + grib_expression* exp = grib_arguments_get_expression(h, e->args, 0); + long lval = 0; + int ret = grib_expression_evaluate_long(h, exp, &lval); + *lres = abs(lval); + return ret; + } + + if (STR_EQUAL(e->name, "missing")) { const char* p = grib_arguments_get_name(h, e->args, 0); if (p) { long val = 0; @@ -122,7 +130,7 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) return GRIB_SUCCESS; } - if (strcmp(e->name, "defined") == 0) { + if (STR_EQUAL(e->name, "defined")) { const char* p = grib_arguments_get_name(h, e->args, 0); if (p) { @@ -134,7 +142,7 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) return GRIB_SUCCESS; } - if (strcmp(e->name, "environment_variable") == 0) { + if (STR_EQUAL(e->name, "environment_variable")) { // ECC-1520: This implementation has some limitations: // 1. Cannot distinguish between environment variable NOT SET // and SET but equal to 0 @@ -154,12 +162,12 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) return GRIB_SUCCESS; } - if (strcmp(e->name, "changed") == 0) { + if (STR_EQUAL(e->name, "changed")) { *lres = 1; return GRIB_SUCCESS; } - if (strcmp(e->name, "gribex_mode_on") == 0) { + if (STR_EQUAL(e->name, "gribex_mode_on")) { *lres = h->context->gribex_mode_on ? 1 : 0; return GRIB_SUCCESS; } diff --git a/tests/grib_filter.sh b/tests/grib_filter.sh index 22a0158ac..c114c5e4e 100755 --- a/tests/grib_filter.sh +++ b/tests/grib_filter.sh @@ -398,6 +398,14 @@ grep "unable to get rubbish as string" $tempOut grep "unable to get garbage as string" $tempOut +# Use of "abs" +cat >$tempFilt < Date: Fri, 27 Oct 2023 17:58:34 +0100 Subject: [PATCH 56/81] Cleanup --- src/grib_accessor_class_data_g22order_packing.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/grib_accessor_class_data_g22order_packing.cc b/src/grib_accessor_class_data_g22order_packing.cc index af462d667..f45d9f722 100644 --- a/src/grib_accessor_class_data_g22order_packing.cc +++ b/src/grib_accessor_class_data_g22order_packing.cc @@ -267,11 +267,9 @@ static void add_bitstream(bitstream_context *ctx, grib_accessor* a, int t, int n return; } -/* - * find min/max of an integer array - * return 0: if min max found - * return 1: if min max not found, min = max = 0 - */ +// find min/max of an integer array +// return 0: if min max found +// return 1: if min max not found, min = max = 0 static int int_min_max_array(int* data, unsigned int n, int* min, int* max) { unsigned int first; @@ -1325,8 +1323,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) grib_context_log(a->context, GRIB_LOG_ERROR, "%s packing: failed to get min max of data", cclass_name); return GRIB_ENCODING_ERROR; } - min_val = static_cast(mn); - max_val = static_cast(mx); + min_val = mn; + max_val = mx; binary_scale = bin_scale; From a2628b6dac53727b5663f8093472e1588c93c7ed Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 27 Oct 2023 17:58:48 +0100 Subject: [PATCH 57/81] Testing: metar group keys --- tests/metar_get.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/metar_get.sh b/tests/metar_get.sh index 181461526..25613ce04 100755 --- a/tests/metar_get.sh +++ b/tests/metar_get.sh @@ -35,4 +35,9 @@ export METAR_MONTH=4 ${tools_dir}/metar_get -n ls $metar_file >/dev/null ${tools_dir}/metar_get -w count=1/2/3 -p CCCC,latitude,longitude,dateTime,elevation,temperature,dewPointTemperature,qnh $metar_file +# Decode a 'group' key as int and double +result=$( ${tools_dir}/metar_get -p visibilityInMetres:i,visibilityInMetres:d -w count=1 $metar_file ) +[ "$result" = "6000 6000" ] + +# Clean up rm -f $fLog From 51f6dcf5690a3809f6dd542663d885838598cb8d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 30 Oct 2023 14:45:15 +0000 Subject: [PATCH 58/81] ECC-1709: GRIB2: Rename indicatorOfUnitOfTimeRange to indicatorOfUnitForForecastTime --- definitions/grib2/template.4.20.def | 8 +++----- definitions/grib2/template.4.forecast_time.def | 4 +++- definitions/grib2/template.4.forecast_time_44.def | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/definitions/grib2/template.4.20.def b/definitions/grib2/template.4.20.def index 9ba5668eb..83db46bc5 100644 --- a/definitions/grib2/template.4.20.def +++ b/definitions/grib2/template.4.20.def @@ -1,7 +1,6 @@ # (C) Copyright 2005- ECMWF. # TEMPLATE 4.20, Radar product -# Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir) : dump; # Parameter number @@ -9,22 +8,21 @@ codetable[1] parameterNumber ('4.2.[discipline:l].[parameterCategory:l].table',m meta parameterUnits codetable_units(parameterNumber) : dump; meta parameterName codetable_title(parameterNumber) : dump; -# Type of generating process codetable[1] typeOfGeneratingProcess ('4.3.table',masterDir,localDir) : dump; # Number of radar sites used unsigned[1] numberOfRadarSitesUsed : dump; -# Indicator of unit of time range codetable[1] indicatorOfUnitOfTimeRange ('4.4.table',masterDir,localDir) : dump; +alias indicatorOfUnitForForecastTime = indicatorOfUnitOfTimeRange; alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; -# Site latitude (in 10-6 degree) +# Site latitude (in microdegrees) unsigned[4] siteLatitude : dump; -# Site longitude (in 10-6 degree) +# Site longitude (in microdegrees) unsigned[4] siteLongitude : dump; # Site elevation (meters) diff --git a/definitions/grib2/template.4.forecast_time.def b/definitions/grib2/template.4.forecast_time.def index 662310fc6..d4999d24f 100644 --- a/definitions/grib2/template.4.forecast_time.def +++ b/definitions/grib2/template.4.forecast_time.def @@ -8,8 +8,10 @@ alias hoursAfterReferenceTimeOfDataCutoff=hoursAfterDataCutoff; unsigned[1] minutesAfterDataCutoff = missing() : edition_specific,can_be_missing; alias minutesAfterReferenceTimeOfDataCutoff=minutesAfterDataCutoff; -# Indicator of unit of time range +# Indicator of unit for forecastTime (ECC-1709) codetable[1] indicatorOfUnitOfTimeRange ('4.4.table',masterDir,localDir) : dump; +alias indicatorOfUnitForForecastTime = indicatorOfUnitOfTimeRange; + alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; diff --git a/definitions/grib2/template.4.forecast_time_44.def b/definitions/grib2/template.4.forecast_time_44.def index 494921b35..0ad48c53b 100644 --- a/definitions/grib2/template.4.forecast_time_44.def +++ b/definitions/grib2/template.4.forecast_time_44.def @@ -10,8 +10,10 @@ alias hoursAfterReferenceTimeOfDataCutoff=hoursAfterDataCutoff; unsigned[1] minutesAfterDataCutoff = missing() : edition_specific,can_be_missing; alias minutesAfterReferenceTimeOfDataCutoff=minutesAfterDataCutoff; -# Indicator of unit of time range +# Indicator of unit for forecastTime (ECC-1709) codetable[1] indicatorOfUnitOfTimeRange ('4.4.table',masterDir,localDir) : dump; +alias indicatorOfUnitForForecastTime = indicatorOfUnitOfTimeRange; + alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; From f991bdbd60feb672f7552c8016df75d504dbc10f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 30 Oct 2023 14:59:45 +0000 Subject: [PATCH 59/81] ECC-1709: Test --- tests/grib_lam_gp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/grib_lam_gp.cc b/tests/grib_lam_gp.cc index 38b2178ed..29b94a96c 100644 --- a/tests/grib_lam_gp.cc +++ b/tests/grib_lam_gp.cc @@ -908,7 +908,7 @@ int main(int argc, char* argv[]) GRIB_CHECK(grib_set_long(h, "minute", 0), 0); GRIB_CHECK(grib_set_long(h, "second", 0), 0); len = strlen("s"); - GRIB_CHECK(grib_set_string(h, "indicatorOfUnitOfTimeRange", "s", &len), 0); + GRIB_CHECK(grib_set_string(h, "indicatorOfUnitForForecastTime", "s", &len), 0); len = strlen("s"); GRIB_CHECK(grib_set_string(h, "stepUnits", "s", &len), 0); GRIB_CHECK(grib_set_long(h, "endStep", 3600), 0); From 5463da29a45017b6396b55966e9710ccd043b42f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 30 Oct 2023 15:02:13 +0000 Subject: [PATCH 60/81] ECC-1709: Test --- tests/grib_step.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/grib_step.sh b/tests/grib_step.sh index 741da1867..ca101b3d5 100755 --- a/tests/grib_step.sh +++ b/tests/grib_step.sh @@ -101,7 +101,7 @@ ${tools_dir}/grib_set -s indicatorOfUnitOfTimeRange=m $grib1_sample $temp unit=`${tools_dir}/grib_get -p unitOfTimeRange $temp` [ "$unit" = "0" ] ${tools_dir}/grib_set -s indicatorOfUnitOfTimeRange=m $grib2_sample $temp -unit=`${tools_dir}/grib_get -p indicatorOfUnitOfTimeRange $temp` +unit=`${tools_dir}/grib_get -p indicatorOfUnitForForecastTime $temp` [ "$unit" = "0" ] # ECC-457 From 6e4caaa0b1f3434a9d77a7a2567243f58351d452 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 30 Oct 2023 16:35:13 +0000 Subject: [PATCH 61/81] Testing: invalid grid input --- tests/grib_copy_message.cc | 2 ++ tests/grib_to_netcdf.sh | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/tests/grib_copy_message.cc b/tests/grib_copy_message.cc index 0fd6bb021..b3ea95cdc 100644 --- a/tests/grib_copy_message.cc +++ b/tests/grib_copy_message.cc @@ -23,6 +23,8 @@ int main(int argc, char* argv[]) assert (argc == 3); + printf("%ld\n", codes_get_api_version()); + in = fopen(argv[1], "rb"); assert(in); diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index e83f9a620..c07dc89e9 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -148,6 +148,16 @@ set -e [ $status -ne 0 ] grep -q "Wrong number of fields" $tempText +# Not regular grid +input=${data_dir}/reduced_gaussian_pressure_level.grib2 +set +e +${tools_dir}/grib_to_netcdf -o $tempNetcdf $input > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "not on a regular lat/lon grid or on a regular Gaussian grid" $tempText + + export GRIB_TO_NETCDF_CHECKVALIDTIME=0 ${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib [ -f "$tempNetcdf" ] From 575c7d7316b49b74847ad189755e0ed25f823857 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 30 Oct 2023 16:35:53 +0000 Subject: [PATCH 62/81] Tools: More readable string compare function --- tools/grib_to_netcdf.cc | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/tools/grib_to_netcdf.cc b/tools/grib_to_netcdf.cc index fec300970..e62b69a7d 100644 --- a/tools/grib_to_netcdf.cc +++ b/tools/grib_to_netcdf.cc @@ -1317,8 +1317,9 @@ static int axisindex(const char* name) { size_t i = 0; for (i = 0; i < NUMBER(global_axis); i++) { - if (strcmp(name, global_axis[i].name) == 0) - return i; + if (STR_EQUAL(name, global_axis[i].name)){ + return (int)i; + } } return -1; } @@ -1335,7 +1336,7 @@ static namecmp comparator(const char* name) } if (dontcompare != NULL) { - if (strcmp(dontcompare, name) == 0) + if (STR_EQUAL(dontcompare, name)) return eq_null; } @@ -1434,7 +1435,7 @@ static void unset_value(request* r, const char* parname) p = r->params; while (p) { - if (strcmp(parname, p->name) == 0) { + if (STR_EQUAL(parname, p->name)) { if (q) q->next = p->next; else @@ -1624,7 +1625,7 @@ static void cube_indexes( int k = 0; int count = count_values(cube, axis); int last = h->index_cache[i]; - const bool is_time_axis = (strcmp(axis, "time") == 0); + const bool is_time_axis = (STR_EQUAL(axis, "time")); if (is_time_axis) { Assert(times_array); Assert(times_array_size == count); @@ -1956,9 +1957,9 @@ static long monthnumber(const char* m) static int check_stepUnits(const char* step_units_str) { /* Only hours, minutes and seconds supported */ - if (strcmp(step_units_str, "h") == 0 || - strcmp(step_units_str, "m") == 0 || - strcmp(step_units_str, "s") == 0) { + if (STR_EQUAL(step_units_str, "h") || + STR_EQUAL(step_units_str, "m") || + STR_EQUAL(step_units_str, "s")) { return GRIB_SUCCESS; } return GRIB_WRONG_STEP_UNIT; @@ -2051,10 +2052,10 @@ static void validation_time(request* r) grib_context_log(ctx, GRIB_LOG_ERROR, "Cannot convert stepUnits of '%s'. Only hours, minutes and seconds supported.", step_units); } - if (strcmp("m", step_units) == 0) { + if (STR_EQUAL("m", step_units)) { step /= 60; } - else if (strcmp("s", step_units) == 0) { + else if (STR_EQUAL("s", step_units)) { step /= 3600; } } @@ -2121,19 +2122,19 @@ static nc_type translate_nctype(const char* name) if (!name) return NC_SHORT; - if (strcmp(name, "NC_BYTE") == 0) + if (STR_EQUAL(name, "NC_BYTE")) return NC_BYTE; - if (strcmp(name, "NC_SHORT") == 0) + if (STR_EQUAL(name, "NC_SHORT")) return NC_SHORT; - if (strcmp(name, "NC_INT") == 0) + if (STR_EQUAL(name, "NC_INT")) return NC_INT; - if (strcmp(name, "NC_FLOAT") == 0) + if (STR_EQUAL(name, "NC_FLOAT")) return NC_FLOAT; - if (strcmp(name, "NC_DOUBLE") == 0) + if (STR_EQUAL(name, "NC_DOUBLE")) return NC_DOUBLE; grib_context_log(ctx, GRIB_LOG_ERROR, "Unknown netCDF type '%s'. Using NC_SHORT", name); @@ -2163,7 +2164,7 @@ static int set_dimension(int ncid, const char* name, int n, int xtype, const cha int dim_id = DIM_ID; int dim_vec[DIM_ID]; - if (setup.unlimited && (strcmp(name, setup.unlimited) == 0)) + if ( setup.unlimited && (STR_EQUAL(name, setup.unlimited)) ) n = NC_UNLIMITED; stat = nc_def_dim(ncid, name, n, &dim_id); @@ -2197,7 +2198,7 @@ static int check_grid(field* f) return e; } - if (strcmp(grid_type, "regular_ll") != 0 && (strcmp(grid_type, "regular_gg") != 0)) { + if ( !STR_EQUAL(grid_type, "regular_ll") && !STR_EQUAL(grid_type, "regular_gg") ) { grib_context_log(ctx, GRIB_LOG_ERROR, "Grid type = %s", grid_type); grib_context_log(ctx, GRIB_LOG_ERROR, "First GRIB is not on a regular lat/lon grid or on a regular Gaussian grid. Exiting.\n"); return GRIB_GEOCALCULUS_PROBLEM; From 6ed70d7c3999b199f72c57799b40310721c86f49 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 1 Nov 2023 11:49:39 +0000 Subject: [PATCH 63/81] Provide get_native_type (See SUP-3871) --- src/grib_accessor_class_when.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/grib_accessor_class_when.cc b/src/grib_accessor_class_when.cc index 6717c2c4a..1bf0d999e 100644 --- a/src/grib_accessor_class_when.cc +++ b/src/grib_accessor_class_when.cc @@ -8,11 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************** - * Enrico Fucile - **************************************/ - - #include "grib_api_internal.h" /* This is used by make_class.pl @@ -21,6 +16,7 @@ CLASS = accessor SUPER = grib_accessor_class_gen IMPLEMENTS = init;dump; + IMPLEMENTS = get_native_type IMPLEMENTS = notify_change END_CLASS_DEF @@ -36,6 +32,7 @@ or edit "accessor.class" and rerun ./make_class.pl */ +static int get_native_type(grib_accessor*); static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); static int notify_change(grib_accessor*, grib_accessor*); @@ -64,7 +61,7 @@ static grib_accessor_class _grib_accessor_class_when = { 0, /* get number of values */ 0, /* get number of bytes */ 0, /* get offset to bytes */ - 0, /* get native type */ + &get_native_type, /* get native type */ 0, /* get sub_section */ 0, /* pack_missing */ 0, /* is_missing */ @@ -109,7 +106,6 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg) a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } - static void dump(grib_accessor* a, grib_dumper* dumper) { /* grib_dump_when(dumper,a,NULL); */ @@ -119,3 +115,8 @@ static int notify_change(grib_accessor* a, grib_accessor* changed) { return grib_action_notify_change(a->creator, a, changed); } + +static int get_native_type(grib_accessor* a) +{ + return GRIB_TYPE_UNDEFINED; +} From e2470a8c60653442b5fc78890f02e437d1391fc4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 1 Nov 2023 15:46:57 +0000 Subject: [PATCH 64/81] ECC-1710: GRIB2: Replace 'highres' with 'high' in DestinE resolution table --- definitions/grib2/destine_resolution.table | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/definitions/grib2/destine_resolution.table b/definitions/grib2/destine_resolution.table index 48d816018..1df78ebbc 100644 --- a/definitions/grib2/destine_resolution.table +++ b/definitions/grib2/destine_resolution.table @@ -1,4 +1,4 @@ 0 unknown unknown 1 standard Standard resolution model output with longer availability -2 highres High resolution model output with limited availability -65535 65535 Missing \ No newline at end of file +2 high High resolution model output with limited availability +65535 65535 Missing From 082b721c4fd712f12bf9b72697fac49fb3abc25c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 Nov 2023 19:52:42 +0000 Subject: [PATCH 65/81] Tools: Add -h option --- tools/bufr_compare.cc | 3 ++- tools/bufr_copy.cc | 3 ++- tools/bufr_dump.cc | 3 ++- tools/bufr_filter.cc | 3 ++- tools/bufr_get.cc | 3 ++- tools/bufr_index_build.cc | 3 ++- tools/bufr_ls.cc | 3 ++- tools/bufr_set.cc | 3 ++- tools/grib_compare.cc | 3 ++- tools/grib_copy.cc | 3 ++- tools/grib_dump.cc | 3 ++- tools/grib_filter.cc | 3 ++- tools/grib_get.cc | 3 ++- tools/grib_get_data.cc | 3 ++- tools/grib_histogram.cc | 3 ++- tools/grib_index_build.cc | 3 ++- tools/grib_ls.cc | 3 ++- tools/grib_merge.cc | 3 ++- tools/grib_options.cc | 8 ++++++-- tools/grib_set.cc | 3 ++- tools/grib_to_netcdf.cc | 3 ++- 21 files changed, 46 insertions(+), 22 deletions(-) diff --git a/tools/bufr_compare.cc b/tools/bufr_compare.cc index 94da7ba2a..268d7ac8e 100644 --- a/tools/bufr_compare.cc +++ b/tools/bufr_compare.cc @@ -34,7 +34,8 @@ grib_option grib_options[] = { { "I", 0, 0, 1, 0, 0 }, { "V", 0, 0, 0, 1, 0 }, { "7", 0, 0, 0, 1, 0 }, - { "v", 0, 0, 0, 1, 0 } + { "v", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); diff --git a/tools/bufr_copy.cc b/tools/bufr_copy.cc index af1bc712c..c4c8cbf8d 100644 --- a/tools/bufr_copy.cc +++ b/tools/bufr_copy.cc @@ -44,7 +44,8 @@ grib_option grib_options[] = { { "g", 0, 0, 0, 1, 0 }, { "7", 0, 0, 0, 1, 0 }, { "X:", 0, 0, 0, 1, 0 }, - { "v", 0, 0, 0, 1, 0 } + { "v", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); diff --git a/tools/bufr_dump.cc b/tools/bufr_dump.cc index 60265b085..ed5fe88b8 100644 --- a/tools/bufr_dump.cc +++ b/tools/bufr_dump.cc @@ -53,7 +53,8 @@ grib_option grib_options[] = { { "V", 0, 0, 0, 1, 0 }, { "q", 0, 0, 1, 0, 0 }, { "S:", "subset_number", "\n\t\tDump the given subset\n", 0, 1, 0 }, - { "X:", 0, 0, 0, 1, 0 } + { "X:", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, /* {"x",0,0,0,1,0} */ }; diff --git a/tools/bufr_filter.cc b/tools/bufr_filter.cc index bee0fe2da..fbabc7a76 100644 --- a/tools/bufr_filter.cc +++ b/tools/bufr_filter.cc @@ -23,7 +23,8 @@ grib_option grib_options[] = { /* {"G",0,0,0,1,0}, */ { "T:", 0, 0, 1, 0, "B" }, { "7", 0, 0, 0, 1, 0 }, - { "v", 0, 0, 0, 1, 0 } + { "v", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; const char* tool_description = "Apply the rules defined in rules_file to each BUFR " diff --git a/tools/bufr_get.cc b/tools/bufr_get.cc index 57664a7ce..ba76afca7 100644 --- a/tools/bufr_get.cc +++ b/tools/bufr_get.cc @@ -27,7 +27,8 @@ grib_option grib_options[] = { /* {"G",0,0,0,1,0}, */ { "T:", 0, 0, 1, 0, "B" }, { "7", 0, 0, 0, 1, 0 }, - { "v", 0, 0, 1, 0, 0 } + { "v", 0, 0, 1, 0, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; const char* tool_description = diff --git a/tools/bufr_index_build.cc b/tools/bufr_index_build.cc index 12dcf7bf5..ac29bd6b7 100644 --- a/tools/bufr_index_build.cc +++ b/tools/bufr_index_build.cc @@ -34,7 +34,8 @@ grib_option grib_options[] = { { "N", 0, "Do not compress index." "\n\t\tBy default the index is compressed to remove keys with only one value.\n", - 0, 1, 0 } + 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; static int compress_index; diff --git a/tools/bufr_ls.cc b/tools/bufr_ls.cc index f86319e22..4537cc666 100644 --- a/tools/bufr_ls.cc +++ b/tools/bufr_ls.cc @@ -30,7 +30,8 @@ grib_option grib_options[] = { { "P", 0, 0, 1, 0, 0 }, { "T:", 0, 0, 1, 0, "B" }, { "7", 0, 0, 0, 1, 0 }, - { "v", 0, 0, 1, 0, 0 } + { "v", 0, 0, 1, 0, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; const char* tool_description = diff --git a/tools/bufr_set.cc b/tools/bufr_set.cc index 38c41dd1b..40c51547b 100644 --- a/tools/bufr_set.cc +++ b/tools/bufr_set.cc @@ -35,7 +35,8 @@ grib_option grib_options[] = { /* {"G",0,0,0,1,0}, */ { "T:", 0, 0, 1, 0, "B" }, { "f", 0, 0, 0, 1, 0 }, - { "v", 0, 0, 0, 1, 0 } + { "v", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; const char* tool_description = diff --git a/tools/grib_compare.cc b/tools/grib_compare.cc index 800c3eca6..a538f2a8c 100644 --- a/tools/grib_compare.cc +++ b/tools/grib_compare.cc @@ -34,7 +34,8 @@ grib_option grib_options[] = { { "I", 0, 0, 1, 0, 0 }, { "V", 0, 0, 0, 1, 0 }, { "7", 0, 0, 0, 1, 0 }, - { "v", 0, 0, 0, 1, 0 } + { "v", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); diff --git a/tools/grib_copy.cc b/tools/grib_copy.cc index ccc4c690a..349a32259 100644 --- a/tools/grib_copy.cc +++ b/tools/grib_copy.cc @@ -48,7 +48,8 @@ grib_option grib_options[] = { { "G", 0, 0, 0, 1, 0 }, { "7", 0, 0, 0, 1, 0 }, { "X:", 0, 0, 0, 1, 0 }, - { "v", 0, 0, 0, 1, 0 } + { "v", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); diff --git a/tools/grib_dump.cc b/tools/grib_dump.cc index f61c6597e..c7e0c02d9 100644 --- a/tools/grib_dump.cc +++ b/tools/grib_dump.cc @@ -31,7 +31,8 @@ grib_option grib_options[] = { { "p:", "key1,key2,...", "\n\t\tDeclaration of keys to dump. Only those keys are dumped (not the whole message).\n", 0, 1, 0 }, { "X:", 0, 0, 0, 1, 0 }, - { "x", 0, 0, 0, 1, 0 } + { "x", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; const char* tool_description = "Dump the content of a GRIB file in different formats."; diff --git a/tools/grib_filter.cc b/tools/grib_filter.cc index 8ed7ff296..019fc48c8 100644 --- a/tools/grib_filter.cc +++ b/tools/grib_filter.cc @@ -24,7 +24,8 @@ grib_option grib_options[] = { { "G", 0, 0, 0, 1, 0 }, { "T:", 0, 0, 0, 1, 0 }, { "7", 0, 0, 0, 1, 0 }, - { "v", 0, 0, 0, 1, 0 } + { "v", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; const char* tool_description = "Apply the rules defined in rules_file to each GRIB " diff --git a/tools/grib_get.cc b/tools/grib_get.cc index 12acb78da..6251c436f 100644 --- a/tools/grib_get.cc +++ b/tools/grib_get.cc @@ -32,7 +32,8 @@ grib_option grib_options[] = { { "7", 0, 0, 0, 1, 0 }, { "v", 0, 0, 1, 0, 0 }, { "X:", 0, 0, 0, 1, 0 }, - { "i:", 0, 0, 0, 1, 0 } + { "i:", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; const char* tool_description = diff --git a/tools/grib_get_data.cc b/tools/grib_get_data.cc index 83b87421d..54185ac61 100644 --- a/tools/grib_get_data.cc +++ b/tools/grib_get_data.cc @@ -31,7 +31,8 @@ grib_option grib_options[] = { { "G", 0, 0, 0, 1, 0 }, { "7", 0, 0, 0, 1, 0 }, { "X:", 0, 0, 0, 1, 0 }, - { "V", 0, 0, 0, 1, 0 } + { "V", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; const char* tool_description = diff --git a/tools/grib_histogram.cc b/tools/grib_histogram.cc index a41105c74..789cdcc26 100644 --- a/tools/grib_histogram.cc +++ b/tools/grib_histogram.cc @@ -15,7 +15,8 @@ grib_option grib_options[] = { { "V", 0, 0, 0, 1, 0 }, { "p:", 0, 0, 0, 1, 0 }, /* print keys */ { "S", 0, 0, 1, 0, 0 }, /* needed for skip */ - { "w:", 0, 0, 0, 1, 0 } /* 'where' clause */ + { "w:", 0, 0, 0, 1, 0 }, /* 'where' clause */ + { "h", 0, 0, 0, 1, 0 }, }; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); diff --git a/tools/grib_index_build.cc b/tools/grib_index_build.cc index 5d1d16915..6e933da2b 100644 --- a/tools/grib_index_build.cc +++ b/tools/grib_index_build.cc @@ -33,7 +33,8 @@ grib_option grib_options[] = { { "N", 0, "Do not compress index." "\n\t\tBy default the index is compressed to remove keys with only one value.\n", - 0, 1, 0 } + 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; static int compress_index; diff --git a/tools/grib_ls.cc b/tools/grib_ls.cc index 0193b3e17..2be9333e4 100644 --- a/tools/grib_ls.cc +++ b/tools/grib_ls.cc @@ -35,7 +35,8 @@ grib_option grib_options[] = { { "7", 0, 0, 0, 1, 0 }, { "v", 0, 0, 1, 0, 0 }, { "X:", 0, 0, 0, 1, 0 }, - { "x", 0, 0, 0, 1, 0 } + { "x", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; const char* tool_description = diff --git a/tools/grib_merge.cc b/tools/grib_merge.cc index 8e18e54ea..7848935ff 100644 --- a/tools/grib_merge.cc +++ b/tools/grib_merge.cc @@ -56,7 +56,8 @@ grib_option grib_options[] = { { "g", 0, 0, 0, 1, 0 }, { "G", 0, 0, 0, 1, 0 }, { "7", 0, 0, 0, 1, 0 }, - { "v", 0, 0, 0, 1, 0 } + { "v", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); diff --git a/tools/grib_options.cc b/tools/grib_options.cc index 475f22fdf..3d792ca4e 100644 --- a/tools/grib_options.cc +++ b/tools/grib_options.cc @@ -106,8 +106,8 @@ static grib_options_help grib_options_help_list[] = { { "k:", "key1,key2,...", "\n\t\tSpecify a list of keys to index on. By default the input files are indexed on the MARS keys." "\n\t\tFor each key a string (key:s) or a double (key:d) or an integer (key:i)" - "\n\t\ttype can be requested.\n" } - + "\n\t\ttype can be requested.\n" }, + { "h", 0, "Display this help text and exit.\n" } }; static int grib_options_help_count = sizeof(grib_options_help_list) / sizeof(grib_options_help); @@ -198,6 +198,10 @@ int grib_process_runtime_options(grib_context* context, int argc, char** argv, g int has_input_extra = 0, nfiles = 0; char *karg = NULL, *warg = NULL, *sarg = NULL, *barg = NULL; + if (grib_options_on("h")) { + usage(); + } + if (grib_options_on("V")) { printf("\necCodes Version "); grib_print_api_version(stdout); diff --git a/tools/grib_set.cc b/tools/grib_set.cc index 13adcde65..537eb8a9f 100644 --- a/tools/grib_set.cc +++ b/tools/grib_set.cc @@ -39,7 +39,8 @@ grib_option grib_options[] = { { "G", 0, 0, 0, 1, 0 }, { "T:", 0, 0, 0, 1, 0 }, { "f", 0, 0, 0, 1, 0 }, - { "v", 0, 0, 0, 1, 0 } + { "v", 0, 0, 0, 1, 0 }, + { "h", 0, 0, 0, 1, 0 }, }; const char* tool_description = diff --git a/tools/grib_to_netcdf.cc b/tools/grib_to_netcdf.cc index e62b69a7d..b46145123 100644 --- a/tools/grib_to_netcdf.cc +++ b/tools/grib_to_netcdf.cc @@ -3936,7 +3936,8 @@ grib_option grib_options[] = { "\n\t\tChunking strategy based on GRIB message.\n", 0, 1, "6" }, { "s", 0, "Shuffle data before deflation compression.\n", 0, 1, 0 }, - { "u:", "dimension", "\n\t\tSet dimension to be an unlimited dimension.\n", 0, 1, "time" } + { "u:", "dimension", "\n\t\tSet dimension to be an unlimited dimension.\n", 0, 1, "time" }, + { "h", 0, 0, 0, 1, 0 }, }; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); From 2f4aa25b181c37d319e4d57604edc5b2c46e90e3 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 4 Nov 2023 14:52:26 +0000 Subject: [PATCH 66/81] ECC-1713: GRIB2: Add correct definition to discipline 192 parameter 228004; mean2t for DestinE ClimateDT --- definitions/grib1/localConcepts/ecmf/cfVarName.def | 2 +- definitions/grib1/localConcepts/ecmf/name.def | 4 ++-- definitions/grib1/localConcepts/ecmf/paramId.def | 2 +- definitions/grib1/localConcepts/ecmf/shortName.def | 2 +- definitions/grib1/localConcepts/ecmf/units.def | 2 +- definitions/grib2/cfVarName.def | 10 ++++++++++ definitions/grib2/localConcepts/ecmf/cfVarName.def | 6 ------ .../grib2/localConcepts/ecmf/cfVarName.legacy.def | 6 ++++++ definitions/grib2/localConcepts/ecmf/name.def | 6 ------ definitions/grib2/localConcepts/ecmf/name.legacy.def | 6 ++++++ definitions/grib2/localConcepts/ecmf/paramId.def | 6 ------ .../grib2/localConcepts/ecmf/paramId.legacy.def | 6 ++++++ definitions/grib2/localConcepts/ecmf/shortName.def | 6 ------ .../grib2/localConcepts/ecmf/shortName.legacy.def | 6 ++++++ definitions/grib2/localConcepts/ecmf/units.def | 6 ------ definitions/grib2/localConcepts/ecmf/units.legacy.def | 6 ++++++ definitions/grib2/name.def | 10 ++++++++++ definitions/grib2/paramId.def | 10 ++++++++++ definitions/grib2/shortName.def | 10 ++++++++++ definitions/grib2/units.def | 10 ++++++++++ 20 files changed, 86 insertions(+), 36 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/cfVarName.def b/definitions/grib1/localConcepts/ecmf/cfVarName.def index 03a5530af..d013f4f5c 100644 --- a/definitions/grib1/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib1/localConcepts/ecmf/cfVarName.def @@ -17509,7 +17509,7 @@ table2Version = 228 ; indicatorOfParameter = 3 ; } -#Mean temperature at 2 metres +#Mean 2 metre temperature 'mean2t' = { table2Version = 228 ; indicatorOfParameter = 4 ; diff --git a/definitions/grib1/localConcepts/ecmf/name.def b/definitions/grib1/localConcepts/ecmf/name.def index 5421b5ca8..1a88028a3 100644 --- a/definitions/grib1/localConcepts/ecmf/name.def +++ b/definitions/grib1/localConcepts/ecmf/name.def @@ -17509,8 +17509,8 @@ table2Version = 228 ; indicatorOfParameter = 3 ; } -#Mean temperature at 2 metres -'Mean temperature at 2 metres' = { +#Mean 2 metre temperature +'Mean 2 metre temperature' = { table2Version = 228 ; indicatorOfParameter = 4 ; } diff --git a/definitions/grib1/localConcepts/ecmf/paramId.def b/definitions/grib1/localConcepts/ecmf/paramId.def index 3bd904fb6..319c4bf54 100644 --- a/definitions/grib1/localConcepts/ecmf/paramId.def +++ b/definitions/grib1/localConcepts/ecmf/paramId.def @@ -17509,7 +17509,7 @@ table2Version = 228 ; indicatorOfParameter = 3 ; } -#Mean temperature at 2 metres +#Mean 2 metre temperature '228004' = { table2Version = 228 ; indicatorOfParameter = 4 ; diff --git a/definitions/grib1/localConcepts/ecmf/shortName.def b/definitions/grib1/localConcepts/ecmf/shortName.def index 02fc2cceb..bc8167ebe 100644 --- a/definitions/grib1/localConcepts/ecmf/shortName.def +++ b/definitions/grib1/localConcepts/ecmf/shortName.def @@ -17509,7 +17509,7 @@ table2Version = 228 ; indicatorOfParameter = 3 ; } -#Mean temperature at 2 metres +#Mean 2 metre temperature 'mean2t' = { table2Version = 228 ; indicatorOfParameter = 4 ; diff --git a/definitions/grib1/localConcepts/ecmf/units.def b/definitions/grib1/localConcepts/ecmf/units.def index 8eadf0ea3..eb4658f2a 100644 --- a/definitions/grib1/localConcepts/ecmf/units.def +++ b/definitions/grib1/localConcepts/ecmf/units.def @@ -17509,7 +17509,7 @@ table2Version = 228 ; indicatorOfParameter = 3 ; } -#Mean temperature at 2 metres +#Mean 2 metre temperature 'K' = { table2Version = 228 ; indicatorOfParameter = 4 ; diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 053b95478..d20711fe5 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -8023,6 +8023,16 @@ parameterCategory = 0 ; parameterNumber = 17 ; } +#Mean 2 metre temperature +'mean2t' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 2 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Lake total depth 'dl' = { discipline = 1 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.def b/definitions/grib2/localConcepts/ecmf/cfVarName.def index 4f85bb57e..e0466a100 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.def @@ -21697,12 +21697,6 @@ parameterCategory = 220 ; parameterNumber = 228 ; } -#Mean temperature at 2 metres -'mean2t' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 4 ; - } #Mean of 10 metre wind speed 'mean10ws' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def index d7faa1e1d..c5a21c0c6 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def @@ -1309,3 +1309,9 @@ parameterCategory = 140 ; parameterNumber = 249 ; } +#Mean temperature at 2 metres +'mean2t' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 4 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/name.def b/definitions/grib2/localConcepts/ecmf/name.def index 1d626bf3d..be29ee555 100644 --- a/definitions/grib2/localConcepts/ecmf/name.def +++ b/definitions/grib2/localConcepts/ecmf/name.def @@ -21697,12 +21697,6 @@ parameterCategory = 220 ; parameterNumber = 228 ; } -#Mean temperature at 2 metres -'Mean temperature at 2 metres' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 4 ; - } #Mean of 10 metre wind speed 'Mean of 10 metre wind speed' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/name.legacy.def b/definitions/grib2/localConcepts/ecmf/name.legacy.def index c7a877462..b0a63cda1 100644 --- a/definitions/grib2/localConcepts/ecmf/name.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/name.legacy.def @@ -1309,3 +1309,9 @@ parameterCategory = 140 ; parameterNumber = 249 ; } +#Mean temperature at 2 metres +'Mean temperature at 2 metres' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 4 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/paramId.def b/definitions/grib2/localConcepts/ecmf/paramId.def index 9886c1f16..347911625 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.def @@ -21697,12 +21697,6 @@ parameterCategory = 220 ; parameterNumber = 228 ; } -#Mean temperature at 2 metres -'228004' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 4 ; - } #Mean of 10 metre wind speed '228005' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def index cb5186931..147ebf63e 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def @@ -1309,3 +1309,9 @@ parameterCategory = 140 ; parameterNumber = 249 ; } +#Mean temperature at 2 metres +'228004' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 4 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/shortName.def b/definitions/grib2/localConcepts/ecmf/shortName.def index 3d30e0aec..40f2c8453 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.def @@ -21697,12 +21697,6 @@ parameterCategory = 220 ; parameterNumber = 228 ; } -#Mean temperature at 2 metres -'mean2t' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 4 ; - } #Mean of 10 metre wind speed 'mean10ws' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def index 7e0d60eed..22dcd00d3 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def @@ -1309,3 +1309,9 @@ parameterCategory = 140 ; parameterNumber = 249 ; } +#Mean temperature at 2 metres +'mean2t' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 4 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/units.def b/definitions/grib2/localConcepts/ecmf/units.def index 26a9c0a22..d367bab66 100644 --- a/definitions/grib2/localConcepts/ecmf/units.def +++ b/definitions/grib2/localConcepts/ecmf/units.def @@ -21697,12 +21697,6 @@ parameterCategory = 220 ; parameterNumber = 228 ; } -#Mean temperature at 2 metres -'K' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 4 ; - } #Mean of 10 metre wind speed 'm s**-1' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/units.legacy.def b/definitions/grib2/localConcepts/ecmf/units.legacy.def index 4b5d36486..73f7514db 100644 --- a/definitions/grib2/localConcepts/ecmf/units.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/units.legacy.def @@ -1309,3 +1309,9 @@ parameterCategory = 140 ; parameterNumber = 249 ; } +#Mean temperature at 2 metres +'K' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 4 ; +} diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index fa7ac3ad4..a2463b165 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -8023,6 +8023,16 @@ parameterCategory = 0 ; parameterNumber = 17 ; } +#Mean 2 metre temperature +'Mean 2 metre temperature' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 2 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Lake total depth 'Lake total depth' = { discipline = 1 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index fe6cc8d80..1c7016a0b 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -8023,6 +8023,16 @@ parameterCategory = 0 ; parameterNumber = 17 ; } +#Mean 2 metre temperature +'228004' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 2 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Lake total depth '228007' = { discipline = 1 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index fa8bce2b8..e1c2c911d 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -8023,6 +8023,16 @@ parameterCategory = 0 ; parameterNumber = 17 ; } +#Mean 2 metre temperature +'mean2t' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 2 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Lake total depth 'dl' = { discipline = 1 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 01d3201e0..8e982beaf 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -8023,6 +8023,16 @@ parameterCategory = 0 ; parameterNumber = 17 ; } +#Mean 2 metre temperature +'K' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 2 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } #Lake total depth 'm' = { discipline = 1 ; From 5346e42fff4203dc0af56b40c18bbeb65f82f71c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 5 Nov 2023 15:19:08 +0000 Subject: [PATCH 67/81] ECC-1712: GRIB2: New table entries for DestinE ClimateDT --- definitions/grib2/destine_activity.table | 1 + definitions/grib2/destine_experiment.table | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/definitions/grib2/destine_activity.table b/definitions/grib2/destine_activity.table index 852b275df..8217458fd 100644 --- a/definitions/grib2/destine_activity.table +++ b/definitions/grib2/destine_activity.table @@ -1,4 +1,5 @@ 0 unknown unknown 1 CMIP6 Coupled Model Intercomparison Project Phase 6 2 ScenarioMIP Scenario Model Intercomparison Project +3 HighResMIP High Resolution Model Intercomparison Project 65535 65535 Missing diff --git a/definitions/grib2/destine_experiment.table b/definitions/grib2/destine_experiment.table index 1429f71ac..d98a8dd70 100644 --- a/definitions/grib2/destine_experiment.table +++ b/definitions/grib2/destine_experiment.table @@ -1,9 +1,10 @@ 0 unknown unknown 1 hist Historical -2 amip Atmospheric Model Intercomparison Project -3 SSP1-1.9 Shared Socio-economic Pathways 1-1.9 -4 SSP1-2.6 Shared Socio-economic Pathways 1-2.6 -5 SSP2-4.5 Shared Socio-economic Pathways 2-4.5 -6 SSP3-7.0 Shared Socio-economic Pathways 3-7.0 -7 SSP5-8.5 Shared Socio-economic Pathways 5-8.5 +2 cont Control +3 amip Atmospheric Model Intercomparison Project +4 SSP1-1.9 Shared Socio-economic Pathways 1-1.9 +5 SSP1-2.6 Shared Socio-economic Pathways 1-2.6 +6 SSP2-4.5 Shared Socio-economic Pathways 2-4.5 +7 SSP3-7.0 Shared Socio-economic Pathways 3-7.0 +8 SSP5-8.5 Shared Socio-economic Pathways 5-8.5 65535 65535 Missing From f4b734c5207692ce498f10bdcd8ea47a04e7a1f9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 7 Nov 2023 13:49:02 +0000 Subject: [PATCH 68/81] Testing: gts_header accessor --- src/grib_accessor_class_gts_header.cc | 1 - tests/gts_get.sh | 7 +++++++ tests/gts_ls.sh | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/grib_accessor_class_gts_header.cc b/src/grib_accessor_class_gts_header.cc index 44aa9852d..1359b7d47 100644 --- a/src/grib_accessor_class_gts_header.cc +++ b/src/grib_accessor_class_gts_header.cc @@ -118,7 +118,6 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return GRIB_NOT_IMPLEMENTED; } - static int unpack_string(grib_accessor* a, char* val, size_t* len) { grib_accessor_gts_header* self = (grib_accessor_gts_header*)a; diff --git a/tests/gts_get.sh b/tests/gts_get.sh index b633e55c7..b61751dcf 100755 --- a/tests/gts_get.sh +++ b/tests/gts_get.sh @@ -29,4 +29,11 @@ fTmp=${label}".tmp.txt" gts_file=EGRR20150317121020_00493212.DAT ${tools_dir}/gts_get -p TT,AA,II,CCCC,YY,GG,gg,BBB $gts_file >/dev/null +gts_file=${data_dir}/gts.grib +result=$( ${tools_dir}/grib_get -wcount=1 -p gts_CCCC -g $gts_file ) +[ "$result" = "ECMG" ] + +${tools_dir}/grib_get -wcount=1 -p gts_header -g $gts_file + + rm -f $fLog diff --git a/tests/gts_ls.sh b/tests/gts_ls.sh index 3de662f3e..ca6fbf29e 100755 --- a/tests/gts_ls.sh +++ b/tests/gts_ls.sh @@ -52,5 +52,10 @@ echo 'print "[theMessage]";' | ${tools_dir}/gts_filter - $gts_file ${tools_dir}/gts_ls -wcount=1 -p theMessage $f + +gts_file=${data_dir}/gts.grib +result=$( ${tools_dir}/grib_ls -wcount=1 -p gts_CCCC -g $gts_file ) + + # Clean up rm -f $fLog $res_ls From 858cdcb0f2f853d74c1d65ae63abdc209099e1c1 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 7 Nov 2023 14:16:46 +0000 Subject: [PATCH 69/81] GTS header: no need for pack_string if read-only --- src/grib_accessor_class_gts_header.cc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/grib_accessor_class_gts_header.cc b/src/grib_accessor_class_gts_header.cc index 1359b7d47..149e9cfdd 100644 --- a/src/grib_accessor_class_gts_header.cc +++ b/src/grib_accessor_class_gts_header.cc @@ -15,7 +15,7 @@ START_CLASS_DEF CLASS = accessor SUPER = grib_accessor_class_ascii - IMPLEMENTS = pack_string;unpack_string;value_count + IMPLEMENTS = unpack_string;value_count IMPLEMENTS = init;string_length MEMBERS = int gts_offset MEMBERS = int gts_length @@ -33,7 +33,6 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_string(grib_accessor*, const char*, size_t* len); static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); static int value_count(grib_accessor*, long*); @@ -76,7 +75,7 @@ static grib_accessor_class _grib_accessor_class_gts_header = { 0, /* pack_float */ 0, /* unpack_double */ 0, /* unpack_float */ - &pack_string, /* pack_string */ + 0, /* pack_string */ &unpack_string, /* unpack_string */ 0, /* pack_string_array */ 0, /* unpack_string_array */ @@ -107,15 +106,11 @@ grib_accessor_class* grib_accessor_class_gts_header = &_grib_accessor_class_gts_ static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_gts_header* self = (grib_accessor_gts_header*)a; - self->gts_offset = -1; - self->gts_length = -1; - self->gts_offset = grib_arguments_get_long(grib_handle_of_accessor(a), c, 0); - self->gts_length = grib_arguments_get_long(grib_handle_of_accessor(a), c, 1); -} - -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; + self->gts_offset = -1; + self->gts_length = -1; + self->gts_offset = grib_arguments_get_long(grib_handle_of_accessor(a), c, 0); + self->gts_length = grib_arguments_get_long(grib_handle_of_accessor(a), c, 1); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static int unpack_string(grib_accessor* a, char* val, size_t* len) From d84441391b87397852f38d61bb4f90b55dc7868a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 7 Nov 2023 14:17:00 +0000 Subject: [PATCH 70/81] Testing: gts_header accessor --- tests/gts_get.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/gts_get.sh b/tests/gts_get.sh index b61751dcf..0bea9b259 100755 --- a/tests/gts_get.sh +++ b/tests/gts_get.sh @@ -13,14 +13,11 @@ #Enter data dir cd ${data_dir}/gts -#Define a common label for all the tmp files label="gts_get_test" -#Create log file fLog=${label}".log" rm -f $fLog -#Define tmp file fTmp=${label}".tmp.txt" #---------------------------------------------- @@ -35,5 +32,20 @@ result=$( ${tools_dir}/grib_get -wcount=1 -p gts_CCCC -g $gts_file ) ${tools_dir}/grib_get -wcount=1 -p gts_header -g $gts_file +# Encoding should be disabled +# ----------------------------- +set +e +${tools_dir}/grib_set -s gts_CCCC=xxx -g $gts_file $fTmp +status=$? +set -e +[ $status -ne 0 ] -rm -f $fLog +set +e +${tools_dir}/grib_set -s gts_header=yyy -g $gts_file $fTmp +status=$? +set -e +[ $status -ne 0 ] + + +# Clean up +rm -f $fLog $fTmp From 292c57a2024b28efadd3d3f50d3269b9be525023 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 7 Nov 2023 23:01:44 +0000 Subject: [PATCH 71/81] Tools: Initialise string buffer --- tools/grib_tools.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index 72122fbd1..b039c8d0d 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -1079,7 +1079,7 @@ void grib_print_key_values(grib_runtime_options* options, grib_handle* h) int strlenvalue = 0; double dvalue = 0; long lvalue = 0; - char value[MAX_STRING_LEN]; + char value[MAX_STRING_LEN] = {0,}; const char* notfound = "not_found"; int written_to_dump = 0; /* boolean */ grib_accessor* acc = NULL; From 7a83e3c1b82825364bb4c64aaea9b30bbf81912c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 8 Nov 2023 12:07:18 +0000 Subject: [PATCH 72/81] ECC-1713: GRIB2: Add correct definition to discipline 192 parameter 228004 (S2S part) --- definitions/grib2/localConcepts/s2s/cfVarName.def | 11 +++++++++++ definitions/grib2/localConcepts/s2s/name.def | 11 +++++++++++ definitions/grib2/localConcepts/s2s/paramId.def | 11 +++++++++++ definitions/grib2/localConcepts/s2s/shortName.def | 11 +++++++++++ definitions/grib2/localConcepts/s2s/units.def | 11 +++++++++++ 5 files changed, 55 insertions(+) diff --git a/definitions/grib2/localConcepts/s2s/cfVarName.def b/definitions/grib2/localConcepts/s2s/cfVarName.def index b9900970b..18ae6bde2 100644 --- a/definitions/grib2/localConcepts/s2s/cfVarName.def +++ b/definitions/grib2/localConcepts/s2s/cfVarName.def @@ -38,6 +38,17 @@ typeOfFirstFixedSurface = 103 ; scaledValueOfFirstFixedSurface = 15 ; scaleFactorOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#2 metre temperature +'t2m' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 2 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; } #2 metre dewpoint temperature 'd2m' = { diff --git a/definitions/grib2/localConcepts/s2s/name.def b/definitions/grib2/localConcepts/s2s/name.def index 478e0a7fa..207a8bf75 100644 --- a/definitions/grib2/localConcepts/s2s/name.def +++ b/definitions/grib2/localConcepts/s2s/name.def @@ -38,6 +38,17 @@ typeOfFirstFixedSurface = 103 ; scaledValueOfFirstFixedSurface = 15 ; scaleFactorOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#2 metre temperature +'2 metre temperature' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 2 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; } #2 metre dewpoint temperature '2 metre dewpoint temperature' = { diff --git a/definitions/grib2/localConcepts/s2s/paramId.def b/definitions/grib2/localConcepts/s2s/paramId.def index f9800fd85..9c9436700 100644 --- a/definitions/grib2/localConcepts/s2s/paramId.def +++ b/definitions/grib2/localConcepts/s2s/paramId.def @@ -38,6 +38,17 @@ typeOfFirstFixedSurface = 103 ; scaledValueOfFirstFixedSurface = 15 ; scaleFactorOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#2 metre temperature +'167' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 2 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; } #2 metre dewpoint temperature '168' = { diff --git a/definitions/grib2/localConcepts/s2s/shortName.def b/definitions/grib2/localConcepts/s2s/shortName.def index e200e018b..e850dd014 100644 --- a/definitions/grib2/localConcepts/s2s/shortName.def +++ b/definitions/grib2/localConcepts/s2s/shortName.def @@ -38,6 +38,17 @@ typeOfFirstFixedSurface = 103 ; scaledValueOfFirstFixedSurface = 15 ; scaleFactorOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#2 metre temperature +'2t' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 2 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; } #2 metre dewpoint temperature '2d' = { diff --git a/definitions/grib2/localConcepts/s2s/units.def b/definitions/grib2/localConcepts/s2s/units.def index c40b4c966..f96b2c9e1 100644 --- a/definitions/grib2/localConcepts/s2s/units.def +++ b/definitions/grib2/localConcepts/s2s/units.def @@ -38,6 +38,17 @@ typeOfFirstFixedSurface = 103 ; scaledValueOfFirstFixedSurface = 15 ; scaleFactorOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } +#2 metre temperature +'K' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 103 ; + scaledValueOfFirstFixedSurface = 2 ; + scaleFactorOfFirstFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; } #2 metre dewpoint temperature 'K' = { From f78d164670049c12c068a8491115544be22904e7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 8 Nov 2023 15:05:39 +0000 Subject: [PATCH 73/81] Const correctness --- src/eccodes_prototypes.h | 2 +- src/grib_handle.cc | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index ecdd83633..c9032e08e 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -994,7 +994,7 @@ int codes_check_message_header(const void* bytes, size_t length, ProductKind pro int codes_check_message_footer(const void* bytes, size_t length, ProductKind product); int grib_get_message_size(const grib_handle* h, size_t* size); int grib_get_message(const grib_handle* h, const void** msg, size_t* size); -int grib_get_message_headers(grib_handle* h, const void** msg, size_t* size); +int grib_get_message_headers(const grib_handle* h, const void** msg, size_t* size); grib_action* grib_action_from_filter(const char* filter); int grib_handle_apply_action(grib_handle* h, grib_action* a); void grib_multi_support_reset_file(grib_context* c, FILE* f); diff --git a/src/grib_handle.cc b/src/grib_handle.cc index be5cdecda..5520c0fc7 100644 --- a/src/grib_handle.cc +++ b/src/grib_handle.cc @@ -1149,9 +1149,7 @@ grib_multi_handle* grib_multi_handle_new(grib_context* c) } h = (grib_multi_handle*)grib_context_malloc_clear(c, sizeof(grib_multi_handle)); if (h == NULL) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_multi_handle_new: unable to allocate memory. %s", - grib_get_error_message(GRIB_OUT_OF_MEMORY)); + grib_context_log(c, GRIB_LOG_ERROR, "%s: Unable to allocate memory", __func__); return NULL; } h->buffer = grib_create_growable_buffer(c); @@ -1375,7 +1373,7 @@ int grib_get_message(const grib_handle* ch, const void** msg, size_t* size) return 0; } -int grib_get_message_headers(grib_handle* h, const void** msg, size_t* size) +int grib_get_message_headers(const grib_handle* h, const void** msg, size_t* size) { int err = 0; size_t endOfHeadersMarker; @@ -1384,7 +1382,7 @@ int grib_get_message_headers(grib_handle* h, const void** msg, size_t* size) if ((err = grib_get_offset(h, "endOfHeadersMarker", &endOfHeadersMarker)) != GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, - "grib_get_message_headers: unable to get offset of endOfHeadersMarker"); + "%s: Unable to get offset of endOfHeadersMarker", __func__); return err; } From d47b5b1265213697feb49df32286fb92a6c8caf3 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 9 Nov 2023 12:51:11 +0000 Subject: [PATCH 74/81] API: Add codes_get_offset --- src/eccodes.cc | 4 ++++ src/eccodes.h | 49 ++++++++++++++++++++++++++++--------------------- src/grib_api.h | 6 +++--- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/src/eccodes.cc b/src/eccodes.cc index 13b23ddc0..961e69139 100644 --- a/src/eccodes.cc +++ b/src/eccodes.cc @@ -321,6 +321,10 @@ int codes_set_missing(grib_handle* h, const char* key) { return grib_set_missing(h, key); } +int codes_get_offset(const codes_handle* h, const char* key, size_t* offset) +{ + return grib_get_offset(h, key, offset); +} int codes_get_size(const grib_handle* h, const char* key, size_t* size) { return grib_get_size(h, key, size); diff --git a/src/eccodes.h b/src/eccodes.h index d890438f2..b4db4406a 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -724,7 +724,7 @@ int codes_grib_nearest_find_multiple(const codes_handle* h, int is_lsm, /*! \defgroup get_set Accessing header and data values */ /*! @{ */ /** - * Get the number offset of a key, in a message if several keys of the same name + * Get the byte offset of a key, if several keys of the same name * are present, the offset of the last one is returned * * @param h : the handle to get the offset from @@ -737,7 +737,7 @@ int codes_get_offset(const codes_handle* h, const char* key, size_t* offset); /** * Get the number of coded value from a key, if several keys of the same name are present, the total sum is returned * - * @param h : the handle to get the offset from + * @param h : the handle to get the data from * @param key : the key to be searched * @param size : the address of a size_t where the size will be set * @return 0 if OK, integer value on error @@ -747,7 +747,7 @@ int codes_get_size(const codes_handle* h, const char* key, size_t* size); /** * Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned * - * @param h : the handle to get the offset from + * @param h : the handle to get the data from * @param key : the key to be searched * @param length : the address of a size_t where the length will be set * @return 0 if OK, integer value on error @@ -809,7 +809,8 @@ int codes_get_float_elements(const codes_handle* h, const char* key, const int* * @param h : the handle to get the data from * @param key : the key to be searched * @param mesg : the address of a string where the data will be retrieved - * @param length : the address of a size_t that contains allocated length of the string on input, and that contains the actual length of the string on output + * @param length : the address of a size_t that contains allocated length of the string on input, + * and that contains the actual length of the string on output * @return 0 if OK, integer value on error */ int codes_get_string(const codes_handle* h, const char* key, char* mesg, size_t* length); @@ -821,7 +822,8 @@ int codes_get_string(const codes_handle* h, const char* key, char* mesg, size_t* * @param h : the handle to get the data from * @param key : the key to be searched * @param vals : the address of a string array where the data will be retrieved - * @param length : the address of a size_t that contains allocated length of the array on input, and that contains the actual length of the array on output + * @param length : the address of a size_t that contains allocated length of the array on input, + * and that contains the actual length of the array on output * @return 0 if OK, integer value on error */ int codes_get_string_array(const codes_handle* h, const char* key, char** vals, size_t* length); @@ -830,11 +832,12 @@ int codes_get_string_array(const codes_handle* h, const char* key, char** vals, * Get raw bytes values from a key. If several keys of the same name are present, the last one is returned * @see codes_set_bytes * - * @param h : the handle to get the data from - * @param key : the key to be searched - * @param bytes : the address of a byte array where the data will be retrieved - * @param length : the address of a size_t that contains allocated length of the byte array on input, and that contains the actual length of the byte array on output - * @return 0 if OK, integer value on error + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param bytes : the address of a byte array where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the byte array on input, + * and that contains the actual length of the byte array on output + * @return 0 if OK, integer value on error */ int codes_get_bytes(const codes_handle* h, const char* key, unsigned char* bytes, size_t* length); @@ -845,7 +848,8 @@ int codes_get_bytes(const codes_handle* h, const char* key, unsigned char* bytes * @param h : the handle to get the data from * @param key : the key to be searched * @param vals : the address of a double array where the data will be retrieved - * @param length : the address of a size_t that contains allocated length of the double array on input, and that contains the actual length of the double array on output + * @param length : the address of a size_t that contains allocated length of the double array on input, + * and that contains the actual length of the double array on output * @return 0 if OK, integer value on error */ int codes_get_double_array(const codes_handle* h, const char* key, double* vals, size_t* length); @@ -857,8 +861,9 @@ int codes_get_float_array(const codes_handle* h, const char* key, float* vals, s * * @param h : the handle to get the data from * @param key : the key to be searched - * @param vals : the address of a long array where the data will be retrieved - * @param length : the address of a size_t that contains allocated length of the long array on input, and that contains the actual length of the long array on output + * @param vals : the address of a long array where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the long array on input, + * and that contains the actual length of the long array on output * @return 0 if OK, integer value on error */ int codes_get_long_array(const codes_handle* h, const char* key, long* vals, size_t* length); @@ -891,10 +896,10 @@ int codes_set_long(codes_handle* h, const char* key, long val); * Set a double value from a key. If several keys of the same name are present, the last one is set * @see codes_get_double * - * @param h : the handle to set the data to - * @param key : the key to be searched + * @param h : the handle to set the data to + * @param key : the key to be searched * @param val : a double where the data will be read - * @return 0 if OK, integer value on error + * @return 0 if OK, integer value on error */ int codes_set_double(codes_handle* h, const char* key, double val); @@ -902,11 +907,12 @@ int codes_set_double(codes_handle* h, const char* key, double val); * Set a string value from a key. If several keys of the same name are present, the last one is set * @see codes_get_string * - * @param h : the handle to set the data to - * @param key : the key to be searched + * @param h : the handle to set the data to + * @param key : the key to be searched * @param mesg : the address of a string where the data will be read - * @param length : the address of a size_t that contains the length of the string on input, and that contains the actual packed length of the string on output - * @return 0 if OK, integer value on error + * @param length : the address of a size_t that contains the length of the string on input, + * and that contains the actual packed length of the string on output + * @return 0 if OK, integer value on error */ int codes_set_string(codes_handle* h, const char* key, const char* mesg, size_t* length); @@ -917,7 +923,8 @@ int codes_set_string(codes_handle* h, const char* key, const char* mesg, size_t* * @param h : the handle to set the data to * @param key : the key to be searched * @param bytes : the address of a byte array where the data will be read - * @param length : the address of a size_t that contains the length of the byte array on input, and that contains the actual packed length of the byte array on output + * @param length : the address of a size_t that contains the length of the byte array on input, + * and that contains the actual packed length of the byte array on output * @return 0 if OK, integer value on error */ int codes_set_bytes(codes_handle* h, const char* key, const unsigned char* bytes, size_t* length); diff --git a/src/grib_api.h b/src/grib_api.h index 9a3e46ffc..21e605baa 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -732,7 +732,7 @@ int grib_nearest_find_multiple(const grib_handle* h, int is_lsm, /*! \defgroup get_set Accessing header and data values */ /*! @{ */ /** - * Get the number offset of a key, in a message if several keys of the same name + * Get the byte offset of a key. If several keys of the same name * are present, the offset of the last one is returned * * @param h : the handle to get the offset from @@ -745,7 +745,7 @@ int grib_get_offset(const grib_handle* h, const char* key, size_t* offset); /** * Get the number of coded value from a key, if several keys of the same name are present, the total sum is returned * - * @param h : the handle to get the offset from + * @param h : the handle to get the data from * @param key : the key to be searched * @param size : the address of a size_t where the size will be set * @return 0 if OK, integer value on error @@ -755,7 +755,7 @@ int grib_get_size(const grib_handle* h, const char* key, size_t* size); /** * Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned * - * @param h : the handle to get the offset from + * @param h : the handle to get the data from * @param key : the key to be searched * @param length : the address of a size_t where the length will be set * @return 0 if OK, integer value on error From b9cf94aa20f5d38b07038efc5f7dd9e66dcc30dd Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 9 Nov 2023 17:20:16 +0000 Subject: [PATCH 75/81] ECC-1717: CRASH: grib_get -p numberOfMissing on invalid GRIB --- src/grib_accessor_class_count_missing.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/grib_accessor_class_count_missing.cc b/src/grib_accessor_class_count_missing.cc index 32f7f16c8..a4ed76841 100644 --- a/src/grib_accessor_class_count_missing.cc +++ b/src/grib_accessor_class_count_missing.cc @@ -200,10 +200,15 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) if (grib_get_long(h, self->unusedBitsInBitmap, &unusedBitsInBitmap) != GRIB_SUCCESS) { if (grib_get_long(h, self->numberOfDataPoints, &numberOfDataPoints) != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unable to count missing values"); + grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to count missing values"); return GRIB_INTERNAL_ERROR; } unusedBitsInBitmap = size * 8 - numberOfDataPoints; + if (unusedBitsInBitmap < 0) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Inconsistent number of bitmap points: Check the bitmap and data sections!"); + grib_context_log(a->context, GRIB_LOG_ERROR, "Bitmap size=%ld, numberOfDataPoints=%ld", size*8, numberOfDataPoints); + return GRIB_DECODING_ERROR; + } } p = h->buffer->data + offset; From a1f17da1086d4b0e0abc8c194023a84a3de5c0d6 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 10 Nov 2023 12:39:54 +0000 Subject: [PATCH 76/81] ECC-1716: GRIB2: Use dataDate and dataTime for indexing within MARS stream clte --- definitions/mars/grib.clte.fc.def | 7 +++---- tests/grib_ecc-1691.sh | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/definitions/mars/grib.clte.fc.def b/definitions/mars/grib.clte.fc.def index f75dd3faf..8d899381f 100644 --- a/definitions/mars/grib.clte.fc.def +++ b/definitions/mars/grib.clte.fc.def @@ -1,5 +1,4 @@ -alias mars.date = validityDate; -meta padded_vtime sprintf("%.4d", validityTime): no_copy; -alias mars.time = padded_vtime; +alias mars.date = dataDate; +alias mars.time = dataTime; unalias mars.step; -unalias mars.domain; \ No newline at end of file +unalias mars.domain; diff --git a/tests/grib_ecc-1691.sh b/tests/grib_ecc-1691.sh index 38a9a1603..97c38108d 100755 --- a/tests/grib_ecc-1691.sh +++ b/tests/grib_ecc-1691.sh @@ -65,13 +65,13 @@ ${tools_dir}/grib_set -s numberOfDataPoints=12582912,gridDefinitionTemplateNumbe grib_check_key_equals $temp_grib_a "gridSpecification" "H1024" # Now check streams. -# Setting stream clte and type fc should set mars.date and mars.time to validityDate and validityTime, +# Setting stream clte and type fc should set mars.date and mars.time to dataDate and dataTime, # and mars.step should be unaliased ${tools_dir}/grib_set -s stream=clte,type=fc $destine_sample $temp_grib_a result1=$( ${tools_dir}/grib_get -p mars.date,mars.time $temp_grib_a ) -result2=$( ${tools_dir}/grib_get -p validityDate,validityTime $temp_grib_a ) +result2=$( ${tools_dir}/grib_get -p dataDate,dataTime $temp_grib_a ) [ "$result1" = "$result2" ] ${tools_dir}/grib_ls -jm $temp_grib_a From b48efc6bc526d97e87253eb0f32c9a8aec2b7918 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 18 Nov 2023 14:26:45 +0000 Subject: [PATCH 77/81] ECC-1719, ECC-1720 and ECC-1721 --- .../grib1/localConcepts/ecmf/cfVarName.def | 6 +- definitions/grib1/localConcepts/ecmf/name.def | 12 +- .../grib1/localConcepts/ecmf/paramId.def | 6 +- .../grib1/localConcepts/ecmf/shortName.def | 6 +- .../grib1/localConcepts/ecmf/units.def | 8 +- definitions/grib2/cfVarName.def | 536 +++++++++++++++++- .../grib2/localConcepts/ecmf/cfVarName.def | 24 - definitions/grib2/localConcepts/ecmf/name.def | 24 - .../grib2/localConcepts/ecmf/paramId.def | 24 - .../grib2/localConcepts/ecmf/shortName.def | 24 - .../grib2/localConcepts/ecmf/units.def | 24 - definitions/grib2/name.def | 536 +++++++++++++++++- definitions/grib2/paramId.def | 536 +++++++++++++++++- definitions/grib2/shortName.def | 536 +++++++++++++++++- definitions/grib2/units.def | 536 +++++++++++++++++- 15 files changed, 2669 insertions(+), 169 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/cfVarName.def b/definitions/grib1/localConcepts/ecmf/cfVarName.def index d013f4f5c..6e19617e2 100644 --- a/definitions/grib1/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib1/localConcepts/ecmf/cfVarName.def @@ -1054,12 +1054,12 @@ table2Version = 128 ; indicatorOfParameter = 148 ; } -#Surface net radiation +#Surface net radiation (SW and LW) 'snr' = { table2Version = 128 ; indicatorOfParameter = 149 ; } -#Top net radiation +#Top net radiation (SW and LW) 'tnr' = { table2Version = 128 ; indicatorOfParameter = 150 ; @@ -15024,7 +15024,7 @@ table2Version = 172 ; indicatorOfParameter = 147 ; } -#Mean surface net radiation flux +#Time-mean surface net radiation flux (SW and LW) 'msnrf' = { table2Version = 172 ; indicatorOfParameter = 149 ; diff --git a/definitions/grib1/localConcepts/ecmf/name.def b/definitions/grib1/localConcepts/ecmf/name.def index 1a88028a3..bee6eddab 100644 --- a/definitions/grib1/localConcepts/ecmf/name.def +++ b/definitions/grib1/localConcepts/ecmf/name.def @@ -1054,13 +1054,13 @@ table2Version = 128 ; indicatorOfParameter = 148 ; } -#Surface net radiation -'Surface net radiation' = { +#Surface net radiation (SW and LW) +'Surface net radiation (SW and LW)' = { table2Version = 128 ; indicatorOfParameter = 149 ; } -#Top net radiation -'Top net radiation' = { +#Top net radiation (SW and LW) +'Top net radiation (SW and LW)' = { table2Version = 128 ; indicatorOfParameter = 150 ; } @@ -15024,8 +15024,8 @@ table2Version = 172 ; indicatorOfParameter = 147 ; } -#Mean surface net radiation flux -'Mean surface net radiation flux' = { +#Time-mean surface net radiation flux (SW and LW) +'Time-mean surface net radiation flux (SW and LW)' = { table2Version = 172 ; indicatorOfParameter = 149 ; } diff --git a/definitions/grib1/localConcepts/ecmf/paramId.def b/definitions/grib1/localConcepts/ecmf/paramId.def index 319c4bf54..bd07cf762 100644 --- a/definitions/grib1/localConcepts/ecmf/paramId.def +++ b/definitions/grib1/localConcepts/ecmf/paramId.def @@ -1054,12 +1054,12 @@ table2Version = 128 ; indicatorOfParameter = 148 ; } -#Surface net radiation +#Surface net radiation (SW and LW) '149' = { table2Version = 128 ; indicatorOfParameter = 149 ; } -#Top net radiation +#Top net radiation (SW and LW) '150' = { table2Version = 128 ; indicatorOfParameter = 150 ; @@ -15024,7 +15024,7 @@ table2Version = 172 ; indicatorOfParameter = 147 ; } -#Mean surface net radiation flux +#Time-mean surface net radiation flux (SW and LW) '172149' = { table2Version = 172 ; indicatorOfParameter = 149 ; diff --git a/definitions/grib1/localConcepts/ecmf/shortName.def b/definitions/grib1/localConcepts/ecmf/shortName.def index bc8167ebe..54ef51c2b 100644 --- a/definitions/grib1/localConcepts/ecmf/shortName.def +++ b/definitions/grib1/localConcepts/ecmf/shortName.def @@ -1054,12 +1054,12 @@ table2Version = 128 ; indicatorOfParameter = 148 ; } -#Surface net radiation +#Surface net radiation (SW and LW) 'snr' = { table2Version = 128 ; indicatorOfParameter = 149 ; } -#Top net radiation +#Top net radiation (SW and LW) 'tnr' = { table2Version = 128 ; indicatorOfParameter = 150 ; @@ -15024,7 +15024,7 @@ table2Version = 172 ; indicatorOfParameter = 147 ; } -#Mean surface net radiation flux +#Time-mean surface net radiation flux (SW and LW) 'msnrf' = { table2Version = 172 ; indicatorOfParameter = 149 ; diff --git a/definitions/grib1/localConcepts/ecmf/units.def b/definitions/grib1/localConcepts/ecmf/units.def index eb4658f2a..12d9b715b 100644 --- a/definitions/grib1/localConcepts/ecmf/units.def +++ b/definitions/grib1/localConcepts/ecmf/units.def @@ -665,7 +665,7 @@ indicatorOfParameter = 123 ; } #Surface emissivity -'dimensionless' = { +'Proportion' = { table2Version = 128 ; indicatorOfParameter = 124 ; } @@ -1054,12 +1054,12 @@ table2Version = 128 ; indicatorOfParameter = 148 ; } -#Surface net radiation +#Surface net radiation (SW and LW) 'J m**-2' = { table2Version = 128 ; indicatorOfParameter = 149 ; } -#Top net radiation +#Top net radiation (SW and LW) 'J m**-2' = { table2Version = 128 ; indicatorOfParameter = 150 ; @@ -15024,7 +15024,7 @@ table2Version = 172 ; indicatorOfParameter = 147 ; } -#Mean surface net radiation flux +#Time-mean surface net radiation flux (SW and LW) 'W m**-2' = { table2Version = 172 ; indicatorOfParameter = 149 ; diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index d20711fe5..9dfb6eeb6 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -299,6 +299,13 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Surface emissivity +'emis' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 62 ; + typeOfFirstFixedSurface = 1 ; + } #Total column vertically-integrated water vapour 'tcwv' = { discipline = 0 ; @@ -320,6 +327,22 @@ parameterCategory = 0 ; parameterNumber = 76 ; } +#Surface net radiation (SW and LW) +'snr' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Top net radiation (SW and LW) +'tnr' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } #Boundary layer height 'blh' = { discipline = 0 ; @@ -3128,6 +3151,329 @@ parameterCategory = 1 ; parameterNumber = 30 ; } +#Vertical divergence +'vdiv' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 59 ; + } +#Drag thermal coefficient +'dtc' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 1 ; + } +#Drag evaporation coefficient +'dec' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 61 ; + typeOfFirstFixedSurface = 1 ; + } +#Pressure departure from hydrostatic state +'pdhs' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 46 ; + } +#Surface net radiation flux (SW and LW) +'snrf' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + } +#Top net radiation flux (SW and LW) +'tnrf' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + } +#Time-mean top net radiation flux (SW and LW) +'mtnrf' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + typeOfStatisticalProcessing = 0 ; + } +#Global irradiance on tilted surfaces +'gits' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 47 ; + } +#Eady growth rate +'eagr' = { + discipline = 0 ; + parameterCategory = 21 ; + parameterNumber = 22 ; + } +#Tropical cyclones track density +'tdtc' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 4 ; + } +#Canopy air temperature +'cant' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 63 ; + } +#Soil wetness index (total layer) +'swit' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 151 ; + } +#Soil wetness index (root zone) +'swir' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 167 ; + } +#Soil wetness index (layer) +'swil' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 151 ; + typeOfSecondFixedSurface = 151 ; + } +#Distance downward from roof surface +'ddrf' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 6 ; + } +#Distance inward from outer wall surface +'diws' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 7 ; + } +#Distance downward from road surface +'ddrd' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 8 ; + } +#Renewable power capacity +'rpc' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Renewable power production rate +'rppr' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Renewable power production +'rpp' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Wind power capacity +'wpc' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Wind power production rate +'wppr' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Wind power production +'wpp' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Solar photovoltaic (PV) power capacity +'pvpc' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Solar photovoltaic (PV) power production rate +'pvppr' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 5 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Solar photovoltaic (PV) power production +'pvpp' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 5 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Graupel (snow pellets) precipitation +'tgrp' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 75 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated total lightning flash density +'litotint' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Maximum total colum integrated graupel (snow pellets) +'maxtcg' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 74 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 2 ; + } +#Minimum visibility +'minvis' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 3 ; + } +#Geometric height of theta level above ground +'hthg' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 107 ; + } +#Pressure at cloud base +'pcdb' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 2 ; + } +#Geometric height of adiabatic condensation level above ground +'hacg' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 5 ; + } +#Geometric height of free convection level above ground +'hfcg' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 14 ; + } +#Geometric height of neutral buoyancy above ground +'hnbg' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 16 ; + } +#Geometric height of atmospheric isothermal level above ground +'haig' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 20 ; + } +#Roof layer temperature +'rflt' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 185 ; + } +#Wall layer temperature +'wlt' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 186 ; + } +#Road layer temperature +'rdlt' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + } +#Snow depth water equivalent on roof surface +'sdrf' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 185 ; + } +#Snow depth water equivalent on road surface +'sdrd' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 187 ; + } +#Urban canyon temperature +'uct' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + typeOfSecondFixedSurface = 185 ; + scaledValueOfFirstFixedSurface = 1 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 1 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Urban canyon specific humidity +'ucq' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + typeOfSecondFixedSurface = 185 ; + scaledValueOfFirstFixedSurface = 1 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 1 ; + scaleFactorOfSecondFixedSurface = 0 ; + } #Burned area 'fba' = { discipline = 2 ; @@ -3170,6 +3516,60 @@ parameterCategory = 4 ; parameterNumber = 25 ; } +#Live leaf fuel load +'llfl' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 27 ; + } +#Live wood fuel load +'lwfl' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 28 ; + } +#Dead leaf fuel load +'dlfl' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + } +#Dead wood fuel load +'dwfl' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + } +#Live fuel moisture content +'lfmc' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 31 ; + } +#Fine dead leaf moisture content +'fdlmc' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + } +#Dense dead leaf moisture content +'ddlmc' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 33 ; + } +#Fine dead wood moisture content +'fdwmc' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + } +#Dense dead wood moisture content +'ddwmc' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + } #Time-integrated total column vertically-integrated eastward geopotential flux 'tvige' = { discipline = 0 ; @@ -4161,6 +4561,14 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Total snow precipitation +'tsnowp' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Total column integrated ozone 'tcioz' = { discipline = 0 ; @@ -4797,6 +5205,20 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Saturation specific humidity with respect to water +'sqw' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 168 ; + } +#Total column integrated saturation specific humidity with respect to water +'tcsqw' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 169 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #Universal thermal climate index 'utci' = { discipline = 20 ; @@ -5733,6 +6155,54 @@ scaledValueOfSecondFixedSurface = 300 ; scaleFactorOfSecondFixedSurface = 0 ; } +#Sea surface salinity +'sss' = { + 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' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Vertically integrated sea water practical salinity in the upper 700 m +'sc700v' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Total column vertically integrated sea water practical salinity +'scbtv' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea water practical salinity 'so' = { discipline = 10 ; @@ -6854,6 +7324,58 @@ scaleFactorOfSecondFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea surface salinity +'avg_sss' = { + 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 +'avg_sc300v' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically integrated sea water practical salinity in the upper 700 m +'avg_sc700v' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total column vertically integrated sea water practical salinity +'avg_scbtv' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea water practical salinity 'avg_so' = { discipline = 10 ; @@ -7943,6 +8465,14 @@ parameterNumber = 40 ; typeOfStatisticalProcessing = 1 ; } +#Time-mean surface net radiation flux (SW and LW) +'msnrf' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Surface runoff 'sro' = { discipline = 2 ; @@ -8708,12 +9238,6 @@ parameterCategory = 1 ; parameterNumber = 49 ; } -#Total snow precipitation -'tsnowp' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 50 ; - } #Total column water (Vertically integrated total water (vapour + cloud water/ice)) 'tcwat' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.def b/definitions/grib2/localConcepts/ecmf/cfVarName.def index e0466a100..3f3a05316 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.def @@ -548,12 +548,6 @@ parameterCategory = 128 ; parameterNumber = 123 ; } -#Surface emissivity -'emis' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 124 ; - } #Vertically integrated total energy 'vite' = { discipline = 192 ; @@ -624,18 +618,6 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Surface net radiation -'snr' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 149 ; - } -#Top net radiation -'tnr' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 150 ; - } #Logarithm of surface pressure 'lnsp' = { discipline = 0 ; @@ -18871,12 +18853,6 @@ parameterCategory = 172 ; parameterNumber = 147 ; } -#Mean surface net radiation flux -'msnrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 149 ; - } #Mean short-wave heating rate 'mswhr' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/name.def b/definitions/grib2/localConcepts/ecmf/name.def index be29ee555..a0081e32f 100644 --- a/definitions/grib2/localConcepts/ecmf/name.def +++ b/definitions/grib2/localConcepts/ecmf/name.def @@ -548,12 +548,6 @@ parameterCategory = 128 ; parameterNumber = 123 ; } -#Surface emissivity -'Surface emissivity' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 124 ; - } #Vertically integrated total energy 'Vertically integrated total energy' = { discipline = 192 ; @@ -624,18 +618,6 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Surface net radiation -'Surface net radiation' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 149 ; - } -#Top net radiation -'Top net radiation' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 150 ; - } #Logarithm of surface pressure 'Logarithm of surface pressure' = { discipline = 0 ; @@ -18871,12 +18853,6 @@ parameterCategory = 172 ; parameterNumber = 147 ; } -#Mean surface net radiation flux -'Mean surface net radiation flux' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 149 ; - } #Mean short-wave heating rate 'Mean short-wave heating rate' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/paramId.def b/definitions/grib2/localConcepts/ecmf/paramId.def index 347911625..8b6604847 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.def @@ -548,12 +548,6 @@ parameterCategory = 128 ; parameterNumber = 123 ; } -#Surface emissivity -'124' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 124 ; - } #Vertically integrated total energy '125' = { discipline = 192 ; @@ -624,18 +618,6 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Surface net radiation -'149' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 149 ; - } -#Top net radiation -'150' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 150 ; - } #Logarithm of surface pressure '152' = { discipline = 0 ; @@ -18871,12 +18853,6 @@ parameterCategory = 172 ; parameterNumber = 147 ; } -#Mean surface net radiation flux -'172149' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 149 ; - } #Mean short-wave heating rate '172153' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/shortName.def b/definitions/grib2/localConcepts/ecmf/shortName.def index 40f2c8453..0a3476f15 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.def @@ -548,12 +548,6 @@ parameterCategory = 128 ; parameterNumber = 123 ; } -#Surface emissivity -'emis' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 124 ; - } #Vertically integrated total energy 'vite' = { discipline = 192 ; @@ -624,18 +618,6 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Surface net radiation -'snr' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 149 ; - } -#Top net radiation -'tnr' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 150 ; - } #Logarithm of surface pressure 'lnsp' = { discipline = 0 ; @@ -18871,12 +18853,6 @@ parameterCategory = 172 ; parameterNumber = 147 ; } -#Mean surface net radiation flux -'msnrf' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 149 ; - } #Mean short-wave heating rate 'mswhr' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/units.def b/definitions/grib2/localConcepts/ecmf/units.def index d367bab66..f1a5418f3 100644 --- a/definitions/grib2/localConcepts/ecmf/units.def +++ b/definitions/grib2/localConcepts/ecmf/units.def @@ -548,12 +548,6 @@ parameterCategory = 128 ; parameterNumber = 123 ; } -#Surface emissivity -'dimensionless' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 124 ; - } #Vertically integrated total energy 'J m**-2' = { discipline = 192 ; @@ -624,18 +618,6 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Surface net radiation -'J m**-2' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 149 ; - } -#Top net radiation -'J m**-2' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 150 ; - } #Logarithm of surface pressure 'Numeric' = { discipline = 0 ; @@ -18871,12 +18853,6 @@ parameterCategory = 172 ; parameterNumber = 147 ; } -#Mean surface net radiation flux -'W m**-2' = { - discipline = 192 ; - parameterCategory = 172 ; - parameterNumber = 149 ; - } #Mean short-wave heating rate 'K s**-1' = { discipline = 192 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index a2463b165..b6a9ff34b 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -299,6 +299,13 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Surface emissivity +'Surface emissivity' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 62 ; + typeOfFirstFixedSurface = 1 ; + } #Total column vertically-integrated water vapour 'Total column vertically-integrated water vapour' = { discipline = 0 ; @@ -320,6 +327,22 @@ parameterCategory = 0 ; parameterNumber = 76 ; } +#Surface net radiation (SW and LW) +'Surface net radiation (SW and LW)' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Top net radiation (SW and LW) +'Top net radiation (SW and LW)' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } #Boundary layer height 'Boundary layer height' = { discipline = 0 ; @@ -3128,6 +3151,329 @@ parameterCategory = 1 ; parameterNumber = 30 ; } +#Vertical divergence +'Vertical divergence' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 59 ; + } +#Drag thermal coefficient +'Drag thermal coefficient' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 1 ; + } +#Drag evaporation coefficient +'Drag evaporation coefficient' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 61 ; + typeOfFirstFixedSurface = 1 ; + } +#Pressure departure from hydrostatic state +'Pressure departure from hydrostatic state' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 46 ; + } +#Surface net radiation flux (SW and LW) +'Surface net radiation flux (SW and LW)' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + } +#Top net radiation flux (SW and LW) +'Top net radiation flux (SW and LW)' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + } +#Time-mean top net radiation flux (SW and LW) +'Time-mean top net radiation flux (SW and LW)' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + typeOfStatisticalProcessing = 0 ; + } +#Global irradiance on tilted surfaces +'Global irradiance on tilted surfaces' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 47 ; + } +#Eady growth rate +'Eady growth rate' = { + discipline = 0 ; + parameterCategory = 21 ; + parameterNumber = 22 ; + } +#Tropical cyclones track density +'Tropical cyclones track density' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 4 ; + } +#Canopy air temperature +'Canopy air temperature' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 63 ; + } +#Soil wetness index (total layer) +'Soil wetness index (total layer)' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 151 ; + } +#Soil wetness index (root zone) +'Soil wetness index (root zone)' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 167 ; + } +#Soil wetness index (layer) +'Soil wetness index (layer)' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 151 ; + typeOfSecondFixedSurface = 151 ; + } +#Distance downward from roof surface +'Distance downward from roof surface' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 6 ; + } +#Distance inward from outer wall surface +'Distance inward from outer wall surface' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 7 ; + } +#Distance downward from road surface +'Distance downward from road surface' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 8 ; + } +#Renewable power capacity +'Renewable power capacity' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Renewable power production rate +'Renewable power production rate' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Renewable power production +'Renewable power production' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Wind power capacity +'Wind power capacity' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Wind power production rate +'Wind power production rate' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Wind power production +'Wind power production' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Solar photovoltaic (PV) power capacity +'Solar photovoltaic (PV) power capacity' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Solar photovoltaic (PV) power production rate +'Solar photovoltaic (PV) power production rate' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 5 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Solar photovoltaic (PV) power production +'Solar photovoltaic (PV) power production' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 5 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Graupel (snow pellets) precipitation +'Graupel (snow pellets) precipitation' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 75 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated total lightning flash density +'Time-integrated total lightning flash density' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Maximum total colum integrated graupel (snow pellets) +'Maximum total colum integrated graupel (snow pellets)' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 74 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 2 ; + } +#Minimum visibility +'Minimum visibility' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 3 ; + } +#Geometric height of theta level above ground +'Geometric height of theta level above ground' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 107 ; + } +#Pressure at cloud base +'Pressure at cloud base' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 2 ; + } +#Geometric height of adiabatic condensation level above ground +'Geometric height of adiabatic condensation level above ground' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 5 ; + } +#Geometric height of free convection level above ground +'Geometric height of free convection level above ground' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 14 ; + } +#Geometric height of neutral buoyancy above ground +'Geometric height of neutral buoyancy above ground' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 16 ; + } +#Geometric height of atmospheric isothermal level above ground +'Geometric height of atmospheric isothermal level above ground' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 20 ; + } +#Roof layer temperature +'Roof layer temperature' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 185 ; + } +#Wall layer temperature +'Wall layer temperature' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 186 ; + } +#Road layer temperature +'Road layer temperature' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + } +#Snow depth water equivalent on roof surface +'Snow depth water equivalent on roof surface' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 185 ; + } +#Snow depth water equivalent on road surface +'Snow depth water equivalent on road surface' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 187 ; + } +#Urban canyon temperature +'Urban canyon temperature' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + typeOfSecondFixedSurface = 185 ; + scaledValueOfFirstFixedSurface = 1 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 1 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Urban canyon specific humidity +'Urban canyon specific humidity' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + typeOfSecondFixedSurface = 185 ; + scaledValueOfFirstFixedSurface = 1 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 1 ; + scaleFactorOfSecondFixedSurface = 0 ; + } #Burned area 'Burned area' = { discipline = 2 ; @@ -3170,6 +3516,60 @@ parameterCategory = 4 ; parameterNumber = 25 ; } +#Live leaf fuel load +'Live leaf fuel load' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 27 ; + } +#Live wood fuel load +'Live wood fuel load ' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 28 ; + } +#Dead leaf fuel load +'Dead leaf fuel load' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + } +#Dead wood fuel load +'Dead wood fuel load' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + } +#Live fuel moisture content +'Live fuel moisture content' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 31 ; + } +#Fine dead leaf moisture content +'Fine dead leaf moisture content' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + } +#Dense dead leaf moisture content +'Dense dead leaf moisture content' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 33 ; + } +#Fine dead wood moisture content +'Fine dead wood moisture content' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + } +#Dense dead wood moisture content +'Dense dead wood moisture content' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + } #Time-integrated total column vertically-integrated eastward geopotential flux 'Time-integrated total column vertically-integrated eastward geopotential flux' = { discipline = 0 ; @@ -4161,6 +4561,14 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Total snow precipitation +'Total snow precipitation' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Total column integrated ozone 'Total column integrated ozone' = { discipline = 0 ; @@ -4797,6 +5205,20 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Saturation specific humidity with respect to water +'Saturation specific humidity with respect to water' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 168 ; + } +#Total column integrated saturation specific humidity with respect to water +'Total column integrated saturation specific humidity with respect to water' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 169 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #Universal thermal climate index 'Universal thermal climate index' = { discipline = 20 ; @@ -5733,6 +6155,54 @@ scaledValueOfSecondFixedSurface = 300 ; scaleFactorOfSecondFixedSurface = 0 ; } +#Sea surface salinity +'Sea surface salinity' = { + 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' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Vertically integrated sea water practical salinity in the upper 700 m +'Vertically integrated sea water practical salinity in the upper 700 m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Total column vertically integrated sea water practical salinity +'Total column vertically integrated sea water practical salinity' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea water practical salinity 'Sea water practical salinity' = { discipline = 10 ; @@ -6854,6 +7324,58 @@ scaleFactorOfSecondFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea surface salinity +'Time-mean sea surface salinity' = { + 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 +'Time-mean vertically integrated sea water practical salinity in the upper 300 m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically integrated sea water practical salinity in the upper 700 m +'Time-mean vertically integrated sea water practical salinity in the upper 700 m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total column vertically integrated sea water practical salinity +'Time-mean total column vertically integrated sea water practical salinity' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea water practical salinity 'Time-mean sea water practical salinity' = { discipline = 10 ; @@ -7943,6 +8465,14 @@ parameterNumber = 40 ; typeOfStatisticalProcessing = 1 ; } +#Time-mean surface net radiation flux (SW and LW) +'Time-mean surface net radiation flux (SW and LW)' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Surface runoff 'Surface runoff' = { discipline = 2 ; @@ -8708,12 +9238,6 @@ parameterCategory = 1 ; parameterNumber = 49 ; } -#Total snow precipitation -'Total snow precipitation' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 50 ; - } #Total column water (Vertically integrated total water (vapour + cloud water/ice)) 'Total column water (Vertically integrated total water (vapour + cloud water/ice))' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 1c7016a0b..03fe3e1b4 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -299,6 +299,13 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Surface emissivity +'124' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 62 ; + typeOfFirstFixedSurface = 1 ; + } #Total column vertically-integrated water vapour '137' = { discipline = 0 ; @@ -320,6 +327,22 @@ parameterCategory = 0 ; parameterNumber = 76 ; } +#Surface net radiation (SW and LW) +'149' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Top net radiation (SW and LW) +'150' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } #Boundary layer height '159' = { discipline = 0 ; @@ -3128,6 +3151,329 @@ parameterCategory = 1 ; parameterNumber = 30 ; } +#Vertical divergence +'231014' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 59 ; + } +#Drag thermal coefficient +'231015' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 1 ; + } +#Drag evaporation coefficient +'231016' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 61 ; + typeOfFirstFixedSurface = 1 ; + } +#Pressure departure from hydrostatic state +'231017' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 46 ; + } +#Surface net radiation flux (SW and LW) +'231018' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + } +#Top net radiation flux (SW and LW) +'231019' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + } +#Time-mean top net radiation flux (SW and LW) +'231020' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + typeOfStatisticalProcessing = 0 ; + } +#Global irradiance on tilted surfaces +'231021' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 47 ; + } +#Eady growth rate +'231022' = { + discipline = 0 ; + parameterCategory = 21 ; + parameterNumber = 22 ; + } +#Tropical cyclones track density +'231023' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 4 ; + } +#Canopy air temperature +'231024' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 63 ; + } +#Soil wetness index (total layer) +'231025' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 151 ; + } +#Soil wetness index (root zone) +'231026' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 167 ; + } +#Soil wetness index (layer) +'231027' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 151 ; + typeOfSecondFixedSurface = 151 ; + } +#Distance downward from roof surface +'231028' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 6 ; + } +#Distance inward from outer wall surface +'231029' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 7 ; + } +#Distance downward from road surface +'231030' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 8 ; + } +#Renewable power capacity +'231031' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Renewable power production rate +'231032' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Renewable power production +'231033' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Wind power capacity +'231034' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Wind power production rate +'231035' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Wind power production +'231036' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Solar photovoltaic (PV) power capacity +'231037' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Solar photovoltaic (PV) power production rate +'231038' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 5 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Solar photovoltaic (PV) power production +'231039' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 5 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Graupel (snow pellets) precipitation +'231040' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 75 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated total lightning flash density +'231041' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Maximum total colum integrated graupel (snow pellets) +'231042' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 74 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 2 ; + } +#Minimum visibility +'231043' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 3 ; + } +#Geometric height of theta level above ground +'231044' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 107 ; + } +#Pressure at cloud base +'231045' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 2 ; + } +#Geometric height of adiabatic condensation level above ground +'231046' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 5 ; + } +#Geometric height of free convection level above ground +'231047' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 14 ; + } +#Geometric height of neutral buoyancy above ground +'231048' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 16 ; + } +#Geometric height of atmospheric isothermal level above ground +'231049' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 20 ; + } +#Roof layer temperature +'231050' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 185 ; + } +#Wall layer temperature +'231051' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 186 ; + } +#Road layer temperature +'231052' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + } +#Snow depth water equivalent on roof surface +'231053' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 185 ; + } +#Snow depth water equivalent on road surface +'231054' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 187 ; + } +#Urban canyon temperature +'231055' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + typeOfSecondFixedSurface = 185 ; + scaledValueOfFirstFixedSurface = 1 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 1 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Urban canyon specific humidity +'231056' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + typeOfSecondFixedSurface = 185 ; + scaledValueOfFirstFixedSurface = 1 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 1 ; + scaleFactorOfSecondFixedSurface = 0 ; + } #Burned area '232000' = { discipline = 2 ; @@ -3170,6 +3516,60 @@ parameterCategory = 4 ; parameterNumber = 25 ; } +#Live leaf fuel load +'232007' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 27 ; + } +#Live wood fuel load +'232008' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 28 ; + } +#Dead leaf fuel load +'232009' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + } +#Dead wood fuel load +'232010' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + } +#Live fuel moisture content +'232011' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 31 ; + } +#Fine dead leaf moisture content +'232012' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + } +#Dense dead leaf moisture content +'232013' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 33 ; + } +#Fine dead wood moisture content +'232014' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + } +#Dense dead wood moisture content +'232015' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + } #Time-integrated total column vertically-integrated eastward geopotential flux '233000' = { discipline = 0 ; @@ -4161,6 +4561,14 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Total snow precipitation +'260046' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Total column integrated ozone '260132' = { discipline = 0 ; @@ -4797,6 +5205,20 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Saturation specific humidity with respect to water +'260656' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 168 ; + } +#Total column integrated saturation specific humidity with respect to water +'260657' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 169 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #Universal thermal climate index '261001' = { discipline = 20 ; @@ -5733,6 +6155,54 @@ scaledValueOfSecondFixedSurface = 300 ; scaleFactorOfSecondFixedSurface = 0 ; } +#Sea surface salinity +'262145' = { + 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' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Vertically integrated sea water practical salinity in the upper 700 m +'262147' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Total column vertically integrated sea water practical salinity +'262148' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea water practical salinity '262500' = { discipline = 10 ; @@ -6854,6 +7324,58 @@ scaleFactorOfSecondFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea surface salinity +'263145' = { + 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 +'263146' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically integrated sea water practical salinity in the upper 700 m +'263147' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total column vertically integrated sea water practical salinity +'263148' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea water practical salinity '263500' = { discipline = 10 ; @@ -7943,6 +8465,14 @@ parameterNumber = 40 ; typeOfStatisticalProcessing = 1 ; } +#Time-mean surface net radiation flux (SW and LW) +'172149' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Surface runoff '174008' = { discipline = 2 ; @@ -8708,12 +9238,6 @@ parameterCategory = 1 ; parameterNumber = 49 ; } -#Total snow precipitation -'260046' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 50 ; - } #Total column water (Vertically integrated total water (vapour + cloud water/ice)) '260047' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index e1c2c911d..5c9e9e73f 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -299,6 +299,13 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Surface emissivity +'emis' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 62 ; + typeOfFirstFixedSurface = 1 ; + } #Total column vertically-integrated water vapour 'tcwv' = { discipline = 0 ; @@ -320,6 +327,22 @@ parameterCategory = 0 ; parameterNumber = 76 ; } +#Surface net radiation (SW and LW) +'snr' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Top net radiation (SW and LW) +'tnr' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } #Boundary layer height 'blh' = { discipline = 0 ; @@ -3128,6 +3151,329 @@ parameterCategory = 1 ; parameterNumber = 30 ; } +#Vertical divergence +'vdiv' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 59 ; + } +#Drag thermal coefficient +'dtc' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 1 ; + } +#Drag evaporation coefficient +'dec' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 61 ; + typeOfFirstFixedSurface = 1 ; + } +#Pressure departure from hydrostatic state +'pdhs' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 46 ; + } +#Surface net radiation flux (SW and LW) +'snrf' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + } +#Top net radiation flux (SW and LW) +'tnrf' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + } +#Time-mean top net radiation flux (SW and LW) +'mtnrf' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + typeOfStatisticalProcessing = 0 ; + } +#Global irradiance on tilted surfaces +'gits' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 47 ; + } +#Eady growth rate +'eagr' = { + discipline = 0 ; + parameterCategory = 21 ; + parameterNumber = 22 ; + } +#Tropical cyclones track density +'tdtc' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 4 ; + } +#Canopy air temperature +'cant' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 63 ; + } +#Soil wetness index (total layer) +'swit' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 151 ; + } +#Soil wetness index (root zone) +'swir' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 167 ; + } +#Soil wetness index (layer) +'swil' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 151 ; + typeOfSecondFixedSurface = 151 ; + } +#Distance downward from roof surface +'ddrf' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 6 ; + } +#Distance inward from outer wall surface +'diws' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 7 ; + } +#Distance downward from road surface +'ddrd' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 8 ; + } +#Renewable power capacity +'rpc' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Renewable power production rate +'rppr' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Renewable power production +'rpp' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Wind power capacity +'wpc' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Wind power production rate +'wppr' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Wind power production +'wpp' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Solar photovoltaic (PV) power capacity +'pvpc' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Solar photovoltaic (PV) power production rate +'pvppr' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 5 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Solar photovoltaic (PV) power production +'pvpp' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 5 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Graupel (snow pellets) precipitation +'tgrp' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 75 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated total lightning flash density +'litotint' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Maximum total colum integrated graupel (snow pellets) +'maxtcg' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 74 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 2 ; + } +#Minimum visibility +'minvis' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 3 ; + } +#Geometric height of theta level above ground +'hthg' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 107 ; + } +#Pressure at cloud base +'pcdb' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 2 ; + } +#Geometric height of adiabatic condensation level above ground +'hacg' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 5 ; + } +#Geometric height of free convection level above ground +'hfcg' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 14 ; + } +#Geometric height of neutral buoyancy above ground +'hnbg' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 16 ; + } +#Geometric height of atmospheric isothermal level above ground +'haig' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 20 ; + } +#Roof layer temperature +'rflt' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 185 ; + } +#Wall layer temperature +'wlt' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 186 ; + } +#Road layer temperature +'rdlt' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + } +#Snow depth water equivalent on roof surface +'sdrf' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 185 ; + } +#Snow depth water equivalent on road surface +'sdrd' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 187 ; + } +#Urban canyon temperature +'uct' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + typeOfSecondFixedSurface = 185 ; + scaledValueOfFirstFixedSurface = 1 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 1 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Urban canyon specific humidity +'ucq' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + typeOfSecondFixedSurface = 185 ; + scaledValueOfFirstFixedSurface = 1 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 1 ; + scaleFactorOfSecondFixedSurface = 0 ; + } #Burned area 'fba' = { discipline = 2 ; @@ -3170,6 +3516,60 @@ parameterCategory = 4 ; parameterNumber = 25 ; } +#Live leaf fuel load +'llfl' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 27 ; + } +#Live wood fuel load +'lwfl' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 28 ; + } +#Dead leaf fuel load +'dlfl' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + } +#Dead wood fuel load +'dwfl' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + } +#Live fuel moisture content +'lfmc' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 31 ; + } +#Fine dead leaf moisture content +'fdlmc' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + } +#Dense dead leaf moisture content +'ddlmc' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 33 ; + } +#Fine dead wood moisture content +'fdwmc' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + } +#Dense dead wood moisture content +'ddwmc' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + } #Time-integrated total column vertically-integrated eastward geopotential flux 'tvige' = { discipline = 0 ; @@ -4161,6 +4561,14 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Total snow precipitation +'tsnowp' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Total column integrated ozone 'tcioz' = { discipline = 0 ; @@ -4797,6 +5205,20 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Saturation specific humidity with respect to water +'sqw' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 168 ; + } +#Total column integrated saturation specific humidity with respect to water +'tcsqw' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 169 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #Universal thermal climate index 'utci' = { discipline = 20 ; @@ -5733,6 +6155,54 @@ scaledValueOfSecondFixedSurface = 300 ; scaleFactorOfSecondFixedSurface = 0 ; } +#Sea surface salinity +'sss' = { + 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' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Vertically integrated sea water practical salinity in the upper 700 m +'sc700v' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Total column vertically integrated sea water practical salinity +'scbtv' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea water practical salinity 'so' = { discipline = 10 ; @@ -6854,6 +7324,58 @@ scaleFactorOfSecondFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea surface salinity +'avg_sss' = { + 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 +'avg_sc300v' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically integrated sea water practical salinity in the upper 700 m +'avg_sc700v' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total column vertically integrated sea water practical salinity +'avg_scbtv' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea water practical salinity 'avg_so' = { discipline = 10 ; @@ -7943,6 +8465,14 @@ parameterNumber = 40 ; typeOfStatisticalProcessing = 1 ; } +#Time-mean surface net radiation flux (SW and LW) +'msnrf' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Surface runoff 'sro' = { discipline = 2 ; @@ -8708,12 +9238,6 @@ parameterCategory = 1 ; parameterNumber = 49 ; } -#Total snow precipitation -'tsnowp' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 50 ; - } #Total column water (Vertically integrated total water (vapour + cloud water/ice)) 'tcwat' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 8e982beaf..cbc0ef50e 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -299,6 +299,13 @@ typeOfFirstFixedSurface = 1 ; typeOfSecondFixedSurface = 8 ; } +#Surface emissivity +'Proportion' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 62 ; + typeOfFirstFixedSurface = 1 ; + } #Total column vertically-integrated water vapour 'kg m**-2' = { discipline = 0 ; @@ -320,6 +327,22 @@ parameterCategory = 0 ; parameterNumber = 76 ; } +#Surface net radiation (SW and LW) +'J m**-2' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Top net radiation (SW and LW) +'J m**-2' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } #Boundary layer height 'm' = { discipline = 0 ; @@ -3128,6 +3151,329 @@ parameterCategory = 1 ; parameterNumber = 30 ; } +#Vertical divergence +'s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 59 ; + } +#Drag thermal coefficient +'Numeric' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 1 ; + } +#Drag evaporation coefficient +'Numeric' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 61 ; + typeOfFirstFixedSurface = 1 ; + } +#Pressure departure from hydrostatic state +'Pa' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 46 ; + } +#Surface net radiation flux (SW and LW) +'W m**-2' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + } +#Top net radiation flux (SW and LW) +'W m**-2' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + } +#Time-mean top net radiation flux (SW and LW) +'W m**-2' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 8 ; + typeOfStatisticalProcessing = 0 ; + } +#Global irradiance on tilted surfaces +'W m**-2' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 47 ; + } +#Eady growth rate +'day**-1' = { + discipline = 0 ; + parameterCategory = 21 ; + parameterNumber = 22 ; + } +#Tropical cyclones track density +'Numeric' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 4 ; + } +#Canopy air temperature +'K' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 63 ; + } +#Soil wetness index (total layer) +'Numeric' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 151 ; + } +#Soil wetness index (root zone) +'Numeric' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 167 ; + } +#Soil wetness index (layer) +'Numeric' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 151 ; + typeOfSecondFixedSurface = 151 ; + } +#Distance downward from roof surface +'m' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 6 ; + } +#Distance inward from outer wall surface +'m' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 7 ; + } +#Distance downward from road surface +'m' = { + discipline = 2 ; + parameterCategory = 6 ; + parameterNumber = 8 ; + } +#Renewable power capacity +'W' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Renewable power production rate +'W' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Renewable power production +'W s' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Wind power capacity +'W' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Wind power production rate +'W' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Wind power production +'W s' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 3 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Solar photovoltaic (PV) power capacity +'W' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Solar photovoltaic (PV) power production rate +'W' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 5 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } +#Solar photovoltaic (PV) power production +'W s' = { + discipline = 20 ; + parameterCategory = 3 ; + parameterNumber = 5 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Graupel (snow pellets) precipitation +'kg m**-2' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 75 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Time-integrated total lightning flash density +'km**-2' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 1 ; + } +#Maximum total colum integrated graupel (snow pellets) +'kg m**-2' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 74 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + typeOfStatisticalProcessing = 2 ; + } +#Minimum visibility +'m' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 3 ; + } +#Geometric height of theta level above ground +'m' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 107 ; + } +#Pressure at cloud base +'Pa' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 2 ; + } +#Geometric height of adiabatic condensation level above ground +'m' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 5 ; + } +#Geometric height of free convection level above ground +'m' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 14 ; + } +#Geometric height of neutral buoyancy above ground +'m' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 16 ; + } +#Geometric height of atmospheric isothermal level above ground +'m' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 20 ; + } +#Roof layer temperature +'K' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 185 ; + } +#Wall layer temperature +'K' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 186 ; + } +#Road layer temperature +'K' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + } +#Snow depth water equivalent on roof surface +'kg m**-2' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 185 ; + } +#Snow depth water equivalent on road surface +'kg m**-2' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 60 ; + typeOfFirstFixedSurface = 187 ; + } +#Urban canyon temperature +'K' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + typeOfSecondFixedSurface = 185 ; + scaledValueOfFirstFixedSurface = 1 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 1 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Urban canyon specific humidity +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 187 ; + typeOfSecondFixedSurface = 185 ; + scaledValueOfFirstFixedSurface = 1 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 1 ; + scaleFactorOfSecondFixedSurface = 0 ; + } #Burned area '%' = { discipline = 2 ; @@ -3170,6 +3516,60 @@ parameterCategory = 4 ; parameterNumber = 25 ; } +#Live leaf fuel load +'kg m**-2' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 27 ; + } +#Live wood fuel load +'kg m**-2' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 28 ; + } +#Dead leaf fuel load +'kg m**-2' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + } +#Dead wood fuel load +'kg m**-2' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + } +#Live fuel moisture content +'kg kg**-1' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 31 ; + } +#Fine dead leaf moisture content +'kg kg**-1' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + } +#Dense dead leaf moisture content +'kg kg**-1' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 33 ; + } +#Fine dead wood moisture content +'kg kg**-1' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + } +#Dense dead wood moisture content +'kg kg**-1' = { + discipline = 2 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + } #Time-integrated total column vertically-integrated eastward geopotential flux 'J m**-1' = { discipline = 0 ; @@ -4161,6 +4561,14 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Total snow precipitation +'kg m**-2' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Total column integrated ozone 'DU' = { discipline = 0 ; @@ -4797,6 +5205,20 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Saturation specific humidity with respect to water +'kg m**-3' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 168 ; + } +#Total column integrated saturation specific humidity with respect to water +'kg m**-2' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 169 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #Universal thermal climate index 'K' = { discipline = 20 ; @@ -5733,6 +6155,54 @@ scaledValueOfSecondFixedSurface = 300 ; scaleFactorOfSecondFixedSurface = 0 ; } +#Sea surface salinity +'kg kg**-1' = { + 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' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Vertically integrated sea water practical salinity in the upper 700 m +'g kg**-1 m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Total column vertically integrated sea water practical salinity +'g kg**-1 m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea water practical salinity 'g kg**-1' = { discipline = 10 ; @@ -6854,6 +7324,58 @@ scaleFactorOfSecondFixedSurface = 0 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea surface salinity +'kg kg**-1' = { + 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 +'g kg**-1 m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically integrated sea water practical salinity in the upper 700 m +'g kg**-1 m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total column vertically integrated sea water practical salinity +'g kg**-1 m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea water practical salinity 'g kg**-1' = { discipline = 10 ; @@ -7943,6 +8465,14 @@ parameterNumber = 40 ; typeOfStatisticalProcessing = 1 ; } +#Time-mean surface net radiation flux (SW and LW) +'W m**-2' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 46 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 0 ; + } #Surface runoff 'kg m**-2' = { discipline = 2 ; @@ -8708,12 +9238,6 @@ parameterCategory = 1 ; parameterNumber = 49 ; } -#Total snow precipitation -'kg m**-2' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 50 ; - } #Total column water (Vertically integrated total water (vapour + cloud water/ice)) 'kg m**-2' = { discipline = 0 ; From bcb83cc5cca6bd0257390e7a1be0d7b699374b91 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 18 Nov 2023 14:30:33 +0000 Subject: [PATCH 78/81] ECC-1720: Legacy encodings --- .../localConcepts/ecmf/cfVarName.legacy.def | 24 +++++++++++++++++++ .../grib2/localConcepts/ecmf/name.legacy.def | 24 +++++++++++++++++++ .../localConcepts/ecmf/paramId.legacy.def | 24 +++++++++++++++++++ .../localConcepts/ecmf/shortName.legacy.def | 24 +++++++++++++++++++ .../grib2/localConcepts/ecmf/units.legacy.def | 24 +++++++++++++++++++ 5 files changed, 120 insertions(+) diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def index c5a21c0c6..27f6cde86 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def @@ -1315,3 +1315,27 @@ parameterCategory = 228 ; parameterNumber = 4 ; } +#Mean surface net radiation flux +'msnrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 149 ; +} +#Surface net radiation +'snr' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 149 ; +} +#Top net radiation +'tnr' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 150 ; +} +#Surface emissivity +'emis' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 124 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/name.legacy.def b/definitions/grib2/localConcepts/ecmf/name.legacy.def index b0a63cda1..01695cdf0 100644 --- a/definitions/grib2/localConcepts/ecmf/name.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/name.legacy.def @@ -1315,3 +1315,27 @@ parameterCategory = 228 ; parameterNumber = 4 ; } +#Mean surface net radiation flux +'Mean surface net radiation flux' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 149 ; +} +#Surface net radiation +'Surface net radiation' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 149 ; +} +#Top net radiation +'Top net radiation' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 150 ; +} +#Surface emissivity +'Surface emissivity' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 124 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def index 147ebf63e..6c8e0c585 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def @@ -1315,3 +1315,27 @@ parameterCategory = 228 ; parameterNumber = 4 ; } +#Mean surface net radiation flux +'172149' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 149 ; +} +#Surface net radiation +'149' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 149 ; +} +#Top net radiation +'150' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 150 ; +} +#Surface emissivity +'124' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 124 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def index 22dcd00d3..655244bc1 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def @@ -1315,3 +1315,27 @@ parameterCategory = 228 ; parameterNumber = 4 ; } +#Mean surface net radiation flux +'msnrf' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 149 ; +} +#Surface net radiation +'snr' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 149 ; +} +#Top net radiation +'tnr' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 150 ; +} +#Surface emissivity +'emis' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 124 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/units.legacy.def b/definitions/grib2/localConcepts/ecmf/units.legacy.def index 73f7514db..20bce98cf 100644 --- a/definitions/grib2/localConcepts/ecmf/units.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/units.legacy.def @@ -1315,3 +1315,27 @@ parameterCategory = 228 ; parameterNumber = 4 ; } +#Mean surface net radiation flux +'W m**-2' = { + discipline = 192 ; + parameterCategory = 172 ; + parameterNumber = 149 ; +} +#Surface net radiation +'J m**-2' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 149 ; +} +#Top net radiation +'J m**-2' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 150 ; +} +#Surface emissivity +'dimensionless' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 124 ; +} From 6ba0eb0f3463f96684c657617cf98712f30767c2 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 20 Nov 2023 16:38:48 +0000 Subject: [PATCH 79/81] ECC-1719: Tweaks to parameter long names and the definitions of 231055 and 231056 --- definitions/grib2/cfVarName.def | 22 +++++++------------- definitions/grib2/name.def | 36 +++++++++++++-------------------- definitions/grib2/paramId.def | 22 +++++++------------- definitions/grib2/shortName.def | 26 +++++++++--------------- definitions/grib2/units.def | 22 +++++++------------- 5 files changed, 44 insertions(+), 84 deletions(-) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 9dfb6eeb6..12d46a815 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -3357,7 +3357,7 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 1 ; } -#Maximum total colum integrated graupel (snow pellets) +#Maximum total column integrated graupel (snow pellets) 'maxtcg' = { discipline = 0 ; parameterCategory = 1 ; @@ -3401,7 +3401,7 @@ parameterNumber = 34 ; typeOfFirstFixedSurface = 14 ; } -#Geometric height of neutral buoyancy above ground +#Geometric height of neutral buoyancy level above ground 'hnbg' = { discipline = 0 ; parameterCategory = 3 ; @@ -3415,35 +3415,35 @@ parameterNumber = 34 ; typeOfFirstFixedSurface = 20 ; } -#Roof layer temperature +#Roof temperature 'rflt' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 185 ; } -#Wall layer temperature +#Wall temperature 'wlt' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 186 ; } -#Road layer temperature +#Road temperature 'rdlt' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; } -#Snow depth water equivalent on roof surface +#Snow depth water equivalent on roof 'sdrf' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 60 ; typeOfFirstFixedSurface = 185 ; } -#Snow depth water equivalent on road surface +#Snow depth water equivalent on road 'sdrd' = { discipline = 0 ; parameterCategory = 1 ; @@ -3457,10 +3457,6 @@ parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; typeOfSecondFixedSurface = 185 ; - scaledValueOfFirstFixedSurface = 1 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 1 ; - scaleFactorOfSecondFixedSurface = 0 ; } #Urban canyon specific humidity 'ucq' = { @@ -3469,10 +3465,6 @@ parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; typeOfSecondFixedSurface = 185 ; - scaledValueOfFirstFixedSurface = 1 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 1 ; - scaleFactorOfSecondFixedSurface = 0 ; } #Burned area 'fba' = { diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index b6a9ff34b..72285ea59 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -3357,8 +3357,8 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 1 ; } -#Maximum total colum integrated graupel (snow pellets) -'Maximum total colum integrated graupel (snow pellets)' = { +#Maximum total column integrated graupel (snow pellets) +'Maximum total column integrated graupel (snow pellets)' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 74 ; @@ -3401,8 +3401,8 @@ parameterNumber = 34 ; typeOfFirstFixedSurface = 14 ; } -#Geometric height of neutral buoyancy above ground -'Geometric height of neutral buoyancy above ground' = { +#Geometric height of neutral buoyancy level above ground +'Geometric height of neutral buoyancy level above ground' = { discipline = 0 ; parameterCategory = 3 ; parameterNumber = 34 ; @@ -3415,36 +3415,36 @@ parameterNumber = 34 ; typeOfFirstFixedSurface = 20 ; } -#Roof layer temperature -'Roof layer temperature' = { +#Roof temperature +'Roof temperature' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 185 ; } -#Wall layer temperature -'Wall layer temperature' = { +#Wall temperature +'Wall temperature' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 186 ; } -#Road layer temperature -'Road layer temperature' = { +#Road temperature +'Road temperature' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; } -#Snow depth water equivalent on roof surface -'Snow depth water equivalent on roof surface' = { +#Snow depth water equivalent on roof +'Snow depth water equivalent on roof' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 60 ; typeOfFirstFixedSurface = 185 ; } -#Snow depth water equivalent on road surface -'Snow depth water equivalent on road surface' = { +#Snow depth water equivalent on road +'Snow depth water equivalent on road' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 60 ; @@ -3457,10 +3457,6 @@ parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; typeOfSecondFixedSurface = 185 ; - scaledValueOfFirstFixedSurface = 1 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 1 ; - scaleFactorOfSecondFixedSurface = 0 ; } #Urban canyon specific humidity 'Urban canyon specific humidity' = { @@ -3469,10 +3465,6 @@ parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; typeOfSecondFixedSurface = 185 ; - scaledValueOfFirstFixedSurface = 1 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 1 ; - scaleFactorOfSecondFixedSurface = 0 ; } #Burned area 'Burned area' = { diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 03fe3e1b4..dacec41e7 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -3357,7 +3357,7 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 1 ; } -#Maximum total colum integrated graupel (snow pellets) +#Maximum total column integrated graupel (snow pellets) '231042' = { discipline = 0 ; parameterCategory = 1 ; @@ -3401,7 +3401,7 @@ parameterNumber = 34 ; typeOfFirstFixedSurface = 14 ; } -#Geometric height of neutral buoyancy above ground +#Geometric height of neutral buoyancy level above ground '231048' = { discipline = 0 ; parameterCategory = 3 ; @@ -3415,35 +3415,35 @@ parameterNumber = 34 ; typeOfFirstFixedSurface = 20 ; } -#Roof layer temperature +#Roof temperature '231050' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 185 ; } -#Wall layer temperature +#Wall temperature '231051' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 186 ; } -#Road layer temperature +#Road temperature '231052' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; } -#Snow depth water equivalent on roof surface +#Snow depth water equivalent on roof '231053' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 60 ; typeOfFirstFixedSurface = 185 ; } -#Snow depth water equivalent on road surface +#Snow depth water equivalent on road '231054' = { discipline = 0 ; parameterCategory = 1 ; @@ -3457,10 +3457,6 @@ parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; typeOfSecondFixedSurface = 185 ; - scaledValueOfFirstFixedSurface = 1 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 1 ; - scaleFactorOfSecondFixedSurface = 0 ; } #Urban canyon specific humidity '231056' = { @@ -3469,10 +3465,6 @@ parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; typeOfSecondFixedSurface = 185 ; - scaledValueOfFirstFixedSurface = 1 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 1 ; - scaleFactorOfSecondFixedSurface = 0 ; } #Burned area '232000' = { diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 5c9e9e73f..7ba480e0b 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -3357,7 +3357,7 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 1 ; } -#Maximum total colum integrated graupel (snow pellets) +#Maximum total column integrated graupel (snow pellets) 'maxtcg' = { discipline = 0 ; parameterCategory = 1 ; @@ -3401,7 +3401,7 @@ parameterNumber = 34 ; typeOfFirstFixedSurface = 14 ; } -#Geometric height of neutral buoyancy above ground +#Geometric height of neutral buoyancy level above ground 'hnbg' = { discipline = 0 ; parameterCategory = 3 ; @@ -3415,35 +3415,35 @@ parameterNumber = 34 ; typeOfFirstFixedSurface = 20 ; } -#Roof layer temperature -'rflt' = { +#Roof temperature +'rft' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 185 ; } -#Wall layer temperature +#Wall temperature 'wlt' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 186 ; } -#Road layer temperature -'rdlt' = { +#Road temperature +'rdt' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; } -#Snow depth water equivalent on roof surface +#Snow depth water equivalent on roof 'sdrf' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 60 ; typeOfFirstFixedSurface = 185 ; } -#Snow depth water equivalent on road surface +#Snow depth water equivalent on road 'sdrd' = { discipline = 0 ; parameterCategory = 1 ; @@ -3457,10 +3457,6 @@ parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; typeOfSecondFixedSurface = 185 ; - scaledValueOfFirstFixedSurface = 1 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 1 ; - scaleFactorOfSecondFixedSurface = 0 ; } #Urban canyon specific humidity 'ucq' = { @@ -3469,10 +3465,6 @@ parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; typeOfSecondFixedSurface = 185 ; - scaledValueOfFirstFixedSurface = 1 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 1 ; - scaleFactorOfSecondFixedSurface = 0 ; } #Burned area 'fba' = { diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index cbc0ef50e..4d2ae52da 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -3357,7 +3357,7 @@ typeOfSecondFixedSurface = 8 ; typeOfStatisticalProcessing = 1 ; } -#Maximum total colum integrated graupel (snow pellets) +#Maximum total column integrated graupel (snow pellets) 'kg m**-2' = { discipline = 0 ; parameterCategory = 1 ; @@ -3401,7 +3401,7 @@ parameterNumber = 34 ; typeOfFirstFixedSurface = 14 ; } -#Geometric height of neutral buoyancy above ground +#Geometric height of neutral buoyancy level above ground 'm' = { discipline = 0 ; parameterCategory = 3 ; @@ -3415,35 +3415,35 @@ parameterNumber = 34 ; typeOfFirstFixedSurface = 20 ; } -#Roof layer temperature +#Roof temperature 'K' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 185 ; } -#Wall layer temperature +#Wall temperature 'K' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 186 ; } -#Road layer temperature +#Road temperature 'K' = { discipline = 0 ; parameterCategory = 0 ; parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; } -#Snow depth water equivalent on roof surface +#Snow depth water equivalent on roof 'kg m**-2' = { discipline = 0 ; parameterCategory = 1 ; parameterNumber = 60 ; typeOfFirstFixedSurface = 185 ; } -#Snow depth water equivalent on road surface +#Snow depth water equivalent on road 'kg m**-2' = { discipline = 0 ; parameterCategory = 1 ; @@ -3457,10 +3457,6 @@ parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; typeOfSecondFixedSurface = 185 ; - scaledValueOfFirstFixedSurface = 1 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 1 ; - scaleFactorOfSecondFixedSurface = 0 ; } #Urban canyon specific humidity 'kg kg**-1' = { @@ -3469,10 +3465,6 @@ parameterNumber = 0 ; typeOfFirstFixedSurface = 187 ; typeOfSecondFixedSurface = 185 ; - scaledValueOfFirstFixedSurface = 1 ; - scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 1 ; - scaleFactorOfSecondFixedSurface = 0 ; } #Burned area '%' = { From ddc1d47a6d8e6ec2d66686edf12d2bdbffdddb44 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 20 Nov 2023 16:52:49 +0000 Subject: [PATCH 80/81] ECC-1719: Fix levtypes and typeOfLevel --- definitions/grib2/marsLevtypeConcept.def | 12 ++++++++++++ definitions/grib2/typeOfLevelConcept.def | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/definitions/grib2/marsLevtypeConcept.def b/definitions/grib2/marsLevtypeConcept.def index 109473e86..4f9c8ae0b 100644 --- a/definitions/grib2/marsLevtypeConcept.def +++ b/definitions/grib2/marsLevtypeConcept.def @@ -66,3 +66,15 @@ 'sfc' = {typeOfFirstFixedSurface=177; typeOfSecondFixedSurface=255;} 'o2d' = {typeOfFirstFixedSurface=188; typeOfSecondFixedSurface=189;} +'sfc' = {typeOfFirstFixedSurface=5; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=14; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=16; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=151;} +'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=167;} +'sol' = {typeOfFirstFixedSurface=185; typeOfSecondFixedSurface=255;} +'sol' = {typeOfFirstFixedSurface=185; typeOfSecondFixedSurface=185;} +'sol' = {typeOfFirstFixedSurface=186; typeOfSecondFixedSurface=255;} +'sol' = {typeOfFirstFixedSurface=186; typeOfSecondFixedSurface=186;} +'sol' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=255;} +'sol' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=187;} +'sfc' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=185;} diff --git a/definitions/grib2/typeOfLevelConcept.def b/definitions/grib2/typeOfLevelConcept.def index 30fad4464..a32abd7e0 100644 --- a/definitions/grib2/typeOfLevelConcept.def +++ b/definitions/grib2/typeOfLevelConcept.def @@ -87,3 +87,13 @@ scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=0;} 'waterSurfaceToIsothermalOceanLayer' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=20; scaledValueOfFirstFixedSurface=0; scaleFactorOfFirstFixedSurface=0;} + +'totalSoilLayer' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=151;} +'rootZone' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=167;} +'roof' = {typeOfFirstFixedSurface=185; typeOfSecondFixedSurface=255;} +'roofLayer' = {typeOfFirstFixedSurface=185; typeOfSecondFixedSurface=185;} +'wall' = {typeOfFirstFixedSurface=186; typeOfSecondFixedSurface=255;} +'wallLayer' = {typeOfFirstFixedSurface=186; typeOfSecondFixedSurface=186;} +'road' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=255;} +'roadLayer' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=187;} +'urbanCanyon' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=185;} From 2d128f5b6c99ab2fed0f6a0173935f8f9e855e3c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 20 Nov 2023 20:53:33 +0000 Subject: [PATCH 81/81] ECC-1722: API: Allow setting integer key as missing via codes_set_string --- examples/C/grib_set_missing.c | 4 ++++ src/grib_accessor_class_long.cc | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/C/grib_set_missing.c b/examples/C/grib_set_missing.c index 543bb1db3..2b8b036e4 100644 --- a/examples/C/grib_set_missing.c +++ b/examples/C/grib_set_missing.c @@ -59,6 +59,10 @@ int main(int argc, char** argv) CODES_CHECK(codes_set_missing(h, "scaleFactorOfFirstFixedSurface"), 0); CODES_CHECK(codes_set_missing(h, "scaledValueOfFirstFixedSurface"), 0); + /* Can also set to MISSING via codes_set_string */ + CODES_CHECK(codes_set_string(h, "scaleFactorOfFirstFixedSurface", "missing", &str_len), 0); + CODES_CHECK(codes_set_string(h, "scaledValueOfFirstFixedSurface", "missing", &str_len), 0); + /* see GRIB-490 */ CODES_CHECK(codes_get_long(h, "Ni", &Ni), 0); is_missing = codes_is_missing(h, "Ni", &err); diff --git a/src/grib_accessor_class_long.cc b/src/grib_accessor_class_long.cc index 1f97a539e..7fa0e5846 100644 --- a/src/grib_accessor_class_long.cc +++ b/src/grib_accessor_class_long.cc @@ -257,10 +257,10 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) { long v = 0; /* The converted value */ - // Requires more work e.g. filter - //if (strcmp_nocase(val, "missing")==0) { - // return pack_missing(a); - //} + // ECC-1722 + if (strcmp_nocase(val, "missing")==0) { + return pack_missing(a); + } if (string_to_long(val, &v, 1) != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR,