-
Notifications
You must be signed in to change notification settings - Fork 375
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
Adds a flag to control vertical mixing of interstitial aerosols during aerosol activation process #6926
base: master
Are you sure you want to change the base?
Adds a flag to control vertical mixing of interstitial aerosols during aerosol activation process #6926
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 |
---|---|---|
|
@@ -205,6 +205,7 @@ void call_function_dropmixnuc( | |
const MAMAci::view_2d wsub, | ||
const MAMAci::view_2d cloud_frac, const MAMAci::view_2d cloud_frac_prev, | ||
const mam_coupling::AerosolState &dry_aero, const int nlev, | ||
const bool &enable_aero_vertical_mix, | ||
|
||
// Following outputs are all diagnostics | ||
MAMAci::view_2d coltend[mam4::ndrop::ncnst_tot], | ||
|
@@ -318,7 +319,7 @@ void call_function_dropmixnuc( | |
num2vol_ratio_max_nmodes); | ||
//--------------------------------------------------------------------------- | ||
//--------------------------------------------------------------------------- | ||
|
||
const bool local_enable_aero_vertical_mix = enable_aero_vertical_mix; | ||
Kokkos::parallel_for( | ||
team_policy, KOKKOS_LAMBDA(const haero::ThreadTeam &team) { | ||
const int icol = team.league_rank(); | ||
|
@@ -406,10 +407,6 @@ void call_function_dropmixnuc( | |
} | ||
}); | ||
team.team_barrier(); | ||
// HACK: dropmixnuc() requires the parameter enable_aero_vertical_mix, | ||
// so we define it here until we have a better idea of where it | ||
// might come from | ||
const bool enable_aero_vertical_mix = true; | ||
mam4::ndrop::dropmixnuc( | ||
team, dt, ekat::subview(T_mid, icol), ekat::subview(p_mid, icol), | ||
ekat::subview(p_int, icol), ekat::subview(pdel, icol), | ||
|
@@ -421,11 +418,10 @@ void call_function_dropmixnuc( | |
spechygro, lmassptr_amode, num2vol_ratio_min_nmodes, | ||
num2vol_ratio_max_nmodes, numptr_amode, nspec_amode, exp45logsig, | ||
alogsig, aten, mam_idx, mam_cnst_idx, | ||
enable_aero_vertical_mix, | ||
ekat::subview(qcld, icol), // out | ||
ekat::subview(wsub, icol), // in | ||
ekat::subview(cloud_frac_prev, icol), // in | ||
qqcw_view, // inout | ||
local_enable_aero_vertical_mix, ekat::subview(qcld, icol), // out | ||
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. is local_enable_aero_vertical_mix out? I thought it would be in... 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. It should be |
||
ekat::subview(wsub, icol), // in | ||
ekat::subview(cloud_frac_prev, icol), // in | ||
qqcw_view, // inout | ||
ptend_q_view, ekat::subview(tendnd, icol), | ||
ekat::subview(factnum, icol), ekat::subview(ndropcol, icol), | ||
ekat::subview(ndropmix, icol), ekat::subview(nsource, icol), | ||
|
@@ -534,6 +530,7 @@ void call_hetfrz_compute_tendencies( | |
haero::Atmosphere haero_atm = | ||
atmosphere_for_column(dry_atmosphere, icol); | ||
haero::Surface surf{}; | ||
set_min_background_mmr(team, dry_aero,icol); | ||
mam4::Prognostics progs = | ||
mam_coupling::aerosols_for_column(dry_aero, icol); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -776,6 +776,32 @@ void compute_wet_mixing_ratios(const Team& team, | |
}); | ||
} | ||
|
||
// Set minimum background MMR for the interstitial aerosols | ||
KOKKOS_INLINE_FUNCTION | ||
void set_min_background_mmr(const Team& team, | ||
const AerosolState& dry_aero, | ||
const int column_index) { | ||
|
||
EKAT_KERNEL_ASSERT_MSG(column_index == team.league_rank(), | ||
"Given column index does not correspond to given team!"); | ||
|
||
//Minimum background value for the interstitial aerosols | ||
constexpr Real INTERSTITIAL_AERO_MIN_VAL = 1e-36; | ||
|
||
constexpr int nlev = mam4::nlev; | ||
const int icol = column_index; | ||
Kokkos::parallel_for(Kokkos::TeamVectorRange(team, nlev), [&] (const int klev) { | ||
for (int imode = 0; imode < num_aero_modes(); ++imode) { | ||
dry_aero.int_aero_nmr[imode](icol,klev) = haero::max(dry_aero.int_aero_nmr[imode](icol,klev), INTERSTITIAL_AERO_MIN_VAL); | ||
for (int ispec = 0; ispec < num_aero_species(); ++ispec) { | ||
if (dry_aero.int_aero_mmr[imode][ispec].data()) { | ||
dry_aero.int_aero_mmr[imode][ispec](icol,klev) = haero::max(dry_aero.int_aero_mmr[imode][ispec](icol,klev), INTERSTITIAL_AERO_MIN_VAL); | ||
} | ||
Comment on lines
+794
to
+799
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. Looks like set_min_background_mmr is unrelated to stuff in the PR title and description. I am concerned about this because it is surprisingly complex (pretty hard to read):
I guess I am confused about both the data layout as well as any undesirable side effect of low values... 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. When
I hope it makes sense, but let me know if you have questions. |
||
}//ispec | ||
}//imode | ||
}); | ||
} // set_min_background_mmr | ||
|
||
// Computes the reciprocal of pseudo density for a column | ||
inline | ||
void compute_recipical_pseudo_density(haero::ThreadTeamPolicy team_policy, | ||
|
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.
Since this flag is to control the vertical mixing calculation of both aerosols and cloud droplet (?) in aci, it might be better change it to "enable_aci_vert_mix". Do we have a similar flag to control the vertical mixing calculation in SHOC?
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.
That's a good suggestion. Thanks. I will revise the flag name.
@tcclevenger is working on a method to disable the vertical mixing in SHOC. Once that is ready, we will have two ways to control vertical mixing.