From 6c55384c1d46834815b3b08683b8a37716bfa6a0 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 31 Oct 2019 13:53:35 +0000 Subject: [PATCH] ECC-1006: New GRIB1/GRIB2 local definitions for Seasonal forecast monthly means for lagged systems (Part 1) --- definitions/grib1/local.98.12.def | 64 +++++++++++++++++++ .../grib1/localDefinitionNumber.98.table | 1 + .../grib2/grib2LocalSectionNumber.98.table | 1 + definitions/grib2/local.98.12.def | 12 ++++ src/grib_accessor_class_local_definition.c | 1 + tests/grib_padding.sh | 1 + 6 files changed, 80 insertions(+) create mode 100644 definitions/grib1/local.98.12.def create mode 100644 definitions/grib2/local.98.12.def diff --git a/definitions/grib1/local.98.12.def b/definitions/grib1/local.98.12.def new file mode 100644 index 000000000..91a7a7626 --- /dev/null +++ b/definitions/grib1/local.98.12.def @@ -0,0 +1,64 @@ +# Copyright 2005-2019 ECMWF. + +# Seasonal forecast monthly mean data for lagged systems + +constant GRIBEXSection1Problem = 120 - section1Length ; + +# used in local definition 13 +transient localFlag=1 : hidden; + +template mars_labeling "grib1/mars_labeling.def"; + +unsigned[2] perturbationNumber : dump ; + +unsigned[2] systemNumber : dump ; + +unsigned[2] methodNumber : dump ; + +unsigned[4] verifyingMonth : dump ; + +meta endOfInterval g1end_of_interval_monthly(verifyingMonth); + +meta yearOfEndOfOverallTimeInterval vector(endOfInterval,0); +meta monthOfEndOfOverallTimeInterval vector(endOfInterval,1); +meta dayOfEndOfOverallTimeInterval vector(endOfInterval,2); +meta hourOfEndOfOverallTimeInterval vector(endOfInterval,3); +meta minuteOfEndOfOverallTimeInterval vector(endOfInterval,4); +meta secondOfEndOfOverallTimeInterval vector(endOfInterval,5); + +transient hourOfEndOfOverallTimeInterval=23 : no_copy; +transient minuteOfEndOfOverallTimeInterval=59 : no_copy; +transient secondOfEndOfOverallTimeInterval=59 : no_copy; + +transient indicatorOfUnitForTimeRange=3; +transient lengthOfTimeRange=1; +unsigned[1] averagingPeriod : dump ; + +transient typeOfStatisticalProcessing=0; +transient indicatorOfUnitForTimeIncrement = 1; +transient timeIncrement=averagingPeriod; + +unsigned[2] forecastMonth : dump ; +remove forecastTime; +transient forecastTime=forecastMonth - 1; +#remove typeOfTimeIncrement; +transient typeOfTimeIncrement = 3; + +# Old GRIBS do not have forecast forecastMonth set. It is computed from verifyingMonth +meta marsForecastMonth g1forecastmonth(verifyingMonth,dataDate,day,hour,forecastMonth) : read_only; + +alias origin = centre; +alias number = perturbationNumber; +alias system = systemNumber; +alias method = methodNumber; + +# ECC-679 +unsigned[2] numberOfForecastsInEnsemble : dump ; +alias totalNumber=numberOfForecastsInEnsemble; + +unsigned[4] indexingDate: dump; # MARS archiving date (YYYYMMDD) +unsigned[2] indexingTime: dump; # MARS archiving time (HHMM) + + +# spareSetToZero +pad padding_loc12_1(50); diff --git a/definitions/grib1/localDefinitionNumber.98.table b/definitions/grib1/localDefinitionNumber.98.table index 28a156738..dda47507b 100644 --- a/definitions/grib1/localDefinitionNumber.98.table +++ b/definitions/grib1/localDefinitionNumber.98.table @@ -9,6 +9,7 @@ 9 9 Singular vectors and ensemble perturbations 10 10 EPS tubes 11 11 Supplementary data used by the analysis +12 12 Seasonal forecast monthly mean data for lagged systems 13 13 Wave 2D spectra direction and frequency 14 14 Brightness temperature 15 15 Seasonal forecast data diff --git a/definitions/grib2/grib2LocalSectionNumber.98.table b/definitions/grib2/grib2LocalSectionNumber.98.table index 051b1c918..c40763096 100644 --- a/definitions/grib2/grib2LocalSectionNumber.98.table +++ b/definitions/grib2/grib2LocalSectionNumber.98.table @@ -4,6 +4,7 @@ 7 7 Sensitivity data 9 9 Singular vectors and ensemble perturbations 11 11 Supplementary data used by the analysis +12 12 Seasonal forecast monthly mean data for lagged systems 14 14 Brightness temperature 15 15 Seasonal forecast data 16 16 Seasonal forecast monthly mean data diff --git a/definitions/grib2/local.98.12.def b/definitions/grib2/local.98.12.def new file mode 100644 index 000000000..8664ac4bc --- /dev/null +++ b/definitions/grib2/local.98.12.def @@ -0,0 +1,12 @@ +# Seasonal forecast monthly mean data for lagged systems + +unsigned[2] systemNumber : dump; +unsigned[2] methodNumber : dump; + +alias local.systemNumber=systemNumber; +alias local.methodNumber=methodNumber; + +unsigned[4] indexingDate: dump; # MARS archiving date (YYYYMMDD) +unsigned[2] indexingTime: dump; # MARS archiving time (HHMM) + +pad padding_loc12_1(50); diff --git a/src/grib_accessor_class_local_definition.c b/src/grib_accessor_class_local_definition.c index 952683fae..fa8fb365d 100644 --- a/src/grib_accessor_class_local_definition.c +++ b/src/grib_accessor_class_local_definition.c @@ -284,6 +284,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) case 15: /* Seasonal forecast data */ case 16: /* Seasonal forecast monthly mean data */ + case 12: /* Seasonal forecast monthly mean data for lagged systems */ case 18: /* Multianalysis ensemble data */ case 26: /* MARS labelling or ensemble forecast data */ case 30: /* Forecasting Systems with Variable Resolution */ diff --git a/tests/grib_padding.sh b/tests/grib_padding.sh index 79ec46aed..eb9634900 100755 --- a/tests/grib_padding.sh +++ b/tests/grib_padding.sh @@ -28,6 +28,7 @@ localDefinitions=`find ${def_dir}/grib1/ -name 'local.98.*def' | sed -e 's:.*/:: awk 'BEGIN {FS=".";} {print $3;}' |\ grep -v def |\ sed '/245/d' |\ + sed '/12/d' |\ sed '/244/d' |\ sed '/192/d' |\ xargs`