Skip to content

Commit

Permalink
Use ClimaTimeSteppers in implicit hydro balance example
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Jul 28, 2023
1 parent 85ea29c commit f9ca4cf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions examples/column/hydrostatic_implicit.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using LinearAlgebra
import ClimaTimeSteppers as CTS
import ClimaCore:
Fields,
Domains,
Expand Down Expand Up @@ -233,11 +234,12 @@ ndays = 1.0

# Solve the ODE operator
prob = ODEProblem(
ODEFunction(
tendency!,
jac = jacobian!,
jac_prototype = zeros(length(Y), length(Y)),
tgrad = (dT, Y, p, t) -> fill!(dT, 0),
CTS.ClimaODEFunction(;
T_imp! = ODEFunction(;
Wfact = jacobian!,
tendency!,
jac_prototype = zeros(length(Y), length(Y)),
),
),
Y,
(0.0, 60 * 60 * 24 * ndays),
Expand All @@ -246,7 +248,7 @@ prob = ODEProblem(
sol = solve(
prob,
# ImplicitEuler(),
Rosenbrock23(linsolve = linsolve!),
CTS.IMEXAlgorithm(CTS.ARS343(), CTS.NewtonsMethod()),
dt = Δt,
saveat = 60 * 60, # save every hour
progress = true,
Expand Down

0 comments on commit f9ca4cf

Please sign in to comment.