Skip to content

Commit ed7839a

Browse files
committed
bench
1 parent 52278da commit ed7839a

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

cle15/bench_precision.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
Sweeps each resolution / iteration knob independently while holding the
55
others at their current default values. Reports timing (ms/call) and
66
accuracy (% rmax error relative to the pure-Python reference) for the
7-
75-case benchmark grid.
7+
192-case benchmark grid (Vmax 20-90 m/s, r0 300-2000 km,
8+
f in {3, 5, 7} x 1e-5 s^-1).
9+
10+
Note: r0 = 200 km is excluded because the high-Rossby degenerate regime
11+
produces large bisection sensitivity that inflates the apparent error
12+
without reflecting normal solver behaviour (see cle15.md).
813
914
Usage::
1015
@@ -54,9 +59,14 @@
5459
ALPHA_EYE_DEFAULT,
5560
)
5661

57-
# ── Parameter grid (identical to bench_cle15.py) ─────────────────────────────
62+
# ── Parameter grid ───────────────────────────────────────────────────────────
63+
# r0 = 200 km is excluded from the benchmark grid because the high-Rossby
64+
# degenerate regime (very small r0, very high Vmax, very low f) produces
65+
# large sensitivity to bisection termination side and inflates the apparent
66+
# error without reflecting normal solver behaviour. The instability is
67+
# documented separately (see cle15.md, MATLAB cross-validation section).
5868
VMAX_VALS = [20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0]
59-
R0_VALS = [200e3, 400e3, 600e3, 800e3, 1000e3, 1200e3, 1600e3, 2000e3]
69+
R0_VALS = [300e3, 400e3, 600e3, 800e3, 1000e3, 1200e3, 1600e3, 2000e3]
6070
FCOR_VALS = [3e-5, 5e-5, 7e-5]
6171

6272
ALL_CASES: List[Tuple[float, float, float]] = [

cle15/cle15.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ res = chavas_et_al_2015_profile(..., solver=SolverConfig.precise())
106106

107107
### Accuracy vs. cost sweep (`bench_precision.py`)
108108

109-
The four knobs were swept independently over a 192-case benchmark grid ($V_\text{max} \in \{20, 30, \ldots, 90\}$ m/s, $r_0 \in \{200, 400, \ldots, 2000\}$ km, $f \in \{3, 5, 7\} \times 10^{-5}$ s$^{-1}$), with rmax error measured relative to the pure-Python reference. The grid was expanded from the original 75-case grid ($V_\text{max} \in \{30\text{–}70\}$ m/s, $r_0 \in \{400\text{–}1200\}$ km) to cover the full physically meaningful range including tropical-depression intensities and very large or very compact storms.
109+
The four knobs were swept independently over a 192-case benchmark grid ($V_\text{max} \in \{20, 30, \ldots, 90\}$ m/s, $r_0 \in \{300, 400, \ldots, 2000\}$ km, $f \in \{3, 5, 7\} \times 10^{-5}$ s$^{-1}$), with rmax error measured relative to the pure-Python reference. The grid was expanded from the original 75-case grid ($V_\text{max} \in \{30\text{–}70\}$ m/s, $r_0 \in \{400\text{–}1200\}$ km) to cover the full physically meaningful range including tropical-depression intensities and very large or very compact storms.
110+
111+
> **Note on $r_0 = 200$ km:** this value is excluded from the benchmark grid because the high-Rossby degenerate regime ($\mathrm{Ro} \gg 1$) produces large sensitivity to bisection termination side, inflating the apparent error without reflecting normal solver behaviour. The regime exists and is documented in the `TestMatlabRegression` cross-validation section below.
110112
111113
#### `Nr_e04` — E04 Euler grid points (default 200 000)
112114

w22/img/bench_precision_knobs.pdf

39 KB
Binary file not shown.

w22/img/bench_precision_regime.pdf

68.3 KB
Binary file not shown.
32.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)