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
|
2015-07-28 09:50:26 +00:00
|
|
|
include "grib2/template.3.shape_of_the_earth.def";
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
# Nx - number of points along X-axis
|
|
|
|
unsigned[4] numberOfPointsAlongXAxis : dump ;
|
|
|
|
alias Nx = numberOfPointsAlongXAxis;
|
2019-02-13 13:27:43 +00:00
|
|
|
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;
|
2019-02-13 13:27:43 +00:00
|
|
|
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;
|
2020-05-16 11:54:03 +00:00
|
|
|
meta geography.latitudeOfFirstGridPointInDegrees scale(latitudeOfFirstGridPoint
|
2013-03-25 12:04:10 +00:00
|
|
|
,one,grib2divider,truncateDegrees) : dump;
|
|
|
|
#meta latitudeOfFirstGridPointInMicrodegrees times(latitudeOfFirstGridPoint,mAngleMultiplier,angleDivisor): no_copy;
|
|
|
|
|
|
|
|
# Lo1 - longitude of first grid point
|
|
|
|
signed[4] longitudeOfFirstGridPoint: edition_specific ;
|
|
|
|
alias La1 = longitudeOfFirstGridPoint;
|
2020-05-16 11:54:03 +00:00
|
|
|
meta geography.longitudeOfFirstGridPointInDegrees scale(longitudeOfFirstGridPoint
|
2013-03-25 12:04:10 +00:00
|
|
|
,one,grib2divider,truncateDegrees) : dump;
|
|
|
|
#meta longitudeOfFirstGridPointInMicrodegrees times(longitudeOfFirstGridPoint,mAngleMultiplier,angleDivisor) : no_copy;
|
|
|
|
|
|
|
|
signed[4] standardParallelInMicrodegrees : dump;
|
|
|
|
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
|
|
|
|
|
|
|
signed[4] centralLongitudeInMicrodegrees : dump;
|
|
|
|
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
|
|
|
|
|
|
|
# Resolution and component flag
|
2016-03-30 16:25:17 +00:00
|
|
|
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 ;
|
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
|
|
|
|
|
|
|
# Dy - Y-direction grid length in millimetres
|
|
|
|
unsigned[4] yDirectionGridLengthInMillimetres : dump ;
|
|
|
|
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
|
|
|
|
2015-07-28 09:50:26 +00:00
|
|
|
include "grib2/template.3.scanning_mode.def";
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
iterator lambert_azimuthal_equal_area(numberOfPoints,missingValue,values,
|
|
|
|
radius,Nx,Ny,
|
|
|
|
latitudeOfFirstGridPointInDegrees,longitudeOfFirstGridPointInDegrees,
|
2020-06-11 14:09:33 +00:00
|
|
|
standardParallelInDegrees,centralLongitudeInDegrees,
|
2013-03-25 12:04:10 +00:00
|
|
|
Dx,Dy,
|
2020-05-16 11:54:03 +00:00
|
|
|
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);
|