@@ -447,13 +447,8 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
447447 # minus ∂e_int_∂q_tot
448448 ∂e_int_∂q_tot = T_0 * (Δcv_v - R_d) - e_int_v0
449449 thermo_params = CAP. thermodynamics_params (params)
450- ᶜh_tot = @. lazy (
451- TD. total_specific_enthalpy (
452- thermo_params,
453- ᶜts,
454- specific (Y. c. ρe_tot, Y. c. ρ),
455- ),
456- )
450+ ᶜe_tot = @. lazy (specific (Y. c. ρe_tot, Y. c. ρ))
451+ ᶜh_tot = @. lazy (TD. total_specific_enthalpy (thermo_params, ᶜts, ᶜe_tot))
457452
458453 ᶜρ = Y. c. ρ
459454 ᶜuₕ = Y. c. uₕ
@@ -502,17 +497,7 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
502497
503498 MatrixFields. unrolled_foreach (tracer_info) do ρχ_name
504499 MatrixFields. has_field (Y, ρχ_name) || return
505- ᶜχ = if ρχ_name === @name (c. ρe_tot)
506- @. lazy (
507- TD. total_specific_enthalpy (
508- thermo_params,
509- ᶜts,
510- specific (Y. c. ρe_tot, Y. c. ρ),
511- ),
512- )
513- else
514- @. lazy (specific (Y. c. ρq_tot, Y. c. ρ))
515- end
500+ ᶜχ = ρχ_name === @name (c. ρe_tot) ? ᶜh_tot : (@. lazy (specific (Y. c. ρq_tot, Y. c. ρ)))
516501
517502 if use_derivative (topography_flag)
518503 ∂ᶜρχ_err_∂ᶜuₕ = matrix[ρχ_name, @name (c. uₕ)]
@@ -545,7 +530,6 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
545530 ᶠinterp_matrix ()
546531 )
547532 @. ∂ᶠu₃_err_∂ᶜρe_tot = dtγ * ᶠp_grad_matrix ⋅ DiagonalMatrixRow (ᶜkappa_m)
548- ᶜe_tot = @. lazy (specific (Y. c. ρe_tot, Y. c. ρ))
549533
550534 if MatrixFields. has_field (Y, @name (c. ρq_tot))
551535 ᶜq_tot = @. lazy (specific (Y. c. ρq_tot, Y. c. ρ))
0 commit comments