Skip to content

Commit

Permalink
Fix the ice thermo tests. (#700)
Browse files Browse the repository at this point in the history
# ModelComponent fix 3

Fixes #614 (partially, incrementally)

---
# Change Description

Add masking to the thermodynamics test.

---
# Test Description

The thermodynamics tests now pass.
  • Loading branch information
timspainNERSC authored Sep 9, 2024
2 parents 3fe4b37 + e1fbd1a commit 4906892
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions physics/test/ThermoIce0_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,14 @@ TEST_CASE("Threshold ice")

fluxData.setData(ModelState::DataMap());


TimestepTime tst = { TimePoint("2000-01-01T00:00:00"), Duration(600) };
ThermoIce0 ti0t;
ti0t.configure();
ti0t.setData(ModelState::DataMap());
HField mask(ModelArray::Type::H);
mask = 1;
ti0t.setOceanMask(mask);
ti0t.update(tst);

ModelArrayRef<Shared::H_ICE> hice(ModelComponent::getStore());
Expand Down
9 changes: 9 additions & 0 deletions physics/test/ThermoWintonTemperature_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ TEST_CASE("Melting conditions")
TimestepTime tst = { TimePoint("2000-001"), Duration("P0-0T0:10:0") };

twin.configure();
HField mask(ModelArray::Type::H);
mask = 1;
twin.setOceanMask(mask);
twin.update(tst);
ModelArrayRef<Shared::T_ICE, RO> tice(ModelComponent::getStore());
ModelArrayRef<Shared::Q_IC, RO> qic(ModelComponent::getStore());
Expand Down Expand Up @@ -225,6 +228,9 @@ TEST_CASE("Freezing conditions")
TimestepTime tst = { TimePoint("2000-001"), Duration("P0-0T0:10:0") };

twin.configure();
HField mask(ModelArray::Type::H);
mask = 1;
twin.setOceanMask(mask);
twin.update(tst);

ModelArrayRef<Shared::T_ICE, RO> tice(ModelComponent::getStore());
Expand Down Expand Up @@ -344,6 +350,9 @@ TEST_CASE("No ice do nothing")
TimestepTime tst = { TimePoint("2000-001"), Duration("P0-0T0:10:0") };

twin.configure();
HField mask(ModelArray::Type::H);
mask = 1;
twin.setOceanMask(mask);
twin.update(tst);

ModelArrayRef<Shared::H_ICE, RO> hice(ModelComponent::getStore());
Expand Down

0 comments on commit 4906892

Please sign in to comment.