Skip to content

Commit

Permalink
prescribe hourly cloud and water vapor
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Jan 3, 2025
1 parent 5206985 commit a186648
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/callbacks/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator)
end

# assume that ᶜq_vap = ᶜq_tot when computing ᶜvmr_h2o
@. ᶜvmr_h2o = TD.shum_to_mixing_ratio(ᶜq_tot, ᶜq_tot)
@. ᶜvmr_h2o = TD.vol_vapor_mixing_ratio(
thermo_params,
TD.PhasePartition(ᶜq_tot),
)
else
@. ᶜvmr_h2o = TD.vol_vapor_mixing_ratio(
thermo_params,
Expand All @@ -148,6 +151,16 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator)
if radiation_mode isa RRTMGPI.AllSkyRadiation ||
radiation_mode isa RRTMGPI.AllSkyRadiationWithClearSkyDiagnostics
if !radiation_mode.idealized_clouds
if radiation_mode.cloud isa PrescribedCloudInRadiation
@. ᶜvmr_h2o = TD.vol_vapor_mixing_ratio(
thermo_params,
TD.PhasePartition(
p.radiation.prescribed_clouds_field.q,
p.radiation.prescribed_clouds_field.clwc,
p.radiation.prescribed_clouds_field.ciwc,
),
)
end
ᶜΔz = Fields.Δz_field(Y.c)
ᶜlwp = Fields.array2field(
rrtmgp_model.center_cloud_liquid_water_path,
Expand Down
2 changes: 1 addition & 1 deletion src/parameterized_tendencies/radiation/radiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ end
get_cloud_cache(_, _, _) = (;)
function get_cloud_cache(::PrescribedCloudInRadiation, Y, start_date)
target_space = axes(Y.c)
prescribed_cloud_names = ("cc", "clwc", "ciwc")
prescribed_cloud_names = ("cc", "clwc", "ciwc", "q")
prescribed_cloud_names_as_symbols = Symbol.(prescribed_cloud_names)
extrapolation_bc = (Intp.Periodic(), Intp.Flat(), Intp.Flat())
timevaryinginputs = [
Expand Down

0 comments on commit a186648

Please sign in to comment.