Skip to content

Commit f927ae3

Browse files
authored
Merge pull request #3745 from CliMA/zs/edmf_buoyancy_jac
remove derivative with respect to grid mean rho in edmf
2 parents 683f35b + 4e5f524 commit f927ae3

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
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-
228
1+
229
22

33
# **README**
44
#
@@ -21,6 +21,9 @@
2121

2222
#=
2323
24+
229
25+
remove derivatives with respect to grid mean rho in edmf implicit solver
26+
2427
228
2528
- Only treat the drag term in edmf pressure closure implicitly
2629

src/prognostic_equations/implicit/implicit_solver.jl

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -287,16 +287,12 @@ function ImplicitEquationJacobian(
287287
name -> (name, name) => similar(Y.c, TridiagonalRow),
288288
available_sgs_scalar_names,
289289
)...,
290-
(@name(c.sgsʲs.:(1).mse), @name(c.ρ)) =>
291-
similar(Y.c, DiagonalRow),
292290
(@name(c.sgsʲs.:(1).mse), @name(c.sgsʲs.:(1).q_tot)) =>
293291
similar(Y.c, DiagonalRow),
294292
(@name(c.sgsʲs.:(1).ρa), @name(c.sgsʲs.:(1).q_tot)) =>
295293
similar(Y.c, TridiagonalRow),
296294
(@name(c.sgsʲs.:(1).ρa), @name(c.sgsʲs.:(1).mse)) =>
297295
similar(Y.c, TridiagonalRow),
298-
(@name(f.sgsʲs.:(1).u₃), @name(c.ρ)) =>
299-
similar(Y.f, BidiagonalRow_C3),
300296
(@name(f.sgsʲs.:(1).u₃), @name(c.sgsʲs.:(1).q_tot)) =>
301297
similar(Y.f, BidiagonalRow_C3),
302298
(@name(f.sgsʲs.:(1).u₃), @name(c.sgsʲs.:(1).mse)) =>
@@ -918,13 +914,7 @@ function update_implicit_equation_jacobian!(A, Y, p, dtγ, t)
918914
ᶜkappa_mʲ / ((ᶜkappa_mʲ + 1) * ᶜp) * ∂e_int_∂q_tot,
919915
)
920916
)
921-
∂ᶜmseʲ_err_∂ᶜρ = matrix[@name(c.sgsʲs.:(1).mse), @name(c.ρ)]
922-
@. ∂ᶜmseʲ_err_∂ᶜρ =
923-
dtγ * (
924-
-DiagonalMatrixRow(
925-
adjoint(ᶜinterp(ᶠu³ʲs.:(1))) * ᶜgradᵥ_ᶠΦ / ᶜρʲs.:(1),
926-
)
927-
)
917+
928918
∂ᶜmseʲ_err_∂ᶜmseʲ =
929919
matrix[@name(c.sgsʲs.:(1).mse), @name(c.sgsʲs.:(1).mse)]
930920
@. ∂ᶜmseʲ_err_∂ᶜmseʲ =
@@ -997,10 +987,6 @@ function update_implicit_equation_jacobian!(A, Y, p, dtγ, t)
997987
ᶠset_upwind_matrix_bcs(ᶠupwind_matrix(ᶠu³ʲs.:(1)))
998988
DiagonalMatrixRow(1 / ᶜρʲs.:(1)) - (I,)
999989

1000-
∂ᶠu₃ʲ_err_∂ᶜρ = matrix[@name(f.sgsʲs.:(1).u₃), @name(c.ρ)]
1001-
@. ∂ᶠu₃ʲ_err_∂ᶜρ =
1002-
dtγ * DiagonalMatrixRow(ᶠgradᵥ_ᶜΦ / ᶠinterp(ᶜρʲs.:(1)))
1003-
ᶠinterp_matrix()
1004990
∂ᶠu₃ʲ_err_∂ᶜq_totʲ =
1005991
matrix[@name(f.sgsʲs.:(1).u₃), @name(c.sgsʲs.:(1).q_tot)]
1006992
@. ∂ᶠu₃ʲ_err_∂ᶜq_totʲ =

0 commit comments

Comments
 (0)