Skip to content

Commit

Permalink
rm ODE, DiffEqBase
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasloan25 committed Dec 1, 2023
1 parent e8e1555 commit 7a03bde
Show file tree
Hide file tree
Showing 21 changed files with 520 additions and 806 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Insolation = "0.6"
JLD2 = "0.4"
NCDatasets = "0.11, 0.12"
Plots = "1.39.0"
SciMLBase = "1"
SciMLBase = "1, 2"
StaticArrays = "1"
Statistics = "1"
SurfaceFluxes = "0.8"
Expand Down
351 changes: 117 additions & 234 deletions experiments/AMIP/modular/Manifest.toml

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions experiments/AMIP/modular/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ ClimaTimeSteppers = "595c0a79-7f3d-439a-bc5a-b232dc3bde79"
CloudMicrophysics = "6a9e3e04-43cd-43ba-94b9-e8782df3c71b"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
Expand All @@ -30,7 +28,6 @@ Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
NVTX = "5da4648a-3479-48b8-97b9-01cb529c0a1f"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c"
Expand All @@ -56,8 +53,6 @@ ClimaCoupler = "0.1"
ClimaTimeSteppers = "0.7"
Colors = "0.12"
Dierckx = "0.5"
DiffEqBase = "6"
DiffEqCallbacks = "2"
ForwardDiff = "0.10"
GR = "0.71"
Glob = "1"
Expand All @@ -66,7 +61,6 @@ IntervalSets = "0.5, 0.6, 0.7"
JSON = "0.21"
MPI = "0.20"
NVTX = "0.3"
OrdinaryDiffEq = "6"
ProgressLogging = "0.1"
RRTMGP = "0.9"
StaticArrays = "1"
Expand Down
6 changes: 1 addition & 5 deletions experiments/AMIP/modular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,9 @@ with the thermal conductivity of ice, $k_i = 2$ W m$^{-2}$ K$^{-1}$, and $T_{bas
# NB:
- first coupled iteration does not call rhs!
- slab `T_sfc` gets huge numbers when using `SSPRK33`. ok with `Euler`
- slab `T_sfc` gets huge numbers when using `SSP333`. ok with `Euler`
- do not init global fields with mpi context
# References
- [Kang et al 2021](https://arxiv.org/abs/2101.09263)
- [kth.se blog for strong and weak scaling](https://www.kth.se/blogs/pdc/2018/11/scalability-strong-and-weak-scaling/)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ClimaCoupler: FluxCalculator
import ClimaTimeSteppers as CTS
import DiffEqBase: ODEProblem, init, step!
import ClimaCoupler.FluxCalculator: update_turbulent_fluxes_point!, differentiate_turbulent_fluxes!
import ClimaCoupler.Interfacer: get_field, update_field!
using ClimaCore.Fields: getindex
import SciMLBase: step!, reinit!, init, ODEProblem

"""
EisenmanIceSimulation{P, Y, D, I}
Expand Down Expand Up @@ -226,8 +226,8 @@ function eisenman_seaice_init(
thermo_params = thermo_params,
dss_buffer = ClimaCore.Spaces.create_dss_buffer(ClimaCore.Fields.zeros(space)),
)
problem = ODEProblem(ode_function, Y, FT.(tspan), cache)
integrator = init(problem, ode_algo, dt = FT(dt), saveat = FT(saveat), adaptive = false)
problem = ODEProblem(ode_function, Y, Float64.(tspan), cache)
integrator = init(problem, ode_algo, dt = Float64(dt), saveat = Float64(saveat), adaptive = false)

sim = EisenmanIceSimulation(params, Y, space, integrator)
@warn name(sim) *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ function ice_init(::Type{FT}; tspan, saveat, dt, space, area_fraction, thermo_pa
ode_algo = CTS.ExplicitAlgorithm(stepper)
ode_function = CTS.ClimaODEFunction(T_exp! = ice_rhs!, dss! = weighted_dss_slab!)

problem = ODEProblem(ode_function, Y, FT.(tspan), (; additional_cache..., params = params))
integrator = init(problem, ode_algo, dt = FT(dt), saveat = FT(saveat), adaptive = false)
problem = ODEProblem(ode_function, Y, Float64.(tspan), (; additional_cache..., params = params))
integrator = init(problem, ode_algo, dt = Float64(dt), saveat = Float64(saveat), adaptive = false)

sim = PrescribedIceSimulation(params, Y, space, integrator)

Expand Down
4 changes: 2 additions & 2 deletions experiments/AMIP/modular/components/ocean/slab_ocean_init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ function ocean_init(
ode_algo = CTS.ExplicitAlgorithm(stepper)
ode_function = CTS.ClimaODEFunction(T_exp! = slab_ocean_rhs!, dss! = weighted_dss_slab!)

problem = ODEProblem(ode_function, Y, FT.(tspan), cache)
integrator = init(problem, ode_algo, dt = FT(dt), saveat = FT(saveat), adaptive = false)
problem = ODEProblem(ode_function, Y, Float64.(tspan), cache)
integrator = init(problem, ode_algo, dt = Float64(dt), saveat = Float64(saveat), adaptive = false)

sim = SlabOceanSimulation(params, Y, space, integrator)

Expand Down
4 changes: 1 addition & 3 deletions experiments/AMIP/modular/coupler_driver_modular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ Here we import standard Julia packages, ClimaESM packages, parse in command-line
We then specify the input data file names. If these are not already downloaded, include `artifacts/download_artifacts.jl`.
=#

import SciMLBase: step!, reinit!
using OrdinaryDiffEq
using OrdinaryDiffEq: ODEProblem, solve, SSPRK33, savevalues!, Euler
import SciMLBase: ODEProblem, solve, step!, init, reinit!
using LinearAlgebra
import Test: @test
using Dates
Expand Down
Loading

0 comments on commit 7a03bde

Please sign in to comment.