Skip to content

Commit

Permalink
change res for hyb. weights
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumevernieres committed Jan 14, 2025
1 parent 595cfaf commit 5ece15f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion utils/soca/gdas_socahybridweights.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ namespace gdasapp {
oops::Log::info() << "geometry: " << std::endl << geomConfig << std::endl;
const soca::Geometry geom(geomConfig, this->getComm());

// Setup the output soca geometry
oops::Log::info() << "====================== ens B geometry" << std::endl;
const std::string outputGeometryKey = fullConfig.has("output geometry")
? "output geometry" // keep things backward compatible for now
: "geometry"; // and default to the input geometry
const eckit::LocalConfiguration geomOutConfig(fullConfig, outputGeometryKey);
const soca::Geometry geomOut(geomOutConfig, this->getComm());

/// Get the date
std::string strdt;
fullConfig.get("date", strdt);
Expand Down Expand Up @@ -94,6 +102,7 @@ namespace gdasapp {
/// Create fields of weights for seaice
soca::Increment socaIceHW(geom, socaVars, dt); // ocean field is mandatory for writting
socaIceHW.ones();
// TODO: set the weights based on the ice extent
socaIceHW *= wIce;
oops::Log::info() << "socaIceHW: " << std::endl << socaIceHW << std::endl;
const eckit::LocalConfiguration socaHWOutConfig(fullConfig, "output");
Expand All @@ -115,7 +124,8 @@ namespace gdasapp {

socaOcnHW *= wOcean;
oops::Log::info() << "socaOcnHW: " << std::endl << socaOcnHW << std::endl;
socaOcnHW.write(socaHWOutConfig);
soca::Increment socaOcnHWOut(geomOut, socaOcnHW); // interp to output geometry
socaOcnHWOut.write(socaHWOutConfig);

return 0;
}
Expand Down

0 comments on commit 5ece15f

Please sign in to comment.