A3 Spectral properties
| ID | Group | Type | Backends | Figure | Program |
|---|---|---|---|---|---|
| A3 | Accuracy | P | the rows (exact, Python); CPU (gfortran R4P, R8P, R16P; nvfortran) for the compiled kernels | yes | gideon_test_spectral, gideon_vv_advection |
Case and scope
An order of accuracy describes the error as
Models and numerics
| Item | Choice | Code |
|---|---|---|
| Symbol | fd) and cell (fv) operators are read alike | |
| First derivative | ||
| Second derivative | ||
| From the rows | the generator's exact weights (--json), in double precision | make_tables.py symbol_exact |
| From the kernels | each kernel on | gideon_test_spectral.F90 |
| Asserted (frozen) | centred kernels: | |
| Resolution | the largest | resolution |
| Advection | SCHEME_RK4, the stepper on the rank-1 field), two periods; gideon_fv_d1_c2, gideon_fv_d1_c4, gideon_fv_d1_ul2; the packet | gideon_vv_advection.F90 |
Program
./exe/gideon_test_spectral
./exe/gideon_vv_advection
scripts/run_report.sh # the CSV of the symbols and the frames of the packet, then figures and castsResults
Centred derivatives

Re
Kernel (= fv_ twin) | Derivative | Order | Resolution ξ/π (1 % dispersion) | Value at ξ = π | Exact at π |
|---|---|---|---|---|---|
fd_d1_c2 | d1 | 2 | 0.078 | 0.0000 | 3.1416 |
fd_d1_c4 | d1 | 4 | 0.239 | 0.0000 | 3.1416 |
fd_d1_c6 | d1 | 6 | 0.350 | 0.0000 | 3.1416 |
fd_d1_c8 | d1 | 8 | 0.426 | 0.0000 | 3.1416 |
fd_d1_c10 | d1 | 10 | 0.481 | 0.0000 | 3.1416 |
fd_d2_c2 | d2 | 2 | 0.110 | 4.0000 | 9.8696 |
fd_d2_c4 | d2 | 4 | 0.317 | 5.3333 | 9.8696 |
fd_d2_c6 | d2 | 6 | 0.446 | 6.0444 | 9.8696 |
fd_d2_c8 | d2 | 8 | 0.530 | 6.5016 | 9.8696 |
fd_d2_c10 | d2 | 10 | 0.588 | 6.8267 | 9.8696 |
Upwind first derivatives

The left-side first derivatives gideon_fv_d1_ul1 to _ul9 (upwind for
| Kernel | Order | Resolution ξ/π | Min Im ξ̃ (dissipation) | Max Im ξ̃ | Amplifying band ξ/π |
|---|---|---|---|---|---|
fv_d1_ul1 | 1 | 0.078 | -2.000 | 0 | none |
fv_d1_ul2 | 2 | 0.055 | -4.000 | 0 | none |
fv_d1_ul3 | 3 | 0.138 | -6.667 | +0.083 | 0.000-0.419 |
fv_d1_ul4 | 4 | 0.171 | -10.667 | +0.667 | 0.004-0.608 |
fv_d1_ul5 | 5 | 0.186 | -17.067 | +2.327 | 0.234-0.711 |
fv_d1_ul6 | 6 | 0.242 | -27.733 | +6.075 | 0.383-0.775 |
fv_d1_ul7 | 7 | 0.237 | -46.019 | +13.838 | 0.013-0.817 |
fv_d1_ul8 | 8 | 0.244 | -78.019 | +29.311 | 0.022-0.847 |
fv_d1_ul9 | 9 | 0.279 | -134.908 | +59.566 | 0.123-0.868 |
The compiled kernels against the rows
| Build | Kernels | Wavenumbers | Largest |compiled − exact| / Σ|c| | Where | Test failures |
|---|---|---|---|---|---|
| gfortran, R4P | 54 | 256 | fv_d1_ur8 | 0 | |
| gfortran, R8P | 54 | 256 | fv_d1_ur7 | 0 | |
| gfortran, R16P | 54 | 256 | fv_d1_ul8 | 0 |
A wave packet

After two periods: c2 lags (its group velocity at
| Kernel | t (periods) | max |u − exact| | Energy kept |
|---|---|---|---|
fv_d1_c2 | 2.000 | 0.988 | 1.0000 |
fv_d1_c4 | 2.000 | 0.197 | 1.0000 |
fv_d1_ul2 | 2.000 | 0.922 | 0.1835 |
Findings
- Centred kernels do not dissipate. Their imaginary part is zero to round-off in every kind, from the rows and from the compiled kernels: the pair form makes the first derivative antisymmetric and the second symmetric exactly. The energy of the centred runs is kept to the digits printed (RK4 alone damps it, below them). A centred scheme gets its dissipation, if it needs one, from elsewhere.
- Dispersion falls with the order, but slowly. The 1% resolution grows from order 2 to 10 (table): a wider row resolves more of the band, never all of it. At
every centred first derivative returns 0 (the odd-even mode does not move), and the second derivatives fall short of . - Only the one- and two-cell left-side first derivatives dissipate every mode. From three cells on, every fully one-sided first derivative has a band where Im
: a mode of in that band grows, whatever the time step. For gideon_fv_d1_ul3the band is every wavenumber below(its growth rate is ); the band of each kernel is in the table. The right-side kernels are their mirrors and do the same for . These rows are exact and verified, and they are kept as building blocks (the candidate stencils of an upwind-biased or WENO reconstruction); as the only spatial operator of an advection scheme, they are unstable. - The compiled kernels are the rows. Their symbols agree with the exact rows' to the precision of the kind (table), and the mirrors hold in the symbols as in the values (C3).
- The packet confirms both effects on a solution. With its carrier at
, c2 disperses the packet into a trailing train and keeps its energy; ul2 keeps the mass and loses most of the energy.