Skip to content

Commit

Permalink
Definitions: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Nov 26, 2023
1 parent 114c4a5 commit c5ee685
Show file tree
Hide file tree
Showing 15 changed files with 226 additions and 229 deletions.
4 changes: 2 additions & 2 deletions definitions/grib2/template.5.1.def
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ alias NR = firstDimension;
# NC - second dimension (columns)
unsigned[2] secondDimension;

alias NC = secondDimension;
alias NC = secondDimension;
# First dimension coordinate value definition (Code Table 5.2)
unsigned[1] firstDimensionCoordinateValueDefinition;

Expand All @@ -41,7 +41,7 @@ unsigned[1] firstDimensionPhysicalSignificance ;
# Second dimension physical significance (Code Table 5.3)
unsigned[1] secondDimensionPhysicalSignificance ;

ieeefloat coefsFirst[NC1]; # TODO: find proper names
ieeefloat coefsFirst[NC1]; # TODO: find proper names
ieeefloat coefsSecond[NC2]; # TODO: find proper names

alias data.coefsFirst = coefsFirst;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.5.2.def
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ unsigned[4] secondaryMissingValueSubstitute ;
# NG - Number of groups of data values into which field is split
unsigned[4] numberOfGroupsOfDataValues ;

alias NG = numberOfGroupsOfDataValues;
alias NG = numberOfGroupsOfDataValues;
# Reference for group widths
unsigned[1] referenceForGroupWidths ;

Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.5.3.def
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ unsigned[4] secondaryMissingValueSubstitute ;
# NG - Number of groups of data values into which field is split
unsigned[4] numberOfGroupsOfDataValues ;

alias NG = numberOfGroupsOfDataValues;
alias NG = numberOfGroupsOfDataValues;
# Reference for group widths
unsigned[1] referenceForGroupWidths ;

Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.5.4.def
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ transient decimalScaleFactor=0 : hidden;
alias numberOfBits = bitsPerValue;
alias numberOfBitsContainingEachPackedValue = bitsPerValue;

codetable[1] precision ('5.7.table',masterDir,localDir) = 1 : edition_specific;
codetable[1] precision ('5.7.table',masterDir,localDir) = 1 : edition_specific;
concept accuracy(zero) {
32 = { precision = 1; }
64 = { precision = 2; }
Expand Down
4 changes: 2 additions & 2 deletions definitions/grib2/template.5.42.def
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ include "grib2/template.5.original_values.def";
unsigned[1] ccsdsFlags : dump;
alias ccsdsCompressionOptionsMask=ccsdsFlags;

flagbit AEC_DATA_SIGNED_OPTION_MASK(ccsdsFlags,0) = 0;
flagbit AEC_DATA_SIGNED_OPTION_MASK(ccsdsFlags,0) = 0;

# AEC_DATA_3BYTE_OPTION_MASK was switched on in order to allow data stored
# with 17 <=bitsPerValue<= 24 to be stored in 3 rather than 4 bytes.
# This eliminates discretization errors that were occurring when it was off.
flagbit AEC_DATA_3BYTE_OPTION_MASK(ccsdsFlags,1) = 1;
flagbit AEC_DATA_3BYTE_OPTION_MASK(ccsdsFlags,1) = 1;

flagbit AEC_DATA_MSB_OPTION_MASK(ccsdsFlags,2) = 1;
flagbit AEC_DATA_PREPROCESS_OPTION_MASK(ccsdsFlags,3) = 1;
Expand Down
6 changes: 3 additions & 3 deletions definitions/grib2/template.5.50000.def
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ if (gribex_mode_on()) {

meta _numberOfValues spectral_truncation(J,K,M,numberOfValues): read_only;

constant laplacianScalingFactorUnset = -2147483647;
constant laplacianScalingFactorUnset = -2147483647;
signed[4] laplacianScalingFactor : edition_specific ;

meta data.laplacianOperator scale(laplacianScalingFactor,one,million,truncateLaplacian) ;
meta laplacianOperatorIsSet evaluate(laplacianScalingFactor != laplacianScalingFactorUnset && !computeLaplacianOperator);
meta data.laplacianOperator scale(laplacianScalingFactor,one,million,truncateLaplacian) ;
meta laplacianOperatorIsSet evaluate(laplacianScalingFactor != laplacianScalingFactorUnset && !computeLaplacianOperator);

transient JS= 20 ;
transient KS=20 ;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.5.50002.def
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# (C) Copyright 2005- ECMWF.

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

signed[2] binaryScaleFactor : no_copy;
Expand Down
22 changes: 11 additions & 11 deletions definitions/grib2/template.5.51.def
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ include "grib2/template.5.packing.def";
if (gribex_mode_on()) {
transient computeLaplacianOperator=0 : hidden;
} else {
transient computeLaplacianOperator=1 : hidden;
transient computeLaplacianOperator=1 : hidden;
}

meta _numberOfValues spectral_truncation(J,K,M,numberOfValues): read_only;

constant laplacianScalingFactorUnset = -2147483647;
constant laplacianScalingFactorUnset = -2147483647;
signed[4] laplacianScalingFactor : edition_specific ;

meta data.laplacianOperator scale(laplacianScalingFactor,one,million,truncateLaplacian) ;
meta laplacianOperatorIsSet evaluate(laplacianScalingFactor != laplacianScalingFactorUnset && !computeLaplacianOperator);
meta data.laplacianOperator scale(laplacianScalingFactor,one,million,truncateLaplacian) ;
meta laplacianOperatorIsSet evaluate(laplacianScalingFactor != laplacianScalingFactorUnset && !computeLaplacianOperator);

unsigned[2] JS ;
unsigned[2] KS ;
unsigned[2] MS ;
unsigned[2] JS;
unsigned[2] KS;
unsigned[2] MS;

alias subSetJ=JS ;
alias subSetK=KS ;
alias subSetM=MS ;
alias subSetJ=JS;
alias subSetK=KS;
alias subSetM=MS;

unsigned[4] TS ;
unsigned[4] TS;

meta _TS spectral_truncation(JS,KS,MS,TS) : read_only,hidden;

Expand Down
10 changes: 5 additions & 5 deletions definitions/grib2/template.5.53.def
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ transient computeLaplacianOperator=1 : hidden;
codetable[1] biFourierSubTruncationType ('5.25.table',masterDir,localDir) : dump;
codetable[1] biFourierPackingModeForAxes ('5.26.table',masterDir,localDir) = 0 : dump;

constant laplacianScalingFactorUnset = -2147483647;
constant laplacianScalingFactorUnset = -2147483647;
signed[4] laplacianScalingFactor : edition_specific ; # units of 10^-6

meta data.laplacianOperator scale(laplacianScalingFactor,one,million,truncateLaplacian) ;
meta laplacianOperatorIsSet evaluate(laplacianScalingFactor != laplacianScalingFactorUnset && !computeLaplacianOperator);
meta data.laplacianOperator scale(laplacianScalingFactor,one,million,truncateLaplacian) ;
meta laplacianOperatorIsSet evaluate(laplacianScalingFactor != laplacianScalingFactorUnset && !computeLaplacianOperator);

unsigned[2] biFourierResolutionSubSetParameterN : dump ; # NS
unsigned[2] biFourierResolutionSubSetParameterM : dump ; # MS
unsigned[2] biFourierResolutionSubSetParameterN : dump; # NS
unsigned[2] biFourierResolutionSubSetParameterM : dump; # MS
unsigned[4] totalNumberOfValuesInUnpackedSubset = 0 : dump; # TS

# This is read_only until we support other values
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.5.packing.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Reference value (R)
# The copy_ok means that the value is copied when changing the representation
# e.g. from jpeg to simple packing.
ieeefloat referenceValue : read_only, copy_ok;
ieeefloat referenceValue : read_only, copy_ok;
meta referenceValueError reference_value_error(referenceValue,ieee);

# Binary scale factor (E)
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.5.second_order.def
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ unsigned[4] primaryMissingValue ;
unsigned[4] secondaryMissingValue ;

unsigned[4] numberOfGroups ;
alias NG = numberOfGroups;
alias NG = numberOfGroups;

unsigned[1] referenceOfWidths ;
unsigned[1] widthOfWidths ;
Expand Down
176 changes: 87 additions & 89 deletions definitions/grib2/template.7.50000.def
Original file line number Diff line number Diff line change
Expand Up @@ -7,95 +7,93 @@ constant sphericalHarmonics = 1;
constant complexPacking = 1;

meta codedValues data_g2complex_packing(
section7Length,
offsetBeforeData,
offsetSection7,

unitsFactor,
unitsBias,
changingPrecision,
numberOfValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,

GRIBEXShBugPresent,
unpackedSubsetPrecision,

laplacianOperatorIsSet,
laplacianOperator,

J,
K,
M,

J,
J,
J,

numberOfValues
): read_only;

meta data.packedValues data_sh_packed(
section7Length,
offsetBeforeData,
offsetSection7,

unitsFactor,
unitsBias,
changingPrecision,
numberOfValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,

GRIBEXShBugPresent,
unpackedSubsetPrecision,

laplacianOperatorIsSet,
laplacianOperator,

J,
K,
M,

J,
J,
J
) : read_only;

meta data.unpackedValues data_sh_unpacked(
section7Length,
offsetBeforeData,
offsetSection7,

unitsFactor,
unitsBias,
changingPrecision,
numberOfValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,

GRIBEXShBugPresent,
unpackedSubsetPrecision,

laplacianOperatorIsSet,
laplacianOperator,

J,
K,
M,

J,
K,
M
section7Length,
offsetBeforeData,
offsetSection7,

unitsFactor,
unitsBias,
changingPrecision,
numberOfValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,

GRIBEXShBugPresent,
unpackedSubsetPrecision,

laplacianOperatorIsSet,
laplacianOperator,

J,
K,
M,

J,
J,
J,
numberOfValues
): read_only;

meta data.packedValues data_sh_packed(
section7Length,
offsetBeforeData,
offsetSection7,

unitsFactor,
unitsBias,
changingPrecision,
numberOfValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,

GRIBEXShBugPresent,
unpackedSubsetPrecision,

laplacianOperatorIsSet,
laplacianOperator,

J,
K,
M,

J,
J,
J
) : read_only;

meta data.unpackedValues data_sh_unpacked(
section7Length,
offsetBeforeData,
offsetSection7,

unitsFactor,
unitsBias,
changingPrecision,
numberOfValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,

GRIBEXShBugPresent,
unpackedSubsetPrecision,

laplacianOperatorIsSet,
laplacianOperator,

J,
K,
M,
J,
K,
M
) : read_only;

meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;
Expand Down
Loading

0 comments on commit c5ee685

Please sign in to comment.