Skip to content

Commit

Permalink
configurable domains to be saved
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumevernieres committed Jan 15, 2025
1 parent 7c2a3c8 commit cfb239a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion utils/soca/gdas_incr_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ namespace gdasapp {
oops::Log::info() << "geometry: " << std::endl << geomConfig << std::endl;
const soca::Geometry geom(geomConfig, this->getComm());

// Domains to save
std::vector<std::string> domains = {"ocn", "ice"};
if (fullConfig.has("domains")) {
fullConfig.get("domains", domains);
}

// Check that we are using at least 2 mpi tasks
if (this->getComm().size() < 2) {
throw eckit::BadValue("This application requires at least 2 MPI tasks", Here());
Expand Down Expand Up @@ -65,7 +71,7 @@ namespace gdasapp {
oops::Log::debug() << incr_mom6 << std::endl;

// Save final increment
result = postProcIncr.save(incr_mom6, i);
result = postProcIncr.save(incr_mom6, i, domains);
oops::Log::debug() << "========= after appending layer and after saving:" << std::endl;
oops::Log::debug() << incr_mom6 << std::endl;
}
Expand Down
4 changes: 2 additions & 2 deletions utils/soca/gdas_postprocincr.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class PostProcIncr {
// -----------------------------------------------------------------------------
// Save increment

int save(soca::Increment& socaIncr, int ensMem = 1) {
int save(soca::Increment& socaIncr, int ensMem = 1, const std::vector<std::string>& domains = {"ocn", "ice"}) {
oops::Log::info() << "==========================================" << std::endl;
oops::Log::info() << "-------------------- save increment: " << std::endl;
oops::Log::info() << socaIncr << std::endl;
Expand All @@ -239,7 +239,7 @@ class PostProcIncr {
std::string outputFileName;
outputIncrConfig_.get("output file", outputFileName);

for (const std::string& domain : {"ocn", "ice"}) {
for (const std::string& domain : domains) {
std::string outputDomain = dataDir + "/" + domain + "." +outputFileName;
if (outputIncrConfig_.has("pattern")) {
std::string pattern;
Expand Down

0 comments on commit cfb239a

Please sign in to comment.