# Copyright 2005-2018 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.192 ----------------------------------------------------------------------
# LOCAL 98 192
#
# localDefinitionTemplate_192
# ---------------------------
#
# 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  -
#zeroForCompatibilityWithMars    50  PAD 42  2
#numberOfLocalDefinitions        52  I1  44  -
#listOfLocalDefinitions          -   LIST    -   numberOfLocalDefinitions
#localDefinitionLength           -   I2  -   -
#localDefinition                 -   LOCAL   -   -
#endListOfLocalDefinitions       -   ENDLIST -   listOfLocalDefinitions
#

# The mars labeling must be inline
# template mars_labeling "grib1/mars_labeling.def";

constant GRIBEXSection1Problem = 0 ;

codetable[1]   thisMarsClass   "mars/class.table" = "od" : dump,lowercase;
codetable[1]   thisMarsType   "mars/type.table" = "an" : dump,string_type,lowercase;
codetable[2]   thisMarsStream "mars/stream.table" = "oper" : dump,lowercase ;
ksec1expver[4] thisExperimentVersionNumber = "0001" : dump;

alias ls.dataType = thisMarsType;
alias mars.class  = thisMarsClass;
alias mars.type   = thisMarsType;
alias mars.stream = thisMarsStream;
alias mars.expver = thisExperimentVersionNumber;

# zeroForCompatibilityWithMars
pad padding_loc192_1(2);

unsigned[1] numberOfLocalDefinitions = 2  : dump;

if (numberOfLocalDefinitions == 2 ) {
	unsigned[2] subLocalDefinitionLength1  = 7 : dump;
	unsigned[1] subLocalDefinitionNumber1 = 1  : dump;
	codetable[1]   marsClass1   "mars/class.table" = "od" : dump,lowercase;
	codetable[1]   marsType1   "mars/type.table" = "an" : dump,string_type,lowercase;
	codetable[2]   marsStream1 "mars/stream.table" = "oper" : dump,lowercase ;
	ksec1expver[4] experimentVersionNumber1 = "0001" : dump;
	template  subDefinitions1  "grib1/local_no_mars.98.[subLocalDefinitionNumber1].def";
	unsigned[2] subLocalDefinitionLength2  = 9 : dump;
	unsigned[1] subLocalDefinitionNumber2 = 24  : dump;
	codetable[1]   marsClass2   "mars/class.table" = "od" : dump,lowercase;
	codetable[1]   marsType2   "mars/type.table" = "an" : dump,string_type,lowercase;
	codetable[2]   marsStream2 "mars/stream.table" = "oper" : dump,lowercase ;
	ksec1expver[4] experimentVersionNumber2 = "0001" : dump;
	template  subDefinitions2  "grib1/local_no_mars.98.[subLocalDefinitionNumber2].def";
}


