eccodes/definitions/grib2/template.3.latlon.def

76 lines
2.8 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
2024-01-16 12:40:17 +00:00
include "grib2/template.3.grid.def"
2013-03-25 12:04:10 +00:00
2023-08-16 14:03:40 +00:00
# Di - i direction increment
2013-03-25 12:04:10 +00:00
unsigned[4] iDirectionIncrement : can_be_missing,edition_specific;
2023-08-16 14:03:40 +00:00
alias Di = iDirectionIncrement;
alias Dx = iDirectionIncrement;
2013-03-25 12:04:10 +00:00
2023-08-16 14:03:40 +00:00
# Dj - j direction increment
2013-03-25 12:04:10 +00:00
unsigned[4] jDirectionIncrement : can_be_missing,edition_specific;
2023-08-16 14:03:40 +00:00
alias Dj = jDirectionIncrement;
alias Dy = jDirectionIncrement;
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
meta g2grid g2grid(
latitudeOfFirstGridPoint,
longitudeOfFirstGridPoint,
latitudeOfLastGridPoint,
longitudeOfLastGridPoint,
iDirectionIncrement,
jDirectionIncrement,
basicAngleOfTheInitialProductionDomain,
subdivisionsOfBasicAngle
2023-12-02 13:34:19 +00:00
);
2013-03-25 12:04:10 +00:00
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;
2013-03-25 12:04:10 +00:00
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 {
transient iteratorDisableUnrotate = 0 : hidden; # ECC-808
2013-03-25 12:04:10 +00:00
iterator latlon(numberOfPoints,missingValue,values,
2023-12-02 13:34:19 +00:00
longitudeFirstInDegrees,DiInDegrees ,
Ni,Nj,iScansNegatively,
latitudeFirstInDegrees, DjInDegrees,
jScansPositively, jPointsAreConsecutive,
isRotatedGrid, angleOfRotation,
latitudeOfSouthernPoleInDegrees,longitudeOfSouthernPoleInDegrees);
2013-03-25 12:04:10 +00:00
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);