# 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 2/template.5.3 ----------------------------------------------------------------------
# TEMPLATE 5.3, Grid point data - complex packing and spatial differencing

include "grib2/template.5.packing.def";
include "grib2/template.5.original_values.def";


#  Group splitting method used
codetable[1] groupSplittingMethodUsed ('5.4.table',masterDir,localDir);

#  Missing value management used
codetable[1] missingValueManagementUsed ('5.5.table',masterDir,localDir);

#  Primary missing value substitute
unsigned[4] primaryMissingValueSubstitute ;

#  Secondary missing value substitute
unsigned[4] secondaryMissingValueSubstitute ;

#  NG - Number of groups of data values into which field is split
unsigned[4] numberOfGroupsOfDataValues ;

alias NG =  numberOfGroupsOfDataValues;
#  Reference for group widths
# NOTE 12 NOT FOUND                                                    
unsigned[1] referenceForGroupWidths ;

#  Number of bits used for the group widths
# (after the reference value in octet 36 has been removed)             
unsigned[1] numberOfBitsUsedForTheGroupWidths ;

#  Reference for group lengths
# NOTE 13 NOT FOUND                                                    
unsigned[4] referenceForGroupLengths ;

#  Length increment for the group lengths
# NOTE 14 NOT FOUND                                                    
unsigned[1] lengthIncrementForTheGroupLengths ;

#  True length of last group
unsigned[4] trueLengthOfLastGroup ;

#  Number of bits used for the scaled group lengths
# (after subtraction of the reference value given in octets 38-41 and division
# by the length increment given in octet 42)                           
unsigned[1] numberOfBitsForScaledGroupLengths ;
alias numberOfBitsUsedForTheScaledGroupLengths=numberOfBitsForScaledGroupLengths;

#  Order of spatial differencing
codetable[1] orderOfSpatialDifferencing ('5.6.table',masterDir,localDir);

#  Number of octets required in the Data Section to specify extra descriptors needed for spatial differencing
# (octets 6-ww in Data Template 7.3)                                   
unsigned[1] numberOfOctetsExtraDescriptors ;


# END   2/template.5.3 ----------------------------------------------------------------------
