Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ClimaTimeSteppers in implicit hydro balance example #1375

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading