eccodes/definitions/grib1/data.spectral_ieee.def

136 lines
3.3 KiB
Modula-2
Raw Normal View History

2020-01-28 14:32:34 +00:00
# (C) Copyright 2005- ECMWF.
2013-03-25 12:04:10 +00:00
# moved here to allow different bitsPerValue in second order packing
2021-12-20 17:28:26 +00:00
unsigned[1] bitsPerValue : dump;
2013-03-25 12:04:10 +00:00
alias numberOfBitsContainingEachPackedValue = bitsPerValue;
alias accuracy = bitsPerValue;
2013-03-25 12:04:10 +00:00
# For grib1 -> grib2
#constant dataRepresentationTemplateNumber = 51;
constant PUnset = -32767;
# N is a pointer to the start of the packed data (i.e. gives octet number)
unsigned[2] N : read_only,dump;
signed[2] P = PUnset;
2023-08-06 12:57:28 +00:00
unsigned[1] JS=0 : dump;
unsigned[1] KS=0 : dump;
unsigned[1] MS=0 : dump;
2013-03-25 12:04:10 +00:00
alias subSetJ=JS;
alias subSetK=KS;
alias subSetM=MS;
2013-03-25 12:04:10 +00:00
constant GRIBEXShBugPresent = 1;
transient computeLaplacianOperator=0;
2023-08-06 12:57:28 +00:00
meta data.laplacianOperator scale(P,oneConstant,grib1divider,truncateLaplacian) : dump;
meta laplacianOperatorIsSet evaluate(P != PUnset && !computeLaplacianOperator );
if (localUsePresent) {
if (changed(localDefinitionNumber)) {
transient TS = 0;
meta TScalc spectral_truncation(JS,KS,MS,TS) : read_only,hidden;
meta Nassigned octet_number(N,4*TScalc) : hidden;
}
}
position offsetBeforeData;
meta values data_g1complex_packing(
2013-03-25 12:04:10 +00:00
section4Length,
offsetBeforeData,
offsetSection4,
unitsFactor,
unitsBias,
changingPrecision,
numberOfCodedValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,
2013-03-25 12:04:10 +00:00
GRIBEXShBugPresent,
ieeeFloats,
laplacianOperatorIsSet,
laplacianOperator,
subSetJ,
subSetK,
subSetM,
pentagonalResolutionParameterJ,
pentagonalResolutionParameterK,
pentagonalResolutionParameterM,
halfByte,
N,packingType,spectral_ieee,precision
2021-12-20 17:28:26 +00:00
) : dump;
2013-03-25 12:04:10 +00:00
meta data.packedValues data_sh_packed(
2013-03-25 12:04:10 +00:00
section4Length,
offsetBeforeData,
offsetSection4,
unitsFactor,
unitsBias,
changingPrecision,
numberOfCodedValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,
2013-03-25 12:04:10 +00:00
GRIBEXShBugPresent,
ieeeFloats,
laplacianOperatorIsSet,
laplacianOperator,
subSetJ,
subSetK,
subSetM,
2022-02-22 17:27:41 +00:00
2013-03-25 12:04:10 +00:00
pentagonalResolutionParameterJ,
pentagonalResolutionParameterK,
pentagonalResolutionParameterM
) : read_only;
meta data.unpackedValues data_sh_unpacked(
2013-03-25 12:04:10 +00:00
section4Length,
offsetBeforeData,
offsetSection4,
unitsFactor,
unitsBias,
changingPrecision,
numberOfCodedValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,
2013-03-25 12:04:10 +00:00
GRIBEXShBugPresent,
ieeeFloats,
laplacianOperatorIsSet,
laplacianOperator,
subSetJ,
subSetK,
subSetM,
2022-02-22 17:27:41 +00:00
2013-03-25 12:04:10 +00:00
pentagonalResolutionParameterJ,
pentagonalResolutionParameterK,
pentagonalResolutionParameterM
) : read_only;
meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ibm) : no_copy;
meta unpackedError simple_packing_error(zero,binaryScaleFactor,decimalScaleFactor,referenceValue,ibm) : no_copy;
# nearest sh(values,radius,J,K,M);
meta numberOfCodedValues g1number_of_coded_values_sh_complex(bitsPerValue,offsetBeforeData,offsetAfterData,halfByte,numberOfValues,subSetJ,subSetK,subSetM) : dump;
template statistics "common/statistics_spectral.def";