diff --git a/src/mains/AnalysisPostproc.h b/src/mains/AnalysisPostproc.h index ee5b6538..c2c0ad70 100644 --- a/src/mains/AnalysisPostproc.h +++ b/src/mains/AnalysisPostproc.h @@ -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); + } } for (size_t jj = 0; jj < incs.size(); ++jj) { // Note: this is soca::Increment specific method diff --git a/src/soca/State/State.cc b/src/soca/State/State.cc index 25ab3e04..4e19c50f 100644 --- a/src/soca/State/State.cc +++ b/src/soca/State/State.cc @@ -248,6 +248,11 @@ namespace soca { const auto missing = util::missingValue(); for (const auto & src : dx_interp->fieldSet()) { const auto v_src = atlas::array::make_view(src); + if (!fieldSet_.has(src.name())) { + oops::Log::warning() << "State does not have variable " << src.name() + << " from Increment, skipping." << std::endl; + continue; + } auto & dst = fieldSet_.field(src.name()); auto v_dst = atlas::array::make_view(dst); for (size_t i = 0; i < src.shape(0); ++i) {