@@ -44,7 +44,7 @@ Base.@kwdef struct EisenmanOceanParameters{FT <: AbstractFloat}
4444end
4545
4646"""
47- EisenmanIceSimulation(::Type{FT}, tspan; space = nothing, area_fraction = nothing, thermo_params = nothing, stepper = CTS.RK4(), dt = 0.02 , saveat = 1.0e10)
47+ EisenmanIceSimulation(::Type{FT}, tspan; space = nothing, area_fraction = nothing, thermo_params = nothing, stepper = CTS.RK4(), dt, saveat = 1.0e10)
4848
4949Initialize the Eisenman-Zhang sea ice model and simulation.
5050"""
@@ -55,7 +55,7 @@ function EisenmanIceSimulation(
5555 area_fraction = nothing ,
5656 thermo_params = nothing ,
5757 stepper = CTS. RK4 (),
58- dt = 0.02 ,
58+ dt,
5959 saveat = [1.0e10 ],
6060) where {FT}
6161
@@ -79,8 +79,13 @@ function EisenmanIceSimulation(
7979 thermo_params = thermo_params,
8080 dss_buffer = CC. Spaces. create_dss_buffer (Y),
8181 )
82- problem = SciMLBase. ODEProblem (ode_function, Y, Float64 .(tspan), cache)
83- integrator = SciMLBase. init (problem, ode_algo, dt = Float64 (dt), saveat = Float64 .(saveat), adaptive = false )
82+ if typeof (dt) isa Number
83+ dt = Float64 (dt)
84+ tspan = Float64 .(tspan)
85+ saveat = Float64 .(saveat)
86+ end
87+ problem = SciMLBase. ODEProblem (ode_function, Y, tspan, cache)
88+ integrator = SciMLBase. init (problem, ode_algo, dt = dt, saveat = saveat, adaptive = false )
8489
8590 sim = EisenmanIceSimulation (params, space, integrator)
8691 return sim
@@ -130,7 +135,7 @@ function Interfacer.get_field(sim::EisenmanIceSimulation, ::Val{:energy})
130135
131136 e_ml = @. p_o. h * p_o. ρ * p_o. c * sim. integrator. u. T_ml # heat
132137 e_ice = @. p_i. L_ice * sim. integrator. u. h_ice # phase
133- e_qflux = @. ocean_qflux * FT (sim. integrator. t)
138+ e_qflux = @. ocean_qflux * FT (float ( sim. integrator. t) )
134139
135140 return @. e_ml + e_ice + e_qflux + e_base
136141end
@@ -340,7 +345,7 @@ Calculate the tendencies for the Eisenman-Zhang sea ice model.
340345"""
341346function ∑tendencies (dY, Y, cache, _)
342347 FT = eltype (dY)
343- Δt = cache. Δt
348+ Δt = float ( cache. Δt)
344349 Ya = cache. Ya
345350 thermo_params = cache. thermo_params
346351 p = cache. params
0 commit comments