@@ -97,6 +97,12 @@ namespace gdasapp {
97
97
ensMembers.push_back (postProcIncr.read (i));
98
98
}
99
99
100
+ // Check if we need to recenter the increment around the deterministic
101
+ bool addRecenterIncr (false );
102
+ if ( fullConfig.has (" add recentering increment" ) ) {
103
+ fullConfig.get (" add recentering increment" , addRecenterIncr);
104
+ }
105
+
100
106
// Compute ensemble moments
101
107
soca::Increment ensMean (geom, postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
102
108
soca::Increment ensStd (geom, postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
@@ -120,24 +126,25 @@ namespace gdasapp {
120
126
fullConfig.get (" steric height" , stericVarChangeConfig);
121
127
oops::Log::info () << " steric config 0000: " << stericVarChangeConfig << std::endl;
122
128
123
- // Initialize trajectories
129
+ // Initialize the trajectories used in the linear variable changes
124
130
const eckit::LocalConfiguration trajConfig (fullConfig, " trajectory" );
125
- soca::State cycleTraj (geom, trajConfig); // trajectory of the cycle
126
- soca::State meanTraj (cycleTraj); // trajectory defined as the ens. mean
127
- meanTraj.zero ();
128
- meanTraj += ensMean;
129
-
130
- // Compute the error between the ensemble mean and the deterministic
131
- soca::Increment deterministicError (geom, postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
132
- deterministicError.diff (cycleTraj, meanTraj);
131
+ soca::State determTraj (geom, trajConfig); // deterministic trajectory
132
+ soca::State ensMeanTraj (determTraj); // trajectory defined as the ens. mean
133
+ ensMeanTraj.zero ();
134
+ ensMeanTraj += ensMean;
135
+
136
+ // Compute the recentering increment as the difference between
137
+ // the ensemble mean and the deterministic
138
+ soca::Increment recenteringIncr (geom, postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
139
+ recenteringIncr.diff (determTraj, ensMeanTraj);
133
140
eckit::LocalConfiguration sshRecErrOutputConfig (fullConfig, " ssh output.recentering error" );
134
- deterministicError = postProcIncr.setToZero (deterministicError );
141
+ recenteringIncr = postProcIncr.setToZero (recenteringIncr );
135
142
oops::Log::info () << " steric config : " << stericVarChangeConfig << std::endl;
136
- postProcIncr.applyLinVarChange (deterministicError , stericVarChangeConfig, cycleTraj );
137
- oops::Log::info () << " ensemble mean: " << meanTraj << std::endl;
138
- oops::Log::info () << " deterministic: " << cycleTraj << std::endl;
139
- oops::Log::info () << " error: " << deterministicError << std::endl;
140
- deterministicError .write (sshRecErrOutputConfig);
143
+ postProcIncr.applyLinVarChange (recenteringIncr , stericVarChangeConfig, determTraj );
144
+ oops::Log::info () << " ensemble mean: " << ensMeanTraj << std::endl;
145
+ oops::Log::info () << " deterministic: " << determTraj << std::endl;
146
+ oops::Log::info () << " error: " << recenteringIncr << std::endl;
147
+ recenteringIncr .write (sshRecErrOutputConfig);
141
148
142
149
// Re-process the ensemble of perturbations
143
150
int result = 0 ;
@@ -165,7 +172,7 @@ namespace gdasapp {
165
172
166
173
// Compute the original steric height perturbation from T and S
167
174
eckit::LocalConfiguration stericConfig (fullConfig, " steric height" );
168
- postProcIncr.applyLinVarChange (incr, stericConfig, meanTraj );
175
+ postProcIncr.applyLinVarChange (incr, stericConfig, ensMeanTraj );
169
176
ssh_tmp = incr;
170
177
sshSteric.push_back (ssh_tmp);
171
178
@@ -183,10 +190,10 @@ namespace gdasapp {
183
190
incr = postProcIncr.setToZero (incr);
184
191
185
192
// Filter ensemble member and recompute steric ssh, recentering around
186
- // the cycle's trajectory
193
+ // the deterministic trajectory
187
194
if ( fullConfig.has (" linear variable change" ) ) {
188
195
eckit::LocalConfiguration lvcConfig (fullConfig, " linear variable change" );
189
- postProcIncr.applyLinVarChange (incr, lvcConfig, cycleTraj );
196
+ postProcIncr.applyLinVarChange (incr, lvcConfig, determTraj );
190
197
}
191
198
192
199
// Add the unbalanced ssh to the recentered perturbation
@@ -200,12 +207,23 @@ namespace gdasapp {
200
207
incr.fromFieldSet (incrFs);
201
208
oops::Log::debug () << " &&&&& after adding ssh_u " << incr << std::endl;
202
209
203
- // Save final perturbation, used in the offline EnVAR
210
+ // Save final perturbation, used in the EnVAR or to initialize the ensemble forecast
211
+ if (addRecenterIncr) {
212
+ // Add the recentering increment to the increment ensemble members.
213
+ // This is generally used to recenter the ensemble fcst around the
214
+ // deterministic
215
+ incr += recenteringIncr;
216
+ }
204
217
result = postProcIncr.save (incr, i+1 );
205
218
206
219
// Update ensemble
207
220
ensMembers[i] = incr;
208
- }
221
+ }
222
+
223
+ // Exit early if only recentering around the deterministic
224
+ if (addRecenterIncr) {
225
+ return 0 ;
226
+ }
209
227
210
228
// Compute ensemble moments for total ssh
211
229
soca::Increment sshMean (geom, socaSshVar, postProcIncr.dt_ );
0 commit comments