Skip to content

Commit

Permalink
Make grid names more strict (invalid: N00001280 , valid: N1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
wdeconinck committed Aug 1, 2023
1 parent d3d55f4 commit 38d9072
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/atlas/grid/detail/grid/CubedSphere.cc
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ GridFactoryBuilder<CubedSphere> __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-<N>", "CS-LFR-{C,L}-<N>"}) {}

void print(std::ostream& os) const override {
Expand Down Expand Up @@ -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-<N>", "CS-EA-{C,L}-<N>"}) {}

void print(std::ostream& os) const override {
Expand Down Expand Up @@ -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-<N>", "CS-ED-{C,L}-<N>"}) {}

void print(std::ostream& os) const override {
Expand Down
2 changes: 1 addition & 1 deletion src/atlas/grid/detail/grid/Healpix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace { // anonymous

static class HealpixGridBuilder : GridBuilder {
public:
HealpixGridBuilder(): GridBuilder("healpix", {"^[Hh]([0-9]+)$"}, {"H<n>"}) {}
HealpixGridBuilder(): GridBuilder("healpix", {"^[Hh]([1-9][0-9]*)$"}, {"H<n>"}) {}

void print(std::ostream& os) const override {
os << std::left << std::setw(20) << "H<n>"
Expand Down
8 changes: 4 additions & 4 deletions src/atlas/grid/detail/grid/LonLat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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]+)$"}, {"L<nx>x<ny>", "L<gauss>"}) {}
GridBuilder("regular_lonlat", {"^[Ll]([1-9][0-9]*)x([1-9][0-9]*)$", "^[Ll]([1-9][0-9]*)$"}, {"L<nx>x<ny>", "L<gauss>"}) {}

void print(std::ostream& os) const override {
os << std::left << std::setw(20) << "L<nx>x<ny> / L<gauss>"
Expand Down Expand Up @@ -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]+)$"}, {"S<nx>x<ny>", "S<gauss>"}) {}
GridBuilder("shifted_lonlat", {"^[Ss]([1-9][0-9]*)x([1-9][0-9]*)$", "^[Ss]([1-9][0-9]*)$"}, {"S<nx>x<ny>", "S<gauss>"}) {}

void print(std::ostream& os) const override {
os << std::left << std::setw(20) << "S<nx>x<ny> / S<gauss>"
Expand Down Expand Up @@ -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]*)$"},
{"Slon<nx>x<ny>", "Slon<gauss>"}) {}

void print(std::ostream& os) const override {
Expand Down Expand Up @@ -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]*)$"},
{"Slat<nx>x<ny>", "Slat<gauss>"}) {}

void print(std::ostream& os) const override {
Expand Down

0 comments on commit 38d9072

Please sign in to comment.