Skip to content

Commit

Permalink
Fix bugs in openacc directives
Browse files Browse the repository at this point in the history
Change an openacc directive in mpas_ocn_diagnostics.F to avoid
getting stuck on pm-gpu.
  • Loading branch information
hyungyukang authored and amametjanov committed Dec 23, 2023
1 parent 74b2e67 commit 95d64d2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/mpas-ocean/src/shared/mpas_ocn_diagnostics.F
Original file line number Diff line number Diff line change
Expand Up @@ -1106,18 +1106,19 @@ subroutine ocn_diagnostic_solve_kineticEnergy(normalVelocity, &
#ifdef MPAS_OPENACC
!$acc parallel loop &
!$acc present(kineticEnergyVertex, normalVelocity, &
!$acc areaTriangle, dcEdge, dvEdge, edgesOnVertex)
!$acc areaTriangle, dcEdge, dvEdge, edgesOnVertex) &
!$acc private(iEdge,rTmp,k,i)
#else
!$omp parallel
!$omp do schedule(runtime) private(i, k, iEdge, rTmp)
#endif
do iVertex = 1, nVerticesAll
kineticEnergyVertex(:, iVertex) = 0.0_RKIND
!$acc loop seq
do i = 1, vertexDegree
iEdge = edgesOnVertex(i, iVertex)
rTmp = dcEdge(iEdge)*dvEdge(iEdge)*0.25_RKIND/ &
areaTriangle(iVertex)
!$acc loop seq
do k = 1, nVertLevels
kineticEnergyVertex(k,iVertex) = &
kineticEnergyVertex(k,iVertex) + rTmp* &
Expand All @@ -1133,7 +1134,8 @@ subroutine ocn_diagnostic_solve_kineticEnergy(normalVelocity, &
!$acc parallel loop &
!$acc present(kineticEnergyVertexOnCells, kineticEnergyVertex,&
!$acc kiteIndexOnCell, kiteAreasOnVertex, invAreaCell,&
!$acc verticesOnCell, nEdgesOnCell)
!$acc verticesOnCell, nEdgesOnCell) &
!$acc private(i,j,k,iVertex,invAreaCell1)
#else
!$omp do schedule(runtime) &
!$omp private(i, j, k, iVertex, invAreaCell1)
Expand Down

0 comments on commit 95d64d2

Please sign in to comment.