Repository navigation
EQUIL - BUGFIX - ldp_i reader: accept F < 0 and an optional psi bounds record - #298
Merged
Merged
Conversation
Contributor
|
@StuartBenjamin we are trying to wrap up fortran dev... fill out the reviewer and assignee and labels metadata asap to get this in before 1.6. I suggest Matt or Daniel. Same for your other PRs. Proceed without me |
…format
With f < 0 (e.g. a TokaMaker equilibrium with B_t < 0) inverse_run built a
negative q and stopped ('Invalid extrapolation near axis'). Flipping the sign of
f in an i-file now gives identical results.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, psi_lcfs] TokaMaker's save_ifile pads the last i-file surface inward from the LCFS. An optional final record of length 2 holding the unpadded plasma bounds now normalizes psi: xs = (psi - psi_axis)/(psi_lcfs - psi_axis), psio = psi_lcfs - psi_axis, so psihigh is the true psi_N; psihigh above the last file surface is clamped to it with a note. The record may follow the optional FF', P' records (skipped here) and is told apart by length: a length-mx read of it fails, and the reader then rewinds and skips the records already read (the position after a failed read is processor dependent, so no BACKSPACE). Without the record results are bit-identical; older builds ignore it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 13, 2026
Merged
StuartBenjamin
force-pushed
the
OFT_interface
branch
from
October 13, 2026 06:39
cc7f996 to
608e094
Compare
StuartBenjamin
marked this pull request as draft
October 13, 2026 07:24
StuartBenjamin
requested review from
matt-pharr
and removed request for
d-burg
October 13, 2026 08:08
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StuartBenjamin
marked this pull request as ready for review
October 13, 2026 09:21
matt-pharr
approved these changes
Oct 15, 2026
matt-pharr
left a comment
Collaborator
There was a problem hiding this comment.
This checks out, I updated the PR and added one minor safety check to your new code. Otherwise good and I am merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GPEC PR report:
OFT_interface→developThis PR was cut down to one issue, the
ldp_ireader for OpenFUSIONToolkit/TokaMaker i-files. #297 and #296 have since merged, anddevelopis merged into this branch (31cb34b1).The RDCON fixes that were stacked here moved to their own PRs:
d58c2622,dfd771ca) → RDCON - BUGFIX - Galerkin factorization failures: Cholesky falls back to LU, a failed LU stops #301.cc7f996a) → RDCON - BUGFIX - Delta-matrix output formats sized with i0 #302.zheevreal-eigenvalue fix (c9642696) is dropped: GPEC, DCON, RDCON, STRIDE - BUGFIX - Fix LAPACK and ZVODE type and size errors #299 made the same change.Purpose
Read OpenFUSIONToolkit/TokaMaker i-files correctly with
eq_type = "ldp_i". The work is spread over:save_ifilecan add FF′, p′ records (profile_derivs) and the psi bounds record (psi_bounds).spline_improvements, merged): can build F and p from the FF′, p′ records with the opt-inprofile_source = "integrate". The default isvalues. For i-files (double precision) the two agree to ≤ 0.2 % on Δ′(2/1) at mpsi ≤ 512, so either works.Changes
read_eq_ldp_itakes |F| (8a578482), asread_eq_efitdoes.inverse_runcomputes q in proportion to F. An i-file with F < 0 (TokaMaker with B_t < 0) stopped with "Invalid extrapolation near axis".[psi_axis, psi_lcfs](608e0942).8dc2d0da). psi_axis slightly inside the first surface is not checked. qa is now extrapolated to the true LCFS.Evidence
A D3D-like TokaMaker i-file (129 × 257) in variants with and without the FF′, p′ and bounds records (bounds 1 % beyond the last surface), run through RDCON on develop and on this branch:
develop(#297): DCON on a TokaMaker i-file (33 × 65) in every record layout, big-endian, F < 0,profile_source= values and integrate (gfortran 16)Earlier i-file vs g-file comparison (on the previous version of this PR, with #297): the i-files give Δ′(2/1) = 8.50–8.62 at every mpsi from 128 to 512, while the g-files scatter over 8.26–9.24 at mpsi ≥ 256 (single-precision ψ(R,Z)); the i-files' integrated GSE is 1.6–5× lower.
Status
make rdcon dconbuilds (gfortran 14, Perlmutter)developafter EQUIL - FEATURE - Optional profile_source = "integrate": build F and P in the sq spline from FF′ and p′ (values stays the default) #297:read_eq_ldp_ikeeps EQUIL - FEATURE - Optional profile_source = "integrate": build F and P in the sq spline from FF′ and p′ (values stays the default) #297's FF′, p′ reads and this PR's |F| and bounds read; tested as above.How to reproduce
ldp_i_reader_scripts.zip
🤖 Generated with Claude Code