# Copyright 2005-2016 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.244 ----------------------------------------------------------------------
# LOCAL 214 98 244
#
#!
#!       localDefinitionTemplate_244
#!       ---------------------------
#!
#! # SREPS Short-Range EPS information
#!
#! Last update: 20070223
#!
#!Description                            Octet   Code    Ksec1   Count
#!-----------                            -----   ----    -----   -----
#!
#!
#! Compatibility with MARS
#!
#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      -
#!
#! **_EXPERIMENT_**
#!
#************_EXPERIMENT_************    52      A4      44      -
#Experiment_Identifier_1                 56      A4      45      -
#Experiment_Identifier_2                 60      A4      46      -
#Sub-Experiment_Identifier_1             64      A4      47      -
#Sub-Experiment_Identifier_2             68      A4      48      -
#!
#! **_PRODUCT_**
#!
#************_PRODUCT_***************    72      A4      49      -
#Original_CodeTable_2_Version_Number     76      I1      50      -
#Original_Parameter_Iden_(CodeTable2)    77      I1      51      -
#Original_Parameter_Identifier_1         78      A4      52      -
#Original_Parameter_Identifier_2         82      A4      53      -
#Product_Identifier_1                    86      A4      54      -
#Product_Identifier_2                    90      A4      55      -
#!
#! Thresholds and Distributions
#!
#Threshold_[Distribution]_(0=n,1=yes)    94      I2      56      -
#Threshold_[Distribution]_Units          96      A4      57      -
#At_least__[Distribut._Proportion_Of]    100     I4      58      -
#Less_Than_[To_Overall_Distribution]     104     I4      59      -
#!
#zeroForFutureProducts                   108     PAD     60      40
#!
#! **_ENSEMBLE_**
#!
#************_ENSEMBLE_**************    148     A4      100     -
#Number_Combination_Ensembles_(1=no)     152     I2      101     -
#Show_Combination_E._[2]_(0=no,1=yes)    154     I1      102     -
#Show_Combination_E._[3]_(0=no,1=yes)    155     I1      103     -
#Show_Combination_E._[4]_(0=no,1=yes)    156     I1      104     -
#zeroForFutureCombinations               157     PAD     105     7
#Total_Number_Members_Used               164     I2      112     -
#Total_Number_Members_Possible           166     I2      113     -
#Total_Number_Members_Missing            168     I2      114     -
#Ensemble_Combination_Number             170     I2      115     -
#Ensemble_Identifier_1                   172     A4      116     -
#Ensemble_Identifier_2                   176     A4      117     -
#Local_Number_Members_Used               180     I2      118     -
#Local_Number_Members_Possible           182     I2      119     -
#Local_Number_Members_Missing            184     I2      120     -
#!
#listMembersUsed                         -       LIST    -       Local_Number_Members_Used
#Used_Model_LBC                          -       A4      -       -
#endlistMembersUsed                      -       ENDLIST -       listMembersUsed
#!
#listMembersMissing                      -       LIST    -       Local_Number_Members_Missing
#Missing_Model_LBC                       -       A4      -       -
#endlistMembersMissing                   -       ENDLIST -       listMembersMissing
#!
#! More than one Combination
#!
#listEnsembleCombination2                -       LIST    -       Show_Combination_E._[2]_(0=no,1=yes)
#Ensemble_Combinat._Number_(0=no)_[2]    -       I2      -       -
#Ensemble_Identifier_1_[2]               -       A4      -       -
#Ensemble_Identifier_2_[2]               -       A4      -       -
#Local_Number_Members_Used_[2]           -       I2      -       -
#Local_Number_Members_Possible_[2]       -       I2      -       -
#Local_Number_Members_Missing_[2]        -       I2      -       -
#Date_[2]                                -       D3      -       -
#Hour_[2]                                -       I1      -       -
#Minute_[2]                              -       I1      -       -
#Time_Range_One_[2]                      -       I2      -       -
#Time_Range_Two_[2]                      -       I2      -       -
#endlistEnsembleCombination2             -       ENDLIST -       listEnsembleCombination2
#!
#listMembersUsed_[2]                     -       LIST    -       Local_Number_Members_Used_[2]
#Used_Model_LBC_[2]                      -       A4      -       -
#endlistMembersUsed_[2]                  -       ENDLIST -       listMembersUsed_[2]
#!
#listMembersMissing_[2]                  -       LIST    -       Local_Number_Members_Missing_[2]
#Missing_Model_LBC_[2]                   -       A4      -       -
#endlistMembersMissing_[2]               -       ENDLIST -       listMembersMissing_[2]
#!
#listEnsembleCombination3                -       LIST    -       Show_Combination_E._[3]_(0=no,1=yes)
#Ensemble_Combinat._Number_(0=no)_[3]    -       I2      -       -
#Ensemble_Identifier_1_[3]               -       A4      -       -
#Ensemble_Identifier_1_[3]               -       A4      -       -
#Local_Number_Members_Used_[3]           -       I2      -       -
#Local_Number_Members_Possible_[3]       -       I2      -       -
#Local_Number_Members_Missing_[3]        -       I2      -       -
#Date_[3]                                -       D3      -       -
#Hour_[3]                                -       I1      -       -
#Minute_[3]                              -       I1      -       -
#Time_Range_One_[3]                      -       I2      -       -
#Time_Range_Two_[3]                      -       I2      -       -
#endlistEnsembleCombination3             -       ENDLIST -       listEnsembleCombination3
#!
#listMembersUsed_[3]                     -       LIST    -       Local_Number_Members_Used_[3]
#Used_Model_LBC_[3]                      -       A4      -       -
#endlistMembersUsed_[3]                  -       ENDLIST -       listMembersUsed_[3]
#!
#listMembersMissing_[3]                  -       LIST    -       Local_Number_Members_Missing_[3]
#Missing_Model_LBC_[3]                   -       A4      -       -
#endlistMembersMissing_[3]               -       ENDLIST -       listMembersMissing_[3]
#!
#listEnsembleCombination4                -       LIST    -       Show_Combination_E._[4]_(0=no,1=yes)
#Ensemble_Combinat._Number_(0=no)_[4]    -       I2      -       -
#Ensemble_Identifier_1_[4]               -       A4      -       -
#Ensemble_Identifier_2_[4]               -       A4      -       -
#Local_Number_Members_Used_[4]           -       I2      -       -
#Local_Number_Members_Possible_[4]       -       I2      -       -
#Local_Number_Members_Missing_[4]        -       I2      -       -
#Date_[4]                                -       D3      -       -
#Hour_[4]                                -       I1      -       -
#Minute_[4]                              -       I1      -       -
#Time_Range_One_[4]                      -       I2      -       -
#Time_Range_Two_[4]                      -       I2      -       -
#endlistEnsembleCombination4             -       ENDLIST -       listEnsembleCombination4
#!
#listMembersUsed_[4]                     -       LIST    -       Local_Number_Members_Used_[4]
#Used_Model_LBC_[4]                      -       A4      -       -
#endlistMembersUsed_[4]                  -       ENDLIST -       listMembersUsed_[4]
#!
#listMembersMissing_[4]                  -       LIST    -       Local_Number_Members_Missing_[4]
#Missing_Model_LBC_[4]                   -       A4      -       -
#endlistMembersMissing_[4]               -       ENDLIST -       listMembersMissing_[4]
#!
#! EXTRA INFORMATION like 191
#!
#*********_EXTRA_DATA_***************    -       A4      -       -
#Extra_Data_FreeFormat_(0=none)          -       I2      -       -
#Data_Descriptor_Bytes                   -       BYTES   -       Extra_Data_FreeFormat_(0=none)
#padToAMultipleOf80Bytes                 -       PADFROM n/a     80
#!
#

template mars_labeling "grib1/mars_labeling.def";

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

unsigned[1] numberOfForecastsInEnsemble  : dump;

#
# **_EXPERIMENT_**
#

ascii[4]    '************_EXPERIMENT_************' ;
ascii[8]    'Experiment_Identifier' ;
ascii[8]    'Sub-Experiment_Identifier' ;

#
# **_PRODUCT_**
#

ascii[4]    '************_PRODUCT_***************' ;
unsigned[1]  Original_CodeTable_2_Version_Number  : dump ;
unsigned[1]  Original_Parameter_Iden_CodeTable2   : dump;
ascii[8]    'Original_Parameter_Identifier' ;
ascii[8]    'Product_Identifier' ;

# Thresholds and Distributions

unsigned[2]  Threshold_Or_Distribution_0_no_1_yes  : dump ;
ascii[4]    'Threshold_Or_Distribution_Units' ;
unsigned[4]  At_least__Or_Distribut_Proportion_Of  : dump ;
unsigned[4]  Less_Than_Or_To_Overall_Distribution  : dump ;

pad padding_loc244_1(40);

ascii[4]    '************_ENSEMBLE_**************' ;
unsigned[2]  Number_Combination_Ensembles_1_none  : dump ;
unsigned[1]  Show_Combination_Ensem_E2_0_no_1_yes  : dump ;
unsigned[1]  Show_Combination_Ensem_E3_0_no_1_yes  : dump ;
unsigned[1]  Show_Combination_Ensem_E4_0_no_1_yes  : dump ;

pad padding_loc244_2(7);

unsigned[2]  Total_Number_Members_Used  : dump;
unsigned[2]  Total_Number_Members_Possible : dump ;
unsigned[2]  Total_Number_Members_Missing : dump ;
unsigned[2]  Ensemble_Combination_Number : dump ;
ascii[8]    'Ensemble_Identifier' ;
unsigned[2]  Local_Number_Members_Used : dump ;
unsigned[2]  Local_Number_Members_Possible : dump ;
unsigned[2]  Local_Number_Members_Missing : dump ;

listMembersUsed list(Local_Number_Members_Used){
ascii[4]    'Used_Model_LBC' ;
}

listMembersMissing list(Local_Number_Members_Missing){
ascii[4]    'Missing_Model_LBC' ;
}

#
# More than one Combination
#

if (Show_Combination_Ensem_E2_0_no_1_yes == 1){
unsigned[2]  Ensemble_Combinat_Number_0_none_E2 : dump  ;
ascii[8]    'Ensemble_Identifier_E2' ;
unsigned[2]  Local_Number_Members_Used_E2 : dump  ;
unsigned[2]  Local_Number_Members_Possible_E2 : dump  ;
unsigned[2]  Local_Number_Members_Missing_E2 : dump  ;
unsigned[3]  Date_E2   : dump;
unsigned[1]  Hour_E2   : dump;
unsigned[1]  Minute_E2   : dump;
unsigned[2]  Time_Range_One_E2  : dump ;
unsigned[2]  Time_Range_Two_E2   : dump;

listMembersUsed2 list(Local_Number_Members_Used_E2){
ascii[4]    'Used_Model_LBC_E2' ;
}

listMembersMissing2 list(Local_Number_Members_Missing_E2){
ascii[4]    'Missing_Model_LBC_E2' ;
}
}

if (Show_Combination_Ensem_E3_0_no_1_yes == 1){
unsigned[2]  Ensemble_Combinat_Number_0_none_E3 : dump  ;
ascii[8]    'Ensemble_Identifier_E3' ;
unsigned[2]  Local_Number_Members_Used_E3   : dump;
unsigned[2]  Local_Number_Members_Possible_E3   : dump;
unsigned[2]  Local_Number_Members_Missing_E3   : dump;
unsigned[3]  Date_E3   : dump;
unsigned[1]  Hour_E3   : dump;
unsigned[1]  Minute_E3   : dump;
unsigned[2]  Time_Range_One_E3   : dump;
unsigned[2]  Time_Range_Two_E3   : dump;

listMembersUsed3 list(Local_Number_Members_Used_E3){
ascii[4]    'Used_Model_LBC_E3' ;
}

listMembersMissing3 list(Local_Number_Members_Missing_E3){
ascii[4]    'Missing_Model_LBC_E3' ;
}
}

if (Show_Combination_Ensem_E4_0_no_1_yes == 1){
unsigned[2]  Ensemble_Combinat_Number_0_none_E4  : dump ;
ascii[8]    'Ensemble_Identifier_E4' ;
unsigned[2]  Local_Number_Members_Used_E4   : dump;
unsigned[2]  Local_Number_Members_Possible_E4   : dump;
unsigned[2]  Local_Number_Members_Missing_E4   : dump;
unsigned[3]  Date_E4   : dump;
unsigned[1]  Hour_E4   : dump;
unsigned[1]  Minute_E4   : dump;
unsigned[2]  Time_Range_One_E4  : dump ;
unsigned[2]  Time_Range_Two_E4   : dump;

listMembersUsed4 list(Local_Number_Members_Used_E4){
ascii[4]    'Used_Model_LBC_E4' ;
}

listMembersMissing4 list(Local_Number_Members_Missing_E4){
ascii[4]    'Missing_Model_LBC_E4' ;
}
}

#
# EXTRA INFORMATION like 191
#

ascii[4]    '*********_EXTRA_DATA_***************' ;
unsigned[2]  Extra_Data_FreeFormat_0_none   : dump;
position offsetFreeFormData;
unsigned[1] freeFormData[Extra_Data_FreeFormat_0_none]  : dump;
#
padtomultiple padding_loc244_3(offsetSection1,80);
#

# END   1/local.98.5 ----------------------------------------------------------------------
