@@ -240,12 +240,10 @@ end
240
240
241
241
# This is used to set the grid-scale velocity quantities ᶜu, ᶠu³, ᶜK based on
242
242
# ᶠu₃, and it is also used to set the SGS quantities based on ᶠu₃⁰ and ᶠu₃ʲ.
243
- function set_velocity_quantities! (ᶜu, ᶠu³, ᶜK, ᶠu₃, ᶜuₕ, ᶠuₕ³)
244
- @. ᶜu = C123 (ᶜuₕ) + ᶜinterp (C123 (ᶠu₃))
245
- @. ᶠu³ = ᶠuₕ³ + CT3 (ᶠu₃)
246
- bc_kinetic = compute_kinetic (ᶜuₕ, ᶠu₃)
247
- @. ᶜK = bc_kinetic
248
- return nothing
243
+ compute_ᶜu (ᶜuₕ, ᶠu₃) = @lazy @. C123 (ᶜuₕ) + ᶜinterp (C123 (ᶠu₃))
244
+ function compute_ᶠu³ (ᶜuₕ, ᶜρ, ᶠu₃)
245
+ ᶠuₕ³ = compute_ᶠuₕ³ (ᶜuₕ, ᶜρ)
246
+ return @lazy @. ᶠuₕ³ + CT3 (ᶠu₃)
249
247
end
250
248
251
249
function set_sgs_ᶠu₃! (w_function, ᶠu₃, Y, turbconv_model)
@@ -385,6 +383,7 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t)
385
383
@. ᶜspecific = specific_gs (Y. c)
386
384
ᶜρ = Y. c. ρ
387
385
ᶜuₕ = Y. c. uₕ
386
+ ᶠu₃ = Y. f. u₃
388
387
bc_ᶠuₕ³ = compute_ᶠuₕ³ (ᶜuₕ, ᶜρ)
389
388
@. ᶠuₕ³ = bc_ᶠuₕ³
390
389
@@ -393,7 +392,13 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t)
393
392
set_velocity_at_surface! (Y, ᶠuₕ³, turbconv_model)
394
393
set_velocity_at_top! (Y, turbconv_model)
395
394
396
- set_velocity_quantities! (ᶜu, ᶠu³, ᶜK, Y. f. u₃, Y. c. uₕ, ᶠuₕ³)
395
+ bc_ᶠu³ = compute_ᶠu³ (ᶜuₕ, ᶜρ, ᶠu₃)
396
+ bc_ᶜu = compute_ᶜu (ᶜuₕ, ᶠu₃)
397
+ bc_ᶜK = compute_kinetic (ᶜuₕ, ᶠu₃)
398
+ @. ᶠu³ = bc_ᶠu³
399
+ @. ᶜu = bc_ᶜu
400
+ @. ᶜK = bc_ᶜK
401
+
397
402
if n > 0
398
403
# TODO : In the following increments to ᶜK, we actually need to add
399
404
# quantities of the form ᶜρaχ⁰ / ᶜρ⁰ and ᶜρaχʲ / ᶜρʲ to ᶜK, rather than
@@ -496,8 +501,8 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t)
496
501
end
497
502
498
503
if turbconv_model isa PrognosticEDMFX
499
- set_prognostic_edmf_precomputed_quantities_draft_and_bc! (Y, p, ᶠuₕ³, t)
500
- set_prognostic_edmf_precomputed_quantities_environment! (Y, p, ᶠuₕ³, t)
504
+ set_prognostic_edmf_precomputed_quantities_draft_and_bc! (Y, p, t)
505
+ set_prognostic_edmf_precomputed_quantities_environment! (Y, p, t)
501
506
set_prognostic_edmf_precomputed_quantities_closures! (Y, p, t)
502
507
set_prognostic_edmf_precomputed_quantities_precipitation! (
503
508
Y,
0 commit comments