-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
p3 auto, accr, scol runtime params #3037
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,17 +222,23 @@ void P3Microphysics::initialize_impl (const RunType /* run_type */) | |
// Gather runtime options | ||
runtime_options.max_total_ni = m_params.get<double>("max_total_ni", 740.0e3); | ||
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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another style question: should we maybe move all the params loading into a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to do this in the next PR as well. Thanks! |
||
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); | ||
runtime_options.p3_rain_selfcollection_prefactor = m_params.get<double>("p3_rain_selfcollection_prefactor", 5.78); | ||
runtime_options.p3_rain_selfcollection_breakup_diameter = m_params.get<double>("p3_rain_selfcollection_breakup_diameter", 0.00028); | ||
runtime_options.p3_mu_r_constant = m_params.get<double>("p3_mu_r_constant", 1.0); | ||
runtime_options.p3_spa_to_nc = m_params.get<double>("p3_spa_to_nc", 1.0); | ||
runtime_options.p3_k_accretion = m_params.get<double>("p3_k_accretion", 67.0); | ||
runtime_options.p3_eci = m_params.get<double>("p3_eci", 0.5); | ||
runtime_options.p3_eri = m_params.get<double>("p3_eri", 1.0); | ||
runtime_options.p3_rho_rime_min = m_params.get<double>("p3_rho_rime_min", 50.0); | ||
runtime_options.p3_rho_rime_max = m_params.get<double>("p3_rho_rime_max", 900.0); | ||
runtime_options.p3_a_imm = m_params.get<double>("p3_a_imm", 0.65); | ||
runtime_options.p3_dep_nucleation_exponent = m_params.get<double>("p3_dep_nucleation_exponent", 0.304); | ||
runtime_options.p3_ice_sed_knob = m_params.get<double>("p3_ice_sed_knob", 1.0); | ||
runtime_options.p3_d_breakup_cutoff = m_params.get<double>("p3_d_breakup_cutoff", 0.00028); | ||
runtime_options.p3_do_ice_production = m_params.get<bool>("p3_do_ice_production", true); | ||
|
||
// Set property checks for fields in this process | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,18 +25,25 @@ ::cloud_rain_accretion( | |
{ | ||
constexpr Scalar qsmall = C::QSMALL; | ||
|
||
const Scalar p3_k_accretion = runtime_options.p3_k_accretion;; | ||
const Scalar p3_accretion_prefactor = runtime_options.p3_accretion_prefactor; | ||
const Scalar p3_accretion_qc_exponent = runtime_options.p3_accretion_qc_exponent; | ||
const Scalar p3_accretion_qr_exponent = runtime_options.p3_accretion_qr_exponent; | ||
|
||
Spack sgs_var_coef; | ||
// sgs_var_coef = subgrid_variance_scaling(inv_qc_relvar, sp(1.15) ); | ||
sgs_var_coef = 1; | ||
|
||
const auto qr_and_qc_not_small = (qr_incld >= qsmall) && (qc_incld >= qsmall) && context; | ||
if (qr_and_qc_not_small.any()) { | ||
if(qr_and_qc_not_small.any()) { | ||
// Khroutdinov and Kogan (2000) | ||
qc2qr_accret_tend.set(qr_and_qc_not_small, | ||
sgs_var_coef * sp(p3_k_accretion) * pow(qc_incld * qr_incld, sp(1.15))); | ||
nc_accret_tend.set(qr_and_qc_not_small, qc2qr_accret_tend * nc_incld / qc_incld); | ||
qc2qr_accret_tend.set( | ||
qr_and_qc_not_small, | ||
sgs_var_coef * sp(p3_accretion_prefactor) * | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no need to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise, I will fix this in the PR making switching things on |
||
// TODO: split this pow into two in a later PR due to NBFB behavior | ||
// pow(qc_incld, p3_accretion_qc_exponent) * pow(qr_incld, p3_accretion_qr_exponent)); | ||
pow(qc_incld * qr_incld, p3_accretion_qr_exponent)); | ||
nc_accret_tend.set(qr_and_qc_not_small, | ||
qc2qr_accret_tend * nc_incld / qc_incld); | ||
|
||
qc2qr_accret_tend.set(nc_accret_tend == 0 && context, 0); | ||
nc_accret_tend.set(qc2qr_accret_tend == 0 && context, 0); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style question: do we need to prepend all param names with
p3_
, considering we are already in thep3
sublist?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the
p3_
but I hesitated removing them. Your opinion will nudge me to remove this. Should I remove them? If so, I will do that in the next PR that will be NBFB to address the two TODO items.