Skip to content

Commit

Permalink
More debugging, use local wfact
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Nov 24, 2024
1 parent 9c602d6 commit 4e10ba9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
6 changes: 4 additions & 2 deletions docs/src/dev/compute_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ function compute_convergence!(
mkpath(out_path)
fname(i) = replace("$(key1)_$(key2)_step_$(i).png", " " => "_", "(" => "", ")" => "")
for (i, u) in enumerate(plot2_values.u)
f = joinpath(out_path, fname(i))
Plots.png(Plots.plot(u.u), joinpath(out_path, fname(i)))
if !all(isnan, u.u)
f = joinpath(out_path, fname(i))
Plots.png(Plots.plot(u.u), joinpath(out_path, fname(i)))
end
end
# error("NaN found in plot2_values in problem $(test_name)")
end
Expand Down
19 changes: 14 additions & 5 deletions test/problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -510,15 +510,24 @@ function climacore_2Dheat_test_cts(::Type{FT}) where {FT}
dss_tendency && Spaces.weighted_dss!(tendency.u)
_FT = Spaces.undertype(axes(state.u))
set_boundaries!(tendency.u, _FT(0))
e1 = extrema(divgradu)
e2 = extrema(src_term)
e3 = extrema(φ_sin_sin_term)
@show e1, e2, e3, exp_term
if t t_end*0.01
e0 = extrema(state.u)
e1 = extrema(divgradu)
@show e0, e1, count(isnan, parent(state.u)), length(parent(state.u))
end
return nothing
end

function dss!(state, _, t)
if t t_end*0.01
e0_dss = extrema(state.u)
@show e0_dss, count(isnan, parent(state.u)), length(parent(state.u))
end
dss_tendency || Spaces.weighted_dss!(state.u)
if t t_end*0.01
e1_dss = extrema(state.u)
@show e1_dss, count(isnan, parent(state.u)), length(parent(state.u))
end
end

function analytic_sol(t)
Expand All @@ -537,7 +546,7 @@ function climacore_2Dheat_test_cts(::Type{FT}) where {FT}
T_imp! = SciMLBase.ODEFunction(
(Yₜ, u, _, t) -> nothing;
jac_prototype = FieldMatrixWithSolver(jacobian, init_state),
Wfact = Wfact!,
Wfact = (W, Y, p, dtγ, t) -> nothing,
tgrad = (∂Y∂t, Y, p, t) -> (∂Y∂t .= 0),
)

Expand Down

0 comments on commit 4e10ba9

Please sign in to comment.