Fortran v3 And dkx Feature Matrix
This page is the review anchor for functionality parity and intentional
extensions. It is audited from the local SFINCS Fortran v3 source tree and the
upstream SFINCS version-3 user manual on 2026-06-25; the feature-completion series
that followed (Phi1 collision coupling and readExternalPhi1, tangential
magnetic drifts 0-9, constraint schemes 3/4, export_f, geometry scheme 13
from the namelist, non-stellarator-symmetric VMEC, and speed-grid schemes
xGridScheme 1-8 with xDotDerivativeScheme -2..11) is summarised in the
README functionality table and lands here at the next audit pass. It separates three questions that
are easy to conflate during refactoring:
what the Fortran v3 code can do,
where that behavior lives in
dkx,and which promotion gate is still required before making a production claim.
Status definitions
implementedThe capability is available through the public CLI or Python API and has a focused test or checked validation artifact.
implemented with gatesThe capability is available, but production claims are limited by explicit residual, runtime, memory, grid-resolution, or backend gates.
partialThe mathematical or API spine exists, but at least one Fortran-compatible output, branch, option, or production-resolution gate is not complete.
deferredThe capability is intentionally documented as future work. It must not be used as release evidence until its promotion gate is closed.
Fortran v3 feature ownership
Feature surface |
Fortran v3 owner |
Source/manual evidence |
|
|---|---|---|---|
Namelist schema, defaults, and validation |
|
Manual |
|
RHSMode 1 profile-response solve |
|
Fortran performs a nonlinear or linear profile-response solve, then writes particle fluxes, heat fluxes, flows, currents, Phi1 fields, and convergence diagnostics. |
|
RHSMode 2 and RHSMode 3 transport/monoenergetic matrices |
|
Fortran loops over transport RHS columns; RHSMode 3 enforces
monoenergetic constraints such as |
|
Ambipolar root solve option 1 |
|
Safeguarded Newton/bisection uses an adjoint-computed
|
|
Ambipolar root solve option 2 |
|
Brent method evaluates the radial current at bracket endpoints and an initial guess, then uses inverse interpolation or bisection. |
|
Ambipolar root solve option 3 |
|
Pure Newton uses the adjoint-computed |
|
RHSMode 4 fixed- |
|
Fortran solves adjoint systems for particle flux, heat flux, bootstrap, parallel flow, total heat flux, and radial current sensitivities. |
|
RHSMode 5 ambipolar sensitivities |
|
Fortran first finds ambipolar |
Bounded/reference implemented. The implicit sensitivity spine is present,
and a compact Fortran RHSMode=5 heat-flux/ |
Collision models |
|
Manual and validation checks distinguish PAS and full Fokker-Planck branches, plus field-particle and momentum-restoring terms. |
|
Magnetic and electric drift branches |
|
Manual |
Implemented with gates. Release examples cover DKES-like and full trajectory branches; Phi1 drift-current sensitivity promotion is still explicit future work. |
Geometry schemes and radial-coordinate conversions |
|
Fortran supports analytic, Boozer, VMEC-derived, and related geometry schemes, with RHSMode>3 restricted to Boozer coordinates. |
|
Phi1/quasineutrality |
|
Fortran solves coupled kinetic/quasineutrality systems for compatible RHSMode-1 settings and rejects RHSMode>3 with Phi1. |
Canonical: |
Sparse solver and preconditioner backend |
|
Fortran generally factors a preconditioner/direct matrix and uses the same infrastructure for adjoint/transpose solves. |
Native JAX/Python solver stack: implemented with gates. |
Output files and plotting |
|
Fortran writes HDF5 fields for inputs, geometry, solution, diagnostics, and adjoint quantities when enabled. |
|
Parallelism |
PETSc/MPI distribution plus parallel sparse factorization backends |
Fortran delegates matrix distribution, factorization, and solves to MPI PETSc and optional parallel direct solvers. |
JAX CPU/GPU execution, chunking, worker scaling, and sharding paths: implemented with gates. Single-case multi-GPU strong scaling and true device-QI are deferred research lanes until strict production gates pass. |
dkx implementation status
Capability |
Status |
Evidence in this branch |
Remaining promotion gate |
|---|---|---|---|
Example-suite parity against SFINCS Fortran v3 |
implemented |
Frozen CPU/GPU 39-case reports and benchmark plots referenced from Validation Matrix and Validation against reference implementations. |
Regenerate after production-floor suite changes or default solver-policy changes. |
Public CLI and Python solve workflows |
implemented |
CLI, output-format, plotting, and import-contract tests; API docs in Usage, Outputs (HDF5, NetCDF4, and NPZ), and API reference. |
Continue moving private internals behind stable problem-domain APIs. |
Ambipolar Brent option |
implemented |
Checked ambipolar summaries and root-policy tests. |
Add production metadata replay for solver counts, residual separation, and RSS bounds. |
Ambipolar Newton/bisection and pure Newton options |
bounded small-deck implemented; production pending |
Small-deck derivative certificates, the namelist-backed fixed-shape
RHSMode-1 radial-current response helper, active Fortran-style
option-1 current/slope replay, option-1/3 root replay, and
radial-current observable gates in |
Production sparse/matrix-free |
RHSMode 4 fixed- |
source contract implemented; numerical replay pending |
|
Build numerical Fortran-compatible diagnostic/output surfaces and intermediate-grid gates. |
RHSMode 5 ambipolar sensitivities |
source contract implemented; numerical replay deferred |
Shared sensitivity spine exists; constant-current formulas are documented in this matrix and source-compatible input/output field gates are tested. |
Close option-1/3 ambipolar derivative gates first, then add constant-current HDF5 diagnostics. |
QA/QH bootstrap-current validation |
implemented with gates |
README/docs figures compare |
More radial points and production-grid repeats after solver-policy changes. |
QI kinetic promotion |
implemented with gates |
Bounded CPU/GPU/Fortran promotion artifacts and documented claim boundaries. |
True device-QI and production-resolution ladders remain deferred. |
Lower-memory production solver replacement |
implemented with gates |
Native block/Schur/factor infrastructure, direct-Pmat experiments, and true-residual admission tests. |
Promote to auto only when production CPU/GPU residual, runtime, and RSS gates pass. |
Refactor/review-ready architecture |
implemented with review gates |
Domain packages, source-tree guards, import-contract tests, and direct owner tests cover the retired monolith and canonical flat owners. |
Keep docs and the source map synchronized, avoid file-count churn, and make future extractions at complete physics/numerics boundaries. |
Using this matrix during review
When a PR changes defaults, solver dispatch, input compatibility, or output
fields, update this page in the same commit as the code or test that changes the
claim. A feature should move from partial to implemented only when it has
all of the following:
a public CLI or Python entry point,
a focused unit or numerical test,
a physics or cross-code gate when the capability is physics-facing,
docs that identify limitations and reproduction commands,
and, for performance claims, fresh runtime and memory provenance.