# Copyright 2005-2007 ECMWF
#
# Licensed under the GNU Lesser General Public License which
# incorporates the terms and conditions of version 3 of the GNU
# General Public License.
# See LICENSE and gpl-3.0.txt for details.

# START 1/local.98.18 ----------------------------------------------------------------------
# LOCAL 98 18
#
# localDefinitionTemplate_018
# ---------------------------
#
# 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  -
#number                      50  I1  42  -
#total                       51  I1  43  -
#dataOrigin                  52  I1  44  -
#modelIdentifier             53  A4  45  -
#consensusCount              57  I1  46  -
#spareSetToZero              58  PAD n/a 3
#wmoCentreIdentifiers        61  LIST    47  consensusCount
#ccccIdentifiers             -   A4  -   -
#ENDLIST                     -   ENDLIST -   wmoCentreIdentifiers
#unusedEntriesSetToBlanks    -   SP_TO   -   120
#

constant GRIBEXSection1Problem = 120 - section1Length ;


#1->2
alias grib2LocalSectionPresent=present;
constant grib2LocalSectionNumber=18;

if (stepType is "instant" ) {
  alias productDefinitionTemplateNumber=epsPoint;
} else {
   alias productDefinitionTemplateNumber=epsContinous;
}
template mars_labeling "grib1/mars_labeling.def";

unsigned[1] perturbationNumber : dump ;
alias number=perturbationNumber;

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

codetable[1] dataOrigin "grib1/0.table" : dump;
alias origin = dataOrigin;

ascii[4] modelIdentifier : dump ;

unsigned[1] consensusCount =1 : dump ;

# spareSetToZero
pad padding_loc18_1(3);

ascii[4] ccccIdentifiers ;

#consensus list(consensusCount)
#{  ascii[4] ccccIdentifiers  : dump;}

padto padding_loc18_2(offsetSection1 + 120);

alias local.dataOrigin=dataOrigin;
alias local.modelIdentifier=modelIdentifier;
alias local.consensusCount=consensusCount;

# END   1/local.98.18 ----------------------------------------------------------------------