Skip to content

Commit 293cbd5

Browse files
authored
Merge Pull Request #2999 from eagles-project/scream/oscar/mam4_constituent_fluxes_fix
Automatically Merged using E3SM Pull Request AutoTester PR Title: MAM4xx: Fix of mam4_constituent_fluxes_standalone_np1 PR Author: odiazib PR LABELS: AT: AUTOMERGE, bugfix, AT: PRE-TEST INSPECTED, EAGLES, MAM
2 parents e721127 + c194ee2 commit 293cbd5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

components/eamxx/src/physics/mam/eamxx_mam_constituent_fluxes_interface.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,20 +274,25 @@ void MAMConstituentFluxes::run_impl(const double dt) {
274274
// Compute vertical layer heights and updraft velocity. We need these to fully
275275
// populate dry_atm_, so that we can form a HAERO atmosphere object. HAERO
276276
// atmosphere object is used to for state%q like array.
277+
// NOTE: We cannot pass a member of the interface class (in this case, MAMConstituentFluxes)
278+
// inside a parallel_for. Instead, we must create a soft copy of each member.
279+
const auto & wet_atm = wet_atm_;
280+
const auto & dry_atm= dry_atm_;
281+
277282
auto lambda =
278283
KOKKOS_LAMBDA(const Kokkos::TeamPolicy<KT::ExeSpace>::member_type &team) {
279284
const int icol = team.league_rank(); // column index
280-
compute_dry_mixing_ratios(team, wet_atm_, // in
281-
dry_atm_, // out
285+
compute_dry_mixing_ratios(team, wet_atm, // in
286+
dry_atm, // out
282287
icol); // in
283288
team.team_barrier();
284289
// vertical heights has to be computed after computing dry mixing ratios
285290
// for atmosphere
286291
compute_vertical_layer_heights(team, // in
287-
dry_atm_, // out
292+
dry_atm, // out
288293
icol); // in
289-
compute_updraft_velocities(team, wet_atm_, // in
290-
dry_atm_, // out
294+
compute_updraft_velocities(team, wet_atm, // in
295+
dry_atm, // out
291296
icol); // in
292297
};
293298
// policy

0 commit comments

Comments
 (0)