@@ -309,11 +309,54 @@ NVTX.@annotate function set_prognostic_edmf_precomputed_quantities_bottom_bc!(
309
309
end
310
310
311
311
"""
312
- set_prognostic_edmf_precomputed_quantities_closures !(Y, p, t)
312
+ set_prognostic_edmf_precomputed_quantities_implicit_closures !(Y, p, t)
313
313
314
- Updates the precomputed quantities stored in `p` for edmfx closures.
314
+ Updates the precomputed quantities stored in `p` for edmfx implicit closures.
315
315
"""
316
- NVTX. @annotate function set_prognostic_edmf_precomputed_quantities_closures! (
316
+ NVTX. @annotate function set_prognostic_edmf_precomputed_quantities_implicit_closures! (
317
+ Y,
318
+ p,
319
+ t,
320
+ )
321
+
322
+ (; moisture_model, turbconv_model) = p. atmos
323
+ @assert ! (moisture_model isa DryModel)
324
+
325
+ (; params) = p
326
+ n = n_mass_flux_subdomains (turbconv_model)
327
+
328
+ (; ᶠgradᵥ_ᶜΦ) = p. core
329
+ (; ᶠu₃⁰, ᶜρʲs, ᶠnh_pressure₃ʲs) = p. precomputed
330
+ ᶠlg = Fields. local_geometry_field (Y. f)
331
+
332
+ scale_height = CAP. R_d (params) * CAP. T_surf_ref (params) / CAP. grav (params)
333
+ for j in 1 : n
334
+ # nonhydrostatic pressure drag
335
+ for j in 1 : n
336
+ if p. atmos. edmfx_model. nh_pressure isa Val{true }
337
+ @. ᶠnh_pressure₃ʲs.:($$ j) = ᶠupdraft_nh_pressure (
338
+ params,
339
+ ᶠlg,
340
+ ᶠbuoyancy (ᶠinterp (Y. c. ρ), ᶠinterp (ᶜρʲs.:($$ j)), ᶠgradᵥ_ᶜΦ),
341
+ Y. f. sgsʲs.:($$ j). u₃,
342
+ ᶠu₃⁰,
343
+ scale_height,
344
+ )
345
+ else
346
+ @. ᶠnh_pressure₃ʲs.:($$ j) = C3 (0 )
347
+ end
348
+ end
349
+ end
350
+
351
+ return nothing
352
+ end
353
+
354
+ """
355
+ set_prognostic_edmf_precomputed_quantities_explicit_closures!(Y, p, t)
356
+
357
+ Updates the precomputed quantities stored in `p` for edmfx explicit closures.
358
+ """
359
+ NVTX. @annotate function set_prognostic_edmf_precomputed_quantities_explicit_closures! (
317
360
Y,
318
361
p,
319
362
t,
@@ -330,8 +373,7 @@ NVTX.@annotate function set_prognostic_edmf_precomputed_quantities_closures!(
330
373
FT = eltype (params)
331
374
n = n_mass_flux_subdomains (turbconv_model)
332
375
333
- (; ᶠgradᵥ_ᶜΦ) = p. core
334
- (; ᶜtke⁰, ᶜu, ᶜp, ᶜρa⁰, ᶠu³⁰, ᶠu₃⁰, ᶜts⁰, ᶜq_tot⁰) = p. precomputed
376
+ (; ᶜtke⁰, ᶜu, ᶜp, ᶜρa⁰, ᶠu³⁰, ᶜts⁰, ᶜq_tot⁰) = p. precomputed
335
377
(;
336
378
ᶜmixing_length_tuple,
337
379
ᶜmixing_length,
@@ -341,16 +383,7 @@ NVTX.@annotate function set_prognostic_edmf_precomputed_quantities_closures!(
341
383
ᶜK_h,
342
384
ρatke_flux,
343
385
) = p. precomputed
344
- (;
345
- ᶜuʲs,
346
- ᶜtsʲs,
347
- ᶠu³ʲs,
348
- ᶜρʲs,
349
- ᶜentrʲs,
350
- ᶜdetrʲs,
351
- ᶜturb_entrʲs,
352
- ᶠnh_pressure₃ʲs,
353
- ) = p. precomputed
386
+ (; ᶜuʲs, ᶜtsʲs, ᶠu³ʲs, ᶜρʲs, ᶜentrʲs, ᶜdetrʲs, ᶜturb_entrʲs) = p. precomputed
354
387
(; ustar, obukhov_length) = p. precomputed. sfc_conditions
355
388
356
389
ᶜz = Fields. coordinate_field (Y. c). z
@@ -428,24 +461,6 @@ NVTX.@annotate function set_prognostic_edmf_precomputed_quantities_closures!(
428
461
draft_area (Y. c. sgsʲs.:($$ j). ρa, ᶜρʲs.:($$ j)),
429
462
dt,
430
463
)
431
-
432
- # nonhydrostatic pressure drag
433
- scale_height =
434
- CAP. R_d (params) * CAP. T_surf_ref (params) / CAP. grav (params)
435
- for j in 1 : n
436
- if p. atmos. edmfx_model. nh_pressure isa Val{true }
437
- @. ᶠnh_pressure₃ʲs.:($$ j) = ᶠupdraft_nh_pressure (
438
- params,
439
- ᶠlg,
440
- ᶠbuoyancy (ᶠinterp (Y. c. ρ), ᶠinterp (ᶜρʲs.:($$ j)), ᶠgradᵥ_ᶜΦ),
441
- Y. f. sgsʲs.:($$ j). u₃,
442
- ᶠu₃⁰,
443
- scale_height,
444
- )
445
- else
446
- @. ᶠnh_pressure₃ʲs.:($$ j) = C3 (0 )
447
- end
448
- end
449
464
end
450
465
451
466
(; ᶜgradᵥ_θ_virt⁰, ᶜgradᵥ_q_tot⁰, ᶜgradᵥ_θ_liq_ice⁰) = p. precomputed
0 commit comments