diff --git a/components/mpas-ocean/src/shared/mpas_ocn_diagnostics.F b/components/mpas-ocean/src/shared/mpas_ocn_diagnostics.F index 339903472eb3..7b8e5154495b 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_diagnostics.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_diagnostics.F @@ -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* & @@ -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)