diff --git a/components/omega/src/ocn/Eos.cpp b/components/omega/src/ocn/Eos.cpp index 1b49fe400eea..1728595939cb 100644 --- a/components/omega/src/ocn/Eos.cpp +++ b/components/omega/src/ocn/Eos.cpp @@ -39,11 +39,11 @@ Eos::Eos(const std::string &Name, ///< [in] Name for eos object ComputeBruntVaisalaFreqSqLinear(VCoord), ComputeBruntVaisalaFreqSqTeos10(VCoord), Name(Name), Mesh(Mesh), VCoord(VCoord) { - SpecVol = Array2DReal("SpecVol", Mesh->NCellsAll, VCoord->NVertLayers); + SpecVol = Array2DReal("SpecVol", Mesh->NCellsSize, VCoord->NVertLayers); SpecVolDisplaced = - Array2DReal("SpecVolDisplaced", Mesh->NCellsAll, VCoord->NVertLayers); + Array2DReal("SpecVolDisplaced", Mesh->NCellsSize, VCoord->NVertLayers); BruntVaisalaFreqSq = - Array2DReal("BruntVaisalaFreqSq", Mesh->NCellsAll, VCoord->NVertLayers); + Array2DReal("BruntVaisalaFreqSq", Mesh->NCellsSize, VCoord->NVertLayers); defineFields(); } diff --git a/components/omega/src/ocn/VertMix.cpp b/components/omega/src/ocn/VertMix.cpp index f0e0db9a7055..d43358a662c7 100644 --- a/components/omega/src/ocn/VertMix.cpp +++ b/components/omega/src/ocn/VertMix.cpp @@ -32,8 +32,8 @@ VertMix::VertMix(const std::string &Name, ///< [in] Name for VertMix object ) : ComputeVertMixConv(VCoord), ComputeVertMixShear(Mesh, VCoord), Name(Name), Mesh(Mesh), VCoord(VCoord) { - VertDiff = Array2DReal("VertDiff", Mesh->NCellsAll, VCoord->NVertLayers); - VertVisc = Array2DReal("VertVisc", Mesh->NCellsAll, VCoord->NVertLayers); + VertDiff = Array2DReal("VertDiff", Mesh->NCellsSize, VCoord->NVertLayers); + VertVisc = Array2DReal("VertVisc", Mesh->NCellsSize, VCoord->NVertLayers); defineFields(); } diff --git a/components/omega/test/ocn/EosTest.cpp b/components/omega/test/ocn/EosTest.cpp index 5202594abedb..9ca0ff956407 100644 --- a/components/omega/test/ocn/EosTest.cpp +++ b/components/omega/test/ocn/EosTest.cpp @@ -107,15 +107,15 @@ void testEosLinear() { const auto Mesh = HorzMesh::getDefault(); const auto VCoord = VertCoord::getDefault(); VCoord->NVertLayers = NVertLayers; - I4 NCellsAll = Mesh->NCellsAll; + I4 NCellsSize = Mesh->NCellsSize; /// Get Eos instance to test Eos *TestEos = Eos::getInstance(); TestEos->EosChoice = EosType::LinearEos; /// Create and fill ocean state arrays - Array2DReal SArray = Array2DReal("SArray", NCellsAll, NVertLayers); - Array2DReal TArray = Array2DReal("TArray", NCellsAll, NVertLayers); - Array2DReal PArray = Array2DReal("PArray", NCellsAll, NVertLayers); + Array2DReal SArray = Array2DReal("SArray", NCellsSize, NVertLayers); + Array2DReal TArray = Array2DReal("TArray", NCellsSize, NVertLayers); + Array2DReal PArray = Array2DReal("PArray", NCellsSize, NVertLayers); /// Use Kokkos::deep_copy to fill the entire view with the ref value deepCopy(SArray, Sa); deepCopy(TArray, Ct); @@ -156,7 +156,7 @@ void testEosLinear() { // If test fails, print bad values and abort if (NumMismatches != 0) { auto SpecVolH = createHostMirrorCopy(TestEos->SpecVol); - for (int I = 0; I < NCellsAll; ++I) { + for (int I = 0; I < Mesh->NCellsAll; ++I) { for (int K = 0; K < NVertLayers; ++K) { if (!isApprox(SpecVolH(I, K), LinearExpValue, RTol)) LOG_ERROR("EosTest: SpecVol Linear Bad Value: " @@ -177,15 +177,15 @@ void testEosLinearDisplaced() { const auto Mesh = HorzMesh::getDefault(); const auto VCoord = VertCoord::getDefault(); VCoord->NVertLayers = NVertLayers; - I4 NCellsAll = Mesh->NCellsAll; + I4 NCellsSize = Mesh->NCellsSize; /// Get Eos instance to test Eos *TestEos = Eos::getInstance(); TestEos->EosChoice = EosType::LinearEos; /// Create and fill ocean state arrays - Array2DReal SArray = Array2DReal("SArray", NCellsAll, NVertLayers); - Array2DReal TArray = Array2DReal("TArray", NCellsAll, NVertLayers); - Array2DReal PArray = Array2DReal("PArray", NCellsAll, NVertLayers); + Array2DReal SArray = Array2DReal("SArray", NCellsSize, NVertLayers); + Array2DReal TArray = Array2DReal("TArray", NCellsSize, NVertLayers); + Array2DReal PArray = Array2DReal("PArray", NCellsSize, NVertLayers); /// Use Kokkos::deep_copy to fill the entire view with the ref value deepCopy(SArray, Sa); deepCopy(TArray, Ct); @@ -227,7 +227,7 @@ void testEosLinearDisplaced() { // If test fails, print bad values and abort if (NumMismatches != 0) { auto SpecVolDisplacedH = createHostMirrorCopy(SpecVolDisplaced); - for (int I = 0; I < NCellsAll; ++I) { + for (int I = 0; I < Mesh->NCellsAll; ++I) { for (int K = 0; K < NVertLayers; ++K) { if (!isApprox(SpecVolDisplacedH(I, K), LinearExpValue, RTol)) LOG_ERROR("EosTest: SpecVol Linear Displaced Bad Value: " @@ -248,15 +248,15 @@ void testBruntVaisalaFreqSqLinear() { const auto Mesh = HorzMesh::getDefault(); const auto VCoord = VertCoord::getDefault(); VCoord->NVertLayers = NVertLayers; - I4 NCellsAll = Mesh->NCellsAll; + I4 NCellsSize = Mesh->NCellsSize; /// Get Eos instance to test Eos *TestEos = Eos::getInstance(); TestEos->EosChoice = EosType::LinearEos; /// Create and fill ocean state arrays - Array2DReal SArray = Array2DReal("SArray", NCellsAll, NVertLayers); - Array2DReal TArray = Array2DReal("TArray", NCellsAll, NVertLayers); - Array2DReal PArray = Array2DReal("PArray", NCellsAll, NVertLayers); + Array2DReal SArray = Array2DReal("SArray", NCellsSize, NVertLayers); + Array2DReal TArray = Array2DReal("TArray", NCellsSize, NVertLayers); + Array2DReal PArray = Array2DReal("PArray", NCellsSize, NVertLayers); /// Use deep copy to initialize results to zero deepCopy(TestEos->SpecVol, 0.0); deepCopy(TestEos->BruntVaisalaFreqSq, 0.0); @@ -265,7 +265,7 @@ void testBruntVaisalaFreqSqLinear() { // for K = 1. OMEGA_SCOPE(ZMid, VCoord->ZMid); parallelFor( - "populateArrays", {NCellsAll, NVertLayers}, + "populateArrays", {Mesh->NCellsAll, NVertLayers}, KOKKOS_LAMBDA(I4 ICell, I4 K) { if (K == 0) { ZMid(ICell, 0) = -992.1173890198451_Real; @@ -338,7 +338,7 @@ void testBruntVaisalaFreqSqLinear() { // If test fails, print bad values and abort if (NumMismatches != 0) { auto BruntVaisalaFreqSqH = createHostMirrorCopy(BruntVaisalaFreqSq); - for (int I = 0; I < NCellsAll; ++I) { + for (int I = 0; I < Mesh->NCellsAll; ++I) { // top layer should be zero if (BruntVaisalaFreqSqH(I, 0) != 0.0) LOG_ERROR("EosTest: Brunt-Vaisala Linear Bad Value: " @@ -372,15 +372,15 @@ void testEosTeos10() { const auto Mesh = HorzMesh::getDefault(); const auto VCoord = VertCoord::getDefault(); VCoord->NVertLayers = NVertLayers; - I4 NCellsAll = Mesh->NCellsAll; + I4 NCellsSize = Mesh->NCellsSize; /// Get Eos instance to test Eos *TestEos = Eos::getInstance(); TestEos->EosChoice = EosType::Teos10Eos; /// Create and fill ocean state arrays - Array2DReal SArray = Array2DReal("SArray", NCellsAll, NVertLayers); - Array2DReal TArray = Array2DReal("TArray", NCellsAll, NVertLayers); - Array2DReal PArray = Array2DReal("PArray", NCellsAll, NVertLayers); + Array2DReal SArray = Array2DReal("SArray", NCellsSize, NVertLayers); + Array2DReal TArray = Array2DReal("TArray", NCellsSize, NVertLayers); + Array2DReal PArray = Array2DReal("PArray", NCellsSize, NVertLayers); /// Use Kokkos::deep_copy to fill the entire view with the ref value deepCopy(SArray, Sa); deepCopy(TArray, Ct); @@ -421,7 +421,7 @@ void testEosTeos10() { // If test fails, print bad values and abort if (NumMismatches != 0) { auto SpecVolH = createHostMirrorCopy(SpecVol); - for (int I = 0; I < NCellsAll; ++I) { + for (int I = 0; I < Mesh->NCellsAll; ++I) { for (int K = 0; K < NVertLayers; ++K) { if (!isApprox(SpecVolH(I, K), LinearExpValue, RTol)) LOG_ERROR("EosTest: SpecVol TEOS Bad Value: " @@ -442,15 +442,15 @@ void testEosTeos10Displaced() { const auto Mesh = HorzMesh::getDefault(); const auto VCoord = VertCoord::getDefault(); VCoord->NVertLayers = NVertLayers; - I4 NCellsAll = Mesh->NCellsAll; + I4 NCellsSize = Mesh->NCellsSize; /// Get Eos instance to test Eos *TestEos = Eos::getInstance(); TestEos->EosChoice = EosType::Teos10Eos; /// Create and fill ocean state arrays - Array2DReal SArray = Array2DReal("SArray", NCellsAll, NVertLayers); - Array2DReal TArray = Array2DReal("TArray", NCellsAll, NVertLayers); - Array2DReal PArray = Array2DReal("PArray", NCellsAll, NVertLayers); + Array2DReal SArray = Array2DReal("SArray", NCellsSize, NVertLayers); + Array2DReal TArray = Array2DReal("TArray", NCellsSize, NVertLayers); + Array2DReal PArray = Array2DReal("PArray", NCellsSize, NVertLayers); /// Use Kokkos::deep_copy to fill the entire view with the ref value deepCopy(SArray, Sa); deepCopy(TArray, Ct); @@ -492,7 +492,7 @@ void testEosTeos10Displaced() { // If test fails, print bad values and abort if (NumMismatches != 0) { auto SpecVolDisplacedH = createHostMirrorCopy(SpecVolDisplaced); - for (int I = 0; I < NCellsAll; ++I) { + for (int I = 0; I < Mesh->NCellsAll; ++I) { for (int K = 0; K < NVertLayers; ++K) { if (!isApprox(SpecVolDisplacedH(I, K), LinearExpValue, RTol)) LOG_ERROR("EosTest: SpecVol Displaced TEOS Bad Value: " @@ -513,15 +513,15 @@ void testBruntVaisalaFreqSqTeos10() { const auto Mesh = HorzMesh::getDefault(); const auto VCoord = VertCoord::getDefault(); VCoord->NVertLayers = NVertLayers; - I4 NCellsAll = Mesh->NCellsAll; + I4 NCellsSize = Mesh->NCellsSize; /// Get Eos instance to test Eos *TestEos = Eos::getInstance(); TestEos->EosChoice = EosType::Teos10Eos; /// Create and fill ocean state arrays - Array2DReal SArray = Array2DReal("SArray", NCellsAll, NVertLayers); - Array2DReal TArray = Array2DReal("TArray", NCellsAll, NVertLayers); - Array2DReal PArray = Array2DReal("PArray", NCellsAll, NVertLayers); + Array2DReal SArray = Array2DReal("SArray", NCellsSize, NVertLayers); + Array2DReal TArray = Array2DReal("TArray", NCellsSize, NVertLayers); + Array2DReal PArray = Array2DReal("PArray", NCellsSize, NVertLayers); /// Use deep copy to initialize results to zero deepCopy(TestEos->BruntVaisalaFreqSq, 0.0); deepCopy(TestEos->SpecVol, 0.0); @@ -529,7 +529,7 @@ void testBruntVaisalaFreqSqTeos10() { /// Fill inputs with values that should lead to ref result for K=1 OMEGA_SCOPE(ZMid, VCoord->ZMid); parallelFor( - "populateArrays", {NCellsAll, NVertLayers}, + "populateArrays", {Mesh->NCellsAll, NVertLayers}, KOKKOS_LAMBDA(I4 ICell, I4 K) { if (K == 0) { ZMid(ICell, 0) = -992.1173890198451_Real; @@ -602,7 +602,7 @@ void testBruntVaisalaFreqSqTeos10() { // If test fails, print bad values and abort if (NumMismatches != 0) { auto BruntVaisalaFreqSqH = createHostMirrorCopy(BruntVaisalaFreqSq); - for (int ICell = 0; ICell < NCellsAll; ++ICell) { + for (int ICell = 0; ICell < Mesh->NCellsAll; ++ICell) { // top layer should be zero if (BruntVaisalaFreqSqH(ICell, 0) != 0.0) LOG_ERROR("EosTest: Brunt-Vaisala TEOS Bad Value: " diff --git a/components/omega/test/ocn/VertMixTest.cpp b/components/omega/test/ocn/VertMixTest.cpp index 9c0cf2101867..96d1195e039f 100644 --- a/components/omega/test/ocn/VertMixTest.cpp +++ b/components/omega/test/ocn/VertMixTest.cpp @@ -105,7 +105,6 @@ void testBackVertMix() { VCoord->NVertLayers = NVertLayers; I4 NCellsSize = Mesh->NCellsSize; I4 NEdgesSize = Mesh->NEdgesSize; - I4 NCellsAll = Mesh->NCellsAll; I4 NEdgesAll = Mesh->NEdgesAll; OMEGA_SCOPE(ZMid, VCoord->ZMid); @@ -126,7 +125,7 @@ void testBackVertMix() { deepCopy(TestVertMix->VertVisc, 0.0); parallelFor( - "populateArrays", {NCellsAll, NVertLayers}, + "populateArrays", {Mesh->NCellsAll, NVertLayers}, KOKKOS_LAMBDA(I4 ICell, I4 K) { ZMid(ICell, K) = -K; }); parallelFor( @@ -231,7 +230,7 @@ void testConvVertMix() { const auto Mesh = HorzMesh::getDefault(); const auto VCoord = VertCoord::getDefault(); VCoord->NVertLayers = NVertLayers; - I4 NCellsAll = Mesh->NCellsAll; + I4 NCellsSize = Mesh->NCellsSize; I4 NEdgesAll = Mesh->NEdgesAll; OMEGA_SCOPE(ZMid, VCoord->ZMid); @@ -242,7 +241,7 @@ void testConvVertMix() { auto NormalVelEdge = Array2DReal("NormalVelEdge", NEdgesAll, NVertLayers); auto TangVelEdge = Array2DReal("TangVelEdge", NEdgesAll, NVertLayers); auto BruntVaisalaFreqSqCell = - Array2DReal("BruntVaisalaFreqSqCell", NCellsAll, NVertLayers); + Array2DReal("BruntVaisalaFreqSqCell", NCellsSize, NVertLayers); /// Use deep copy to initialize with the ref value deepCopy(NormalVelEdge, NV); @@ -252,7 +251,7 @@ void testConvVertMix() { deepCopy(TestVertMix->VertVisc, 0.0); parallelFor( - "populateArrays", {NCellsAll, NVertLayers}, + "populateArrays", {Mesh->NCellsAll, NVertLayers}, KOKKOS_LAMBDA(I4 ICell, I4 K) { ZMid(ICell, K) = -K; }); parallelFor( @@ -358,7 +357,7 @@ void testShearVertMix() { const auto Mesh = HorzMesh::getDefault(); const auto VCoord = VertCoord::getDefault(); VCoord->NVertLayers = NVertLayers; - I4 NCellsAll = Mesh->NCellsAll; + I4 NCellsSize = Mesh->NCellsSize; I4 NEdgesAll = Mesh->NEdgesAll; OMEGA_SCOPE(ZMid, VCoord->ZMid); OMEGA_SCOPE(NEdgesOnCell, Mesh->NEdgesOnCell); @@ -373,7 +372,7 @@ void testShearVertMix() { auto NormalVelEdge = Array2DReal("NormalVelEdge", NEdgesAll, NVertLayers); auto TangVelEdge = Array2DReal("TangVelEdge", NEdgesAll, NVertLayers); auto BruntVaisalaFreqSqCell = - Array2DReal("BruntVaisalaFreqSqCell", NCellsAll, NVertLayers); + Array2DReal("BruntVaisalaFreqSqCell", NCellsSize, NVertLayers); /// Use Kokkos::deep_copy to fill the entire view with the ref value deepCopy(NormalVelEdge, NV); @@ -383,7 +382,7 @@ void testShearVertMix() { deepCopy(TestVertMix->VertVisc, 0.0); parallelFor( - "populateArrays", {NCellsAll, NVertLayers}, + "populateArrays", {Mesh->NCellsAll, NVertLayers}, KOKKOS_LAMBDA(I4 ICell, I4 K) { ZMid(ICell, K) = -K; NEdgesOnCell(ICell) = 5; @@ -508,7 +507,7 @@ void testTotalVertMix() { const auto Mesh = HorzMesh::getDefault(); const auto VCoord = VertCoord::getDefault(); VCoord->NVertLayers = NVertLayers; - I4 NCellsAll = Mesh->NCellsAll; + I4 NCellsSize = Mesh->NCellsSize; I4 NEdgesAll = Mesh->NEdgesAll; OMEGA_SCOPE(ZMid, VCoord->ZMid); OMEGA_SCOPE(NEdgesOnCell, Mesh->NEdgesOnCell); @@ -523,7 +522,7 @@ void testTotalVertMix() { auto NormalVelEdge = Array2DReal("NormalVelEdge", NEdgesAll, NVertLayers); auto TangVelEdge = Array2DReal("TangVelEdge", NEdgesAll, NVertLayers); auto BruntVaisalaFreqSqCell = - Array2DReal("BruntVaisalaFreqSqCell", NCellsAll, NVertLayers); + Array2DReal("BruntVaisalaFreqSqCell", NCellsSize, NVertLayers); /// Use deep copy to initialize with the ref value deepCopy(NormalVelEdge, NV); @@ -535,7 +534,7 @@ void testTotalVertMix() { deepCopy(TestVertMix->VertVisc, 0.0); parallelFor( - "populateArrays", {NCellsAll, NVertLayers}, + "populateArrays", {Mesh->NCellsAll, NVertLayers}, KOKKOS_LAMBDA(I4 ICell, I4 K) { ZMid(ICell, K) = -K; NEdgesOnCell(ICell) = 5;