Add ensemble-consistent snow masking for SWC-DA#58
Open
jjokella wants to merge 2 commits intotsmp-pdaf-patchedfrom
Open
Add ensemble-consistent snow masking for SWC-DA#58jjokella wants to merge 2 commits intotsmp-pdaf-patchedfrom
jjokella wants to merge 2 commits intotsmp-pdaf-patchedfrom
Conversation
Inputoption `CLM:swc_mask_snow_ens` When `CLM:swc_mask_snow = 1`, the SWC update is suppressed for columns with snow depth ≥ 1 mm. Previously, each ensemble member applied this mask independently based on its own snow state. This means members with and without snow over the same grid cell receive different treatment: snow-free members are updated, snowy members are not. The result is an inconsistent ensemble after the analysis step. A new optional input parameter `CLM:swc_mask_snow_ens` (default 0) enables ensemble-consistent snow masking. When set to 1, an `MPI_Allreduce` with MPI_MAX is performed over COMM_couple_clm - the communicator that connects corresponding spatial PEs across ensemble members - before the column update loop. This reduces the per-column snow flag (0/1) across all members so that a column is masked out if any member has snow there. The update is then either applied to all members or none, for each column. The default (0) preserves the original per-member behaviour exactly. With `clmswc_mask_snow_ens = 0` (default), the known inconsistency remains: snowy members still contribute to the ensemble covariance used by PDAF but do not receive the analysis increment. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jjokella
added a commit
to HPSCTerrSys/TSMP2
that referenced
this pull request
Mar 12, 2026
Collaborator
Author
Different ideas for masking observations
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Input option
CLM:swc_mask_snow_ensRelated to #52
Background
When
CLM:swc_mask_snow = 1, the SWC update is suppressed for columns with snowdepth ≥ 1 mm. Previously, each ensemble member applied this mask
independently based on its own snow state. This means members with and without
snow over the same grid cell receive different treatment: snow-free members
are updated, snowy members are not. The result is an inconsistent ensemble
after the analysis step.
Changes
A new optional input parameter
CLM:swc_mask_snow_ens(default 0) enablesensemble-consistent snow masking. When set to 1, an
MPI_Allreducewith MPI_MAXis performed over COMM_couple_clm - the communicator that connects
corresponding spatial PEs across ensemble members - before the column update
loop. This reduces the per-column snow flag (0/1) across all members so that a
column is masked out if any member has snow there. The update is then either
applied to all members or none, for each column.
The default (0) preserves the original per-member behaviour exactly.
Limitations
With
clmswc_mask_snow_ens = 0(default), the known inconsistency remains:snowy members still contribute to the ensemble covariance used by PDAF but do
not receive the analysis increment.