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
Our current implementation of the bubble correction is not internally consistent, as it modifies the volume element J without modifying the metric tensor g, so that we no longer satisfy the discrete identity J = sqrt(det(g)). Our current implementation also does not account for volume distortions due to topography, as it is only applied to the horizontal component of the volume element. In order to fix this (and be more similar to HOMME's implementation), we would need to apply the bubble correction to the full 3D metric Jacobian, and then compute J and g from the corrected Jacobian.
However, as Paul Ullrich pointed out, modifying g on interior nodal points without modifying it on boundary nodal points will have the consequence of changing the discrete curvature. I think this is basically the point of the bubble correction (trading accuracy in curvature for accuracy in volume integrals), but Tapio is not a fan of this tradeoff. Our current plan is to eliminate the bubble correction from ClimaCore altogether, and instead handle volume integral discrepancies during remapping, which will allow us to avoid changes in curvature terms.
We might end up revisiting the bubble correction later if this strategy does not work well, but we will still need to implement it in a completely different way to fix the current issues. So, there is no point in keeping the current implementation.
To-do
Content