Skip to content

Commit c380776

Browse files
Make sure we reach error
1 parent ea04196 commit c380776

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

examples/hybrid/driver.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Test-specific definitions (may be overwritten in each test case file)
22
# TODO: Allow some of these to be enironment variables or command line arguments
33

4-
import ClimaCore
5-
ClimaCore.DebugOnly.call_post_op_callback() = true
6-
function ClimaCore.DebugOnly.post_op_callback(result, args...; kwargs...)
7-
has_nans = result isa Number ? isnan(result) : any(isnan, parent(result))
8-
has_inf = result isa Number ? isinf(result) : any(isinf, parent(result))
9-
if has_nans || has_inf
10-
has_nans && println("NaNs found!")
11-
has_inf && println("Infs found!")
12-
# Let's define the stack trace so that we know where this came from
13-
st = stacktrace()
14-
ClimaCore.DebugOnly.print_depth_limited_stack_trace(st; maxtypedepth=2)
4+
# import ClimaCore
5+
# ClimaCore.DebugOnly.call_post_op_callback() = true
6+
# function ClimaCore.DebugOnly.post_op_callback(result, args...; kwargs...)
7+
# has_nans = result isa Number ? isnan(result) : any(isnan, parent(result))
8+
# has_inf = result isa Number ? isinf(result) : any(isinf, parent(result))
9+
# if has_nans || has_inf
10+
# has_nans && println("NaNs found!")
11+
# has_inf && println("Infs found!")
12+
# # Let's define the stack trace so that we know where this came from
13+
# st = stacktrace()
14+
# ClimaCore.DebugOnly.print_depth_limited_stack_trace(st; maxtypedepth=2)
1515

16-
error("Halting execution.")
17-
end
18-
end
16+
# error("Halting execution.")
17+
# end
18+
# end
1919

2020
upwinding_mode = :none
2121
horizontal_mesh = nothing # must be object of type AbstractMesh

examples/hybrid/sphere/held_suarez_rhoe.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ horizontal_mesh = cubed_sphere_mesh(; radius = R, h_elem = 4)
1010
npoly = 4
1111
z_max = FT(30e3)
1212
z_elem = 10
13-
# t_end = FT(60 * 60 * 24 * 10)
14-
t_end = FT(60 * 60 * 24)
13+
t_end = FT(60 * 60 * 24 * 10)
1514
dt = FT(400)
1615
dt_save_to_sol = FT(60 * 60 * 24)
1716
dt_save_to_disk = FT(0) # 0 means don't save to disk
@@ -27,7 +26,7 @@ additional_cache(ᶜlocal_geometry, ᶠlocal_geometry, dt) = merge(
2726
held_suarez_cache(ᶜlocal_geometry),
2827
)
2928
function additional_tendency!(Yₜ, Y, p, t)
30-
@show t
29+
t > 805400.0 && @show t
3130
hyperdiffusion_tendency!(Yₜ, Y, p, t)
3231
sponge && rayleigh_sponge_tendency!(Yₜ, Y, p, t)
3332
held_suarez_tendency!(Yₜ, Y, p, t)

0 commit comments

Comments
 (0)