Skip to content

Commit 0f4314a

Browse files
committed
Simplify zeroing top now that ngwv is gone
1 parent aa59ce8 commit 0f4314a

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

components/eamxx/src/physics/gw/impl/gw_gwd_compute_tendencies_from_stress_divergence_impl.hpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,17 @@ void Functions<S,D>::gwd_compute_tendencies_from_stress_divergence(
4646
{
4747
const Real ptaper = do_taper ? std::cos(lat) : 1.;
4848

49-
// Force tau at the top of the model to zero, if requested.
50-
if (init.tau_0_ubc) {
51-
Kokkos::parallel_for(
52-
Kokkos::TeamVectorRange(team, 0, tau.extent(0)), [&] (const int i) {
53-
tau(i,0) = 0.;
54-
});
55-
}
56-
57-
team.team_barrier();
58-
5949
// Loop waves
6050
Kokkos::parallel_for(
6151
Kokkos::TeamVectorRange(team, -pgwv, pgwv+1), [&] (const int l) {
6252
// Accumulate the mean wind tendency over wavenumber.
6353
int pl_idx = l + pgwv; // 0-based idx for -pgwv:pgwv arrays
6454

55+
// Force tau at the top of the model to zero, if requested.
56+
if (init.tau_0_ubc) {
57+
tau(pl_idx,0) = 0.;
58+
}
59+
6560
// Loop over levels from top to bottom. Each level reads and writes to
6661
// the next level, so this loop must be serialized.
6762
for (int k = init.ktop; k <= max_level; ++k) {

0 commit comments

Comments
 (0)