Sect. 2.
2 Time stepping schemes: MLF and RK3
Having defined the continuous equations in chapter 1, we need now to choose a time discretization, a key
feature of an ocean model as it exerts a strong influence on the structure of the computer code (i.e. on its
flowchart). In the present chapter, we provide a general description of the NEMO time stepping strategy and
the consequences for the order in which the equations are solved.
2.1. Time stepping schemes: MLF and RK3
One can choose between two time stepping schemes for non-diffusive processes in NEMO . It can either be a
three-stages, two-time level Runge Kutta scheme (RK3, Wicker and Skamarock (2002)) or a three-time level
Modified LeapFrog scheme (MLF, Mesinger and Arakawa (1976) ; Leclair and Madec (2009)). MLF being the
”historical” time stepping scheme, it is still the default. RK3 scheme can be activated by adding the cpp key
key_RK3 at compilation time.
The RK3 scheme, beside its higher formal accuracy than MLF (3rd order vs less than 2nd order for linear
terms), has the advantage of requiring less memory storage and being more computationnaly efficient (table 2.1).
As such, it will soon become the only time stepping option in NEMO . The reader is referred to (Ducousso
et al. (2024) and Madec et al. (2024)) for further specific details about the implementation of the RK3 scheme
in NEMO .
In the following, one describes the time evolution of a variable x, that stands for u, v, T or S. RHS is the
Right-Hand-Side of the corresponding time evolution equation while ∆t is the time step. The superscripts
indicate the time at which a quantity is evaluated. Each term of the RHS is evaluated at a specific time step
depending on the physics with which it is associated. In both schemes, the final value of x, i.e. at time t + ∆t,
is obtained where implicit vertical diffusion is computed, i.e. in the trazdf.F90 and dynzdf.F90 modules.
max max max max max
αC2 αUP αC4 αUP q αCo4
q 3 5
1−γ 3
LFRA (γ = 0.1) 1+γ = 0.904534 0.47074 0.659175 Unst. = 0.522233
√ 11
RK3 3 = 1.73205 1.62589 1.26222 1.43498 1
Table 2.1.: CFL stability criteria αmax for LF (with Asselin parameter γ) and RK3 time discretizations combined with the most
commonly used linear advection schemes. Specific acronyms : C2 = second-order centered, UP3 = third-order upwind,
C4 = fourth-order centered, UP5 = fifth-order upwind, Co4 = fourth-order compact. Table extracted from Madec et al.
(2024).
2.2. MLF scheme
2.2.1. Non-diffusive part
The LeapFrog (LF) time stepping is a three level scheme that can be represented as follows for non-diffusive
processes:
xt+∆t = xt−∆t + 2 ∆t RHStx (2.1)
This three level scheme requires three arrays for each prognostic variable. For each variable x there is xb
(before), xn (now) and xa . The third array, although referred to as xa (after) in the code, is usually not the
variable at the after time step; but rather it is used to store the time derivative (RHS in equation 2.1) prior to
time-stepping the equation.
This scheme is widely used for advection processes in low-viscosity fluids. It is a time centred scheme, i.e. the
RHS in equation 2.1 is evaluated at time step t, the now time step. It may be used for momentum and tracer
advection, pressure gradient, and Coriolis terms, but not for diffusion terms. It is an efficient method that
achieves second-order accuracy with just one right hand side evaluation per time step. Moreover, it does not
artificially damp linear oscillatory motion nor does it produce instability by amplifying the oscillations. These
advantages are somewhat diminished by the large phase-speed error of the leapfrog scheme, and the unsuitability
of leapfrog differencing for the representation of diffusion and Rayleigh damping processes. However, the scheme
allows the coexistence of a numerical and a physical mode due to its leading third order dispersive error. In
other words a divergence of odd and even time steps may occur. To prevent it, the leapfrog scheme is often
used in association with a Robert-Asselin time filter (hereafter the LF-RA scheme). This filter, first designed
by Robert (1966) and more comprehensively studied by Asselin (1972), is a kind of laplacian diffusion in time
that mixes odd and even time steps:
t−∆t
xtF = xt + γ xF − 2xt + xt+∆t (2.2)
NEMO Reference Manual Page 18 of 310