From 66bc9aec47fdf71d020f863d0888f97c6347e346 Mon Sep 17 00:00:00 2001 From: Anna Jaruga Date: Fri, 5 Jul 2024 16:30:50 -0700 Subject: [PATCH] Add prescribed cloud droplet number concentration for rain autoconversion --- .../microphysics/microphysics_wrappers.jl | 7 +++++-- src/parameters/create_parameters.jl | 6 ++++++ toml/single_column_precipitation_test.toml | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/parameterized_tendencies/microphysics/microphysics_wrappers.jl b/src/parameterized_tendencies/microphysics/microphysics_wrappers.jl index 9c8a7642d0..5379909bc2 100644 --- a/src/parameterized_tendencies/microphysics/microphysics_wrappers.jl +++ b/src/parameterized_tendencies/microphysics/microphysics_wrappers.jl @@ -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 @@ -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) + Φ) diff --git a/src/parameters/create_parameters.jl b/src/parameters/create_parameters.jl index 2136717261..61dab684d5 100644 --- a/src/parameters/create_parameters.jl +++ b/src/parameters/create_parameters.jl @@ -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)") diff --git a/toml/single_column_precipitation_test.toml b/toml/single_column_precipitation_test.toml index 6d7a943ddb..7012136c83 100644 --- a/toml/single_column_precipitation_test.toml +++ b/toml/single_column_precipitation_test.toml @@ -1,2 +1,5 @@ [C_H] value = 0.0 + +[prescribed_cloud_droplet_number_concentration] +value = 0.0