Testing
Conventions
Unit tests use GoogleTest; each is named
Suite.Test. They are deterministic, finish in seconds on 1–4 ranks, and run on every commit:ctest -L unit.Regression tests run the application and compare with stored gold plotfiles using
amrex_fcompare. Their check scripts print measured / target / tolerance / pass rows.ctest -L smokeruns the structural checks CI does on every pull request;ctest -L physicsruns the converged checks nightly on Kestrel.Performance tests run nightly or weekly on Kestrel. They track iterations, wall time and allocation-unit cost; a slowdown of more than 10 % fails.
Gold files change only in a reviewed commit.
Every test is first shown to fail on the bug it guards against, or on a one-line mutant of the code it covers.
The one-line mutants of the gmres_mlmg default (Source/Poisson.H, Source/Initializer.cpp,
Source/App.cpp), each run against unit_np2, rt_steady_askervein and (M1) rt_init_askervein; every one
is killed:
Mutant |
Change |
Failing tests |
|---|---|---|
P1 |
No fallback: the projection with |
|
P2 |
The old default |
|
P3 |
The split coefficient set for every \(\alpha \ne 1\), also \(\alpha_v = \alpha_h\) |
|
P4 |
The fallback not reported |
|
P5 |
The stage’s log line without the back end |
|
P6 |
The fallback to |
|
P7 |
The |
|
The one-line mutants of the line-sweep variants (Source/LineSweeps.cpp and Source/Driver.cpp), each run against
LineSweeps.*, Driver.* and Predictor.Lusgs* on two ranks by tools/line_sweep_mutants.py; every one
is killed:
Mutant |
Change |
Failing tests |
|---|---|---|
M1 |
Overlap ignored (swept region not grown) |
|
M2 |
Face updated twice (box keeps its high face) |
|
M3 |
Periodic seam updated twice (first box keeps the domain’s low face) |
|
M4 |
Forward wavefront skips its last plane |
|
M5 |
Backward wavefront skips plane 0 |
|
M6 |
Ghost δ not zeroed (neighbours’ values exchanged between passes) |
|
M7 |
Non-owned face copies keep their own value (owner mask all 1) |
|
M8 |
One-cell periodic axis not folded into the diagonal |
|
M9 |
|
|
M10 |
|
|
M11 |
|
|
M12 |
|
|
M13 |
A negative |
|
M14 |
Overlap with lagged ghosts accepted |
|
M15 |
Overlap wider than the narrowest box accepted |
|
M16 |
Line key given with |
|
M17 |
Odd sweeps not reversed ( |
|
M18 |
Reversed forward wavefront skips its last plane |
|
M19 |
Reversed sequential forward pass walks j ascending |
|
M20 |
|
|
M21 |
|
|
M22 |
|
|
M23 |
|
|
The one-line mutants of the transfers between levels (Source/Transfer.cpp), each run against Transfer.* on two ranks with the
unit-test flags (SNaN fill, FPE trap) by tools/transfer_mutants.py. 23 are killed. Three survive and the script
lists them as equivalent: T6 and T9 change no value, and T24 changes only the gmres_fft solver’s path, so its result
agrees with the original’s to the solver tolerance. A first run, without the SNaN and FPE flags and before TargetNodeHeightsComeFromTheHierarchy,
OneCellDirectionIsConstant and WrongLevelPairsAbort were added, left T10, T14, T18 and T19 alive as well. “Crash” marks a mutant that stops the run with a
signal in that test (SIGILL on macOS arm64), so the tests after it did not run.
Mutant |
Change |
Failing tests |
|---|---|---|
T1 |
Cell means not |
|
T2 |
x/y-face flux without the fine area factor |
|
T3 |
x/y-face flux not divided by r |
|
T4 |
z-face flux divided by r instead of \(r^2\) |
|
T5 |
Coarse u not divided by the coarse area factor |
|
T6 |
Coarse Ω not divided by the coarse area factor |
Equivalent: \(a_z = 1\) on every mesh |
T7 |
w restricted in place of Ω |
|
T8 |
No zero-gradient rows for the slope term’s u |
|
T9 |
No periodic fill for the slope term’s u |
Equivalent: the slope term reads u on its own cell’s x-faces, no horizontal ghost |
T10 |
Coarse |
|
T11 |
Cell-centred position shifted by half a fine cell |
|
T12 |
No linear extrapolation at a non-periodic face (reads past the last centre) |
|
T13 |
Periodic direction extrapolates instead of reading the periodic image |
|
T14 |
One-cell direction reads a second coarse cell (zero weight, unfilled ghost) |
|
T15 |
x weights swapped on the upper y row |
|
T16 |
w interpolated with the nodal x axis |
|
T17 |
Coarse image filled without the periodic images |
|
T18 |
Fine |
|
T19 |
Fine-below-coarse level check dropped |
|
T20 |
k not clipped |
|
T21 |
Clipped-cell count not summed over ranks |
|
T22 |
Infinite |
|
T23 |
No boundary fill before the projection |
|
T24 |
Projection corrects the Dirichlet rows too (d = 1 + mask) |
Equivalent with |
T25 |
No projection off the Dirichlet rows (d = −mask) |
|
T26 |
p′ not restored after the projection |
|
The one-line mutants of the canopy’s drag field (Source/Canopy.cpp, Source/Canopy_K.H), each run against
Canopy.* on two ranks with the unit-test flags by tools/canopy_mutants.py (macOS arm64, AppleClang). All 18 are
killed.
Mutant |
Change |
Failing tests |
|---|---|---|
C1 |
Lower-branch polynomial coefficient \(12/6^3\) changed to \(12/215\) |
|
C2 |
Upper-branch tail without the erfc term |
|
C3 |
A cell across \(\eta_m\) misses the lower branch’s top |
|
C4 |
Uniform profile not clipped at the canopy top |
|
C5 |
Cell value not divided by the cell’s height |
|
C6 |
Heights from sea level, not from the local ground |
|
C7 |
A patch across the periodic seam not imaged |
|
C8 |
Overlapping patches replace instead of add |
|
C9 |
Ghost columns not imaged |
|
C10 |
Restriction without the fine \(J\) |
|
C11 |
Restriction not divided by the coarse \(J\) |
|
C12 |
Restart hash of the file name, not its contents |
|
C13 |
Restart with another canopy accepted |
|
C14 |
Patch height 0 accepted |
|
C15 |
|
|
C16 |
Negative map values accepted |
|
C17 |
A patch wider than a periodic direction accepted |
|
C18 |
Cells above half the tallest patch skip the patch loop |
|
The one-line mutants of the canopy’s drag on the momentum equations (Source/CanopyDrag.cpp,
Source/Residual.cpp, Source/Canopy.cpp), each run against Canopy.* and CanopyDrag.* on two ranks with
the unit-test flags by tools/canopy_drag_mutants.py (macOS arm64, AppleClang). All 12 are killed.
Mutant |
Change |
Failing tests |
|---|---|---|
D1 |
The sink with the wrong sign |
|
D2 |
x and y faces take one cell’s \(f\), not the mean of two |
|
D3 |
z faces take the cell above only |
|
D4 |
The |
|
D5 |
\(|U|\) without \(w\) |
|
D6 |
\(v\) at an x- or z-face not averaged over its four faces |
|
D7 |
The |
|
D8 |
The residual without the drag |
|
D9 |
|
|
D11 |
The drag rows added to an off-diagonal coefficient |
|
D12 |
|
|
D10 |
A |
|
The one-line mutants of the canopy terms of the k–L closure (Source/CanopyTke.cpp, Source/Closure.cpp,
Source/Closure_K.H, Source/Residual.cpp, Source/Canopy.cpp), each run against Canopy.*,
CanopyDrag.* and CanopyTke.* on two ranks with the unit-test flags by tools/canopy_tke_mutants.py (macOS
arm64, AppleClang). All 13 are killed.
Mutant |
Change |
Failing tests |
|---|---|---|
T1 |
Wake production without \(\beta_p\) |
|
T2 |
Wake production with \(|U|^2\) in place of \(|U|^3\) |
|
T3 |
The sink not on the Patankar diagonal |
|
T4 |
The sink added to the exact derivative with the wrong sign |
|
T5 |
The residual without the wake production |
|
T6 |
The residual without the short-circuit sink |
|
T7 |
The capped length not \(\alpha/f\) |
|
T8 |
The live decisions without the canopy |
|
T9 |
The cap’s switch not encoded (not frozen) |
|
T10 |
The capped decision taken against \(\alpha/(2f)\) |
|
T11 |
\(P_b\)’s derivative without \(d(c_\mu'/c_\mu)/dk\) (the error fixed here) |
|
T12 |
|
|
T13 |
|
|
The one-line mutants of the count behind the canopy’s inflow-face and damping-layer warnings
(BoundaryConditions::canopy_in_boundary_zones, Source/BoundaryDamping.cpp), each run against CanopyTke.* by
tools/canopy_zone_mutants.py. All 8 are killed by BoundaryZonesCountTheCanopyCells.
Mutant |
Change |
|---|---|
Z1 |
Every cell counted, not only canopy cells |
Z2 |
The inflow face’s second column counted in place of its first |
Z3 |
The sponge left out |
Z4 |
The Rayleigh layer left out |
Z5 |
An outflow face counted as an inflow face |
Z6 |
The x high face’s second-last column counted |
Z7 |
The y high face’s second-last row counted |
Z8 |
The Rayleigh layer counted when it damps only w |
The one-line mutants of the local step floor (Source/PseudoTime.cpp), the canopy in the column first guess
(Source/ColumnGuess.cpp) and the canopy’s column profile (Source/Canopy.cpp), each run against
PseudoTime.StepFloor*, ColumnCanopy.* and Canopy.ColumnProfile* on two and four ranks by
tools/step_floor_mutants.py (macOS arm64, AppleClang). All 16 are killed. F3 and F4 survived the test’s first
mesh (one box, dx the smaller spacing); the test now uses four boxes with dy < dx.
Mutant |
Change |
Failing tests |
|---|---|---|
F1 |
The floor ignored |
|
F2 |
\(U_{\max}\) from u alone |
|
F3 |
dx for min(dx, dy) |
|
F4 |
No all-reduce of \(U_{\max}\) |
|
F5 |
A negative floor accepted |
|
C1 |
The column’s drag dropped |
|
C2 |
Picard drag (\(|W|\) lagged) |
|
C3 |
No wake production |
|
C4 |
No short-circuit sink |
|
C5 |
No length cap |
|
C6 |
The profile’s size unchecked |
|
C7 |
A non-uniform canopy accepted |
|
C8 |
The terrain unchecked |
|
P1 |
The layer sum, not the mean |
|
P2 |
The spread absolute, not relative |
|
P3 |
The spread from the maximum alone |
|
The one-line mutants of simplec.theta = frozen (Source/Simplec.cpp, Source/Residual.cpp,
Source/Predictor.cpp, Source/Sequencing.cpp, Source/App.cpp, Source/BoundaryConditions.cpp) by
tools/frozen_theta_mutants.py (macOS arm64, AppleClang): F1–F7 and F16–F19 against FrozenTheta.* on two ranks
with the unit-test flags, F8–F15 and F20–F23 against the CTests rt_frozen_theta and abort_simplec_theta_*
(the wiring of the application, which the unit tests do not reach). All 23 are killed.
Mutant |
Change |
Killed by |
|---|---|---|
F1 |
The buoyancy left in the momentum residual |
|
F2 |
The predictor’s point-implicit buoyancy left in the \(w\) rows |
|
F3 |
θ’s residual not zeroed |
|
F4 |
θ swept although frozen |
|
F5 |
|
|
F6 |
Any value of |
|
F7 |
The stage accepts residual inputs that do not match the option |
|
F8 |
The residual inputs keep the momentum buoyancy with frozen θ |
|
F9 |
The coarsest level not reset |
|
F10 |
A prolonged coarse level not reset |
|
F11 |
Level 0 not reset |
|
F12 |
θ from the sounding by absolute height, not by height above the ground |
|
F13 |
Frozen accepted without grid sequencing |
|
F14 |
Frozen accepted with the Newton stage |
|
F15 |
Frozen accepted with a restart |
|
F16 |
The ground extension left out of the fill |
|
F17 |
The ground extension in homogeneous fills too |
|
F18 |
Only the first ghost layer extended |
|
F19 |
The extension’s slope halved |
|
F20 |
Frozen accepted with a stratified column first guess |
|
F21 |
The turbulence plotfile’s |
|
F22 |
The frozen θ read at the floored height ( |
|
F23 |
The levels do not extend θ below the ground |
|
The one-line mutants of the physical time term (Source/TimeTerm.cpp, Source/Residual.cpp), each run
against TimeTerm.* on two ranks with the unit-test flags by tools/time_term_mutants.py (macOS arm64,
AppleClang). All 9 are killed. The order of the term against the boundary and building rows is checked for the wall-k
rows (DT8) and the ground and top \(w\) faces only; the test case has no open faces and no buildings.
Mutant |
Change |
Failing tests |
|---|---|---|
DT1 |
The time term with the wrong sign |
|
DT2 |
A factor 2 on \(1/\Delta t\) in the residual |
|
DT3 |
A factor 2 on \(1/\Delta t\) on the diagonal |
|
DT4 |
\(q^n\) taken from the current iterate |
|
DT5 |
|
|
DT6 |
The residual without the time term |
|
DT7 |
|
|
DT8 |
The time term added after the |
|
DT9 |
A denormal |
|
The one-line mutants of the time driver (Source/TimeDriver.cpp, Source/TimeTerm.cpp and the CFL ramp in
Source/Driver.cpp), each run against TimeDriver.* on two ranks with the unit-test flags by
tools/time_driver_mutants.py (macOS arm64, AppleClang). All 16 are killed. TD7 and TD11 survived the first set of tests: every step there ended at the floor
steady.residual_tol, and on flat ground the ghost cells do not enter \(\Delta t\). The tests
InnerStopIsRelativeToTheStepStart and StepFromTargetCflFillsTheGhostsFirst (a periodic bump) were added for
them. That the application passes the time term to the stage (res_in.time in Source/Sequencing.cpp) is
checked by rt_unsteady_hill2d: without it every step stops at unsteady.max_inner.
Mutant |
Change |
Failing tests |
|---|---|---|
TD1 |
\(q^n\) stored at the first step only |
|
TD2 |
The time term keeps the first step’s \(\Delta t\) |
|
TD3 |
The last step not shortened |
|
TD4 |
A tolerance of 1e-6 on the last step (a sliver step is left) |
|
TD5 |
The step from |
|
TD6 |
The inner stop without the floor at |
|
TD7 |
The inner stop’s reference taken at every iteration |
|
TD8 |
One inner iteration more than |
|
TD9 |
|
|
TD10 |
|
|
TD11 |
The ghost cells not filled before \(\Delta t\) |
|
TD12 |
|
|
TD13 |
The time a sum of rounded steps for a fixed step |
|
TD14 |
A target CFL over a field at rest accepted |
|
TD15 |
A step that is not finite accepted |
|
TD16 |
The CFL ramp of an unsteady run stops at a steady verdict |
|
The one-line mutants of the unsteady outputs and the restart (Source/UnsteadyOutput.cpp and
Source/TimeDriver.cpp), each run against UnsteadyOutput.* and TimeDriver.Resume* on two ranks with the
unit-test flags by tools/unsteady_output_mutants.py (macOS arm64, AppleClang). All 10 are killed.
Mutant |
Change |
Failing tests |
|---|---|---|
UO1 |
The weight \(t^{n+1} - t^n\) (the averaging start ignored) |
|
UO2 |
West’s \(w/W\) with \(W\) before the add |
|
UO3 |
\(M_2\) from the old mean only |
|
UO4 |
A tie takes the higher cell |
|
UO5 |
\(h\) measured from \(z = 0\), not from the ground |
|
UO6 |
A point on the high face not given the last cell |
|
UO7 |
A restart drops the probe row at the checkpoint’s time |
|
UO8 |
A resumed fixed step summed from the checkpoint’s time (the record’s anchor dropped) |
|
UO9 |
Another step after a restart keeps the checkpoint’s anchor |
|
UO10 |
A resumed run numbers its steps from 1 |
|
UO11 |
A clipped last step keeps the anchor (the next step at \((n_0 + 1)\,\Delta t\)) |
|
UO12 |
Every last step moves the anchor (a chain of restarts at full steps drifts by round-off) |
|
UO13 |
The record’s anchor time not written |
|
UO14 |
A kept probe file reported as new (the checkpoint’s row written twice) |
|
UO15 |
A restart without a probe file reported as kept (no first row) |
|
The one-line mutants of the Newton stage (Source/NewtonStage.cpp and the switch rules in Source/Driver.cpp),
each run against Driver.* and NewtonStage.* on two ranks with the unit-test flags by
tools/newton_stage_mutants.py (macOS arm64, AppleClang). 13 of 15 are killed. N14 and N15 survive: they matter only
where the SIMPLEC preconditioner loses GMRES at a large CFL (the full-size 2-D hill), which no unit test reaches in
seconds; a Newton study on Askervein (not yet run) would measure them.
Mutant |
Change |
Failing tests |
|---|---|---|
N1 |
The fallback waits for the hysteresis window |
|
N2 |
The forward switch ignores the monitors |
|
N3 |
The forward switch ignores |
|
N4 |
|
|
N5 |
The monitor test against the window’s first record, off by one |
|
N6 |
The fallback after one failure whatever the key |
|
N7 |
A failed step does not count |
|
N8 |
Converged before any accepted step |
|
N9 |
No hand-back for the final pass |
|
N10 |
The continuation’s start CFL not reset on entry |
every |
N11 |
The continuation state not restored on restart |
|
N12 |
No limit on failed visits |
|
N13 |
No idle hand-back |
|
N14 |
The Newton cap not used (the SIMPLEC cap, plain Newton after one step) |
survives (above) |
N15 |
The preconditioner of an infinite \(\Delta\tau\) at the SIMPLEC cap |
survives (above) |
The one-line mutants of the smoothness options (Source/Smoothness.cpp and the floor freeze and stratification gate in
Source/Closure.cpp), each run against Smoothness.* and Closure.* on two ranks with the unit-test flags by
tools/smoothness_mutants.py (macOS arm64, AppleClang). 12 of 13 are killed. S5 survives: it removes the gate
from the decisions that freeze_switches and changed_switches take, and the floor scope’s held bit does not
depend on \(N^2\) (evaluate gates \(N^2\) itself; S4 and S13 cover it there).
Mutant |
Change |
Failing tests |
|---|---|---|
S1 |
The floor scope holds every decision |
|
S2 |
|
|
S3 |
The floor scope decides from the live state (frozen bits ignored) |
|
S4 |
The gate with \(S^2\) not squared |
|
S5 |
The gate not applied in |
survives (above) |
S6 |
|
|
S7 |
No limiter swap |
|
S8 |
|
|
S9 |
|
|
S10 |
The checkpoint’s scope ignored on read |
|
S11 |
A held cell decided at its own \(k\), not the floor (negative \(\nu_t\)) |
|
S12 |
|
|
S13 |
\(P_b\) from the gated \(N^2\) |
|
The one-line mutants of the continuation (Source/Continuation.cpp, the SER law in Source/PseudoTime.cpp and the
GMRES limit in Source/Newton.cpp), each run against Continuation.*, Newton.* and Driver.* on two ranks
with the unit-test flags by tools/continuation_mutants.py (run on macOS arm64 with AppleClang). #36 reported 40
mutants killed but kept no list; these 40 are a new set. The first run left C20, C25 and C36 alive: C25 because
LineSearchRejectsOvershoot no longer pins the trajectory, and C20 and C36 because no test covered them.
LineSearchRejectsOvershoot now checks the
\(k\) floor, and RestoreCapsTheCflAndTheFloorIsChecked covers the other two. All 40 are killed with GCC; with
Clang and AppleClang 39 are, and C2 cannot be told apart from the original.
Mutant |
Change |
Failing tests |
|---|---|---|
C1 |
Armijo without the sufficient decrease (any decrease accepted) |
|
C2 |
Armijo compares a NaN trial (no isfinite guard) |
|
C3 |
Backtracking factor fixed at 1/2 |
|
C4 |
No lower bound on lambda |
|
C5 |
Backtracks not counted |
|
C6 |
Full-step residual not kept (the growth bound never passes) |
|
C7 |
Growth bound strict at the bound |
|
C8 |
Growth-bound step not re-evaluated (last trial kept) |
|
C9 |
Growth-bound flag not recorded |
|
C10 |
SER restarts from the stored CFL after infinite dtau |
|
C11 |
Never switches to infinite dtau |
|
C12 |
Last residual not stored |
|
C13 |
Accepted steps not counted |
|
C14 |
No CFL cut after a failed attempt |
|
C15 |
No floor on the cut CFL |
|
C16 |
A failed attempt keeps infinite dtau |
|
C17 |
Growth bound also at infinite dtau |
|
C18 |
Checkpoint drops the infinite flag |
|
C19 |
Reader ignores r_last |
|
C20 |
Restore keeps a CFL above a lowered |
|
C21 |
|
|
C22 |
|
|
C23 |
No layout check in step |
|
C24 |
\(|R_0|\) never taken from the first step |
|
C25 |
Trial k not clipped at the floor |
|
C26 |
Accepted step not copied back to q |
|
C27 |
Finite dtau even when infinite |
|
C28 |
One retry fewer |
|
C29 |
|
|
C30 |
|
|
C31 |
|
|
C32 |
|
|
C33 |
|
|
C34 |
|
|
C35 |
A repeated key accepted |
|
C36 |
|
|
C37 |
SER without the growth limit |
|
C38 |
SER exponent sign flipped |
|
C39 |
GMRES iteration limit not applied |
|
C40 |
|
|
The tests run with the GPU CI flags (see Running a simulation). Each test runs in its own directory under
<build>/Tests/run/.
Each case has its own folder Tests/<group>/<case>/ with a README.md, its input decks, its check script and
its gold files (Gold/); Tests/README.md lists the groups. Check scripts used by more than one case and the
test-only drivers are in Tests/Supporting_Files/.
Current tests
CTest |
What it checks |
|---|---|
|
The GoogleTest suite on 1, 2 and 4 ranks (below). |
|
The same suite with tiling off, as on a GPU. |
|
A 2-rank run; a 3-rank restart on another box layout, whose log must show the restart; the two plotfiles
identical under |
|
The named set-ups ( |
|
The canopy’s drag field ( |
|
The building geometry (Buildings): each column’s volume against the height map, the wall mask, a restart on
another layout, the refusals (those of |
|
The cube of Snyder and Lawson (1994) in a wind-tunnel boundary layer ( |
|
The staggered cube array of Castro et al. (2006) ( |
|
|
|
A courtyard open to the wind ( |
|
One block on a ridge’s windward flank ( |
|
One block in a log-law wind ( |
|
A restart with one patch’s LAI changed, and one without a canopy, stop naming |
|
Decks that must stop, with the input named in the message. Audit A10: |
|
The column deck with |
|
The thin-cell strip on a 50 m ridge ( |
|
ERF’s Askervein mesh coarsened to 60 × 60 × 18 (20 m × 1.08 layers, BTF, ERF’s terrain
file): statistics of |
|
A 600 m ridge under STF: the report against its gold, including both warnings (STF capped, top not flat). Double-precision builds only. |
|
A run without a solve writes the mapped-grid plotfile of the 2-D hill; The golds of the three mesh tests above were written by GUST itself ( |
|
The Askervein mesh of |
|
The steep ridge of |
|
The Askervein hierarchy with unsmoothed coarse grounds ( |
|
A checkpoint of the Askervein mesh written without a hierarchy (2 ranks), restarted with three levels on 3
ranks: the rebuilt levels 1 and 2 against the golds of |
|
|
|
Grid sequencing’s inputs at the application (the truly neutral hill deck with overrides): a loose drop of 9
orders against the strict 8, a monitor tolerance of 1 and sequencing without a hierarchy, all three named
in one abort; a coarsest level of 4 × 1 cells (64 × 16 over five levels); |
|
|
|
|
|
Old against new |
|
|
|
|
|
The same projection with back end B (MLMG, 6 iterations): iterations at most 10 % above
|
|
|
|
The mass-consistent initial field on the Askervein mesh (30 × 30 × 18; |
|
The hilltop speed-up over FastWindTerrain’s bump ( |
|
|
|
|
|
The application on the 1-D neutral column ( |
|
The column of |
|
The column on rough ground ( |
|
40 iterations of the column ( |
|
The same chain over terrain: 5 iterations of the 2-D hill ( |
|
The 2-D hill with Coriolis ( |
|
The application on ERF’s Neutral_ABL_Flat ( |
|
The canopy’s drag on the momentum equations, alone ( |
|
A uniform canopy under a pressure gradient ( |
|
A forest-clearing-forest pattern ( |
|
A canopy on cosine hills ( |
|
A dense canopy on steep terrain with an inflow face ( |
|
|
|
The canopy terms of the k–L closure on |
|
The column first guess with a uniform canopy (UT-8.5.1, Initial conditions) on
|
|
The w rows’ VNN cap on a flat inflow/outflow strip with a 0.7 m first cell
( |
|
The slope margin of the cap on a steep ridge with a 0.4 m first cell
( |
|
Thin first cells on a 2-D Agnesi ridge ( |
|
Steep terrain at an outflow face ( |
|
ERF’s Neutral_Hill_2D ( |
|
RT-6.2.1 (plan rev. 6, sub-phase 6.2, beyond the plan): the same hill as unsteady RANS
( |
|
The unsteady deck restarted from the 5-iteration checkpoint of |
|
The refusals of |
|
The refusals of the output keys, each message matched: |
|
Two steps of 60 s with the four probes that write |
|
The 2-D hill with the line LU-SGS sweeps ( |
|
The 2-D hill LU-SGS deck started from the converged column ( |
|
ERF’s Neutral_Hill_3D ( |
|
A truly neutral Hill_3D ( |
|
The default |
|
The deck of |
|
|
|
Askervein on the ERF grid of |
|
The precursor column of the conventionally neutral Askervein case ( |
|
Askervein in a conventionally neutral boundary layer ( |
|
|
|
Askervein with ERF’s setup ( |
|
Old against new for |
|
Old against new: the same deck with the z-line Jacobi configuration of |
|
The |
|
A configure with |
|
|
|
|
|
|
|
A copy of the archive with one bit flipped is refused, naming the file; bad tool inputs stop the tool with
each input named; a build key given with |
|
|
|
Not registered on Windows. The Kestrel scripts parse; a dry run with stub |
|
Not registered on Windows. |
|
Not registered on Windows. Audit A10 (P1): the WindNinja2019 drivers’ |
In a build without MPI (GUST_MPI=OFF, as in the Windows CI job) every test runs on one rank, so
unit_np2 and unit_np4 repeat unit_np1 and smoke_restart_matches does not change the rank count.
MSVC does not trap floating-point exceptions, so amrex.fpe_trap_invalid=1 has no effect there; the Linux GCC
jobs keep that check.
GoogleTest suite
GoogleTest |
Check |
|---|---|
|
A reference archive written, verified and loaded: fields bit-identical to the average, metadata and field statistics unchanged; a changed byte, a missing file, an extra file, edited AU, and data changed together with its checksum are each found and named, and loading refuses. |
|
The average equals a host-side recomputation bit for bit and, for fields linear in
time, the mid-window value to 8 ε; trapezoid weights for uneven spacing; the half-window change is exact
for a linear drift and zero for a steady field; a snapshot with a NaN, fewer than 3 snapshots and times out of
order are refused with their messages; a trailing |
|
AU = nodes × hours × rate (10 CPU, 100 GPU); metadata range checks name their inputs. |
|
SHA-256 against the NIST example vectors, at every padding boundary and chunking;
|
|
Vertical levels: uniform; solved ratio (top exact, ratio 1.0421553943273616 from an independent exact-rational bisection); fixed ratio (ERF’s Askervein 20 m × 1.08, top 749.0048747962335 m); z-levels file and its errors. |
|
Flat terrain gives the Cartesian levels: bit for bit for STF and Sullivan, within 2 ulp for BTF. |
|
Free-stream preservation on round Witch-of-Agnesi and Gaussian hills, all three mappings: divergence below
1e-12 of \((|U|+|V|)/\Delta x\). The cancellation is algebraic for any node heights, so this test does
not detect wrong heights; |
|
Cell volumes sum to the column volumes above the ground to 1e-12, and to a 1 m quadrature of the domain above the hill to 1e-4 (the bilinear ground differs from the continuous hill by 2.4e-5 of the domain). |
|
Smoothing: a constant is unchanged; a Fourier mode is damped by the analytic factor per pass; β ≥ 1/4 is refused. On a non-periodic domain, edge nodes use themselves as the outside neighbour and ghost nodes take the nearest domain node. |
|
IDW returns input points and, with 4 neighbours, is exact on a plane at a symmetric query (with the
default 6 the two extra neighbours break the symmetry and IDW is not exact on a plane); ERF’s bilinear form
is exact on planes anywhere, with ERF’s edge fallback; |
|
|
|
Audit A5 (found by Pressel): the two mirror images of a query on the diagonal of a 0.1-spaced grid tie exactly,
and the lower index wins, for k = 2 to 8 and both point orders. The squared distance is each square rounded,
then added, so no build can fuse it; with |
|
The IDW bucket search picks the brute-force neighbours; results agree to 1e-13 (random cloud with far queries, a regular grid with exact distance ties, a tie across a bucket edge, a transect queried from a 2-D domain, one point); UTM-sized coordinates are read and interpolated in double; file terrain on a periodic domain has one seam height; every mapping keeps the ground layer as given; ground at the top and inverted cells stop the run; the slope of a diagonal ridge is reported in full; a restart with changed terrain is refused; the report of a steep ridge carries both warnings. |
|
Convection on a manufactured flow over a 120 m cosine hill (BTF, geometric layers, 16 × 12 × 8 to 64 × 48 × 32
cells), ghost nodes continuing the layers: the unlimited MUSCL reconstruction (van Albada slope with
\(\epsilon\) above every difference) is second order for q (conservative and bounded forms) and for the u, v
and w control volumes, L2 order ≥ 1.9 on both pairs and max-norm order ≥ 1.9 on the finest. With |
|
Scalar diffusion with a variable \(\gamma\), and momentum diffusion with the full stress tensor and a variable \(\nu\), on the same meshes: L2 order ≥ 1.9 on both pairs, max-norm order ≥ 1.9 on the finest, for q, u, v and w. |
|
Random \(k \ge 0\) (a third of the points zero) and random transport fluxes of ±50 m/s: the step \(k - C(k)/a_P\) with the bounded upwind form leaves every \(k \ge 0\); the conservative upwind form goes below −0.1 in the same step. The bounded form of a constant is zero for every limiter and location. |
|
Random transport (±20 m/s) and diffusivity (0 to 50 m²/s, a fifth zero) over the hill: every neighbour weight of \(A_1\) is ≥ 0 and \(a_P\) equals their sum (1e-14; single 1e-6), for cells and the three velocity components. |
|
The van Albada slope’s derivative changes by less than 0.1 across every point where van Leer switches
(\(a = 0\), \(b = 0\), \(a = -b\), the origin), in three directions; van Leer’s jumps by more than 1.
On the manufactured flow (64 × 48 × 32) the two limiters differ by less than 1 % (L2) for q, u, v and w.
Invalid |
|
\(A_1\) is the explicit operators’ first-order part: bounded upwind convection equals \(A_1 q\) for random q and transport (1e-12; single 1e-5), and on a flat mesh \(-D(q) = A_1 q\) for the scalar and \(-D_c(u) = A_1 u_c\) for each velocity component with random \(\nu\). Over the hill, every weight equals the explicit face flux of a field that varies along one index direction only (this pins the \(1 + \delta_{cd}\) and \(|\mathbf{n}|^2 + n_c^2\) factors on sloping faces). MUSCL convection, both diffusions and \(A_1\) agree to round-off (1e-13) on 16² and 8² column boxes, and boxes that share a face point agree there (not bit for bit: GCC on arm64 contracts multiply-adds inside vectorised loops only). |
|
The divergence (through \(\Omega\)) and the three components of \(G p\) over the 120 m hill (BTF, geometric layers, 16 × 12 × 8 to 64 × 48 × 32 cells): L2 order ≥ 1.9 on both pairs, max-norm order ≥ 1.9 on the finest (single precision 1.8). \(\langle Gp, U\rangle = -\langle p, DU\rangle\) with control-volume weights to 1e-12 of either side (7e-12 against 3.3e4), for random p and a random velocity that vanishes near the ground and top. \(G\) does not read the ghost cells below the ground. |
|
The continuity residual is bit for bit |
|
|
|
Rest over a 300 m hill (slopes up to 0.94), θ = θ_ref(z) stratified, Coriolis on: the momentum, continuity and k residuals are below 1e-14. With a constant reference the hydrostatic \(p(z)\) balances only to truncation (R_u 1.6e-3 m/s², 0.5 % of the buoyancy; R_w exact on interior faces). |
|
|
|
Sources in closed form: Coriolis with the \(\cos\varphi\) terms and geostrophic forcing on a uniform wind (\(f = 7.27221\times10^{-5}\) 1/s at 30°, T = 86400 s), buoyancy of a uniform excess; the geostrophic wind is balanced. The residual equals its operators applied one by one (momentum, continuity, θ, k) on the hill with a general state. Invalid options (latitude, period, geostrophic forcing at latitude 0 or with the forcing off, θ₀, gravity, profiles that do not increase) and missing inputs stop with a message. |
|
Node heights shared by two boxes (or periodic images) are equal, for BTF, STF and Sullivan,
periodic and not (under gcc each box’s copy differed by up to 1e-13 m before |
|
Every ghost node in x and y, at every k (the rows below the ground and above the top included), equals the node
it stands for, bit for bit: its periodic image, or the edge node of its row at a non-periodic face. BTF, STF
and Sullivan; periodic in x only, y only, both and neither, and a layout split in z; on 1, 2 and 4 ranks; every
copy of a domain node agrees. Before |
|
The Agnesi ground as written, before any exchange: each ghost node in a periodic direction is its periodic image, bit for bit, and outside a non-periodic face the face node. Round hill and both ridges on a domain not centred at the origin, x periodic and then y. Before audit A3 the periodic ghosts were clamped (2.5 m and 4.1 m off). |
|
ERF’s similarity functions (the copied |
|
Reference-height lookup on the ERF#3982 column (dz₀ = 10 m, ratio 1.1, 40 layers): centres belong to the interval above, faces (10 m included) to the interval that holds them, the last centre to the last interval; heights below the first or above the last centre are refused. |
|
u* from a log-law state (u* = 0.45, z₀ = 0.1 m) on that column: within 2e-5 at the first centre, at 10 m, at 55.3 m
and on a centre. With a heat flux, u* matches an independent bisection to 1e-10 for unstable,
stable and low-wind convective cases, and is positive. On rough ground (z₀ = 0.5 m, 1 m first layer,
ln((d + z₀)/z₀) = ln 2): u* from the log law at the first centre and at 0.8 m with
|
|
\(k_w = u_*^2/C_{\mu0}^2\) exactly (neutral); Axell’s buoyant form with a heat flux; the wall eddy viscosity equals \(C_{\mu0}\sqrt{k_w}\,\kappa(d+z_0)\). |
|
Over the hill: the columns’ distances and areas from their nodes; the wall stress along the
ground with magnitude \(u_*^2|A|\). In the residual, R_u, R_v and R_θ change only in the first cells, by the
wall flux minus the interior flux over the cell volume; the k rows are the wall-k rows (both modes). The
|
|
UT-8.1.2: the profile’s \(N\) in closed form against quadrature ( |
|
UT-8.1.1 and UT-8.1.3: every column’s sum of \(f J \Delta\zeta\) is \(C_d\) LAI with a height and LAI that vary over the domain and the top inside stretched cells, both profiles, \(C_d\) constant and from a map; \(f\) is 0 exactly above the canopy and > 0 below. On a 50 m hill (BTF) the same holds and the first cell is \(C_d \mathrm{LAI}/h\) in every column (heights from sea level would leave the hill bare). |
|
UT-8.1.4: three patches give the same field, bit for bit, on 1, 16 and uneven boxes; the patch across the periodic seam reaches the columns on the other side; overlapping patches add, and a layer above the shorter patch holds the taller one’s drag alone; the ghost column is the periodic image in x and the nearest column in y. |
|
UT-8.1.5: on a hill smoothed differently on each level (levels 1 and 2, gathered on one box or not), each layer’s integral of \(f\) over the coarse cells equals that over level 0. |
|
UT-8.1.7: the same canopy restarts; one changed LAI, a canopy where the checkpoint has none and none where it
has one are refused; the hash follows the contents, not the file name. The option checks, the patch file’s
lines (named by number), negative map values and a patch wider than the periodic domain are refused with the
input named. UT-8.1.6 ( |
|
UT-8.2.1: on linear velocity fields (so every four-point mean is the value at the face) through a uniform patch, each face’s residual is \(f_c |U| u_c\) with \(f_c = C_d\,\mathrm{LAI}/h\) or 0 in closed form, on 1 and 16 boxes (the faces on box edges read the ghost column), the ground z-faces taking the first cell. |
|
UT-8.2.2: on sign-changing periodic velocities, the |
|
The residual’s momentum rows gain exactly the sink and |
|
UT-6.1.1 (beyond the plan): on the 2-D hill (k–L closure, wall law with |
|
UT-6.1.2 (beyond the plan): |
|
UT-6.1.3 (beyond the plan): at \(q = q^n\) the residual is unchanged in value. That the steady path
(no time term) is bit-identical is shown by the regression tests, whose golds are unchanged. |
|
UT-6.2.1 (beyond the plan): a lid started impulsively at 1 m/s over fluid at rest (\(\nu\) = 0.01 m²/s, 1 m deep, 64 layers, four boxes) to \(T\) = 1 s with \(\Delta t\) = 0.1, 0.05 and 0.025 s. The differences between successive runs halve: observed order 0.998, within 0.85–1.15. Against Stokes’ first problem, \(u = U\,\mathrm{erfc}((H - z)/(2\sqrt{\nu T}))\), the error at 0.025 s is 4.2e-3, below 1.5 times the last difference (3.5e-3, the backward-Euler error); the Richardson value \(2u_{\Delta t/4} - u_{\Delta t/2}\) is within 8.2e-4 (the space error), below 1.5e-3. Double precision only. |
|
UT-6.2.2 (beyond the plan): the same channel from rest with \(\Delta t\) = 10 s to 300 s reaches the Couette profile \(u = Uz/H\) within 1.6e-9 (bound 1e-8; single 1e-3). Started on the profile, each of three steps takes one inner iteration and the profile does not change (1e-10). |
|
0.25 s in steps of 0.1 s is 0.1, 0.1, 0.05 s, ending at 0.25 s, with the time term’s \(\Delta t\) and
\(1/\Delta t\) those of the last step. |
|
1.00005 s in steps of 0.1 s is ten steps, the last 0.10005 s (within 0.1 % of the time left), not eleven with a
sliver; the time of step \(n\) is exactly \(n\) times 0.1 in double (nine sums of 0.1 are not). A
\(\Delta t\) of 0, \(\infty\) or NaN is refused naming |
|
UT-6.3.1 (beyond the plan): a non-uniform state that changes with time on six boxes, six irregular steps
(0.7 to 2.5 s) with |
|
The averages read on another box layout and the |
|
Comments and blank lines are skipped; two numbers, a word, NaN, \(h = 0\) and four numbers are each refused
with |
|
UT-6.3.2 (beyond the plan): on flat ground with layers of 0.125 m, \(h\) = 0.3 takes the cell at 0.3125 m, the tie \(h\) = 0.25 the lower cell (0.1875 m), the domain’s high corner the last cell and the low corner the first; a probe samples its cell’s closed-form values. On a bump the cell is the one nearest \(h\) above the local ground, from a host scan of the node heights. |
|
A new file has the header and one row per call; reopened with the time 1, it keeps the rows up to 1, and
the rows written after it make the file equal to the run without the restart. |
|
UT-6.3.3 (beyond the plan): a driver resumed after step 3 of 0.1 s numbers its steps 4 to 10 and gives the times of the run without the restart bit for bit; with 0.05 s after the checkpoint, the times are \(t_0 + n \cdot 0.05\) and the run ends at its stop time. After a clipped last step (0.3 s steps to 1 s, anchor (1 s, 4)) a restart to 2 s ends its first step at 1.3 s, not 1.5 s. A chain of restarts (0.1 s to 0.3 s, then 0.05 s to 0.6 s and on to 1 s) gives the steps and times of one restart (0.05 s to 1 s) bit for bit. |
|
UT-8.3.1: with a uniform 5 m/s wind, \(P_c = \beta_p f |U|^3\) and \(D_c = \beta_d f |U| k\) on every cell; where \(k = \beta_p |U|^2/\beta_d\) they balance; the Patankar diagonal gains \(\beta_d f |U|\) and the exact one loses it. |
|
UT-8.3.1 with the cap: in a uniform wind (no shear production), neutral, every capped canopy cell has \(P_c = D_c + \varepsilon\) at \(k = \kappa_c |U|^2\), \(\kappa_c\) the root of \(\beta_d \kappa + C_{\mu0}^3 \kappa^{3/2}/\alpha = \beta_p\) (0.1728 for the defaults). |
|
UT-8.3.2: \(L = \min(L_\text{free}, \alpha/f)\) where \(f > 0\) and \(\varepsilon\) follows it; the same bits where \(f = 0\) or with \(\alpha = 0\); both capped and uncapped canopy cells occur. |
|
UT-8.3.3: with the switches frozen, \(dS_k/dk\) by central differences equals |
|
UT-8.3.4: a canopy with a zero drag field leaves every closure field bit for bit; the residual of \(k\) gains exactly \(D_c - P_c\). |
|
The count behind the inflow-face and damping-layer warnings: a patch covering only the first column of the inflow face is counted there; with a 100 m sponge on the inflow and outflow faces and a Rayleigh layer above 15 m, the canopy cells whose centre lies in either are counted (the Rayleigh layer on w alone is not); patches in the first column or row of each of the four faces are counted with that face inflow; an outflow face and no damping count nothing. |
|
UT-8.3.5: a capped decision held for a smaller \(k\) keeps \(L = \alpha/f\); on the field the moved decisions are counted and the frozen evaluation keeps the cap. The ground-\(z_0\) warning counts every canopy column when \(z_0\) = 1 m and none when 0.05 m. |
|
The momentum predictor’s \(a_P\) is that of the run without a canopy plus the rows computed at the state before the step, on all three components (the v and w rows do not see the u the step has just updated); a step on an increment from zero, as the Newton preconditioner takes, has the same \(a_P\). |
|
|
|
Three iterations of the laminar stage from a random state whose θ is up to 5 K from the reference, on 4 boxes: with θ frozen, θ is unchanged to the last bit and its residual is 0 at every iteration, and u, v, w, p and k are bit for bit those of the frozen stage with gravity off; with θ solved, θ moves and w differs. |
|
With the k–L closure and θ frozen at a stable 10 K/km, one iteration gives a total \(\nu\) below 0.9 times that with gravity off (the closure’s \(N^2\)). |
|
The stage refuses frozen θ with the momentum buoyancy on, and the momentum buoyancy off without frozen θ. |
|
With the ground extension on, θ’s two ground ghost layers are \(2\theta_0 - \theta_1\) and \(3\theta_0 - 2\theta_1\) on uniform layers, in every column of 4 boxes (lateral ghost columns included); off, and in a homogeneous fill with it on, the slip ground’s mirror (\(\theta_0\), \(\theta_1\)). |
|
The Poisson boundary types of every face type on every face it may take, periodic directions included, equal
ERF’s |
|
On a ridge whose height varies along the inflow face: every inflow ghost point (both layers, u, v, θ, k) takes the profile at its own height above the ground, the inlet wind varies along the face by more than 0.05 m/s, and the outflow face points of u are not Dirichlet rows. The ghost values of every rule for every face type (even, odd, value, profile, gradient, the Dirichlet face points, the top’s θ gradient); the analytic profiles and their equilibrium k and \(\nu_t\), and a file table with and without a k column. On a domain two cells wide in x with slip walls on both x faces, the low face is filled first: \(u(-2) = -u(2)\) before the high face sets \(u(2) = 0\), and \(u(4) = -u(0) = 0\) (audit A9: one launch for both faces would read the other face’s points; a CPU build, which runs the tags in order, fails if the split is lost). |
|
Over a 120 m hill with a stable heat flux, the ground ghosts of u, v and θ give MOST’s
gradient at the first centre (u* φ_m/(κ(d₀ + z₀)) along the stress, −q φ_h/(κ u* (d₀ + z₀))) in both layers,
on the two lateral ghost columns too (the periodic images of the neighbouring boxes; this catches a gradient
slab with too few ghost columns under |
|
|
|
The turbulence plotfile’s |
|
Kynema’s |
|
|
|
The point-implicit update k + S_k/(1/Δτ + ∂S_k/∂k) with the Patankar diagonal stays ≥ 0 (> 0 with production) for 1/Δτ = 1, 1e-3 and 0 on 5000 random states; without the diagonal a decaying state goes negative. |
|
The dual-number dS_k/dk and dν_t/dk against central finite differences on 3000 random states (branches held): relative 1e-6 (single 1e-2); the dual value part equals the Real evaluation to a few ulp. |
|
Every |
|
Audit A7: \(d + z_0 > 0\) is checked once per level, where the wall distance is made, the ghost cells
included: a zero ghost distance is refused with \(z_0 = 0\) and accepted with 0.1, −0.1 with 0.1 is
refused. |
|
The logarithmic mean against (a − b)/ln(a/b) on random pairs (1e-14), equal values, zero,
continuity across its series switch; on a log-law column the logarithmic face mean gives the wall flux u*² at
every interior u face (1e-12) where the arithmetic mean misses the first by 2–12 %; the implicit operator with
the same mean satisfies A₁u = −D(u). Over a 120 m hill the residual with the closure equals the residual with
the closure’s own fields given minus the sources bit for bit, the k line Jacobian’s diagonal differs by dSdk
exactly, every field is finite with positive diffusivities, misuse (fields given with a closure, no wall
distance) is refused, and |
|
Manufactured \(\phi\) on a stretched STF mesh over a 60 m hill: every lateral BC (periodic, Neumann, Dirichlet) with a Dirichlet or Neumann top, 2-D (y periodic) at three resolutions, and a 3-D case (Neumann in x, Dirichlet in y, two resolutions): order ≥ 1.9 (single precision: 1.8 coarse, 1.6 fine), residual below 10 × tolerance. The solution has zero gradient at the ground and level side faces, where ERF’s operator is exact for the mirror ghost cells (next row). |
|
With a tangential gradient at sloped ground: order 2 on flat ground (≥ 1.95), between 0.8 and 1.2 over a 120 m hill (64 → 128 → 256 cells), and a fine-mesh error 3 to 6 times that over a 60 m hill (slope²). Double precision only. Pins ERF’s ground treatment (Solution algorithm). |
|
The anisotropic operator with \(\beta_v/\beta_h\) = 1, 0.5, 0.1 ( |
|
\(\beta = 1\) gives the no-coefficient path bit for bit (iterations, solution, fluxes); \(\beta = 2.5\) on every face gives \(\phi/2.5\) and the same fluxes (to 1e-9; single 1e-4). Both paths are this layer’s; there is no separate plain projection to compare with. |
|
On a ramp (slope 0.15) crossing the Neumann faces, their fluxes and the ground’s are exactly zero, and \(\sum J\,A\phi\) equals the flux out of the Dirichlet top (1e-12; single 1e-4). |
|
Operator and fluxes agree cell by cell, \(A\phi = -\nabla_h\cdot F\) (1e-12 of
\(\max|A\phi|\); single 1e-4), with varying coefficients and |
|
Projection: the divergence of \(u + F\) is below 10 × tolerance of the divergence of \(u\), and equals the residual of the solve. |
|
Symmetric hill and right-hand side: \(\phi\) mirror-symmetric to 1e-12 of \(\max|\phi|\) (single 1e-5), Neumann and Dirichlet sides. |
|
Preconditioner, with bounds 10 % above the counts measured: 19 iterations isotropic (more than
10 times as many without it); 16 for \(\beta_v/\beta_h = 0.1\) told the ratio (at most 3 more than
isotropic; not told, more than 1.5 times as many); 29 for \(\beta\) varying over 100 times. A singular
problem reports and removes the mean. Option and BC checks, coefficients that are not positive, MultiFabs on
another layout and a solve that does not converge each stop with the input named.
|
|
Back end B ( |
|
Back end A with a Dirichlet ground: order ≥ 1.9 for every lateral BC and top. |
|
Spatially varying coefficients, Neumann and Dirichlet ground, 3-D with non-periodic sides (Neumann x, Dirichlet y and top): both back ends solved to 1e-12 give \(\phi\) within 1e-9 of max \(|\phi|\) (single: 1e-5 and 1e-4), and the fluxes satisfy \(\nabla_h\cdot F = -\mathrm{rhs}\) to the residual. |
|
|
|
Tucker distance against the exact distance with ERF’s tolerances on ERF’s decks: flat ground (max relative ≤ 3e-3, ≤ 0.1 m below 100 m; single 1e-2 and 0.5 m), 2-D ridge and 3-D hill (max relative ≤ 0.15, mean ≤ 0.03, ≤ 0.2 cells below 100 m); the 3-D hill with periodic and Neumann sides; both back ends (back end B on 64-cell boxes, under CI’s trap). Single precision solves to 1e-4. On flat ground the error converges at second order (32, 64, 128 layers; double precision). |
|
No node of |
|
\(\alpha_h = \alpha_v = 1\): the initial field equals the Poisson layer’s plain projection of the same first guess (the solve without coefficients, applied the same way) bit for bit, \(\lambda\) included; \(\alpha_h = \alpha_v = 2\) gives the same velocity within 1e-9 of max \(|u|\) and \(\lambda/4\) (single: 1e-4); the scalar state is untouched by the correction. Scaling the whole z flux by \(\alpha_v^2\) instead of the cross part by \(\alpha_h^2\) gives a different field; with periodic sides the hill case is divergence-free as a singular problem and the seam ghost of \(u\) is the corrected periodic image; a \(\lambda\) handed in with garbage is zeroed first; the divergence after is measured, not assumed. |
|
The divergence after the correction is below 10 × |
|
Flat terrain, open and periodic sides: the profile is divergence-free, so \(\lambda\), \(w\) and the divergence stay below 1e-12 and \(u\) equals the log law at every x face’s height (single: 1e-4, 1e-5). |
|
D4 symmetry: on a square domain with a Gaussian hill, the wind along ±x and ±y (its own inflow and outflow
faces each time) gives fields that are the eight transforms of each other: the cell-centred velocity vector
maps with the transform’s matrix, \(w\) and \(\lambda\) as scalars, within 1e-12 of the maxima (single
1e-5), with the solve converged to round-off ( |
|
The speed-up above the summit (four central cells a quarter of the depth up, over the profile at their height) falls by more than 0.01 at each step of \(\alpha_v\) = 1, 0.7, 0.5, 0.3, 0.1 (1.015, 0.998, 0.975, 0.943, 0.913 on the 1 km test domain, whose open faces are 500 m from the summit), and \(\alpha_h = 2, \alpha_v = 1\) gives the same value as \(\alpha_v = 0.5\) (the ratio alone matters; 1e-9). The preconditioner is told the ratio: at most 21 GMRES iterations at every ratio (13 to 19 measured). |
|
The first guess over sloping terrain: \(u\) at every x face, the two ghost layers included, and \(v\) at every y face equal the profile at the face’s height above its column’s ground with the 3 m floor (the floor acts on the ground faces and the ghosts below); \(\theta\) equals the sounding by absolute height; \(k\) the profile’s value with the decay above 200 m, and \(u_*^2/C_{\mu 0}^2\) everywhere without it; \(p' = 0\); \(w_0 = 0\) except on the ground faces, which carry no flux (\(\Omega_0 = 0\) to round-off); every ghost cell of the state is written (no NaN from the allocation); the O’Brien pass refuses a layout whose boxes do not span the column. |
|
O’Brien: \(\Omega_0\) vanishes at the ground and the top exactly, the divergence left in every cell is the weight difference \(f_{k+1}^2 a_{z,k+1} - f_k^2 a_{z,k}\) (\(f\) the height fraction, which the test shows differs from the index fraction on the stretched mesh) times the column’s residual (1e-11), the column sum equals the residual flux, the residual the function returns equals the largest column’s; through the initializer the correction starts from a different divergence than without O’Brien (not a lower one: the terrain-following first guess is already consistent at the ground) and gives a different \(w\). |
|
Inputs: \(z_{agl,\min} < 0\) or NaN, \(\alpha_h \le 0\) or infinite,
\(\alpha_v < 0\) or NaN, \(z_i < 0\), and any key other than |
|
The split anisotropic operator ( |
|
The step floor ( |
|
The local pseudo-time step on known fields: uniform \((u, v, w)\) and \(\nu\) on a flat uniform mesh give \(\mathrm{CFL} / (|u|/\Delta x + |v|/\Delta y + |w|/\Delta z + 2\nu(1/\Delta x^2 + 1/\Delta y^2))\) in every cell to 1e-14 (single 1e-6; the hill cases 1e-12 and 1e-5), without \(\nu\) the diffusive term is gone, a field at rest without diffusion gets the floored step, \(u\) varying in \(x\) gives the face mean per cell, a terrain-following field (\(\Omega = 0\)) over a 120 m hill has no vertical term and a plain \(w\) over it the term \(|w| / (J \Delta\zeta)\) cell by cell; a non-positive or NaN CFL and a face layout are refused. |
|
The SER ramp on a geometric residual (rate 1/4): CFL 1, 1, 1, 4, 16, 64, 64, 64 ( |
|
Switch rules on scripted residuals (\(W\) = 5, threshold 0.01, back growth 10): a residual alternating
about the threshold never switches; five iterations below switch forward at iteration 5 with the reason
naming |
|
Audit A5: a new run records the norm (driver history format 4) and a write and a read keep it; a format-3 file reads as not recorded, and a restore from it says so in the log; a norm other than 0 or 1 is refused. |
|
Audit A5 (U6): node heights one ulp above this build’s, or ±32 ulp of the top level’s height, restart, and the run continues on this build’s heights; ±128 ulp, 64 000 ulp and a NaN node stop it (before, any difference did). |
|
Audit A7: the mesh keeps the smallest \(J\) when it makes its metrics (the pressure correction reads it
every iteration). After |
|
The history written to |
|
A residual that becomes infinite or NaN stops the run as |
|
\(a_P\) on every x-, y- and z-face equals \(1/\Delta\tau\) plus the diagonal of |
|
The z-line solve (the vertical upwind weights of \(A_1\) included) against a dense direct solve of the same system, assembled independently from the coefficient fields: on a single column (1 × 1 × 12, periodic sides, the lagged neighbours are the column itself) to 1e-12 after 60 sweeps (single 1e-4); the ghosts outside the domain stay 0. |
|
\(\alpha_u\) relaxation equals pseudo-time relaxation: with \(\Delta\tau = \alpha_u/(1-\alpha_u)/ \mathrm{diag}(A_1)\) on every face, \(a_P = \mathrm{diag}(A_1)/\alpha_u\) to 1e-12 (single 1e-5) and the converged correction of u, v and w equals the dense solve of the relaxed system to 1e-12 (single 1e-4). |
|
z-line Jacobi on a 3-D linear advection-diffusion problem (4 × 4 × 6, periodic, \(\Delta\tau\) = 20 s) converges to the dense direct solution: the error falls at every doubling of the sweeps (1, 2, 4, 8, 16) and is below 1e-10 after 400 sweeps, with the last sweep’s change below 1e-10. |
|
Fixed point: a uniform wind over flat ground with uniform pressure has a residual of exactly zero and the predictor changes nothing (\(|\Delta q| = 0\); with a zero right-hand side the solve is zero for any coefficients, so this follows from the residual); a perturbation of \(u\) at one face is pulled back: one predictor step with \(\Delta\tau\) = 10⁴ s and 50 sweeps lowers max \(|R_u|\) below 0.75 of its value (0.56 measured; the pressure and the transport are frozen in the step). |
|
|
|
With boundary conditions (inflow at xlo, outflow at xhi, slip ground and top), the Dirichlet rows (the inflow face of u, the ground and top faces of w) have \(a_P = 1\), \(d = 0\), and one predictor step sets them to the boundary value exactly for any \(\Delta\tau\) (the inflow faces then have a zero residual row); every other row has \(a_P = 1/\Delta\tau + \mathrm{diag}(A_1)\) and \(d = a_P - \sum a_{nb} > 0\). |
|
The same state on one box and on 2 × 2 boxes (the lagged neighbours cross the box seams through the ghost exchange) gives the same corrected u, v, w, \(a_P\), \(d\) and face step to 1e-12 (single 1e-5). |
|
Audit A4: with the Coriolis coupling on, six boxes on their ranks and in reverse give the same u and v update
bit for bit (the level mean is a fixed-order sum; with the atomic sum it differed by 2.2e-16 on 2 and 4 ranks).
On one rank the two maps are the same, so only the 2- and 4-rank runs can fail. The mean’s value is pinned by
|
|
The w rows’ VNN cap ( |
|
The slope-aware cap ( |
|
On flat ground (several boxes) the cap \(V = 20\) with margin 4 and with margin 0 gives the same w rows (\(a_P\), \(d\)) and the same u, v and w, bit for bit; the cap itself changes \(a_P\). \(1/20\) is inexact, so a regrouped term would differ. |
|
One pressure correction of a predicted velocity (random wind, slip ground and top, periodic sides) leaves a divergence below the Poisson tolerance of the predicted one (0.1 and 1e-10, 2-norms), the ground and top faces of w untouched (\(d = 0\)), \(p\) changed from a random start by \(\alpha_p\) times the potential (\(\alpha_p\) = 1 and 0.7); the stage’s iterate reports the same divergences and six residual norms. |
|
Poiseuille flow between no-slip walls (uniform mesh, 16 layers, \(\nu\) = 10 m²/s, F = 1e-4 m/s²): the stage
at CFL 10 reaches the discrete closed form \(u_k = (F/2\nu)(z_k(H - z_k) + \Delta z^2/4)\) (the odd mirror of
the walls) to 1e-13 of \(u_{\max}\) (single 1e-5) in under 400 iterations; w, v exactly 0, \(p'\) at
round-off, θ and k untouched; one more iteration changes u by less than 1e-14 (the fixed-point check, also run on a uniform state in
|
|
The lid-driven cavity at Re 100 (64 × 64 in x–z, two periodic cells in y, no-slip walls, the lid at U = 1, \(\nu\) = 0.01) run by the driver (four sweeps, CFL 1 → 4) to its verdict: u on the vertical centreline and w on the horizontal one within 0.01 U of Ghia, Ghia and Shin (1982) at their tabulated points (measured 0.0045 and 0.0083; 1760 iterations, 14 s); nothing varies in y. |
|
With \(d = 1/\Delta\tau\) on every interior face and \(\Delta\tau\) = 1e3, 1e6, 1e9, the corrected velocity equals the plain projection’s to 1e-9 of U (single 1e-4), \(\Delta\tau\,p'\) equals the projection’s potential to 1e-8, and the divergence falls to the solver tolerance: no breakdown as \(\Delta\tau \to \infty\). |
|
With the closure and a strong random wind, k stays at or above the floor after each of five iterations: a floor of 1.5 above most of the initial k (the clip acts and its count is reported) and a floor of 1e-6 below every value (the natural case: no cell is clipped), every field finite. |
|
A uniform wind with slip walls has a residual at round-off and a full iteration changes every field by less than 1e-14 of its scale (the Poisson solve of a zero right-hand side returns round-off); the monitors are the speed and the mean k. |
|
The point-implicit buoyancy and rotation of the predictor pinned against their formulas on a
random stratified rotating state, with |
|
The moving lid and lateral walls: the ghost of u above a moving top is 2U − u, the ghost of w beyond an x wall is −w, u is 0 on the x walls (2 n_y n_z Dirichlet rows), and the checks refuse a wall velocity on another face type, a normal component and a non-finite value, and a lateral surface layer. |
|
The readers of |
|
The wall-k rows folded into the implicit rows: with a surface layer the first cells’ k
rows are, for |
|
Over a 60 m hill (and over flat ground) the ground and top faces of w take the no-flux value after the fill: Ω vanishes on every ground and top face to 1e-12 (it is 0.1 or more before the fill on a random w), the two ghost layers mirror about the face value, the lateral ghost columns of the face rows are the periodic images of the valid faces, the Dirichlet rows of the residual vanish, and the homogeneous fill of a perturbation gives the same linear relation; over flat ground the value is 0. |
|
The Rayleigh layer’s fields and height: with |
|
One and two symmetric line LU-SGS sweeps on a 6 × 3 × 4 box (cells and x faces; non-periodic, and periodic cells where the seam couplings are the previous pass’s values) equal a dense block-triangular reference (the forward and backward solves with the lower or upper x/y couplings and every z coupling in the matrix, the rest on the right-hand side) to 1e-12 of the solution; 40 sweeps reach the dense solution of the full system to 1e-11. |
|
Pure first-order upwind convection along x on a non-periodic box, wind in +x or −x: one symmetric sweep equals the dense solution to 1e-12, a second sweep changes nothing (1e-13), and two z-line Jacobi sweeps are still 1e-3 off (the lag). |
|
The real \(A_1\) of u (implicit vertical advection and diffusion, the principal diffusion) on a periodic 4 × 4 × 6 hill mesh with a uniform wind of either sign at Δτ = 20 s: the LU-SGS error falls with every sweep, is below the Jacobi error after four sweeps, and reaches 1e-10 of the dense solution after 40. |
|
The scalar sweep of k with |
|
A zero right-hand side gives a zero correction and zero change for one and three sweeps; the dispatcher
routes by kind ( |
|
The in-memory table profile evaluates its table (exact at the heights, linear between, constant beyond) and
refuses a first height ≠ 0, non-increasing heights, θ ≤ 0, k < 0 and a single row; with the column override the
first guess takes u, v and k from the table at the cell-centre heights of a flat mesh (1e-13) and θ from the
sounding, and the override is required; |
|
The 1-D column on 16 levels over 1000 m under the flat deck’s sounding with the hill decks’ Rayleigh layer on w and θ: converges within the limit, the ground row at z = 0, heights strictly increasing, u and v bounded, v > 0 near the ground (the Ekman turning at latitude 90), the geostrophic wind at the top within 0.5 m/s, k at the floor in the inversion and largest near the ground, the first cell’s k = u*²/C_μ0² (1e-12), u* in 0.2–0.6 m/s, the table identical on every rank. |
|
The stratified column ( |
|
The column first guess with a canopy (UT-8.5.1’s 1-D part): under a dense uniform canopy (f = 0.5 1/m over
the lowest 40 of 64 layers, a pressure-gradient force F, no rotation) the layers at 10 to 30 m have
\(|W| = \sqrt{F/f}\) and \(k\) the root of \(\beta_p |W|^3 = \beta_d |W| k + C_{\mu 0}^3
k^{3/2}/\alpha\), both within 1e-3 (double), and v = 0; with |
|
|
|
The time-marching column ( |
|
QNSE’s φ and ψ against Python values at ζ = 0.1–100 (1e-14) and with distinct coefficients per function, ψ against a Simpson integral of (1 − φ)/x (1e-10); the unstable side and the default equal ERF’s Businger–Dyer functions; the 3-D u* with QNSE matches a bisection (1e-10) and is 8 % above Businger–Dyer’s at ζ = 0.087; the ground ghosts take QNSE’s φ; the keys are read and checked by name. Twelve one-line mutants are caught. |
|
On 1, 2 and 4 boxes (an uneven 7 × 6 split and a 2-D 8 × 1 mesh too), periodic and not, the owned regions cover every cell and every x, y and z face exactly once (periodic images identified, an image owning nothing); the box-local sweeps (zero ghosts, \(n_o\) = 0 and 2, one and two sweeps) equal a host replay written from the ownership rule (1e-13 of the largest value); on one non-periodic box the zero and lagged ghosts give the same result, bit for bit. |
|
A 16 × 8 mesh in 4 × 2 boxes with a strong x coupling (cells and x faces, periodic and not): the outer defect correction with two box-local sweeps per step reaches \(|r| \le 10^{-12}|b|\) for \(n_o\) = 0, 2 and 4, the three states agree to 1e-10, and the outer iterations fall strictly with \(n_o\) (122, 54, 49 non-periodic). Two boxes of four columns with \(n_o = 4\) reproduce the one-box sweep bit for bit, and differ from it with \(n_o = 0\). |
|
A 16 × 16 mesh in 1, 4 and 16 boxes (cells, x and y faces, periodic and not; zero ghosts with \(n_o\) = 0 and 2, and the lagged ghosts): the converged states agree to 1e-10. The box-local sweeps depend on the box shape, so the test is of the converged state, not of the iterates: one step is checked to differ between the layouts. |
|
The diagonal wavefront ordering equals the sequential sweep bit for bit (the correction and the reported
change): every location, 1, 2 and 4 boxes, periodic and not, one and three sweeps, the lagged ghosts and the
zero ghosts with \(n_o\) = 0 and 2. A per-rank launch counter ( |
|
The refusals naming |
|
The alternating ordering ( |
|
Three levels of a stretched mesh (dz0 = 40 m, the ratio solved by Newton), flat and over a round STF hill: every level’s z-levels equal level 0’s bit for bit, with the same nz and z extent and x, y halved per level; on flat ground every node of every level sits at its z-level exactly. |
|
The pass counts \(p(2^l - 1)\) pinned for p = 0 to 3 and l = 0 to 4; for p = 0, 1, 2 every coarse ground of the hill mesh (non-periodic x, periodic y, 8 boxes) equals an independent host rebuild (injection, then that many passes, β = 1/8, in double precision) to 1e-12 of the hill height and differs from one pass more or fewer by more than 1 mm; level 0 is the run’s own mesh; a constant 37.5 m ground is unchanged on every level, bit for bit, ghost nodes included. |
|
Free-stream preservation on every level for BTF, STF and Sullivan: the metric divergence of a uniform (10, 5) m/s wind below 1e-12 of \((|U| + |V|)/\Delta x\) of the level; the coarse grounds are not flat. |
|
Flat terrain, three levels (16 × 8, 8 × 4, 4 × 2 × 24 cells, stretched): (a) each level’s own Poisson solver gives the same φ column for a right-hand side in z alone; (b) the full residual of a conventionally neutral column state (the k-L closure, the surface layer, Coriolis with a geostrophic wind, a capping inversion with buoyancy) has the same u, v, w, p, θ and k columns on every level, so every level has the same column solutions; (c) ten SIMPLEC iterations keep every column of a level alike. Relative 1e-12. Part (b) compares the steady equations rather than iterates; the pull request that added the test gives the reason. |
|
Every invalid hierarchy input gives one message naming the key (n_cell x or y not divisible, levels beyond
the cells, a box size not a multiple of the coarsening, levels 0 and 11, passes −1 and 65, passes without a
hierarchy), and |
|
A level gathered onto one box equals the distributed level (8 boxes) bit for bit: node heights with ghost
nodes, |
|
A 32 × 24 × 10 mesh in 6 boxes of unequal size (non-periodic x, periodic y), three
levels, flat and over a round STF hill (150 m, half width 300 m), level pairs 0 → 1, 1 → 2 and 0 → 2: every
coarse face flux equals the sum of the fine ones it covers (\(a_x u\), \(a_y v\), \(a_z \Omega\))
to 1e-12 of the largest flux; θ, k and p′ equal the |
|
Prolongation of a smooth level-1 state onto level 0 (inflow, outflow, surface layer, slip top, periodic y),
flat and over the hill, with |
|
Flat ground, periodic in x or in y, the three level pairs: a field bilinear in x and y (a tent of the period in the periodic direction, with its kinks on coarse points of the field’s type) is reproduced at every fine point of each of the six fields, up to the non-periodic faces and across the seam, to 1e-13 (2e-6 in single precision). The coarse ghost cells are set to 1e30, so a read of them would show. |
|
A coarse k between −6e-5 and 1.8e-4 against a floor of 1e-4 (the interpolant is negative somewhere and below
the floor in more than 100 fine cells): after |
|
With levels 1 and 2 gathered onto one box, restriction and interpolation between every pair, and
|
|
restrict(prolong(c)) on flat ground, periodic in x or in y, against the closed form: \((c_{I-1} + 6c_I + c_{I+1})/8\) along a cell-centred direction (the identity in the first and last cells next to a non-periodic face), the identity along a nodal one, for a non-smooth coarse field; to 2e-14 (2e-6 in single precision). |
|
Over the hill, for the three level pairs: |
|
32 × 4 cells, periodic x, walls in y, three levels: level 2 is one cell wide in y. A tent in x, constant in y,
prolonged from level 2 to levels 1 and 0, is reproduced at every fine point of each field to 1e-13 (2e-6 in
single precision). A read of the coarse image’s unfilled ghost cells shows as a NaN under |
|
Level pairs (1, 1), (2, 1), (−1, 1) and (0, 3) abort in |
|
The loose stop on synthetic histories, pinned by an independent Python implementation: three residuals (one
peaking at its third value, one below |
|
|
|
|
|
The rotation’s pin holds the planar-mean split: \(a_P\) with \(f^2\max(\tau_c, \tau_{\mathrm{own}})\) and the right-hand side with the unique-face horizontal mean of the other residual per level at \(\tau_c\) and the fluctuation at \(\tau_{\mathrm{own}}\). |
|
Steady-criterion verdicts on converging, stalling (including a residual stuck exactly at the tolerance) and oscillating histories. The converging history becomes steady at iteration 136, pinned from an independent Python implementation of the definition. |
|
A NaN or infinite residual or monitor gives |
|
A monitor at round-off level around zero is steady with scale 1 and never steady with a scale below the noise. |
|
The monitor window needs \(W+1\) values; a change of exactly the tolerance passes and one just above it does not (values exact in binary). |
|
The residual drop is measured from the early peak (iteration 38), not from the first value (iteration 49). |
|
Parameter range checks name their keys; bad or missing monitor scales and size mismatches stop. |
|
A monitor converging at rate 0.999 stops at iteration 4602, within the tolerance of its limit; the window test alone would stop at 1615 with a 2 % error. |
|
Undamped oscillations with periods of 37, 100 and 200 iterations are never steady. |
|
A residual that is zero over the reference iterations does not block the stop. |
|
A criterion restored from a saved history gives the same verdict at every later iteration as one never interrupted; a mismatched history is refused. |
|
A slowly growing monitor is not steady while its change over the window is still small. |
|
Input parsing; unknown, repeated, multi-valued and out-of-range keys reported with their names. |
|
Plotfile round trip, bit-identical, including the nodal heights and their ghost nodes. |
|
Checkpoint and restart onto another box layout, bit-identical; ghost nodes restored without overwriting
valid nodes; a checkpoint written with one ghost cell on the solution fields (the earlier
layout) restarts bit-identical. |
|
Audit A10 (P3): |
|
Audit A10 (P4): comments, tabs, Windows line ends, a UTF-8 byte-order mark and a hex float are read;
|
|
Audit A10 (P2): the column table ( |
|
The sum gives the same bits on 1, 2 and 4 ranks and within 16 ε Σ|x| of the exact sum; the maximum
handles NaN and −0. Audit A4: |
|
On a residual that is exactly quadratic in q (upwind convection, Coriolis, slip walls), the analytic \(Jv\)
and \(B(v,v)\) from central differences; the sweep of |
|
Plain Newton on the Ekman column; the reductions 0.403, 0.171, 0.0131, 2.09e-4, 8.26e-8 pinned to a factor 2, the last two steps above the round-off floor gain more than three orders each, and \(r_{n+1} \le r_n^2\) after the first step. In single precision the first three reductions are pinned and the last two steps sit on the forward difference’s floor (they depend on FMA contraction); the single-precision CI job compiles only, so this branch runs on request. |
|
|
|
|
|
Added after #19. |
|
The 30 m hill with \(u\) three times larger, plain Newton throughout, GMRES(30) stopped at 200 iterations.
Plain |
|
Given a sequence of \(|R|\), the CFL after each accepted step equals the closed form
\(\min(\mathrm{CFL}_\mathrm{max}, g\,\mathrm{CFL}_n, \mathrm{CFL}_0(|R_0|/|R_n|)^p)\) for four SER
settings, with a flag per setting for whether the growth limit and the cap bind (each asserted); the switch to
infinite \(\Delta\tau\) at the cap (and not with |
|
|
|
|
|
On a terrain hill split into six boxes (shared and periodic faces), with non-uniform fields and
\(\Delta\tau\), |
|
On the periodic hill (singular pressure problem), a constant added to \(r_p\) or to \(q\)’s \(p\)
leaves |
|
Four Newton steps on the open hill (9 × 6 × 8, six boxes) at CFL 10, 1e2, 1e3 and 1e4. With |
|
|
|
The 2-D periodic hill with a capping inversion (8 × 2 × 8 cells, two boxes, the k–L closure, the wall law,
Rayleigh damping of w and θ at the top). From the SIMPLEC state at \(r\) = 1e-4: |
|
The same test: the smooth-limiter Newton solution differs from the van Leer SIMPLEC solution by at most 2 % of the largest \(u\) in \(u\) and \(w\), 0.01 K in θ and 5 % of the largest \(k\) in \(k\) (1.1 %, 0.09 %, 7e-5 K and 3.2 % measured), and by more than 0.1 % in \(u\) (the limiters differ). |
|
|
|
Synthetic histories with |
|
The same test: a second stage that asks to go back from its second iterate is left at once (iteration 9,
inside the hysteresis window), its |
|
|
CTest |
|