Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in OpenACC directives and revise machine files #6116

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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