Skip to content

Commit

Permalink
Try to fix captured variable in radiation tendency
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Sep 16, 2024
1 parent 6253373 commit 459b82e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/parameterized_tendencies/radiation/radiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,14 @@ function radiation_tendency!(Yₜ, Y, p, t, radiation_mode::RadiationDYCOMS)

# Find the values of (z, ρ, q_tot) at the q_tot = 0.008 isoline, i.e., at
# the level whose value of q_tot is closest to 0.008.
Operators.column_reduce!(
(nt1, nt2) ->
abs(nt1.q_tot - FT(0.008)) < abs(nt2.q_tot - FT(0.008)) ? nt1 : nt2,
isoline_z_ρ_q,
Base.broadcasted(NT tuple, ᶜz, Y.c.ρ, ᶜspecific.q_tot),
)
let FT=FT
Operators.column_reduce!(
(nt1, nt2) ->
abs(nt1.q_tot - FT(0.008)) < abs(nt2.q_tot - FT(0.008)) ? nt1 : nt2,
isoline_z_ρ_q,
Base.broadcasted(NT tuple, ᶜz, Y.c.ρ, ᶜspecific.q_tot),
)
end

zi = isoline_z_ρ_q.z
ρi = isoline_z_ρ_q.ρ
Expand Down

0 comments on commit 459b82e

Please sign in to comment.