Skip to content

A9 Leapfrog ​

IDGroupTypeBackendsFigureProgram
A9AccuracyPCPU (gfortran, nvfortran, ifx; orders in R8P)yesselah_vv_leapfrog

Case and scope ​

The leapfrog form (Schemes) with four filters, every run through the stepper, its start-up step included: the plain leapfrog (ν=0), Robert–Asselin (RA: ν=0.2, α=1), the mean-conserving RAW (ν=0.2, α=1/2) and leapfrog-raw (ν=0.2, α=0.53). The case checks the orders Williams (2009, Table 1) states, the measured amplification factors, and the stability bound the stepper reports.

Setup ​

ItemValue
Oscillationy′=iy as the rotation X′=−Y, Y′=X; 32 to 512 steps per unit time; the amplitude drift ||y(2)|/|y(1)|−1| (the amplitude error per unit time, Williams's measure), the amplitude error ||y(1)|−1| and the phase error |arg⁡y(1)−1|
Advectionut+ux=0, periodic, 32 cells, GIDEON's centred first derivative; one Fourier mode, which moves at the semi-discrete speed sin⁡(2πΔx)/(2πΔx) exactly: the reference has no space error; t=0.5, 64 to 1024 steps
Damped oscillationy′=(i−0.2)y, the plain leapfrog, t=1
Boundan observed order within 0.15 of the declared one on the finest halving (two-sided: a filter not applied, order 2 where 1 is declared, fails)
Amplification factorshistory and state set to an eigenvector of the in-place step, one step through the stepper, at ωΔt=0.1, 0.3 and 0.9 of the bound: both multiplied by the root of Williams's eq. (11), to 10−12
Stabilityat 0.99 and 1.01 times imag_axis_bound(), over the steps (at least 2000) that the faster growth needs to reach 100: the peak |y| against its peak over the first tenth; no growth at 0.99, at least tenfold at 1.01

Program ​

bash
./exe/selah_vv_leapfrog
SELAH_VV_DIR=exe/vv-data ./exe/selah_vv_leapfrog   # leapfrog-orders.dat, leapfrog-modes.dat
scripts/run_vv.sh --only selah_vv_leapfrog         # the data, then the table and the figures below

Results ​

Leapfrog orders

FilterProblemErrorDeclaredObserved, 1st halving2nd3rd4thFinest error
leapfrogoscillationphase22.0012.0002.0002.0006.36e-07
leapfrogadvectionglobal22.0012.0002.0002.0004.82e-06
RAoscillationamplitude drift11.0001.0001.0001.0001.09e-04
RAoscillationamplitude at t=110.9630.9820.9910.9961.08e-04
RAoscillationphase21.9951.9971.9991.9998.47e-07
RAadvectionglobal10.9970.9950.9980.9995.27e-04
RAW-1/2oscillationamplitude drift33.0403.0003.0003.0001.15e-10
RAW-1/2oscillationamplitude at t=122.0152.0072.0032.0021.06e-07
RAW-1/2oscillationphase21.9951.9981.9991.9997.41e-07
RAW-1/2advectionglobal21.9991.9991.9992.0005.64e-06
leapfrog-rawoscillationamplitude drift—0.9950.9991.0001.0006.51e-06
leapfrog-rawoscillationamplitude at t=1—0.7200.8800.9440.9736.39e-06
leapfrog-rawoscillationphase21.9951.9981.9991.9997.48e-07
leapfrog-rawadvectionglobal—1.8101.5041.2041.0563.18e-05
leapfrogdamped oscillationglobal22.0012.0002.0002.0005.52e-07

RA: ν=0.2, α=1; RAW-1/2: ν=0.2, α=1/2; leapfrog-raw: ν=0.2, α=0.53 (amplitude first order with a small constant: no order declared). A declared order passes within 0.15 on the finest halving.

Amplification factors

The roots of Williams's eq. (11) against ωΔt: the physical mode is the root nearer 1. Where the two roots meet (RA at ωΔt=1−ν/2; past the bound for the others) the labels swap.

One step on the eigenvectors reproduces both roots to 5⋅10−16 for every filter. Stability: the plain leapfrog is bounded at 0.99 (peak |y| 3.6, reached in the first tenth: the two modes nearly coincide near the double root at 1) and grows from 1.01; RA's bound is 0.9045, leapfrog-raw's 0.4371.

Findings ​

  • Williams's orders hold through the stepper: phase 2 for every filter; amplitude drift 1 with RA and 3 with the mean-conserving filter; leapfrog-raw drifts at first order but 17 times less than RA.
  • The error at a fixed time is second order for every α≠1, even α=1/2. The stored state is the singly filtered value, displaced from the solution by (α−1)d=O(ν(1−α)Δt2). That bias does not grow, so it leaves the drift's third order intact but sets the error of the state at any time: RAW-1/2's amplitude error at t=1 is 1.1⋅10−7 at 512 steps, its drift 1.2⋅10−10. Williams's third order is the order of the amplification factor, not of the stored value.
  • leapfrog-raw has no clean order on advection (1.81 down to 1.06): its amplitude error is first order with a constant ∝ν(α−1/2), which overtakes the second-order phase error as the step decreases.
  • The start-up keeps the orders: every run above begins with the ssp-22 step.
  • A damped problem through the plain leapfrog keeps order 2 on a short horizon: its computational mode, unstable for any decay, starts at the round-off of the start-up.