diff --git a/definitions/grib2/products_crra.def b/definitions/grib2/products_crra.def index 003a282f0..a0c531921 100644 --- a/definitions/grib2/products_crra.def +++ b/definitions/grib2/products_crra.def @@ -75,24 +75,73 @@ concept marsType(unknown) { } } +# get the values from the 1st most outer loop which matter! +# aarays should be implemented in ecCodes as for bufr i.e. outerLoopLengthOfTimeRange[0] => #0#lengthOfTimeRange +meta outerLoopLengthOfTimeRange element(lengthOfTimeRange, 0); +meta outerLoopTypeOfStatisticalProcessing element(typeOfStatisticalProcessing, 0); +meta outerLoopTypeOfTimeIncrement element(typeOfTimeIncrement, 0); + # See GRIB-205 re no_copy # Cannot use typeOfProcessedData for stream. See GRIB-911 concept marsStream(unknown) { oper = { - productDefinitionTemplateNumber = 8; + productDefinitionTemplateNumber = 0; } oper = { - productDefinitionTemplateNumber = 0; + productDefinitionTemplateNumber = 8; } - enda = { productDefinitionTemplateNumber = 11; } enda = { productDefinitionTemplateNumber = 1; } -} : no_copy; + moda = { + productDefinitionTemplateNumber = 8; + outerLoopTypeOfTimeIncrement = 1; + } + # avgd, mind, maxd + dame = { + productDefinitionTemplateNumber = 8; + outerLoopTypeOfTimeIncrement = 1; + outerLoopLengthOfTimeRange = 21; + } + # accumd + dame = { + productDefinitionTemplateNumber = 8; + outerLoopTypeOfTimeIncrement = 1; + outerLoopLengthOfTimeRange = 24; + } +} : no_copy,read_only; alias mars.stream = marsStream; alias mars.type = marsType; + +if (marsStream is "moda") { + + meta verificationDate g1verificationdate(dataDate, dataTime, outerLoopLengthOfTimeRange) : read_only; + meta monthlyVerificationDate g1monthlydate(verificationDate) : no_copy; + alias mars.date = monthlyVerificationDate; + + unalias mars.time; + unalias mars.step; +} + +if (marsStream is "dame") { + + if (!(outerLoopTypeOfStatisticalProcessing == 3 || outerLoopTypeOfStatisticalProcessing == 2)) { + # not mind or maxd + alias mars.date = validityDate; + } + + if (outerLoopLengthOfTimeRange == 24) { + # accumd + meta verificationDate g1verificationdate(dataDate, dataTime, outerLoopLengthOfTimeRange) : read_only; + alias mars.date = verificationDate; + + } + + unalias mars.time; + unalias mars.step; +} diff --git a/definitions/mars/stream.table b/definitions/mars/stream.table index 446d5e6b0..d41e21eee 100644 --- a/definitions/mars/stream.table +++ b/definitions/mars/stream.table @@ -71,6 +71,7 @@ 1097 smma Seasonal monthly means anomalies 1098 clte Climate run output 1099 clmn Climate run monthly means output +1100 dame Daily means 1110 seap Sensitive area prediction 1120 eefh Extended ensemble forecast hindcast 1121 eehs Extended ensemble forecast hindcast statistics