Skip to content

Commit

Permalink
Use ensemble member for mask in snow recentering (#1242)
Browse files Browse the repository at this point in the history
This PR uses the first ensemble member to mask the snow recentering
increment, and changes the logic so that anything below the min value
and above the max value is masked out.
  • Loading branch information
CoryMartin-NOAA authored Aug 2, 2024
1 parent f62b912 commit cc4568d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion parm/jcb-gdas
5 changes: 3 additions & 2 deletions utils/land/land_ensrecenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ namespace gdasapp {
incrMaskConfig.get("variable", maskvarname);
double minvalue = incrMaskConfig.getDouble("minvalue", -9e36);
double maxvalue = incrMaskConfig.getDouble("maxvalue", 9e36);
const eckit::LocalConfiguration maskBkgConfig(incrMaskConfig, "background");
oops::Variables maskVars(incrMaskConfig, "variable");
fv3jedi::State maskbkg(geom, maskVars, cycleDate);
maskbkg.read(bkgConfig);
maskbkg.read(maskBkgConfig);
atlas::FieldSet xbFs;
maskbkg.toFieldSet(xbFs);
/// Create the atlas fieldset for the output increment
Expand All @@ -144,7 +145,7 @@ namespace gdasapp {
/// Loop over all points, if the mask is in range, zero out the increments
auto bkgMask = atlas::array::make_view<double, 2>(xbFs[maskvarname]);
for (atlas::idx_t jnode = 0; jnode < bkgMask.shape(0); ++jnode) {
if (bkgMask(jnode, 0) > minvalue && bkgMask(jnode, 0) < maxvalue) {
if (bkgMask(jnode, 0) < minvalue || bkgMask(jnode, 0) > maxvalue) {
for (auto & var : varList.variables()) {
auto inc = atlas::array::make_view<double, 2>(ensincFs[var]);
for (atlas::idx_t level = 0; level < ensincFs[var].shape(1); ++level) {
Expand Down

0 comments on commit cc4568d

Please sign in to comment.