diff --git a/src/callbacks/callbacks.jl b/src/callbacks/callbacks.jl index 428a6dc2b75..1f4dda9c8ec 100644 --- a/src/callbacks/callbacks.jl +++ b/src/callbacks/callbacks.jl @@ -152,9 +152,26 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator) radiation_mode isa RRTMGPI.AllSkyRadiationWithClearSkyDiagnostics if !radiation_mode.idealized_clouds if radiation_mode.cloud isa PrescribedCloudInRadiation - @. ᶜT = - min(max(p.radiation.prescribed_clouds_field.t, FT(T_min)), FT(T_max)) - @. ᶜp = Y.c.ρ * CAP.R_d(params) * ᶜT + ᶜz = Fields.coordinate_field(Y.c).z + @. ᶜT = ifelse( + ᶜz < 20000, + min( + max(p.radiation.prescribed_clouds_field.t, FT(T_min)), + FT(T_max), + ), + ᶜT, + ) + @. ᶜp = + Y.c.ρ * + TD.gas_constant_air( + thermo_params, + TD.PhasePartition( + p.radiation.prescribed_clouds_field.q, + p.radiation.prescribed_clouds_field.clwc, + p.radiation.prescribed_clouds_field.ciwc, + ), + ) * + ᶜT @. ᶜvmr_h2o = TD.vol_vapor_mixing_ratio( thermo_params, TD.PhasePartition(