From 582899e59663b41d0c05e36687466a5f5e441de7 Mon Sep 17 00:00:00 2001 From: mark-petersen Date: Tue, 6 Dec 2022 12:14:57 -0800 Subject: [PATCH 1/2] Move bottomDepthEdge calculation to single loop over all edges --- .../src/mode_forward/mpas_ocn_time_integration_split.F | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/mpas-ocean/src/mode_forward/mpas_ocn_time_integration_split.F b/components/mpas-ocean/src/mode_forward/mpas_ocn_time_integration_split.F index 84dc8d4cfc5f..7d1a1a0c8ca3 100644 --- a/components/mpas-ocean/src/mode_forward/mpas_ocn_time_integration_split.F +++ b/components/mpas-ocean/src/mode_forward/mpas_ocn_time_integration_split.F @@ -775,8 +775,6 @@ subroutine ocn_time_integrator_split(domain, dt)!{{{ enddo barotropicForcing(iEdge) = splitFact* & normalThicknessFluxSum/thicknessSum/dt - bottomDepthEdge(iEdge) = thicknessSum & - - 0.5_RKIND*(sshNew(cell1) + sshNew(cell2)) do k = minLevelEdgeBot(iEdge), maxLevelEdgeTop(iEdge) ! These two steps are together here: @@ -798,7 +796,7 @@ subroutine ocn_time_integrator_split(domain, dt)!{{{ !$omp parallel !$omp do schedule(runtime) & !$omp private(cell1, cell2, k, thicknessSum) - do iEdge = nEdgesOwned+1, nEdgesArray(4) + do iEdge = 1, nEdgesArray(size(nEdgesArray)-1) cell1 = cellsOnEdge(1,iEdge) cell2 = cellsOnEdge(2,iEdge) thicknessSum = layerThickEdgeFlux(minLevelEdgeBot(iEdge),iEdge) From 824850e74e5499a8cc88dc27e1952454bba1b1dc Mon Sep 17 00:00:00 2001 From: mark-petersen Date: Thu, 8 Dec 2022 12:26:53 -0800 Subject: [PATCH 2/2] Change nEdgesArray to nEdgesHalo --- .../src/mode_forward/mpas_ocn_time_integration_split.F | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/components/mpas-ocean/src/mode_forward/mpas_ocn_time_integration_split.F b/components/mpas-ocean/src/mode_forward/mpas_ocn_time_integration_split.F index 7d1a1a0c8ca3..ae171995ad80 100644 --- a/components/mpas-ocean/src/mode_forward/mpas_ocn_time_integration_split.F +++ b/components/mpas-ocean/src/mode_forward/mpas_ocn_time_integration_split.F @@ -173,8 +173,6 @@ subroutine ocn_time_integrator_split(domain, dt)!{{{ edgeHaloComputeCounter, &! halo counters to reduce cellHaloComputeCounter ! halo updates during cycling - integer, dimension(:), pointer :: nEdgesArray - real (kind=RKIND) :: & normalThicknessFluxSum, &! sum of thickness flux in column thicknessSum, &! sum of thicknesses in column @@ -385,8 +383,6 @@ subroutine ocn_time_integrator_split(domain, dt)!{{{ call mpas_pool_get_array(tracersPool, 'activeTracers', activeTracersNew, 2) - call mpas_pool_get_dimension(meshPool,'nEdgesArray', nEdgesArray) - allocate(bottomDepthEdge(nEdgesAll+1)) if (config_transport_tests_flow_id > 0) then @@ -796,7 +792,7 @@ subroutine ocn_time_integrator_split(domain, dt)!{{{ !$omp parallel !$omp do schedule(runtime) & !$omp private(cell1, cell2, k, thicknessSum) - do iEdge = 1, nEdgesArray(size(nEdgesArray)-1) + do iEdge = 1, nEdgesHalo(config_num_halos+1) cell1 = cellsOnEdge(1,iEdge) cell2 = cellsOnEdge(2,iEdge) thicknessSum = layerThickEdgeFlux(minLevelEdgeBot(iEdge),iEdge)