Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions components/omega/test/ocn/VertCoordTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down
Loading