Skip to content

Commit 3aa0a08

Browse files
committed
Pass in arrays for saveat
With the release of v0.8.2 for CliamTimeSteppers, you cannot use a number for `saveat`.
1 parent fb0d72d commit 3aa0a08

File tree

8 files changed

+15
-6
lines changed

8 files changed

+15
-6
lines changed

experiments/ClimaEarth/components/land/climaland_bucket.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function BucketSimulation(
5858
output_dir::String;
5959
space,
6060
dt::Float64,
61-
saveat::Float64,
61+
saveat::Vector{Float64},
6262
area_fraction,
6363
stepper = CTS.RK4(),
6464
date_ref::Dates.DateTime,

experiments/ClimaEarth/components/ocean/eisenman_seaice.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function EisenmanIceSimulation(
8181
dss_buffer = CC.Spaces.create_dss_buffer(Y),
8282
)
8383
problem = SciMLBase.ODEProblem(ode_function, Y, Float64.(tspan), cache)
84-
integrator = SciMLBase.init(problem, ode_algo, dt = Float64(dt), saveat = Float64(saveat), adaptive = false)
84+
integrator = SciMLBase.init(problem, ode_algo, dt = Float64(dt), saveat = Float64.(saveat), adaptive = false)
8585

8686
sim = EisenmanIceSimulation(params, Y, space, integrator)
8787
return sim

experiments/ClimaEarth/components/ocean/prescr_seaice.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function PrescribedIceSimulation(
141141
ode_function = CTS.ClimaODEFunction(T_exp! = ice_rhs!, dss! = (Y, p, t) -> CC.Spaces.weighted_dss!(Y, p.dss_buffer))
142142

143143
problem = SciMLBase.ODEProblem(ode_function, Y, Float64.(tspan), (; cache..., params = params))
144-
integrator = SciMLBase.init(problem, ode_algo, dt = Float64(dt), saveat = Float64(saveat), adaptive = false)
144+
integrator = SciMLBase.init(problem, ode_algo, dt = Float64(dt), saveat = Float64.(saveat), adaptive = false)
145145

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

experiments/ClimaEarth/components/ocean/slab_ocean.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function SlabOceanSimulation(
9494
CTS.ClimaODEFunction(; T_exp! = slab_ocean_rhs!, dss! = (Y, p, t) -> CC.Spaces.weighted_dss!(Y, p.dss_buffer))
9595

9696
problem = SciMLBase.ODEProblem(ode_function, Y, Float64.(tspan), cache)
97-
integrator = SciMLBase.init(problem, ode_algo, dt = Float64(dt), saveat = Float64(saveat), adaptive = false)
97+
integrator = SciMLBase.init(problem, ode_algo, dt = Float64(dt), saveat = Float64.(saveat), adaptive = false)
9898

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

experiments/ClimaEarth/run_cloudless_aquaplanet.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,15 @@ boundary_space = CC.Spaces.horizontal_space(atmos_sim.domain.face_space) # TODO:
153153
### Surface Model: Slab Ocean
154154
=#
155155

156+
saveat = Float64(Utilities.time_to_seconds(config_dict["dt_save_to_sol"]))
157+
saveat = [tspan[1]:saveat:tspan[1]..., tspan[2]]
158+
156159
ocean_sim = SlabOceanSimulation(
157160
FT;
158161
tspan = tspan,
159162
dt = Δt_cpl,
160163
space = boundary_space,
161-
saveat = Float64(Utilities.time_to_seconds(config_dict["dt_save_to_sol"])),
164+
saveat = saveat,
162165
area_fraction = ones(boundary_space),
163166
thermo_params = thermo_params,
164167
evolving = true,

experiments/ClimaEarth/run_cloudy_aquaplanet.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,16 @@ boundary_space = CC.Spaces.horizontal_space(atmos_sim.domain.face_space) # TODO:
177177
#=
178178
### Surface Model: Slab Ocean
179179
=#
180+
181+
saveat = Float64(Utilities.time_to_seconds(config_dict["dt_save_to_sol"]))
182+
saveat = [tspan[1]:saveat:tspan[1]..., tspan[2]]
183+
180184
ocean_sim = SlabOceanSimulation(
181185
FT;
182186
tspan = tspan,
183187
dt = Δt_cpl,
184188
space = boundary_space,
185-
saveat = Float64(Utilities.time_to_seconds(config_dict["dt_save_to_sol"])),
189+
saveat = saveat,
186190
area_fraction = ones(boundary_space),
187191
thermo_params = thermo_params,
188192
evolving = true,

experiments/ClimaEarth/run_cloudy_slabplanet.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ land_area_fraction = SpaceVaryingInput(land_mask_data, "landsea", boundary_space
201201
=#
202202

203203
saveat = Float64(Utilities.time_to_seconds(config_dict["dt_save_to_sol"]))
204+
saveat = [tspan[1]:saveat:tspan[1]..., tspan[2]]
204205

205206
## land model
206207
land_sim = BucketSimulation(

experiments/ClimaEarth/user_io/arg_parsing.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function get_coupler_args(config_dict::Dict)
6363
date0 = date = Dates.DateTime(config_dict["start_date"], Dates.dateformat"yyyymmdd")
6464
Δt_cpl = Float64(Utilities.time_to_seconds(config_dict["dt_cpl"]))
6565
saveat = Float64(Utilities.time_to_seconds(config_dict["dt_save_to_sol"]))
66+
saveat = [t_start:saveat:t_end..., t_end]
6667
component_dt_dict = config_dict["component_dt_dict"]
6768

6869
# Checkpointing information

0 commit comments

Comments
 (0)