# 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.
#


ieeefloat   referenceValue  : no_copy;
meta referenceValueError reference_value_error(referenceValue,ieee);

signed[2]   binaryScaleFactor : no_copy;

signed[2]   decimalScaleFactor :no_copy;

# Try different values of binaryScaleFactor and decimalScaleFactor to reduce packing error
transient optimizeScaleFactor = 0;

unsigned[1] bitsPerValue ;
if (bitsPerValue) {
	unsigned[1] widthOfFirstOrderValues :no_copy ;

	unsigned [4] numberOfGroups : no_copy;
	unsigned [4] numberOfSecondOrderPackedValues : no_copy;
	unsigned [1] widthOfWidths : no_copy;
	unsigned [1] widthOfLengths : no_copy;
	unsigned [1] orderOfSPD = 2 : no_copy ;

	if (orderOfSPD) {
		 unsigned[1] widthOfSPD ;
		 meta SPD spd(widthOfSPD,orderOfSPD) : read_only;
	}
}

