Skip to content

Commit 2d55ab7

Browse files
committed
switched from using KOKKOS_LAMBDA for reductions in EAMxx zonal average diagnostic
1 parent e6af439 commit 2d55ab7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/eamxx/src/diagnostics/zonal_avg.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void ZonalAvgDiag::compute_zonal_sum(const Field &result, const Field &field, co
2929
const Real lat_upper = lat_lower + lat_delta;
3030
Kokkos::parallel_reduce(
3131
Kokkos::TeamVectorRange(tm, ncols),
32-
KOKKOS_LAMBDA(int i, Real &val) {
32+
[&](int i, Real &val) {
3333
// TODO: check if tenary is ok here (if not, multiply by flag)
3434
int flag = (lat_lower <= lat_view(i)) && (lat_view(i) < lat_upper);
3535
val += flag ? weight_view(i) * field_view(i) : sp(0.0);
@@ -51,7 +51,7 @@ void ZonalAvgDiag::compute_zonal_sum(const Field &result, const Field &field, co
5151
const Real lat_upper = lat_lower + lat_delta;
5252
Kokkos::parallel_reduce(
5353
Kokkos::TeamVectorRange(tm, ncols),
54-
KOKKOS_LAMBDA(int i, Real &val) {
54+
[&](int i, Real &val) {
5555
int flag = (lat_lower <= lat_view(i)) && (lat_view(i) < lat_upper);
5656
// TODO: check if tenary is ok here (if not, multiply by flag)
5757
val += flag ? weight_view(i) * field_view(i, d1_i) : sp(0.0);
@@ -76,7 +76,7 @@ void ZonalAvgDiag::compute_zonal_sum(const Field &result, const Field &field, co
7676
const Real lat_upper = lat_lower + lat_delta;
7777
Kokkos::parallel_reduce(
7878
Kokkos::TeamVectorRange(tm, ncols),
79-
KOKKOS_LAMBDA(int i, Real &val) {
79+
[&](int i, Real &val) {
8080
int flag = (lat_lower <= lat_view(i)) && (lat_view(i) < lat_upper);
8181
// TODO: check if tenary is ok here (if not, multiply by flag)
8282
val += flag ? weight_view(i) * field_view(i, d1_i, d2_i) : sp(0.0);

0 commit comments

Comments
 (0)