From 38d9072360469c39e67fd57fb06a0b0fc36cfa46 Mon Sep 17 00:00:00 2001 From: Willem Deconinck Date: Tue, 1 Aug 2023 17:59:32 +0200 Subject: [PATCH] Make grid names more strict (invalid: N00001280 , valid: N1280) --- src/atlas/grid/detail/grid/CubedSphere.cc | 6 +++--- src/atlas/grid/detail/grid/Healpix.cc | 2 +- src/atlas/grid/detail/grid/LonLat.cc | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/atlas/grid/detail/grid/CubedSphere.cc b/src/atlas/grid/detail/grid/CubedSphere.cc index da653959d..bc70444b0 100644 --- a/src/atlas/grid/detail/grid/CubedSphere.cc +++ b/src/atlas/grid/detail/grid/CubedSphere.cc @@ -315,7 +315,7 @@ GridFactoryBuilder __register_CubedSphere(CubedSphere::static_type( static class cubedsphere_lfric : public GridBuilder { public: cubedsphere_lfric(): - GridBuilder("cubedsphere_lfric", {"^[Cc][Ss][_-][Ll][Ff][Rr][-_](([CL])[-_])?([0-9]+)$"}, + GridBuilder("cubedsphere_lfric", {"^[Cc][Ss][_-][Ll][Ff][Rr][-_](([CL])[-_])?([1-9][0-9]*)$"}, {"CS-LFR-", "CS-LFR-{C,L}-"}) {} void print(std::ostream& os) const override { @@ -399,7 +399,7 @@ static class cubedsphere_lfric : public GridBuilder { static class cubedsphere_equiangular : public GridBuilder { public: cubedsphere_equiangular(): - GridBuilder("cubedsphere_equiangular", {"^[Cc][Ss][_-][Ee][Aa][-_](([CL])[-_])?([0-9]+)$"}, + GridBuilder("cubedsphere_equiangular", {"^[Cc][Ss][_-][Ee][Aa][-_](([CL])[-_])?([1-9][0-9]*)$"}, {"CS-EA-", "CS-EA-{C,L}-"}) {} void print(std::ostream& os) const override { @@ -481,7 +481,7 @@ static class cubedsphere_equiangular : public GridBuilder { static class cubedsphere_equidistant : public GridBuilder { public: cubedsphere_equidistant(): - GridBuilder("cubedsphere_equidistant", {"^[Cc][Ss][_-][Ee][Dd][-_](([CL])[-_])?([0-9]+)$"}, + GridBuilder("cubedsphere_equidistant", {"^[Cc][Ss][_-][Ee][Dd][-_](([CL])[-_])?([1-9][0-9]*)$"}, {"CS-ED-", "CS-ED-{C,L}-"}) {} void print(std::ostream& os) const override { diff --git a/src/atlas/grid/detail/grid/Healpix.cc b/src/atlas/grid/detail/grid/Healpix.cc index 08baa68b6..9a0d4c6f3 100644 --- a/src/atlas/grid/detail/grid/Healpix.cc +++ b/src/atlas/grid/detail/grid/Healpix.cc @@ -31,7 +31,7 @@ namespace { // anonymous static class HealpixGridBuilder : GridBuilder { public: - HealpixGridBuilder(): GridBuilder("healpix", {"^[Hh]([0-9]+)$"}, {"H"}) {} + HealpixGridBuilder(): GridBuilder("healpix", {"^[Hh]([1-9][0-9]*)$"}, {"H"}) {} void print(std::ostream& os) const override { os << std::left << std::setw(20) << "H" diff --git a/src/atlas/grid/detail/grid/LonLat.cc b/src/atlas/grid/detail/grid/LonLat.cc index 50ca3443d..493b86f3d 100644 --- a/src/atlas/grid/detail/grid/LonLat.cc +++ b/src/atlas/grid/detail/grid/LonLat.cc @@ -124,7 +124,7 @@ StructuredGrid::grid_t* create_lonlat(const Grid::Config& config, Shift shift) { static class regular_lonlat : public GridBuilder { public: regular_lonlat(): - GridBuilder("regular_lonlat", {"^[Ll]([0-9]+)x([0-9]+)$", "^[Ll]([0-9]+)$"}, {"Lx", "L"}) {} + GridBuilder("regular_lonlat", {"^[Ll]([1-9][0-9]*)x([1-9][0-9]*)$", "^[Ll]([1-9][0-9]*)$"}, {"Lx", "L"}) {} void print(std::ostream& os) const override { os << std::left << std::setw(20) << "Lx / L" @@ -165,7 +165,7 @@ static class regular_lonlat : public GridBuilder { static class shifted_lonlat : public GridBuilder { public: shifted_lonlat(): - GridBuilder("shifted_lonlat", {"^[Ss]([0-9]+)x([0-9]+)$", "^[Ss]([0-9]+)$"}, {"Sx", "S"}) {} + GridBuilder("shifted_lonlat", {"^[Ss]([1-9][0-9]*)x([1-9][0-9]*)$", "^[Ss]([1-9][0-9]*)$"}, {"Sx", "S"}) {} void print(std::ostream& os) const override { os << std::left << std::setw(20) << "Sx / S" @@ -206,7 +206,7 @@ static class shifted_lonlat : public GridBuilder { static class shifted_lon : public GridBuilder { public: shifted_lon(): - GridBuilder("shifted_lon", {"^[Ss][Ll][Oo][Nn]([0-9]+)x([0-9]+)$", "^[Ss][Ll][Oo][Nn]([0-9]+)$"}, + GridBuilder("shifted_lon", {"^[Ss][Ll][Oo][Nn]([1-9][0-9]*)x([1-9][0-9]*)$", "^[Ss][Ll][Oo][Nn]([1-9][0-9]*)$"}, {"Slonx", "Slon"}) {} void print(std::ostream& os) const override { @@ -248,7 +248,7 @@ static class shifted_lon : public GridBuilder { static class shifted_lat : public GridBuilder { public: shifted_lat(): - GridBuilder("shifted_lat", {"^[Ss][Ll][Aa][Tt]([0-9]+)x([0-9]+)$", "^[Ss][Ll][Aa][Tt]([0-9]+)$"}, + GridBuilder("shifted_lat", {"^[Ss][Ll][Aa][Tt]([1-9][0-9]*)x([1-9][0-9]*)$", "^[Ss][Ll][Aa][Tt]([1-9][0-9]*)$"}, {"Slatx", "Slat"}) {} void print(std::ostream& os) const override {