#| fig-cap: "JOREK is an offline reference branch, separate from the evolving transport loop."
#| fig-alt: "A saved toolkit equilibrium and plasma profiles become explicit JOREK inputs. JOREK solves the equilibrium, which must be checked before stability scans can assess the toolkit's reduced models."
%%{init: {"flowchart": {"useMaxWidth": false}}}%%
flowchart TD
State["Saved equilibrium and profiles"] --> Inputs["Explicit JOREK inputs"]
Inputs --> Equilibrium["JOREK equilibrium solve"]
Equilibrium --> Check["Check equilibrium agreement"]
Check --> Scan["Offline stability scans"]
Scan --> Evidence["Evidence for reduced models"]
JOREK integration: scope, build and regression checks
We built JOREK as an external reference for stability questions that the transport loop does not resolve. JOREK is a nonlinear extended magnetohydrodynamics (MHD) code for edge-localised modes (ELMs), disruptions and tearing modes in X-point geometry. The toolkit instead prescribes the pedestal or predicts it with EPEDNN, and uses a reduced sawtooth trigger. JOREK’s open-source release this year makes it available as a Tier A reference for those models.
The owner chose the scope (OQ-37). JOREK is an external reference code. It runs outside the JAX loop, never inside compiled code, and is never a runtime dependency of a surrogate. The first use is linear pedestal-stability scans over toroidal mode number, which labels variation around the torus, on the ITER hybrid case, then an internal-kink check for the sawtooth model, then MAST-U. Nonlinear ELM runs are later reference runs only. Disruption studies are outside the brief.
We built JOREK from source on a CPU cluster with our own build of the MUMPS sparse solver, because the cluster’s shared JOREK libraries were not available to us. Two input changes were needed for the GNU Fortran compiler and the solver choice. Neither changes a value. As a check that does not depend on our code, we ran JOREK’s own regression cases against the reference data the JOREK team publishes (3 of 4 upstream regression cases reproduce their public reference data: MAST-U grid and equilibrium (largest difference 2.0e-5, tolerance 1e-4), MAST equilibrium with coils (1.2e-10), and one implicit tearing-mode step (4.1e-13, tolerance 1e-12); the full-MHD kink case was not run because its upstream input is out of date for this code versionC-210). One case could not be run: its input predates a consistency check in the current code, and fixing it would mean changing physics inputs.
A single one-hour CPU job then repeated the regression cases on the compute nodes and measured the cost of an implicit time step on the MAST-U X-point grid (all three regression cases pass on a 256-core AMD node; one implicit step on the MAST-U X-point grid (8050 elements, toroidal modes n = 0 and 1) takes 5.8 s at 2 ranks x 16 threads, 6.7 s at 4 x 32 and 8.1 s at 2 x 64; the whole job used 22.4 core-hoursC-211). That measured cost determines the resources requested for the stability scans.
Where this stands: build and regression checks done; physics settings for the first stability runs await the owner (OQ-39).
Technical details → JOREK. Decision → OQ-37.
JOREK acknowledgement. JOREK is developed by the JOREK team and is open source under the GNU LGPL v3. Results here use JOREK at commit 01a52be3. Citations: M. Hoelzl et al., Nuclear Fusion 61, 065001 (2021); M. Hoelzl et al., Nuclear Fusion 66, 116006 (2026). For a list of JOREK team members, refer to the author list of M. Hoelzl, G.T.A. Huijsmans, F.J. Artola, E. Nardon, M. Becoulet, N. Schwarz, A. Cathey, S.J.P. Pamela et al., Nuclear Fusion 64, 112016 (2024).
Technical details → JOREK › scope · JOREK › build
Decisions → OQ-37