Move DSS to the end of each implicit stage #348
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
This PR moves the DSS operation from the middle of each implicit stage (between the partial stage assembly and the start of Newton's method) to the end of each implicit stage. The change is applied consistently to all algorithms, and it ensures that stage values passed to our explicit and limited tendencies are always continuous across element boundaries.
The minor version number is also incremented so that we can immediately test this out in ClimaAtmos.
Motivation
For all simulations on a sphere, our metric terms (
J
andg
) are discontinuous across element boundaries. Since the implicit tendency uses these metric terms, it introduces discontinuities to the Runge-Kutta stages. To avoid these discontinuities when evaluating explicit and limited tendencies, we must apply DSS after the last iteration of Newton's method (or after the linear solve in the case of Rosenbrock methods). We were previously applying DSS before Newton's method (and before the linear solve for Rosenbrock) because we incorrectly assumed that our metric terms were continuous. However, this intermediate application of DSS is unnecessary, since the implicit tendency does not involve any horizontal derivatives and can therefore handle discontinuous arguments. So, we can simply move DSS to the end of each stage in order to fix this issue.