Skip to content

Commit

Permalink
Willem's suggested modifications from ecmwf#167
Browse files Browse the repository at this point in the history
  • Loading branch information
phlndrwd committed Jan 10, 2024
1 parent e734e7a commit abc8c27
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions src/atlas/meshgenerator/detail/CubedSphereDualMeshGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ CubedSphereDualMeshGenerator::CubedSphereDualMeshGenerator(const eckit::Parametr
}

// Get partitioner.
std::string partitioner;
try { p.get("partitioner.type", partitioner); } catch( std::exception& ) {}
p.get("partitioner", partitioner);
if( partitioner.size() ) {
if (p.has("partitioner.type")) {
std::string partitioner;
p.get("partitioner.type", partitioner);
options.set("partitioner", partitioner);
}
else if (p.has("partitioner")) {
std::string partitioner;
p.get("partitioner", partitioner);
options.set("partitioner", partitioner);
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/atlas/meshgenerator/detail/CubedSphereMeshGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@ CubedSphereMeshGenerator::CubedSphereMeshGenerator(const eckit::Parametrisation&
}

// Get partitioner.
std::string partitioner;
try { p.get("partitioner.type", partitioner); } catch( std::exception& ) {}
p.get("partitioner", partitioner);
if( partitioner.size() ) {
if (p.has("partitioner.type")) {
std::string partitioner;
p.get("partitioner.type", partitioner);
options.set("partitioner", partitioner);
}
else if (p.has("partitioner")) {
std::string partitioner;
p.get("partitioner", partitioner);
options.set("partitioner", partitioner);
}
}
Expand Down

0 comments on commit abc8c27

Please sign in to comment.