Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a lower limit for pressure in radiation #3350

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/callbacks/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ 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)
# When add_isothermal_boundary_layer is true, we add a layer in rrtmgp and set the
# pressure to half of the sum of top level pressure and rrtmgp minimum pressure.
# Here we limit the pressure to p_min multiplied by a small number to prevent
# pressure from decreasing or being constant with height.
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))
Expand Down
Loading