Skip to content

Stability of simulations

Zhaoyi Shen edited this page Mar 19, 2024 · 2 revisions

What to do when a ClimaAtmos simulation crashes?

When you see error messages like maxiter reached in saturation_adjustment or DomainError, it usually means the simulation becomes unstable. While there is no general solution, here are a few things you could try:

  • Reduce timestep

    Some of the jobs may be close to the unstable regime. You can change the timestep by changing dt in the config file. It is usually ok if the simulation becomes stable when timestep is decreased by less than 20%. It would be good to investigate further if you need a larger decrease in dt.

  • Increase or decrease hyperdiffusion

    Hyperdiffusion damps oscillations at small scales. Increasing hyperdiffusion may be helpful if you see grid imprinting in the state variables. However, hyperdiffusion can create spurious extrema. Decreasing hyperdiffusion may be helpful if you see spurious extrema in your tracer field.

    You can change hyperdiffusion by changing vorticity_hyperdiffusion_coefficient, divergence_damping_factor, and scalar_hyperdiffusion_coefficient in the config file. It is common to have vorticity_hyperdiffusion_coefficient * divergence_damping_factor = scalar_hyperdiffusion_coefficient, with divergence_damping_factor greater than or equal to 1. Try to keep both coefficients smaller than 6. You can also change the hyperdiffusivity directly in src/prognostic_equations/hyperdiffusion.jl for testing if you want to change it for certain tracers.

  • Increase the strength of the Rayleigh sponge

    Rayleigh sponge damps vertical velocity to 0 in the top model layers. Increasing its strength may be helpful if the instability comes from the top, which is usually the case if ρ in the input to saturation_adjustment is smaller than 0.1. You can change the strength of the damping by changing alpha_rayleigh_w in the parameter file. There is no constraint on how large the number can be, but 10 is pretty large.

Clone this wiki locally