# 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.19 ----------------------------------------------------------------------
# LOCAL 98 19
#
# localDefinitionTemplate_019
# ---------------------------
#
# 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  -
#zeroForMarsCompatibility            50  PAD 42  1
#ensembleSize                        51  I1  43  -
#powerOfTenUsedToScaleClimateWeight  52  I1  44  -
#weightAppliedToClimateMonth1        53  I4  45  -
#firstMonthUsedToBuildClimateMonth1  57  I3  46  -
#lastMonthUsedToBuildClimateMonth1   60  I3  47  -
#firstMonthUsedToBuildClimateMonth2  63  I3  48  -
#lastMonthUsedToBuildClimateMonth2   66  I3  49  -
#efiOrder                            69  I1  50  -
#spareSetToZero                      70  PAD n/a 11
#
template mars_labeling "grib1/mars_labeling.def";

constant GRIBEXSection1Problem = 80 - section1Length ;

# zeroForMarsCompatibility
#pad padding_loc19_1(1);
unsigned[1] number : dump;
alias perturbationNumber=number;

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

meta quantile sprintf("%s:%s",number,ensembleSize);

# See GRIB-862 for the reason behind the aliases

unsigned[1] versionNumberOfExperimentalSuite : dump;
alias powerOfTenUsedToScaleClimateWeight=versionNumberOfExperimentalSuite;

unsigned[4] implementationDateOfModelCycle : dump;
alias weightAppliedToClimateMonth1=implementationDateOfModelCycle;

unsigned[3] numberOfReforecastYearsInModelClimate : dump;
alias firstMonthUsedToBuildClimateMonth1=numberOfReforecastYearsInModelClimate;

unsigned[3] numberOfDaysInClimateSamplingWindow : dump;
alias lastMonthUsedToBuildClimateMonth1=numberOfDaysInClimateSamplingWindow;

unsigned[3] sampleSizeOfModelClimate : dump;
alias firstMonthUsedToBuildClimateMonth2=sampleSizeOfModelClimate;

unsigned[3] versionOfModelClimate : dump;
alias lastMonthUsedToBuildClimateMonth2=versionOfModelClimate;

unsigned[1] efiOrder : dump;

# spareSetToZero
pad padding_loc19_2(11);

# END   1/local.98.19 ----------------------------------------------------------------------
