Skip to content

selah_leapfrog ​

SELAH, L0: the leapfrog and its Robert–Asselin–Williams filter: the schemes, the filter's coefficients, the stability.

The leapfrog is a two-step method on three time levels, U^{n+1} = U^{n-1} + 2 dt R(t^n, U^n): one residual evaluation per step. The filter of Williams (2009, Mon. Wea. Rev. 137, 2538, eqs. (7)-(9)) damps its computational mode: d = nu/2 (U^{n-1} - 2 U^n + U^{n+1}), U^n += alpha d, U^{n+1} += (alpha - 1) d, the leapfrog step reading the singly filtered U^n and the doubly filtered U^{n-1}. alpha = 1 is the Robert–Asselin filter (Robert 1966, Asselin 1972), alpha = 1/2 conserves the three-level mean.

SchemenualphaAmplitude drift orderPhase orderImaginary-axis boundSource
leapfrog0—exact21—
leapfrog-raw0.20.531 (a small constant, nearly 3)20.4371Williams (2009), Figs. 2 and 5

nu and alpha can be set at the stepper's initialisation (alpha = 1: Robert–Asselin; alpha = 1/2: third-order amplitude drift, unconditionally unstable). The amplitude orders are those of the amplification factor (Williams's measure). The state after a filtered step is the singly filtered U^{n+1}, offset from the solution by (alpha - 1) d = O(nu (1 - alpha) dt^2), an offset that does not grow: the error of the state at a fixed time is second order at best for every alpha /= 1 (notes/integrators-adam-move.md §2.2). On y' = mu y one step is a 2x2 map whose characteristic polynomial is Williams's eq. (11), A^2 - (nu + 2 (1 - nu (1 - alpha)/2) mu dt) A + (nu - 1 + alpha nu mu dt) = 0 (notes/ integrators-adam-move.md §2): leapfrog_roots, and from them the axis bounds.

Source: src/lib/selah_leapfrog.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
SCHEME_LEAPFROGcharacter(len=*)parameterLeapfrog, unfiltered.
SCHEME_LEAPFROG_RAWcharacter(len=*)parameterLeapfrog with the RAW filter.
LEAPFROG_SCHEMEScharacter(len=SCHEME_NAME_LEN)parameterAll.

Derived Types ​

leapfrog_filter ​

The filter's coefficients (nu = 0: no filter).

Components

NameTypeAttributesDescription
nureal(kind=R_P)Filter strength, 0 <= nu < 1.
alphareal(kind=R_P)Share of the displacement on U^n, 0 <= alpha <= 1 (1 - alpha on U^{n+1}).

Subroutines ​

leapfrog_roots ​

The roots of Williams's eq. (11) at z = mu dt: the physical mode (the root nearer 1) and the computational one.

Attributes: pure

fortran
subroutine leapfrog_roots(f, z, a_phys, a_comp)

Arguments

NameTypeIntentAttributesDescription
ftype(leapfrog_filter)inFilter.
zcomplex(kind=R_P)inmu dt.
a_physcomplex(kind=R_P)outPhysical mode.
a_compcomplex(kind=R_P)outComputational mode.

Functions ​

leapfrog ​

The filter of a leapfrog scheme; nu < 0 if the name is unknown.

Attributes: pure

Returns: type(leapfrog_filter)

fortran
function leapfrog(scheme) result(f)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

leapfrog_imag_axis_bound ​

The largest beta with max |A| <= 1 for z = i y, 0 <= y <= beta: an oscillatory mode of frequency omega is stable for omega dt <= beta. 0 for alpha = 1/2 with nu > 0 (|A_phys| - 1 ~ +y^4: unconditionally unstable, Williams 2009 §3); 1 unfiltered. A scan by 1e-3, then bisection to round-off (as selah_tableaux imag_axis_bound).

Attributes: pure

Returns: real(kind=R_P)

fortran
function leapfrog_imag_axis_bound(f) result(beta)

Arguments

NameTypeIntentAttributesDescription
ftype(leapfrog_filter)inFilter.

Call graph

leapfrog_real_axis_bound ​

The largest beta with max |A| <= 1 for z = -x, 0 <= x <= beta: a decay of rate lambda is stable for lambda dt <= beta. 0 unfiltered (|A_comp| = x + sqrt(1 + x^2)); about nu with the filter.

Attributes: pure

Returns: real(kind=R_P)

fortran
function leapfrog_real_axis_bound(f) result(beta)

Arguments

NameTypeIntentAttributesDescription
ftype(leapfrog_filter)inFilter.

Call graph