eccodes/definitions/grib2/template.3.140.def

74 lines
2.9 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
# TEMPLATE 3.140, Lambert azimuthal equal area projection
2024-01-16 12:40:17 +00:00
include "grib2/template.3.shape_of_the_earth.def"
2013-03-25 12:04:10 +00:00
constant isGridded = true;
# Nx - number of points along X-axis
unsigned[4] numberOfPointsAlongXAxis : dump;
alias Nx = numberOfPointsAlongXAxis;
alias Ni = Nx;
2013-03-25 12:04:10 +00:00
# Ny - number of points along Y-axis
unsigned[4] numberOfPointsAlongYAxis : dump;
alias Ny = numberOfPointsAlongYAxis;
alias numberOfPointsAlongAMeridian = Ny;
alias Nj = Ny;
2013-03-25 12:04:10 +00:00
# La1 - latitude of first grid point
signed[4] latitudeOfFirstGridPoint: edition_specific;
alias La1 = latitudeOfFirstGridPoint;
2023-12-02 13:34:19 +00:00
meta geography.latitudeOfFirstGridPointInDegrees scale(
latitudeOfFirstGridPoint, one,grib2divider,truncateDegrees) : dump;
2013-03-25 12:04:10 +00:00
#meta latitudeOfFirstGridPointInMicrodegrees times(latitudeOfFirstGridPoint,mAngleMultiplier,angleDivisor): no_copy;
# Lo1 - longitude of first grid point
2013-03-25 12:04:10 +00:00
signed[4] longitudeOfFirstGridPoint: edition_specific ;
alias La1 = longitudeOfFirstGridPoint;
2023-12-02 13:34:19 +00:00
meta geography.longitudeOfFirstGridPointInDegrees scale(
longitudeOfFirstGridPoint,one,grib2divider,truncateDegrees) : dump;
2013-03-25 12:04:10 +00:00
signed[4] standardParallelInMicrodegrees : dump;
2013-03-25 12:04:10 +00:00
alias standardParallel=standardParallelInMicrodegrees;
meta geography.standardParallelInDegrees scale(standardParallelInMicrodegrees,one,grib2divider,truncateDegrees) : dump;
2013-03-25 12:04:10 +00:00
signed[4] centralLongitudeInMicrodegrees : dump;
2013-03-25 12:04:10 +00:00
alias centralLongitude=centralLongitudeInMicrodegrees;
meta geography.centralLongitudeInDegrees scale(centralLongitudeInMicrodegrees,one,grib2divider,truncateDegrees) : dump;
2013-03-25 12:04:10 +00:00
# Resolution and component flag
flags[1] resolutionAndComponentFlags 'grib2/tables/[tablesVersion]/3.3.table' : dump;
2013-03-25 12:04:10 +00:00
# Dx - X-direction grid length in millimetres
unsigned[4] xDirectionGridLengthInMillimetres: dump;
alias Dx = xDirectionGridLengthInMillimetres;
meta geography.xDirectionGridLengthInMetres scale(xDirectionGridLengthInMillimetres,one,thousand,truncateDegrees): dump;
2020-06-08 15:01:19 +00:00
alias DxInMetres = xDirectionGridLengthInMetres;
2013-03-25 12:04:10 +00:00
# Dy - Y-direction grid length in millimetres
unsigned[4] yDirectionGridLengthInMillimetres : dump ;
2013-03-25 12:04:10 +00:00
alias Dy = yDirectionGridLengthInMillimetres ;
meta geography.yDirectionGridLengthInMetres scale(yDirectionGridLengthInMillimetres,one,thousand,truncateDegrees): dump;
2020-06-08 15:01:19 +00:00
alias DyInMetres = yDirectionGridLengthInMetres;
2013-03-25 12:04:10 +00:00
2024-01-16 12:40:17 +00:00
include "grib2/template.3.scanning_mode.def"
2013-03-25 12:04:10 +00:00
2023-12-02 13:34:19 +00:00
iterator lambert_azimuthal_equal_area(
numberOfPoints,missingValue,values,
radius,Nx,Ny,
latitudeOfFirstGridPointInDegrees,longitudeOfFirstGridPointInDegrees,
standardParallelInDegrees,centralLongitudeInDegrees,
Dx,Dy,
iScansNegatively, jScansPositively,
jPointsAreConsecutive, alternativeRowScanning);
2013-03-25 12:04:10 +00:00
nearest lambert_azimuthal_equal_area(values,radius,Nx,Ny);
2013-03-25 12:04:10 +00:00
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);