Skip to content

Commit c6fac9b

Browse files
Update saveat (#2174)
* Update saveat With ClimaTimeSteppers 0.8.2, you cannot pass saveat as a scalar. * Define zero for SchurComplementW * Fix --------- Co-authored-by: Charles Kawczynski <[email protected]>
1 parent a1c6470 commit c6fac9b

39 files changed

+86
-47
lines changed

docs/tutorials/introduction.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ function heat_fd_tendency!(dydt, y, α, t)
390390
end
391391

392392
heat_fd_prob = ODEProblem(heat_fd_tendency!, y0, (0.0, 5.0), 0.1)
393-
heat_fd_sol = solve(heat_fd_prob, SSPRK33(), dt = 0.1, saveat = 0.25)
393+
heat_fd_sol =
394+
solve(heat_fd_prob, SSPRK33(), dt = 0.1, saveat = collect(0.0:0.25:5.0))
394395
#----------------------------------------------------------------------------
395396

396397
anim = Plots.@animate for u in heat_fd_sol.u
@@ -417,7 +418,8 @@ end
417418
y0 = exp.(.-(coord.y .^ 2 .+ coord.x .^ 2) ./ 2)
418419

419420
heat_cg_prob = ODEProblem(heat_cg_tendency!, y0, (0.0, 5.0), 0.1)
420-
heat_cg_sol = solve(heat_cg_prob, SSPRK33(), dt = 0.1, saveat = 0.5)
421+
heat_cg_sol =
422+
solve(heat_cg_prob, SSPRK33(), dt = 0.1, saveat = collect(0.0:0.5:5.0))
421423
#----------------------------------------------------------------------------
422424

423425
anim = Plots.@animate for u in heat_cg_sol.u
@@ -535,8 +537,12 @@ end
535537
#----------------------------------------------------------------------------
536538

537539
shallow_water_prob = ODEProblem(shallow_water_tendency!, y0, (0.0, 20.0))
538-
@time shallow_water_sol =
539-
solve(shallow_water_prob, SSPRK33(), dt = 0.05, saveat = 1.0)
540+
@time shallow_water_sol = solve(
541+
shallow_water_prob,
542+
SSPRK33(),
543+
dt = 0.05,
544+
saveat = collect(0.0:1.0:20.0),
545+
)
540546
anim = Plots.@animate for u in shallow_water_sol.u
541547
Plots.plot(u.ρθ, clim = (-1, 1))
542548
end

examples/bickleyjet/bickleyjet_cg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ sol = solve(
127127
prob,
128128
SSPRK33(),
129129
dt = 0.02,
130-
saveat = 1.0,
130+
saveat = collect(0.0:1.0:80.0),
131131
progress = true,
132132
progress_message = (dt, u, p, t) -> t,
133133
)

examples/bickleyjet/bickleyjet_cg_invariant_hypervisc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ sol = solve(
154154
prob,
155155
SSPRK33(),
156156
dt = 0.02,
157-
saveat = 1.0,
157+
saveat = collect(0.0:1.0:80.0),
158158
progress = true,
159159
progress_message = (dt, u, p, t) -> t,
160160
)

examples/bickleyjet/bickleyjet_cg_unsmesh.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ sol = solve(
127127
prob,
128128
SSPRK33(),
129129
dt = 0.02,
130-
saveat = 1.0,
130+
saveat = collect(0.0:1.0:80.0),
131131
progress = true,
132132
progress_message = (dt, u, p, t) -> t,
133133
)

examples/bickleyjet/bickleyjet_dg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ sol = solve(
226226
prob,
227227
SSPRK33(),
228228
dt = 0.02,
229-
saveat = 1.0,
229+
saveat = collect(0.0:1.0:200.0),
230230
progress = true,
231231
progress_message = (dt, u, p, t) -> t,
232232
)

examples/column/advect.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,31 +119,31 @@ sol1 = solve(
119119
prob1,
120120
SSPRK33(),
121121
dt = Δt,
122-
saveat = 10 * Δt,
122+
saveat = collect(0.0:(10 * Δt):10.0),
123123
progress = true,
124124
progress_message = (dt, u, p, t) -> t,
125125
);
126126
sol2 = solve(
127127
prob2,
128128
SSPRK33(),
129129
dt = Δt,
130-
saveat = 10 * Δt,
130+
saveat = collect(0.0:(10 * Δt):10.0),
131131
progress = true,
132132
progress_message = (dt, u, p, t) -> t,
133133
);
134134
sol3 = solve(
135135
prob3,
136136
SSPRK33(),
137137
dt = Δt,
138-
saveat = 10 * Δt,
138+
saveat = collect(0.0:(10 * Δt):10.0),
139139
progress = true,
140140
progress_message = (dt, u, p, t) -> t,
141141
);
142142
sol4 = solve(
143143
prob4,
144144
SSPRK33(),
145145
dt = Δt,
146-
saveat = 10 * Δt,
146+
saveat = collect(0.0:(10 * Δt):10.0),
147147
progress = true,
148148
progress_message = (dt, u, p, t) -> t,
149149
);

examples/column/advect_diffusion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ sol = solve(
9595
prob,
9696
SSPRK33(),
9797
dt = Δt,
98-
saveat = 10000 * Δt,
98+
saveat = collect(t₀:(10000 * Δt):t₁),
9999
progress = true,
100100
progress_message = (dt, u, p, t) -> t,
101101
);

examples/column/bb_fct_advection.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ for (i, stretch_fn) in enumerate(stretch_fns)
115115
prob,
116116
ExplicitAlgorithm(SSP33ShuOsher()),
117117
dt = Δt,
118-
saveat = Δt,
118+
saveat = collect(t₀:Δt:t₁),
119119
progress = true,
120120
adaptive = false,
121121
progress_message = (dt, u, p, t) -> t,

examples/column/ekman.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ sol = solve(
118118
prob,
119119
SSPRK33(),
120120
dt = Δt,
121-
saveat = 600, # save 10 min
121+
saveat = collect(0.0:600:(60 * 60 * 50)), # save 10 min
122122
progress = true,
123123
progress_message = (dt, u, p, t) -> t,
124124
);

examples/column/fct_advection.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ for (i, stretch_fn) in enumerate(stretch_fns)
116116
prob,
117117
SSPRK33(),
118118
dt = Δt,
119-
saveat = Δt,
119+
saveat = collect(t₀:Δt:t₁),
120120
progress = true,
121121
adaptive = false,
122122
progress_message = (dt, u, p, t) -> t,

0 commit comments

Comments
 (0)