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.

    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.

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!.

ClimaCoupler.ConservationChecker.plot_global_conservationFunction
plot_global_conservation(
    cc::AbstractConservationCheck,
    coupler_sim::Interfacer.CoupledSimulation,
    softfail = false;
    figname1 = "total.png",
    figname2 = "total_log.png",
)

Creates two plots of the globally integrated quantity (energy, $\rho e$):

  1. global quantity of each model component as a function of time,

relative to the initial value;

  1. fractional change in the sum of all components over time on a log scale.

ConservationChecker Internal Functions