@@ -304,27 +304,28 @@ void Interpolator::applyAD(const oops::Variables& vars, Increment& inc,
304
304
atlas::option::name (gv_varname) |
305
305
atlas::option::levels (varSizes[jvar]));
306
306
307
+ // Copying observation array vector to an atlas observation field (tgt_field)
308
+ // DJL not sure if the missing value aspect does anything here
307
309
auto field_view = atlas::array::make_view<double , 2 >(tgt_field);
308
310
// field_view.assign(0.0);
309
-
311
+ atlas::field::MissingValue mv (inc.incrementFields ()[gv_varname]);
312
+ bool has_mv = static_cast <bool >(mv);
310
313
for (std::size_t klev=0 ; klev < varSizes[jvar]; ++klev) {
311
314
for (std::size_t iloc=0 ; iloc < nlocs_; iloc++) {
312
- // if (has_mv && mv(field_view(iloc, klev))) {
313
- // // result[out_idx] = util::missingValue(result[out_idx] );
314
- // } else {
315
+ if (has_mv && mv (field_view (iloc, klev))) {
316
+ field_view (iloc, klev) = util::missingValue< double >( );
317
+ } else {
315
318
oops::Log::debug () << " DJL iloc " << iloc << " klev " << klev << " out_idx "
316
319
<< out_idx << " resultin[out_idx] " << resultin[out_idx] << std::endl;
317
- field_view (iloc, klev) = resultin[out_idx];
318
- // }
320
+ field_view (iloc, klev) = resultin[out_idx];
321
+ }
319
322
++out_idx;
320
323
}
321
324
}
322
325
323
326
// halo exchange update ghost points DJL
324
327
geom->functionSpace ().haloExchange (inc.incrementFields ()[gv_varname]);
325
328
326
- // atlas::field::MissingValue mv(inc.incrementFields()[gv_varname]);
327
- // bool has_mv = static_cast<bool>(mv);
328
329
interpolator_.execute_adjoint (inc.incrementFields ()[gv_varname], tgt_field);
329
330
330
331
} // jvar
0 commit comments