-
Notifications
You must be signed in to change notification settings - Fork 54
add runtime options for p3 #3033
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
Changes from all commits
bba279b
2fc1726
e3b223c
7895945
699d103
9749a30
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 |
---|---|---|
|
@@ -127,6 +127,11 @@ struct P3_Constants | |
{ | ||
public: | ||
Scalar p3_autoconversion_prefactor = 1350.0; | ||
Scalar p3_autoconversion_qc_exp = 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. Random question: do we know why the struct 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 agree, I think we should pull it out of 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. This was done in #2655. I agree with both of you on not having these here, but I view that as a separate PR 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. Thanks Naser for volunteering to do it an a separate PR... :P 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. If you look inside components/eamxx/src/physics/share/physics_constants.hpp, I think it is already the case that it is a dumping ground ... 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. (jk) 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 can, but it will have to wait a bit :D |
||
Scalar p3_autoconversion_nc_exp = 1.79; | ||
Scalar p3_autoconversion_radius = 0.000025; | ||
Scalar p3_accretion_qc_exp = 1.15; | ||
Scalar p3_accretion_qr_exp = 1.15; | ||
Scalar p3_mu_r_constant = 1.0; | ||
Scalar p3_spa_to_nc = 1.0; | ||
Scalar p3_k_accretion = 67.0; | ||
|
@@ -138,13 +143,34 @@ struct P3_Constants | |
Scalar p3_dep_nucleation_exponent = 0.304; | ||
Scalar p3_ice_sed_knob = 1.0; | ||
Scalar p3_d_breakup_cutoff = 0.00028; | ||
bool p3_do_ice = true; | ||
|
||
void set_p3_from_namelist(ekat::ParameterList ¶ms){ | ||
|
||
std::string nname = "p3_autoconversion_prefactor"; | ||
if(params.isParameter(nname)) | ||
p3_autoconversion_prefactor = params.get<double>(nname); | ||
|
||
nname = "p3_autoconversion_qc_exp"; | ||
if(params.isParameter(nname)) | ||
p3_autoconversion_qc_exp = params.get<double>(nname); | ||
|
||
nname = "p3_autoconversion_nc_exp"; | ||
if(params.isParameter(nname)) | ||
p3_autoconversion_nc_exp = params.get<double>(nname); | ||
|
||
nname = "p3_autoconversion_radius"; | ||
if(params.isParameter(nname)) | ||
p3_autoconversion_radius = params.get<double>(nname); | ||
|
||
nname = "p3_accretion_qc_exp"; | ||
if(params.isParameter(nname)) | ||
p3_accretion_qc_exp = params.get<double>(nname); | ||
|
||
nname = "p3_accretion_qr_exp"; | ||
if(params.isParameter(nname)) | ||
p3_accretion_qr_exp = params.get<double>(nname); | ||
|
||
nname = "p3_mu_r_constant"; | ||
if(params.isParameter(nname)) | ||
p3_mu_r_constant = params.get<double>(nname); | ||
|
@@ -189,13 +215,32 @@ struct P3_Constants | |
if(params.isParameter(nname)) | ||
p3_d_breakup_cutoff = params.get<double>(nname); | ||
|
||
nname = "p3_do_ice"; | ||
if(params.isParameter(nname)) | ||
p3_do_ice = params.get<bool>(nname); | ||
|
||
}; | ||
|
||
void print_p3constants(std::shared_ptr<ekat::logger::LoggerBase> logger){ | ||
logger->info("P3 Constants:"); | ||
|
||
std::string nname = "p3_autoconversion_prefactor"; | ||
logger->info(std::string("P3 ") + nname + std::string(" = ") + std::to_string(p3_autoconversion_prefactor)); | ||
|
||
nname = "p3_autoconversion_qc_exp"; | ||
logger->info(std::string("P3 ") + nname + std::string(" = ") + std::to_string(p3_autoconversion_qc_exp)); | ||
|
||
nname = "p3_autoconversion_nc_exp"; | ||
logger->info(std::string("P3 ") + nname + std::string(" = ") + std::to_string(p3_autoconversion_nc_exp)); | ||
|
||
nname = "p3_autoconversion_radius"; | ||
logger->info(std::string("P3 ") + nname + std::string(" = ") + std::to_string(p3_autoconversion_radius)); | ||
|
||
nname = "p3_accretion_qc_exp"; | ||
logger->info(std::string("P3 ") + nname + std::string(" = ") + std::to_string(p3_autoconversion_qc_exp)); | ||
|
||
nname = "p3_accretion_qr_exp"; | ||
logger->info(std::string("P3 ") + nname + std::string(" = ") + std::to_string(p3_autoconversion_nc_exp)); | ||
|
||
nname = "p3_mu_r_constant"; | ||
logger->info(std::string("P3 ") + nname + std::string(" = ") + std::to_string(p3_mu_r_constant)); | ||
|
@@ -230,6 +275,9 @@ struct P3_Constants | |
nname = "p3_d_breakup_cutoff"; | ||
logger->info(std::string("P3 ") + nname + std::string(" = ") + std::to_string(p3_d_breakup_cutoff)); | ||
|
||
nname = "p3_do_ice"; | ||
logger->info(std::string("P3 ") + nname + std::string(" = ") + std::to_string(p3_do_ice)); | ||
|
||
logger->info(" "); | ||
}; | ||
|
||
|
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.
It may be a good idea to add the units in the doc string.
Uh oh!
There was an error while loading. Please reload this page.
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 wanna edit the docs for all p3 constants tbh...