# Copyright 2005-2017 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# 
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#

# START 1/local.98.23 ----------------------------------------------------------------------
# LOCAL 98 23
#
# localDefinitionTemplate_023
# ---------------------------
#
# Description            Octet    Code    Ksec1    Count
# -----------            -----    ----    -----    -----
#localDefinitionNumber       41  I1  37  -
#class                       42  I1  38  -
#type                        43  I1  39  -
#stream                      44  I2  40  -
#experimentVersionNumber     46  A4  41  -
#ensembleNumber              50  I2  42  -
#totalNumber                 81  I2  43  -
#systemNumber                52  I2  44  -
#methodNumber                54  I2  45  -
#verifyingMonth              56  I4  46  -
#averagingPeriod             60  I1  47  -
#forecastMonth               61  I2  48  -
#referenceDate               63  I4  49  -
#climateDateFrom             67  I4  50  -
#climateDateTo               71  I4  51  -
#unitsDecimalScaleFactor     75  S1  52  -
#thresholdIndicator          76  I1  53  -
#lowerThresholdValue         77  I2  54  -
#upperThresholdValue         79  I2  55  -
#spareSetToZero              83  PAD 56  2
#

constant GRIBEXSection1Problem = 84 - section1Length ;

#used in local definition 13
transient localFlag=2 : hidden;

template mars_labeling "grib1/mars_labeling.def";
#1->2
alias grib2LocalSectionPresent=present;
constant grib2LocalSectionNumber=23;

unsigned[2] perturbationNumber  : dump;

# unsigned[2] numberOfForecastsInEnsemble  : dump;

unsigned[2] systemNumber  : dump;
unsigned[2] methodNumber  : dump;
unsigned[4] verifyingMonth : dump;
unsigned[1] averagingPeriod : dump ;
unsigned[2] forecastMonth : dump ;
unsigned[4] referenceDate  : dump;
unsigned[4] climateDateFrom  : dump;
unsigned[4] climateDateTo : dump;
signed[1] unitsDecimalScaleFactor  : dump;
unsigned[1] thresholdIndicator  : dump;
unsigned[2] lowerThresholdValue  : dump;
unsigned[2] upperThresholdValue  : dump;

alias local.systemNumber=systemNumber;
alias local.methodNumber=methodNumber;
alias local.verifyingMonth=verifyingMonth ;
alias local.averagingPeriod=averagingPeriod  ;
alias local.forecastMonth=forecastMonth ;
alias local.referenceDate=referenceDate  ;
alias local.climateDateFrom=climateDateFrom  ;
alias local.climateDateTo=climateDateTo ;
alias local.unitsDecimalScaleFactor=unitsDecimalScaleFactor ;
alias local.thresholdIndicator=thresholdIndicator ;
alias local.lowerThresholdValue=lowerThresholdValue ;
alias local.upperThresholdValue=upperThresholdValue;


# TODO: BR Note: this is not where we expect it!!

unsigned[2] numberOfForecastsInEnsemble  : dump;
alias totalNumber=numberOfForecastsInEnsemble;


#spareSetToZero
pad padding_loc23_1(2);

alias number = perturbationNumber;
alias system = systemNumber;
alias method = methodNumber;
alias refdate = referenceDate;


# END   1/local.98.23 ----------------------------------------------------------------------

