Skip to content

Commit

Permalink
add a lower limit for pressure in radiation
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Oct 1, 2024
1 parent 1c94454 commit b6c1d8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/callbacks/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b6c1d8b

Please sign in to comment.