From 954b07d398b7482c7b07f198c5f41a749b2c38ba Mon Sep 17 00:00:00 2001 From: Joe Wallwork Date: Mon, 9 Dec 2024 16:34:19 +0000 Subject: [PATCH] Don't build RectGrid_test with XIOS --- core/test/CMakeLists.txt | 22 +++++++++++----------- core/test/RectGrid_test.cpp | 17 ----------------- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index e2d440cff..15ae0c2c3 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -94,6 +94,17 @@ if(ENABLE_MPI) PRIVATE "${MODEL_INCLUDE_DIR}" "${XIOS_INCLUDE_LIST}" "${ModulesRoot}/StructureModule" ) target_link_libraries(testXiosReadWrite_MPI2 PRIVATE nextsimlib doctest::doctest) + else() + add_executable(testRectGrid_MPI3 "RectGrid_test.cpp" "MainMPI.cpp") + target_compile_definitions( + testRectGrid_MPI3 + PRIVATE TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" + ) + target_include_directories( + testRectGrid_MPI3 + PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" + ) + target_link_libraries(testRectGrid_MPI3 PRIVATE nextsimlib doctest::doctest) endif() # Generate partition files needed for MPI test from respective cdl files @@ -115,17 +126,6 @@ if(ENABLE_MPI) DEPENDS partition_metadata_3.nc partition_metadata_2.nc ) - add_executable(testRectGrid_MPI3 "RectGrid_test.cpp" "MainMPI.cpp") - target_compile_definitions( - testRectGrid_MPI3 - PRIVATE TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" - ) - target_include_directories( - testRectGrid_MPI3 - PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" - ) - target_link_libraries(testRectGrid_MPI3 PRIVATE nextsimlib doctest::doctest) - add_executable(testParaGrid_MPI2 "ParaGrid_test.cpp" "MainMPI.cpp") target_compile_definitions( testParaGrid_MPI2 diff --git a/core/test/RectGrid_test.cpp b/core/test/RectGrid_test.cpp index c4d364c52..ec6c0c296 100644 --- a/core/test/RectGrid_test.cpp +++ b/core/test/RectGrid_test.cpp @@ -84,16 +84,7 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") {} }; ModelMetadata metadata; -#ifdef USE_XIOS - enableXios(); - Xios xiosHandler("test1a"); - xiosHandler.setCalendarOrigin(TimePoint("1970-01-01T00:00:00Z")); - metadata.setXiosHandler(&xiosHandler); -#endif metadata.setTime(TimePoint(date_string)); -#ifdef USE_XIOS - xiosHandler.close_context_definition(); -#endif // Use x & y coordinates ModelArray x(ModelArray::Type::H); ModelArray y(ModelArray::Type::H); @@ -159,15 +150,7 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") gridIn.setIO(new RectGridIO(grid)); #ifdef USE_MPI ModelMetadata metadataIn(partition_filename, test_comm); -#ifdef USE_XIOS - Xios xiosHandlerIn("test1b"); - xiosHandlerIn.setCalendarOrigin(TimePoint("1970-01-01T00:00:00Z")); - metadata.setXiosHandler(&xiosHandlerIn); -#endif metadataIn.setTime(TimePoint(date_string)); -#ifdef USE_XIOS - xiosHandlerIn.close_context_definition(); -#endif ModelState ms = gridIn.getModelState(filename, metadataIn); #else ModelState ms = gridIn.getModelState(filename);