@@ -512,19 +512,13 @@ function ᶜmixing_length(Y, p, property::Val{P} = Val{:master}()) where {P}
512512 z_sfc = Fields. level (Fields. coordinate_field (Y. f). z, Fields. half)
513513 ᶜdz = Fields. Δz_field (axes (Y. c))
514514
515- turbconv_model = p. atmos. turbconv_model
516- ᶜρa⁰ =
517- turbconv_model isa PrognosticEDMFX ?
518- (@. lazy (ρa⁰ (Y. c. ρ, Y. c. sgsʲs, turbconv_model))) : Y. c. ρ
519- ᶜtke⁰ = @. lazy (specific_tke (Y. c. ρ, Y. c. sgs⁰. ρatke, ᶜρa⁰, turbconv_model))
515+ ᶜtke⁰ = @. lazy (specific (Y. c. sgs⁰. ρatke, Y. c. ρ))
520516 sfc_tke = Fields. level (ᶜtke⁰, 1 )
521517
522518 ᶜprandtl_nvec = p. scratch. ᶜtemp_scalar_5
523519 @. ᶜprandtl_nvec =
524520 turbulent_prandtl_number (params, ᶜlinear_buoygrad, ᶜstrain_rate_norm)
525521
526- ᶜtke_exch = ᶜtke_exchange (Y, p)
527-
528522 ᶜmixing_length_tuple = @. lazy (
529523 mixing_length_lopez_gomez_2020 (
530524 params,
@@ -629,62 +623,6 @@ function turbulent_prandtl_number(params, ᶜN²_eff, ᶜstrain_rate_norm)
629623 return min (max (prandtl_nvec, eps_FT), Pr_max)
630624end
631625
632-
633- """
634- ᶜtke_exchange(Y, p)
635-
636- Calculates the turbulent kinetic energy (TKE) exchange tendency between the
637- environment and updrafts due to detrainment.
638-
639- Arguments:
640- - `Y`: The prognostic state vector.
641- - `p`: Cache
642-
643- Returns:
644- - The TKE exchange tendency term [m²/s³].
645- """
646- function ᶜtke_exchange (Y, p)
647- (; turbconv_model) = p. atmos
648- n = n_mass_flux_subdomains (turbconv_model)
649- ᶜρa⁰ =
650- p. atmos. turbconv_model isa PrognosticEDMFX ?
651- (@. lazy (ρa⁰ (Y. c. ρ, Y. c. sgsʲs, turbconv_model))) : Y. c. ρ
652- ᶜtke⁰ = @. lazy (specific_tke (Y. c. ρ, Y. c. sgs⁰. ρatke, ᶜρa⁰, turbconv_model))
653-
654- if p. atmos. turbconv_model isa PrognosticEDMFX
655- (; ᶜdetrʲs, ᶠu³⁰, ᶠu³ʲs) = p. precomputed
656- ᶜtke_exch = p. scratch. ᶜtemp_scalar_2
657- @. ᶜtke_exch = 0
658- for j in 1 : n
659- @. ᶜtke_exch +=
660- Y. c. sgsʲs.:($$ j). ρa * ᶜdetrʲs.:($$ j) / ᶜρa⁰ * (
661- 1 / 2 * norm_sqr (ᶜinterp (ᶠu³⁰) - ᶜinterp (ᶠu³ʲs.:($$ j))) -
662- ᶜtke⁰
663- )
664- end
665-
666- return ᶜtke_exch
667- elseif p. atmos. turbconv_model isa DiagnosticEDMFX
668- (; ᶜdetrʲs, ᶠu³⁰, ᶠu³ʲs, ᶜρaʲs) = p. precomputed
669- ᶜtke_exch = p. scratch. ᶜtemp_scalar_2
670- @. ᶜtke_exch = 0
671- for j in 1 : n
672- @. ᶜtke_exch +=
673- ᶜρaʲs.:($$ j) * ᶜdetrʲs.:($$ j) / ᶜρa⁰ * (
674- 1 / 2 * norm_sqr (ᶜinterp (ᶠu³⁰) - ᶜinterp (ᶠu³ʲs.:($$ j))) -
675- ᶜtke⁰
676- )
677- end
678-
679- return ᶜtke_exch
680- # ED only or none-EDMF model does not have updrafts (or detrainment),
681- # so tke exchange is 0
682- else
683- return 0
684- end
685-
686- end
687-
688626"""
689627 blend_scales(
690628 method::AbstractScaleBlending,
0 commit comments