Conservation Checks

If the model is a physically closed system (e.g., in the slabplanet configuration with free slip conditions), it should conserve mass (including water), energy and momentum. The conservation checker logs global conservation.

Only energy and water are currently implemented.

Note that kinetic energy is not included in the calculation of the global energy, reflecting the formulation on ClimaAtmos, which assumes that kinetic energy is negligible in comparison with the moist static energy components.

ConservationChecker API

ClimaCoupler.ConservationChecker.check_conservation!Function
check_conservation!(coupler_sim::Interfacer.CoupledSimulation; runtime_check = false)

itertes over all specified conservation checks.

source
    check_conservation!(
    cc::EnergyConservationCheck,
    coupler_sim::Interfacer.CoupledSimulation,
    runtime_check = false,
    )

computes the total energy, ∫ ρe dV, of the model components of the coupled simulations and the TOA radiation, and updates cc with these values.

source
check_conservation!(
cc::WaterConservationCheck,
coupler_sim::Interfacer.CoupledSimulation,
runtime_check = false,
)

computes the total water, ∫ ρq_tot dV, of the various components of the coupled simulations, and updates cc with the values.

Note: in the future this should not use push!.

source

ConservationChecker Internal Functions