Conversation
4a72738 to
9344f69
Compare
| ), | ||
| )) | ||
|
|
||
| ᶜinv_ρ̂ = p.scratch.ᶜtemp_scalar_6 |
There was a problem hiding this comment.
You can probably use ᶜtemp_scalar_4 here and ᶜtemp_scalar_5 for vtt?
| ᶜw = MatrixFields.get_field(p.precomputed, w_name) | ||
| vtt = @.lazy( | ||
| vtt = p.scratch.ᶜtemp_scalar_2 | ||
| @. p.scratch.ᶜtemp_scalar_6 = specific(ᶜρq, Y.c.ρ) |
There was a problem hiding this comment.
Maybe more readable if you do something like:
ᶠρ = p.scratch.ᶠtemp_scalar
@. p.scratch.ᶠtemp_scalar = ᶠinterp(Y.c.ρ * ᶜJ) / ᶠJ
ᶜq = p.scratch.ᶜtemp_scalar_2
@. ᶜq = specific(ᶜρq, Y.c.ρ)
and use those variables?
| @. p.scratch.ᶜtemp_scalar_6 = | ||
| -(ᶜw) * p.scratch.ᶜtemp_scalar_6 * (e_int_func(thp, ᶜT) + ᶜΦ + $(Kin(ᶜw, ᶜu))) | ||
| @. Yₜ.c.ρe_tot -= ᶜprecipdivᵥ( | ||
| ᶠinterp(Y.c.ρ * ᶜJ) / ᶠJ * ᶠright_bias( | ||
| Geometry.WVector(-(ᶜw)) * specific(ᶜρq, Y.c.ρ) * | ||
| (e_int_func(thp, ᶜT) + ᶜΦ + $(Kin(ᶜw, ᶜu))), | ||
| p.scratch.ᶠtemp_scalar * ᶠright_bias( | ||
| Geometry.WVector(-(ᶜw)p.scratch.ᶜtemp_scalar_6), |
There was a problem hiding this comment.
Good catch, that is a typo
9344f69 to
8af9525
Compare
szy21
left a comment
There was a problem hiding this comment.
Thanks, this looks fine to me. Maybe it would be good if @sajjadazimi takes a look as well.
sajjadazimi
left a comment
There was a problem hiding this comment.
Thank you. I just found a minor issue in water advection.
| (e_int_func(thp, ᶜT⁰) - e_int_func(thp, ᶜT) - $(Kin(ᶜw, ᶜu))), | ||
| p.scratch.ᶜtemp_scalar_2, |
There was a problem hiding this comment.
This is not equal to temp_scalar_2. Here instead of T^j we should use T^0
There was a problem hiding this comment.
our regression test on 1M is useless
There was a problem hiding this comment.
😳 good catch, I'll fix this and double check the other changes
8af9525 to
5c50cf5
Compare
5c50cf5 to
fbd84b9
Compare
Purpose
I took a look at a prognostic EDMF simulation with 1M microphysics and noticed that there are some easy performance improvements in the advection code (at the cost of readability)
To-do
Content
update_jacobianᶠwinterp_matrix(ᶜJ * ᶜρ) ⋅ DiagonalMatrixRow(g³ʰ(ᶜgⁱʲ))inupdate_jacobianupdraft_sedimentationto an in-place eager computationWith the following config options, this PR improves SYPD from 0.11 to 0.124