Repository navigation
Conversation
Code written by Claude, reviewed carefully by myself
I noticed that we sometimes were left with tiny but non-zero areas when they should have been 0. This should resolve that issue. This is answer changing, but should only change answers by roundoff. Unit tests were written by Claude and reviewed by myself. Production code changes were done by myself.
Written by Claude, reviewed by myself.
Member
Author
|
This seems worth getting in eventually, but I'd suggest waiting until post-CESM3, since the benefits are probably minor and I don't think it's worth the risk at this stage. |
Contributor
|
Cool, thanks for creating a PR for this @billsacks. I assigned it a 6.1 milestone because of your thought about doing this after cesm3.0. But I added next so we can discuss when we think this should happen. We'll make sure it's a draft if it'll be on a 6.1 timeline. |
This branch has not been deployed
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.
Description of changes
With dynamic landunits, I noticed that landunit areas can end up roundoff-level greater than zero. The issue is that, when the areas of one or more landunits increases, other landunit areas decrease to accommodate this. However, the algorithm for the decrease is prone to roundoff-level errors. This can leave some landunit areas just roundoff-level greater than zero when they should be exactly zero.
This PR fixes this issue by truncating tiny landunit weights to exactly 0 during landunit area changes.
This also changes and adds unit tests to ensure that weights go to exactly 0 when they should. The two new unit tests here failed before these changes, at least with gfortran on my Mac (behavior could differ on different machines / compilers).
Specific notes
Contributors other than yourself, if any:
CTSM issues resolved or otherwise addressed, if any:
If answers are expected to change, describe (delete this line otherwise):
Any user interface changes (namelist or namelist defaults changes)? No
Testing planned or performed, if any:
Requirements before merge: