@@ -33,6 +33,17 @@ NVTX.@annotate function set_cloud_fraction!(
3333 (; ᶜts, ᶜmixing_length, ᶜcloud_fraction) = p. precomputed
3434 thermo_params = CAP. thermodynamics_params (params)
3535 if isnothing (turbconv_model)
36+ if p. atmos. call_cloud_diagnostics_per_stage isa
37+ CallCloudDiagnosticsPerStage
38+ (; ᶜgradᵥ_θ_virt, ᶜgradᵥ_q_tot, ᶜgradᵥ_θ_liq_ice) = p. precomputed
39+ thermo_params = CAP. thermodynamics_params (p. params)
40+ @. ᶜgradᵥ_θ_virt =
41+ ᶜgradᵥ (ᶠinterp (TD. virtual_pottemp (thermo_params, ᶜts)))
42+ @. ᶜgradᵥ_q_tot =
43+ ᶜgradᵥ (ᶠinterp (TD. total_specific_humidity (thermo_params, ᶜts)))
44+ @. ᶜgradᵥ_θ_liq_ice =
45+ ᶜgradᵥ (ᶠinterp (TD. liquid_ice_pottemp (thermo_params, ᶜts)))
46+ end
3647 compute_gm_mixing_length! (ᶜmixing_length, Y, p)
3748 end
3849 @. ᶜcloud_fraction = ifelse (TD. has_condensate (thermo_params, ᶜts), 1 , 0 )
@@ -50,6 +61,17 @@ NVTX.@annotate function set_cloud_fraction!(
5061 (; ᶜts, ᶜp, ᶜmixing_length, ᶜcloud_fraction) = p. precomputed
5162 (; turbconv_model) = p. atmos
5263 if isnothing (turbconv_model)
64+ if p. atmos. call_cloud_diagnostics_per_stage isa
65+ CallCloudDiagnosticsPerStage
66+ (; ᶜgradᵥ_θ_virt, ᶜgradᵥ_q_tot, ᶜgradᵥ_θ_liq_ice) = p. precomputed
67+ thermo_params = CAP. thermodynamics_params (p. params)
68+ @. ᶜgradᵥ_θ_virt =
69+ ᶜgradᵥ (ᶠinterp (TD. virtual_pottemp (thermo_params, ᶜts)))
70+ @. ᶜgradᵥ_q_tot =
71+ ᶜgradᵥ (ᶠinterp (TD. total_specific_humidity (thermo_params, ᶜts)))
72+ @. ᶜgradᵥ_θ_liq_ice =
73+ ᶜgradᵥ (ᶠinterp (TD. liquid_ice_pottemp (thermo_params, ᶜts)))
74+ end
5375 compute_gm_mixing_length! (ᶜmixing_length, Y, p)
5476 end
5577
0 commit comments