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
|
|
|
|
2023-11-22 10:51:00 +00:00
|
|
|
constant isGridded = true;
|
2023-08-03 14:15:26 +00:00
|
|
|
|
|
|
|
# Nx - number of points along X-axis
|
|
|
|
unsigned[4] numberOfPointsAlongXAxis : dump;
|
2023-08-16 10:34:37 +00:00
|
|
|
alias Nx = numberOfPointsAlongXAxis;
|
|
|
|
alias Ni = Nx;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2023-08-03 14:15:26 +00:00
|
|
|
# Ny - number of points along Y-axis
|
|
|
|
unsigned[4] numberOfPointsAlongYAxis : dump;
|
2023-08-16 10:34:37 +00:00
|
|
|
alias Ny = numberOfPointsAlongYAxis;
|
|
|
|
alias numberOfPointsAlongAMeridian = Ny;
|
|
|
|
alias Nj = Ny;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2023-08-03 14:15:26 +00:00
|
|
|
# La1 - latitude of first grid point
|
|
|
|
signed[4] latitudeOfFirstGridPoint: edition_specific;
|
2023-08-16 10:34:37 +00:00
|
|
|
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;
|
|
|
|
|
2023-08-03 14:15:26 +00:00
|
|
|
# Lo1 - longitude of first grid point
|
2013-03-25 12:04:10 +00:00
|
|
|
signed[4] longitudeOfFirstGridPoint: edition_specific ;
|
2023-08-16 10:34:37 +00:00
|
|
|
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
|
|
|
|
2023-08-03 14:15:26 +00:00
|
|
|
signed[4] standardParallelInMicrodegrees : dump;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias standardParallel=standardParallelInMicrodegrees;
|
2019-01-02 19:06:10 +00:00
|
|
|
meta geography.standardParallelInDegrees scale(standardParallelInMicrodegrees,one,grib2divider,truncateDegrees) : dump;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2023-08-03 14:15:26 +00:00
|
|
|
signed[4] centralLongitudeInMicrodegrees : dump;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias centralLongitude=centralLongitudeInMicrodegrees;
|
2019-01-02 19:06:10 +00:00
|
|
|
meta geography.centralLongitudeInDegrees scale(centralLongitudeInMicrodegrees,one,grib2divider,truncateDegrees) : dump;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2023-08-03 14:15:26 +00:00
|
|
|
# Resolution and component flag
|
|
|
|
flags[1] resolutionAndComponentFlags 'grib2/tables/[tablesVersion]/3.3.table' : dump;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2023-08-03 14:15:26 +00:00
|
|
|
# Dx - X-direction grid length in millimetres
|
|
|
|
unsigned[4] xDirectionGridLengthInMillimetres: dump;
|
|
|
|
alias Dx = xDirectionGridLengthInMillimetres;
|
2019-01-02 19:06:10 +00:00
|
|
|
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
|
|
|
|
2023-08-03 14:15:26 +00:00
|
|
|
# Dy - Y-direction grid length in millimetres
|
|
|
|
unsigned[4] yDirectionGridLengthInMillimetres : dump ;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias Dy = yDirectionGridLengthInMillimetres ;
|
2019-01-02 19:06:10 +00:00
|
|
|
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
|
|
|
|
2020-06-12 21:14:02 +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);
|
2019-02-13 13:27:43 +00:00
|
|
|
meta distinctLatitudes latitudes(values,1);
|
|
|
|
meta distinctLongitudes longitudes(values,1);
|