Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/mains/AnalysisPostproc.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,13 @@ class AnalysisPostproc : public oops::Application {
if (incPostprocConfig.has("set increment variables to zero")) {
oops::Variables socaZeroIncrVar(incPostprocConfig, "set increment variables to zero");
if (!(socaZeroIncrVar <= incs.variables())) {
oops::Log::error() << "Variables to zero must be a subset of increment variables"
<< std::endl;
throw eckit::UserError("Invalid variables to zero", Here());
// Add variables that have to be set to zero to the increment variables,
// so that the increment can be updated
oops::Variables newvars = incs.variables();
newvars += socaZeroIncrVar;
for (size_t jj = 0; jj < incs.size(); ++jj) {
incs[jj].increment().updateFields(newvars);
}
Comment on lines 321 to +328
}
for (size_t jj = 0; jj < incs.size(); ++jj) {
// Note: this is soca::Increment specific method
Expand Down
5 changes: 5 additions & 0 deletions src/soca/State/State.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ namespace soca {
const auto missing = util::missingValue<double>();
for (const auto & src : dx_interp->fieldSet()) {
const auto v_src = atlas::array::make_view<double, 2>(src);
if (!fieldSet_.has(src.name())) {
oops::Log::warning() << "State does not have variable " << src.name()
<< " from Increment, skipping." << std::endl;
continue;
Comment on lines +251 to +254
}
auto & dst = fieldSet_.field(src.name());
auto v_dst = atlas::array::make_view<double, 2>(dst);
for (size_t i = 0; i < src.shape(0); ++i) {
Expand Down
Loading