Ensemble postproc: Allow to not have zero-out variables in the list of increment variables#1244
Conversation
…f increment variables
|
I've pushed a minor update to |
There was a problem hiding this comment.
Pull request overview
This PR updates the SOCA ensemble analysis postprocessing workflow to support “zero-out” increment variables that are not included in the configured increment variables list, enabling use cases like LETKF recentering when the deterministic analysis lacks certain variables (e.g., currents) that MOM6 IAU still requires in the increment output.
Changes:
- Allow
set increment variables to zeroto include variables not present inincrement variablesby expanding each member increment’s allocated fields before zeroing. - Make
soca::State::operator+=skip increment fields that do not exist in the target State (instead of failing), enabling increments to carry extra fields.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/soca/State/State.cc | Skip adding increment fields that aren’t present in the State, with a log message. |
| src/mains/AnalysisPostproc.h | If zero-out vars aren’t in the increment variable set, allocate them in each increment before calling zero(...). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!fieldSet_.has(src.name())) { | ||
| oops::Log::warning() << "State does not have variable " << src.name() | ||
| << " from Increment, skipping." << std::endl; | ||
| continue; |
| 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); | ||
| } |
Description
Allows to not specify zero-out variables in the list of increment variables in the ensemble postprocessing app (they don't need to come from backgrounds or analyses since they are zeroed out anyway!)
This would allow us to run recentering app with LETKF, while recentering analyses that don't have currents around the 3DVar analysis that doesn't have currents. (mom6 IAU requires currents in the increments files).
Manual Testing Instructions (optional)
Specify the currents variables only in
set increment variables to zeroyaml section in the ensemble postprocessing app in gdas.Checklist