GRIB3 definitions: fix broken tests (part 1)

This commit is contained in:
Shahram Najm 2017-10-30 13:28:01 +00:00
parent 70a2871b6f
commit bd18377e40
41 changed files with 272 additions and 71 deletions

View File

@ -0,0 +1,25 @@
# Horizontal Domain Template Component 4.0 - Ellipsoid of revolution defined with axis lengths
# Scale factor of length of semi-major axis
unsigned[1] scaleFactorOfLengthOfSemiMajorAxis = missing() : can_be_missing, edition_specific;
# Scaled value of length of semi-major axis (equatorial radius)
unsigned[4] scaledValueOfLengthOfSemiMajorAxis = missing(): can_be_missing, edition_specific;
# Scale factor of prime meridian offset
unsigned[1] scaleFactorOfPrimeMeridianOffset = missing(): can_be_missing, edition_specific;
# Scaled value of prime meridian offset
# Note: Basic angle of the initial production domain and subdivisions of this basic angle are
# provided to manage cases where the recommended unit of 10^-6 degrees is not applicable
# to describe the extreme longitudes and latitudes, and direction increments.
# For these descriptors, the unit is equal to the ratio of the basic angle and the subdivisions number.
# For ordinary cases, zero and missing values should be coded, equivalent to respective values
# of 1 and 10^6 (10^-6 degrees unit)
unsigned[4] scaledValueOfPrimeMeridianOffset = missing(): can_be_missing, edition_specific;
# Scale factor of length of semi-minor axis
unsigned[1] scaleFactorOfLengthOfSemiMinorAxis = missing() : can_be_missing, edition_specific;
# Scaled value of length of semi-minor axis (distance from ellipsoid centre to pole)
unsigned[4] scaledValueOfLengthOfSemiMinorAxis = missing() : can_be_missing, edition_specific;

View File

@ -0,0 +1,135 @@
# Horizontal Domain Template Component 4.1 - Latitude/longitude regular grid
# Ni - number of points along a parallel
unsigned[4] Ni : dump; # Note: This is for a REGULAR GRID so Ni cannot be missing
alias numberOfPointsAlongAParallel=Ni;
alias Nx = Ni;
alias geography.Ni=Ni;
# Nj - number of points along a meridian
unsigned[4] Nj : dump;
alias numberOfPointsAlongAMeridian=Nj;
alias Ny = Nj ;
alias geography.Nj=Nj;
# Basic angle of the initial production domain
unsigned[4] basicAngleOfTheInitialProductionDomain = 0;
transient mBasicAngle=basicAngleOfTheInitialProductionDomain*oneMillionConstant;
transient angleMultiplier = 1;
transient mAngleMultiplier = 1000000;
when (basicAngleOfTheInitialProductionDomain == 0) {
set angleMultiplier = 1;
set mAngleMultiplier = 1000000;
} else {
set angleMultiplier = basicAngleOfTheInitialProductionDomain;
set mAngleMultiplier = mBasicAngle;
}
# Subdivisions of basic angle used to define extreme longitudes and latitudes, and direction increments
unsigned[4] subdivisionsOfBasicAngle = missing() : can_be_missing;
transient angleDivisor = 1000000;
when (missing(subdivisionsOfBasicAngle) || subdivisionsOfBasicAngle == 0) {
set angleDivisor = 1000000;
set angularPrecision = 1000000;
} else {
set angleDivisor = subdivisionsOfBasicAngle;
set angularPrecision = subdivisionsOfBasicAngle;
}
# Note: Basic angle of the initial production domain and subdivisions of this basic angle are
# provided to manage cases where the recommended unit of 10^-6 degrees is not applicable
# to describe the extreme longitudes and latitudes, and direction increments.
# For these descriptors, the unit is equal to the ratio of the basic angle and the subdivisions number.
# For ordinary cases, zero and missing values should be coded, equivalent to respective values
# of 1 and 10^6 (10^-6 degrees unit)
# La1 - latitude of first grid point
signed[4] latitudeOfFirstGridPoint : edition_specific;
alias La1 = latitudeOfFirstGridPoint;
# Lo1 - longitude of first grid point
signed[4] longitudeOfFirstGridPoint ;
alias Lo1 = longitudeOfFirstGridPoint;
include "grib3/template.4.resolution_flags.def"
# La2 - latitude of last grid point
signed[4] latitudeOfLastGridPoint : edition_specific;
alias La2 = latitudeOfLastGridPoint;
# Lo2 - longitude of last grid point
signed[4] longitudeOfLastGridPoint : edition_specific;
alias Lo2 = longitudeOfLastGridPoint;
# Di - i direction increment
# Direction increments are unsigned and direction of increment is represented in the scanning mode
unsigned[4] iDirectionIncrement : can_be_missing,edition_specific;
alias Di = iDirectionIncrement;
alias Dx = iDirectionIncrement;
# Dj - j direction increment
# Direction increments are unsigned and direction of increment is represented in the scanning mode
unsigned[4] jDirectionIncrement : can_be_missing,edition_specific;
alias Dj = jDirectionIncrement;
alias Dy = jDirectionIncrement;
include "grib3/template.4.scanning_mode.def";
meta g2grid g2grid(
latitudeOfFirstGridPoint,
longitudeOfFirstGridPoint,
latitudeOfLastGridPoint,
longitudeOfLastGridPoint,
iDirectionIncrement,
jDirectionIncrement,
basicAngleOfTheInitialProductionDomain,
subdivisionsOfBasicAngle
);
meta geography.latitudeOfFirstGridPointInDegrees g2latlon(g2grid,0) : dump;
meta geography.longitudeOfFirstGridPointInDegrees g2latlon(g2grid,1) : dump;
meta geography.latitudeOfLastGridPointInDegrees g2latlon(g2grid,2) : dump;
meta geography.longitudeOfLastGridPointInDegrees g2latlon(g2grid,3) : dump;
alias xFirst=longitudeOfFirstGridPointInDegrees;
alias yFirst=latitudeOfFirstGridPointInDegrees;
alias xLast=longitudeOfLastGridPointInDegrees;
alias yLast=latitudeOfLastGridPointInDegrees;
meta geography.iDirectionIncrementInDegrees g2latlon(g2grid,4,
iDirectionIncrementGiven) : can_be_missing,dump;
meta geography.jDirectionIncrementInDegrees g2latlon(g2grid,5,
jDirectionIncrementGiven) : can_be_missing,dump;
alias latitudeFirstInDegrees = latitudeOfFirstGridPointInDegrees;
alias longitudeFirstInDegrees = longitudeOfFirstGridPointInDegrees;
alias latitudeLastInDegrees = latitudeOfLastGridPointInDegrees;
alias longitudeLastInDegrees = longitudeOfLastGridPointInDegrees;
alias DiInDegrees = iDirectionIncrementInDegrees;
alias DxInDegrees = iDirectionIncrementInDegrees;
alias DjInDegrees = jDirectionIncrementInDegrees;
alias DyInDegrees = jDirectionIncrementInDegrees;
#_if ( missing(Ni) && PLPresent == 1 ) {
# iterator latlon_reduced(numberOfPoints,missingValue,values,
# latitudeFirstInDegrees,longitudeFirstInDegrees,
# latitudeLastInDegrees,longitudeLastInDegrees,
# Nj,DjInDegrees,pl);
# nearest latlon_reduced(values,radius,Nj,pl,longitudeFirstInDegrees,longitudeLastInDegrees);
#} else {
iterator latlon(numberOfPoints,missingValue,values,
longitudeFirstInDegrees,DiInDegrees,
Ni,Nj,iScansNegatively,
latitudeFirstInDegrees, DjInDegrees,jScansPositively,jPointsAreConsecutive);
nearest regular(values,radius,Ni,Nj);
#}
meta latLonValues latlonvalues(values);
alias latitudeLongitudeValues=latLonValues;
meta latitudes latitudes(values,0);
meta longitudes longitudes(values,0);
meta distinctLatitudes latitudes(values,1);
meta distinctLongitudes longitudes(values,1);

View File

@ -0,0 +1,21 @@
# Horizontal Domain Template Component 4.2 - Rotation of latitude/longitude coordinates system
# Latitude of the southern pole of projection
signed[4] latitudeOfSouthernPole : no_copy;
alias latitudeOfTheSouthernPoleOfProjection=latitudeOfSouthernPole;
# Longitude of the southern pole of projection
unsigned[4] longitudeOfSouthernPole : no_copy;
alias longitudeOfTheSouthernPoleOfProjection=longitudeOfSouthernPole;
meta geography.latitudeOfSouthernPoleInDegrees scale(latitudeOfSouthernPole,
one,grib3divider,truncateDegrees) : dump;
meta geography.longitudeOfSouthernPoleInDegrees g2lon(longitudeOfSouthernPole) : dump;
# Angle of rotation of projection
ieeefloat angleOfRotation : dump,edition_specific ;
alias geography.angleOfRotationInDegrees=angleOfRotation;
alias angleOfRotationOfProjection=angleOfRotation;
alias is_rotated_grid=one;

View File

@ -0,0 +1,20 @@
# Horizontal Domain Template Component 4.3 - Stretching of latitude/longitude coordinates system
label "Stretching information";
# Latitude of the pole of stretching
signed[4] latitudeOfThePoleOfStretching : edition_specific,no_copy;
# Longitude of the pole of stretching
signed[4] longitudeOfThePoleOfStretching : edition_specific,no_copy;
meta geography.latitudeOfStretchingPoleInDegrees
scale(latitudeOfThePoleOfStretching,oneConstant,grib3divider,truncateDegrees) : dump;
meta geography.longitudeOfStretchingPoleInDegrees
scale(longitudeOfThePoleOfStretching,oneConstant,grib3divider,truncateDegrees) : dump;
# Stretching factor
unsigned[4] stretchingFactorScaled : edition_specific,no_copy;
meta geography.stretchingFactor
scale(stretchingFactorScaled,oneConstant,grib3divider) : dump;

View File

@ -10,4 +10,4 @@
# TEMPLATE 3.0, Forecast point in time
# Forecast point in time
include "grib3/template.component.3.0.def";
include "grib3/tc/template.component.3.0.def";

View File

@ -10,7 +10,7 @@
# TEMPLATE 4.0, Latitude/longitude regular grid on ellipsoidal planet
# Ellipsoid of revolution defined with axis lengths
include "grib3/template.component.4.0.def";
include "grib3/tc/template.component.4.0.def";
# Latitude/longitude regular grid
include "grib3/template.component.4.1.def";
include "grib3/tc/template.component.4.1.def";

View File

@ -10,10 +10,10 @@
# TEMPLATE 4.1, Rotated latitude/longitude regular grid on ellipsoidal planet
# Ellipsoid of revolution defined with axis lengths
include "grib3/template.component.4.0.def"
include "grib3/tc/template.component.4.0.def"
# Latitude/longitude regular grid
include "grib3/template.component.4.1.def"
include "grib3/tc/template.component.4.1.def"
# Rotation of latitude/longitude coordinate system
include "grib3/template.component.4.2.def"
include "grib3/tc/template.component.4.2.def"

View File

@ -10,10 +10,10 @@
# TEMPLATE 4.2, Stretched latitude/longitude regular grid on ellipsoidal planet
# Ellipsoid of revolution defined with axis lengths
include "grib3/template.component.4.0.def"
include "grib3/tc/template.component.4.0.def"
# Latitude/longitude regular grid
include "grib3/template.component.4.1.def"
include "grib3/tc/template.component.4.1.def"
# Stretching of latitude/longitude coordinate system
include "grib3/template.component.4.3.def"
include "grib3/tc/template.component.4.3.def"

View File

@ -10,13 +10,13 @@
# TEMPLATE 4.3, Stretched and rotated latitude/longitude regular grid on ellipsoidal planet
# Ellipsoid of revolution defined with axis lengths
include "grib3/template.component.4.0.def"
include "grib3/tc/template.component.4.0.def"
# Latitude/longitude regular grid
include "grib3/template.component.4.1.def"
include "grib3/tc/template.component.4.1.def"
# Rotation of latitude/longitude coordinate system
include "grib3/template.component.4.2.def"
include "grib3/tc/template.component.4.2.def"
# Stretching of latitude/longitude coordinate system
include "grib3/template.component.4.3.def"
include "grib3/tc/template.component.4.3.def"

View File

@ -10,4 +10,4 @@
# TEMPLATE 5.0, Vertical level
# Vertical level
include "grib3/template.component.5.0.def";
include "grib3/tc/template.component.5.0.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 5.1, Vertical layer
# Vertical layer
include "grib3/template.component.5.1.def";
include "grib3/tc/template.component.5.1.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 6.0, Forecast, analysis or observation
# Process type and identifier
include "grib3/template.component.6.0.def";
include "grib3/tc/template.component.6.0.def";

View File

@ -10,10 +10,10 @@
# TEMPLATE 6.1, Individual ensemble forecast or analysis
# Process type and identifier
include "grib3/template.component.6.0.def";
include "grib3/tc/template.component.6.0.def";
# Ensemble size
include "grib3/template.component.6.1.def";
include "grib3/tc/template.component.6.1.def";
# Ensemble member
include "grib3/template.component.6.2.def";
include "grib3/tc/template.component.6.2.def";

View File

@ -10,10 +10,10 @@
# TEMPLATE 6.2, Statistical post-processing of all ensemble members
# Process type and identifier
include "grib3/template.component.6.0.def";
include "grib3/tc/template.component.6.0.def";
# Ensemble size
include "grib3/template.component.6.1.def";
include "grib3/tc/template.component.6.1.def";
# Statistical post-processing of ensemble members
include "grib3/template.component.6.3.def";
include "grib3/tc/template.component.6.3.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 7.0, Observable property by discipline, category and number
# Observable property by discipline, category and number
include "grib3/template.component.7.0.def";
include "grib3/tc/template.component.7.0.def";

View File

@ -10,7 +10,7 @@
# TEMPLATE 7.1, Observable Property with units conversion
# Observable property by discipline, category and number
include "grib3/template.component.7.0.def";
include "grib3/tc/template.component.7.0.def";
# Units conversion
include "grib3/template.component.7.1.def";
include "grib3/tc/template.component.7.1.def";

View File

@ -10,7 +10,7 @@
# TEMPLATE 7.2, Atmospheric chemical or physical constituents
# Observable property by discipline, category and number
include "grib3/template.component.7.0.def";
include "grib3/tc/template.component.7.0.def";
# Chemical or physical constituents
include "grib3/template.component.7.2.def";
include "grib3/tc/template.component.7.2.def";

View File

@ -10,10 +10,10 @@
# TEMPLATE 7.3, Aerosol physical property
# Observable property by discipline, category and number
include "grib3/template.component.7.0.def";
include "grib3/tc/template.component.7.0.def";
# Chemical or physical constituents
include "grib3/template.component.7.2.def";
include "grib3/tc/template.component.7.2.def";
# Aerosol size
include "grib3/template.component.7.3.def";
include "grib3/tc/template.component.7.3.def";

View File

@ -10,13 +10,13 @@
# TEMPLATE 7.4, Aerosol optical property
# Observable property by discipline, category and number
include "grib3/template.component.7.0.def";
include "grib3/tc/template.component.7.0.def";
# Chemical or physical constituents
include "grib3/template.component.7.2.def";
include "grib3/tc/template.component.7.2.def";
# Aerosol size
include "grib3/template.component.7.3.def";
include "grib3/tc/template.component.7.3.def";
# Radiation wavelength interval
include "grib3/template.component.7.4.def";
include "grib3/tc/template.component.7.4.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 8.0, Simple packing
# Simple packing
include "grib3/template.component.8.0.def";
include "grib3/tc/template.component.8.0.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 8.1, IEEE floating point
# IEEE floating point
include "grib3/template.component.8.1.def";
include "grib3/tc/template.component.8.1.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 9.0, Bitmap
# Bitmap
include "grib3/template.component.9.0.def";
include "grib3/tc/template.component.9.0.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 8.0, Simple packing
# Simple packing
include "grib3/template.component.8.0.def";
include "grib3/tc/template.component.8.0.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 8.1, IEEE floating point
# IEEE floating point
include "grib3/template.component.8.1.def";
include "grib3/tc/template.component.8.1.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 6.0, Forecast, analysis or observation
# Process type and identifier
include "grib3/template.component.6.0.def";
include "grib3/tc/template.component.6.0.def";

View File

@ -10,10 +10,10 @@
# TEMPLATE 6.1, Individual ensemble forecast or analysis
# Process type and identifier
include "grib3/template.component.6.0.def";
include "grib3/tc/template.component.6.0.def";
# Ensemble size
include "grib3/template.component.6.1.def";
include "grib3/tc/template.component.6.1.def";
# Ensemble member
include "grib3/template.component.6.2.def";
include "grib3/tc/template.component.6.2.def";

View File

@ -10,10 +10,10 @@
# TEMPLATE 6.2, Statistical post-processing of all ensemble members
# Process type and identifier
include "grib3/template.component.6.0.def";
include "grib3/tc/template.component.6.0.def";
# Ensemble size
include "grib3/template.component.6.1.def";
include "grib3/tc/template.component.6.1.def";
# Statistical post-processing of ensemble members
include "grib3/template.component.6.3.def";
include "grib3/tc/template.component.6.3.def";

View File

@ -10,7 +10,7 @@
# TEMPLATE 4.0, Latitude/longitude regular grid on ellipsoidal planet
# Ellipsoid of revolution defined with axis lengths
include "grib3/template.component.4.0.def";
include "grib3/tc/template.component.4.0.def";
# Latitude/longitude regular grid
include "grib3/template.component.4.1.def";
include "grib3/tc/template.component.4.1.def";

View File

@ -10,10 +10,10 @@
# TEMPLATE 4.1, Rotated latitude/longitude regular grid on ellipsoidal planet
# Ellipsoid of revolution defined with axis lengths
include "grib3/template.component.4.0.def"
include "grib3/tc/template.component.4.0.def"
# Latitude/longitude regular grid
include "grib3/template.component.4.1.def"
include "grib3/tc/template.component.4.1.def"
# Rotation of latitude/longitude coordinate system
include "grib3/template.component.4.2.def"
include "grib3/tc/template.component.4.2.def"

View File

@ -10,10 +10,10 @@
# TEMPLATE 4.2, Stretched latitude/longitude regular grid on ellipsoidal planet
# Ellipsoid of revolution defined with axis lengths
include "grib3/template.component.4.0.def"
include "grib3/tc/template.component.4.0.def"
# Latitude/longitude regular grid
include "grib3/template.component.4.1.def"
include "grib3/tc/template.component.4.1.def"
# Stretching of latitude/longitude coordinate system
include "grib3/template.component.4.3.def"
include "grib3/tc/template.component.4.3.def"

View File

@ -10,7 +10,7 @@
# TEMPLATE 4.3, Stretched and rotated latitude/longitude regular grid on ellipsoidal planet
# Ellipsoid of revolution defined with axis lengths
include "grib3/tc/4.0.ellipsoid_with_axis_lengthes.def"
include "grib3/tc/4.0.ellipsoid_with_axis_lengths.def"
# Latitude/longitude regular grid
include "grib3/tc/4.1.latlon_regular_grid.def"

View File

@ -10,4 +10,4 @@
# TEMPLATE 7.0, Observable property by discipline, category and number
# Observable property by discipline, category and number
include "grib3/template.component.7.0.def";
include "grib3/tc/template.component.7.0.def";

View File

@ -10,7 +10,7 @@
# TEMPLATE 7.1, Observable Property with units conversion
# Observable property by discipline, category and number
include "grib3/template.component.7.0.def";
include "grib3/tc/template.component.7.0.def";
# Units conversion
include "grib3/template.component.7.1.def";
include "grib3/tc/template.component.7.1.def";

View File

@ -10,7 +10,7 @@
# TEMPLATE 7.2, Atmospheric chemical or physical constituents
# Observable property by discipline, category and number
include "grib3/template.component.7.0.def";
include "grib3/tc/template.component.7.0.def";
# Chemical or physical constituents
include "grib3/template.component.7.2.def";
include "grib3/tc/template.component.7.2.def";

View File

@ -10,10 +10,10 @@
# TEMPLATE 7.3, Aerosol physical property
# Observable property by discipline, category and number
include "grib3/template.component.7.0.def";
include "grib3/tc/template.component.7.0.def";
# Chemical or physical constituents
include "grib3/template.component.7.2.def";
include "grib3/tc/template.component.7.2.def";
# Aerosol size
include "grib3/template.component.7.3.def";
include "grib3/tc/template.component.7.3.def";

View File

@ -10,13 +10,13 @@
# TEMPLATE 7.4, Aerosol optical property
# Observable property by discipline, category and number
include "grib3/template.component.7.0.def";
include "grib3/tc/template.component.7.0.def";
# Chemical or physical constituents
include "grib3/template.component.7.2.def";
include "grib3/tc/template.component.7.2.def";
# Aerosol size
include "grib3/template.component.7.3.def";
include "grib3/tc/template.component.7.3.def";
# Radiation wavelength interval
include "grib3/template.component.7.4.def";
include "grib3/tc/template.component.7.4.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 9.0, Bitmap
# Bitmap
include "grib3/template.component.9.0.def";
include "grib3/tc/template.component.9.0.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 3.0, Forecast point in time
# Forecast point in time
include "grib3/template.component.3.0.def";
include "grib3/tc/template.component.3.0.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 5.0, Vertical level
# Vertical level
include "grib3/template.component.5.0.def";
include "grib3/tc/template.component.5.0.def";

View File

@ -10,4 +10,4 @@
# TEMPLATE 5.1, Vertical layer
# Vertical layer
include "grib3/template.component.5.1.def";
include "grib3/tc/template.component.5.1.def";