@@ -882,6 +882,93 @@ add_diagnostic_variable!(
882882 compute! = compute_tke!,
883883)
884884
885+ # ##
886+ # Environment Wall Constrained Mixing Length (3d)
887+ # ##
888+ compute_lmixw! (out, state, cache, time) =
889+ compute_lmixw! (out, state, cache, time, cache. atmos. turbconv_model)
890+ compute_lmixw! (_, _, _, _, turbconv_model:: T ) where {T} =
891+ error_diagnostic_variable (" lmixw" , turbconv_model)
892+
893+ function compute_lmixw! (
894+ out,
895+ state,
896+ cache,
897+ time,
898+ turbconv_model:: Union{PrognosticEDMFX, DiagnosticEDMFX} ,
899+ )
900+ if isnothing (out)
901+ return copy (cache. precomputed. ᶜmixing_length_tuple. wall)
902+ else
903+ out .= cache. precomputed. ᶜmixing_length_tuple. wall
904+ end
905+ end
906+
907+ add_diagnostic_variable! (
908+ short_name = " lmixw" ,
909+ long_name = " Environment Wall Constrained Mixing Length" ,
910+ units = " m" ,
911+ compute! = compute_lmixw!,
912+ )
913+
914+ # ##
915+ # Environment TKE Balanced Mixing Length (3d)
916+ # ##
917+ compute_lmixtke! (out, state, cache, time) =
918+ compute_lmixtke! (out, state, cache, time, cache. atmos. turbconv_model)
919+ compute_lmixtke! (_, _, _, _, turbconv_model:: T ) where {T} =
920+ error_diagnostic_variable (" lmixtke" , turbconv_model)
921+
922+ function compute_lmixtke! (
923+ out,
924+ state,
925+ cache,
926+ time,
927+ turbconv_model:: Union{PrognosticEDMFX, DiagnosticEDMFX} ,
928+ )
929+ if isnothing (out)
930+ return copy (cache. precomputed. ᶜmixing_length_tuple. tke)
931+ else
932+ out .= cache. precomputed. ᶜmixing_length_tuple. tke
933+ end
934+ end
935+
936+ add_diagnostic_variable! (
937+ short_name = " lmixtke" ,
938+ long_name = " Environment TKE Balanced Mixing Length" ,
939+ units = " m" ,
940+ compute! = compute_lmixtke!,
941+ )
942+
943+ # ##
944+ # Environment Stability Mixing Length (3d)
945+ # ##
946+ compute_lmixb! (out, state, cache, time) =
947+ compute_lmixb! (out, state, cache, time, cache. atmos. turbconv_model)
948+ compute_lmixb! (_, _, _, _, turbconv_model:: T ) where {T} =
949+ error_diagnostic_variable (" lmixb" , turbconv_model)
950+
951+ function compute_lmixb! (
952+ out,
953+ state,
954+ cache,
955+ time,
956+ turbconv_model:: Union{PrognosticEDMFX, DiagnosticEDMFX} ,
957+ )
958+ if isnothing (out)
959+ return copy (cache. precomputed. ᶜmixing_length_tuple. buoy)
960+ else
961+ out .= cache. precomputed. ᶜmixing_length_tuple. buoy
962+ end
963+ end
964+
965+ add_diagnostic_variable! (
966+ short_name = " lmixb" ,
967+ long_name = " Environment Static Stability Mixing Length" ,
968+ units = " m" ,
969+ compute! = compute_lmixb!,
970+ )
971+
885972# ##
886973# Diffusivity of heat (3d)
887974# ##
0 commit comments