Skip to content

Commit

Permalink
Add prescribed cloud droplet number concentration for rain autoconver…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
trontrytel committed Jul 9, 2024
1 parent 98bac83 commit 66bc9ae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import Thermodynamics as TD
import CloudMicrophysics.Microphysics0M as CM0
import CloudMicrophysics.Microphysics1M as CM1
import CloudMicrophysics.Microphysics2M as CM2
import CloudMicrophysics.MicrophysicsNonEq as CMNe
import CloudMicrophysics.Parameters as CMP

Expand Down Expand Up @@ -172,10 +173,12 @@ function compute_precipitation_sources!(

#! format: off
# rain autoconversion: q_liq -> q_rain
@. Sᵖ = min(
limit(qₗ(thp, ts), dt, 5),
@. Sᵖ = ifelse(
mp.Ndp <= 0,
CM1.conv_q_liq_to_q_rai(mp.pr.acnv1M, qₗ(thp, ts), true),
CM2.conv_q_liq_to_q_rai(mp.var, qₗ(thp, ts), ρ, mp.Ndp),
)
@. Sᵖ = min(limit(qₗ(thp, ts), dt, 5), Sᵖ)
@. Sqₜᵖ -= Sᵖ
@. Sqᵣᵖ += Sᵖ
@. Seₜᵖ -= Sᵖ * (Iₗ(thp, ts) + Φ)
Expand Down
6 changes: 6 additions & 0 deletions src/parameters/create_parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ function create_parameter_set(config::AtmosConfig)
ce = CM.Parameters.CollisionEff(toml_dict),
tv = CM.Parameters.Blk1MVelType(toml_dict),
aps = CM.Parameters.AirProperties(toml_dict),
var = CM.Parameters.VarTimescaleAcnv(toml_dict),
Ndp = CP.get_parameter_values(
toml_dict,
"prescribed_cloud_droplet_number_concentration",
"ClimaAtmos",
).prescribed_cloud_droplet_number_concentration,
)
else
error("Invalid precip_model $(precip_model)")
Expand Down
3 changes: 3 additions & 0 deletions toml/single_column_precipitation_test.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[C_H]
value = 0.0

[prescribed_cloud_droplet_number_concentration]
value = 0.0

0 comments on commit 66bc9ae

Please sign in to comment.