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.
| Scheme | nu | alpha | Amplitude drift order | Phase order | Imaginary-axis bound | Source |
|---|---|---|---|---|---|---|
leapfrog | 0 | — | exact | 2 | 1 | — |
leapfrog-raw | 0.2 | 0.53 | 1 (a small constant, nearly 3) | 2 | 0.4371 | Williams (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
| Name | Type | Attributes | Description |
|---|---|---|---|
SCHEME_LEAPFROG | character(len=*) | parameter | Leapfrog, unfiltered. |
SCHEME_LEAPFROG_RAW | character(len=*) | parameter | Leapfrog with the RAW filter. |
LEAPFROG_SCHEMES | character(len=SCHEME_NAME_LEN) | parameter | All. |
Derived Types
leapfrog_filter
The filter's coefficients (nu = 0: no filter).
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
nu | real(kind=R_P) | Filter strength, 0 <= nu < 1. | |
alpha | real(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
subroutine leapfrog_roots(f, z, a_phys, a_comp)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
f | type(leapfrog_filter) | in | Filter. | |
z | complex(kind=R_P) | in | mu dt. | |
a_phys | complex(kind=R_P) | out | Physical mode. | |
a_comp | complex(kind=R_P) | out | Computational mode. |
Functions
leapfrog
The filter of a leapfrog scheme; nu < 0 if the name is unknown.
Attributes: pure
Returns: type(leapfrog_filter)
function leapfrog(scheme) result(f)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme 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)
function leapfrog_imag_axis_bound(f) result(beta)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
f | type(leapfrog_filter) | in | Filter. |
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)
function leapfrog_real_axis_bound(f) result(beta)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
f | type(leapfrog_filter) | in | Filter. |
Call graph