Skip to content

Commit

Permalink
Don't build RectGrid_test with XIOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Dec 9, 2024
1 parent 51dbfb5 commit 954b07d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 28 deletions.
22 changes: 11 additions & 11 deletions core/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 0 additions & 17 deletions core/test/RectGrid_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 954b07d

Please sign in to comment.