diff --git a/components/omega/test/ocn/VertCoordTest.cpp b/components/omega/test/ocn/VertCoordTest.cpp index 96a6ffcac5d1..b0ecb8b5508b 100644 --- a/components/omega/test/ocn/VertCoordTest.cpp +++ b/components/omega/test/ocn/VertCoordTest.cpp @@ -242,6 +242,7 @@ int main(int argc, char *argv[]) { DefVertCoord->computeZHeight(LayerThickness, SpecVol); auto ZInterfH = createHostMirrorCopy(DefVertCoord->ZInterface); auto ZMidH = createHostMirrorCopy(DefVertCoord->ZMid); + auto SshCellH = createHostMirrorCopy(DefVertCoord->SshCell); /// Check results Err = 0; @@ -261,6 +262,12 @@ int main(int argc, char *argv[]) { Err += 1; } } + /// SshCell should equal ZInterface at the top of the active column + Real Expected = -DefVertCoord->MinLayerCellH(ICell); + Real Diff = std::abs(SshCellH(ICell) - Expected); + if (Diff > 1e-10) { + Err += 1; + } } /// Determine test pass/fail @@ -289,6 +296,7 @@ int main(int argc, char *argv[]) { /// Call functions and get host copy of output DefVertCoord->computeZHeight(LayerThickness, SpecVol); auto ZInterfH2 = createHostMirrorCopy(DefVertCoord->ZInterface); + auto SshCellH2 = createHostMirrorCopy(DefVertCoord->SshCell); /// Check results Err = 0; @@ -302,6 +310,14 @@ int main(int argc, char *argv[]) { Err += 1; } } + /// SshCell should equal ZInterface at the top of the active column, + /// which is -((MinLayer+1)*MinLayer)/2 + I4 MinK = DefVertCoord->MinLayerCellH(ICell); + Real Expected = -((MinK + 1.0_Real) * MinK) / 2.0_Real; + Real Diff = std::abs(SshCellH2(ICell) - Expected); + if (Diff > 1e-10) { + Err += 1; + } } /// Determine test pass/fail