@@ -75,14 +75,22 @@ namespace gdasapp {
75
75
// -----------------------------------------------------------------------------
76
76
77
77
int execute (const eckit::Configuration & fullConfig) const {
78
- // Setup the soca geometry
78
+ // Setup the native geometry of the ens. members,
79
+ // currently assumed to be the same as the deterministic
79
80
const eckit::LocalConfiguration geomConfig (fullConfig, " geometry" );
80
81
oops::Log::info () << " geometry: " << std::endl << geomConfig << std::endl;
81
82
const soca::Geometry geom (geomConfig, this ->getComm ());
82
83
84
+ // Setup the ensemble B (and output) soca geometry
85
+ oops::Log::info () << " ====================== ens B geometry" << std::endl;
86
+ const std::string outputGeometryKey = fullConfig.has (" output geometry" )
87
+ ? " output geometry" // keep things backward compatible for now
88
+ : " geometry" ; // and default to the input geometry
89
+ const eckit::LocalConfiguration geomOutConfig (fullConfig, outputGeometryKey);
90
+ const soca::Geometry geomOut (geomOutConfig, this ->getComm ());
83
91
84
92
// Initialize the post processing
85
- PostProcIncr postProcIncr (fullConfig, geom, this ->getComm ());
93
+ PostProcIncr postProcIncr (fullConfig, geom, this ->getComm (), geomOut );
86
94
87
95
oops::Log::info () << " soca increments: " << std::endl
88
96
<< postProcIncr.inputIncrConfig_ << std::endl;
@@ -93,7 +101,9 @@ namespace gdasapp {
93
101
oops::Log::info () << postProcIncr.inputIncrConfig_ << std::endl;
94
102
95
103
// Assume z* output is the same for the trajectory and the state
96
- ensMembers.push_back (postProcIncr.read (i));
104
+ soca::Increment fullResIncr = postProcIncr.read (i);
105
+ soca::Increment lowResIncr (geomOut, fullResIncr); // interp to low resolution geometry
106
+ ensMembers.push_back (lowResIncr);
97
107
}
98
108
99
109
// Check if we need to recenter the increment around the deterministic
@@ -103,9 +113,9 @@ namespace gdasapp {
103
113
}
104
114
105
115
// Compute ensemble moments
106
- soca::Increment ensMean (geom , postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
107
- soca::Increment ensStd (geom , postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
108
- soca::Increment ensVariance (geom , postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
116
+ soca::Increment ensMean (geomOut , postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
117
+ soca::Increment ensStd (geomOut , postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
118
+ soca::Increment ensVariance (geomOut , postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
109
119
gdasapp_ens_utils::ensMoments (ensMembers, ensMean, ensStd, ensVariance);
110
120
oops::Log::info () << " mean: " << ensMean << std::endl;
111
121
oops::Log::info () << " std: " << ensStd << std::endl;
@@ -123,14 +133,15 @@ namespace gdasapp {
123
133
124
134
// Initialize the trajectories used in the linear variable changes
125
135
const eckit::LocalConfiguration trajConfig (fullConfig, " trajectory" );
126
- soca::State determTraj (geom, trajConfig); // deterministic trajectory
136
+ soca::State determTrajNative (geom, trajConfig); // deterministic trajectory at full res
137
+ soca::State determTraj (geomOut, determTrajNative); // interpolated deterministic trajectory
127
138
soca::State ensMeanTraj (determTraj); // trajectory defined as the ens. mean
128
139
ensMeanTraj.zero ();
129
140
ensMeanTraj += ensMean;
130
141
131
142
// Compute the recentering increment as the difference between
132
143
// the ensemble mean and the deterministic
133
- soca::Increment recenteringIncr (geom , postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
144
+ soca::Increment recenteringIncr (geomOut , postProcIncr.socaIncrVar_ , postProcIncr.dt_ );
134
145
recenteringIncr.diff (determTraj, ensMeanTraj);
135
146
postProcIncr.setToZero (recenteringIncr);
136
147
@@ -192,7 +203,7 @@ namespace gdasapp {
192
203
193
204
// Save total ssh
194
205
oops::Log::info () << " ssh ensemble member " << i << std::endl;
195
- soca::Increment ssh_tmp (geom , socaSshVar, postProcIncr.dt_ );
206
+ soca::Increment ssh_tmp (geomOut , socaSshVar, postProcIncr.dt_ );
196
207
ssh_tmp = ensMembers[i];
197
208
sshTotal.push_back (ssh_tmp);
198
209
@@ -257,9 +268,9 @@ namespace gdasapp {
257
268
}
258
269
259
270
// Compute ensemble moments for total ssh
260
- soca::Increment sshMean (geom , socaSshVar, postProcIncr.dt_ );
261
- soca::Increment sshStd (geom , socaSshVar, postProcIncr.dt_ );
262
- soca::Increment sshTotalVariance (geom , socaSshVar, postProcIncr.dt_ );
271
+ soca::Increment sshMean (geomOut , socaSshVar, postProcIncr.dt_ );
272
+ soca::Increment sshStd (geomOut , socaSshVar, postProcIncr.dt_ );
273
+ soca::Increment sshTotalVariance (geomOut , socaSshVar, postProcIncr.dt_ );
263
274
gdasapp_ens_utils::ensMoments (sshTotal, sshMean, sshStd, sshTotalVariance);
264
275
oops::Log::info () << " mean ssh total: " << sshMean << std::endl;
265
276
oops::Log::info () << " std ssh total: " << sshStd << std::endl;
@@ -269,7 +280,7 @@ namespace gdasapp {
269
280
// Compute ensemble moments for steric ssh
270
281
sshMean.zero ();
271
282
sshStd.zero ();
272
- soca::Increment sshStericVariance (geom , socaSshVar, postProcIncr.dt_ );
283
+ soca::Increment sshStericVariance (geomOut , socaSshVar, postProcIncr.dt_ );
273
284
gdasapp_ens_utils::ensMoments (sshSteric, sshMean, sshStd, sshStericVariance);
274
285
oops::Log::info () << " mean steric ssh: " << sshMean << std::endl;
275
286
oops::Log::info () << " std steric ssh: " << sshStd << std::endl;
@@ -278,8 +289,8 @@ namespace gdasapp {
278
289
279
290
// Compute ensemble moments for non-steric ssh
280
291
sshMean.zero ();
281
- soca::Increment sshNonStericVariance (geom , socaSshVar, postProcIncr.dt_ );
282
- soca::Increment sshNonStericStd (geom , socaSshVar, postProcIncr.dt_ );
292
+ soca::Increment sshNonStericVariance (geomOut , socaSshVar, postProcIncr.dt_ );
293
+ soca::Increment sshNonStericStd (geomOut , socaSshVar, postProcIncr.dt_ );
283
294
sshNonStericStd.zero ();
284
295
gdasapp_ens_utils::ensMoments (sshNonSteric, sshMean, sshNonStericStd, sshNonStericVariance);
285
296
oops::Log::info () << " mean non-steric ssh: " << sshMean << std::endl;
@@ -308,7 +319,7 @@ namespace gdasapp {
308
319
ensStd.write (bkgErrOutputConfig);
309
320
310
321
// Explained variance by steric height R=1-SS(non-steric ssh)/SS(total ssh)
311
- soca::Increment varianceRatio (geom , socaSshVar, postProcIncr.dt_ );
322
+ soca::Increment varianceRatio (geomOut , socaSshVar, postProcIncr.dt_ );
312
323
varianceRatio = sshNonStericVariance;
313
324
atlas::FieldSet varianceRatioFs;
314
325
varianceRatio.toFieldSet (varianceRatioFs);
@@ -319,7 +330,7 @@ namespace gdasapp {
319
330
util::divideFieldSets (varianceRatioFs, sshTotalVarianceFs, sshTotalVarianceFs);
320
331
varianceRatio.fromFieldSet (varianceRatioFs);
321
332
322
- soca::Increment stericExplainedVariance (geom , socaSshVar, postProcIncr.dt_ );
333
+ soca::Increment stericExplainedVariance (geomOut , socaSshVar, postProcIncr.dt_ );
323
334
stericExplainedVariance.ones ();
324
335
stericExplainedVariance -= varianceRatio;
325
336
0 commit comments