Skip to content

Commit

Permalink
add autoconversion radius to namelist
Browse files Browse the repository at this point in the history
  • Loading branch information
mahf708 committed Oct 11, 2024
1 parent 7c859f0 commit 540f8e0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/eamxx/cime_config/namelist_defaults_scream.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ be lost if SCREAM_HACK_XML is not enabled.
<p3_autoconversion_prefactor type="real" doc="Autoconversion linear prefactor in P3">1350.0</p3_autoconversion_prefactor>
<p3_autoconversion_qc_exponent type="real" doc="Autoconversion qc exponent in P3">2.47</p3_autoconversion_qc_exponent>
<p3_autoconversion_nc_exponent type="real" doc="Autoconversion nc exponent in P3">1.79</p3_autoconversion_nc_exponent>
<p3_autoconversion_radius type="real" doc="Autoconversion droplet radius (meter) in P3">25.0e-6</p3_autoconversion_radius>
<p3_accretion_prefactor type="real" doc="Accretion linear prefactor in P3">67.0</p3_accretion_prefactor>
<p3_accretion_qc_exponent type="real" doc="Accretion qc exponent in P3">1.15</p3_accretion_qc_exponent>
<p3_accretion_qr_exponent type="real" doc="Accretion qr exponent in P3">1.15</p3_accretion_qr_exponent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ void P3Microphysics::initialize_impl (const RunType /* run_type */)
runtime_options.p3_autoconversion_prefactor = m_params.get<double>("p3_autoconversion_prefactor", 1350.0);
runtime_options.p3_autoconversion_qc_exponent = m_params.get<double>("p3_autoconversion_qc_exponent", 2.47);
runtime_options.p3_autoconversion_nc_exponent = m_params.get<double>("p3_autoconversion_nc_exponent", 1.79);
runtime_options.p3_autoconversion_radius = m_params.get<double>("p3_autoconversion_radius", 25.0e-6);
runtime_options.p3_accretion_prefactor = m_params.get<double>("p3_accretion_prefactor", 67.0);
runtime_options.p3_accretion_qc_exponent = m_params.get<double>("p3_accretion_qc_exponent", 1.15);
runtime_options.p3_accretion_qr_exponent = m_params.get<double>("p3_accretion_qr_exponent", 1.15);
Expand Down
10 changes: 9 additions & 1 deletion components/eamxx/src/physics/p3/impl/p3_autoconversion_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ ::cloud_water_autoconversion(

// Khroutdinov and Kogan (2000)
const auto qc_not_small = qc_incld >= 1e-8 && context;
constexpr Scalar CONS3 = C::CONS3;

const Scalar p3_autoconversion_prefactor = runtime_options.p3_autoconversion_prefactor;
const Scalar p3_autoconversion_qc_exponent = runtime_options.p3_autoconversion_qc_exponent;
const Scalar p3_autoconversion_nc_exponent = runtime_options.p3_autoconversion_nc_exponent;
const Scalar p3_autoconversion_radius = runtime_options.p3_autoconversion_radius;

// TODO: remove this conditional (and keep CONS3 defined as in else) once BFB reqs are satisfied
Scalar CONS3;
if(p3_autoconversion_radius == 25.0e-6) {
CONS3 = C::CONS3;
} else {
CONS3 = sp(1.0) / (C::CONS2 * pow(p3_autoconversion_radius, sp(3.0)));
}

if(qc_not_small.any()) {
Spack sgs_var_coef;
Expand Down
1 change: 1 addition & 0 deletions components/eamxx/src/physics/p3/p3_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ struct Functions
Scalar p3_autoconversion_prefactor = 1350.0;
Scalar p3_autoconversion_qc_exponent = 2.47;
Scalar p3_autoconversion_nc_exponent = 1.79;
Scalar p3_autoconversion_radius = 25.0e-6;
Scalar p3_accretion_prefactor = 67.0;
Scalar p3_accretion_qc_exponent = 1.15;
Scalar p3_accretion_qr_exponent = 1.15;
Expand Down

0 comments on commit 540f8e0

Please sign in to comment.