Correct q and COCOS statements in sign conventions reference - #268
Merged
logan-nc merged 3 commits intoJun 12, 2026
Merged
Conversation
… g-file The sign conventions reference claimed q is read directly from the EFIT g-file without sign manipulation. In the direct path the g-file q profile is read but unused: direct_run rebuilds q from a field-line integration using the sign-normalized psi map and |F|, so q is always positive for g-file input. Verified by running DCON on a DIII-D g-file and on a copy with all signed quantities negated: outputs (euler.bin, crit.bin, dcon.out, netcdf) are identical except timestamps. Also clarifies the COCOS section: sign conventions of the g-file are normalized away on read, only the per-radian flux units are required. Inverse equilibria keep the input q profile, including its sign.
Contributor
|
Superseded by #269, which carries these commits plus review corrections: the inverse-equilibrium q statement here was inaccurate (the main inverse path |
logan-nc
added a commit
that referenced
this pull request
Jun 12, 2026
…ositive Correct q sign-convention docs and enforce positive q (replaces #268)
Collaborator
Author
|
Great, thanks Nik! |
This was referenced Jul 25, 2026
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.
Fixes #267. Follows up on @logan-nc's review comment on #253: the sign conventions reference merged in #266 claims q is read directly from the EFIT g-file without sign manipulation. For g-file input, q is recomputed by field-line integration in
direct_run(equil/direct.f) and always comes out positive; the file's q profile is read but unused.Changes to
docs/sign_conventions.rst:newq0remains the one override.Same correction applied to the q bullet in
CLAUDE.md.Verification
Documentation claims tested against develop (375ee8f) built with gfortran 16.1.1.
Failing before (doc claim "read directly from the EFIT g-file without sign manipulation" is falsified by the code): DCON run on the DIII-D ideal example g-file versus a copy with all signed quantities negated (
psirz,simag,sibry,cpasma,ffprim,pprime,qpsi; the file's q profile becomes -1.06 to -8.03):The g-file q sign has no effect and the recomputed q is positive in both runs, matching the corrected text. The unmodified example file already has fpol < 0, so the ABS(F) branch is exercised in the baseline; the flipped file has psio < 0 and exercises the psi flip branch.
Passing after: the revised rst parses cleanly (docutils; the pre-existing Sphinx-only
:doc:role is unchanged).