AIBECS.jl: A tool for exploring global marine biogeochemical cycles
Authors/Creators
- 1. Department of Earth Sciences, University of Southern California; (now at) School of Mathematics and Statistics, University of New South Wales, Sydney
- 2. Department of Earth System Science, University of California, Irvine
- 3. Department of Earth Sciences, University of Southern California
Description
AIBECS v0.18.0
Breaking changes
CTKAlg's defaultlinsolvefield now eagerly defaults toUMFPACKFactorization()instead ofnothing. Runtime behaviour is unchanged (the previous=== nothingbranch fell back to UMFPACK too), but the type parameterCTKAlg{L}is nowCTKAlg{UMFPACKFactorization}by default rather thanCTKAlg{Nothing}. Any downstream code dispatching onCTKAlg{Nothing}will need updating.
New features
Analytical
∂Gs/∂Gkeyword onAIBECSFunction— supply closed-form derivatives of the source–sink termGto skip the per-blockForwardDiff.derivativecall in Jacobian assembly. Strictly opt-in; omitting the keyword keeps the existing ForwardDiff path. Tuple-of-tuples shape for multi-tracer;check_∂Gs(Gs, ∂Gs, x, p, nb)is exported to validate analytical derivatives against ForwardDiff.AD-through-the-solve for
CTKAlg— newsolve(::SteadyStateProblem{…,Dual,…}, ::CTKAlg)dispatch peels the duals, runs the primal Newton–Chord–Shamanskii at Float64, and reconstructs∂u*/∂pvia the implicit function theorem (Jᵤ z = −Jₚ). Nested-Dual (Hessian) calls recurse one Dual layer per level, routed through LinearSolve'sDualLinearCacheso the sparse factorisation is reused — no densification.ForwardDiff.gradient(p -> sum(solve(SteadyStateProblem(F, x, p), CTKAlg()).u), p)now Just Works on AIBECS's sparse Jacobian.AIBECS.nonlinearproblemDual-stripping — the sparsejac_prototypebuilder now strips Duals before construction, so the SciML NonlinearSolve IFT path also works withForwardDiffover an AIBECS steady-state solve.
Caveats
- The IFT dispatch reuses three
NonlinearSolveBasesymbols (nodual_value,nonlinearsolve_∂f_∂p,nonlinearsolve_dual_solution) that are public-but-internal-feeling. A one-shot@warnsurfaces this on first AD-through-solve call. - IFT-reconstructed partials inherit the primal Newton residual; for
machine-precision derivatives the solver must be forced past its
stopping rule (
abstol=0, run tomaxItNewton). Not practical at production grid sizes — useF1Method's analytical gradient/Hessian there.
Merged pull requests:
- feat: analytical ∂Gs for G + AD-through-the-solve via IFT for CTKAlg (#124) (@briochemc)
Files
JuliaOcean/AIBECS.jl-v0.18.0.zip
Files
(595.0 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:b9161e01dec0e09d8276b04628d73c0d
|
595.0 kB | Preview Download |
Additional details
Related works
- Is supplement to
- Software: https://github.com/JuliaOcean/AIBECS.jl/tree/v0.18.0 (URL)
Software
- Repository URL
- https://github.com/JuliaOcean/AIBECS.jl