@@ -285,12 +285,13 @@ subroutine ocn_diagnostic_solve(dt, statePool, forcingPool, meshPool, diagnostic
285285 ! used - 1e34 so error clearly occurs if these values are used.
286286 !
287287
288- !$omp single
288+ !$omp master
289289 normalVelocity(:,nEdges+1 ) = - 1e34
290290 layerThickness(:,nCells+1 ) = - 1e34
291291 activeTracers(indexTemperature,:,nCells+1 ) = - 1e34
292292 activeTracers(indexSalinity,:,nCells+1 ) = - 1e34
293- !$omp end single
293+ !$omp end master
294+ call mpas_threading_barrier()
294295
295296 call ocn_relativeVorticity_circulation(relativeVorticity, circulation, meshPool, normalVelocity, err)
296297
@@ -320,7 +321,7 @@ subroutine ocn_diagnostic_solve(dt, statePool, forcingPool, meshPool, diagnostic
320321 !
321322 allocate(div_hu(nVertLevels),div_huTransport(nVertLevels),div_huGMBolus(nVertLevels))
322323
323- !$omp do schedule(runtime) private(invAreaCell1, iEdge, r_tmp, i, k)
324+ !$omp do schedule(runtime)
324325 do iCell = 1 , nCells
325326 divergence(:, iCell) = 0.0_RKIND
326327 kineticEnergyCell(:, iCell) = 0.0_RKIND
@@ -364,7 +365,7 @@ subroutine ocn_diagnostic_solve(dt, statePool, forcingPool, meshPool, diagnostic
364365
365366 nEdges = nEdgesArray( 2 )
366367
367- !$omp do schedule(runtime) private(eoe, i, k)
368+ !$omp do schedule(runtime)
368369 do iEdge = 1 , nEdges
369370 tangentialVelocity(:, iEdge) = 0.0_RKIND
370371 ! Compute v (tangential) velocities
@@ -621,7 +622,7 @@ subroutine ocn_diagnostic_solve(dt, statePool, forcingPool, meshPool, diagnostic
621622
622623 allocate(pTop(nVertLevels))
623624
624- !$omp do schedule(runtime) private(k)
625+ !$omp do schedule(runtime)
625626 do iCell = 1 , nCells
626627
627628 ! assume atmospheric pressure at the surface is zero for now.
@@ -752,7 +753,7 @@ subroutine ocn_diagnostic_solve(dt, statePool, forcingPool, meshPool, diagnostic
752753
753754 nCells = nCellsArray( 1 )
754755
755- !$omp do schedule(runtime) private(surfaceLayerDepth, sumSurfaceLayer, k, rSurfaceLayer)
756+ !$omp do schedule(runtime)
756757 do iCell= 1 ,nCells
757758 surfaceLayerDepth = config_cvmix_kpp_surface_layer_averaging
758759 sumSurfaceLayer= 0.0_RKIND
@@ -1168,7 +1169,7 @@ subroutine ocn_filter_btr_mode_vel(statePool, diagnosticsPool, meshPool, timeLev
11681169
11691170 call mpas_pool_get_dimension(meshPool, ' nEdges' , nEdges)
11701171
1171- !$omp do schedule(runtime) private(normalThicknessFluxSum, thicknessSum, k, vertSum)
1172+ !$omp do schedule(runtime)
11721173 do iEdge = 1, nEdges
11731174
11741175 ! thicknessSum is initialized outside the loop because on land boundaries
@@ -1189,8 +1190,6 @@ subroutine ocn_filter_btr_mode_vel(statePool, diagnosticsPool, meshPool, timeLev
11891190 enddo ! iEdge
11901191 !$omp end do
11911192
1192- call mpas_threading_barrier()
1193-
11941193 call mpas_timer_stop("ocn_filter_btr_mode_vel")
11951194
11961195 end subroutine ocn_filter_btr_mode_vel!}}}
@@ -1239,7 +1238,7 @@ subroutine ocn_filter_btr_mode_tend_vel(tendPool, statePool, diagnosticsPool, me
12391238
12401239 call mpas_pool_get_dimension(meshPool, ' nEdges' , nEdges)
12411240
1242- !$omp do schedule(runtime) private(normalThicknessFluxSum, thicknessSum, vertSum, k)
1241+ !$omp do schedule(runtime)
12431242 do iEdge = 1, nEdges
12441243
12451244 ! thicknessSum is initialized outside the loop because on land boundaries
@@ -1450,8 +1449,7 @@ subroutine ocn_compute_KPP_input_fields(statePool, forcingPool, meshPool, diagno
14501449 densitySurfaceDisplaced, err, thermalExpansionCoeff, salineContractionCoeff, &
14511450 timeLevel)
14521451
1453- !$omp do schedule(runtime) private(invAreaCell, deltaVelocitySquared, i, iEdge, factor, delU2, fracAbsorbed, &
1454- !$omp fracAbsorbedRunoff)
1452+ !$omp do schedule(runtime)
14551453 do iCell = 1, nCells
14561454 invAreaCell = 1.0_RKIND / areaCell(iCell)
14571455
@@ -1514,8 +1512,6 @@ subroutine ocn_compute_KPP_input_fields(statePool, forcingPool, meshPool, diagno
15141512 enddo
15151513 !$omp end do
15161514
1517- call mpas_threading_barrier()
1518-
15191515 ! deallocate scratch space
15201516 call mpas_deallocate_scratch_field(thermalExpansionCoeffField, .true.)
15211517 call mpas_deallocate_scratch_field(salineContractionCoeffField, .true.)
@@ -1740,7 +1736,7 @@ subroutine ocn_compute_land_ice_flux_input_fields(meshPool, statePool, &
17401736
17411737
17421738 ! average temperature and salinity over horizontal neighbors and the sub-ice-shelf boundary layer
1743- !$omp do schedule(runtime) private(blThickness, iLevel, dz)
1739+ !$omp do schedule(runtime)
17441740 do iCell = 1, nCells
17451741 blThickness = 0.0_RKIND
17461742 blTempScratch(iCell) = 0.0_RKIND
0 commit comments