From b6c1d8b57114d4d1d1bffa0326f2422e35fa77fa Mon Sep 17 00:00:00 2001 From: Zhaoyi Shen <11598433+szy21@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:46:18 -0700 Subject: [PATCH] add a lower limit for pressure in radiation --- src/callbacks/callbacks.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/callbacks/callbacks.jl b/src/callbacks/callbacks.jl index f3be69cf03f..a5869a69a9a 100644 --- a/src/callbacks/callbacks.jl +++ b/src/callbacks/callbacks.jl @@ -89,7 +89,10 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator) ᶜp = Fields.array2field(rrtmgp_model.center_pressure, axes(Y.c)) ᶜT = Fields.array2field(rrtmgp_model.center_temperature, axes(Y.c)) - @. ᶜp = TD.air_pressure(thermo_params, ᶜts) + # Here we multiply p_min by a small number to avoid exactly same + # pressure in the top layer and in the extra layer added in rrtmgp + p_min = RRTMGPI.get_p_min(rrtmgp_model) + @. ᶜp = max(TD.air_pressure(thermo_params, ᶜts), p_min * FT(1.01)) # TODO: move this to RRTMGP @. ᶜT = min(max(TD.air_temperature(thermo_params, ᶜts), FT(T_min)), FT(T_max))