Skip to content

Commit

Permalink
prescribe temperature below 20km
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Jan 17, 2025
1 parent bd597d5 commit c0afc7e
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/callbacks/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c0afc7e

Please sign in to comment.