Skip to content

Commit

Permalink
Merge branch 'hkang/ocean/pm-gpu-fix' (PR #6116)
Browse files Browse the repository at this point in the history
Fix bugs in OpenACC directives:
- Change an openacc directive in mpas_ocn_diagnostics.F to avoid
getting stuck on pm-gpu.

Fixes #6127

[BFB]
  • Loading branch information
amametjanov committed Jan 26, 2024
2 parents f6f79a2 + 95d64d2 commit 4f0d0ca
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 4f0d0ca

Please sign in to comment.