From 504463af3a09f27ab75a8ad2f799c4ce2ad7873f Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Thu, 19 Sep 2024 15:15:26 -0600 Subject: [PATCH] Refactor `OceanState::updateTimeLevels` --- components/omega/src/ocn/OceanState.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/components/omega/src/ocn/OceanState.cpp b/components/omega/src/ocn/OceanState.cpp index a257185f4e1c..ee4aaa46da94 100644 --- a/components/omega/src/ocn/OceanState.cpp +++ b/components/omega/src/ocn/OceanState.cpp @@ -382,25 +382,14 @@ void OceanState::updateTimeLevels() { int NewLevel = NTimeLevels - 1; - // Update time levels for layer thickness - copyToHost(NewLevel); - MeshHalo->exchangeFullArrayHalo(LayerThicknessH[NewLevel], OnCell); - copyToDevice(NewLevel); - - Array2DR8 Temp; - HostArray2DR8 TempH; + // Exchange halo + exchangeHalo(NewLevel); + // Update time levels for layer thickness and normal velocity for (int Level = 0; Level < NTimeLevels - 1; Level++) { std::swap(LayerThickness[Level + 1], LayerThickness[Level]); std::swap(LayerThicknessH[Level + 1], LayerThicknessH[Level]); - } - // Update time levels for normal velocity - copyToHost(NewLevel); - MeshHalo->exchangeFullArrayHalo(NormalVelocityH[NewLevel], OnEdge); - copyToDevice(NewLevel); - - for (int Level = 0; Level < NTimeLevels - 1; Level++) { std::swap(NormalVelocity[Level + 1], NormalVelocity[Level]); std::swap(NormalVelocityH[Level + 1], NormalVelocityH[Level]); }