Skip to content

Attempt at making RootSolvers.jl compatible with Reactant - #99

Open
olivierbonte wants to merge 8 commits into
CliMA:mainfrom
olivierbonte:ob/enzyme_reactant
Open

Attempt at making RootSolvers.jl compatible with Reactant#99
olivierbonte wants to merge 8 commits into
CliMA:mainfrom
olivierbonte:ob/enzyme_reactant

Conversation

@olivierbonte

@olivierbonte olivierbonte commented Aug 10, 2026

Copy link
Copy Markdown

Currently, Terrarium.jl uses RootSolvers.jl to solve the surface energy balance equation. Currently, there is an ongoing effort (see NumericalEarth/Terrarium.jl#157) to make the model compatible with Reactant.jl.

This PR is an attempt at making RootSolvers.jl compatible with Reactant.jl. It focusses on allowing forward evaluation of the solvers. Compatibility with AD tools such as Enzyme on top of Reactant.jl are not yet in this PR.

Changes are added in a way to minimally change the current algorithms. Change for loops to while loops was sometimes necessary to allow for the correct tracing, but this does not alter the algorithms.

Furthermore, all test are passing locally (WSL), both for CuArray as the regular tests.

@olivierbonte olivierbonte changed the title WIP: Attempt at making RootSolvers.jl compatible with Enzyme and Reactant WIP: Attempt at making RootSolvers.jl compatible with Reactant Aug 11, 2026
@olivierbonte
olivierbonte marked this pull request as ready for review August 11, 2026 14:24
@olivierbonte olivierbonte changed the title WIP: Attempt at making RootSolvers.jl compatible with Reactant Attempt at making RootSolvers.jl compatible with Reactant Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant