# 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.190 ----------------------------------------------------------------------
# LOCAL 98 190
#
# localDefinitionTemplate_190
# ---------------------------
#
# 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  -
#zeroesForCompatibilityWithMars  50  PAD 42  2
#numberOfLocalDefinitions        52  I1  44  -
#localDefinitions                53  LIST    45  numberOfLocalDefinitions
#localDefinitionNumber            -   I1  -   -
#numberOfBytesInLocalDefinition   -   I2  -   -
#ENDLIST                          -   ENDLIST -   localDefinitions
#streamOfLocalDefinitionBytes     -   BYTES   -   numberOfBytesInLocalDefinition
#

constant GRIBEXSection1Problem = 0 ;

template mars_labeling "grib1/mars_labeling.def";

# zeroesForCompatibilityWithMars
pad padding_loc190_1(2);

unsigned[1] numberOfLocalDefinitions  : dump;

if(numberOfLocalDefinitions == 1){
  unsigned[1] localDefNumberOne  : dump;
  unsigned[2] numberOfBytesInLocalDefinition  : dump;
  template subLocalDefinition1  "grib1/local.[centre:l].[localDefNumberOne:l].def";
}

if(numberOfLocalDefinitions == 2){
  unsigned[1] localDefNumberOne  : dump;
  unsigned[2] numberOfBytesInLocalDefinition  : dump;
  unsigned[1] localDefNumberTwo  : dump;
  unsigned[2] numberOfBytesInLocalDefinition  : dump;
  template subLocalDefinition1  "grib1/local.[centre:l].[localDefNumberOne:l].def";
  unsigned[4] spare2;
  template subLocalDefinition2  "grib1/local.[centre:l].[localDefNumberTwo:l].def";
}

# END   1/local.98.190 ----------------------------------------------------------------------
