Add an orbit-class magnetic-drift control - #97
Merged
Conversation
…ift scope MARS-K has no passing magnetic-drift code path at all. Matching that scope in NEO-RT previously required two runs -- trapped with magdrift, passing without -- whose per-class outputs were added by hand. That works because NEO-RT serializes Tco, Tctr and Tt separately and the class contributions are additive, but it doubles the runs and puts the composition in the analysis layer where it is easy to get wrong. `magdrift_passing` switches the magnetic drift off for passing orbits only. It gates two places: the passing branch of Om_tB, which now returns exactly zero rather than an interpolated value, and init_canon_freq_passing_spline, which no longer builds a drift spline it will not use. The namelist control is an integer with a negative "follow magdrift" default, so every existing deck keeps its behaviour bit-identically and no deck has to name the new key. Only an explicit 0 or 1 overrides. VALIDATION IS PENDING and this should not merge without it. The oracle is the two-run equivalence above: trapped-with-drift plus passing-without, summed from the separate class columns, must reproduce a single run with magdrift=.true. and magdrift_passing=0. That compares against an existing, independent code path rather than restating the patch. A bespoke unit test was attempted and dropped: driving Om_tB directly needs more orbit-machinery setup than the check is worth, and the two-run comparison is the stronger oracle anyway. First of a planned set of code-mimicry flags, whose purpose is to let NEO-RT be run *as* MARS-K on the MARS field and *as* PENTRC on the GPEC field, so that residual differences are physics rather than configuration.
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.
MARS-K has no passing magnetic-drift path. This adds one narrowly scoped control so NEO-RT can reproduce that orbit-class physics in one run.
magdrift_passingis an integer namelist/API control: negative followsmagdrift(the backward-compatible default), zero disables only the passing contribution, and positive enables it. The trapped branch and native torque signs are unchanged.The independent behavioral oracle runs three real golden-record cases: full drift, no drift, and mixed scope. It verifies that the mixed run's passing contribution equals the no-drift run while its trapped contribution equals the full-drift run. This is the previous two-run composition, not an assertion of the new implementation's internal state.
Validation:
fo test: 10/10This supersedes #94, whose branch accidentally contained unrelated stacked work.