Skip to content

Commit 00bf435

Browse files
authored
Merge pull request #4011 from CliMA/zs/diffusion_jacobian
change diffusion jacobian in the implicit solver
2 parents cb7f050 + 79e016d commit 00bf435

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

reproducibility_tests/ref_counter.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
260
1+
261
22

33
# **README**
44
#
@@ -20,6 +20,9 @@
2020

2121

2222
#=
23+
261
24+
- Ignore the implicit solver Jacobian for the tracer-density block from diffusion
25+
2326
260
2427
- Change environment TKE to grid-mean TKE
2528

src/prognostic_equations/implicit/manual_sparse_jacobian.jl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -619,11 +619,7 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
619619
end
620620

621621
∂ᶜρe_tot_err_∂ᶜρ = matrix[@name(c.ρe_tot), @name(c.ρ)]
622-
@. ∂ᶜρe_tot_err_∂ᶜρ =
623-
dtγ * ᶜdiffusion_h_matrix DiagonalMatrixRow(
624-
(-(1 + ᶜkappa_m) * ᶜe_tot - ᶜkappa_m * ∂e_int_∂q_tot * ᶜq_tot) /
625-
ᶜρ,
626-
)
622+
@. ∂ᶜρe_tot_err_∂ᶜρ = zero(typeof(∂ᶜρe_tot_err_∂ᶜρ))
627623
@. ∂ᶜρe_tot_err_∂ᶜρe_tot +=
628624
dtγ * ᶜdiffusion_h_matrix DiagonalMatrixRow((1 + ᶜkappa_m) / ᶜρ)
629625

@@ -637,8 +633,7 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
637633
ᶜ∂kappa_m∂q_tot *
638634
(cp_d * T_0 + ᶜe_tot - ᶜK - ᶜΦ + ∂e_int_∂q_tot * ᶜq_tot)
639635
))
640-
@. ∂ᶜρq_tot_err_∂ᶜρ =
641-
dtγ * ᶜdiffusion_h_matrix DiagonalMatrixRow(-(ᶜq_tot) / ᶜρ)
636+
@. ∂ᶜρq_tot_err_∂ᶜρ = zero(typeof(∂ᶜρq_tot_err_∂ᶜρ))
642637
@. ∂ᶜρq_tot_err_∂ᶜρq_tot +=
643638
dtγ * ᶜdiffusion_h_matrix DiagonalMatrixRow(1 / ᶜρ)
644639
end
@@ -654,8 +649,7 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
654649
ᶜdiffusion_h_matrix_scaled,
655650
ᶜdiffusion_h_matrix,
656651
)
657-
@. ∂ᶜρχ_err_∂ᶜρ =
658-
dtγ * ᶜtridiagonal_matrix_scalar DiagonalMatrixRow(-(ᶜχ) / ᶜρ)
652+
@. ∂ᶜρχ_err_∂ᶜρ = zero(typeof(∂ᶜρχ_err_∂ᶜρ))
659653
@. ∂ᶜρχ_err_∂ᶜρχ +=
660654
dtγ * ᶜtridiagonal_matrix_scalar DiagonalMatrixRow(1 / ᶜρ)
661655
end
@@ -695,9 +689,8 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
695689
matrix[@name(c.sgs⁰.ρatke), @name(c.sgs⁰.ρatke)]
696690
@. ∂ᶜρatke⁰_err_∂ᶜρ =
697691
dtγ * (
698-
ᶜdiffusion_u_matrix -
699692
DiagonalMatrixRow(ᶜdissipation_matrix_diagonal)
700-
) DiagonalMatrixRow(-(ᶜtke⁰) / ᶜρa⁰)
693+
) DiagonalMatrixRow(ᶜtke⁰ / ᶜρa⁰)
701694
@. ∂ᶜρatke⁰_err_∂ᶜρatke⁰ =
702695
dtγ * (
703696
(

0 commit comments

Comments
 (0)