mask netcdf output by wet-cell topography instead of value==0#929
Open
JanStreffing wants to merge 2 commits into
Open
mask netcdf output by wet-cell topography instead of value==0#929JanStreffing wants to merge 2 commits into
JanStreffing wants to merge 2 commits into
Conversation
PR #799 set any accumulated output value below 1e-30 to _FillValue. That also masks legitimate ocean zeros: ice-free sea-ice concentration (a_ice and all other 2D ice variables) and vanishing 3D fields such as IDEMIX energy were written as NaN instead of 0, contrary to the CMIP/CMOR convention. The masking was applied uniformly to 2D and 3D fields. Replace the value-based test with a proper wet-cell mask derived from the mesh level arrays (ulevels/nlevels for elements, ulevels_nod2D/ nlevels_nod2D for nodes). Only cells above a cavity or below the bottom topography are written as _FillValue; every wet cell keeps its averaged value, including a genuine zero. 2D fields and non-spatial vertical axes (density / ice classes) are never masked. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 24, 2026
Open
Collaborator
Author
|
Adding a data point in favor of this fix: #939 is another symptom of the value-based masking from #799, this time on river runoff. Same pattern as #821: a sparse 2D field where |
…landmask # Conflicts: # src/io_meandata.F90
JanStreffing
marked this pull request as ready for review
June 24, 2026 15:17
patrickscholz
approved these changes
Jun 25, 2026
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.
PR #799 set any accumulated output value below 1e-30 to _FillValue. That also masks legitimate ocean zeros: ice-free sea-ice concentration (a_ice and all other 2D ice variables) and vanishing 3D fields such as IDEMIX energy were written as NaN instead of 0, contrary to the CMIP/CMOR convention. The masking was applied uniformly to 2D and 3D fields.
Replace the value-based test with a proper wet-cell mask derived from the mesh level arrays (ulevels/nlevels for elements, ulevels_nod2D/ nlevels_nod2D for nodes). Only cells above a cavity or below the bottom topography are written as _FillValue; every wet cell keeps its averaged value, including a genuine zero. 2D fields and non-spatial vertical axes (density / ice classes) are never masked.
@chrisdane Can you check if this fixes what you flagged in #799 ?