move surface tendency after precipitation tendency #3159
Merged
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.
Purpose
Move surface tendency after precipitation tendency so that precipitation used in atmos and surface tendencies are in sync. Fixes water conservation issue with SSP. After this change, SSP conserves water but ARS doesn't (2% error in 100 days): https://buildkite.com/clima/climaatmos-gpulongruns/builds/264#_. We should look into ARS if we want to use it.
I don't like that we need to have a specific order of tendencies for the test to work, but this is a quick fix and refactoring precipitation needs more work. cc @trontrytel . We should check what the coupler is doing.
Also changes energy conservation to use the initial condition as the reference. Only water conservation uses the final state as the reference, because the initial condition can be zero.
Closes #3113
To-do
Content