Skip to content

C5 Equivalence with ADAM ​

IDGroupTypeBackendsFigureProgram
C5ContractsCCPU, R8P only (gfortran; nvfortran); the CI matrixyesgideon_test_adam

Case and scope ​

GIDEON replaces ADAM's FDV operators. Where ADAM is right, a GIDEON kernel must return ADAM's value, bitwise, so that ADAM's results do not move when it switches; where ADAM is wrong, GIDEON must be right, and the difference must be the documented defect, not another one. The audit of ADAM's operators (notes/adam-fdv-audit.md, ADAM ff879596) found six items:

ItemADAM's defectHow GIDEON avoids itChecked here
Acompute_derivative1_fv_lupwind and compute_reconstruction_r_fv_lupwind, s≥2: the left-side row is mirrored twice; first order instead of order sleft rows are the right rows read mirrored, never stored (C3)ADAM misses a linear (face value) or quadratic (d1) function that GIDEON reproduces exactly
Bcompute_derivative1_fv_rupwind: its window q(0:) over [0:1+s] and ADAM's own test disagree; the test reads one element out of boundsexplicit-shape windows by offset, one convention per familythe right-side d1 on ADAM's documented window, cell at q(1): bitwise
Crows ADAM has not got (FD d3–d6, FV face d2–d5 and cell d3–d6 at small s; upwind d6) return 0absent kernels; a dispatcher returns NaN (C4)ADAM returns exactly 0
DADAM's FDV tests print errors, they do not assertevery GIDEON test asserts a frozen bound(the test suite itself)
EADAM's generator validates its tables against the committed tables, not against their meaningrows derived by meaning (C1)(C1)
Fthe upwind names flip: ADAM's rupwind d1 reads the right side, its rupwind d2–d5 the leftur, ul name the side the stencil lies on, for every operatoreach ADAM upwind operator mapped to the GIDEON side it really reads

Models and numerics ​

ItemChoiceCode
ADAM's codeadam_fdv_operators_library.F90 and adam_fnl_fdv_operators_library.F90, byte copies of notes/adam-reference/, compiled into the R8P test builds onlysrc/tests/
Datarandom numbers in [−1,1), a fixed seed; Δs=0.37, Δxyz=(0.37,0.53,0.29); every half-stencil s=1…5gideon_test_adam.F90
Index mapsADAM's node or cell sits at q(1), GIDEON's at offset 0; faces at the same indices
Bitwisea == gsame
Within tolerance|a−g|≤64ε⋅103∑|q|/Δsn: ADAM sums the right-side upwind rows farthest cell first, GIDEON nearest firstclose
DefectGIDEON within 640ε of the exact value, ADAM off by more than 10−3defect
AbsentADAM returns exactly 0zero
3-D operatorsADAM's FNL (directional stencils) and CPU (cube) signatures against GIDEON's directional onethree_d

Program ​

bash
./exe/gideon_test_adam

Results ​

Comparisons with ADAM by operator group and class

Every comparison of the test by ADAM operator group: bitwise, within the summation-order tolerance, ADAM's defect reproduced (GIDEON exact), ADAM's zero row.

ADAM operatorsBitwiseWithin 64 epsADAM defect reproducedADAM returns 0Largest differenceAudit
FD centred face5000
FD centred d1-d624006C (zero rows)
FV centred face5000
FV centred face d1-d519006C (zero rows)
FV centred cell d1-d624006C (zero rows)
Deconvolution10000
FV upwind face, right side (rupwind)5000
FV upwind face, left side (lupwind)1040A
FV upwind d1, right side (rupwind)5000B (window), F
FV upwind d1, left side (lupwind)1040A, F
FV upwind d2-d5, left side (ADAM rupwind)100010C, F
FV upwind d2-d5, right side (ADAM lupwind)0100105.7⋅10−14C, F
FV upwind face d1-d4, left side (ADAM rupwind_d)10000F
FV upwind face d1-d4, right side (ADAM lupwind_d)010001.8⋅10−15F
FV upwind d6 (ADAM: none)0005C
3-D operators, FNL (directional) signature80000
3-D operators, CPU (cube) signature80000
total27920843
BuildBitwiseWithin toleranceDefects reproducedADAM zero rowsFailures
gfortran, R8P279208430
nvfortran -acc, R8P279208430

Findings ​

  • GIDEON is bitwise equal to ADAM on every centred operator, the deconvolution, the 3-D operators in both of ADAM's signatures, and the upwind operators that ADAM sums in GIDEON's order: switching ADAM to GIDEON does not move a bit of its centred results.
  • The right-side upwind d2–d5 and face derivatives differ by the summation order only, within the tolerance; the largest differences are in the table.
  • ADAM's left-side face value and d1 are wrong for s≥2 (A), at every s the test runs; for s=1 the double mirror is the identity and they are right (bitwise).
  • ADAM's right-side d1 is right on its documented window [0:1+s] with the cell at q(1); B is a mismatch between that window and ADAM's own test, not a wrong row.
  • The mapping of F is in the table: ADAM's rupwind d2–d5 and rupwind_d are GIDEON's left side, its lupwind the right side (Replace ADAM's FDV calls).

Released under your choice of GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT.