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

remove OrdinaryDiffEq, DiffEqBase #526

Merged
merged 2 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ steps:

- label: "heat-diffusion"
command: "julia --color=yes --project=experiments/ClimaCore/ experiments/ClimaCore/heat-diffusion/run.jl"
artifact_paths: "heat-diffusion/images/*"
artifact_paths: "experiments/ClimaCore/output/heat-diffusion_artifacts/*"
agents:
slurm_mem: 20GB

Expand Down
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)
juliasloan25 marked this conversation as resolved.
Show resolved Hide resolved

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
37 changes: 18 additions & 19 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 Expand Up @@ -157,10 +155,11 @@ run_name = config_dict["run_name"]
energy_check = config_dict["energy_check"]
const FT = config_dict["FLOAT_TYPE"] == "Float64" ? Float64 : Float32
land_sim_name = "bucket"
t_end = Int(time_to_seconds(config_dict["t_end"]))
tspan = (Int(0), t_end)
Δt_cpl = Int(config_dict["dt_cpl"])
saveat = time_to_seconds(config_dict["dt_save_to_sol"])
t_end = Float64(time_to_seconds(config_dict["t_end"]))
t_start = 0.0
tspan = (t_start, t_end)
Δt_cpl = Float64(config_dict["dt_cpl"])
saveat = Float64(time_to_seconds(config_dict["dt_save_to_sol"]))
date0 = date = DateTime(config_dict["start_date"], dateformat"yyyymmdd")
mono_surface = config_dict["mono_surface"]
hourly_checkpoint = config_dict["hourly_checkpoint"]
Expand Down Expand Up @@ -235,18 +234,18 @@ if mode_name == "amip"
## land
land_sim = bucket_init(
FT,
FT.(tspan),
tspan,
config_dict["land_domain_type"],
config_dict["land_albedo_type"],
config_dict["land_temperature_anomaly"],
comms_ctx,
REGRID_DIR;
dt = FT(Δt_cpl),
dt = Δt_cpl,
space = boundary_space,
saveat = FT(saveat),
saveat = saveat,
area_fraction = land_fraction,
date_ref = date0,
t_start = FT(0),
t_start = t_start,
)

## ocean
Expand Down Expand Up @@ -333,18 +332,18 @@ elseif mode_name in ("slabplanet", "slabplanet_aqua", "slabplanet_terra")
## land
land_sim = bucket_init(
FT,
FT.(tspan),
tspan,
config_dict["land_domain_type"],
config_dict["land_albedo_type"],
config_dict["land_temperature_anomaly"],
comms_ctx,
REGRID_DIR;
dt = FT(Δt_cpl),
dt = Δt_cpl,
space = boundary_space,
saveat = FT(saveat),
saveat = saveat,
area_fraction = land_fraction,
date_ref = date0,
t_start = FT(0),
t_start = t_start,
)

## ocean
Expand Down Expand Up @@ -379,18 +378,18 @@ elseif mode_name == "slabplanet_eisenman"
## land
land_sim = bucket_init(
FT,
FT.(tspan),
tspan,
config_dict["land_domain_type"],
config_dict["land_albedo_type"],
config_dict["land_temperature_anomaly"],
comms_ctx,
REGRID_DIR;
dt = FT(Δt_cpl),
dt = Δt_cpl,
space = boundary_space,
saveat = FT(saveat),
saveat = saveat,
area_fraction = land_fraction,
date_ref = date0,
t_start = FT(0),
t_start = t_start,
)

## ocean
Expand Down
Loading
Loading