Skip to content

Commit c314139

Browse files
committed
Align XIOS tests with midnight
1 parent c3e4af4 commit c314139

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

core/test/XiosAxis_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ MPI_TEST_CASE("TestXiosAxis", 3)
3030
{
3131
std::stringstream config;
3232
config << "[model]" << std::endl;
33-
config << "start = 2023-03-17T17:11:00Z" << std::endl;
34-
config << "stop = 2023-03-17T18:11:00Z" << std::endl;
33+
config << "start = 2023-03-17T00:00:00Z" << std::endl;
34+
config << "stop = 2023-03-17T00:00:00Z" << std::endl;
3535
config << "time_step = P0-0T01:00:00" << std::endl;
3636
config << "partition_file = xios_test_partition_metadata_3.nc" << std::endl;
3737
std::unique_ptr<std::istream> pcstream(new std::stringstream(config.str()));

core/test/XiosCalendar_test.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ MPI_TEST_CASE("TestXiosCalendar", 1)
3131
{
3232
std::stringstream config;
3333
config << "[model]" << std::endl;
34-
config << "start = 2023-03-17T17:11:00Z" << std::endl;
35-
config << "stop = 2023-03-17T18:11:00Z" << std::endl;
34+
config << "start = 2023-03-17T00:00:00Z" << std::endl;
35+
config << "stop = 2023-03-17T00:00:00Z" << std::endl;
3636
config << "time_step = P0-0T01:00:00" << std::endl;
3737
config << "partition_file = xios_test_partition_metadata_1.nc" << std::endl;
3838
std::unique_ptr<std::istream> pcstream(new std::stringstream(config.str()));
@@ -53,11 +53,11 @@ MPI_TEST_CASE("TestXiosCalendar", 1)
5353

5454
// --- Tests for calendar API
5555
// Calendar start
56-
REQUIRE(xiosHandler.getCalendarStart().format() == "2023-03-17T17:11:00Z"); // Set in config
57-
TimePoint start("2023-03-17T20:11:00Z");
56+
REQUIRE(xiosHandler.getCalendarStart().format() == "2023-03-17T00:00:00Z"); // Set in config
57+
TimePoint start("2023-03-18T00:00:00Z");
5858
xiosHandler.setCalendarStart(start);
5959
REQUIRE(start == xiosHandler.getCalendarStart());
60-
REQUIRE(start.format() == "2023-03-17T20:11:00Z");
60+
REQUIRE(start.format() == "2023-03-18T00:00:00Z");
6161
// Timestep
6262
ModelMetadata& metadata = ModelMetadata::getInstance();
6363
REQUIRE(metadata.stepLength().seconds() == 3600.0); // Read from config
@@ -67,12 +67,12 @@ MPI_TEST_CASE("TestXiosCalendar", 1)
6767

6868
// --- Tests for getCurrentDate method
6969
REQUIRE(xiosHandler.getCalendarStep() == 0);
70-
REQUIRE(xiosHandler.getCurrentDate().format() == "2023-03-17T20:11:00Z");
70+
REQUIRE(xiosHandler.getCurrentDate().format() == "2023-03-18T00:00:00Z");
7171

7272
// -- Tests that the timestep is set up correctly
7373
xiosHandler.setCalendarStep(1);
7474
REQUIRE(xiosHandler.getCalendarStep() == 1);
75-
REQUIRE(xiosHandler.getCurrentDate().format() == "2023-03-17T21:11:00Z");
75+
REQUIRE(xiosHandler.getCurrentDate().format() == "2023-03-18T01:00:00Z");
7676

7777
xiosHandler.context_finalize();
7878
Finalizer::finalize();

core/test/XiosReadDiagnostic_test.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
const std::string testFilesDir = TEST_FILES_DIR;
2020
const std::string diagnosticFilename
21-
= testFilesDir + "/diagnostic_2023-03-17T17:11:00Z-2023-03-17T20:10:59Z.nc";
21+
= testFilesDir + "/diagnostic_2023-03-17T00:00:00Z-2023-03-17T02:59:59Z.nc";
2222

2323
static const int DGCOMP = 6;
2424
static const int DGSTRESSCOMP = 8;
@@ -37,8 +37,8 @@ MPI_TEST_CASE("TestXiosReadDiagnostic", 3)
3737
{
3838
std::stringstream config;
3939
config << "[model]" << std::endl;
40-
config << "start = 2023-03-17T17:11:00Z" << std::endl;
41-
config << "stop = 2023-03-17T23:11:00Z" << std::endl;
40+
config << "start = 2023-03-17T00:00:00Z" << std::endl;
41+
config << "stop = 2023-03-17T00:00:00Z" << std::endl;
4242
config << "time_step = P0-0T01:30:00" << std::endl;
4343
config << "init_file = " << diagnosticFilename << std::endl;
4444
config << "restart_period = P0-0T03:00:00" << std::endl;
@@ -91,8 +91,8 @@ MPI_TEST_CASE("TestXiosReadDiagnostic", 3)
9191
int rank;
9292
MPI_Comm_rank(test_comm, &rank);
9393
if (rank == 0) {
94-
std::filesystem::remove("diagnostic_2023-03-17T17:11:00Z-2023-03-17T20:10:59Z.nc");
95-
std::filesystem::remove("diagnostic_2023-03-17T20:11:00Z-2023-03-17T23:10:59Z.nc");
94+
std::filesystem::remove("diagnostic_2023-03-17T00:00:00Z-2023-03-17T02:59:59Z.nc");
95+
std::filesystem::remove("diagnostic_2023-03-17T03:00:00Z-2023-03-17T05:59:59Z.nc");
9696
}
9797

9898
xiosHandler.context_finalize();

core/test/XiosReadRestart_test.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
const std::string testFilesDir = TEST_FILES_DIR;
2020
const std::string restartFilename
21-
= testFilesDir + "/restart_2023-03-17T17:11:00Z-2023-03-17T20:10:59Z.nc";
21+
= testFilesDir + "/restart_2023-03-17T00:00:00Z-2023-03-17T02:59:59Z.nc";
2222

2323
static const int DGCOMP = 6;
2424
static const int DGSTRESSCOMP = 8;
@@ -35,8 +35,8 @@ MPI_TEST_CASE("TestXiosReadRestart", 2)
3535
{
3636
std::stringstream config;
3737
config << "[model]" << std::endl;
38-
config << "start = 2023-03-17T17:11:00Z" << std::endl;
39-
config << "stop = 2023-03-17T23:11:00Z" << std::endl;
38+
config << "start = 2023-03-17T00:00:00Z" << std::endl;
39+
config << "stop = 2023-03-17T00:00:00Z" << std::endl;
4040
config << "time_step = P0-0T01:30:00" << std::endl;
4141
config << "init_file = " << restartFilename << std::endl;
4242
config << "restart_period = P0-0T03:00:00" << std::endl;
@@ -79,7 +79,7 @@ MPI_TEST_CASE("TestXiosReadRestart", 2)
7979
// StructureFactory::stateFromFile()
8080
int rank;
8181
MPI_Comm_rank(test_comm, &rank);
82-
float ts = 2; // Corresponds to 2023-03-17T20:10:59Z
82+
float ts = 2; // Corresponds to 2023-03-17T02:59:59Z
8383
ModelState modelstate = StructureFactory::stateFromFile(restartFilename);
8484
ModelArray& mask = modelstate.data.at(maskName);
8585
for (size_t j = 0; j < ny; ++j) {
@@ -172,8 +172,8 @@ MPI_TEST_CASE("TestXiosReadRestart", 2)
172172

173173
// Remove the restart files
174174
if (rank == 0) {
175-
std::filesystem::remove("restart_2023-03-17T17:11:00Z-2023-03-17T20:10:59Z.nc");
176-
std::filesystem::remove("restart_2023-03-17T20:11:00Z-2023-03-17T23:10:59Z.nc");
175+
std::filesystem::remove("restart_2023-03-17T00:00:00Z-2023-03-17T02:59:59Z.nc");
176+
std::filesystem::remove("restart_2023-03-17T03:00:00Z-2023-03-17T05:59:59Z.nc");
177177
}
178178

179179
xiosHandler.context_finalize();

core/test/XiosReadWriteRestart_test.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ MPI_TEST_CASE("TestXiosReadWriteRestart", 2)
3636
{
3737
std::stringstream config;
3838
config << "[model]" << std::endl;
39-
config << "start = 2023-03-17T17:11:00Z" << std::endl;
40-
config << "stop = 2023-03-17T23:11:00Z" << std::endl;
39+
config << "start = 2023-03-17T00:00:00Z" << std::endl;
40+
config << "stop = 2023-03-17T00:00:00Z" << std::endl;
4141
config << "time_step = P0-0T01:30:00" << std::endl;
4242
config << "init_file = " << inputFilename << std::endl;
4343
config << "restart_file = " << outputFilename << std::endl;
@@ -95,11 +95,11 @@ MPI_TEST_CASE("TestXiosReadWriteRestart", 2)
9595
}
9696

9797
// Check the files have indeed been created then remove them
98-
REQUIRE(std::filesystem::exists("readwrite_2023-03-17T17:11:00Z-2023-03-17T20:10:59Z.nc"));
99-
REQUIRE(std::filesystem::exists("readwrite_2023-03-17T20:11:00Z-2023-03-17T23:10:59Z.nc"));
98+
REQUIRE(std::filesystem::exists("readwrite_2023-03-17T00:00:00Z-2023-03-17T02:59:59Z.nc"));
99+
REQUIRE(std::filesystem::exists("readwrite_2023-03-17T03:00:00Z-2023-03-17T05:59:59Z.nc"));
100100
if (rank == 0) {
101-
std::filesystem::remove("readwrite_2023-03-17T17:11:00Z-2023-03-17T20:10:59Z.nc");
102-
std::filesystem::remove("readwrite_2023-03-17T20:11:00Z-2023-03-17T23:10:59Z.nc");
101+
std::filesystem::remove("readwrite_2023-03-17T00:00:00Z-2023-03-17T02:59:59Z.nc");
102+
std::filesystem::remove("readwrite_2023-03-17T03:00:00Z-2023-03-17T05:59:59Z.nc");
103103
}
104104

105105
xiosHandler.context_finalize();

core/test/XiosWriteDiagnostic_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ MPI_TEST_CASE("TestXiosWriteDiagnostic", 2)
3636
{
3737
std::stringstream config;
3838
config << "[model]" << std::endl;
39-
config << "start = 2023-03-17T17:11:00Z" << std::endl;
40-
config << "stop = 2023-03-17T23:11:00Z" << std::endl;
39+
config << "start = 2023-03-17T00:00:00Z" << std::endl;
40+
config << "stop = 2023-03-17T06:00:00Z" << std::endl;
4141
config << "time_step = P0-0T01:30:00" << std::endl;
4242
config << "init_file = " << inputFilename << std::endl;
4343
config << "partition_file = xios_test_partition_metadata_2.nc" << std::endl;
@@ -118,8 +118,8 @@ MPI_TEST_CASE("TestXiosWriteDiagnostic", 2)
118118
// Check the files have indeed been created
119119
// NOTE: Don't remove them because their contents are checked in
120120
// XiosReadxios_test_diagnostic_test
121-
REQUIRE(std::filesystem::exists("diagnostic_2023-03-17T17:11:00Z-2023-03-17T20:10:59Z.nc"));
122-
REQUIRE(std::filesystem::exists("diagnostic_2023-03-17T20:11:00Z-2023-03-17T23:10:59Z.nc"));
121+
REQUIRE(std::filesystem::exists("diagnostic_2023-03-17T00:00:00Z-2023-03-17T02:59:59Z.nc"));
122+
REQUIRE(std::filesystem::exists("diagnostic_2023-03-17T03:00:00Z-2023-03-17T05:59:59Z.nc"));
123123

124124
xiosHandler.context_finalize();
125125
Finalizer::finalize();

core/test/XiosWriteRestart_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ MPI_TEST_CASE("TestXiosWriteRestart", 2)
3636
{
3737
std::stringstream config;
3838
config << "[model]" << std::endl;
39-
config << "start = 2023-03-17T17:11:00Z" << std::endl;
40-
config << "stop = 2023-03-17T23:11:00Z" << std::endl;
39+
config << "start = 2023-03-17T00:00:00Z" << std::endl;
40+
config << "stop = 2023-03-17T00:00:00Z" << std::endl;
4141
config << "time_step = P0-0T01:30:00" << std::endl;
4242
config << "init_file = " << inputFilename << std::endl;
4343
config << "restart_file = " << outputFilename << std::endl;
@@ -248,8 +248,8 @@ MPI_TEST_CASE("TestXiosWriteRestart", 2)
248248

249249
// Check the files have indeed been created
250250
// NOTE: Don't remove them because their contents are checked in XiosReadRestart_test
251-
REQUIRE(std::filesystem::exists("restart_2023-03-17T17:11:00Z-2023-03-17T20:10:59Z.nc"));
252-
REQUIRE(std::filesystem::exists("restart_2023-03-17T20:11:00Z-2023-03-17T23:10:59Z.nc"));
251+
REQUIRE(std::filesystem::exists("restart_2023-03-17T00:00:00Z-2023-03-17T02:59:59Z.nc"));
252+
REQUIRE(std::filesystem::exists("restart_2023-03-17T03:00:00Z-2023-03-17T05:59:59Z.nc"));
253253

254254
xiosHandler.context_finalize();
255255
Finalizer::finalize();

0 commit comments

Comments
 (0)