PENTRC: fix bspl column index in the vpar<=0 fill path - #288
Merged
Conversation
The tail-fill branch of the GAR bounce average padded the omega_D integrand (column 2) with omega_b integrand (column 1) values when a vpar zero crossing was encountered past the well midpoint, corrupting the precession frequency for pitches near the trapped/passing boundary. Present verbatim since the PENT->PENTRC rewrite (da0e606, 2015). Fixes #286 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rewp8poxoQyorK48SwxEUv
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 #286. Found while reviewing #281, which corrects the normalization of the same integral.
What this changes
One character in the GAR bounce-average
vpar<=0handling:Why
bspl%fs(:,1)is the bounce-time integrand (I1->omega_b) andbspl%fs(:,2)is the radial-derivative integrand (I2->omega_D). When avparzero crossing is encountered past the well midpoint — the warning path near the trapped/passing boundary — the old code filled the remainder of theI2integrand withI1values. The intent (hold the last valid value per column) is clear from the matching column-1 line and from the analogous pre-bounce fill later in the loop, which uses matched columns.Scope
Affects the GAR-family methods (
fgar/tgar/pgarand the*mmmatrix methods) only for pitches that hit thevpar<=0warning path withi >= ntheta/2; results away from the trapped/passing boundary are unchanged. Present verbatim since the PENT->PENTRC rewrite import (da0e6067, June 2015); PENT itself did not have this fill path.Compiles cleanly (gfortran). Independent of #281 (different lines; both apply cleanly in either order).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Rewp8poxoQyorK48SwxEUv