ClimaAtmos.jl icon indicating copy to clipboard operation
ClimaAtmos.jl copied to clipboard

Improve enery, mass, and water conservation checks

Open LenkaNovak opened this issue 1 year ago • 2 comments

As investigated in #2458, we need a global energy and water for more accurate tracking of conservation (to floating point precision), and for tracking of global energy/water with time (indicates type if instability). We can assume a similar approach to ClimaCoupler.ConservationChecker and produce conservation plots, in addition to the quantitative instantaneous asserts to stay within a sqrt(eps) leakage.

QA:

  • move all energy checks to callbacks (e.g., expanding on flux_accumulation!)
  • ensure no performance penalty
  • reduce atol to sqrt(eps) in conservation asserts
  • ensure this works for topography configs
  • add total mass
### Tasks
- [x] conservation checks without any source or sink, without topography on a sphere
- [x] conservation checks with sources and sinks, without topography, for 0M microphysics on a sphere
- [ ] conservation checks with sources and sinks, without topography, for 1M microphysics on a sphere
- [ ] All of the above, but with topography on a sphere

LenkaNovak avatar Jan 24 '24 01:01 LenkaNovak

@LenkaNovak - is it ok with you to turn the bullet points here into separate issues? I can put my issue about adding mass water and energy checks for the 1M scheme here also

Though technically this is for 1.5.2.d, so maybe better to not merge them?

trontrytel avatar Feb 13 '24 08:02 trontrytel

@LenkaNovak - is it ok with you to turn the bullet points here into separate issues? I can put my issue about adding mass water and energy checks for the 1M scheme here also

Though technically this is for 1.5.2.d, so maybe better to not merge them?

Of course. Please feel free to adapt the above. This issue was to keep track of what we need to do for conservation in general, but no-one is currently working on it.

LenkaNovak avatar Feb 13 '24 16:02 LenkaNovak