Skip to content

Commit 192c433

Browse files
committed
no more ts but gpu error
1 parent c19a0c3 commit 192c433

File tree

4 files changed

+7
-21
lines changed

4 files changed

+7
-21
lines changed

src/cache/precomputed_quantities.jl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ function implicit_precomputed_quantities(Y, atmos)
4343
ᶠu³ = similar(Y.f, CT3{FT}),
4444
ᶠu = similar(Y.f, CT123{FT}),
4545
ᶜK = similar(Y.c, FT),
46-
ᶜts = similar(Y.c, TST),
4746
ᶜT = similar(Y.c, FT),
4847
ᶜq_tot_safe = similar(Y.c, FT),
4948
ᶜq_liq_rai = similar(Y.c, FT),
@@ -439,13 +438,6 @@ function thermo_vars(::NonEquilMoistModel, ::Any, ᶜY, K, Φ)
439438
return (; e_int, q_pt = TD.PhasePartition(q_pt_args...))
440439
end
441440

442-
ts_gs(thermo_params, moisture_model, microphysics_model, ᶜY, K, Φ, ρ) =
443-
thermo_state(
444-
thermo_params;
445-
thermo_vars(moisture_model, microphysics_model, ᶜY, K, Φ)...,
446-
ρ,
447-
)
448-
449441
"""
450442
T_gs(thermo_params, moisture_model, microphysics_model, ᶜY, K, Φ, ρ)
451443
@@ -656,7 +648,7 @@ quantities are updated.
656648
NVTX.@annotate function set_implicit_precomputed_quantities!(Y, p, t)
657649
(; turbconv_model, moisture_model, microphysics_model) = p.atmos
658650
(; ᶜΦ) = p.core
659-
(; ᶜu, ᶠu³, ᶠu, ᶜK, ᶜts, ᶜT, ᶜq_tot_safe, ᶜq_liq_rai, ᶜq_ice_sno, ᶜh_tot, ᶜp) = p.precomputed
651+
(; ᶜu, ᶠu³, ᶠu, ᶜK, ᶜT, ᶜq_tot_safe, ᶜq_liq_rai, ᶜq_ice_sno, ᶜh_tot, ᶜp) = p.precomputed
660652
ᶠuₕ³ = p.scratch.ᶠtemp_CT3
661653
n = n_mass_flux_subdomains(turbconv_model)
662654
thermo_params = CAP.thermodynamics_params(p.params)
@@ -688,7 +680,6 @@ NVTX.@annotate function set_implicit_precomputed_quantities!(Y, p, t)
688680
# @. ᶜK += Y.c.ρtke / Y.c.ρ
689681
# TODO: We should think more about these increments before we use them.
690682
end
691-
@. ᶜts = ts_gs(thermo_args..., Y.c, ᶜK, ᶜΦ, Y.c.ρ)
692683
@. ᶜT = T_gs(thermo_args..., Y.c, ᶜK, ᶜΦ, Y.c.ρ)
693684
@. ᶜq_tot_safe = q_tot_safe_gs(thermo_args..., Y.c, ᶜK, ᶜΦ, Y.c.ρ)
694685
@. ᶜq_liq_rai = q_liq_rai_gs(thermo_args..., Y.c, ᶜK, ᶜΦ, Y.c.ρ)

src/prognostic_equations/forcing/external_forcing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ function external_forcing_tendency!(
318318
# horizontal advection, vertical fluctuation, nudging, subsidence (need to add),
319319
(; params) = p
320320
thermo_params = CAP.thermodynamics_params(params)
321-
(; ᶜts, ᶜT) = p.precomputed
321+
(; ᶜT) = p.precomputed
322322
(;
323323
ᶜdTdt_fluc,
324324
ᶜdqtdt_fluc,
@@ -560,7 +560,7 @@ function external_forcing_tendency!(Yₜ, Y, p, t, ::ISDACForcing)
560560
FT = Spaces.undertype(axes(Y.c))
561561
(; params) = p
562562
thermo_params = CAP.thermodynamics_params(params)
563-
(; ᶜts, ᶜp, ᶜT) = p.precomputed
563+
(; ᶜp, ᶜT) = p.precomputed
564564

565565
ᶜinv_τ_scalar = APL.ISDAC_inv_τ_scalar(FT) # s⁻¹
566566
ᶜinv_τ_wind = APL.ISDAC_inv_τ_wind(FT) # s⁻¹

src/prognostic_equations/implicit/manual_sparse_jacobian.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
428428
(; matrix) = cache
429429
(; params) = p
430430
(; ᶜΦ, ᶠgradᵥ_ᶜΦ) = p.core
431-
(; ᶠu³, ᶜK, ᶜts, ᶜp, ᶜT) = p.precomputed
431+
(; ᶜu, ᶠu³, ᶜK, ᶜp, ᶜT) = p.precomputed
432+
(; ᶜq_tot_safe, ᶜq_liq_rai, ᶜq_ice_sno, ᶜh_tot) = p.precomputed
432433
(;
433434
∂ᶜK_∂ᶜuₕ,
434435
∂ᶜK_∂ᶠu₃,
@@ -466,11 +467,7 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
466467
Δcv_i = FT(CAP.cp_i(params) - CAP.cv_v(params))
467468
e_int_v0 = FT(CAP.e_int_v0(params))
468469
e_int_s0 = FT(CAP.e_int_i0(params)) + e_int_v0
469-
# This term appears a few times in the Jacobian, and is technically
470-
# minus ∂e_int_∂q_tot
471-
∂e_int_∂q_tot = T_0 * (Δcv_v - R_d) - e_int_v0
472470
thermo_params = CAP.thermodynamics_params(params)
473-
(; ᶜq_tot_safe, ᶜq_liq_rai, ᶜq_ice_sno, ᶜh_tot) = p.precomputed
474471

475472
ᶜρ = Y.c.ρ
476473
ᶜuₕ = Y.c.uₕ
@@ -483,7 +480,6 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
483480
zmax = z_max(axes(Y.f))
484481

485482
ᶜkappa_m = p.scratch.ᶜtemp_scalar
486-
(; ᶜq_tot_safe, ᶜq_liq_rai, ᶜq_ice_sno) = p.precomputed
487483
@. ᶜkappa_m =
488484
TD.gas_constant_air(thermo_params, ᶜq_tot_safe, ᶜq_liq_rai, ᶜq_ice_sno) /
489485
TD.cv_m(thermo_params, ᶜq_tot_safe, ᶜq_liq_rai, ᶜq_ice_sno)
@@ -660,8 +656,7 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
660656
p.scratch.ᶜbidiagonal_adjoint_matrix_c3
661657
p.scratch.ᶠband_matrix_wvec
662658
DiagonalMatrixRow(
663-
e_int_func(thermo_params, p.precomputed.ᶜts) + ᶜΦ +
664-
$(Kin(ᶜwₚ, p.precomputed.ᶜu)),
659+
e_int_func(thermo_params, ᶜT) + ᶜΦ + $(Kin(ᶜwₚ, ᶜu)),
665660
)
666661
end
667662
end

src/prognostic_equations/remaining_tendency.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ NVTX.@annotate function additional_tendency!(Yₜ, Y, p, t)
144144
(; ls_adv, scm_coriolis) = p.atmos
145145
(; params) = p
146146
thermo_params = CAP.thermodynamics_params(params)
147-
(; ᶜp, sfc_conditions, ᶜK, ᶜts, ᶜT, ᶜh_tot, ᶜq_tot_safe, ᶜq_liq_rai, ᶜq_ice_sno) = p.precomputed
147+
(; ᶜp, sfc_conditions, ᶜK, ᶜT, ᶜh_tot, ᶜq_tot_safe, ᶜq_liq_rai, ᶜq_ice_sno) = p.precomputed
148148

149149
vst_uₕ = viscous_sponge_tendency_uₕ(ᶜuₕ, viscous_sponge)
150150
vst_u₃ = viscous_sponge_tendency_u₃(ᶠu₃, viscous_sponge)

0 commit comments

Comments
 (0)