Migrate KiLCA/QL-Balance quadrature to fortnum (3/8)#142
Draft
krystophny wants to merge 1 commit into
Draft
Conversation
3635b49 to
6048ea8
Compare
bde806b to
d730a8c
Compare
d730a8c to
e87eabb
Compare
This was referenced Jun 14, 2026
e87eabb to
d04fcc2
Compare
af7196f to
867964c
Compare
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.
Merge order
These fortnum-migration PRs are individually based on
mainand form onecumulative stack. Merge them in this order:
#140 -> #141 -> #142 -> #143 -> #144 -> #145 -> #146 -> #147 -> #148 -> #149 -> #150
Each PR is opened against
main, so its diff is cumulative versusmainandoverlaps its predecessors. Merging in the order above keeps the history linear:
once a predecessor merges into
main, the next PR's diff shrinks to just itsown increment.
Scope
Route the C/C++ GSL adaptive-quadrature call sites onto the fortnum C ABI. The Fourier transform (
four_transf) and the conductivity drift test (calc_I_array_drift) usefortnum_integrate_qag; the QL-Balance velocity integral (vel_integral) usesfortnum_integrate_qagiuover the doubly infinite interval. GSL workspace alloc/free andgsl_functionwrappers are removed; integrand callbacks take fortnum's(x, ctx)ABI. Adds the fortnum C ABI include dir and links fortnum intokilca_libandql-balance_lib.Dependency removed
GSL
gsl_integration_qag/qagiin KiLCA and QL-Balance.Verification
The K3 fortnum quadrature signatures compile and link against libfortnum:
Stack tip builds green and
ctestpasses 18/18 (see K8). Draft: only the stack tip was built end to end.Stack reconciliation (update)
The migration stack was rebuilt as a strictly linear cumulative chain on main
428a708:Every branch now pins fortnum to main
974dcf1(all kernel fixes plus both new integrators). This branch's standalone golden result above stands. The cumulative tip (#150 z3) does not pass: the KiLCA background equilibrium ODE on#143 k4cannot reproduce the GSLrk8pdgolden with DOP853 at the unchanged1e-8bar. See#143and#150. Tolerances were not weakened and the stored golden was not regenerated.Merge order:
#140 -> #141 -> #142 -> #143 -> #144 -> #145 -> #146 -> #147 -> #148 -> #149 -> #150.Note: fortnum pin updated to current main (92de6e9) after a fortnum history rewrite; old shas no longer resolve.