Skip to content

Commit dfaee24

Browse files
committed
Changes to OpenACC directives
Converting acc kernels to an acc parallel region, following earlier discussions to only use kernels directive for temporary code regions. Using the default(present) clauses for parallel regions to be consistent with the rest of the code.
1 parent c9c0e5f commit dfaee24

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/core_atmosphere/dynamics/mpas_atm_boundaries.F

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,14 @@ subroutine mpas_atm_update_bdy_tend(clock, streamManager, block, firstCall, ierr
215215
index_qv = index_qv_ptr
216216

217217
! Compute lbc_rho_zz
218+
!$acc parallel default(present)
219+
!$acc loop vector
220+
do k=1,nVertLevels
221+
zz(k,nCells+1) = 1.0_RKIND ! Avoid potential division by zero in the following line
222+
end do
223+
!$acc end parallel
218224

219-
!$acc kernels
220-
zz(:,nCells+1) = 1.0_RKIND ! Avoid potential division by zero in the following line
221-
!$acc end kernels
222-
223-
!$acc parallel
225+
!$acc parallel default(present)
224226
!$acc loop gang vector collapse(2)
225227
do iCell=1,nCells+1
226228
do k=1,nVertLevels
@@ -230,7 +232,7 @@ subroutine mpas_atm_update_bdy_tend(clock, streamManager, block, firstCall, ierr
230232
!$acc end parallel
231233

232234
! Average lbc_rho_zz to edges
233-
!$acc parallel
235+
!$acc parallel default(present)
234236
!$acc loop gang worker
235237
do iEdge=1,nEdges
236238
cell1 = cellsOnEdge(1,iEdge)
@@ -244,7 +246,7 @@ subroutine mpas_atm_update_bdy_tend(clock, streamManager, block, firstCall, ierr
244246
end do
245247
!$acc end parallel
246248

247-
!$acc parallel
249+
!$acc parallel default(present)
248250
!$acc loop gang vector collapse(2)
249251
do iEdge=1,nEdges+1
250252
do k=1,nVertLevels

0 commit comments

Comments
 (0)