Skip to content

Commit

Permalink
Definitions: Use false/true instead of zero/one
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Nov 22, 2023
1 parent 3e10d5b commit 14f7de9
Show file tree
Hide file tree
Showing 32 changed files with 40 additions and 36 deletions.
2 changes: 2 additions & 0 deletions definitions/grib1/boot.def
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

constant ieeeFloats = 0 : hidden, edition_specific;
transient eps=0;
constant false=0 : hidden;
constant true=1 : hidden;
constant two=1 : hidden;
constant three=1 : hidden;
constant eight=8 : hidden;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib1/grid_definition_spherical_harmonics.def
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GRID DEFINITION spherical harmonic coefficients (including rotated, stretched, or stretched and rotated)
constant isGridded = zero;
constant isGridded = false;

# J - pentagonal resolution parameter
unsigned[2] J : dump ;
Expand Down
4 changes: 2 additions & 2 deletions definitions/grib1/grid_rotation.def
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ meta geography.longitudeOfSouthernPoleInDegrees scale(longitudeOfSouthernPole ,o

ibmfloat geography.angleOfRotationInDegrees : dump;

alias angleOfRotation =angleOfRotationInDegrees;
alias isRotatedGrid = one;
alias angleOfRotation = angleOfRotationInDegrees;
alias isRotatedGrid = true;
2 changes: 1 addition & 1 deletion definitions/grib1/scanning_mode.def
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
constant isGridded = one;
constant isGridded = true;

# Scanning mode
flags[1] scanningMode 'grib1/8.table' : edition_specific,no_copy;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib1/section.2.def
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ codetable[1] dataRepresentationType 'grib1/6.table' = 0;
meta gridDefinitionDescription codetable_title(dataRepresentationType);

# Grid definition (according to data representation type - octet 6 above)
alias isRotatedGrid=zero;
alias isRotatedGrid = false;

if (dataRepresentationType < 192) {
template dataRepresentation "grib1/grid_definition_[dataRepresentationType:l].def";
Expand Down
2 changes: 2 additions & 0 deletions definitions/grib2/boot.def
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ constant tablesVersionLatestOfficial = 31 : edition_specific;
# If this is different from the official version, then it is the pre-operational version
constant tablesVersionLatest = 31 : edition_specific;

constant false = 0 : hidden;
constant true = 1 : hidden;
constant million = 1000000 : hidden;
constant grib2divider = 1000000;
alias extraDimensionPresent=zero;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/section.1.def
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ meta is_aerosol_optical g2_aerosol(productDefinitionTemplateNumber, stepType, 1

transient setCalendarId = 0 ;
transient deleteCalendarId = 0 ;
alias calendarIdPresent = zero;
alias calendarIdPresent = false;
if ( ((section1Length > 21) or setCalendarId > 0) and deleteCalendarId == 0) {
alias calendarIdPresent = present;
codetable[2] calendarIdentificationTemplateNumber ('1.5.table',masterDir,localDir) : dump,string_type,no_fail;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/section.2.def
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ transient addEmptySection2 = 0;

if ( addEmptySection2 == 0 ) {
if ( grib2LocalSectionPresent==1 or ( section2Length>5 or new() ) ) {
alias section2Used=one;
alias section2Used=true;

if(productionStatusOfProcessedData == 8 || productionStatusOfProcessedData == 9) {
# This for adding an expver other than prod/test to UERRA
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/section.3.def
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if(numberOfOctectsForNumberOfPoints == 0){
codetable[2] gridDefinitionTemplateNumber ('3.1.table',masterDir,localDir) =0 : dump,edition_specific;
meta gridDefinitionDescription codetable_title(gridDefinitionTemplateNumber);

alias isRotatedGrid=zero;
alias isRotatedGrid = false;

if (gridDefinitionTemplateNumber >= 32768) {
template gridDefinitionSection "grib2/local/[centreForLocal]/template.3.[gridDefinitionTemplateNumber:l].def";
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/section.4.def
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ alias numberOfVerticalGridDescriptors=NV ;
transient neitherPresent = 0;

if (centre==7 || centre==46) {
alias disableGrib1LocalSection=one;
alias disableGrib1LocalSection=true;
}

concept datasetForLocal(unknown) {
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.10.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TEMPLATE 3.10, Mercator
include "grib2/template.3.shape_of_the_earth.def";

constant isGridded = one;
constant isGridded = true;

unsigned[4] Ni : dump;
alias numberOfPointsAlongAParallel = Ni;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.100.def
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# (C) Copyright 2005- ECMWF.

# TEMPLATE 3.100, Triangular grid based on an icosahedron (see Attachment I.2-GRIB-Att.)
constant isGridded = one;
constant isGridded = true;

# n2 - exponent of 2 for the number of intervals on main triangle sides
unsigned[1] n2 : dump ;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.1000.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TEMPLATE 3.1000, Cross-section grid, with points equally spaced on the horizontal
include "grib2/template.3.shape_of_the_earth.def";

constant isGridded = one;
constant isGridded = true;

# Number of horizontal points
unsigned[4] numberOfHorizontalPoints : dump ;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.101.def
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# TEMPLATE 3.101, General Unstructured Grid

constant isGridded = one;
constant isGridded = true;

codetable[1] shapeOfTheEarth ('3.2.table',masterDir,localDir) : dump;

Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.110.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TEMPLATE 3.110, Equatorial azimuthal equidistant projection
include "grib2/template.3.shape_of_the_earth.def";

constant isGridded = one;
constant isGridded = true;

# Nx - number of points along X-axis
unsigned[4] numberOfPointsAlongXAxis : dump;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.1100.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TEMPLATE 3.1100, Hovmoller diagram grid with points equally spaced on the horizontal
include "grib2/template.3.shape_of_the_earth.def";

constant isGridded = one;
constant isGridded = true;

# Number of horizontal points
unsigned[5] numberOfHorizontalPoints : dump ;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.12.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TEMPLATE 3.12, Transverse Mercator
include "grib2/template.3.shape_of_the_earth.def";

constant isGridded = one;
constant isGridded = true;

unsigned[4] Ni : dump;
alias numberOfPointsAlongAParallel = Ni;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.120.def
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# TEMPLATE 3.120, Azimuth-range projection

constant isGridded = one;
constant isGridded = true;

# Nb - number of data bins along radials (A data bin is a data point representing the volume centred on it)
unsigned[4] numberOfDataBinsAlongRadials;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.1200.def
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# (C) Copyright 2005- ECMWF.

# TEMPLATE 3.1200, Time section grid
constant isGridded = one;
constant isGridded = true;

# NT - Number of time steps
unsigned[4] numberOfTimeSteps : dump;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.130.def
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# TEMPLATE 3.130, Irregular Latitude/longitude grid

constant isGridded = one;
constant isGridded = true;

# Note: This template is deprecated.

Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.140.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TEMPLATE 3.140, Lambert azimuthal equal area projection
include "grib2/template.3.shape_of_the_earth.def";

constant isGridded = one;
constant isGridded = true;

# Nx - number of points along X-axis
unsigned[4] numberOfPointsAlongXAxis : dump;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.20.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TEMPLATE 3.20, Polar stereographic projection
include "grib2/template.3.shape_of_the_earth.def";

constant isGridded = one;
constant isGridded = true;

# Nx - number of points along X-axis
unsigned[4] Nx : dump;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.30.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TEMPLATE 3.30, Lambert conformal
include "grib2/template.3.shape_of_the_earth.def";

constant isGridded = one;
constant isGridded = true;

unsigned[4] Nx : dump;
alias Ni = Nx;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.31.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TEMPLATE 3.31, Albers equal area
include "grib2/template.3.shape_of_the_earth.def";

constant isGridded = one;
constant isGridded = true;

# Nx - number of points along the X-axis
unsigned[4] Nx : dump;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.90.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TEMPLATE 3.90, Space view perspective or orthographic
include "grib2/template.3.shape_of_the_earth.def";

constant isGridded = one;
constant isGridded = true;

unsigned[4] Nx : dump;
alias Ni = Nx;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.bf.def
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
label "BiFourier coefficients";
constant biFourierCoefficients=1;
constant isGridded = one;
constant isGridded = true;

codetable[1] spectralType ('3.6.table',masterDir,localDir) = 2 : no_copy;
alias spectralDataRepresentationType=spectralType;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.grid.def
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# (C) Copyright 2005- ECMWF.

constant isGridded = one;
constant isGridded = true;

unsigned[4] Ni : can_be_missing,dump;
alias numberOfPointsAlongAParallel=Ni;
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.healpix.def
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# See https://healpix.jpl.nasa.gov/pdf/intro.pdf

constant isGridded = one;
constant isGridded = true;

# Number of grid points along one side of one of the 12 base resolution pixels (>=1)
# The number of data points should be = 12 * Nside * Nside
Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.rotation.def
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ alias geography.angleOfRotationInDegrees=angleOfRotation;

alias angleOfRotationOfProjection=angleOfRotation;

alias isRotatedGrid=one;
alias isRotatedGrid = true;
10 changes: 5 additions & 5 deletions definitions/grib2/template.3.shape_of_the_earth.def
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,34 @@ alias scaleFactorOfMinorAxisOfOblateSpheroidEarth=scaleFactorOfEarthMinorAxis ;
unsigned[4] scaledValueOfEarthMinorAxis = missing(): can_be_missing, edition_specific;
alias scaledValueOfMinorAxisOfOblateSpheroidEarth=scaledValueOfEarthMinorAxis;

alias earthIsOblate=one;
alias earthIsOblate = true;

_if (shapeOfTheEarth == 0) {
transient radius=6367470;
alias radiusOfTheEarth=radius;
alias radiusInMetres=radius;
alias earthIsOblate=zero;
alias earthIsOblate=false;
}
_if (shapeOfTheEarth == 1){
meta radius from_scale_factor_scaled_value(
scaleFactorOfRadiusOfSphericalEarth,
scaledValueOfRadiusOfSphericalEarth);
alias radiusOfTheEarth=radius;
alias radiusInMetres=radius;
alias earthIsOblate=zero;
alias earthIsOblate=false;
}
_if (shapeOfTheEarth == 6){
transient radius=6371229;
alias radiusOfTheEarth=radius;
alias radiusInMetres=radius;
alias earthIsOblate=zero;
alias earthIsOblate=false;
}

_if (shapeOfTheEarth == 8){
transient radius=6371200;
alias radiusOfTheEarth=radius;
alias radiusInMetres=radius;
alias earthIsOblate=zero;
alias earthIsOblate=false;
}


Expand Down
2 changes: 1 addition & 1 deletion definitions/grib2/template.3.spherical_harmonics.def
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ alias spectralDataRepresentationType=spectralType;
codetable[1] spectralMode ('3.7.table',masterDir,localDir) = 1 : no_copy;
alias spectralDataRepresentationMode=spectralMode;

constant isGridded = zero;
constant isGridded = false;
4 changes: 2 additions & 2 deletions definitions/grib2/template.4.horizontal.def
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ alias vertical.level=level;
alias vertical.bottomLevel=bottomLevel;
alias vertical.topLevel=topLevel;

alias extraDim=zero;
alias extraDim=false;
if (defined(extraDimensionPresent)) {
if (extraDimensionPresent) {
alias extraDim=one;
alias extraDim=true;
}
}
if (extraDim) {
Expand Down

0 comments on commit 14f7de9

Please sign in to comment.