eccodes/definitions/grib2/template.7.50001.def

102 lines
2.3 KiB
Modula-2
Raw Normal View History

2020-01-28 14:32:34 +00:00
# (C) Copyright 2005- ECMWF.
2023-06-29 15:17:34 +00:00
# TEMPLATE 7.50001, Second order
2013-03-25 12:04:10 +00:00
if (bitsPerValue) {
2019-05-01 16:22:22 +00:00
meta groupWidths unsigned_bits(widthOfWidths,numberOfGroups) : read_only;
meta groupLengths unsigned_bits(widthOfLengths,numberOfGroups) : read_only;
meta firstOrderValues unsigned_bits(widthOfFirstOrderValues,numberOfGroups) : read_only;
# meta countOfGroupLengths sum(groupLengths);
2013-03-25 12:04:10 +00:00
}
transient halfByte=0;
position offsetBeforeData;
if(bitmapPresent) {
2013-03-25 12:04:10 +00:00
meta codedValues data_g1second_order_general_extended_packing(
#simple_packing args
section7Length,
offsetBeforeData,
offsetSection7,
unitsFactor,
unitsBias,
changingPrecision,
numberOfCodedValues,
2023-08-06 12:57:28 +00:00
bitsPerValue,
2013-03-25 12:04:10 +00:00
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,
2013-03-25 12:04:10 +00:00
#g1second_order_row_by_row args
halfByte,
packingType,
grid_ieee,
precision,
widthOfFirstOrderValues,
firstOrderValues,
N1,
N2,
numberOfGroups,
numberOfGroups,
numberOfSecondOrderPackedValues,
keyNotPresent,
groupWidths,
widthOfWidths,
groupLengths,
widthOfLengths,
NL,
SPD,
widthOfSPD,
orderOfSPD,
numberOfPoints
): read_only;
2023-08-06 12:57:28 +00:00
alias data.packedValues = codedValues;
2013-03-25 12:04:10 +00:00
meta values data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : dump;
} else {
meta values data_g1second_order_general_extended_packing(
#simple_packing args
section7Length,
offsetBeforeData,
offsetSection7,
unitsFactor,
unitsBias,
changingPrecision,
numberOfCodedValues,
2023-08-06 12:57:28 +00:00
bitsPerValue,
2013-03-25 12:04:10 +00:00
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,
2013-03-25 12:04:10 +00:00
#g1second_order_row_by_row args
halfByte,
packingType,
grid_ieee,
precision,
widthOfFirstOrderValues,
firstOrderValues,
N1,
N2,
numberOfGroups,
numberOfGroups,
numberOfSecondOrderPackedValues,
keyNotPresent,
groupWidths,
widthOfWidths,
groupLengths,
widthOfLengths,
NL,
SPD,
widthOfSPD,
orderOfSPD,
numberOfPoints
) : dump;
alias codedValues=values;
alias data.packedValues = values;
}
meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;
template statistics "common/statistics_grid.def";
template missing_values "common/missing_values_grid.def";