From b78efb90266372a534fd4e1641d680143cd6804e Mon Sep 17 00:00:00 2001 From: melt Date: Fri, 23 Aug 2024 14:53:02 +0200 Subject: [PATCH 01/53] feat: added metadata info on neighbours add metadata info for periodic and non-periodic neighbours i.e., halo sizes, starting indices etc. add an associated unit test to check values are read correctly from file. --- core/src/ModelMetadata.cpp | 86 ++++++++++++++- core/src/include/ModelMetadata.hpp | 26 ++++- core/test/CMakeLists.txt | 80 ++++++++++++++ core/test/ModelMetadata_test.cpp | 149 ++++++++++++++++++++++++++ core/test/partition_metadata_3_cb.cdl | 108 +++++++++++++++++++ core/test/partition_metadata_3_pb.cdl | 132 +++++++++++++++++++++++ 6 files changed, 575 insertions(+), 6 deletions(-) create mode 100644 core/test/ModelMetadata_test.cpp create mode 100644 core/test/partition_metadata_3_cb.cdl create mode 100644 core/test/partition_metadata_3_pb.cdl diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index 15e328970..151dc7201 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -13,6 +13,9 @@ #ifdef USE_XIOS #include "include/Xios.hpp" #endif +#include "mpi.h" +#include +#include #ifdef USE_MPI #include @@ -42,6 +45,75 @@ void ModelMetadata::setMpiMetadata(MPI_Comm comm) MPI_Comm_rank(mpiComm, &mpiMyRank); } +void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) +{ + netCDF::NcGroup neighbourGroup(ncFile.getGroup(neighbourName)); + std::string varName {}; + for (auto edge : edges) { + size_t nStart {}; // start point in metadata arrays + size_t count {}; // number of elements to read from metadata arrays + std::vector numNeighbours = std::vector(mpiSize, 0); + std::vector offsets = std::vector(mpiSize, 0); + + // non-periodic neighbours + varName = edgeNames[edge] + "_neighbours"; + neighbourGroup.getVar(varName).getVar( + { 0 }, { static_cast(mpiSize) }, &numNeighbours[0]); + + // compute start index for each process + MPI_Exscan(&numNeighbours[mpiMyRank], &nStart, 1, MPI_INT, MPI_SUM, mpiComm); + // how many elements to read for each process + count = numNeighbours[mpiMyRank]; + + if (count) { + // initialize neighbour info to zero and correct size + neighbourRanks[edge].resize(count, 0); + neighbourExtents[edge].resize(count, 0); + neighbourHaloStarts[edge].resize(count, 0); + + varName = edgeNames[edge] + "_neighbour_ids"; + neighbourGroup.getVar(varName).getVar({ nStart }, { count }, &neighbourRanks[edge][0]); + + varName = edgeNames[edge] + "_neighbour_halos"; + neighbourGroup.getVar(varName).getVar( + { nStart }, { count }, &neighbourExtents[edge][0]); + + varName = edgeNames[edge] + "_neighbour_halo_starts"; + neighbourGroup.getVar(varName).getVar( + { nStart }, { count }, &neighbourHaloStarts[edge][0]); + } + + // periodic neighbours + varName = edgeNames[edge] + "_neighbours_periodic"; + neighbourGroup.getVar(varName).getVar( + { 0 }, { static_cast(mpiSize) }, &numNeighbours[0]); + + // compute start index for each process + MPI_Exscan(&numNeighbours[mpiMyRank], &nStart, 1, MPI_INT, MPI_SUM, mpiComm); + // how many elements to read for each process + count = numNeighbours[mpiMyRank]; + + if (count) { + // initialize neighbour info to zero and correct size + neighbourRanksPeriodic[edge].resize(count, 0); + neighbourExtentsPeriodic[edge].resize(count, 0); + neighbourHaloStartsPeriodic[edge].resize(count, 0); + + varName = edgeNames[edge] + "_neighbour_ids_periodic"; + neighbourGroup.getVar(varName).getVar( + { nStart }, { count }, &neighbourRanksPeriodic[edge][0]); + + varName = edgeNames[edge] + "_neighbour_halos_periodic"; + neighbourGroup.getVar(varName).getVar( + { nStart }, { count }, &neighbourExtentsPeriodic[edge][0]); + + varName = edgeNames[edge] + "_neighbour_halo_starts_periodic"; + neighbourGroup.getVar(varName).getVar( + { nStart }, { count }, &neighbourHaloStartsPeriodic[edge][0]); + } + } +} + void ModelMetadata::getPartitionMetadata(std::string partitionFile) { // TODO: Move the reading of the partition file to its own class @@ -56,11 +128,15 @@ void ModelMetadata::getPartitionMetadata(std::string partitionFile) globalExtentX = ncFile.getDim("NX").getSize(); globalExtentY = ncFile.getDim("NY").getSize(); netCDF::NcGroup bboxGroup(ncFile.getGroup(bboxName)); - std::vector index(1, mpiMyRank); - bboxGroup.getVar("domain_x").getVar(index, &localCornerX); - bboxGroup.getVar("domain_y").getVar(index, &localCornerY); - bboxGroup.getVar("domain_extent_x").getVar(index, &localExtentX); - bboxGroup.getVar("domain_extent_y").getVar(index, &localExtentY); + + std::vector rank(1, mpiMyRank); + bboxGroup.getVar("domain_x").getVar(rank, &localCornerX); + bboxGroup.getVar("domain_y").getVar(rank, &localCornerY); + bboxGroup.getVar("domain_extent_x").getVar(rank, &localExtentX); + bboxGroup.getVar("domain_extent_y").getVar(rank, &localExtentY); + + readNeighbourData(ncFile); + ncFile.close(); } diff --git a/core/src/include/ModelMetadata.hpp b/core/src/include/ModelMetadata.hpp index ae25940ab..9c0859e0d 100644 --- a/core/src/include/ModelMetadata.hpp +++ b/core/src/include/ModelMetadata.hpp @@ -12,7 +12,9 @@ #include "include/ModelArray.hpp" #include "include/ModelState.hpp" #include "include/Time.hpp" +#include #include +#include #ifdef USE_MPI #include @@ -92,13 +94,34 @@ class ModelMetadata { */ void getPartitionMetadata(std::string partitionFile); + enum Edge { BOTTOM, RIGHT, TOP, LEFT, N_EDGE }; + // An array to allow the edges to be accessed in the correct order. + static constexpr std::array edges = { BOTTOM, RIGHT, TOP, LEFT }; + std::array edgeNames = { "bottom", "right", "top", "left" }; + MPI_Comm mpiComm; int mpiSize = 0; int mpiMyRank = -1; - int localCornerX, localCornerY, localExtentX, localExtentY, globalExtentX, globalExtentY; + int localCornerX, localCornerY; + int localExtentX, localExtentY; + int globalExtentX, globalExtentY; + // mpi rank ID and extent for each edge direction + std::array, N_EDGE> neighbourRanks; + std::array, N_EDGE> neighbourExtents; + std::array, N_EDGE> neighbourHaloStarts; + std::array, N_EDGE> neighbourRanksPeriodic; + std::array, N_EDGE> neighbourExtentsPeriodic; + std::array, N_EDGE> neighbourHaloStartsPeriodic; #endif private: + /*! + * @brief Read neighbour metadata from netCDF file + * + * @param netCDF file with partition metadata + */ + void readNeighbourData(netCDF::NcFile& ncFile); + TimePoint m_time; ConfigMap m_config; @@ -115,6 +138,7 @@ class ModelMetadata { bool hasParameters = false; #ifdef USE_MPI const std::string bboxName = "bounding_boxes"; + const std::string neighbourName = "connectivity"; #endif }; diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index 3ff31ca5e..da71aff06 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -19,6 +19,86 @@ include_directories(${COMMON_INCLUDE_DIRS}) set(MODEL_INCLUDE_DIR "../../core/src/discontinuousgalerkin") if(ENABLE_MPI) + # Generate partition files needed for MPI test from respective cdl files + add_custom_command( + OUTPUT partition_metadata_3.nc + COMMAND + ncgen -b -o partition_metadata_3.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3.cdl + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3.cdl + ) + add_custom_command( + OUTPUT partition_metadata_2.nc + COMMAND + ncgen -b -o partition_metadata_2.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_2.cdl + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_2.cdl + ) + add_custom_command( + OUTPUT partition_metadata_3_cb.nc partition_metadata_3_pb.nc + COMMAND + ncgen -b -o partition_metadata_3_cb.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl + COMMAND + ncgen -b -o partition_metadata_3_pb.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl + ) + add_custom_target( + generate_partition_files + ALL + DEPENDS + partition_metadata_3.nc + partition_metadata_2.nc + partition_metadata_3_cb.nc + partition_metadata_3_pb.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(testModelMetadata_MPI3 "ModelMetadata_test.cpp" "MainMPI.cpp") + target_compile_definitions( + testModelMetadata_MPI3 + PRIVATE + USE_MPI + TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" + TEST_FILE_SOURCE=\"${CMAKE_CURRENT_SOURCE_DIR}\" + ) + target_include_directories( + testModelMetadata_MPI3 + PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" + ) + target_link_libraries(testModelMetadata_MPI3 PRIVATE nextsimlib doctest::doctest) + + add_executable(testParaGrid_MPI2 "ParaGrid_test.cpp" "MainMPI.cpp") + target_compile_definitions( + testParaGrid_MPI2 + PRIVATE + USE_MPI + TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" + TEST_FILE_SOURCE=\"${CMAKE_CURRENT_SOURCE_DIR}\" + ) + target_include_directories( + testParaGrid_MPI2 + PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" + ) + target_link_libraries(testParaGrid_MPI2 PRIVATE nextsimlib doctest::doctest) + + add_executable(testConfigOutput_MPI2 "ConfigOutput_test.cpp" "MainMPI.cpp") + target_compile_definitions( + testConfigOutput_MPI2 + PRIVATE USE_MPI TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" + ) + target_include_directories(testConfigOutput_MPI2 PRIVATE ${MODEL_INCLUDE_DIR}) + target_link_libraries(testConfigOutput_MPI2 PRIVATE nextsimlib doctest::doctest) + if(ENABLE_XIOS) set(XIOS_INCLUDE_LIST "${xios_INCLUDES}" diff --git a/core/test/ModelMetadata_test.cpp b/core/test/ModelMetadata_test.cpp new file mode 100644 index 000000000..2da43c959 --- /dev/null +++ b/core/test/ModelMetadata_test.cpp @@ -0,0 +1,149 @@ +/*! + * @file ModelMetadata_test.cpp + * + * @date 18 Nov 2024 + * @author Tom Meltzer + */ + +#include +#include + +#include "ModelMetadata.hpp" + +const std::string testFilesDir = TEST_FILES_DIR; +const std::string filename = testFilesDir + "/paraGrid_test.nc"; +const std::string diagFile = "paraGrid_diag.nc"; +const std::string dateString = "2000-01-01T00:00:00Z"; +const std::string partitionFilenameCB = testFilesDir + "/partition_metadata_3_cb.nc"; +const std::string partitionFilenamePB = testFilesDir + "/partition_metadata_3_pb.nc"; + +namespace Nextsim { + +TEST_SUITE_BEGIN("ModelMetadata"); +MPI_TEST_CASE("Test getPartitionMetadata closed boundary", 3) +{ + ModelMetadata metadata(partitionFilenameCB, test_comm); + REQUIRE(metadata.mpiComm == test_comm); + // this metadata is specific to the non-periodic boundary conditions + if (test_rank == 0) { + REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT].size() == 0); + REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT] == std::vector { 2 }); + REQUIRE(metadata.neighbourExtents[ModelMetadata::RIGHT] == std::vector { 4 }); + REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::RIGHT] == std::vector { 0 }); + REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM].size() == 0); + REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP] == std::vector { 1 }); + REQUIRE(metadata.neighbourExtents[ModelMetadata::TOP] == std::vector { 7 }); + REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::TOP] == std::vector { 0 }); + } else if (test_rank == 1) { + REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT].size() == 0); + REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT] == std::vector { 2 }); + REQUIRE(metadata.neighbourExtents[ModelMetadata::RIGHT] == std::vector { 5 }); + REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::RIGHT] == std::vector { 12 }); + REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM] == std::vector { 0 }); + REQUIRE(metadata.neighbourExtents[ModelMetadata::BOTTOM] == std::vector { 7 }); + REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::BOTTOM] == std::vector { 21 }); + REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP].size() == 0); + } else if (test_rank == 2) { + REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT] == std::vector { 0, 1 }); + REQUIRE(metadata.neighbourExtents[ModelMetadata::LEFT] == std::vector { 4, 5 }); + REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::LEFT] == std::vector { 6, 6 }); + REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT].size() == 0); + REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM].size() == 0); + REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP].size() == 0); + } else { + std::cerr << "only valid for 3 ranks" << std::endl; + exit(1); + } + + // This metadata is specific to the periodic boundary conditions. + // They are all zero because the input metadata file `partitionFilenameCB` does not use periodic + // boundary conditions. + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::LEFT].size() == 0); + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::RIGHT].size() == 0); + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::BOTTOM].size() == 0); + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::TOP].size() == 0); +} + +MPI_TEST_CASE("Test getPartitionMetadata periodic boundary", 3) +{ + ModelMetadata metadata(partitionFilenamePB, test_comm); + REQUIRE(metadata.mpiComm == test_comm); + // this metadata should be identical to the Closed Boundary version so we check it again + if (test_rank == 0) { + REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT].size() == 0); + REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT] == std::vector { 2 }); + REQUIRE(metadata.neighbourExtents[ModelMetadata::RIGHT] == std::vector { 4 }); + REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::RIGHT] == std::vector { 0 }); + REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM].size() == 0); + REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP] == std::vector { 1 }); + REQUIRE(metadata.neighbourExtents[ModelMetadata::TOP] == std::vector { 7 }); + REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::TOP] == std::vector { 0 }); + } else if (test_rank == 1) { + REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT].size() == 0); + REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT] == std::vector { 2 }); + REQUIRE(metadata.neighbourExtents[ModelMetadata::RIGHT] == std::vector { 5 }); + REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::RIGHT] == std::vector { 12 }); + REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM] == std::vector { 0 }); + REQUIRE(metadata.neighbourExtents[ModelMetadata::BOTTOM] == std::vector { 7 }); + REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::BOTTOM] == std::vector { 21 }); + REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP].size() == 0); + } else if (test_rank == 2) { + REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT] == std::vector { 0, 1 }); + REQUIRE(metadata.neighbourExtents[ModelMetadata::LEFT] == std::vector { 4, 5 }); + REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::LEFT] == std::vector { 6, 6 }); + REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT].size() == 0); + REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM].size() == 0); + REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP].size() == 0); + } else { + std::cerr << "only valid for 3 ranks" << std::endl; + exit(1); + } + + // this metadata is specific to the periodic boundary conditions + if (test_rank == 0) { + // clang-format off + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::LEFT] == std::vector { 2 }); + REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::LEFT] == std::vector { 4 }); + REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::LEFT] == std::vector { 2 }); + + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::RIGHT].size() == 0); + + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::BOTTOM] == std::vector { 1 }); + REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::BOTTOM] == std::vector { 7 }); + REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::BOTTOM] == std::vector { 28 }); + + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::TOP].size() == 0); + } else if (test_rank == 1) { + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::LEFT] == std::vector { 2 }); + REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::LEFT] == std::vector { 5 }); + REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::LEFT] == std::vector { 14 }); + + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::RIGHT].size() == 0); + + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::BOTTOM].size() == 0); + + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::TOP] == std::vector { 0 }); + REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::TOP] == std::vector { 7 }); + REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::TOP] == std::vector { 0 }); + } else if (test_rank == 2) { + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::LEFT].size() == 0); + + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::RIGHT] == std::vector { 0, 1 }); + REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::RIGHT] == std::vector { 4, 5 }); + REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::RIGHT] == std::vector { 0, 0 }); + + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::BOTTOM] == std::vector { 2 }); + REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::BOTTOM] == std::vector { 3 }); + REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::BOTTOM] == std::vector { 24 }); + + REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::TOP] == std::vector { 2 }); + REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::TOP] == std::vector { 3 }); + REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::TOP] == std::vector { 0 }); + // clang-format on + } else { + std::cerr << "only valid for 3 ranks" << std::endl; + exit(1); + } +} + +} diff --git a/core/test/partition_metadata_3_cb.cdl b/core/test/partition_metadata_3_cb.cdl new file mode 100644 index 000000000..f08c26cf9 --- /dev/null +++ b/core/test/partition_metadata_3_cb.cdl @@ -0,0 +1,108 @@ +netcdf partition_metadata_3 { +dimensions: + NX = 10 ; + NY = 9 ; + P = 3 ; + L = 2 ; + R = 2 ; + B = 1 ; + T = 1 ; + L_periodic = UNLIMITED ; // (0 currently) + R_periodic = UNLIMITED ; // (0 currently) + B_periodic = UNLIMITED ; // (0 currently) + T_periodic = UNLIMITED ; // (0 currently) + +group: bounding_boxes { + variables: + int domain_x(P) ; + int domain_extent_x(P) ; + int domain_y(P) ; + int domain_extent_y(P) ; + data: + + domain_x = 0, 0, 7 ; + + domain_extent_x = 7, 7, 3 ; + + domain_y = 0, 4, 0 ; + + domain_extent_y = 4, 5, 9 ; + } // group bounding_boxes + +group: connectivity { + variables: + int left_neighbours(P) ; + int left_neighbour_ids(L) ; + int left_neighbour_halos(L) ; + int left_neighbour_halo_starts(L) ; + int right_neighbours(P) ; + int right_neighbour_ids(R) ; + int right_neighbour_halos(R) ; + int right_neighbour_halo_starts(R) ; + int bottom_neighbours(P) ; + int bottom_neighbour_ids(B) ; + int bottom_neighbour_halos(B) ; + int bottom_neighbour_halo_starts(B) ; + int top_neighbours(P) ; + int top_neighbour_ids(T) ; + int top_neighbour_halos(T) ; + int top_neighbour_halo_starts(T) ; + int left_neighbours_periodic(P) ; + int left_neighbour_ids_periodic(L_periodic) ; + int left_neighbour_halos_periodic(L_periodic) ; + int left_neighbour_halo_starts_periodic(L_periodic) ; + int right_neighbours_periodic(P) ; + int right_neighbour_ids_periodic(R_periodic) ; + int right_neighbour_halos_periodic(R_periodic) ; + int right_neighbour_halo_starts_periodic(R_periodic) ; + int bottom_neighbours_periodic(P) ; + int bottom_neighbour_ids_periodic(B_periodic) ; + int bottom_neighbour_halos_periodic(B_periodic) ; + int bottom_neighbour_halo_starts_periodic(B_periodic) ; + int top_neighbours_periodic(P) ; + int top_neighbour_ids_periodic(T_periodic) ; + int top_neighbour_halos_periodic(T_periodic) ; + int top_neighbour_halo_starts_periodic(T_periodic) ; + data: + + left_neighbours = 0, 0, 2 ; + + left_neighbour_ids = 0, 1 ; + + left_neighbour_halos = 4, 5 ; + + left_neighbour_halo_starts = 6, 6 ; + + right_neighbours = 1, 1, 0 ; + + right_neighbour_ids = 2, 2 ; + + right_neighbour_halos = 4, 5 ; + + right_neighbour_halo_starts = 0, 12 ; + + bottom_neighbours = 0, 1, 0 ; + + bottom_neighbour_ids = 0 ; + + bottom_neighbour_halos = 7 ; + + bottom_neighbour_halo_starts = 21 ; + + top_neighbours = 1, 0, 0 ; + + top_neighbour_ids = 1 ; + + top_neighbour_halos = 7 ; + + top_neighbour_halo_starts = 0 ; + + left_neighbours_periodic = 0, 0, 0 ; + + right_neighbours_periodic = 0, 0, 0 ; + + bottom_neighbours_periodic = 0, 0, 0 ; + + top_neighbours_periodic = 0, 0, 0 ; + } // group connectivity +} diff --git a/core/test/partition_metadata_3_pb.cdl b/core/test/partition_metadata_3_pb.cdl new file mode 100644 index 000000000..6d71d7ed5 --- /dev/null +++ b/core/test/partition_metadata_3_pb.cdl @@ -0,0 +1,132 @@ +netcdf partition_metadata_3 { +dimensions: + NX = 10 ; + NY = 9 ; + P = 3 ; + L = 2 ; + R = 2 ; + B = 1 ; + T = 1 ; + L_periodic = 2 ; + R_periodic = 2 ; + B_periodic = 2 ; + T_periodic = 2 ; + +group: bounding_boxes { + variables: + int domain_x(P) ; + int domain_extent_x(P) ; + int domain_y(P) ; + int domain_extent_y(P) ; + data: + + domain_x = 0, 0, 7 ; + + domain_extent_x = 7, 7, 3 ; + + domain_y = 0, 4, 0 ; + + domain_extent_y = 4, 5, 9 ; + } // group bounding_boxes + +group: connectivity { + variables: + int left_neighbours(P) ; + int left_neighbour_ids(L) ; + int left_neighbour_halos(L) ; + int left_neighbour_halo_starts(L) ; + int right_neighbours(P) ; + int right_neighbour_ids(R) ; + int right_neighbour_halos(R) ; + int right_neighbour_halo_starts(R) ; + int bottom_neighbours(P) ; + int bottom_neighbour_ids(B) ; + int bottom_neighbour_halos(B) ; + int bottom_neighbour_halo_starts(B) ; + int top_neighbours(P) ; + int top_neighbour_ids(T) ; + int top_neighbour_halos(T) ; + int top_neighbour_halo_starts(T) ; + int left_neighbours_periodic(P) ; + int left_neighbour_ids_periodic(L_periodic) ; + int left_neighbour_halos_periodic(L_periodic) ; + int left_neighbour_halo_starts_periodic(L_periodic) ; + int right_neighbours_periodic(P) ; + int right_neighbour_ids_periodic(R_periodic) ; + int right_neighbour_halos_periodic(R_periodic) ; + int right_neighbour_halo_starts_periodic(R_periodic) ; + int bottom_neighbours_periodic(P) ; + int bottom_neighbour_ids_periodic(B_periodic) ; + int bottom_neighbour_halos_periodic(B_periodic) ; + int bottom_neighbour_halo_starts_periodic(B_periodic) ; + int top_neighbours_periodic(P) ; + int top_neighbour_ids_periodic(T_periodic) ; + int top_neighbour_halos_periodic(T_periodic) ; + int top_neighbour_halo_starts_periodic(T_periodic) ; + data: + + left_neighbours = 0, 0, 2 ; + + left_neighbour_ids = 0, 1 ; + + left_neighbour_halos = 4, 5 ; + + left_neighbour_halo_starts = 6, 6 ; + + right_neighbours = 1, 1, 0 ; + + right_neighbour_ids = 2, 2 ; + + right_neighbour_halos = 4, 5 ; + + right_neighbour_halo_starts = 0, 12 ; + + bottom_neighbours = 0, 1, 0 ; + + bottom_neighbour_ids = 0 ; + + bottom_neighbour_halos = 7 ; + + bottom_neighbour_halo_starts = 21 ; + + top_neighbours = 1, 0, 0 ; + + top_neighbour_ids = 1 ; + + top_neighbour_halos = 7 ; + + top_neighbour_halo_starts = 0 ; + + left_neighbours_periodic = 1, 1, 0 ; + + left_neighbour_ids_periodic = 2, 2 ; + + left_neighbour_halos_periodic = 4, 5 ; + + left_neighbour_halo_starts_periodic = 2, 14 ; + + right_neighbours_periodic = 0, 0, 2 ; + + right_neighbour_ids_periodic = 0, 1 ; + + right_neighbour_halos_periodic = 4, 5 ; + + right_neighbour_halo_starts_periodic = 0, 0 ; + + bottom_neighbours_periodic = 1, 0, 1 ; + + bottom_neighbour_ids_periodic = 1, 2 ; + + bottom_neighbour_halos_periodic = 7, 3 ; + + bottom_neighbour_halo_starts_periodic = 28, 24 ; + + top_neighbours_periodic = 0, 1, 1 ; + + top_neighbour_ids_periodic = 0, 2 ; + + top_neighbour_halos_periodic = 7, 3 ; + + top_neighbour_halo_starts_periodic = 0, 0 ; + } // group connectivity +} From 0c630535e651500b27d0914671cd28e05ff7fef7 Mon Sep 17 00:00:00 2001 From: tommelt Date: Fri, 17 Jan 2025 14:38:02 +0000 Subject: [PATCH 02/53] feat: additional metadata for send recv buffers --- core/src/ModelMetadata.cpp | 29 ++-- core/src/include/ModelMetadata.hpp | 9 +- core/test/CMakeLists.txt | 6 +- core/test/ModelMetadata_test.cpp | 195 ++++++++++++-------------- core/test/partition_metadata_3_cb.cdl | 42 ++++-- core/test/partition_metadata_3_pb.cdl | 58 +++++--- 6 files changed, 186 insertions(+), 153 deletions(-) diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index 151dc7201..85e6496d3 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -1,8 +1,9 @@ /*! * @file ModelMetadata.cpp * - * @date 09 Apr 2025 + * @date 17 Jan 2025 * @author Tim Spain + * @author Tom Meltzer */ #include "include/ModelMetadata.hpp" @@ -50,8 +51,8 @@ void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) netCDF::NcGroup neighbourGroup(ncFile.getGroup(neighbourName)); std::string varName {}; for (auto edge : edges) { - size_t nStart {}; // start point in metadata arrays - size_t count {}; // number of elements to read from metadata arrays + size_t nStart = 0; // start point in metadata arrays + size_t count = 0; // number of elements to read from metadata arrays std::vector numNeighbours = std::vector(mpiSize, 0); std::vector offsets = std::vector(mpiSize, 0); @@ -69,7 +70,8 @@ void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) // initialize neighbour info to zero and correct size neighbourRanks[edge].resize(count, 0); neighbourExtents[edge].resize(count, 0); - neighbourHaloStarts[edge].resize(count, 0); + neighbourHaloSend[edge].resize(count, 0); + neighbourHaloRecv[edge].resize(count, 0); varName = edgeNames[edge] + "_neighbour_ids"; neighbourGroup.getVar(varName).getVar({ nStart }, { count }, &neighbourRanks[edge][0]); @@ -78,9 +80,13 @@ void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) neighbourGroup.getVar(varName).getVar( { nStart }, { count }, &neighbourExtents[edge][0]); - varName = edgeNames[edge] + "_neighbour_halo_starts"; + varName = edgeNames[edge] + "_neighbour_halo_send"; neighbourGroup.getVar(varName).getVar( - { nStart }, { count }, &neighbourHaloStarts[edge][0]); + { nStart }, { count }, &neighbourHaloSend[edge][0]); + + varName = edgeNames[edge] + "_neighbour_halo_recv"; + neighbourGroup.getVar(varName).getVar( + { nStart }, { count }, &neighbourHaloRecv[edge][0]); } // periodic neighbours @@ -97,7 +103,8 @@ void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) // initialize neighbour info to zero and correct size neighbourRanksPeriodic[edge].resize(count, 0); neighbourExtentsPeriodic[edge].resize(count, 0); - neighbourHaloStartsPeriodic[edge].resize(count, 0); + neighbourHaloSendPeriodic[edge].resize(count, 0); + neighbourHaloRecvPeriodic[edge].resize(count, 0); varName = edgeNames[edge] + "_neighbour_ids_periodic"; neighbourGroup.getVar(varName).getVar( @@ -107,9 +114,13 @@ void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) neighbourGroup.getVar(varName).getVar( { nStart }, { count }, &neighbourExtentsPeriodic[edge][0]); - varName = edgeNames[edge] + "_neighbour_halo_starts_periodic"; + varName = edgeNames[edge] + "_neighbour_halo_send_periodic"; + neighbourGroup.getVar(varName).getVar( + { nStart }, { count }, &neighbourHaloSendPeriodic[edge][0]); + + varName = edgeNames[edge] + "_neighbour_halo_recv_periodic"; neighbourGroup.getVar(varName).getVar( - { nStart }, { count }, &neighbourHaloStartsPeriodic[edge][0]); + { nStart }, { count }, &neighbourHaloRecvPeriodic[edge][0]); } } } diff --git a/core/src/include/ModelMetadata.hpp b/core/src/include/ModelMetadata.hpp index 9c0859e0d..962f29354 100644 --- a/core/src/include/ModelMetadata.hpp +++ b/core/src/include/ModelMetadata.hpp @@ -1,8 +1,9 @@ /*! * @file ModelMetadata.hpp * - * @date 02 Jan 2025 + * @date 17 Jan 2025 * @author Tim Spain + * @author Tom Meltzer */ #ifndef MODELMETADATA_HPP @@ -108,10 +109,12 @@ class ModelMetadata { // mpi rank ID and extent for each edge direction std::array, N_EDGE> neighbourRanks; std::array, N_EDGE> neighbourExtents; - std::array, N_EDGE> neighbourHaloStarts; + std::array, N_EDGE> neighbourHaloSend; + std::array, N_EDGE> neighbourHaloRecv; std::array, N_EDGE> neighbourRanksPeriodic; std::array, N_EDGE> neighbourExtentsPeriodic; - std::array, N_EDGE> neighbourHaloStartsPeriodic; + std::array, N_EDGE> neighbourHaloSendPeriodic; + std::array, N_EDGE> neighbourHaloRecvPeriodic; #endif private: diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index da71aff06..aad33c5d2 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -35,9 +35,11 @@ if(ENABLE_MPI) add_custom_command( OUTPUT partition_metadata_3_cb.nc partition_metadata_3_pb.nc COMMAND - ncgen -b -o partition_metadata_3_cb.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl + ncgen -b -o partition_metadata_3_cb.nc + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl COMMAND - ncgen -b -o partition_metadata_3_pb.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl + ncgen -b -o partition_metadata_3_pb.nc + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl diff --git a/core/test/ModelMetadata_test.cpp b/core/test/ModelMetadata_test.cpp index 2da43c959..859596ed4 100644 --- a/core/test/ModelMetadata_test.cpp +++ b/core/test/ModelMetadata_test.cpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata_test.cpp * - * @date 18 Nov 2024 + * @date 17 Jan 2025 * @author Tom Meltzer */ @@ -11,138 +11,115 @@ #include "ModelMetadata.hpp" const std::string testFilesDir = TEST_FILES_DIR; -const std::string filename = testFilesDir + "/paraGrid_test.nc"; -const std::string diagFile = "paraGrid_diag.nc"; -const std::string dateString = "2000-01-01T00:00:00Z"; const std::string partitionFilenameCB = testFilesDir + "/partition_metadata_3_cb.nc"; const std::string partitionFilenamePB = testFilesDir + "/partition_metadata_3_pb.nc"; namespace Nextsim { -TEST_SUITE_BEGIN("ModelMetadata"); -MPI_TEST_CASE("Test getPartitionMetadata closed boundary", 3) +constexpr ModelMetadata::Edge BOTTOM = ModelMetadata::Edge::BOTTOM; +constexpr ModelMetadata::Edge RIGHT = ModelMetadata::Edge::RIGHT; +constexpr ModelMetadata::Edge TOP = ModelMetadata::Edge::TOP; +constexpr ModelMetadata::Edge LEFT = ModelMetadata::Edge::LEFT; + +typedef std::vector vec; + +// these tests are the same for closed boundary conditions (BC) and peridic BC +static void testNonPeriodicBC(ModelMetadata meta, int test_rank) { - ModelMetadata metadata(partitionFilenameCB, test_comm); - REQUIRE(metadata.mpiComm == test_comm); - // this metadata is specific to the non-periodic boundary conditions if (test_rank == 0) { - REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT].size() == 0); - REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT] == std::vector { 2 }); - REQUIRE(metadata.neighbourExtents[ModelMetadata::RIGHT] == std::vector { 4 }); - REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::RIGHT] == std::vector { 0 }); - REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM].size() == 0); - REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP] == std::vector { 1 }); - REQUIRE(metadata.neighbourExtents[ModelMetadata::TOP] == std::vector { 7 }); - REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::TOP] == std::vector { 0 }); + REQUIRE(meta.neighbourRanks[LEFT].size() == 0); + REQUIRE(meta.neighbourRanks[RIGHT] == vec { 2 }); + REQUIRE(meta.neighbourExtents[RIGHT] == vec { 4 }); + REQUIRE(meta.neighbourHaloSend[RIGHT] == vec { 15 }); + REQUIRE(meta.neighbourHaloRecv[RIGHT] == vec { 7 }); + REQUIRE(meta.neighbourRanks[BOTTOM].size() == 0); + REQUIRE(meta.neighbourRanks[TOP] == vec { 1 }); + REQUIRE(meta.neighbourExtents[TOP] == vec { 7 }); + REQUIRE(meta.neighbourHaloSend[TOP] == vec { 0 }); + REQUIRE(meta.neighbourHaloRecv[TOP] == vec { 11 }); } else if (test_rank == 1) { - REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT].size() == 0); - REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT] == std::vector { 2 }); - REQUIRE(metadata.neighbourExtents[ModelMetadata::RIGHT] == std::vector { 5 }); - REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::RIGHT] == std::vector { 12 }); - REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM] == std::vector { 0 }); - REQUIRE(metadata.neighbourExtents[ModelMetadata::BOTTOM] == std::vector { 7 }); - REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::BOTTOM] == std::vector { 21 }); - REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP].size() == 0); + REQUIRE(meta.neighbourRanks[LEFT].size() == 0); + REQUIRE(meta.neighbourRanks[RIGHT] == vec { 2 }); + REQUIRE(meta.neighbourExtents[RIGHT] == vec { 5 }); + REQUIRE(meta.neighbourHaloSend[RIGHT] == vec { 19 }); + REQUIRE(meta.neighbourHaloRecv[RIGHT] == vec { 7 }); + REQUIRE(meta.neighbourRanks[BOTTOM] == vec { 0 }); + REQUIRE(meta.neighbourExtents[BOTTOM] == vec { 7 }); + REQUIRE(meta.neighbourHaloSend[BOTTOM] == vec { 11 }); + REQUIRE(meta.neighbourHaloRecv[BOTTOM] == vec { 0 }); + REQUIRE(meta.neighbourRanks[TOP].size() == 0); } else if (test_rank == 2) { - REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT] == std::vector { 0, 1 }); - REQUIRE(metadata.neighbourExtents[ModelMetadata::LEFT] == std::vector { 4, 5 }); - REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::LEFT] == std::vector { 6, 6 }); - REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT].size() == 0); - REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM].size() == 0); - REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP].size() == 0); - } else { - std::cerr << "only valid for 3 ranks" << std::endl; - exit(1); + REQUIRE(meta.neighbourRanks[LEFT] == vec { 0, 1 }); + REQUIRE(meta.neighbourExtents[LEFT] == vec { 4, 5 }); + REQUIRE(meta.neighbourHaloSend[LEFT] == vec { 7, 7 }); + REQUIRE(meta.neighbourHaloRecv[LEFT] == vec { 15, 19 }); + REQUIRE(meta.neighbourRanks[RIGHT].size() == 0); + REQUIRE(meta.neighbourRanks[BOTTOM].size() == 0); + REQUIRE(meta.neighbourRanks[TOP].size() == 0); } +} + +TEST_SUITE_BEGIN("ModelMetadata"); +MPI_TEST_CASE("Test getPartitionMetadata closed boundary", 3) +{ + ModelMetadata meta(partitionFilenameCB, test_comm); + REQUIRE(meta.mpiComm == test_comm); + // this metadata is specific to the non-periodic boundary conditions + testNonPeriodicBC(meta, test_rank); // This metadata is specific to the periodic boundary conditions. // They are all zero because the input metadata file `partitionFilenameCB` does not use periodic // boundary conditions. - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::LEFT].size() == 0); - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::RIGHT].size() == 0); - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::BOTTOM].size() == 0); - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::TOP].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[LEFT].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[RIGHT].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[BOTTOM].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[TOP].size() == 0); } MPI_TEST_CASE("Test getPartitionMetadata periodic boundary", 3) { - ModelMetadata metadata(partitionFilenamePB, test_comm); - REQUIRE(metadata.mpiComm == test_comm); + ModelMetadata meta(partitionFilenamePB, test_comm); + REQUIRE(meta.mpiComm == test_comm); // this metadata should be identical to the Closed Boundary version so we check it again - if (test_rank == 0) { - REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT].size() == 0); - REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT] == std::vector { 2 }); - REQUIRE(metadata.neighbourExtents[ModelMetadata::RIGHT] == std::vector { 4 }); - REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::RIGHT] == std::vector { 0 }); - REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM].size() == 0); - REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP] == std::vector { 1 }); - REQUIRE(metadata.neighbourExtents[ModelMetadata::TOP] == std::vector { 7 }); - REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::TOP] == std::vector { 0 }); - } else if (test_rank == 1) { - REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT].size() == 0); - REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT] == std::vector { 2 }); - REQUIRE(metadata.neighbourExtents[ModelMetadata::RIGHT] == std::vector { 5 }); - REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::RIGHT] == std::vector { 12 }); - REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM] == std::vector { 0 }); - REQUIRE(metadata.neighbourExtents[ModelMetadata::BOTTOM] == std::vector { 7 }); - REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::BOTTOM] == std::vector { 21 }); - REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP].size() == 0); - } else if (test_rank == 2) { - REQUIRE(metadata.neighbourRanks[ModelMetadata::LEFT] == std::vector { 0, 1 }); - REQUIRE(metadata.neighbourExtents[ModelMetadata::LEFT] == std::vector { 4, 5 }); - REQUIRE(metadata.neighbourHaloStarts[ModelMetadata::LEFT] == std::vector { 6, 6 }); - REQUIRE(metadata.neighbourRanks[ModelMetadata::RIGHT].size() == 0); - REQUIRE(metadata.neighbourRanks[ModelMetadata::BOTTOM].size() == 0); - REQUIRE(metadata.neighbourRanks[ModelMetadata::TOP].size() == 0); - } else { - std::cerr << "only valid for 3 ranks" << std::endl; - exit(1); - } + testNonPeriodicBC(meta, test_rank); // this metadata is specific to the periodic boundary conditions if (test_rank == 0) { - // clang-format off - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::LEFT] == std::vector { 2 }); - REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::LEFT] == std::vector { 4 }); - REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::LEFT] == std::vector { 2 }); - - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::RIGHT].size() == 0); - - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::BOTTOM] == std::vector { 1 }); - REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::BOTTOM] == std::vector { 7 }); - REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::BOTTOM] == std::vector { 28 }); - - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::TOP].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[LEFT] == vec { 2 }); + REQUIRE(meta.neighbourExtentsPeriodic[LEFT] == vec { 4 }); + REQUIRE(meta.neighbourHaloSendPeriodic[LEFT] == vec { 3 }); + REQUIRE(meta.neighbourHaloRecvPeriodic[LEFT] == vec { 18 }); + REQUIRE(meta.neighbourRanksPeriodic[RIGHT].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[BOTTOM] == vec { 1 }); + REQUIRE(meta.neighbourExtentsPeriodic[BOTTOM] == vec { 7 }); + REQUIRE(meta.neighbourHaloSendPeriodic[BOTTOM] == vec { 12 }); + REQUIRE(meta.neighbourHaloRecvPeriodic[BOTTOM] == vec { 0 }); + REQUIRE(meta.neighbourRanksPeriodic[TOP].size() == 0); } else if (test_rank == 1) { - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::LEFT] == std::vector { 2 }); - REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::LEFT] == std::vector { 5 }); - REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::LEFT] == std::vector { 14 }); - - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::RIGHT].size() == 0); - - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::BOTTOM].size() == 0); - - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::TOP] == std::vector { 0 }); - REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::TOP] == std::vector { 7 }); - REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::TOP] == std::vector { 0 }); + REQUIRE(meta.neighbourRanksPeriodic[LEFT] == vec { 2 }); + REQUIRE(meta.neighbourExtentsPeriodic[LEFT] == vec { 5 }); + REQUIRE(meta.neighbourHaloSendPeriodic[LEFT] == vec { 7 }); + REQUIRE(meta.neighbourHaloRecvPeriodic[LEFT] == vec { 19 }); + REQUIRE(meta.neighbourRanksPeriodic[RIGHT].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[BOTTOM].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[TOP] == vec { 0 }); + REQUIRE(meta.neighbourExtentsPeriodic[TOP] == vec { 7 }); + REQUIRE(meta.neighbourHaloSendPeriodic[TOP] == vec { 0 }); + REQUIRE(meta.neighbourHaloRecvPeriodic[TOP] == vec { 12 }); } else if (test_rank == 2) { - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::LEFT].size() == 0); - - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::RIGHT] == std::vector { 0, 1 }); - REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::RIGHT] == std::vector { 4, 5 }); - REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::RIGHT] == std::vector { 0, 0 }); - - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::BOTTOM] == std::vector { 2 }); - REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::BOTTOM] == std::vector { 3 }); - REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::BOTTOM] == std::vector { 24 }); - - REQUIRE(metadata.neighbourRanksPeriodic[ModelMetadata::TOP] == std::vector { 2 }); - REQUIRE(metadata.neighbourExtentsPeriodic[ModelMetadata::TOP] == std::vector { 3 }); - REQUIRE(metadata.neighbourHaloStartsPeriodic[ModelMetadata::TOP] == std::vector { 0 }); - // clang-format on - } else { - std::cerr << "only valid for 3 ranks" << std::endl; - exit(1); + REQUIRE(meta.neighbourRanksPeriodic[LEFT].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[RIGHT] == vec { 0, 1 }); + REQUIRE(meta.neighbourExtentsPeriodic[RIGHT] == vec { 4, 5 }); + REQUIRE(meta.neighbourHaloSendPeriodic[RIGHT] == vec { 18, 19 }); + REQUIRE(meta.neighbourHaloRecvPeriodic[RIGHT] == vec { 3, 7 }); + REQUIRE(meta.neighbourRanksPeriodic[BOTTOM] == vec { 2 }); + REQUIRE(meta.neighbourExtentsPeriodic[BOTTOM] == vec { 3 }); + REQUIRE(meta.neighbourHaloSendPeriodic[BOTTOM] == vec { 12 }); + REQUIRE(meta.neighbourHaloRecvPeriodic[BOTTOM] == vec { 0 }); + REQUIRE(meta.neighbourRanksPeriodic[TOP] == vec { 2 }); + REQUIRE(meta.neighbourExtentsPeriodic[TOP] == vec { 3 }); + REQUIRE(meta.neighbourHaloSendPeriodic[TOP] == vec { 0 }); + REQUIRE(meta.neighbourHaloRecvPeriodic[TOP] == vec { 12 }); } } diff --git a/core/test/partition_metadata_3_cb.cdl b/core/test/partition_metadata_3_cb.cdl index f08c26cf9..789136a45 100644 --- a/core/test/partition_metadata_3_cb.cdl +++ b/core/test/partition_metadata_3_cb.cdl @@ -1,4 +1,4 @@ -netcdf partition_metadata_3 { +netcdf partition_metadata_3_cb { dimensions: NX = 10 ; NY = 9 ; @@ -34,35 +34,43 @@ group: connectivity { int left_neighbours(P) ; int left_neighbour_ids(L) ; int left_neighbour_halos(L) ; - int left_neighbour_halo_starts(L) ; + int left_neighbour_halo_send(L) ; + int left_neighbour_halo_recv(L) ; int right_neighbours(P) ; int right_neighbour_ids(R) ; int right_neighbour_halos(R) ; - int right_neighbour_halo_starts(R) ; + int right_neighbour_halo_send(R) ; + int right_neighbour_halo_recv(R) ; int bottom_neighbours(P) ; int bottom_neighbour_ids(B) ; int bottom_neighbour_halos(B) ; - int bottom_neighbour_halo_starts(B) ; + int bottom_neighbour_halo_send(B) ; + int bottom_neighbour_halo_recv(B) ; int top_neighbours(P) ; int top_neighbour_ids(T) ; int top_neighbour_halos(T) ; - int top_neighbour_halo_starts(T) ; + int top_neighbour_halo_send(T) ; + int top_neighbour_halo_recv(T) ; int left_neighbours_periodic(P) ; int left_neighbour_ids_periodic(L_periodic) ; int left_neighbour_halos_periodic(L_periodic) ; - int left_neighbour_halo_starts_periodic(L_periodic) ; + int left_neighbour_halo_send_periodic(L_periodic) ; + int left_neighbour_halo_recv_periodic(L_periodic) ; int right_neighbours_periodic(P) ; int right_neighbour_ids_periodic(R_periodic) ; int right_neighbour_halos_periodic(R_periodic) ; - int right_neighbour_halo_starts_periodic(R_periodic) ; + int right_neighbour_halo_send_periodic(R_periodic) ; + int right_neighbour_halo_recv_periodic(R_periodic) ; int bottom_neighbours_periodic(P) ; int bottom_neighbour_ids_periodic(B_periodic) ; int bottom_neighbour_halos_periodic(B_periodic) ; - int bottom_neighbour_halo_starts_periodic(B_periodic) ; + int bottom_neighbour_halo_send_periodic(B_periodic) ; + int bottom_neighbour_halo_recv_periodic(B_periodic) ; int top_neighbours_periodic(P) ; int top_neighbour_ids_periodic(T_periodic) ; int top_neighbour_halos_periodic(T_periodic) ; - int top_neighbour_halo_starts_periodic(T_periodic) ; + int top_neighbour_halo_send_periodic(T_periodic) ; + int top_neighbour_halo_recv_periodic(T_periodic) ; data: left_neighbours = 0, 0, 2 ; @@ -71,7 +79,9 @@ group: connectivity { left_neighbour_halos = 4, 5 ; - left_neighbour_halo_starts = 6, 6 ; + left_neighbour_halo_send = 7, 7 ; + + left_neighbour_halo_recv = 15, 19 ; right_neighbours = 1, 1, 0 ; @@ -79,7 +89,9 @@ group: connectivity { right_neighbour_halos = 4, 5 ; - right_neighbour_halo_starts = 0, 12 ; + right_neighbour_halo_send = 15, 19 ; + + right_neighbour_halo_recv = 7, 7 ; bottom_neighbours = 0, 1, 0 ; @@ -87,7 +99,9 @@ group: connectivity { bottom_neighbour_halos = 7 ; - bottom_neighbour_halo_starts = 21 ; + bottom_neighbour_halo_send = 11 ; + + bottom_neighbour_halo_recv = 0 ; top_neighbours = 1, 0, 0 ; @@ -95,7 +109,9 @@ group: connectivity { top_neighbour_halos = 7 ; - top_neighbour_halo_starts = 0 ; + top_neighbour_halo_send = 0 ; + + top_neighbour_halo_recv = 11 ; left_neighbours_periodic = 0, 0, 0 ; diff --git a/core/test/partition_metadata_3_pb.cdl b/core/test/partition_metadata_3_pb.cdl index 6d71d7ed5..adea3e31a 100644 --- a/core/test/partition_metadata_3_pb.cdl +++ b/core/test/partition_metadata_3_pb.cdl @@ -1,4 +1,4 @@ -netcdf partition_metadata_3 { +netcdf partition_metadata_3_pb { dimensions: NX = 10 ; NY = 9 ; @@ -34,35 +34,43 @@ group: connectivity { int left_neighbours(P) ; int left_neighbour_ids(L) ; int left_neighbour_halos(L) ; - int left_neighbour_halo_starts(L) ; + int left_neighbour_halo_send(L) ; + int left_neighbour_halo_recv(L) ; int right_neighbours(P) ; int right_neighbour_ids(R) ; int right_neighbour_halos(R) ; - int right_neighbour_halo_starts(R) ; + int right_neighbour_halo_send(R) ; + int right_neighbour_halo_recv(R) ; int bottom_neighbours(P) ; int bottom_neighbour_ids(B) ; int bottom_neighbour_halos(B) ; - int bottom_neighbour_halo_starts(B) ; + int bottom_neighbour_halo_send(B) ; + int bottom_neighbour_halo_recv(B) ; int top_neighbours(P) ; int top_neighbour_ids(T) ; int top_neighbour_halos(T) ; - int top_neighbour_halo_starts(T) ; + int top_neighbour_halo_send(T) ; + int top_neighbour_halo_recv(T) ; int left_neighbours_periodic(P) ; int left_neighbour_ids_periodic(L_periodic) ; int left_neighbour_halos_periodic(L_periodic) ; - int left_neighbour_halo_starts_periodic(L_periodic) ; + int left_neighbour_halo_send_periodic(L_periodic) ; + int left_neighbour_halo_recv_periodic(L_periodic) ; int right_neighbours_periodic(P) ; int right_neighbour_ids_periodic(R_periodic) ; int right_neighbour_halos_periodic(R_periodic) ; - int right_neighbour_halo_starts_periodic(R_periodic) ; + int right_neighbour_halo_send_periodic(R_periodic) ; + int right_neighbour_halo_recv_periodic(R_periodic) ; int bottom_neighbours_periodic(P) ; int bottom_neighbour_ids_periodic(B_periodic) ; int bottom_neighbour_halos_periodic(B_periodic) ; - int bottom_neighbour_halo_starts_periodic(B_periodic) ; + int bottom_neighbour_halo_send_periodic(B_periodic) ; + int bottom_neighbour_halo_recv_periodic(B_periodic) ; int top_neighbours_periodic(P) ; int top_neighbour_ids_periodic(T_periodic) ; int top_neighbour_halos_periodic(T_periodic) ; - int top_neighbour_halo_starts_periodic(T_periodic) ; + int top_neighbour_halo_send_periodic(T_periodic) ; + int top_neighbour_halo_recv_periodic(T_periodic) ; data: left_neighbours = 0, 0, 2 ; @@ -71,7 +79,9 @@ group: connectivity { left_neighbour_halos = 4, 5 ; - left_neighbour_halo_starts = 6, 6 ; + left_neighbour_halo_send = 7, 7 ; + + left_neighbour_halo_recv = 15, 19 ; right_neighbours = 1, 1, 0 ; @@ -79,7 +89,9 @@ group: connectivity { right_neighbour_halos = 4, 5 ; - right_neighbour_halo_starts = 0, 12 ; + right_neighbour_halo_send = 15, 19 ; + + right_neighbour_halo_recv = 7, 7 ; bottom_neighbours = 0, 1, 0 ; @@ -87,7 +99,9 @@ group: connectivity { bottom_neighbour_halos = 7 ; - bottom_neighbour_halo_starts = 21 ; + bottom_neighbour_halo_send = 11 ; + + bottom_neighbour_halo_recv = 0 ; top_neighbours = 1, 0, 0 ; @@ -95,7 +109,9 @@ group: connectivity { top_neighbour_halos = 7 ; - top_neighbour_halo_starts = 0 ; + top_neighbour_halo_send = 0 ; + + top_neighbour_halo_recv = 11 ; left_neighbours_periodic = 1, 1, 0 ; @@ -103,7 +119,9 @@ group: connectivity { left_neighbour_halos_periodic = 4, 5 ; - left_neighbour_halo_starts_periodic = 2, 14 ; + left_neighbour_halo_send_periodic = 3, 7 ; + + left_neighbour_halo_recv_periodic = 18, 19 ; right_neighbours_periodic = 0, 0, 2 ; @@ -111,7 +129,9 @@ group: connectivity { right_neighbour_halos_periodic = 4, 5 ; - right_neighbour_halo_starts_periodic = 0, 0 ; + right_neighbour_halo_send_periodic = 18, 19 ; + + right_neighbour_halo_recv_periodic = 3, 7 ; bottom_neighbours_periodic = 1, 0, 1 ; @@ -119,7 +139,9 @@ group: connectivity { bottom_neighbour_halos_periodic = 7, 3 ; - bottom_neighbour_halo_starts_periodic = 28, 24 ; + bottom_neighbour_halo_send_periodic = 12, 12 ; + + bottom_neighbour_halo_recv_periodic = 0, 0 ; top_neighbours_periodic = 0, 1, 1 ; @@ -127,6 +149,8 @@ group: connectivity { top_neighbour_halos_periodic = 7, 3 ; - top_neighbour_halo_starts_periodic = 0, 0 ; + top_neighbour_halo_send_periodic = 0, 0 ; + + top_neighbour_halo_recv_periodic = 12, 12 ; } // group connectivity } From cec50d7ee6da91702aedcbec176af74caa46b183 Mon Sep 17 00:00:00 2001 From: tommelt Date: Fri, 17 Jan 2025 15:37:11 +0000 Subject: [PATCH 03/53] tests: update to reflect new metadata --- core/test/ParaGrid_test.cpp | 11 +-- core/test/partition_metadata_2.cdl | 104 +++++++++++++++++++++-------- 2 files changed, 82 insertions(+), 33 deletions(-) diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index c89eb3e6d..feb326d91 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -1,8 +1,9 @@ /*! * @file ParaGrid_test.cpp * - * @date 07 May 2025 + * @date 17 Jan 2025 * @author Tim Spain + * @author Tom Meltzer */ #include "ModelArray.hpp" @@ -111,12 +112,12 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") #ifdef USE_MPI if (test_rank == 0) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 4, 0); - ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 4 + 1, 0); + ModelArray::setDimension(ModelArray::Dimension::X, nx, 5, 0); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 5 + 1, 0); } if (test_rank == 1) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 6, 4); - ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 6 + 1, 4); + ModelArray::setDimension(ModelArray::Dimension::X, nx, 5, 5); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 5 + 1, 5); } ModelArray::setDimension(ModelArray::Dimension::Y, ny, ny, 0); ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, ny + 1, 0); diff --git a/core/test/partition_metadata_2.cdl b/core/test/partition_metadata_2.cdl index 0c9abc2f5..c70dbe2de 100644 --- a/core/test/partition_metadata_2.cdl +++ b/core/test/partition_metadata_2.cdl @@ -3,58 +3,106 @@ dimensions: NX = 10 ; NY = 9 ; P = 2 ; - T = 1 ; - B = 1 ; - L = UNLIMITED ; // (0 currently) - R = UNLIMITED ; // (0 currently) + L = 1 ; + R = 1 ; + B = UNLIMITED ; // (0 currently) + T = UNLIMITED ; // (0 currently) + L_periodic = UNLIMITED ; // (0 currently) + R_periodic = UNLIMITED ; // (0 currently) + B_periodic = UNLIMITED ; // (0 currently) + T_periodic = UNLIMITED ; // (0 currently) group: bounding_boxes { variables: int domain_x(P) ; - int domain_y(P) ; int domain_extent_x(P) ; + int domain_y(P) ; int domain_extent_y(P) ; data: - domain_x = 0, 4 ; + domain_x = 0, 5 ; - domain_y = 0, 0 ; + domain_extent_x = 5, 5 ; - domain_extent_x = 4, 6 ; + domain_y = 0, 0 ; domain_extent_y = 9, 9 ; } // group bounding_boxes group: connectivity { variables: - int top_neighbors(P) ; - int top_neighbor_ids(T) ; - int top_neighbor_halos(T) ; - int bottom_neighbors(P) ; - int bottom_neighbor_ids(B) ; - int bottom_neighbor_halos(B) ; - int left_neighbors(P) ; - int left_neighbor_ids(L) ; - int left_neighbor_halos(L) ; - int right_neighbors(P) ; - int right_neighbor_ids(R) ; - int right_neighbor_halos(R) ; + int left_neighbours(P) ; + int left_neighbour_ids(L) ; + int left_neighbour_halos(L) ; + int left_neighbour_halo_send(L) ; + int left_neighbour_halo_recv(L) ; + int right_neighbours(P) ; + int right_neighbour_ids(R) ; + int right_neighbour_halos(R) ; + int right_neighbour_halo_send(R) ; + int right_neighbour_halo_recv(R) ; + int bottom_neighbours(P) ; + int bottom_neighbour_ids(B) ; + int bottom_neighbour_halos(B) ; + int bottom_neighbour_halo_send(B) ; + int bottom_neighbour_halo_recv(B) ; + int top_neighbours(P) ; + int top_neighbour_ids(T) ; + int top_neighbour_halos(T) ; + int top_neighbour_halo_send(T) ; + int top_neighbour_halo_recv(T) ; + int left_neighbours_periodic(P) ; + int left_neighbour_ids_periodic(L_periodic) ; + int left_neighbour_halos_periodic(L_periodic) ; + int left_neighbour_halo_send_periodic(L_periodic) ; + int left_neighbour_halo_recv_periodic(L_periodic) ; + int right_neighbours_periodic(P) ; + int right_neighbour_ids_periodic(R_periodic) ; + int right_neighbour_halos_periodic(R_periodic) ; + int right_neighbour_halo_send_periodic(R_periodic) ; + int right_neighbour_halo_recv_periodic(R_periodic) ; + int bottom_neighbours_periodic(P) ; + int bottom_neighbour_ids_periodic(B_periodic) ; + int bottom_neighbour_halos_periodic(B_periodic) ; + int bottom_neighbour_halo_send_periodic(B_periodic) ; + int bottom_neighbour_halo_recv_periodic(B_periodic) ; + int top_neighbours_periodic(P) ; + int top_neighbour_ids_periodic(T_periodic) ; + int top_neighbour_halos_periodic(T_periodic) ; + int top_neighbour_halo_send_periodic(T_periodic) ; + int top_neighbour_halo_recv_periodic(T_periodic) ; data: - top_neighbors = 0, 1 ; + left_neighbours = 0, 1 ; + + left_neighbour_ids = 0 ; + + left_neighbour_halos = 9 ; + + left_neighbour_halo_send = 5 ; + + left_neighbour_halo_recv = 19 ; + + right_neighbours = 1, 0 ; + + right_neighbour_ids = 1 ; + + right_neighbour_halos = 9 ; + + right_neighbour_halo_send = 19 ; - top_neighbor_ids = 0 ; + right_neighbour_halo_recv = 5 ; - top_neighbor_halos = 9 ; + bottom_neighbours = 0, 0 ; - bottom_neighbors = 1, 0 ; + top_neighbours = 0, 0 ; - bottom_neighbor_ids = 1 ; + left_neighbours_periodic = 0, 0 ; - bottom_neighbor_halos = 9 ; + right_neighbours_periodic = 0, 0 ; - left_neighbors = 0, 0 ; + bottom_neighbours_periodic = 0, 0 ; - right_neighbors = 0, 0 ; + top_neighbours_periodic = 0, 0 ; } // group connectivity } From 057d69c497b555dc90d264a2589cb5212d63ea3d Mon Sep 17 00:00:00 2001 From: tommelt Date: Fri, 17 Jan 2025 15:41:47 +0000 Subject: [PATCH 04/53] tests: update metadata file for testRectGrid --- core/test/partition_metadata_3.cdl | 118 +++++++++++++++++++++-------- 1 file changed, 87 insertions(+), 31 deletions(-) diff --git a/core/test/partition_metadata_3.cdl b/core/test/partition_metadata_3.cdl index b70696991..b1e698f72 100644 --- a/core/test/partition_metadata_3.cdl +++ b/core/test/partition_metadata_3.cdl @@ -3,66 +3,122 @@ dimensions: NX = 5 ; NY = 7 ; P = 3 ; - T = 2 ; - B = 2 ; - L = 1 ; - R = 1 ; + L = 2 ; + R = 2 ; + B = 1 ; + T = 1 ; + L_periodic = UNLIMITED ; // (0 currently) + R_periodic = UNLIMITED ; // (0 currently) + B_periodic = UNLIMITED ; // (0 currently) + T_periodic = UNLIMITED ; // (0 currently) group: bounding_boxes { variables: int domain_x(P) ; - int domain_y(P) ; int domain_extent_x(P) ; + int domain_y(P) ; int domain_extent_y(P) ; data: domain_x = 0, 0, 3 ; - domain_y = 0, 3, 0 ; - domain_extent_x = 3, 3, 2 ; + domain_y = 0, 3, 0 ; + domain_extent_y = 3, 4, 7 ; } // group bounding_boxes group: connectivity { variables: - int top_neighbors(P) ; - int top_neighbor_ids(T) ; - int top_neighbor_halos(T) ; - int bottom_neighbors(P) ; - int bottom_neighbor_ids(B) ; - int bottom_neighbor_halos(B) ; - int left_neighbors(P) ; - int left_neighbor_ids(L) ; - int left_neighbor_halos(L) ; - int right_neighbors(P) ; - int right_neighbor_ids(R) ; - int right_neighbor_halos(R) ; + int left_neighbours(P) ; + int left_neighbour_ids(L) ; + int left_neighbour_halos(L) ; + int left_neighbour_halo_send(L) ; + int left_neighbour_halo_recv(L) ; + int right_neighbours(P) ; + int right_neighbour_ids(R) ; + int right_neighbour_halos(R) ; + int right_neighbour_halo_send(R) ; + int right_neighbour_halo_recv(R) ; + int bottom_neighbours(P) ; + int bottom_neighbour_ids(B) ; + int bottom_neighbour_halos(B) ; + int bottom_neighbour_halo_send(B) ; + int bottom_neighbour_halo_recv(B) ; + int top_neighbours(P) ; + int top_neighbour_ids(T) ; + int top_neighbour_halos(T) ; + int top_neighbour_halo_send(T) ; + int top_neighbour_halo_recv(T) ; + int left_neighbours_periodic(P) ; + int left_neighbour_ids_periodic(L_periodic) ; + int left_neighbour_halos_periodic(L_periodic) ; + int left_neighbour_halo_send_periodic(L_periodic) ; + int left_neighbour_halo_recv_periodic(L_periodic) ; + int right_neighbours_periodic(P) ; + int right_neighbour_ids_periodic(R_periodic) ; + int right_neighbour_halos_periodic(R_periodic) ; + int right_neighbour_halo_send_periodic(R_periodic) ; + int right_neighbour_halo_recv_periodic(R_periodic) ; + int bottom_neighbours_periodic(P) ; + int bottom_neighbour_ids_periodic(B_periodic) ; + int bottom_neighbour_halos_periodic(B_periodic) ; + int bottom_neighbour_halo_send_periodic(B_periodic) ; + int bottom_neighbour_halo_recv_periodic(B_periodic) ; + int top_neighbours_periodic(P) ; + int top_neighbour_ids_periodic(T_periodic) ; + int top_neighbour_halos_periodic(T_periodic) ; + int top_neighbour_halo_send_periodic(T_periodic) ; + int top_neighbour_halo_recv_periodic(T_periodic) ; data: - top_neighbors = 0, 0, 2 ; + left_neighbours = 0, 0, 2 ; + + left_neighbour_ids = 0, 1 ; + + left_neighbour_halos = 3, 4 ; + + left_neighbour_halo_send = 3, 3 ; + + left_neighbour_halo_recv = 11, 14 ; + + right_neighbours = 1, 1, 0 ; + + right_neighbour_ids = 2, 2 ; + + right_neighbour_halos = 3, 4 ; + + right_neighbour_halo_send = 11, 14 ; + + right_neighbour_halo_recv = 3, 3 ; + + bottom_neighbours = 0, 1, 0 ; + + bottom_neighbour_ids = 0 ; + + bottom_neighbour_halos = 3 ; - top_neighbor_ids = 0, 1 ; + bottom_neighbour_halo_send = 6 ; - top_neighbor_halos = 3, 4 ; + bottom_neighbour_halo_recv = 0 ; - bottom_neighbors = 1, 1, 0 ; + top_neighbours = 1, 0, 0 ; - bottom_neighbor_ids = 2, 2 ; + top_neighbour_ids = 1 ; - bottom_neighbor_halos = 3, 4 ; + top_neighbour_halos = 3 ; - left_neighbors = 0, 1, 0 ; + top_neighbour_halo_send = 0 ; - left_neighbor_ids = 0 ; + top_neighbour_halo_recv = 6 ; - left_neighbor_halos = 3 ; + left_neighbours_periodic = 0, 0, 0 ; - right_neighbors = 1, 0, 0 ; + right_neighbours_periodic = 0, 0, 0 ; - right_neighbor_ids = 1 ; + bottom_neighbours_periodic = 0, 0, 0 ; - right_neighbor_halos = 3 ; + top_neighbours_periodic = 0, 0, 0 ; } // group connectivity } From dca50ffad06b9c3f3ae82018f797147efcd966f0 Mon Sep 17 00:00:00 2001 From: tommelt Date: Fri, 17 Jan 2025 15:52:16 +0000 Subject: [PATCH 05/53] chore: fix mpi.h include error --- core/src/ModelMetadata.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index 85e6496d3..1181c3d83 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -19,6 +19,7 @@ #include #ifdef USE_MPI +#include "mpi.h" #include #include #include From 672e637b21e9b9a3693e83e424093def1dceb4a9 Mon Sep 17 00:00:00 2001 From: tommelt Date: Thu, 15 May 2025 11:25:50 +0100 Subject: [PATCH 06/53] chore: fix CMakeLists for mpi tests --- core/test/CMakeLists.txt | 164 +++++++++++++-------------------------- 1 file changed, 55 insertions(+), 109 deletions(-) diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index aad33c5d2..43e1b1f88 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -19,88 +19,6 @@ include_directories(${COMMON_INCLUDE_DIRS}) set(MODEL_INCLUDE_DIR "../../core/src/discontinuousgalerkin") if(ENABLE_MPI) - # Generate partition files needed for MPI test from respective cdl files - add_custom_command( - OUTPUT partition_metadata_3.nc - COMMAND - ncgen -b -o partition_metadata_3.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3.cdl - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3.cdl - ) - add_custom_command( - OUTPUT partition_metadata_2.nc - COMMAND - ncgen -b -o partition_metadata_2.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_2.cdl - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_2.cdl - ) - add_custom_command( - OUTPUT partition_metadata_3_cb.nc partition_metadata_3_pb.nc - COMMAND - ncgen -b -o partition_metadata_3_cb.nc - ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl - COMMAND - ncgen -b -o partition_metadata_3_pb.nc - ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl - DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl - ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl - ) - add_custom_target( - generate_partition_files - ALL - DEPENDS - partition_metadata_3.nc - partition_metadata_2.nc - partition_metadata_3_cb.nc - partition_metadata_3_pb.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(testModelMetadata_MPI3 "ModelMetadata_test.cpp" "MainMPI.cpp") - target_compile_definitions( - testModelMetadata_MPI3 - PRIVATE - USE_MPI - TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" - TEST_FILE_SOURCE=\"${CMAKE_CURRENT_SOURCE_DIR}\" - ) - target_include_directories( - testModelMetadata_MPI3 - PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" - ) - target_link_libraries(testModelMetadata_MPI3 PRIVATE nextsimlib doctest::doctest) - - add_executable(testParaGrid_MPI2 "ParaGrid_test.cpp" "MainMPI.cpp") - target_compile_definitions( - testParaGrid_MPI2 - PRIVATE - USE_MPI - TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" - TEST_FILE_SOURCE=\"${CMAKE_CURRENT_SOURCE_DIR}\" - ) - target_include_directories( - testParaGrid_MPI2 - PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" - ) - target_link_libraries(testParaGrid_MPI2 PRIVATE nextsimlib doctest::doctest) - - add_executable(testConfigOutput_MPI2 "ConfigOutput_test.cpp" "MainMPI.cpp") - target_compile_definitions( - testConfigOutput_MPI2 - PRIVATE USE_MPI TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" - ) - target_include_directories(testConfigOutput_MPI2 PRIVATE ${MODEL_INCLUDE_DIR}) - target_link_libraries(testConfigOutput_MPI2 PRIVATE nextsimlib doctest::doctest) - if(ENABLE_XIOS) set(XIOS_INCLUDE_LIST "${xios_INCLUDES}" @@ -185,59 +103,87 @@ if(ENABLE_MPI) ) target_link_libraries(testXiosWrite_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) - - add_executable(testConfigOutput_MPI2 "ConfigOutput_test.cpp" "MainMPI.cpp") - target_compile_definitions( - testConfigOutput_MPI2 - PRIVATE USE_MPI TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" - ) - target_include_directories(testConfigOutput_MPI2 PRIVATE ${MODEL_INCLUDE_DIR}) - target_link_libraries(testConfigOutput_MPI2 PRIVATE nextsimlib doctest::doctest) - # Generate partition files needed for MPI test from respective cdl files add_custom_command( OUTPUT partition_metadata_3.nc COMMAND - ncgen -b -o partition_metadata_3.nc - ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3.cdl + ncgen -b -o partition_metadata_3.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3.cdl DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3.cdl ) add_custom_command( OUTPUT partition_metadata_2.nc COMMAND - ncgen -b -o partition_metadata_2.nc - ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_2.cdl + ncgen -b -o partition_metadata_2.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_2.cdl DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_2.cdl ) + add_custom_command( + OUTPUT partition_metadata_3_cb.nc partition_metadata_3_pb.nc + COMMAND + ncgen -b -o partition_metadata_3_cb.nc + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl + COMMAND + ncgen -b -o partition_metadata_3_pb.nc + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl + ) add_custom_target( generate_partition_files ALL - DEPENDS partition_metadata_3.nc partition_metadata_2.nc + DEPENDS + partition_metadata_3.nc + partition_metadata_2.nc + partition_metadata_3_cb.nc + partition_metadata_3_pb.nc ) add_executable(testParaGrid_MPI2 "ParaGrid_test.cpp" "MainMPI.cpp") target_compile_definitions( testParaGrid_MPI2 PRIVATE - USE_MPI - TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" - TEST_FILE_SOURCE=\"${CMAKE_CURRENT_SOURCE_DIR}\" + USE_MPI + TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" + TEST_FILE_SOURCE=\"${CMAKE_CURRENT_SOURCE_DIR}\" ) target_include_directories( testParaGrid_MPI2 PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" ) target_link_libraries(testParaGrid_MPI2 PRIVATE nextsimlib doctest::doctest) + + 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(testModelMetadata_MPI3 "ModelMetadata_test.cpp" "MainMPI.cpp") + target_compile_definitions( + testModelMetadata_MPI3 + PRIVATE + USE_MPI + TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" + TEST_FILE_SOURCE=\"${CMAKE_CURRENT_SOURCE_DIR}\" + ) + target_include_directories( + testModelMetadata_MPI3 + PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" + ) + target_link_libraries(testModelMetadata_MPI3 PRIVATE nextsimlib doctest::doctest) + + add_executable(testConfigOutput_MPI2 "ConfigOutput_test.cpp" "MainMPI.cpp") + target_compile_definitions( + testConfigOutput_MPI2 + PRIVATE USE_MPI TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" + ) + target_include_directories(testConfigOutput_MPI2 PRIVATE ${MODEL_INCLUDE_DIR}) + target_link_libraries(testConfigOutput_MPI2 PRIVATE nextsimlib doctest::doctest) endif() else() add_executable(testRectGrid "RectGrid_test.cpp") From 847ba27b70eb6dec8d1c93e094fb535f2a0ba375 Mon Sep 17 00:00:00 2001 From: tommelt Date: Fri, 20 Dec 2024 17:47:34 +0000 Subject: [PATCH 07/53] test: working example of halo exchange This test includes two examples for different grid layouts: - 3 x 1 grid (3 procs) - 2 x 2 grid (4 procs) Makes use of the Slice functionality --- core/src/include/ModelArraySlice.hpp | 5 +- core/test/CMakeLists.txt | 16 + core/test/HaloExchange_test.cpp | 418 +++++++++++++++++++++++++++ 3 files changed, 437 insertions(+), 2 deletions(-) create mode 100644 core/test/HaloExchange_test.cpp diff --git a/core/src/include/ModelArraySlice.hpp b/core/src/include/ModelArraySlice.hpp index 716863422..c5ae266ec 100644 --- a/core/src/include/ModelArraySlice.hpp +++ b/core/src/include/ModelArraySlice.hpp @@ -189,13 +189,14 @@ class ModelArraySlice { * @param buffer The target of the copying. The buffer type must provide a forward operator. * The buffer object must provide at least as many elements as exist in the * slice. + * @param startIndex Starting index in the target buffer where data will be copied. * @return A reference to the updated buffer object. */ - template T& copyToBuffer(T& buffer) + template T& copyToBuffer(T& buffer, size_t startIndex = 0) { // make no especial attempt at efficiency here SliceIter thisIter(slice, data.dimensions()); - auto biter = buffer.begin(); + auto biter = std::next(buffer.begin(), startIndex); while (!thisIter.isEnd()) { // If the buffer ends before the slice, throw an exception diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index 43e1b1f88..b9e91a06e 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -138,6 +138,22 @@ if(ENABLE_MPI) partition_metadata_3_pb.nc ) + add_executable(testHaloExchange_MPI3 + "HaloExchange_test.cpp" + "MainMPI.cpp" + "../src/ModelArray.cpp" + "../src/ModelArraySlice.cpp" + ) + target_compile_definitions(testHaloExchange_MPI3 PRIVATE USE_MPI TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\") + target_include_directories( + testHaloExchange_MPI3 PRIVATE + ${MODEL_INCLUDE_DIR} + "${ModulesRoot}/StructureModule" + "../src" + "../../dynamics/src" + ) + target_link_libraries(testHaloExchange_MPI3 PRIVATE nextsimlib doctest::doctest) + add_executable(testParaGrid_MPI2 "ParaGrid_test.cpp" "MainMPI.cpp") target_compile_definitions( testParaGrid_MPI2 diff --git a/core/test/HaloExchange_test.cpp b/core/test/HaloExchange_test.cpp new file mode 100644 index 000000000..86c19542e --- /dev/null +++ b/core/test/HaloExchange_test.cpp @@ -0,0 +1,418 @@ +/*! + * @file ModelMetadata_test.cpp + * + * @date 27 Jan 2025 + * @author Tom Meltzer + */ + +#include +#include +#include +#include + +#include +#include + +#include "ModelMetadata.hpp" +#include "ParaGridIO.hpp" +#include "Slice.hpp" +#include "include/DGModelArray.hpp" +#include "include/ModelArraySlice.hpp" +#include "include/ParametricMesh.hpp" +#include "include/dgVector.hpp" +#include "mpi.h" + +namespace Nextsim { + +const std::string testFilesDir = TEST_FILES_DIR; +const std::string file_cb = testFilesDir + "/partition_metadata_3_cb.nc"; +const std::string file_pb = testFilesDir + "/partition_metadata_3_pb.nc"; + +static const int DG = 3; +static const bool debug = false; + +// aliases +using Indexer::indexer; +using Slice = ArraySlicer::Slice; +using VBounds = ArraySlicer::Slice::VBounds; +using SliceIter = ArraySlicer::SliceIter; + +constexpr ModelMetadata::Edge BOTTOM = ModelMetadata::Edge::BOTTOM; +constexpr ModelMetadata::Edge RIGHT = ModelMetadata::Edge::RIGHT; +constexpr ModelMetadata::Edge TOP = ModelMetadata::Edge::TOP; +constexpr ModelMetadata::Edge LEFT = ModelMetadata::Edge::LEFT; + +// make some slices for later use +// clang-format off +VBounds VBAll {{ },{ }}; +VBounds VBLeft {{ 0},{ }}; +VBounds VBRight {{-1},{ }}; +VBounds VBTop {{ },{-1}}; +VBounds VBBottom {{ },{ 0}}; +// clang-format on +std::map slices = { + { LEFT, VBLeft }, + { RIGHT, VBRight }, + { TOP, VBTop }, + { BOTTOM, VBBottom }, +}; + +// print out dgvec so that origin (0,0) is bottom left corner +static void printDGVec(DGVector& dgvec, SliceIter::MultiDim& dims) +{ + if (debug) { + for (size_t j = 0; j < dims[1]; ++j) { + for (size_t i = 0; i < dims[0]; ++i) { + size_t pos = indexer(dims, { i, dims[1] - j - 1 }); + printf("%6.0f ", dgvec(pos, 0)); + } + printf("\n"); + } + printf("--------------------------------------------------\n"); + } +}; + +ParametricMesh initializeSmesh(size_t localNx, size_t localNy) +{ + auto CoordinateSystem = Nextsim::CARTESIAN; + ParametricMesh smesh(CoordinateSystem); + smesh.nx = localNx + 2; + smesh.ny = localNy + 2; + smesh.nnodes = smesh.nx * smesh.ny; + smesh.nelements = smesh.nnodes; + smesh.vertices.resize(smesh.nelements, Eigen::NoChange); // note these are uninitialised but + // unused in this test + return smesh; +} + +void initializeHField(ModelArray& hfield, size_t localNx, size_t localNy, size_t offsetX, + size_t offsetY, int test_rank) +{ + // initialize with mock data + for (size_t j = 0; j < localNy; ++j) { + for (size_t i = 0; i < localNx; ++i) { + hfield(i, j) = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); + } + } +} + +void setDGVecValue(DGVector& dgvec, SliceIter::MultiDim meshDims, double value) +{ + for (size_t k = 0; k < DG; ++k) { + for (size_t j = 0; j < meshDims[1]; ++j) { + for (size_t i = 0; i < meshDims[0]; ++i) { + size_t pos = indexer(meshDims, std::vector({ i, j })); + dgvec(pos, k) = value; + } + } + } +} + +void updateDGVec(DGVector& dgvec, const std::vector& recv, + const SliceIter::MultiDim meshDims, std::array& edgeLengths, + const ModelMetadata::Edge edge) +{ + SliceIter sliceIter = SliceIter(slices.at(edge), meshDims); + size_t offset = std::accumulate(edgeLengths.begin(), edgeLengths.begin() + edge, 0); + std::vector edgeIndices; + while (!sliceIter.isEnd()) { + const size_t start = sliceIter.index(); + const size_t step = sliceIter.step(0); + const size_t n = sliceIter.nElements(0); + for (int i = 0; i < n; ++i) { + auto idx = start + i * step; + edgeIndices.push_back(idx); + } + sliceIter.incrementDim(1); + } + + for (size_t i = 0; i < edgeIndices.size() - 2; ++i) { + dgvec(edgeIndices[i + 1], 0) = recv[offset + i]; + } +} + +TEST_SUITE_BEGIN("Halo exchange tests"); +MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) +{ + // test for a 3 proc grid + // ┌─┬─┐ + // │1│ │ + // ├─┤2│ + // │0│ │ + // └─┴─┘ (proc id) + + ModelMetadata metadata(file_cb, test_comm); + + const size_t nx = metadata.globalExtentX; + const size_t ny = metadata.globalExtentY; + const size_t localNx = metadata.localExtentX; + const size_t localNy = metadata.localExtentY; + const size_t offsetX = metadata.localCornerX; + const size_t offsetY = metadata.localCornerY; + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + + // create example 2D field on each process + auto testfield = ModelArray::HField(); + testfield.resize(); + initializeHField(testfield, localNx, localNy, offsetX, offsetY, test_rank); + + // create example 2D field for dynamics code which needs +1 halo on all edges, leading to +2 in + // x and y + // Create the ParametricMesh object to initialize dgvec + ParametricMesh smesh = initializeSmesh(localNx, localNy); + + // create dgvec to simulate nextsim + DGVector dgvec(smesh); + SliceIter::MultiDim meshDims = { smesh.nx, smesh.ny }; + + // initialize dgvec to -1 + setDGVecValue(dgvec, meshDims, -1.0); + + // we want to copy testfield to the central block + Slice centreBlock(VBounds({ { 1, -1 }, { 1, -1 } })); + SliceIter eigCentre(centreBlock, meshDims); + + // all spatial dims are collapsed into the first dimension (col(0)) + // The other dimensions are for higher-order DG components + auto dgvecSpatial = dgvec.array().col(0); + + // copy from testfield into the dgvec + testfield[Slice(VBAll)].copyToSlicedBuffer(dgvecSpatial, eigCentre); + + // print to check data copied successfully + printDGVec(dgvec, meshDims); + + auto edges = ModelMetadata::edges; + std::array edgeLengths = { localNx, localNy, localNx, localNy }; // BRTL + + // create a send buffer the size of the perimeter of the domain + // each process will populate the send buffer with their perimeter cells + const size_t perimeterLength = 2 * localNx + 2 * localNy; + std::vector send = std::vector(perimeterLength, 0.0); + std::vector recv = std::vector(perimeterLength, 0.0); + + for (auto edge : edges) { + size_t offset = std::accumulate(edgeLengths.begin(), edgeLengths.begin() + edge, 0); + testfield[slices.at(edge)].copyToBuffer(send, offset); + } + + // create a RMA memory window which all process will be able to access + MPI_Win win; + MPI_Win_create( + &send[0], perimeterLength * sizeof(double), sizeof(double), MPI_INFO_NULL, test_comm, &win); + + MPI_Win_fence(MPI_MODE_NOPRECEDE, win); // Fence, no preceding RMA calls + + // Each process can now gather the data it needs (based on mpi metadata) from the respective + // send buffers on the other processes (or current process under some circumstances e.g., + // periodic boundary conditions) + + // get non-periodic neighbours and populate recv buffer + for (auto edge : edges) { + auto numNeighbours = metadata.neighbourRanks[edge].size(); + if (numNeighbours) { + // get data for each neighbour + for (size_t i = 0; i < numNeighbours; ++i) { + int fromRank = metadata.neighbourRanks[edge][i]; + size_t count = metadata.neighbourExtents[edge][i]; + size_t disp = metadata.neighbourHaloSend[edge][i]; + size_t recvOffset = metadata.neighbourHaloRecv[edge][i]; + MPI_Get( + &recv[recvOffset], count, MPI_DOUBLE, fromRank, disp, count, MPI_DOUBLE, win); + } + } + } + + MPI_Win_fence(MPI_MODE_NOSUCCEED, win); // Fence, no RMA calls in next epoch + MPI_Win_free(&win); // free window + + // populate dgvec with halo data from the recv buffer + for (auto edge : edges) { + updateDGVec(dgvec, recv, meshDims, edgeLengths, edge); + } + + // print to check halo cells copied correctly + printDGVec(dgvec, meshDims); + + // mock data for halo exchange for each test rank (0-2) + std::array, 3> mockDataAllProcs = { + std::vector( + { -1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 100, 110, 120, 130, 140, 150, 160, 370, 0, 101, 111, + 121, 131, 141, 151, 161, 371, 0, 102, 112, 122, 132, 142, 152, 162, 372, 0, 103, + 113, 123, 133, 143, 153, 163, 373, -1, 204, 214, 224, 234, 244, 254, 264, -1 }), + std::vector({ -1, 103, 113, 123, 133, 143, 153, 163, -1, 0, 204, 214, 224, 234, 244, + 254, 264, 374, 0, 205, 215, 225, 235, 245, 255, 265, 375, 0, 206, 216, 226, 236, 246, + 256, 266, 376, 0, 207, 217, 227, 237, 247, 257, 267, 377, 0, 208, 218, 228, 238, 248, + 258, 268, 378, -1, 0, 0, 0, 0, 0, 0, 0, -1 }), + std::vector({ -1, 0, 0, 0, -1, 160, 370, 380, 390, 0, 161, 371, 381, 391, 0, 162, + 372, 382, 392, 0, 163, 373, 383, 393, 0, 264, 374, 384, 394, 0, 265, 375, 385, 395, 0, + 266, 376, 386, 396, 0, 267, 377, 387, 397, 0, 268, 378, 388, 398, 0, -1, 0, 0, 0, -1 }), + }; + + // create mock eigen matrix for each process + Eigen::Matrix mockData; + mockData.resize(dgvecSpatial.size(), 1); + mockData = Eigen::Map>( + mockDataAllProcs[test_rank].data(), mockData.size(), 1); + + // spatial part of dgvec + auto testData = dgvec(Eigen::all, 0); + + // compare mock data with data generated in this test (testData) + REQUIRE(testData.isApprox(mockData)); +} +MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditions", 3) +{ + // test for a 3 proc grid + // ┌─┬─┐ + // │1│ │ + // ├─┤2│ + // │0│ │ + // └─┴─┘ (proc id) + + ModelMetadata metadata(file_pb, test_comm); + + const size_t nx = metadata.globalExtentX; + const size_t ny = metadata.globalExtentY; + const size_t localNx = metadata.localExtentX; + const size_t localNy = metadata.localExtentY; + const size_t offsetX = metadata.localCornerX; + const size_t offsetY = metadata.localCornerY; + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + + // create example 2D field on each process + auto testfield = ModelArray::HField(); + testfield.resize(); + initializeHField(testfield, localNx, localNy, offsetX, offsetY, test_rank); + + // create example 2D field for dynamics code which needs +1 halo on all edges, leading to +2 in + // x and y + // Create the ParametricMesh object to initialize dgvec + ParametricMesh smesh = initializeSmesh(localNx, localNy); + + // create dgvec to simulate nextsim + DGVector dgvec(smesh); + SliceIter::MultiDim meshDims = { smesh.nx, smesh.ny }; + + // initialize dgvec to -1 + setDGVecValue(dgvec, meshDims, -1.0); + + // we want to copy testfield to the central block + Slice centreBlock(VBounds({ { 1, -1 }, { 1, -1 } })); + SliceIter eigCentre(centreBlock, meshDims); + + // all spatial dims are collapsed into the first dimension (col(0)) + // The other dimensions are for higher-order DG components + auto dgvecSpatial = dgvec.array().col(0); + + // copy from testfield into the dgvec + testfield[Slice(VBAll)].copyToSlicedBuffer(dgvecSpatial, eigCentre); + + // print to check data copied successfully + printDGVec(dgvec, meshDims); + + auto edges = ModelMetadata::edges; + std::array edgeLengths = { localNx, localNy, localNx, localNy }; // BRTL + + // create a send buffer the size of the perimeter of the domain + // each process will populate the send buffer with their perimeter cells + const size_t perimeterLength = 2 * localNx + 2 * localNy; + std::vector send = std::vector(perimeterLength, 0.0); + std::vector recv = std::vector(perimeterLength, 0.0); + + for (auto edge : edges) { + size_t offset = std::accumulate(edgeLengths.begin(), edgeLengths.begin() + edge, 0); + testfield[slices.at(edge)].copyToBuffer(send, offset); + } + + // create a RMA memory window which all process will be able to access + MPI_Win win; + MPI_Win_create( + &send[0], perimeterLength * sizeof(double), sizeof(double), MPI_INFO_NULL, test_comm, &win); + + MPI_Win_fence(MPI_MODE_NOPRECEDE, win); // Fence, no preceding RMA calls + + // Each process can now gather the data it needs (based on mpi metadata) from the respective + // send buffers on the other processes (or current process under some circumstances e.g., + // periodic boundary conditions) + + // get non-periodic neighbours and populate recv buffer + for (auto edge : edges) { + auto numNeighbours = metadata.neighbourRanks[edge].size(); + if (numNeighbours) { + // get data for each neighbour + for (size_t i = 0; i < numNeighbours; ++i) { + int fromRank = metadata.neighbourRanks[edge][i]; + size_t count = metadata.neighbourExtents[edge][i]; + size_t disp = metadata.neighbourHaloSend[edge][i]; + size_t recvOffset = metadata.neighbourHaloRecv[edge][i]; + MPI_Get( + &recv[recvOffset], count, MPI_DOUBLE, fromRank, disp, count, MPI_DOUBLE, win); + } + } + } + + // get periodic neighbours and populate recv buffer + for (auto edge : edges) { + auto numNeighbours = metadata.neighbourRanksPeriodic[edge].size(); + if (numNeighbours) { + // get data for each neighbour + for (size_t i = 0; i < numNeighbours; ++i) { + int fromRank = metadata.neighbourRanksPeriodic[edge][i]; + size_t count = metadata.neighbourExtentsPeriodic[edge][i]; + size_t disp = metadata.neighbourHaloSendPeriodic[edge][i]; + size_t recvOffset = metadata.neighbourHaloRecvPeriodic[edge][i]; + MPI_Get( + &recv[recvOffset], count, MPI_DOUBLE, fromRank, disp, count, MPI_DOUBLE, win); + } + } + } + + MPI_Win_fence(MPI_MODE_NOSUCCEED, win); // Fence, no RMA calls in next epoch + MPI_Win_free(&win); // free window + + // populate dgvec with halo data from the recv buffer + for (auto edge : edges) { + updateDGVec(dgvec, recv, meshDims, edgeLengths, edge); + } + + // print to check halo cells copied correctly + printDGVec(dgvec, meshDims); + + // mock data for halo exchange for each test rank (0-2) + std::array, 3> mockDataAllProcs = { + std::vector({ -1, 208, 218, 228, 238, 248, 258, 268, -1, 390, 100, 110, 120, 130, + 140, 150, 160, 370, 391, 101, 111, 121, 131, 141, 151, 161, 371, 392, 102, 112, 122, + 132, 142, 152, 162, 372, 393, 103, 113, 123, 133, 143, 153, 163, 373, -1, 204, 214, 224, + 234, 244, 254, 264, -1 }), + std::vector({ -1, 103, 113, 123, 133, 143, 153, 163, -1, 394, 204, 214, 224, 234, + 244, 254, 264, 374, 395, 205, 215, 225, 235, 245, 255, 265, 375, 396, 206, 216, 226, + 236, 246, 256, 266, 376, 397, 207, 217, 227, 237, 247, 257, 267, 377, 398, 208, 218, + 228, 238, 248, 258, 268, 378, -1, 100, 110, 120, 130, 140, 150, 160, -1 }), + std::vector({ -1, 378, 388, 398, -1, 160, 370, 380, 390, 100, 161, 371, 381, 391, + 101, 162, 372, 382, 392, 102, 163, 373, 383, 393, 103, 264, 374, 384, 394, 204, 265, + 375, 385, 395, 205, 266, 376, 386, 396, 206, 267, 377, 387, 397, 207, 268, 378, 388, + 398, 208, -1, 370, 380, 390, -1 }), + }; + + // create mock eigen matrix for each process + Eigen::Matrix mockData; + mockData.resize(dgvecSpatial.size(), 1); + mockData = Eigen::Map>( + mockDataAllProcs[test_rank].data(), mockData.size(), 1); + + // spatial part of dgvec + auto testData = dgvec(Eigen::all, 0); + + std::vector v2; + v2.resize(testData.size()); + Eigen::Matrix::Map(&v2[0], testData.size()) = testData; + + // compare mock data with data generated in this test (testData) + REQUIRE(testData.isApprox(mockData)); +} +} From fd4c9160df5376b51972cace38c5141edc94b4d8 Mon Sep 17 00:00:00 2001 From: tommelt Date: Tue, 28 Jan 2025 14:30:16 +0000 Subject: [PATCH 08/53] feat: separate halo exchange logic into class --- .gitignore | 3 + core/src/ParaGridIO.cpp | 120 +++++--- core/src/include/Halo.hpp | 316 +++++++++++++++++++++ core/src/include/ModelArray.hpp | 22 ++ core/src/include/ModelArraySlice.hpp | 18 ++ core/test/CMakeLists.txt | 1 + core/test/HaloExchange_test.cpp | 401 +++++---------------------- core/test/ParaGrid_test.cpp | 18 +- dynamics/src/ParametricMesh.cpp | 3 +- 9 files changed, 528 insertions(+), 374 deletions(-) create mode 100644 core/src/include/Halo.hpp diff --git a/.gitignore b/.gitignore index f3533f51f..9ef3ec9da 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,6 @@ __pycache__/ *.sif .*sw? /run/*.cdl +.cache/ +.clangd +compile_commands.json diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index c0d671eca..5ad88f742 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -10,6 +10,9 @@ #include "include/CommonRestartMetadata.hpp" #include "include/FileCallbackCloser.hpp" #include "include/Finalizer.hpp" +#ifdef USE_MPI +#include "include/Halo.hpp" +#endif #include "include/MissingData.hpp" #include "include/gridNames.hpp" @@ -138,59 +141,90 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) localLength = dim.getSize(); start = 0; } - ModelArray::setDimension(dimType, dim.getSize(), localLength, start); + ModelArray::setDimension(dimType, dim.getSize() + 2 * Halo::haloWidth, + localLength + 2 * Halo::haloWidth, start); #else ModelArray::setDimension(dimType, dim.getSize()); #endif } + } - // Get all vars in the data group, and load them into a new ModelState + // Get all vars in the data group, and load them into a new ModelState - for (auto entry : dataGroup.getVars()) { - const std::string& varName = entry.first; - netCDF::NcVar& var = entry.second; - // Determine the type from the dimensions - std::vector varDims = var.getDims(); - std::string dimKey = ""; - for (netCDF::NcDim& dim : varDims) { - dimKey += dim.getName(); - } - if (!dimensionKeys.count(dimKey)) { - throw std::out_of_range( - std::string("No ModelArray::Type corresponds to the dimensional key ") - + dimKey); - } - ModelArray::Type type = dimensionKeys.at(dimKey); - state.data[varName] = ModelArray(type); - ModelArray& data = state.data.at(varName); - data.resize(); + for (auto entry : dataGroup.getVars()) { + const std::string& varName = entry.first; + netCDF::NcVar& var = entry.second; + // Determine the type from the dimensions + std::vector varDims = var.getDims(); + std::string dimKey = ""; + for (netCDF::NcDim& dim : varDims) { + dimKey += dim.getName(); + } + if (!dimensionKeys.count(dimKey)) { + throw std::out_of_range( + std::string("No ModelArray::Type corresponds to the dimensional key ") + dimKey); + } + ModelArray::Type type = dimensionKeys.at(dimKey); + state.data[varName] = ModelArray(type); + ModelArray& data = state.data.at(varName); + data.resize(); - std::vector start; - std::vector count; - if (ModelArray::hasDoF(type)) { - auto ncomps = data.nComponents(); - start.push_back(0); - count.push_back(ncomps); - } - for (ModelArray::Dimension dt : ModelArray::typeDimensions.at(type)) { - auto dim = ModelArray::definedDimensions.at(dt); - start.push_back(dim.start); - count.push_back(dim.localLength); - } - // dims are looped in [dg], x, y, [z] order so start and count - // order must be reveresed to match order netcdf expects - std::reverse(start.begin(), start.end()); - std::reverse(count.begin(), count.end()); + std::vector start; + std::vector count; + if (ModelArray::hasDoF(type)) { + auto ncomps = data.nComponents(); + start.push_back(0); + count.push_back(ncomps); + } - var.getVar(start, count, &data[0]); + using Dim = ModelArray::Dimension; + for (Dim dt : ModelArray::typeDimensions.at(type)) { + auto dim = ModelArray::definedDimensions.at(dt); + size_t startIndex = dim.start; + size_t localLength = dim.localLength; +#ifdef USE_MPI + if (dt == Dim::X or dt == Dim::XVERTEX) { + localLength = localLength - 2 * Halo::haloWidth; + } else if (dt == Dim::Y or dt == Dim::YVERTEX) { + localLength = localLength - 2 * Halo::haloWidth; + } +#endif + start.push_back(startIndex); + count.push_back(localLength); } - ncFile.close(); - } catch (const netCDF::exceptions::NcException& nce) { - std::string ncWhat(nce.what()); - ncWhat += ": " + filePath; - throw std::runtime_error(ncWhat); + // dims are looped in [dg], x, y, [z] order so start and count + // order must be reveresed to match order netcdf expects + std::reverse(start.begin(), start.end()); + std::reverse(count.begin(), count.end()); + +#ifdef USE_MPI + // TODO + // at this point we should add the halo exchange logic for each modelarray + // need to check what happens for non-H-field modelarrays + // need to figure out what happens w.r.t to coords in non-periodic and periodic case + + Halo halo(metadata, data); + // create and allocate temporary Eigen array + ModelArray::DataType tempData; + tempData.resize(halo.getInnerSize(), data.nComponents()); + // populate temp Eigen array with data from netCDF file + var.getVar(start, count, tempData.data()); + // populate inner block of modelarray with data from tempData + halo.populateInnerBlock(tempData); + halo.exchangeHalos(); +#else + var.getVar(start, count, &data[0]); +#endif } - return state; + ncFile.close(); +} +catch (const netCDF::exceptions::NcException& nce) +{ + std::string ncWhat(nce.what()); + ncWhat += ": " + filePath; + throw std::runtime_error(ncWhat); +} +return state; } ModelState ParaGridIO::readForcingTimeStatic( diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp new file mode 100644 index 000000000..0b75f3312 --- /dev/null +++ b/core/src/include/Halo.hpp @@ -0,0 +1,316 @@ +/*! + * @file Halo.hpp + * + * @date 29 Apr 2025 + * @author Tom Meltzer + */ + +#ifndef HALO_HPP +#define HALO_HPP + +#include +#include +#include +#include +#include + +#include "Slice.hpp" +#include "include/ModelArray.hpp" +#include "include/ModelArraySlice.hpp" +#include "include/ModelMetadata.hpp" +#include "mpi.h" + +#ifndef DGCOMP +#define DGCOMP 3 +#endif + +#ifndef DGSTRESSCOMP +#define DGSTRESSCOMP 8 +#endif + +#ifndef CGDEGREE +#define CGDEGREE 2 +#endif + +namespace Nextsim { + +/*! + * @brief A class to facilitate halo exchange between MPI ranks + * + * @details + */ +class Halo { +public: + /*! + * @brief Constructs a halo object + */ + Halo(ModelMetadata& metadata, ModelArray& ma) + : m_metadata(std::make_unique(metadata)) + , m_ma(ma) + { + m_innerNx = ma.innerDimensions()[0]; + m_innerNy = ma.innerDimensions()[1]; + m_perimeterLength = 2 * m_innerNx + 2 * m_innerNy; + m_numComps = m_ma.nComponents(); + send.resize(m_numComps); + recv.resize(m_numComps); + for (size_t i = 0; i < m_numComps; i++) { + send[i].resize(m_perimeterLength, 0.0); + recv[i].resize(m_perimeterLength, 0.0); + } + m_edgeLengths = { m_innerNx, m_innerNy, m_innerNx, m_innerNy }; // order is Bottom + m_comm = metadata.mpiComm; + + m_outerSlices = { + { Edge::LEFT, VBounds({ { 0 }, { 1, m_innerNy + haloWidth } }) }, + { Edge::RIGHT, VBounds({ { -1 }, { 1, m_innerNy + haloWidth } }) }, + { Edge::TOP, VBounds({ { 1, m_innerNx + haloWidth }, { -1 } }) }, + { Edge::BOTTOM, VBounds({ { 1, m_innerNx + haloWidth }, { 0 } }) }, + }; + m_innerSlices = { + { Edge::LEFT, VBounds({ { 1 }, { 1, m_innerNy + haloWidth } }) }, + { Edge::RIGHT, VBounds({ { -2 }, { 1, m_innerNy + haloWidth } }) }, + { Edge::TOP, VBounds({ { 1, m_innerNx + haloWidth }, { -2 } }) }, + { Edge::BOTTOM, VBounds({ { 1, m_innerNx + haloWidth }, { 1 } }) }, + }; + m_innerSlicesVertexAdjusted = { + { Edge::LEFT, VBounds({ { 2 }, { 1, m_innerNy + haloWidth } }) }, + { Edge::RIGHT, VBounds({ { -3 }, { 1, m_innerNy + haloWidth } }) }, + { Edge::TOP, VBounds({ { 1, m_innerNx + haloWidth }, { -3 } }) }, + { Edge::BOTTOM, VBounds({ { 1, m_innerNx + haloWidth }, { 2 } }) }, + }; + } + + static const size_t haloWidth = 1; // how many cells wide is the halo region + +private: + using Slice = ArraySlicer::Slice; + using SliceIter = ArraySlicer::SliceIter; + using Edge = ModelMetadata::Edge; + using VBounds = ArraySlicer::Slice::VBounds; + + const typedef ArraySlicer::SliceIter::MultiDim MultiDim; + const MultiDim m_haloDims; + ModelArray& m_ma; // reference to modelarray + size_t m_innerNx; // local extent in x-direction + size_t m_innerNy; // local extent in y-direction + size_t m_perimeterLength; // length of perimeter of domain + size_t m_numComps; // number of DG components + std::unique_ptr m_metadata; // pointer to metadata + std::array m_edgeLengths; // array containing length of each edge + std::array edges = ModelMetadata::edges; // array of edge enums + std::map m_outerSlices; + std::map m_innerSlices; + std::map m_innerSlicesVertexAdjusted; + MPI_Win m_win; // RMA memory window object (used for sharing send buffers between ranks) + MPI_Comm m_comm; // RMA memory window object (used for sharing send buffers between ranks) + + std::map oppositeEdge = { + { Edge::LEFT, Edge::RIGHT }, + { Edge::RIGHT, Edge::LEFT }, + { Edge::TOP, Edge::BOTTOM }, + { Edge::BOTTOM, Edge::TOP }, + }; // map to opposite edge + + /*! + * @brief Open memory window to exchange send buffer between MPI ranks. + * + * @ details this is not intended to be used manually. It should only be called as part of the + * update method. + */ + void openMemoryWindow(size_t idx) + { + // create a RMA memory window which all ranks will be able to access + MPI_Win_create(&send[idx][0], m_perimeterLength * sizeof(double), sizeof(double), + MPI_INFO_NULL, m_comm, &m_win); + // remove fence and check that no proceding RMA calls have been made + MPI_Win_fence(MPI_MODE_NOPRECEDE, m_win); + } + + /*! + * @brief Initialise memory window to exchange send buffer between MPI ranks. + * + * @ details this is not intended to be used manually. It should only be called as part of the + * update method. + */ + void closeMemoryWindow() + { + // enable fence i.e., disable future RMA calls until we re-open memory window + MPI_Win_fence(MPI_MODE_NOSUCCEED, m_win); + // free window object + MPI_Win_free(&m_win); + } + + /*! + * @brief Populate send buffer with halo data of the specified ModelArray + */ + void populateSendBuffers() + { + tempBuffer.resize(m_perimeterLength, m_numComps); + for (auto edge : edges) { + size_t beg = std::accumulate(m_edgeLengths.begin(), m_edgeLengths.begin() + edge, 0); + size_t num = m_edgeLengths.at(edge); + if (m_ma.getType() == ModelArray::Type::VERTEX) { + // because vertex points lie along the domain boundaries we need offset the + // slices by and additional row/column + // m_ma[m_innerSlicesVertexAdjusted.at(edge)].copyToBuffer(send[i], offset); + tempBuffer(Eigen::seqN(beg, num), Eigen::all) + = static_cast(m_ma[m_innerSlicesVertexAdjusted.at(edge)]); + } else { + // m_ma[m_innerSlices.at(edge)].copyToBuffer(send[i], offset); + tempBuffer(Eigen::seqN(beg, num), Eigen::all) + = static_cast(m_ma[m_innerSlices.at(edge)]); + } + } + // we need to copy into std vector send buffer because MPI doesn't work with Eigen Arrays + for (size_t i = 0; i < m_numComps; i++) { + typedef Eigen::Map MapType; + MapType map(send[i].data(), m_perimeterLength, 1); + // map is connected with the send buffer so the following line sets the data in send + map = tempBuffer.col(i); + } + } + + /*! + * @brief Populate recv buffer with halo data from other ranks send buffers via the memory + * window + */ + void populateRecvBuffers() + { + + // do halo exchange for each component + for (size_t comp = 0; comp < m_numComps; comp++) { + // open memory window to send buffer on other ranks + openMemoryWindow(comp); + + // get non-periodic neighbours and populate recv buffer (if the exist) + for (auto edge : edges) { + auto numNeighbours = m_metadata->neighbourRanks[edge].size(); + if (numNeighbours) { + // get data for each neighbour that exists along a given edge + for (size_t i = 0; i < numNeighbours; ++i) { + int fromRank = m_metadata->neighbourRanks[edge][i]; + size_t count = m_metadata->neighbourExtents[edge][i]; + size_t disp = m_metadata->neighbourHaloSend[edge][i]; + size_t recvOffset = m_metadata->neighbourHaloRecv[edge][i]; + if (m_ma.getType() == ModelArray::Type::VERTEX) { + vertexAdjustedPositions( + count = count, disp = disp, recvOffset = recvOffset, edge = edge); + } + MPI_Get(&recv[comp][recvOffset], count, MPI_DOUBLE, fromRank, disp, count, + MPI_DOUBLE, m_win); + } + } + } + + // get periodic neighbours and populate recv buffer (if they exist) + for (auto edge : edges) { + auto numNeighbours = m_metadata->neighbourRanksPeriodic[edge].size(); + if (numNeighbours) { + // get data for each neighbour that exists along a given edge + for (size_t i = 0; i < numNeighbours; ++i) { + int fromRank = m_metadata->neighbourRanksPeriodic[edge][i]; + size_t count = m_metadata->neighbourExtentsPeriodic[edge][i]; + size_t disp = m_metadata->neighbourHaloSendPeriodic[edge][i]; + size_t recvOffset = m_metadata->neighbourHaloRecvPeriodic[edge][i]; + if (m_ma.getType() == ModelArray::Type::VERTEX) { + vertexAdjustedPositions( + count = count, disp = disp, recvOffset = recvOffset, edge = edge); + } + MPI_Get(&recv[comp][recvOffset], count, MPI_DOUBLE, fromRank, disp, count, + MPI_DOUBLE, m_win); + } + } + } + + // close memory window (essentially make sure all communications are done before moving + // on) + closeMemoryWindow(); + } + + // copy from the recv std vector into an eigen array + for (size_t i = 0; i < m_numComps; i++) { + typedef Eigen::Map MapType; + MapType map(recv[i].data(), m_perimeterLength, 1); + // map is connected with the recv buffer so the following line copies the data into + // tempBuffer + tempBuffer.col(i) = map; + } + } + + void vertexAdjustedPositions(size_t& count, size_t& disp, size_t& recvOffset, Edge& edge) + { + count = count + haloWidth; + disp = disp + oppositeEdge.at(edge) * haloWidth; + recvOffset = recvOffset + edge * haloWidth; + } + +public: + std::vector> + send; // buffer to store halo region that will be read by other ranks + std::vector> + recv; // buffer to store halo region which is read from other ranks + ModelArray::DataType tempBuffer; + + /*! + * @brief Returns size of the inner flattened array + */ + size_t getInnerSize() { return m_innerNx * m_innerNy; } + + /*! + * @brief Populate inner block of ModelArray from tempData + * + * @params ma ModelArray which we intend to update across MPI ranks + */ + void populateInnerBlock(ModelArray::DataType& tempData) + { + ArraySlicer::Slice::VBounds innerBlock, allBlock; + if (m_ma.getType() == ModelArray::Type::Z) { + innerBlock = { { 1, -1 }, { 1, -1 }, {} }; + allBlock = { {}, {}, {} }; + } else { + innerBlock = { { 1, -1 }, { 1, -1 } }; + allBlock = { {}, {} }; + } + ArraySlicer::SliceIter wholeBlock(allBlock, m_ma.innerDimensions()); + + m_ma = 0.; // TODO -- should this be removed? It does mean that mask is zero by default + + // copy temp data to the central block of the main modelarray + m_ma[innerBlock].copyFromSlicedBuffer(tempData, wholeBlock); + } + + /*! + * @brief Update a ModelArray with data from + * + * @params dgvec DGVector which we intend to update across MPI ranks based on halo cells + * note that the start index is offset by 1 and the loop limit is size() - 2 because + * the edge of each domain is 2 less than the length of the expanded halo region + * (see diagram below - the empty cells are skipped by going from i+1 to size()-2) + * ┌─┬─┬─┬─┐ + * │ │x│x│ │ + * ├─┼─┼─┼─┤ + * │x│o│o│x│ + * ├─┼─┼─┼─┤ + * │x│o│o│x│ o = original data + * ├─┼─┼─┼─┤ x = mpi halo data (from recv) + * │ │x│x│ │ (empty) = unused data in DGVector + * └─┴─┴─┴─┘ + */ + void exchangeHalos() + { + populateSendBuffers(); + populateRecvBuffers(); + + for (auto edge : edges) { + size_t beg = std::accumulate(m_edgeLengths.begin(), m_edgeLengths.begin() + edge, 0); + size_t num = m_edgeLengths.at(edge); + // m_ma[m_outerSlices.at(edge)] = tempBuffer(Eigen::seqN(beg, num), Eigen::all); + m_ma[m_outerSlices.at(edge)] + = ModelArray::DataType(tempBuffer(Eigen::seqN(beg, num), Eigen::all)); + } + } +}; +} // end of nextsim namespace + +#endif /* HALO_HPP */ diff --git a/core/src/include/ModelArray.hpp b/core/src/include/ModelArray.hpp index bd441f20b..a0e8de7f0 100644 --- a/core/src/include/ModelArray.hpp +++ b/core/src/include/ModelArray.hpp @@ -9,6 +9,8 @@ #define MODELARRAY_HPP #include +#include +#include #include #include #include @@ -294,6 +296,26 @@ class ModelArray { const MultiDim& dimensions() const { return dimensions(type); } //! Returns a vector of the size of each dimension of the specified type of ModelArray. static const MultiDim& dimensions(Type type) { return m_dims.at(type); } +#ifdef USE_MPI + //! Returns the total number of elements of this type of ModelArray. + const MultiDim innerDimensions() { return innerDimensions(type); } + + //! Returns a vector of the size of each dimension of the specified type of ModelArray. + MultiDim innerDimensions(Type type) + { + using Dim = ModelArray::Dimension; + std::array haloTypes = { Dim::X, Dim::Y, Dim::XVERTEX, Dim::YVERTEX }; + auto dimTypes = typeDimensions.at(type); + auto dims = m_dims.at(type); + for (size_t i = 0; i < dims.size(); i++) { + if (std::count(haloTypes.begin(), haloTypes.end(), dimTypes[i])) { + dims[i] = dims[i] - 2; + } + } + return dims; + } +#endif + //! Returns the total number of elements of this type of ModelArray. size_t size() const { return size(type); } //! Returns the total number of elements of the specified type of ModelArray. diff --git a/core/src/include/ModelArraySlice.hpp b/core/src/include/ModelArraySlice.hpp index c5ae266ec..0f7a49028 100644 --- a/core/src/include/ModelArraySlice.hpp +++ b/core/src/include/ModelArraySlice.hpp @@ -209,6 +209,24 @@ class ModelArraySlice { } return buffer; } + /*! + */ + template void copyFromBuffer(T& buffer, size_t startIndex = 0) + { + // make no especial attempt at efficiency here + SliceIter thisIter(slice, data.dimensions()); + auto biter = std::next(buffer.begin(), startIndex); + + while (!thisIter.isEnd()) { + // If the buffer ends before the slice, throw an exception + if (biter == buffer.end()) { + throw std::length_error("ModelArraySlice::copyToBuffer(T): buffer exhausted"); + } + data[thisIter.index()] = *biter; + ++thisIter; + ++biter; + } + } private: // Copies data between any two objects which accept indexing by the Eigen seqN function. This diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index b9e91a06e..11ded5ab9 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -154,6 +154,7 @@ if(ENABLE_MPI) ) target_link_libraries(testHaloExchange_MPI3 PRIVATE nextsimlib doctest::doctest) + add_executable(testParaGrid_MPI2 "ParaGrid_test.cpp" "MainMPI.cpp") target_compile_definitions( testParaGrid_MPI2 diff --git a/core/test/HaloExchange_test.cpp b/core/test/HaloExchange_test.cpp index 86c19542e..da1af07e0 100644 --- a/core/test/HaloExchange_test.cpp +++ b/core/test/HaloExchange_test.cpp @@ -1,26 +1,14 @@ /*! * @file ModelMetadata_test.cpp * - * @date 27 Jan 2025 + * @date 19 Mar 2025 * @author Tom Meltzer */ -#include -#include -#include #include -#include -#include - #include "ModelMetadata.hpp" -#include "ParaGridIO.hpp" -#include "Slice.hpp" -#include "include/DGModelArray.hpp" -#include "include/ModelArraySlice.hpp" -#include "include/ParametricMesh.hpp" -#include "include/dgVector.hpp" -#include "mpi.h" +#include "include/Halo.hpp" namespace Nextsim { @@ -28,106 +16,18 @@ const std::string testFilesDir = TEST_FILES_DIR; const std::string file_cb = testFilesDir + "/partition_metadata_3_cb.nc"; const std::string file_pb = testFilesDir + "/partition_metadata_3_pb.nc"; +// TODO expand test for DG > 1 static const int DG = 3; static const bool debug = false; -// aliases -using Indexer::indexer; -using Slice = ArraySlicer::Slice; -using VBounds = ArraySlicer::Slice::VBounds; -using SliceIter = ArraySlicer::SliceIter; - -constexpr ModelMetadata::Edge BOTTOM = ModelMetadata::Edge::BOTTOM; -constexpr ModelMetadata::Edge RIGHT = ModelMetadata::Edge::RIGHT; -constexpr ModelMetadata::Edge TOP = ModelMetadata::Edge::TOP; -constexpr ModelMetadata::Edge LEFT = ModelMetadata::Edge::LEFT; - -// make some slices for later use -// clang-format off -VBounds VBAll {{ },{ }}; -VBounds VBLeft {{ 0},{ }}; -VBounds VBRight {{-1},{ }}; -VBounds VBTop {{ },{-1}}; -VBounds VBBottom {{ },{ 0}}; -// clang-format on -std::map slices = { - { LEFT, VBLeft }, - { RIGHT, VBRight }, - { TOP, VBTop }, - { BOTTOM, VBBottom }, -}; - -// print out dgvec so that origin (0,0) is bottom left corner -static void printDGVec(DGVector& dgvec, SliceIter::MultiDim& dims) -{ - if (debug) { - for (size_t j = 0; j < dims[1]; ++j) { - for (size_t i = 0; i < dims[0]; ++i) { - size_t pos = indexer(dims, { i, dims[1] - j - 1 }); - printf("%6.0f ", dgvec(pos, 0)); - } - printf("\n"); - } - printf("--------------------------------------------------\n"); - } -}; - -ParametricMesh initializeSmesh(size_t localNx, size_t localNy) -{ - auto CoordinateSystem = Nextsim::CARTESIAN; - ParametricMesh smesh(CoordinateSystem); - smesh.nx = localNx + 2; - smesh.ny = localNy + 2; - smesh.nnodes = smesh.nx * smesh.ny; - smesh.nelements = smesh.nnodes; - smesh.vertices.resize(smesh.nelements, Eigen::NoChange); // note these are uninitialised but - // unused in this test - return smesh; -} - -void initializeHField(ModelArray& hfield, size_t localNx, size_t localNy, size_t offsetX, +void initializeHField(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, size_t offsetY, int test_rank) { // initialize with mock data for (size_t j = 0; j < localNy; ++j) { for (size_t i = 0; i < localNx; ++i) { - hfield(i, j) = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); - } - } -} - -void setDGVecValue(DGVector& dgvec, SliceIter::MultiDim meshDims, double value) -{ - for (size_t k = 0; k < DG; ++k) { - for (size_t j = 0; j < meshDims[1]; ++j) { - for (size_t i = 0; i < meshDims[0]; ++i) { - size_t pos = indexer(meshDims, std::vector({ i, j })); - dgvec(pos, k) = value; - } - } - } -} - -void updateDGVec(DGVector& dgvec, const std::vector& recv, - const SliceIter::MultiDim meshDims, std::array& edgeLengths, - const ModelMetadata::Edge edge) -{ - SliceIter sliceIter = SliceIter(slices.at(edge), meshDims); - size_t offset = std::accumulate(edgeLengths.begin(), edgeLengths.begin() + edge, 0); - std::vector edgeIndices; - while (!sliceIter.isEnd()) { - const size_t start = sliceIter.index(); - const size_t step = sliceIter.step(0); - const size_t n = sliceIter.nElements(0); - for (int i = 0; i < n; ++i) { - auto idx = start + i * step; - edgeIndices.push_back(idx); + data(i + j * localNx) = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); } - sliceIter.incrementDim(1); - } - - for (size_t i = 0; i < edgeIndices.size() - 2; ++i) { - dgvec(edgeIndices[i + 1], 0) = recv[offset + i]; } } @@ -145,8 +45,8 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) const size_t nx = metadata.globalExtentX; const size_t ny = metadata.globalExtentY; - const size_t localNx = metadata.localExtentX; - const size_t localNy = metadata.localExtentY; + const size_t localNx = metadata.localExtentX + 2 * Halo::haloWidth; + const size_t localNy = metadata.localExtentY + 2 * Halo::haloWidth; const size_t offsetX = metadata.localCornerX; const size_t offsetY = metadata.localCornerY; @@ -154,114 +54,46 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); // create example 2D field on each process - auto testfield = ModelArray::HField(); - testfield.resize(); - initializeHField(testfield, localNx, localNy, offsetX, offsetY, test_rank); - - // create example 2D field for dynamics code which needs +1 halo on all edges, leading to +2 in - // x and y - // Create the ParametricMesh object to initialize dgvec - ParametricMesh smesh = initializeSmesh(localNx, localNy); - - // create dgvec to simulate nextsim - DGVector dgvec(smesh); - SliceIter::MultiDim meshDims = { smesh.nx, smesh.ny }; - - // initialize dgvec to -1 - setDGVecValue(dgvec, meshDims, -1.0); - - // we want to copy testfield to the central block - Slice centreBlock(VBounds({ { 1, -1 }, { 1, -1 } })); - SliceIter eigCentre(centreBlock, meshDims); + auto testData = ModelArray::HField(); + testData.resize(); - // all spatial dims are collapsed into the first dimension (col(0)) - // The other dimensions are for higher-order DG components - auto dgvecSpatial = dgvec.array().col(0); + // create halo for testData model array + Halo halo(metadata, testData); - // copy from testfield into the dgvec - testfield[Slice(VBAll)].copyToSlicedBuffer(dgvecSpatial, eigCentre); + // create and allocate temporary Eigen array + ModelArray::DataType innerData; + innerData.resize(halo.getInnerSize(), testData.nComponents()); + initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); - // print to check data copied successfully - printDGVec(dgvec, meshDims); + // populate inner block of modelarray + halo.populateInnerBlock(innerData); + // exchange halos + halo.exchangeHalos(); - auto edges = ModelMetadata::edges; - std::array edgeLengths = { localNx, localNy, localNx, localNy }; // BRTL - - // create a send buffer the size of the perimeter of the domain - // each process will populate the send buffer with their perimeter cells - const size_t perimeterLength = 2 * localNx + 2 * localNy; - std::vector send = std::vector(perimeterLength, 0.0); - std::vector recv = std::vector(perimeterLength, 0.0); - - for (auto edge : edges) { - size_t offset = std::accumulate(edgeLengths.begin(), edgeLengths.begin() + edge, 0); - testfield[slices.at(edge)].copyToBuffer(send, offset); - } - - // create a RMA memory window which all process will be able to access - MPI_Win win; - MPI_Win_create( - &send[0], perimeterLength * sizeof(double), sizeof(double), MPI_INFO_NULL, test_comm, &win); - - MPI_Win_fence(MPI_MODE_NOPRECEDE, win); // Fence, no preceding RMA calls - - // Each process can now gather the data it needs (based on mpi metadata) from the respective - // send buffers on the other processes (or current process under some circumstances e.g., - // periodic boundary conditions) - - // get non-periodic neighbours and populate recv buffer - for (auto edge : edges) { - auto numNeighbours = metadata.neighbourRanks[edge].size(); - if (numNeighbours) { - // get data for each neighbour - for (size_t i = 0; i < numNeighbours; ++i) { - int fromRank = metadata.neighbourRanks[edge][i]; - size_t count = metadata.neighbourExtents[edge][i]; - size_t disp = metadata.neighbourHaloSend[edge][i]; - size_t recvOffset = metadata.neighbourHaloRecv[edge][i]; - MPI_Get( - &recv[recvOffset], count, MPI_DOUBLE, fromRank, disp, count, MPI_DOUBLE, win); - } - } - } - - MPI_Win_fence(MPI_MODE_NOSUCCEED, win); // Fence, no RMA calls in next epoch - MPI_Win_free(&win); // free window - - // populate dgvec with halo data from the recv buffer - for (auto edge : edges) { - updateDGVec(dgvec, recv, meshDims, edgeLengths, edge); - } - - // print to check halo cells copied correctly - printDGVec(dgvec, meshDims); - - // mock data for halo exchange for each test rank (0-2) std::array, 3> mockDataAllProcs = { - std::vector( - { -1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 100, 110, 120, 130, 140, 150, 160, 370, 0, 101, 111, - 121, 131, 141, 151, 161, 371, 0, 102, 112, 122, 132, 142, 152, 162, 372, 0, 103, - 113, 123, 133, 143, 153, 163, 373, -1, 204, 214, 224, 234, 244, 254, 264, -1 }), - std::vector({ -1, 103, 113, 123, 133, 143, 153, 163, -1, 0, 204, 214, 224, 234, 244, + std::vector({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 110, 120, 130, 140, 150, 160, 370, + 0, 101, 111, 121, 131, 141, 151, 161, 371, 0, 102, 112, 122, 132, 142, 152, 162, 372, 0, + 103, 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, 244, 254, 264, 0 }), + std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 0, 204, 214, 224, 234, 244, 254, 264, 374, 0, 205, 215, 225, 235, 245, 255, 265, 375, 0, 206, 216, 226, 236, 246, 256, 266, 376, 0, 207, 217, 227, 237, 247, 257, 267, 377, 0, 208, 218, 228, 238, 248, - 258, 268, 378, -1, 0, 0, 0, 0, 0, 0, 0, -1 }), - std::vector({ -1, 0, 0, 0, -1, 160, 370, 380, 390, 0, 161, 371, 381, 391, 0, 162, - 372, 382, 392, 0, 163, 373, 383, 393, 0, 264, 374, 384, 394, 0, 265, 375, 385, 395, 0, - 266, 376, 386, 396, 0, 267, 377, 387, 397, 0, 268, 378, 388, 398, 0, -1, 0, 0, 0, -1 }), + 258, 268, 378, 0, 0, 0, 0, 0, 0, 0, 0, 0 }), + std::vector({ 0, 0, 0, 0, 0, 160, 370, 380, 390, 0, 161, 371, 381, 391, 0, 162, 372, + 382, 392, 0, 163, 373, 383, 393, 0, 264, 374, 384, 394, 0, 265, 375, 385, 395, 0, 266, + 376, 386, 396, 0, 267, 377, 387, 397, 0, 268, 378, 388, 398, 0, 0, 0, 0, 0, 0 }), }; // create mock eigen matrix for each process - Eigen::Matrix mockData; - mockData.resize(dgvecSpatial.size(), 1); - mockData = Eigen::Map>( - mockDataAllProcs[test_rank].data(), mockData.size(), 1); - - // spatial part of dgvec - auto testData = dgvec(Eigen::all, 0); - - // compare mock data with data generated in this test (testData) - REQUIRE(testData.isApprox(mockData)); + ModelArray::DataType mockData; + mockData.resize(localNx * localNy, 1); + mockData + = Eigen::Map(mockDataAllProcs[test_rank].data(), mockData.size(), 1); + + for (size_t j = 0; j < localNy; j++) { + for (size_t i = 0; i < localNx; i++) { + REQUIRE(testData(i, j) == mockData(i + j * localNx)); + } + } } MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditions", 3) { @@ -276,8 +108,8 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditio const size_t nx = metadata.globalExtentX; const size_t ny = metadata.globalExtentY; - const size_t localNx = metadata.localExtentX; - const size_t localNy = metadata.localExtentY; + const size_t localNx = metadata.localExtentX + 2 * Halo::haloWidth; + const size_t localNy = metadata.localExtentY + 2 * Halo::haloWidth; const size_t offsetX = metadata.localCornerX; const size_t offsetY = metadata.localCornerY; @@ -285,134 +117,47 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditio ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); // create example 2D field on each process - auto testfield = ModelArray::HField(); - testfield.resize(); - initializeHField(testfield, localNx, localNy, offsetX, offsetY, test_rank); + auto testData = ModelArray::HField(); + testData.resize(); - // create example 2D field for dynamics code which needs +1 halo on all edges, leading to +2 in - // x and y - // Create the ParametricMesh object to initialize dgvec - ParametricMesh smesh = initializeSmesh(localNx, localNy); + // create halo for testData model array + Halo halo(metadata, testData); - // create dgvec to simulate nextsim - DGVector dgvec(smesh); - SliceIter::MultiDim meshDims = { smesh.nx, smesh.ny }; - - // initialize dgvec to -1 - setDGVecValue(dgvec, meshDims, -1.0); - - // we want to copy testfield to the central block - Slice centreBlock(VBounds({ { 1, -1 }, { 1, -1 } })); - SliceIter eigCentre(centreBlock, meshDims); - - // all spatial dims are collapsed into the first dimension (col(0)) - // The other dimensions are for higher-order DG components - auto dgvecSpatial = dgvec.array().col(0); - - // copy from testfield into the dgvec - testfield[Slice(VBAll)].copyToSlicedBuffer(dgvecSpatial, eigCentre); - - // print to check data copied successfully - printDGVec(dgvec, meshDims); - - auto edges = ModelMetadata::edges; - std::array edgeLengths = { localNx, localNy, localNx, localNy }; // BRTL - - // create a send buffer the size of the perimeter of the domain - // each process will populate the send buffer with their perimeter cells - const size_t perimeterLength = 2 * localNx + 2 * localNy; - std::vector send = std::vector(perimeterLength, 0.0); - std::vector recv = std::vector(perimeterLength, 0.0); - - for (auto edge : edges) { - size_t offset = std::accumulate(edgeLengths.begin(), edgeLengths.begin() + edge, 0); - testfield[slices.at(edge)].copyToBuffer(send, offset); - } + // create and allocate temporary Eigen array + ModelArray::DataType innerData; + innerData.resize(halo.getInnerSize(), testData.nComponents()); + initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); - // create a RMA memory window which all process will be able to access - MPI_Win win; - MPI_Win_create( - &send[0], perimeterLength * sizeof(double), sizeof(double), MPI_INFO_NULL, test_comm, &win); + // populate inner block of modelarray + halo.populateInnerBlock(innerData); + // exchange halos + halo.exchangeHalos(); - MPI_Win_fence(MPI_MODE_NOPRECEDE, win); // Fence, no preceding RMA calls - - // Each process can now gather the data it needs (based on mpi metadata) from the respective - // send buffers on the other processes (or current process under some circumstances e.g., - // periodic boundary conditions) - - // get non-periodic neighbours and populate recv buffer - for (auto edge : edges) { - auto numNeighbours = metadata.neighbourRanks[edge].size(); - if (numNeighbours) { - // get data for each neighbour - for (size_t i = 0; i < numNeighbours; ++i) { - int fromRank = metadata.neighbourRanks[edge][i]; - size_t count = metadata.neighbourExtents[edge][i]; - size_t disp = metadata.neighbourHaloSend[edge][i]; - size_t recvOffset = metadata.neighbourHaloRecv[edge][i]; - MPI_Get( - &recv[recvOffset], count, MPI_DOUBLE, fromRank, disp, count, MPI_DOUBLE, win); - } - } - } - - // get periodic neighbours and populate recv buffer - for (auto edge : edges) { - auto numNeighbours = metadata.neighbourRanksPeriodic[edge].size(); - if (numNeighbours) { - // get data for each neighbour - for (size_t i = 0; i < numNeighbours; ++i) { - int fromRank = metadata.neighbourRanksPeriodic[edge][i]; - size_t count = metadata.neighbourExtentsPeriodic[edge][i]; - size_t disp = metadata.neighbourHaloSendPeriodic[edge][i]; - size_t recvOffset = metadata.neighbourHaloRecvPeriodic[edge][i]; - MPI_Get( - &recv[recvOffset], count, MPI_DOUBLE, fromRank, disp, count, MPI_DOUBLE, win); - } - } - } - - MPI_Win_fence(MPI_MODE_NOSUCCEED, win); // Fence, no RMA calls in next epoch - MPI_Win_free(&win); // free window - - // populate dgvec with halo data from the recv buffer - for (auto edge : edges) { - updateDGVec(dgvec, recv, meshDims, edgeLengths, edge); - } - - // print to check halo cells copied correctly - printDGVec(dgvec, meshDims); - - // mock data for halo exchange for each test rank (0-2) std::array, 3> mockDataAllProcs = { - std::vector({ -1, 208, 218, 228, 238, 248, 258, 268, -1, 390, 100, 110, 120, 130, - 140, 150, 160, 370, 391, 101, 111, 121, 131, 141, 151, 161, 371, 392, 102, 112, 122, - 132, 142, 152, 162, 372, 393, 103, 113, 123, 133, 143, 153, 163, 373, -1, 204, 214, 224, - 234, 244, 254, 264, -1 }), - std::vector({ -1, 103, 113, 123, 133, 143, 153, 163, -1, 394, 204, 214, 224, 234, - 244, 254, 264, 374, 395, 205, 215, 225, 235, 245, 255, 265, 375, 396, 206, 216, 226, - 236, 246, 256, 266, 376, 397, 207, 217, 227, 237, 247, 257, 267, 377, 398, 208, 218, - 228, 238, 248, 258, 268, 378, -1, 100, 110, 120, 130, 140, 150, 160, -1 }), - std::vector({ -1, 378, 388, 398, -1, 160, 370, 380, 390, 100, 161, 371, 381, 391, - 101, 162, 372, 382, 392, 102, 163, 373, 383, 393, 103, 264, 374, 384, 394, 204, 265, - 375, 385, 395, 205, 266, 376, 386, 396, 206, 267, 377, 387, 397, 207, 268, 378, 388, - 398, 208, -1, 370, 380, 390, -1 }), + std::vector({ 0, 208, 218, 228, 238, 248, 258, 268, 0, 390, 100, 110, 120, 130, 140, + 150, 160, 370, 391, 101, 111, 121, 131, 141, 151, 161, 371, 392, 102, 112, 122, 132, + 142, 152, 162, 372, 393, 103, 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, + 244, 254, 264, 0 }), + std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 394, 204, 214, 224, 234, 244, + 254, 264, 374, 395, 205, 215, 225, 235, 245, 255, 265, 375, 396, 206, 216, 226, 236, + 246, 256, 266, 376, 397, 207, 217, 227, 237, 247, 257, 267, 377, 398, 208, 218, 228, + 238, 248, 258, 268, 378, 0, 100, 110, 120, 130, 140, 150, 160, 0 }), + std::vector({ 0, 378, 388, 398, 0, 160, 370, 380, 390, 100, 161, 371, 381, 391, 101, + 162, 372, 382, 392, 102, 163, 373, 383, 393, 103, 264, 374, 384, 394, 204, 265, 375, + 385, 395, 205, 266, 376, 386, 396, 206, 267, 377, 387, 397, 207, 268, 378, 388, 398, + 208, 0, 370, 380, 390, 0 }), }; // create mock eigen matrix for each process - Eigen::Matrix mockData; - mockData.resize(dgvecSpatial.size(), 1); - mockData = Eigen::Map>( - mockDataAllProcs[test_rank].data(), mockData.size(), 1); - - // spatial part of dgvec - auto testData = dgvec(Eigen::all, 0); - - std::vector v2; - v2.resize(testData.size()); - Eigen::Matrix::Map(&v2[0], testData.size()) = testData; - - // compare mock data with data generated in this test (testData) - REQUIRE(testData.isApprox(mockData)); + ModelArray::DataType mockData; + mockData.resize(localNx * localNy, 1); + mockData + = Eigen::Map(mockDataAllProcs[test_rank].data(), mockData.size(), 1); + + for (size_t j = 0; j < localNy; j++) { + for (size_t i = 0; i < localNx; i++) { + REQUIRE(testData(i, j) == mockData(i + j * localNx)); + } + } } } diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index feb326d91..2bce5f472 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -19,6 +19,9 @@ #include "include/Configurator.hpp" #include "include/ConfiguredModule.hpp" #include "include/Finalizer.hpp" +#ifdef USE_MPI +#include "include/Halo.hpp" +#endif #include "include/IStructure.hpp" #include "include/NextsimModule.hpp" #include "include/ParaGridIO.hpp" @@ -142,7 +145,6 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") DGField hsnow = fractionalDG + 30; DGField damage = fractionalDG * 0.; HField sss = fractional; - VertexField coordinates(ModelArray::Type::VERTEX); initializeTestCoordinates(coordinates); @@ -246,8 +248,15 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") ModelArray& hiceRef = ms.data.at(hiceName); REQUIRE(hiceRef.nDimensions() == 2); + // TODO need to decide how non-MPI code should be handled i.e., will we only ever run with + // MPI=ON? even if it's mpirun -n 1... +#ifdef USE_MPI + REQUIRE(hiceRef.dimensions()[0] == localNX + 2 * Halo::haloWidth); + REQUIRE(hiceRef.dimensions()[1] == ny + 2 * Halo::haloWidth); +#else REQUIRE(hiceRef.dimensions()[0] == localNX); REQUIRE(hiceRef.dimensions()[1] == ny); +#endif REQUIRE(ModelArray::nComponents(ModelArray::Type::DG) == DG); REQUIRE(hiceRef.nComponents() == DG); @@ -255,8 +264,13 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") ModelArray& coordRef = ms.data.at(coordsName); REQUIRE(coordRef.nDimensions() == 2); REQUIRE(coordRef.nComponents() == 2); +#ifdef USE_MPI + REQUIRE(coordRef.dimensions()[0] == localNXVertex + 2 * Halo::haloWidth); + REQUIRE(coordRef.dimensions()[1] == ny + 1 + 2 * Halo::haloWidth); +#else REQUIRE(coordRef.dimensions()[0] == localNXVertex); REQUIRE(coordRef.dimensions()[1] == ny + 1); +#endif REQUIRE(coordRef.components({ 3, 8 })[0] - coordRef.components({ 2, 8 })[0] == scale); REQUIRE(coordRef.components({ 3, 8 })[1] - coordRef.components({ 3, 7 })[1] == scale); @@ -269,7 +283,7 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") REQUIRE(yRef(3, 8) == coordRef.components({ 2, 8 })[1] + scale / 2); REQUIRE(ms.data.count(gridAzimuthName) > 0); - REQUIRE(ms.data.at(gridAzimuthName)(0, 0) == gridAzimuth0); + REQUIRE(ms.data.at(gridAzimuthName)(1, 1) == gridAzimuth0); std::filesystem::remove(filename); Finalizer::finalize(); diff --git a/dynamics/src/ParametricMesh.cpp b/dynamics/src/ParametricMesh.cpp index 1bf15bd2d..158ee7844 100644 --- a/dynamics/src/ParametricMesh.cpp +++ b/dynamics/src/ParametricMesh.cpp @@ -1,6 +1,6 @@ /*! * @file ParametricMesh.hpp - * @date 14 Jan 2025 + * @date 18 Mar 2025 * @author Thomas Richter */ @@ -205,6 +205,7 @@ void ParametricMesh::readmesh(std::string fname) void ParametricMesh::coordinatesFromModelArray(const ModelArray& coords) { // Fill in the array sizes from the ModelArray dimensions + // TODO check do we need to make any additional changes here nx = ModelArray::size(ModelArray::Dimension::X); ny = ModelArray::size(ModelArray::Dimension::Y); nelements = nx * ny; From b00e90787988b97fa8819f950a3908b55e1a03b2 Mon Sep 17 00:00:00 2001 From: tommelt Date: Fri, 16 May 2025 11:25:21 +0100 Subject: [PATCH 09/53] chore: fixes for halo logic after merge request --- core/src/ParaGridIO.cpp | 134 ++++++++++++++++++------------------ core/src/include/Halo.hpp | 11 +-- core/test/ParaGrid_test.cpp | 9 ++- 3 files changed, 76 insertions(+), 78 deletions(-) diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index 5ad88f742..f340ca06b 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGridIO.cpp * - * @date 09 Dec 2024 + * @date 16 May 2025 * @author Tim Spain */ @@ -147,84 +147,82 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) ModelArray::setDimension(dimType, dim.getSize()); #endif } - } - // Get all vars in the data group, and load them into a new ModelState + // Get all vars in the data group, and load them into a new ModelState - for (auto entry : dataGroup.getVars()) { - const std::string& varName = entry.first; - netCDF::NcVar& var = entry.second; - // Determine the type from the dimensions - std::vector varDims = var.getDims(); - std::string dimKey = ""; - for (netCDF::NcDim& dim : varDims) { - dimKey += dim.getName(); - } - if (!dimensionKeys.count(dimKey)) { - throw std::out_of_range( - std::string("No ModelArray::Type corresponds to the dimensional key ") + dimKey); - } - ModelArray::Type type = dimensionKeys.at(dimKey); - state.data[varName] = ModelArray(type); - ModelArray& data = state.data.at(varName); - data.resize(); + for (auto entry : dataGroup.getVars()) { + const std::string& varName = entry.first; + netCDF::NcVar& var = entry.second; + // Determine the type from the dimensions + std::vector varDims = var.getDims(); + std::string dimKey = ""; + for (netCDF::NcDim& dim : varDims) { + dimKey += dim.getName(); + } + if (!dimensionKeys.count(dimKey)) { + throw std::out_of_range( + std::string("No ModelArray::Type corresponds to the dimensional key ") + + dimKey); + } + ModelArray::Type type = dimensionKeys.at(dimKey); + state.data[varName] = ModelArray(type); + ModelArray& data = state.data.at(varName); + data.resize(); - std::vector start; - std::vector count; - if (ModelArray::hasDoF(type)) { - auto ncomps = data.nComponents(); - start.push_back(0); - count.push_back(ncomps); - } + std::vector start; + std::vector count; + if (ModelArray::hasDoF(type)) { + auto ncomps = data.nComponents(); + start.push_back(0); + count.push_back(ncomps); + } - using Dim = ModelArray::Dimension; - for (Dim dt : ModelArray::typeDimensions.at(type)) { - auto dim = ModelArray::definedDimensions.at(dt); - size_t startIndex = dim.start; - size_t localLength = dim.localLength; + using Dim = ModelArray::Dimension; + for (Dim dt : ModelArray::typeDimensions.at(type)) { + auto dim = ModelArray::definedDimensions.at(dt); + size_t startIndex = dim.start; + size_t localLength = dim.localLength; #ifdef USE_MPI - if (dt == Dim::X or dt == Dim::XVERTEX) { - localLength = localLength - 2 * Halo::haloWidth; - } else if (dt == Dim::Y or dt == Dim::YVERTEX) { - localLength = localLength - 2 * Halo::haloWidth; - } + if (dt == Dim::X or dt == Dim::XVERTEX) { + localLength = localLength - 2 * Halo::haloWidth; + } else if (dt == Dim::Y or dt == Dim::YVERTEX) { + localLength = localLength - 2 * Halo::haloWidth; + } #endif - start.push_back(startIndex); - count.push_back(localLength); - } - // dims are looped in [dg], x, y, [z] order so start and count - // order must be reveresed to match order netcdf expects - std::reverse(start.begin(), start.end()); - std::reverse(count.begin(), count.end()); + start.push_back(startIndex); + count.push_back(localLength); + } + // dims are looped in [dg], x, y, [z] order so start and count + // order must be reveresed to match order netcdf expects + std::reverse(start.begin(), start.end()); + std::reverse(count.begin(), count.end()); #ifdef USE_MPI - // TODO - // at this point we should add the halo exchange logic for each modelarray - // need to check what happens for non-H-field modelarrays - // need to figure out what happens w.r.t to coords in non-periodic and periodic case - - Halo halo(metadata, data); - // create and allocate temporary Eigen array - ModelArray::DataType tempData; - tempData.resize(halo.getInnerSize(), data.nComponents()); - // populate temp Eigen array with data from netCDF file - var.getVar(start, count, tempData.data()); - // populate inner block of modelarray with data from tempData - halo.populateInnerBlock(tempData); - halo.exchangeHalos(); + // TODO + // at this point we should add the halo exchange logic for each modelarray + // need to check what happens for non-H-field modelarrays + // need to figure out what happens w.r.t to coords in non-periodic and periodic case + + Halo halo(metadata, data); + // create and allocate temporary Eigen array + ModelArray::DataType tempData; + tempData.resize(halo.getInnerSize(), data.nComponents()); + // populate temp Eigen array with data from netCDF file + var.getVar(start, count, tempData.data()); + // populate inner block of modelarray with data from tempData + halo.populateInnerBlock(tempData); + halo.exchangeHalos(); #else - var.getVar(start, count, &data[0]); + var.getVar(start, count, &data[0]); #endif + } + ncFile.close(); + } catch (const netCDF::exceptions::NcException& nce) { + std::string ncWhat(nce.what()); + ncWhat += ": " + filePath; + throw std::runtime_error(ncWhat); } - ncFile.close(); -} -catch (const netCDF::exceptions::NcException& nce) -{ - std::string ncWhat(nce.what()); - ncWhat += ": " + filePath; - throw std::runtime_error(ncWhat); -} -return state; + return state; } ModelState ParaGridIO::readForcingTimeStatic( diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index 0b75f3312..d9650be5e 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -1,7 +1,7 @@ /*! * @file Halo.hpp * - * @date 29 Apr 2025 + * @date 16 May 2025 * @author Tom Meltzer */ @@ -265,13 +265,8 @@ class Halo { void populateInnerBlock(ModelArray::DataType& tempData) { ArraySlicer::Slice::VBounds innerBlock, allBlock; - if (m_ma.getType() == ModelArray::Type::Z) { - innerBlock = { { 1, -1 }, { 1, -1 }, {} }; - allBlock = { {}, {}, {} }; - } else { - innerBlock = { { 1, -1 }, { 1, -1 } }; - allBlock = { {}, {} }; - } + innerBlock = { { 1, -1 }, { 1, -1 } }; + allBlock = { {}, {} }; ArraySlicer::SliceIter wholeBlock(allBlock, m_ma.innerDimensions()); m_ma = 0.; // TODO -- should this be removed? It does mean that mask is zero by default diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index 2bce5f472..8b96d5a2b 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGrid_test.cpp * - * @date 17 Jan 2025 + * @date 16 May 2025 * @author Tim Spain * @author Tom Meltzer */ @@ -589,9 +589,14 @@ TEST_CASE("Check if a file with the old dimension names can be read") ModelState ms = gridIn.getModelState(inputFilename); #endif - auto localNX = ModelArray::definedDimensions.at(ModelArray::Dimension::X).localLength; + auto localNX = metadata.localExtentX; +#ifdef USE_MPI + REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[0] == localNX + 2 * Halo::haloWidth); + REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[1] == ny + 2 * Halo::haloWidth); +#else REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[0] == localNX); REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[1] == ny); +#endif Finalizer::finalize(); } From 5467eb14b93fa471f24c543e447bedd1572e5c01 Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 19 May 2025 16:50:14 +0100 Subject: [PATCH 10/53] feat: convert ModelMetadata to singleton --- core/src/ModelMetadata.cpp | 16 ++++++++++++- core/src/PDWriter.cpp | 4 ++-- core/src/ParaGridIO.cpp | 4 ++-- core/src/include/Halo.hpp | 32 ++++++++++++------------- core/src/include/Model.hpp | 4 ++-- core/src/include/ModelMetadata.hpp | 38 ++++++++++++++++++++++-------- core/test/ConfigOutput_test.cpp | 21 +++++++++-------- core/test/HaloExchange_test.cpp | 10 ++++---- core/test/ModelMetadata_test.cpp | 8 +++---- core/test/ParaGrid_test.cpp | 12 +++++----- core/test/RectGrid_test.cpp | 6 ++--- 11 files changed, 94 insertions(+), 61 deletions(-) diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index 1181c3d83..4022ce9f4 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -1,13 +1,14 @@ /*! * @file ModelMetadata.cpp * - * @date 17 Jan 2025 + * @date 19 May 2025 * @author Tim Spain * @author Tom Meltzer */ #include "include/ModelMetadata.hpp" +#include "include/Finalizer.hpp" #include "include/IStructure.hpp" #include "include/NextsimModule.hpp" #include "include/gridNames.hpp" @@ -36,6 +37,7 @@ const std::string& ModelMetadata::structureName() const #ifdef USE_MPI ModelMetadata::ModelMetadata(std::string partitionFile, MPI_Comm comm) { + static bool doneOnce = doOnce(); setMpiMetadata(comm); getPartitionMetadata(partitionFile); } @@ -151,6 +153,9 @@ void ModelMetadata::getPartitionMetadata(std::string partitionFile) ncFile.close(); } +#else + +ModelMetadata::ModelMetadata() { static bool doneOnce = doOnce(); } #endif @@ -219,4 +224,13 @@ void ModelMetadata::incrementTime(const Duration& step) #endif } +void ModelMetadata::finalize() { } + +bool ModelMetadata::doOnce() +{ + // Register the finalization function here + Finalizer::registerUnique(finalize); + return true; +} + } /* namespace Nextsim */ diff --git a/core/src/PDWriter.cpp b/core/src/PDWriter.cpp index cec80aa58..0b48b5f58 100644 --- a/core/src/PDWriter.cpp +++ b/core/src/PDWriter.cpp @@ -1,7 +1,7 @@ /*! * @file PDWriter.cpp * - * @date 14 Apr 2023 + * @date 19 May 2025 * @author Tim Spain */ @@ -21,7 +21,7 @@ void PrognosticData::writeRestartFile( ModelState state = getStatePrognostic(); state.merge(ModelConfig::getConfig()); - ModelMetadata meta(metadata); + ModelMetadata& meta = ModelMetadata::getInstance(); meta.affixCoordinates(state); StructureFactory::fileFromState(state, meta, filePath, true); diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index f340ca06b..ca711b9df 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGridIO.cpp * - * @date 16 May 2025 + * @date 19 May 2025 * @author Tim Spain */ @@ -203,7 +203,7 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) // need to check what happens for non-H-field modelarrays // need to figure out what happens w.r.t to coords in non-periodic and periodic case - Halo halo(metadata, data); + Halo halo(data); // create and allocate temporary Eigen array ModelArray::DataType tempData; tempData.resize(halo.getInnerSize(), data.nComponents()); diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index d9650be5e..0e57d0f36 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -1,7 +1,7 @@ /*! * @file Halo.hpp * - * @date 16 May 2025 + * @date 19 May 2025 * @author Tom Meltzer */ @@ -44,9 +44,9 @@ class Halo { /*! * @brief Constructs a halo object */ - Halo(ModelMetadata& metadata, ModelArray& ma) - : m_metadata(std::make_unique(metadata)) - , m_ma(ma) + Halo(ModelArray& ma) + : m_ma(ma) + , m_metadata(ModelMetadata::getInstance()) { m_innerNx = ma.innerDimensions()[0]; m_innerNy = ma.innerDimensions()[1]; @@ -59,7 +59,7 @@ class Halo { recv[i].resize(m_perimeterLength, 0.0); } m_edgeLengths = { m_innerNx, m_innerNy, m_innerNx, m_innerNy }; // order is Bottom - m_comm = metadata.mpiComm; + m_comm = m_metadata.mpiComm; m_outerSlices = { { Edge::LEFT, VBounds({ { 0 }, { 1, m_innerNy + haloWidth } }) }, @@ -96,7 +96,7 @@ class Halo { size_t m_innerNy; // local extent in y-direction size_t m_perimeterLength; // length of perimeter of domain size_t m_numComps; // number of DG components - std::unique_ptr m_metadata; // pointer to metadata + ModelMetadata& m_metadata; // reference to metadata singleton std::array m_edgeLengths; // array containing length of each edge std::array edges = ModelMetadata::edges; // array of edge enums std::map m_outerSlices; @@ -185,14 +185,14 @@ class Halo { // get non-periodic neighbours and populate recv buffer (if the exist) for (auto edge : edges) { - auto numNeighbours = m_metadata->neighbourRanks[edge].size(); + auto numNeighbours = m_metadata.neighbourRanks[edge].size(); if (numNeighbours) { // get data for each neighbour that exists along a given edge for (size_t i = 0; i < numNeighbours; ++i) { - int fromRank = m_metadata->neighbourRanks[edge][i]; - size_t count = m_metadata->neighbourExtents[edge][i]; - size_t disp = m_metadata->neighbourHaloSend[edge][i]; - size_t recvOffset = m_metadata->neighbourHaloRecv[edge][i]; + int fromRank = m_metadata.neighbourRanks[edge][i]; + size_t count = m_metadata.neighbourExtents[edge][i]; + size_t disp = m_metadata.neighbourHaloSend[edge][i]; + size_t recvOffset = m_metadata.neighbourHaloRecv[edge][i]; if (m_ma.getType() == ModelArray::Type::VERTEX) { vertexAdjustedPositions( count = count, disp = disp, recvOffset = recvOffset, edge = edge); @@ -205,14 +205,14 @@ class Halo { // get periodic neighbours and populate recv buffer (if they exist) for (auto edge : edges) { - auto numNeighbours = m_metadata->neighbourRanksPeriodic[edge].size(); + auto numNeighbours = m_metadata.neighbourRanksPeriodic[edge].size(); if (numNeighbours) { // get data for each neighbour that exists along a given edge for (size_t i = 0; i < numNeighbours; ++i) { - int fromRank = m_metadata->neighbourRanksPeriodic[edge][i]; - size_t count = m_metadata->neighbourExtentsPeriodic[edge][i]; - size_t disp = m_metadata->neighbourHaloSendPeriodic[edge][i]; - size_t recvOffset = m_metadata->neighbourHaloRecvPeriodic[edge][i]; + int fromRank = m_metadata.neighbourRanksPeriodic[edge][i]; + size_t count = m_metadata.neighbourExtentsPeriodic[edge][i]; + size_t disp = m_metadata.neighbourHaloSendPeriodic[edge][i]; + size_t recvOffset = m_metadata.neighbourHaloRecvPeriodic[edge][i]; if (m_ma.getType() == ModelArray::Type::VERTEX) { vertexAdjustedPositions( count = count, disp = disp, recvOffset = recvOffset, edge = edge); diff --git a/core/src/include/Model.hpp b/core/src/include/Model.hpp index 83eaab5e6..593950ca0 100644 --- a/core/src/include/Model.hpp +++ b/core/src/include/Model.hpp @@ -1,6 +1,6 @@ /*! * @file Model.hpp - * @date 12 Aug 2021 + * @date 19 May 2025 * @author Tim Spain * @author Kacper Kornet */ @@ -74,7 +74,7 @@ class Model : public Configured { Iterator iterator; DevStep modelStep; // Change the model step calculation here PrognosticData pData; - ModelMetadata m_etadata; + ModelMetadata& m_etadata = ModelMetadata::getInstance(); std::string initialFileName; std::string finalFileName; diff --git a/core/src/include/ModelMetadata.hpp b/core/src/include/ModelMetadata.hpp index 962f29354..14ab9546e 100644 --- a/core/src/include/ModelMetadata.hpp +++ b/core/src/include/ModelMetadata.hpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata.hpp * - * @date 17 Jan 2025 + * @date 19 May 2025 * @author Tim Spain * @author Tom Meltzer */ @@ -30,20 +30,38 @@ class CommonRestartMetadata; * output. */ class ModelMetadata { -public: +private: #ifdef USE_MPI - /*! - * @brief Construct a ModelMedata based on file with decompostion data - * - * @param partitionFile The name of file with decompostion data - * @param comm MPI communicator - */ ModelMetadata(std::string partitionFile, MPI_Comm comm); +#else + ModelMetadata(); +#endif + // Prevent copying + ModelMetadata(const ModelMetadata&) = delete; + // ModelMetadata& operator=(const ModelMetadata&) = delete; + + //! Performs some one-time initialization for the class. Returns true. + static bool doOnce(); - // We need to force default constructor also - ModelMetadata() = default; +public: +#ifdef USE_MPI + inline static ModelMetadata& getInstance( + std::string partitionFile = "partition.nc", MPI_Comm comm = nullptr) + { + static ModelMetadata instance = ModelMetadata(partitionFile, comm); + return instance; + } +#else + inline static ModelMetadata& getInstance() + { + static ModelMetadata instance = ModelMetadata(); + return instance; + } #endif + // finalize ModelMetadata + static void finalize(); + /*! * @brief Sets the initial or current model time * diff --git a/core/test/ConfigOutput_test.cpp b/core/test/ConfigOutput_test.cpp index 68402dc8b..7957fd795 100644 --- a/core/test/ConfigOutput_test.cpp +++ b/core/test/ConfigOutput_test.cpp @@ -1,7 +1,7 @@ /*! * @file ConfigOutput_test.cpp * - * @date 06 May 2025 + * @date 19 May 2025 * @author Tim Spain */ @@ -69,7 +69,8 @@ TEST_CASE("Test periodic output") config << "[ConfigOutput]" << std::endl; config << "period = 3600" << std::endl; // Output every hour config << "start = 2020-01-11T00:00:00Z" << std::endl; // start after 10 days - config << "field_names = " << hiceName << "," << ciceName << "," << tsurfName << "," << "top_melt" << std::endl; + config << "field_names = " << hiceName << "," << ciceName << "," << tsurfName << "," + << "top_melt" << std::endl; config << "filename = diag%m%d.nc" << std::endl; config << "file_period = 86400" << std::endl; // Files every day @@ -97,18 +98,19 @@ TEST_CASE("Test periodic output") ModelComponent::getStore().registerArray(Protected::H_SNOW, &hsnow); ModelComponent::getStore().registerArray(Protected::T_SURF, &tsurf); - ModelMetadata meta; + ModelMetadata& meta = ModelMetadata::getInstance(); // Set up the coordinates, but use arrays filled with zeros HField latlonData(ModelArray::Type::H); latlonData = 0.; VertexField coordsData(ModelArray::Type::VERTEX); coordsData = 0.; ModelState modelCoordinates = { { - { longitudeName, latlonData }, - { latitudeName, latlonData }, - { gridAzimuthName, latlonData }, - { coordsName, coordsData }, - }, { } }; + { longitudeName, latlonData }, + { latitudeName, latlonData }, + { gridAzimuthName, latlonData }, + { coordsName, coordsData }, + }, + {} }; meta.extractCoordinates(modelCoordinates); meta.setTime(TimePoint("2020-01-01T00:00:00Z")); @@ -130,7 +132,6 @@ TEST_CASE("Test periodic output") hsnow(i, j) = 0.2 + 0.01 * (j * nx + (i + startX)); tsurf(i, j) = 0.4 + 0.01 * (j * nx + (i + startX)); topMelt(i, j) = 0.6 + 0.01 * (j * nx + (i + startX)); - } } std::vector diagFiles; @@ -151,7 +152,7 @@ TEST_CASE("Test periodic output") hice += hourIncr; cice += hourIncr; hsnow += hourIncr; - ModelState state = { { { "top_melt", topMelt } }, { } }; + ModelState state = { { { "top_melt", topMelt } }, {} }; ido.outputState(state, meta); meta.incrementTime(Duration(3600.)); diff --git a/core/test/HaloExchange_test.cpp b/core/test/HaloExchange_test.cpp index da1af07e0..a442ca1f8 100644 --- a/core/test/HaloExchange_test.cpp +++ b/core/test/HaloExchange_test.cpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata_test.cpp * - * @date 19 Mar 2025 + * @date 19 May 2025 * @author Tom Meltzer */ @@ -41,7 +41,7 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) // │0│ │ // └─┴─┘ (proc id) - ModelMetadata metadata(file_cb, test_comm); + ModelMetadata& metadata = ModelMetadata::getInstance(file_cb, test_comm); const size_t nx = metadata.globalExtentX; const size_t ny = metadata.globalExtentY; @@ -58,7 +58,7 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) testData.resize(); // create halo for testData model array - Halo halo(metadata, testData); + Halo halo(testData); // create and allocate temporary Eigen array ModelArray::DataType innerData; @@ -104,7 +104,7 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditio // │0│ │ // └─┴─┘ (proc id) - ModelMetadata metadata(file_pb, test_comm); + ModelMetadata& metadata = ModelMetadata::getInstance(file_pb, test_comm); const size_t nx = metadata.globalExtentX; const size_t ny = metadata.globalExtentY; @@ -121,7 +121,7 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditio testData.resize(); // create halo for testData model array - Halo halo(metadata, testData); + Halo halo(testData); // create and allocate temporary Eigen array ModelArray::DataType innerData; diff --git a/core/test/ModelMetadata_test.cpp b/core/test/ModelMetadata_test.cpp index 859596ed4..975ea20cf 100644 --- a/core/test/ModelMetadata_test.cpp +++ b/core/test/ModelMetadata_test.cpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata_test.cpp * - * @date 17 Jan 2025 + * @date 19 May 2025 * @author Tom Meltzer */ @@ -24,7 +24,7 @@ constexpr ModelMetadata::Edge LEFT = ModelMetadata::Edge::LEFT; typedef std::vector vec; // these tests are the same for closed boundary conditions (BC) and peridic BC -static void testNonPeriodicBC(ModelMetadata meta, int test_rank) +static void testNonPeriodicBC(ModelMetadata& meta, int test_rank) { if (test_rank == 0) { REQUIRE(meta.neighbourRanks[LEFT].size() == 0); @@ -62,7 +62,7 @@ static void testNonPeriodicBC(ModelMetadata meta, int test_rank) TEST_SUITE_BEGIN("ModelMetadata"); MPI_TEST_CASE("Test getPartitionMetadata closed boundary", 3) { - ModelMetadata meta(partitionFilenameCB, test_comm); + ModelMetadata& meta = ModelMetadata::getInstance(partitionFilenameCB, test_comm); REQUIRE(meta.mpiComm == test_comm); // this metadata is specific to the non-periodic boundary conditions testNonPeriodicBC(meta, test_rank); @@ -78,7 +78,7 @@ MPI_TEST_CASE("Test getPartitionMetadata closed boundary", 3) MPI_TEST_CASE("Test getPartitionMetadata periodic boundary", 3) { - ModelMetadata meta(partitionFilenamePB, test_comm); + ModelMetadata& meta = ModelMetadata::getInstance(partitionFilenamePB, test_comm); REQUIRE(meta.mpiComm == test_comm); // this metadata should be identical to the Closed Boundary version so we check it again testNonPeriodicBC(meta, test_rank); diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index 8b96d5a2b..edd884cf6 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGrid_test.cpp * - * @date 16 May 2025 + * @date 19 May 2025 * @author Tim Spain * @author Tom Meltzer */ @@ -196,7 +196,7 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") }, {} }; - ModelMetadata metadata; + ModelMetadata& metadata = ModelMetadata::getInstance(); metadata.setTime(TimePoint("2000-01-01T00:00:00Z")); // The coordinates are passed through the metadata object as affix // coordinates is the correct way to add coordinates to a ModelState @@ -237,7 +237,7 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") gridIn.setIO(readIO); #ifdef USE_MPI - ModelMetadata metadataIn(partitionFilename, test_comm); + ModelMetadata& metadataIn = ModelMetadata::getInstance(partitionFilename, test_comm); metadataIn.setTime(TimePoint(dateString)); ModelState ms = gridIn.getModelState(filename, metadataIn); #else @@ -383,7 +383,7 @@ TEST_CASE("Write a diagnostic ParaGrid file") }, {} }; - ModelMetadata metadata; + ModelMetadata& metadata = ModelMetadata::getInstance(); metadata.setTime(TimePoint("2000-01-01T00:00:00Z")); // The coordinates are passed through the metadata object as affix // coordinates is the correct way to add coordinates to a ModelState @@ -520,7 +520,7 @@ TEST_CASE("Check an exception is thrown for an invalid file name") // MD5 hash of the current output of $ date std::string longRandomFilename("a44f5cc1f7934a8ae8dd03a95308745d.nc"); #ifdef USE_MPI - ModelMetadata metadataIn(partitionFilename, test_comm); + ModelMetadata& metadataIn = ModelMetadata::getInstance(partitionFilename, test_comm); metadataIn.setTime(TimePoint(dateString)); REQUIRE_THROWS(state = gridIn.getModelState(longRandomFilename, metadataIn)); #else @@ -570,7 +570,7 @@ TEST_CASE("Check if a file with the old dimension names can be read") REQUIRE(ModelArray::nComponents(ModelArray::Type::VERTEX) == ModelArray::nCoords); #ifdef USE_MPI - ModelMetadata metadata; + ModelMetadata& metadata = ModelMetadata::getInstance(); metadata.setMpiMetadata(test_comm); if (metadata.mpiMyRank == 0) { metadata.localCornerX = 0; diff --git a/core/test/RectGrid_test.cpp b/core/test/RectGrid_test.cpp index c2d2ee767..3fa4d770f 100644 --- a/core/test/RectGrid_test.cpp +++ b/core/test/RectGrid_test.cpp @@ -1,7 +1,7 @@ /*! * @file RectGrid_test.cpp * - * @date 09 Dec 2024 + * @date 19 May 2025 * @author Tim Spain */ @@ -80,7 +80,7 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") }, {} }; - ModelMetadata metadata; + ModelMetadata& metadata = ModelMetadata::getInstance(); metadata.setTime(TimePoint(date_string)); // Use x & y coordinates ModelArray x(ModelArray::Type::H); @@ -145,7 +145,7 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") // Read reference file gridIn.setIO(new RectGridIO(grid)); #ifdef USE_MPI - ModelMetadata metadataIn(partition_filename, test_comm); + ModelMetadata& metadataIn = ModelMetadata::getInstance(partition_filename, test_comm); metadataIn.setTime(TimePoint(date_string)); ModelState ms = gridIn.getModelState(filename, metadataIn); #else From e2173922e6e12cdbf6975ebc7233833ab885fa40 Mon Sep 17 00:00:00 2001 From: tommelt Date: Fri, 23 May 2025 15:44:18 +0100 Subject: [PATCH 11/53] chore: simplify ParaGrid_test to use same metadata throughout --- core/test/ParaGrid_test.cpp | 62 ++++++------------------------ core/test/old_names.py | 4 +- core/test/partition_metadata_2.cdl | 4 +- 3 files changed, 16 insertions(+), 54 deletions(-) diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index edd884cf6..8cab375a7 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGrid_test.cpp * - * @date 19 May 2025 + * @date 23 May 2025 * @author Tim Spain * @author Tom Meltzer */ @@ -115,12 +115,12 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") #ifdef USE_MPI if (test_rank == 0) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 5, 0); - ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 5 + 1, 0); + ModelArray::setDimension(ModelArray::Dimension::X, nx, 4, 0); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 4 + 1, 0); } if (test_rank == 1) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 5, 5); - ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 5 + 1, 5); + ModelArray::setDimension(ModelArray::Dimension::X, nx, 6, 4); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 6 + 1, 4); } ModelArray::setDimension(ModelArray::Dimension::Y, ny, ny, 0); ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, ny + 1, 0); @@ -196,22 +196,17 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") }, {} }; +#ifdef USE_MPI + ModelMetadata& metadata = ModelMetadata::getInstance(partitionFilename, test_comm); +#else ModelMetadata& metadata = ModelMetadata::getInstance(); +#endif + metadata.setTime(TimePoint("2000-01-01T00:00:00Z")); // The coordinates are passed through the metadata object as affix // coordinates is the correct way to add coordinates to a ModelState metadata.extractCoordinates(coordState); metadata.affixCoordinates(state); - -#ifdef USE_MPI - metadata.setMpiMetadata(test_comm); - metadata.globalExtentX = nx; - metadata.globalExtentY = ny; - metadata.localCornerX = startX; - metadata.localCornerY = 0; - metadata.localExtentX = localNX; - metadata.localExtentY = ny; -#endif grid.dumpModelState(state, metadata, filename, true); REQUIRE(std::filesystem::exists(std::filesystem::path(filename))); @@ -237,9 +232,7 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") gridIn.setIO(readIO); #ifdef USE_MPI - ModelMetadata& metadataIn = ModelMetadata::getInstance(partitionFilename, test_comm); - metadataIn.setTime(TimePoint(dateString)); - ModelState ms = gridIn.getModelState(filename, metadataIn); + ModelState ms = gridIn.getModelState(filename, metadata); #else ModelState ms = gridIn.getModelState(filename); #endif @@ -333,8 +326,6 @@ TEST_CASE("Write a diagnostic ParaGrid file") auto startX = ModelArray::definedDimensions.at(dimX).start; auto localNX = ModelArray::definedDimensions.at(dimX).localLength; auto dimXVertex = ModelArray::Dimension::XVERTEX; - auto localNXVertex = ModelArray::definedDimensions.at(dimXVertex).localLength; - auto startXVertex = ModelArray::definedDimensions.at(dimXVertex).start; HField fractional(ModelArray::Type::H); DGField fractionalDG(ModelArray::Type::DG); @@ -390,16 +381,6 @@ TEST_CASE("Write a diagnostic ParaGrid file") metadata.extractCoordinates(coordState); metadata.affixCoordinates(state); -#ifdef USE_MPI - metadata.setMpiMetadata(test_comm); - metadata.globalExtentX = nx; - metadata.globalExtentY = ny; - metadata.localCornerX = startX; - metadata.localCornerY = 0; - metadata.localExtentX = localNX; - metadata.localExtentY = ny; -#endif - for (int t = 1; t < 5; ++t) { hice += 100; cice += 100; @@ -432,8 +413,6 @@ TEST_CASE("Write a diagnostic ParaGrid file") structGrp.getAtt(grid.typeNodeName()).getValues(structureType); REQUIRE(structureType == grid.structureType()); - // TODO test metadata - // test data REQUIRE(dataGrp.getVarCount() == 7); netCDF::NcVar hiceVar = dataGrp.getVar(hiceName); @@ -520,8 +499,7 @@ TEST_CASE("Check an exception is thrown for an invalid file name") // MD5 hash of the current output of $ date std::string longRandomFilename("a44f5cc1f7934a8ae8dd03a95308745d.nc"); #ifdef USE_MPI - ModelMetadata& metadataIn = ModelMetadata::getInstance(partitionFilename, test_comm); - metadataIn.setTime(TimePoint(dateString)); + ModelMetadata& metadataIn = ModelMetadata::getInstance(); REQUIRE_THROWS(state = gridIn.getModelState(longRandomFilename, metadataIn)); #else REQUIRE_THROWS(state = gridIn.getModelState(longRandomFilename)); @@ -542,9 +520,6 @@ TEST_CASE("Check if a file with the old dimension names can be read") REQUIRE(Module::getImplementation().structureType() == "parametric_rectangular"); - size_t nx = 2; - size_t ny = 1; - ParametricGrid gridIn; ParaGridIO* readIO = new ParaGridIO(gridIn); gridIn.setIO(readIO); @@ -571,19 +546,6 @@ TEST_CASE("Check if a file with the old dimension names can be read") #ifdef USE_MPI ModelMetadata& metadata = ModelMetadata::getInstance(); - metadata.setMpiMetadata(test_comm); - if (metadata.mpiMyRank == 0) { - metadata.localCornerX = 0; - } - if (metadata.mpiMyRank == 1) { - metadata.localCornerX = 1; - } - metadata.globalExtentX = nx; - metadata.globalExtentY = ny; - metadata.localCornerY = 0; - metadata.localExtentX = 1; - metadata.localExtentY = ny; - metadata.setTime(TimePoint(dateString)); ModelState ms = gridIn.getModelState(inputFilename, metadata); #else ModelState ms = gridIn.getModelState(inputFilename); diff --git a/core/test/old_names.py b/core/test/old_names.py index b1949ac25..54be96c14 100644 --- a/core/test/old_names.py +++ b/core/test/old_names.py @@ -7,8 +7,8 @@ if __name__ == "__main__": # Grid dimensions. x varies fastest - nfirst = 1 - nsecond = 2 + nfirst = 9 + nsecond = 10 nLayers = 1 ncg = 1 n_dg = 1 diff --git a/core/test/partition_metadata_2.cdl b/core/test/partition_metadata_2.cdl index c70dbe2de..651a3d054 100644 --- a/core/test/partition_metadata_2.cdl +++ b/core/test/partition_metadata_2.cdl @@ -20,9 +20,9 @@ group: bounding_boxes { int domain_extent_y(P) ; data: - domain_x = 0, 5 ; + domain_x = 0, 4 ; - domain_extent_x = 5, 5 ; + domain_extent_x = 4, 6 ; domain_y = 0, 0 ; From d70ad3dcce179c15250e508a95b4c58925bda88b Mon Sep 17 00:00:00 2001 From: tommelt Date: Wed, 4 Jun 2025 11:34:48 +0100 Subject: [PATCH 12/53] feat: refactor MPI metadata into singleton update tests and code to use ModelMPI and ModelMetadata singleton classes --- core/src/CMakeLists.txt | 1 + core/src/CommonRestartMetadata.cpp | 11 +- core/src/DevStep.cpp | 16 +- core/src/Model.cpp | 36 ++-- core/src/ModelMPI.cpp | 39 +++++ core/src/ModelMetadata.cpp | 41 +++-- core/src/PDWriter.cpp | 9 +- core/src/ParaGridIO.cpp | 50 +++--- core/src/ParaGridIO_Xios.cpp | 55 +++--- core/src/RectGridIO.cpp | 62 +++---- core/src/StructureFactory.cpp | 20 +-- core/src/include/CommonRestartMetadata.hpp | 9 +- core/src/include/DevStep.hpp | 4 +- core/src/include/Halo.hpp | 31 ++-- core/src/include/IModelStep.hpp | 14 +- core/src/include/Model.hpp | 10 +- core/src/include/ModelMPI.hpp | 68 ++++++++ core/src/include/ModelMetadata.hpp | 73 ++++++-- core/src/include/ParaGridIO.hpp | 16 +- core/src/include/PrognosticData.hpp | 4 +- core/src/include/RectGridIO.hpp | 10 +- core/src/include/StructureFactory.hpp | 17 +- core/src/main.cpp | 6 +- .../DiagnosticOutputModule/ConfigOutput.cpp | 12 +- .../DiagnosticOutputModule/SimpleOutput.cpp | 7 +- .../include/ConfigOutput.hpp | 4 +- .../include/NoOutput.hpp | 4 +- .../include/SimpleOutput.hpp | 4 +- .../include/ParametricGrid.hpp | 30 +--- .../include/RectangularGrid.hpp | 23 +-- .../src/modules/include/IDiagnosticOutput.hpp | 4 +- core/src/modules/include/IStructure.hpp | 17 +- core/test/CMakeLists.txt | 127 +++++++++----- core/test/ConfigOutput_test.cpp | 16 +- core/test/HaloExchangeCB_test.cpp | 98 +++++++++++ core/test/HaloExchangePB_test.cpp | 100 +++++++++++ core/test/HaloExchange_test.cpp | 163 ------------------ core/test/ModelMetadataCB_test.cpp | 81 +++++++++ ...data_test.cpp => ModelMetadataPB_test.cpp} | 30 +--- core/test/ParaGrid_test.cpp | 42 ++--- core/test/PrognosticDataIO_test.cpp | 6 +- core/test/PrognosticData_test.cpp | 6 +- core/test/RectGrid_test.cpp | 120 +++++++------ core/test/XiosRead_test.cpp | 9 +- core/test/XiosWrite_test.cpp | 9 +- 45 files changed, 860 insertions(+), 654 deletions(-) create mode 100644 core/src/ModelMPI.cpp create mode 100644 core/src/include/ModelMPI.hpp create mode 100644 core/test/HaloExchangeCB_test.cpp create mode 100644 core/test/HaloExchangePB_test.cpp create mode 100644 core/test/ModelMetadataCB_test.cpp rename core/test/{ModelMetadata_test.cpp => ModelMetadataPB_test.cpp} (82%) diff --git a/core/src/CMakeLists.txt b/core/src/CMakeLists.txt index d063b51f0..248a77aee 100644 --- a/core/src/CMakeLists.txt +++ b/core/src/CMakeLists.txt @@ -13,6 +13,7 @@ else() endif() set(BaseSources + "ModelMPI.cpp" "Logged.cpp" "ModelConfig.cpp" "Model.cpp" diff --git a/core/src/CommonRestartMetadata.cpp b/core/src/CommonRestartMetadata.cpp index 3d15f8fda..45a78c520 100644 --- a/core/src/CommonRestartMetadata.cpp +++ b/core/src/CommonRestartMetadata.cpp @@ -1,11 +1,12 @@ /*! * @file CommonRestartMetadata.cpp * - * @date Jun 30, 2022 + * @date 04 Jun 2025 * @author Tim Spain */ #include "include/CommonRestartMetadata.hpp" +#include "include/ModelMetadata.hpp" #include #include @@ -15,18 +16,18 @@ namespace Nextsim { -netCDF::NcGroup& CommonRestartMetadata::writeStructureType( - netCDF::NcFile& rootGroup, const ModelMetadata& metadata) +netCDF::NcGroup& CommonRestartMetadata::writeStructureType(netCDF::NcFile& rootGroup) { + auto& metadata = ModelMetadata::getInstance(); netCDF::NcGroup structGroup = rootGroup.addGroup(IStructure::structureNodeName()); structGroup.putAtt(IStructure::typeNodeName(), metadata.structureName()); return rootGroup; } -netCDF::NcGroup& CommonRestartMetadata::writeRestartMetadata( - netCDF::NcGroup& metaGroup, const ModelMetadata& metadata) +netCDF::NcGroup& CommonRestartMetadata::writeRestartMetadata(netCDF::NcGroup& metaGroup) { // Structure type + auto& metadata = ModelMetadata::getInstance(); metaGroup.putAtt(IStructure::typeNodeName(), metadata.structureName()); // Current time diff --git a/core/src/DevStep.cpp b/core/src/DevStep.cpp index 7c0d30d80..c144046f9 100644 --- a/core/src/DevStep.cpp +++ b/core/src/DevStep.cpp @@ -1,7 +1,7 @@ /*! * @file DevStep.cpp * - * @date 2 Jul 2024 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -15,7 +15,6 @@ namespace Nextsim { DevStep::DevStep() : pData(nullptr) - , mData(nullptr) , m_restartPeriod(0) { } @@ -41,14 +40,15 @@ void DevStep::iterate(const TimestepTime& tst) pData->update(tst); // The state of the model has now advanced by one timestep, so update the // model metadata timestamp. - mData->incrementTime(tst.step); - if ((m_restartPeriod.seconds() > 0) && (mData->time() >= lastOutput + m_restartPeriod)) { - std::string currentFileName = mData->time().format(m_restartFileName); - pData->writeRestartFile(currentFileName, *mData); - lastOutput = mData->time(); + auto& mData = ModelMetadata::getInstance(); + mData.incrementTime(tst.step); + if ((m_restartPeriod.seconds() > 0) && (mData.time() >= lastOutput + m_restartPeriod)) { + std::string currentFileName = mData.time().format(m_restartFileName); + pData->writeRestartFile(currentFileName); + lastOutput = mData.time(); } // XIOS wants all the fields, every timestep, so I guess that's what everyone gets - Module::getImplementation().outputState(pData->getStateDiagnostic(), *mData); + Module::getImplementation().outputState(pData->getStateDiagnostic()); } void DevStep::setRestartDetails(const Duration& restartPeriod, const std::string& fileName) diff --git a/core/src/Model.cpp b/core/src/Model.cpp index 6db7741b7..a860f4b53 100644 --- a/core/src/Model.cpp +++ b/core/src/Model.cpp @@ -1,6 +1,6 @@ /*! * @file Model.cpp - * @date 12 Aug 2021 + * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet */ @@ -42,16 +42,9 @@ static const std::map keyMap = { { Model::RESTARTOUTFILE_KEY, "model.restart_file" }, }; -#ifdef USE_MPI -Model::Model(MPI_Comm comm) -#else Model::Model() -#endif : iterator(modelStep) { -#ifdef USE_MPI - m_etadata.setMpiMetadata(comm); -#endif finalFileName = std::string("restart") + TimePoint::ymdhmsFormat + ".nc"; } @@ -71,11 +64,6 @@ void Model::configure() = Configured::getConfiguration(keyMap.at(RUNLENGTH_KEY), std::string()); ModelConfig::stepStr = Configured::getConfiguration(keyMap.at(TIMESTEP_KEY), std::string()); - // Set the time correspond to the current (initial) model state - TimePoint timeNow = iterator.parseAndSet(ModelConfig::startTimeStr, ModelConfig::stopTimeStr, - ModelConfig::durationStr, ModelConfig::stepStr); - m_etadata.setTime(timeNow); - // Configure the missing data value MissingData::setValue( Configured::getConfiguration(keyMap.at(MISSINGVALUE_KEY), MissingData::defaultValue)); @@ -92,14 +80,17 @@ void Model::configure() #ifdef USE_MPI std::string partitionFile = Configured::getConfiguration(keyMap.at(PARTITIONFILE_KEY), std::string("partition.nc")); - m_etadata.getPartitionMetadata(partitionFile); + auto& metadata = ModelMetadata::getInstance(partitionFile); +#else + auto& metadata = ModelMetadata::getInstance(); #endif -#ifdef USE_MPI - ModelState initialState(StructureFactory::stateFromFile(initialFileName, m_etadata)); -#else + // Set the time correspond to the current (initial) model state + TimePoint timeNow = iterator.parseAndSet(ModelConfig::startTimeStr, ModelConfig::stopTimeStr, + ModelConfig::durationStr, ModelConfig::stepStr); + metadata.setTime(timeNow); + ModelState initialState(StructureFactory::stateFromFile(initialFileName)); -#endif // The period with which to write restart files. std::string restartPeriodStr @@ -107,10 +98,9 @@ void Model::configure() restartPeriod = Duration(restartPeriodStr); // Get the coordinates from the ModelState for persistence - m_etadata.extractCoordinates(initialState); + metadata.extractCoordinates(initialState); modelStep.setData(pData); - modelStep.setMetadata(m_etadata); modelStep.setRestartDetails(restartPeriod, finalFileName); pData.setData(initialState.data); } @@ -177,9 +167,9 @@ void Model::run() //! Write a restart file for the model. void Model::writeRestartFile() { - std::string formattedFileName = m_etadata.time().format(finalFileName); - pData.writeRestartFile(formattedFileName, m_etadata); + auto& metadata = ModelMetadata::getInstance(); + std::string formattedFileName = metadata.time().format(finalFileName); + pData.writeRestartFile(formattedFileName); } -ModelMetadata& Model::metadata() { return m_etadata; } } /* namespace Nextsim */ diff --git a/core/src/ModelMPI.cpp b/core/src/ModelMPI.cpp new file mode 100644 index 000000000..94dd30300 --- /dev/null +++ b/core/src/ModelMPI.cpp @@ -0,0 +1,39 @@ +/*! + * @file ModelMPI.cpp + * + * @date 04 Jun 2025 + * @author Tom Meltzer + */ + +#ifdef USE_MPI +#include "include/ModelMPI.hpp" + +namespace Nextsim { + +ModelMPI::ModelMPI(MPI_Comm comm) + : m_comm(comm) +{ + MPI_Comm_size(m_comm, &m_size); + MPI_Comm_rank(m_comm, &m_rank); + static bool doneOnce = doOnce(); + isInitialized = true; +} + +MPI_Comm ModelMPI::getComm() const { return m_comm; } + +int ModelMPI::getSize() const { return m_size; } + +int ModelMPI::getRank() const { return m_rank; } + +bool ModelMPI::doOnce() +{ + // Register the finalization function here + Finalizer::registerUnique(finalize); + return true; +} + +void ModelMPI::finalize() { } + +} // namespace Nextsim + +#endif // USE_MPI diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index 4022ce9f4..888cf2c46 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata.cpp * - * @date 19 May 2025 + * @date 04 Jun 2025 * @author Tim Spain * @author Tom Meltzer */ @@ -10,6 +10,7 @@ #include "include/Finalizer.hpp" #include "include/IStructure.hpp" +#include "include/ModelMPI.hpp" #include "include/NextsimModule.hpp" #include "include/gridNames.hpp" #ifdef USE_XIOS @@ -35,24 +36,20 @@ const std::string& ModelMetadata::structureName() const } #ifdef USE_MPI -ModelMetadata::ModelMetadata(std::string partitionFile, MPI_Comm comm) +ModelMetadata::ModelMetadata(std::string partitionFile) { - static bool doneOnce = doOnce(); - setMpiMetadata(comm); getPartitionMetadata(partitionFile); -} - -void ModelMetadata::setMpiMetadata(MPI_Comm comm) -{ - mpiComm = comm; - MPI_Comm_size(mpiComm, &mpiSize); - MPI_Comm_rank(mpiComm, &mpiMyRank); + static bool doneOnce = doOnce(); + isInitialized = true; } void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) { netCDF::NcGroup neighbourGroup(ncFile.getGroup(neighbourName)); std::string varName {}; + auto& modelMPI = ModelMPI::getInstance(); + auto mpiSize = modelMPI.getSize(); + auto mpiMyRank = modelMPI.getRank(); for (auto edge : edges) { size_t nStart = 0; // start point in metadata arrays size_t count = 0; // number of elements to read from metadata arrays @@ -65,7 +62,7 @@ void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) { 0 }, { static_cast(mpiSize) }, &numNeighbours[0]); // compute start index for each process - MPI_Exscan(&numNeighbours[mpiMyRank], &nStart, 1, MPI_INT, MPI_SUM, mpiComm); + MPI_Exscan(&numNeighbours[mpiMyRank], &nStart, 1, MPI_INT, MPI_SUM, modelMPI.getComm()); // how many elements to read for each process count = numNeighbours[mpiMyRank]; @@ -98,7 +95,7 @@ void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) { 0 }, { static_cast(mpiSize) }, &numNeighbours[0]); // compute start index for each process - MPI_Exscan(&numNeighbours[mpiMyRank], &nStart, 1, MPI_INT, MPI_SUM, mpiComm); + MPI_Exscan(&numNeighbours[mpiMyRank], &nStart, 1, MPI_INT, MPI_SUM, modelMPI.getComm()); // how many elements to read for each process count = numNeighbours[mpiMyRank]; @@ -128,12 +125,15 @@ void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) } } +// rename void ModelMetadata::getPartitionMetadata(std::string partitionFile) { // TODO: Move the reading of the partition file to its own class netCDF::NcFile ncFile(partitionFile, netCDF::NcFile::read); int sizes = ncFile.getDim("L").getSize(); int nBoxes = ncFile.getDim("P").getSize(); + auto& modelMPI = ModelMPI::getInstance(); + auto mpiSize = modelMPI.getSize(); if (nBoxes != mpiSize) { std::string errorMsg = "Number of MPI ranks " + std::to_string(mpiSize) + " <> " + std::to_string(nBoxes) + "\n"; @@ -143,7 +143,7 @@ void ModelMetadata::getPartitionMetadata(std::string partitionFile) globalExtentY = ncFile.getDim("NY").getSize(); netCDF::NcGroup bboxGroup(ncFile.getGroup(bboxName)); - std::vector rank(1, mpiMyRank); + std::vector rank(1, modelMPI.getRank()); bboxGroup.getVar("domain_x").getVar(rank, &localCornerX); bboxGroup.getVar("domain_y").getVar(rank, &localCornerY); bboxGroup.getVar("domain_extent_x").getVar(rank, &localExtentX); @@ -153,9 +153,20 @@ void ModelMetadata::getPartitionMetadata(std::string partitionFile) ncFile.close(); } + +int ModelMetadata::getLocalCornerX() const { return localCornerX; } +int ModelMetadata::getLocalCornerY() const { return localCornerY; } +int ModelMetadata::getLocalExtentX() const { return localExtentX; } +int ModelMetadata::getLocalExtentY() const { return localExtentY; } +int ModelMetadata::getGlobalExtentX() const { return globalExtentX; } +int ModelMetadata::getGlobalExtentY() const { return globalExtentY; } #else -ModelMetadata::ModelMetadata() { static bool doneOnce = doOnce(); } +ModelMetadata::ModelMetadata() +{ + isInitialized = true; + static bool doneOnce = doOnce(); +} #endif diff --git a/core/src/PDWriter.cpp b/core/src/PDWriter.cpp index 0b48b5f58..11ee58200 100644 --- a/core/src/PDWriter.cpp +++ b/core/src/PDWriter.cpp @@ -1,7 +1,7 @@ /*! * @file PDWriter.cpp * - * @date 19 May 2025 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -13,17 +13,16 @@ #include "include/StructureFactory.hpp" namespace Nextsim { -void PrognosticData::writeRestartFile( - const std::string& filePath, const ModelMetadata& metadata) const +void PrognosticData::writeRestartFile(const std::string& filePath) const { Logged::notice(std::string(" Writing state-based restart file: ") + filePath + '\n'); ModelState state = getStatePrognostic(); state.merge(ModelConfig::getConfig()); - ModelMetadata& meta = ModelMetadata::getInstance(); + auto& meta = ModelMetadata::getInstance(); meta.affixCoordinates(state); - StructureFactory::fileFromState(state, meta, filePath, true); + StructureFactory::fileFromState(state, filePath, true); } } diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index ca711b9df..b73531c94 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGridIO.cpp * - * @date 19 May 2025 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -12,6 +12,7 @@ #include "include/Finalizer.hpp" #ifdef USE_MPI #include "include/Halo.hpp" +#include "include/ModelMPI.hpp" #endif #include "include/MissingData.hpp" #include "include/gridNames.hpp" @@ -82,17 +83,14 @@ bool ParaGridIO::doOnce() ParaGridIO::~ParaGridIO() = default; -#ifdef USE_MPI -ModelState ParaGridIO::getModelState(const std::string& filePath, ModelMetadata& metadata) -#else ModelState ParaGridIO::getModelState(const std::string& filePath) -#endif { ModelState state; try { #ifdef USE_MPI - netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::read, metadata.mpiComm); + auto& modelMPI = ModelMPI::getInstance(); + netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::read, modelMPI.getComm()); #else netCDF::NcFile ncFile(filePath, netCDF::NcFile::read); #endif @@ -125,18 +123,19 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) auto dimName = dim.getName(); size_t localLength = 0; size_t start = 0; + auto& metadata = ModelMetadata::getInstance(); if (dimType == ModelArray::Dimension::X) { - localLength = metadata.localExtentX; - start = metadata.localCornerX; + localLength = metadata.getLocalExtentX(); + start = metadata.getLocalCornerX(); } else if (dimType == ModelArray::Dimension::Y) { - localLength = metadata.localExtentY; - start = metadata.localCornerY; + localLength = metadata.getLocalExtentY(); + start = metadata.getLocalCornerY(); } else if (dimType == ModelArray::Dimension::XVERTEX) { - localLength = metadata.localExtentX + 1; - start = metadata.localCornerX; + localLength = metadata.getLocalExtentX() + 1; + start = metadata.getLocalCornerX(); } else if (dimType == ModelArray::Dimension::YVERTEX) { - localLength = metadata.localExtentY + 1; - start = metadata.localCornerY; + localLength = metadata.getLocalExtentY() + 1; + start = metadata.getLocalCornerY(); } else { localLength = dim.getSize(); start = 0; @@ -287,20 +286,20 @@ ModelState ParaGridIO::readForcingTimeStatic( return state; } -void ParaGridIO::dumpModelState( - const ModelState& state, const ModelMetadata& metadata, const std::string& filePath) +void ParaGridIO::dumpModelState(const ModelState& state, const std::string& filePath) { #ifdef USE_MPI - netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::replace, metadata.mpiComm); + auto& modelMPI = ModelMPI::getInstance(); + netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::replace, modelMPI.getComm()); #else netCDF::NcFile ncFile(filePath, netCDF::NcFile::replace); #endif - CommonRestartMetadata::writeStructureType(ncFile, metadata); + CommonRestartMetadata::writeStructureType(ncFile); netCDF::NcGroup metaGroup = ncFile.addGroup(IStructure::metadataNodeName()); netCDF::NcGroup dataGroup = ncFile.addGroup(IStructure::dataNodeName()); - CommonRestartMetadata::writeRestartMetadata(metaGroup, metadata); + CommonRestartMetadata::writeRestartMetadata(metaGroup); // Dump the dimensions and number of components std::map ncFromMAMap; @@ -360,8 +359,7 @@ void ParaGridIO::dumpModelState( ncFile.close(); } -void ParaGridIO::writeDiagnosticTime( - const ModelState& state, const ModelMetadata& meta, const std::string& filePath) +void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& filePath) { bool isNew = openFilesAndIndices.count(filePath) <= 0; size_t nt = (isNew) ? 0 : ++openFilesAndIndices.at(filePath).second; @@ -371,9 +369,10 @@ void ParaGridIO::writeDiagnosticTime( // Piecewise construction is necessary to correctly construct the file handle/time index // pair #ifdef USE_MPI + auto& modelMPI = ModelMPI::getInstance(); openFilesAndIndices.emplace(std::piecewise_construct, std::make_tuple(filePath), std::forward_as_tuple(std::piecewise_construct, - std::forward_as_tuple(filePath, netCDF::NcFile::replace, meta.mpiComm), + std::forward_as_tuple(filePath, netCDF::NcFile::replace, modelMPI.getComm()), std::forward_as_tuple(nt))); #else openFilesAndIndices.emplace(std::piecewise_construct, std::make_tuple(filePath), @@ -393,8 +392,8 @@ void ParaGridIO::writeDiagnosticTime( if (isNew) { // Write the common structure and time metadata - CommonRestartMetadata::writeStructureType(ncFile, meta); - CommonRestartMetadata::writeRestartMetadata(metaGroup, meta); + CommonRestartMetadata::writeStructureType(ncFile); + CommonRestartMetadata::writeRestartMetadata(metaGroup); } // Get the unlimited time dimension, creating it if necessary netCDF::NcDim timeDim = (isNew) ? dataGroup.addDim(timeName) : dataGroup.getDim(timeName); @@ -477,7 +476,8 @@ void ParaGridIO::writeDiagnosticTime( std::vector timeDimVec = { timeDim }; netCDF::NcVar timeVar((isNew) ? dataGroup.addVar(timeName, netCDF::ncDouble, timeDimVec) : dataGroup.getVar(timeName)); - double secondsSinceEpoch = (meta.time() - TimePoint()).seconds(); + auto& metadata = ModelMetadata::getInstance(); + double secondsSinceEpoch = (metadata.time() - TimePoint()).seconds(); #ifdef USE_MPI netCDF::setVariableCollective(timeVar, dataGroup); #endif diff --git a/core/src/ParaGridIO_Xios.cpp b/core/src/ParaGridIO_Xios.cpp index e607620e8..5548cb7cf 100644 --- a/core/src/ParaGridIO_Xios.cpp +++ b/core/src/ParaGridIO_Xios.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGridIO_Xios.cpp * - * @date 12 May 2025 + * @date 04 Jun 2025 * @author Tim Spain * @author Joe Wallwork */ @@ -11,8 +11,11 @@ #include "include/CommonRestartMetadata.hpp" #include "include/FileCallbackCloser.hpp" #include "include/Finalizer.hpp" +#include "include/Halo.hpp" #include "include/Logged.hpp" #include "include/MissingData.hpp" +#include "include/ModelMPI.hpp" + #ifdef USE_XIOS #include "include/Xios.hpp" #endif @@ -95,18 +98,15 @@ bool ParaGridIO::doOnce() ParaGridIO::~ParaGridIO() = default; -#ifdef USE_MPI -ModelState ParaGridIO::getModelState(const std::string& filePath, ModelMetadata& metadata) -#else ModelState ParaGridIO::getModelState(const std::string& filePath) -#endif { // TODO: XIOS implementation ModelState state; try { #ifdef USE_MPI - netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::read, metadata.mpiComm); + auto& modelMPI = ModelMPI::getInstance(); + netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::read, modelMPI.getComm()); #else netCDF::NcFile ncFile(filePath, netCDF::NcFile::read); #endif @@ -139,23 +139,25 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) auto dimName = dim.getName(); size_t localLength = 0; size_t start = 0; + auto& metadata = ModelMetadata::getInstance(); if (dimType == ModelArray::Dimension::X) { - localLength = metadata.localExtentX; - start = metadata.localCornerX; + localLength = metadata.getLocalExtentX(); + start = metadata.getLocalCornerX(); } else if (dimType == ModelArray::Dimension::Y) { - localLength = metadata.localExtentY; - start = metadata.localCornerY; + localLength = metadata.getLocalExtentY(); + start = metadata.getLocalCornerY(); } else if (dimType == ModelArray::Dimension::XVERTEX) { - localLength = metadata.localExtentX + 1; - start = metadata.localCornerX; + localLength = metadata.getLocalExtentX() + 1; + start = metadata.getLocalCornerX(); } else if (dimType == ModelArray::Dimension::YVERTEX) { - localLength = metadata.localExtentY + 1; - start = metadata.localCornerY; + localLength = metadata.getLocalExtentY() + 1; + start = metadata.getLocalCornerY(); } else { localLength = dim.getSize(); start = 0; } - ModelArray::setDimension(dimType, dim.getSize(), localLength, start); + ModelArray::setDimension(dimType, dim.getSize() + 2 * Halo::haloWidth, + localLength + 2 * Halo::haloWidth, start); #else ModelArray::setDimension(dimType, dim.getSize()); #endif @@ -269,21 +271,21 @@ ModelState ParaGridIO::readForcingTimeStatic( return state; } -void ParaGridIO::dumpModelState( - const ModelState& state, const ModelMetadata& metadata, const std::string& filePath) +void ParaGridIO::dumpModelState(const ModelState& state, const std::string& filePath) { // TODO: XIOS implementation #ifdef USE_MPI - netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::replace, metadata.mpiComm); + auto& modelMPI = ModelMPI::getInstance(); + netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::replace, modelMPI.getComm()); #else netCDF::NcFile ncFile(filePath, netCDF::NcFile::replace); #endif - CommonRestartMetadata::writeStructureType(ncFile, metadata); + CommonRestartMetadata::writeStructureType(ncFile); netCDF::NcGroup metaGroup = ncFile.addGroup(IStructure::metadataNodeName()); netCDF::NcGroup dataGroup = ncFile.addGroup(IStructure::dataNodeName()); - CommonRestartMetadata::writeRestartMetadata(metaGroup, metadata); + CommonRestartMetadata::writeRestartMetadata(metaGroup); // Dump the dimensions and number of components std::map ncFromMAMap; @@ -348,8 +350,7 @@ void ParaGridIO::dumpModelState( ncFile.close(); } -void ParaGridIO::writeDiagnosticTime( - const ModelState& state, const ModelMetadata& meta, const std::string& filePath) +void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& filePath) { // TODO: XIOS implementation @@ -361,9 +362,10 @@ void ParaGridIO::writeDiagnosticTime( // Piecewise construction is necessary to correctly construct the file handle/time index // pair #ifdef USE_MPI + auto& modelMPI = ModelMPI::getInstance(); openFilesAndIndices.emplace(std::piecewise_construct, std::make_tuple(filePath), std::forward_as_tuple(std::piecewise_construct, - std::forward_as_tuple(filePath, netCDF::NcFile::replace, meta.mpiComm), + std::forward_as_tuple(filePath, netCDF::NcFile::replace, modelMPI.getComm()), std::forward_as_tuple(nt))); #else openFilesAndIndices.emplace(std::piecewise_construct, std::make_tuple(filePath), @@ -383,8 +385,8 @@ void ParaGridIO::writeDiagnosticTime( if (isNew) { // Write the common structure and time metadata - CommonRestartMetadata::writeStructureType(ncFile, meta); - CommonRestartMetadata::writeRestartMetadata(metaGroup, meta); + CommonRestartMetadata::writeStructureType(ncFile); + CommonRestartMetadata::writeRestartMetadata(metaGroup); } // Get the unlimited time dimension, creating it if necessary netCDF::NcDim timeDim = (isNew) ? dataGroup.addDim(timeName) : dataGroup.getDim(timeName); @@ -467,7 +469,8 @@ void ParaGridIO::writeDiagnosticTime( std::vector timeDimVec = { timeDim }; netCDF::NcVar timeVar((isNew) ? dataGroup.addVar(timeName, netCDF::ncDouble, timeDimVec) : dataGroup.getVar(timeName)); - double secondsSinceEpoch = (meta.time() - TimePoint()).seconds(); + auto& metadata = ModelMetadata::getInstance(); + double secondsSinceEpoch = (metadata.time() - TimePoint()).seconds(); #ifdef USE_MPI netCDF::setVariableCollective(timeVar, dataGroup); #endif diff --git a/core/src/RectGridIO.cpp b/core/src/RectGridIO.cpp index 7fa2a8b77..aca553b90 100644 --- a/core/src/RectGridIO.cpp +++ b/core/src/RectGridIO.cpp @@ -1,7 +1,7 @@ /*! * @file RectGridIO.cpp * - * @date Feb 8, 2022 + * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet */ @@ -12,6 +12,7 @@ #include "include/IStructure.hpp" #include "include/MissingData.hpp" #include "include/ModelArray.hpp" +#include "include/ModelMPI.hpp" #include "include/ModelState.hpp" #include "include/gridNames.hpp" @@ -33,8 +34,8 @@ namespace Nextsim { #ifdef USE_MPI -void dimensionSetter(const netCDF::NcGroup& dataGroup, const std::string& fieldName, - ModelArray::Type type, ModelMetadata& metadata) +void dimensionSetter( + const netCDF::NcGroup& dataGroup, const std::string& fieldName, ModelArray::Type type) { size_t nDims = dataGroup.getVar(fieldName).getDimCount(); ModelArray::MultiDim dims; @@ -45,8 +46,9 @@ void dimensionSetter(const netCDF::NcGroup& dataGroup, const std::string& fieldN // The dimensions in the netCDF are in the reverse order compared to ModelArray std::reverse(dims.begin(), dims.end()); // Replace X, Y dimensions with local extends - dims[0] = metadata.localExtentX; - dims[1] = metadata.localExtentY; + auto& metadata = ModelMetadata::getInstance(); + dims[0] = metadata.getLocalExtentX(); + dims[1] = metadata.getLocalExtentY(); ModelArray::setDimensions(type, dims); } #else @@ -65,29 +67,17 @@ void dimensionSetter( } #endif -#ifdef USE_MPI -ModelState RectGridIO::getModelState(const std::string& filePath, ModelMetadata& metadata) -#else ModelState RectGridIO::getModelState(const std::string& filePath) -#endif { ModelState state; #ifdef USE_MPI - netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::read, metadata.mpiComm); + auto& modelMPI = ModelMPI::getInstance(); + netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::read, modelMPI.getComm()); #else netCDF::NcFile ncFile(filePath, netCDF::NcFile::read); #endif netCDF::NcGroup dataGroup(ncFile.getGroup(IStructure::dataNodeName())); -#ifdef USE_MPI - // Get the sizes of the four types of field - // HField from hice - dimensionSetter(dataGroup, hiceName, ModelArray::Type::H, metadata); - // UField from hice - dimensionSetter(dataGroup, hiceName, ModelArray::Type::U, metadata); - // VField from hice - dimensionSetter(dataGroup, hiceName, ModelArray::Type::V, metadata); -#else // Get the sizes of the four types of field // HField from hice dimensionSetter(dataGroup, hiceName, ModelArray::Type::H); @@ -95,17 +85,17 @@ ModelState RectGridIO::getModelState(const std::string& filePath) dimensionSetter(dataGroup, hiceName, ModelArray::Type::U); // VField from hice dimensionSetter(dataGroup, hiceName, ModelArray::Type::V); -#endif #ifdef USE_MPI // Set the origins and extensions for reading 2D data based // on MPI decomposition std::vector start(2); std::vector size(2); - start[0] = metadata.localCornerY; - start[1] = metadata.localCornerX; - size[0] = metadata.localExtentY; - size[1] = metadata.localExtentX; + auto& metadata = ModelMetadata::getInstance(); + start[0] = metadata.getLocalCornerY(); + start[1] = metadata.getLocalCornerX(); + size[0] = metadata.getLocalExtentY(); + size[1] = metadata.getLocalExtentX(); #else std::vector start = { 0, 0 }; std::vector size = ModelArray::dimensions(ModelArray::Type::H); @@ -138,20 +128,21 @@ ModelState RectGridIO::getModelState(const std::string& filePath) return state; } -void RectGridIO::dumpModelState(const ModelState& state, const ModelMetadata& metadata, - const std::string& filePath, bool isRestart) const +void RectGridIO::dumpModelState( + const ModelState& state, const std::string& filePath, bool isRestart) const { #ifdef USE_MPI - netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::replace, metadata.mpiComm); + auto& modelMPI = ModelMPI::getInstance(); + netCDF::NcFilePar ncFile(filePath, netCDF::NcFile::replace, modelMPI.getComm()); #else netCDF::NcFile ncFile(filePath, netCDF::NcFile::replace); #endif - CommonRestartMetadata::writeStructureType(ncFile, metadata); + CommonRestartMetadata::writeStructureType(ncFile); netCDF::NcGroup metaGroup = ncFile.addGroup(IStructure::metadataNodeName()); netCDF::NcGroup dataGroup = ncFile.addGroup(IStructure::dataNodeName()); - CommonRestartMetadata::writeRestartMetadata(metaGroup, metadata); + CommonRestartMetadata::writeRestartMetadata(metaGroup); typedef ModelArray::Type Type; int nx = ModelArray::dimensions(Type::H)[0]; @@ -162,8 +153,9 @@ void RectGridIO::dumpModelState(const ModelState& state, const ModelMetadata& me // Create the dimension data, since it has to be in the same group as the // data or the parent group #ifdef USE_MPI - netCDF::NcDim xDim = dataGroup.addDim(dimensionNames[0], metadata.globalExtentX); - netCDF::NcDim yDim = dataGroup.addDim(dimensionNames[1], metadata.globalExtentY); + auto& metadata = ModelMetadata::getInstance(); + netCDF::NcDim xDim = dataGroup.addDim(dimensionNames[0], metadata.getGlobalExtentX()); + netCDF::NcDim yDim = dataGroup.addDim(dimensionNames[1], metadata.getGlobalExtentY()); #else netCDF::NcDim xDim = dataGroup.addDim(dimensionNames[0], nx); netCDF::NcDim yDim = dataGroup.addDim(dimensionNames[1], ny); @@ -172,10 +164,10 @@ void RectGridIO::dumpModelState(const ModelState& state, const ModelMetadata& me #ifdef USE_MPI // Set the origins and extensions for reading 2D data based // on MPI decomposition - std::vector start2 = { static_cast(metadata.localCornerY), - static_cast(metadata.localCornerX) }; - std::vector size2 = { static_cast(metadata.localExtentY), - static_cast(metadata.localExtentX) }; + std::vector start2 = { static_cast(metadata.getLocalCornerY()), + static_cast(metadata.getLocalCornerX()) }; + std::vector size2 = { static_cast(metadata.getLocalExtentY()), + static_cast(metadata.getLocalExtentX()) }; #endif for (const auto entry : state.data) { diff --git a/core/src/StructureFactory.cpp b/core/src/StructureFactory.cpp index fb893e796..0d7e933ae 100644 --- a/core/src/StructureFactory.cpp +++ b/core/src/StructureFactory.cpp @@ -1,7 +1,7 @@ /*! * @file StructureFactory.cpp * - * @date Jan 18, 2022 + * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet */ @@ -47,11 +47,7 @@ std::string structureNameFromFile(const std::string& filePath) return structureName; } -#ifdef USE_MPI -ModelState StructureFactory::stateFromFile(const std::string& filePath, ModelMetadata& metadata) -#else ModelState StructureFactory::stateFromFile(const std::string& filePath) -#endif { Finalizer::registerUnique(Module::finalize); @@ -61,20 +57,12 @@ ModelState StructureFactory::stateFromFile(const std::string& filePath) Module::setImplementation("Nextsim::RectangularGrid"); RectangularGrid gridIn; gridIn.setIO(new RectGridIO(gridIn)); -#ifdef USE_MPI - return gridIn.getModelState(filePath, metadata); -#else return gridIn.getModelState(filePath); -#endif } else if (ParametricGrid::structureName == structureName) { Module::setImplementation("Nextsim::ParametricGrid"); ParametricGrid gridIn; gridIn.setIO(new ParaGridIO(gridIn)); -#ifdef USE_MPI - return gridIn.getModelState(filePath, metadata); -#else return gridIn.getModelState(filePath); -#endif } else { throw std::invalid_argument( std::string("fileFromName: structure not implemented: ") + structureName); @@ -85,18 +73,18 @@ ModelState StructureFactory::stateFromFile(const std::string& filePath) } void StructureFactory::fileFromState( - const ModelState& state, const ModelMetadata& meta, const std::string& filePath, bool isRestart) + const ModelState& state, const std::string& filePath, bool isRestart) { std::string structureName = Module::getImplementation().structureType(); if (RectangularGrid::structureName == structureName) { RectangularGrid gridOut; gridOut.setIO(new RectGridIO(gridOut)); - gridOut.dumpModelState(state, meta, filePath, isRestart); + gridOut.dumpModelState(state, filePath, isRestart); } else if (ParametricGrid::structureName == structureName) { ParametricGrid gridOut; gridOut.setIO(new ParaGridIO(gridOut)); - gridOut.dumpModelState(state, meta, filePath, isRestart); + gridOut.dumpModelState(state, filePath, isRestart); } else { throw std::invalid_argument( std::string("fileFromName: structure not implemented: ") + structureName); diff --git a/core/src/include/CommonRestartMetadata.hpp b/core/src/include/CommonRestartMetadata.hpp index ddaa70092..144e54099 100644 --- a/core/src/include/CommonRestartMetadata.hpp +++ b/core/src/include/CommonRestartMetadata.hpp @@ -1,7 +1,7 @@ /*! * @file CommonRestartMetadata.hpp * - * @date Jun 30, 2022 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -9,7 +9,6 @@ #define COMMONRESTARTMETADATA_HPP #include "include/IStructure.hpp" -#include "include/ModelMetadata.hpp" #include #include @@ -20,11 +19,9 @@ class CommonRestartMetadata { public: //! Writes the structure type to the root of the restart file for future //! retrieval. - static netCDF::NcGroup& writeStructureType( - netCDF::NcFile& rootGroup, const ModelMetadata& metadata); + static netCDF::NcGroup& writeStructureType(netCDF::NcFile& rootGroup); //! Writes the standard restart file metadata to a metadata node. - static netCDF::NcGroup& writeRestartMetadata( - netCDF::NcGroup& metaGroup, const ModelMetadata& metadata); + static netCDF::NcGroup& writeRestartMetadata(netCDF::NcGroup& metaGroup); static const std::string timeNodeName() { return "time"; } diff --git a/core/src/include/DevStep.hpp b/core/src/include/DevStep.hpp index 4f9b61b22..a9b85de0f 100644 --- a/core/src/include/DevStep.hpp +++ b/core/src/include/DevStep.hpp @@ -1,7 +1,7 @@ /*! * @file DevStep.hpp * - * @date Jan 12, 2022 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -25,7 +25,6 @@ class DevStep : public IModelStep { void writeRestartFile(const std::string& filePath) override {}; void setData(PrognosticData& pDat) override { pData = &pDat; } - void setMetadata(ModelMetadata& metadata) override { mData = &metadata; } /*! * Sets the period with which restart files are created. @@ -44,7 +43,6 @@ class DevStep : public IModelStep { private: PrognosticData* pData; - ModelMetadata* mData; Duration m_restartPeriod; TimePoint lastOutput; // The time a restart file was last output std::string m_restartFileName; diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index 0e57d0f36..c2a4d774d 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -1,7 +1,7 @@ /*! * @file Halo.hpp * - * @date 19 May 2025 + * @date 04 Jun 2025 * @author Tom Meltzer */ @@ -17,6 +17,7 @@ #include "Slice.hpp" #include "include/ModelArray.hpp" #include "include/ModelArraySlice.hpp" +#include "include/ModelMPI.hpp" #include "include/ModelMetadata.hpp" #include "mpi.h" @@ -46,7 +47,6 @@ class Halo { */ Halo(ModelArray& ma) : m_ma(ma) - , m_metadata(ModelMetadata::getInstance()) { m_innerNx = ma.innerDimensions()[0]; m_innerNy = ma.innerDimensions()[1]; @@ -59,7 +59,6 @@ class Halo { recv[i].resize(m_perimeterLength, 0.0); } m_edgeLengths = { m_innerNx, m_innerNy, m_innerNx, m_innerNy }; // order is Bottom - m_comm = m_metadata.mpiComm; m_outerSlices = { { Edge::LEFT, VBounds({ { 0 }, { 1, m_innerNy + haloWidth } }) }, @@ -96,14 +95,12 @@ class Halo { size_t m_innerNy; // local extent in y-direction size_t m_perimeterLength; // length of perimeter of domain size_t m_numComps; // number of DG components - ModelMetadata& m_metadata; // reference to metadata singleton std::array m_edgeLengths; // array containing length of each edge std::array edges = ModelMetadata::edges; // array of edge enums std::map m_outerSlices; std::map m_innerSlices; std::map m_innerSlicesVertexAdjusted; MPI_Win m_win; // RMA memory window object (used for sharing send buffers between ranks) - MPI_Comm m_comm; // RMA memory window object (used for sharing send buffers between ranks) std::map oppositeEdge = { { Edge::LEFT, Edge::RIGHT }, @@ -121,8 +118,9 @@ class Halo { void openMemoryWindow(size_t idx) { // create a RMA memory window which all ranks will be able to access + auto& modelMPI = ModelMPI::getInstance(); MPI_Win_create(&send[idx][0], m_perimeterLength * sizeof(double), sizeof(double), - MPI_INFO_NULL, m_comm, &m_win); + MPI_INFO_NULL, modelMPI.getComm(), &m_win); // remove fence and check that no proceding RMA calls have been made MPI_Win_fence(MPI_MODE_NOPRECEDE, m_win); } @@ -182,17 +180,18 @@ class Halo { for (size_t comp = 0; comp < m_numComps; comp++) { // open memory window to send buffer on other ranks openMemoryWindow(comp); + auto& metadata = ModelMetadata::getInstance(); // get non-periodic neighbours and populate recv buffer (if the exist) for (auto edge : edges) { - auto numNeighbours = m_metadata.neighbourRanks[edge].size(); + auto numNeighbours = metadata.neighbourRanks[edge].size(); if (numNeighbours) { // get data for each neighbour that exists along a given edge for (size_t i = 0; i < numNeighbours; ++i) { - int fromRank = m_metadata.neighbourRanks[edge][i]; - size_t count = m_metadata.neighbourExtents[edge][i]; - size_t disp = m_metadata.neighbourHaloSend[edge][i]; - size_t recvOffset = m_metadata.neighbourHaloRecv[edge][i]; + int fromRank = metadata.neighbourRanks[edge][i]; + size_t count = metadata.neighbourExtents[edge][i]; + size_t disp = metadata.neighbourHaloSend[edge][i]; + size_t recvOffset = metadata.neighbourHaloRecv[edge][i]; if (m_ma.getType() == ModelArray::Type::VERTEX) { vertexAdjustedPositions( count = count, disp = disp, recvOffset = recvOffset, edge = edge); @@ -205,14 +204,14 @@ class Halo { // get periodic neighbours and populate recv buffer (if they exist) for (auto edge : edges) { - auto numNeighbours = m_metadata.neighbourRanksPeriodic[edge].size(); + auto numNeighbours = metadata.neighbourRanksPeriodic[edge].size(); if (numNeighbours) { // get data for each neighbour that exists along a given edge for (size_t i = 0; i < numNeighbours; ++i) { - int fromRank = m_metadata.neighbourRanksPeriodic[edge][i]; - size_t count = m_metadata.neighbourExtentsPeriodic[edge][i]; - size_t disp = m_metadata.neighbourHaloSendPeriodic[edge][i]; - size_t recvOffset = m_metadata.neighbourHaloRecvPeriodic[edge][i]; + int fromRank = metadata.neighbourRanksPeriodic[edge][i]; + size_t count = metadata.neighbourExtentsPeriodic[edge][i]; + size_t disp = metadata.neighbourHaloSendPeriodic[edge][i]; + size_t recvOffset = metadata.neighbourHaloRecvPeriodic[edge][i]; if (m_ma.getType() == ModelArray::Type::VERTEX) { vertexAdjustedPositions( count = count, disp = disp, recvOffset = recvOffset, edge = edge); diff --git a/core/src/include/IModelStep.hpp b/core/src/include/IModelStep.hpp index 5650542c8..7b744af86 100644 --- a/core/src/include/IModelStep.hpp +++ b/core/src/include/IModelStep.hpp @@ -1,7 +1,7 @@ /*! * @file IModelStep.hpp * - * @date Jan 18, 2022 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -42,18 +42,6 @@ class IModelStep : public Iterator::Iterant { */ virtual void setData(PrognosticData& data) = 0; - /*! - * @brief Sets the metadata object that will be used within the timesteps. - * - * @details The ModelMetadata object will contain much constant - * information, primarily metadata about the model set up, but also - * time-dependent metadata, including the current time for which the model - * data is valid. - * - * @param meta A ModelMetadata reference to the metadata instance - */ - virtual void setMetadata(ModelMetadata& meta) = 0; - // Member functions inherited from Iterant virtual void init() = 0; virtual void start(const TimePoint& startTime) = 0; diff --git a/core/src/include/Model.hpp b/core/src/include/Model.hpp index 593950ca0..c165c5681 100644 --- a/core/src/include/Model.hpp +++ b/core/src/include/Model.hpp @@ -1,6 +1,6 @@ /*! * @file Model.hpp - * @date 19 May 2025 + * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet */ @@ -25,12 +25,8 @@ namespace Nextsim { //! A class that encapsulates the whole of the model class Model : public Configured { public: -#ifdef USE_MPI - Model(MPI_Comm comm); -#else Model(); // TODO add arguments to pass the desired // environment and configuration to the model -#endif ~Model(); // Finalize the model. Collect data and so on. void configure() override; @@ -64,9 +60,6 @@ class Model : public Configured { //! Sets the filename of the restart file that would currently be written out. void setFinalFilename(const std::string& finalFile); - //! Gets the model metadata instance - ModelMetadata& metadata(); - // Configuration option that holds the restart file name const static std::string restartOptionName; @@ -74,7 +67,6 @@ class Model : public Configured { Iterator iterator; DevStep modelStep; // Change the model step calculation here PrognosticData pData; - ModelMetadata& m_etadata = ModelMetadata::getInstance(); std::string initialFileName; std::string finalFileName; diff --git a/core/src/include/ModelMPI.hpp b/core/src/include/ModelMPI.hpp new file mode 100644 index 000000000..b6624aa0f --- /dev/null +++ b/core/src/include/ModelMPI.hpp @@ -0,0 +1,68 @@ +/*! + * @file ModelMPI.hpp + * + * @date 04 Jun 2025 + * @author Tom Meltzer + */ + +#ifndef MODELMPI_HPP +#define MODELMPI_HPP +#ifdef USE_MPI + +#include "include/Finalizer.hpp" +#include +#include + +namespace Nextsim { + +class ModelMPI { +private: + ModelMPI(MPI_Comm comm); + // Prevent copying + ModelMPI(const ModelMPI&) = delete; + //! Performs some one-time initialization for the class. Returns true. + static bool doOnce(); + +public: + inline static ModelMPI& getInstance(MPI_Comm comm = nullptr) + { + static ModelMPI instance = ModelMPI(comm); + if (instance.isInitialized) { + return instance; + } else { + throw std::runtime_error("ModelMPI :: Object needs to be initialized before use."); + } + } + + // finalize ModelMPI + static void finalize(); + + /*! + * @brief Gets the MPI communicator. + * @return The MPI communicator for all processes. + */ + MPI_Comm getComm() const; + + /*! + * @brief Gets the MPI size (number of processes). + * @return The size of the communicator. + */ + int getSize() const; + + /*! + * @brief Gets the MPI rank (process ID). + * @return The rank of this process in the communicator. + */ + int getRank() const; + +private: + bool isInitialized = false; + MPI_Comm m_comm; + int m_size = 0; + int m_rank = 0; +}; + +} /* namespace Nextsim */ + +#endif /* MPI_HPP */ +#endif /* MODELMPI_HPP */ diff --git a/core/src/include/ModelMetadata.hpp b/core/src/include/ModelMetadata.hpp index 14ab9546e..b61d96ad9 100644 --- a/core/src/include/ModelMetadata.hpp +++ b/core/src/include/ModelMetadata.hpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata.hpp * - * @date 19 May 2025 + * @date 04 Jun 2025 * @author Tim Spain * @author Tom Meltzer */ @@ -32,30 +32,35 @@ class CommonRestartMetadata; class ModelMetadata { private: #ifdef USE_MPI - ModelMetadata(std::string partitionFile, MPI_Comm comm); + ModelMetadata(std::string partitionFile); #else ModelMetadata(); #endif // Prevent copying ModelMetadata(const ModelMetadata&) = delete; - // ModelMetadata& operator=(const ModelMetadata&) = delete; - //! Performs some one-time initialization for the class. Returns true. static bool doOnce(); public: #ifdef USE_MPI - inline static ModelMetadata& getInstance( - std::string partitionFile = "partition.nc", MPI_Comm comm = nullptr) + inline static ModelMetadata& getInstance(std::string partitionFile = "") { - static ModelMetadata instance = ModelMetadata(partitionFile, comm); - return instance; + static ModelMetadata instance = ModelMetadata(partitionFile); + if (instance.isInitialized) { + return instance; + } else { + throw std::runtime_error("ModelMetadata :: Object needs to be initialized before use."); + } } #else inline static ModelMetadata& getInstance() { static ModelMetadata instance = ModelMetadata(); - return instance; + if (instance.isInitialized) { + return instance; + } else { + throw std::runtime_error("ModelMetadata :: Object needs to be initialized before use."); + } } #endif @@ -68,12 +73,14 @@ class ModelMetadata { * @param time TimePoint instance encoding the current time. */ void setTime(const TimePoint& time); + /*! * @brief Increments the model time metadata value. * * @param step Duration of the time increment to add. */ void incrementTime(const Duration& step); + //! Returns the current model time. inline const TimePoint& time() const { return m_time; } @@ -105,7 +112,6 @@ class ModelMetadata { ModelState& affixCoordinates(ModelState& state) const; #ifdef USE_MPI - void setMpiMetadata(MPI_Comm comm); /*! * @brief Extracts and sets MPI partition metadata from partition file * @@ -113,17 +119,41 @@ class ModelMetadata { */ void getPartitionMetadata(std::string partitionFile); + /*! + * @brief Gets the local X coordinate of the partition's lower-left corner. + * @return The X index of the local partition's corner. + */ + int getLocalCornerX() const; + /*! + * @brief Gets the local Y coordinate of the partition's lower-left corner. + * @return The Y index of the local partition's corner. + */ + int getLocalCornerY() const; + /*! + * @brief Gets the extent of the partition in the X direction. + * @return The number of grid points in X for the local partition. + */ + int getLocalExtentX() const; + /*! + * @brief Gets the extent of the partition in the Y direction. + * @return The number of grid points in Y for the local partition. + */ + int getLocalExtentY() const; + /*! + * @brief Gets the global extent of the grid in the X direction. + * @return The total number of grid points in X for the global domain. + */ + int getGlobalExtentX() const; + /*! + * @brief Gets the global extent of the grid in the Y direction. + * @return The total number of grid points in Y for the global domain. + */ + int getGlobalExtentY() const; + enum Edge { BOTTOM, RIGHT, TOP, LEFT, N_EDGE }; // An array to allow the edges to be accessed in the correct order. static constexpr std::array edges = { BOTTOM, RIGHT, TOP, LEFT }; std::array edgeNames = { "bottom", "right", "top", "left" }; - - MPI_Comm mpiComm; - int mpiSize = 0; - int mpiMyRank = -1; - int localCornerX, localCornerY; - int localExtentX, localExtentY; - int globalExtentX, globalExtentY; // mpi rank ID and extent for each edge direction std::array, N_EDGE> neighbourRanks; std::array, N_EDGE> neighbourExtents; @@ -143,6 +173,10 @@ class ModelMetadata { */ void readNeighbourData(netCDF::NcFile& ncFile); +#ifdef USE_MPI + void setMpiMetadata(MPI_Comm comm); +#endif + TimePoint m_time; ConfigMap m_config; @@ -157,7 +191,12 @@ class ModelMetadata { bool isCartesian = false; // Are the more complex coordinates stored? bool hasParameters = false; + // has metadata been initialized + bool isInitialized = false; #ifdef USE_MPI + int localCornerX, localCornerY; + int localExtentX, localExtentY; + int globalExtentX, globalExtentY; const std::string bboxName = "bounding_boxes"; const std::string neighbourName = "connectivity"; #endif diff --git a/core/src/include/ParaGridIO.hpp b/core/src/include/ParaGridIO.hpp index 34e803b24..e0468f72b 100644 --- a/core/src/include/ParaGridIO.hpp +++ b/core/src/include/ParaGridIO.hpp @@ -1,7 +1,7 @@ /*! * @file ParaGridIO.hpp * - * @date Oct 24, 2022 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -39,23 +39,17 @@ class ParaGridIO : public ParametricGrid::IParaGridIO { * Retrieves the ModelState from a restart file of the parametric_grid type. * @param filePath The file path containing the file to be read. */ -#ifdef USE_MPI - ModelState getModelState(const std::string& filePath, ModelMetadata& metadata) override; -#else ModelState getModelState(const std::string& filePath) override; -#endif /*! * @brief Writes the ModelState to a given file location from the provided - * model data and metadata. + * model data. * * @params state The model state and configuration object. - * @params metadata The model metadata (principally the initial file * creation model time). * @params filePath The path for the restart file. */ - void dumpModelState( - const ModelState& state, const ModelMetadata& meta, const std::string& filePath) override; + void dumpModelState(const ModelState& state, const std::string& filePath) override; /*! * @brief Reads forcings from a ParameticGrid flavoured file. @@ -74,11 +68,9 @@ class ParaGridIO : public ParametricGrid::IParaGridIO { * @brief Writes diagnostic data to a file. * * @param state The state to write to the file. - * @param time The time of the passed data. * @param filePath Path of the file to write to. */ - void writeDiagnosticTime( - const ModelState& state, const ModelMetadata& meta, const std::string& filePath) override; + void writeDiagnosticTime(const ModelState& state, const std::string& filePath) override; /*! * Closes an open diagnostic file. Does nothing when provided with a diff --git a/core/src/include/PrognosticData.hpp b/core/src/include/PrognosticData.hpp index 724e22f98..5b562dd29 100644 --- a/core/src/include/PrognosticData.hpp +++ b/core/src/include/PrognosticData.hpp @@ -1,7 +1,7 @@ /*! * @file PrognosticData.hpp * - * @date Mar 1, 2022 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -51,7 +51,7 @@ class PrognosticData : public ModelComponent, public Configured * Writes a restart file to the specified file path. * @param filePath the file path to write the restart file to. */ - void writeRestartFile(const std::string& filePath, const ModelMetadata& metadata) const; + void writeRestartFile(const std::string& filePath) const; private: HField m_snow; diff --git a/core/src/include/RectGridIO.hpp b/core/src/include/RectGridIO.hpp index 5b74be5df..22ef26c9a 100644 --- a/core/src/include/RectGridIO.hpp +++ b/core/src/include/RectGridIO.hpp @@ -1,7 +1,7 @@ /*! * @file RectGridIO.hpp * - * @date Feb 8, 2022 + * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet */ @@ -23,14 +23,10 @@ class RectGridIO : public RectangularGrid::IRectGridIO { typedef RectangularGrid::GridDimensions GridDimensions; -#ifdef USE_MPI - ModelState getModelState(const std::string& filePath, ModelMetadata& metadata) override; -#else ModelState getModelState(const std::string& filePath) override; -#endif - void dumpModelState(const ModelState& state, const ModelMetadata& metadata, - const std::string& filePath, bool isRestart) const override; + void dumpModelState( + const ModelState& state, const std::string& filePath, bool isRestart) const override; private: RectGridIO() = default; diff --git a/core/src/include/StructureFactory.hpp b/core/src/include/StructureFactory.hpp index e2daaf5a7..9b2b9c5a4 100644 --- a/core/src/include/StructureFactory.hpp +++ b/core/src/include/StructureFactory.hpp @@ -1,7 +1,7 @@ /*! * @file StructureFactory.hpp * - * @date Jan 18, 2022 + * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet */ @@ -20,23 +20,12 @@ namespace Nextsim { class StructureFactory { public: -#ifdef USE_MPI - /*! - * @brief Returns the ModelState of the named restart file. - * - * @param filePath the name of the file to be read. - * @param partitionFile name of file with data for MPI domain decomposition - * @param metadata ModelMedata to be used to get MPI parameters - */ - static ModelState stateFromFile(const std::string& filePath, ModelMetadata& metadata); -#else /*! * @brief Returns the ModelState of the named restart file. * * @param filePath the name of the file to be read. */ static ModelState stateFromFile(const std::string& filePath); -#endif /*! * @brief Takes a ModelState and a template file name to write the state @@ -45,8 +34,8 @@ class StructureFactory { * @param state the ModelState to be written. * @param filePath the path for the file to be written to. */ - static void fileFromState(const ModelState& state, const ModelMetadata& meta, - const std::string& filePath, bool isRestart = false); + static void fileFromState( + const ModelState& state, const std::string& filePath, bool isRestart = false); static void finaliseAllFiles(); diff --git a/core/src/main.cpp b/core/src/main.cpp index c02c2f52b..9314b0b1a 100644 --- a/core/src/main.cpp +++ b/core/src/main.cpp @@ -1,6 +1,6 @@ /*! * @file main.cpp - * @date 11 Aug 2021 + * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet */ @@ -15,6 +15,7 @@ #include "include/Configurator.hpp" #include "include/ConfiguredModule.hpp" #include "include/Model.hpp" +#include "include/ModelMPI.hpp" #include "include/NetcdfMetadataConfiguration.hpp" int main(int argc, char* argv[]) @@ -47,7 +48,8 @@ int main(int argc, char* argv[]) } else { // Construct the Model #ifdef USE_MPI - Nextsim::Model model(MPI_COMM_WORLD); + Nextsim::ModelMPI& modelMPI = Nextsim::ModelMPI::getInstance(MPI_COMM_WORLD); + Nextsim::Model model; #else Nextsim::Model model; #endif diff --git a/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp b/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp index 4d6b0ce68..f96e9f89c 100644 --- a/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp +++ b/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp @@ -1,7 +1,7 @@ /*! * @file ConfigOutput.cpp * - * @date 02 May 2025 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -140,8 +140,9 @@ void ConfigOutput::setModelStart(const TimePoint& modelStart) } } -void ConfigOutput::outputState(const ModelState& diagState, const ModelMetadata& meta) +void ConfigOutput::outputState(const ModelState& diagState) { + auto& meta = ModelMetadata::getInstance(); const TimePoint& time = meta.time(); if (currentFileName == "" || (lastFileChange + fileChangePeriod <= time)) { std::string newFileName = time.format(m_filePrefix) + ".nc"; @@ -153,7 +154,7 @@ void ConfigOutput::outputState(const ModelState& diagState, const ModelMetadata& lastFileChange = time; } - ModelState state { { }, diagState.config }; + ModelState state { {}, diagState.config }; auto storeData = ModelComponent::getStore().getAllData(); if (outputAllTheFields) { // If the internal to external name lookup table is still empty, fill it @@ -186,7 +187,8 @@ void ConfigOutput::outputState(const ModelState& diagState, const ModelMetadata& } } - // Get data from the data store for any named fields that have an external name that matches. + // Get data from the data store for any named fields that have an external name that + // matches. for (const auto& fieldExtName : fieldsForOutput) { if (externalNames.count(fieldExtName) && storeData.count(externalNames.at(fieldExtName)) && storeData.at(externalNames.at(fieldExtName))) { @@ -207,7 +209,7 @@ void ConfigOutput::outputState(const ModelState& diagState, const ModelMetadata& Logged::info("ConfigOutput: Outputting " + std::to_string(state.data.size()) + " fields to " + currentFileName + " at " + meta.time().format() + "\n"); meta.affixCoordinates(state); - StructureFactory::fileFromState(state, meta, currentFileName, false); + StructureFactory::fileFromState(state, currentFileName, false); lastOutput = meta.time(); } } diff --git a/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp b/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp index bd21a7bd1..aca1ebaf4 100644 --- a/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp +++ b/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp @@ -1,7 +1,7 @@ /*! * @file SimpleOutput.cpp * - * @date 24 Sep 2024 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -15,8 +15,9 @@ namespace Nextsim { -void SimpleOutput::outputState(const ModelState& diagState, const ModelMetadata& meta) +void SimpleOutput::outputState(const ModelState& diagState) { + auto& meta = ModelMetadata::getInstance(); std::stringstream startStream; startStream << meta.time(); std::string timeFileName = m_filePrefix + "." + startStream.str() + ".nc"; @@ -33,6 +34,6 @@ void SimpleOutput::outputState(const ModelState& diagState, const ModelMetadata& if (entry.second) state.data.at(entry.first) = *entry.second; } - StructureFactory::fileFromState(state, meta, timeFileName); + StructureFactory::fileFromState(state, timeFileName); } } /* namespace Nextsim */ diff --git a/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp index ba00e9178..12b221d62 100644 --- a/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp @@ -1,7 +1,7 @@ /*! * @file ConfigOutput.hpp * - * @date 24 Sep 2024 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -38,7 +38,7 @@ class ConfigOutput : public IDiagnosticOutput, public Configured { // IDiagnosticOutput overrides void setFilenamePrefix(const std::string& filePrefix) override { m_filePrefix = filePrefix; } void setModelStart(const TimePoint& modelStart) override; - void outputState(const ModelState& state, const ModelMetadata& meta) override; + void outputState(const ModelState& state) override; // ModelComponent overrides inline std::string getName() const override { return "ConfigOutput"; }; diff --git a/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp index f91af6235..6351daae3 100644 --- a/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp @@ -1,7 +1,7 @@ /*! * @file NoOutput.hpp * - * @date 23 Oct 2024 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -18,7 +18,7 @@ class NoOutput : public IDiagnosticOutput { void setFilenamePrefix(const std::string& filePrefix) override {}; - void outputState(const ModelState& state, const ModelMetadata& meta) override {}; + void outputState(const ModelState& state) override {}; // ModelComponent functions std::string getName() const override { return "NoOutput"; } diff --git a/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp index c3107e6f3..ea383fd16 100644 --- a/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp @@ -1,7 +1,7 @@ /*! * @file SimpleOutput.hpp * - * @date 24 Sep 2024 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -18,7 +18,7 @@ class SimpleOutput : public IDiagnosticOutput { void setFilenamePrefix(const std::string& filePrefix) override { m_filePrefix = filePrefix; } - void outputState(const ModelState& state, const ModelMetadata& meta) override; + void outputState(const ModelState& state) override; // ModelComponent functions std::string getName() const override { return "SimpleOutput"; } diff --git a/core/src/modules/StructureModule/include/ParametricGrid.hpp b/core/src/modules/StructureModule/include/ParametricGrid.hpp index dca0368e6..6f9f234f8 100644 --- a/core/src/modules/StructureModule/include/ParametricGrid.hpp +++ b/core/src/modules/StructureModule/include/ParametricGrid.hpp @@ -1,7 +1,7 @@ /*! * @file ParametricGrid.hpp * - * @date Oct 24, 2022 + * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet */ @@ -35,26 +35,19 @@ class ParametricGrid : public IStructure { } // Read/write override functions -#ifdef USE_MPI - ModelState getModelState(const std::string& filePath, ModelMetadata& metadata) override - { - return pio ? pio->getModelState(filePath, metadata) : ModelState(); - } -#else ModelState getModelState(const std::string& filePath) override { return pio ? pio->getModelState(filePath) : ModelState(); } -#endif - void dumpModelState(const ModelState& state, const ModelMetadata& metadata, - const std::string& filePath, bool isRestart = false) const override + void dumpModelState( + const ModelState& state, const std::string& filePath, bool isRestart = false) const override { if (pio) { if (isRestart) { - pio->dumpModelState(state, metadata, filePath); + pio->dumpModelState(state, filePath); } else { - pio->writeDiagnosticTime(state, metadata, filePath); + pio->writeDiagnosticTime(state, filePath); } } } @@ -68,20 +61,13 @@ class ParametricGrid : public IStructure { } virtual ~IParaGridIO() = default; -#ifdef USE_MPI - virtual ModelState getModelState(const std::string& filePath, ModelMetadata& metadata) = 0; -#else virtual ModelState getModelState(const std::string& filePath) = 0; -#endif - virtual void dumpModelState( - const ModelState& state, const ModelMetadata& metadata, const std::string& filePath) - = 0; + + virtual void dumpModelState(const ModelState& state, const std::string& filePath) = 0; virtual ModelState readForcingTime(const std::set& forcings, const TimePoint& time, const std::string& filePath) = 0; - virtual void writeDiagnosticTime( - const ModelState& state, const ModelMetadata& meta, const std::string& filePath) - = 0; + virtual void writeDiagnosticTime(const ModelState& state, const std::string& filePath) = 0; protected: IParaGridIO() = delete; diff --git a/core/src/modules/StructureModule/include/RectangularGrid.hpp b/core/src/modules/StructureModule/include/RectangularGrid.hpp index 33d6bf150..85e0169c4 100644 --- a/core/src/modules/StructureModule/include/RectangularGrid.hpp +++ b/core/src/modules/StructureModule/include/RectangularGrid.hpp @@ -1,7 +1,7 @@ /*! * @file RectangularGrid.hpp * - * @date 24 Sep 2024 + * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet */ @@ -46,23 +46,16 @@ class RectangularGrid : public IStructure { } // Read/write override functions -#ifdef USE_MPI - ModelState getModelState(const std::string& filePath, ModelMetadata& metadata) override - { - return pio ? pio->getModelState(filePath, metadata) : ModelState(); - } -#else ModelState getModelState(const std::string& filePath) override { return pio ? pio->getModelState(filePath) : ModelState(); } -#endif - void dumpModelState(const ModelState& state, const ModelMetadata& metadata, - const std::string& filePath, bool isRestart = false) const override + void dumpModelState( + const ModelState& state, const std::string& filePath, bool isRestart = false) const override { if (pio) - pio->dumpModelState(state, metadata, filePath, isRestart); + pio->dumpModelState(state, filePath, isRestart); } const std::string& structureType() const override { return structureName; }; @@ -80,11 +73,7 @@ class RectangularGrid : public IStructure { } virtual ~IRectGridIO() = default; -#ifdef USE_MPI - virtual ModelState getModelState(const std::string& filePath, ModelMetadata& metadata) = 0; -#else virtual ModelState getModelState(const std::string& filePath) = 0; -#endif /*! * @brief Dumps the given ModelState to the given file path. @@ -92,8 +81,8 @@ class RectangularGrid : public IStructure { * @param state The ModelState data * @param filePath The path to attempt to write the data to. */ - virtual void dumpModelState(const ModelState& state, const ModelMetadata& metadata, - const std::string& filePath, bool isRestart) const + virtual void dumpModelState( + const ModelState& state, const std::string& filePath, bool isRestart) const = 0; protected: diff --git a/core/src/modules/include/IDiagnosticOutput.hpp b/core/src/modules/include/IDiagnosticOutput.hpp index f82d087ca..ca62650e1 100644 --- a/core/src/modules/include/IDiagnosticOutput.hpp +++ b/core/src/modules/include/IDiagnosticOutput.hpp @@ -1,7 +1,7 @@ /*! * @file IDiagnosticOutput.hpp * - * @date 24 Sep 2024 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -44,7 +44,7 @@ class IDiagnosticOutput : public ModelComponent { * @param state The model state to be written out. * @param meta The model metadata for the the given state. */ - virtual void outputState(const ModelState& state, const ModelMetadata& meta) = 0; + virtual void outputState(const ModelState& state) = 0; // Define some of the ModelComponent class functions // No data to be set diff --git a/core/src/modules/include/IStructure.hpp b/core/src/modules/include/IStructure.hpp index 7e43e4df8..980d11c59 100644 --- a/core/src/modules/include/IStructure.hpp +++ b/core/src/modules/include/IStructure.hpp @@ -1,7 +1,7 @@ /*! * @file IStructure.hpp * - * @date 24 Sep 2024 + * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet */ @@ -33,21 +33,10 @@ class IStructure { IStructure() { } virtual ~IStructure() = default; - /*! - * @brief Dumps the data to a file path. - * - * @param filePath The path to attempt writing the data to. - */ - // virtual void init(const std::string& filePath) = 0; - /*! * @brief Returns the ModelState stored in the file */ -#ifdef USE_MPI - virtual ModelState getModelState(const std::string& filePath, ModelMetadata& metadata) = 0; -#else virtual ModelState getModelState(const std::string& filePath) = 0; -#endif //! Returns the structure name that this class will process virtual const std::string& structureType() const { return processedStructureName; } @@ -75,8 +64,8 @@ class IStructure { * @param state The ModelState data * @param filePath The path to attempt to write the data to. */ - virtual void dumpModelState(const ModelState& state, const ModelMetadata& metadata, - const std::string& filePath, bool isRestart) const + virtual void dumpModelState( + const ModelState& state, const std::string& filePath, bool isRestart) const = 0; // Node names in the default structure diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index e7bfdbd1a..c78933116 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -42,6 +42,41 @@ if(ENABLE_MPI) endforeach() endfunction() + # Generate partition files needed for MPI test from respective cdl files + add_custom_command( + OUTPUT partition_metadata_3.nc + COMMAND + ncgen -b -o partition_metadata_3.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3.cdl + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3.cdl + ) + add_custom_command( + OUTPUT partition_metadata_2.nc + COMMAND + ncgen -b -o partition_metadata_2.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_2.cdl + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_2.cdl + ) + add_custom_command( + OUTPUT partition_metadata_3_cb.nc partition_metadata_3_pb.nc + COMMAND + ncgen -b -o partition_metadata_3_cb.nc + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl + COMMAND + ncgen -b -o partition_metadata_3_pb.nc + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl + ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl + ) + add_custom_target( + generate_partition_files + ALL + DEPENDS + partition_metadata_3.nc + partition_metadata_2.nc + partition_metadata_3_cb.nc + partition_metadata_3_pb.nc + ) + if(ENABLE_XIOS) set(XIOS_INCLUDE_LIST "${xios_INCLUDES}" @@ -111,7 +146,8 @@ if(ENABLE_MPI) target_link_libraries(testXiosFile_MPI2 PRIVATE nextsimlib doctest::doctest) add_executable(testXiosRead_MPI2 "XiosRead_test.cpp" "MainMPI.cpp") - target_compile_definitions(testXiosRead_MPI2 PRIVATE USE_XIOS) + target_compile_definitions(testXiosRead_MPI2 PRIVATE USE_XIOS + TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\") target_include_directories( testXiosRead_MPI2 PRIVATE "${MODEL_INCLUDE_DIR}" "${XIOS_INCLUDE_LIST}" "${ModulesRoot}/StructureModule" @@ -119,7 +155,8 @@ if(ENABLE_MPI) target_link_libraries(testXiosRead_MPI2 PRIVATE nextsimlib doctest::doctest) add_executable(testXiosWrite_MPI2 "XiosWrite_test.cpp" "MainMPI.cpp") - target_compile_definitions(testXiosWrite_MPI2 PRIVATE USE_XIOS) + target_compile_definitions(testXiosWrite_MPI2 PRIVATE USE_XIOS + TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\") target_include_directories( testXiosWrite_MPI2 PRIVATE "${MODEL_INCLUDE_DIR}" "${XIOS_INCLUDE_LIST}" "${ModulesRoot}/StructureModule" @@ -139,57 +176,39 @@ if(ENABLE_MPI) add_mpi_test("${XIOS_TESTS}") else() - # Generate partition files needed for MPI test from respective cdl files - add_custom_command( - OUTPUT partition_metadata_3.nc - COMMAND - ncgen -b -o partition_metadata_3.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3.cdl - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3.cdl - ) - add_custom_command( - OUTPUT partition_metadata_2.nc - COMMAND - ncgen -b -o partition_metadata_2.nc ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_2.cdl - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_2.cdl - ) - add_custom_command( - OUTPUT partition_metadata_3_cb.nc partition_metadata_3_pb.nc - COMMAND - ncgen -b -o partition_metadata_3_cb.nc - ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl - COMMAND - ncgen -b -o partition_metadata_3_pb.nc - ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl - DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_cb.cdl - ${CMAKE_CURRENT_SOURCE_DIR}/partition_metadata_3_pb.cdl + add_executable(testHaloExchangeCB_MPI3 + "HaloExchangeCB_test.cpp" + "MainMPI.cpp" + "../src/ModelArray.cpp" + "../src/ModelArraySlice.cpp" ) - add_custom_target( - generate_partition_files - ALL - DEPENDS - partition_metadata_3.nc - partition_metadata_2.nc - partition_metadata_3_cb.nc - partition_metadata_3_pb.nc + target_compile_definitions(testHaloExchangeCB_MPI3 PRIVATE USE_MPI + TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\") + target_include_directories( + testHaloExchangeCB_MPI3 PRIVATE + ${MODEL_INCLUDE_DIR} + "${ModulesRoot}/StructureModule" + "../src" + "../../dynamics/src" ) + target_link_libraries(testHaloExchangeCB_MPI3 PRIVATE nextsimlib doctest::doctest) - add_executable(testHaloExchange_MPI3 - "HaloExchange_test.cpp" + add_executable(testHaloExchangePB_MPI3 + "HaloExchangePB_test.cpp" "MainMPI.cpp" "../src/ModelArray.cpp" "../src/ModelArraySlice.cpp" ) - target_compile_definitions(testHaloExchange_MPI3 PRIVATE USE_MPI TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\") + target_compile_definitions(testHaloExchangePB_MPI3 PRIVATE USE_MPI + TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\") target_include_directories( - testHaloExchange_MPI3 PRIVATE + testHaloExchangePB_MPI3 PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" "../src" "../../dynamics/src" ) - target_link_libraries(testHaloExchange_MPI3 PRIVATE nextsimlib doctest::doctest) - + target_link_libraries(testHaloExchangePB_MPI3 PRIVATE nextsimlib doctest::doctest) add_executable(testParaGrid_MPI2 "ParaGrid_test.cpp" "MainMPI.cpp") target_compile_definitions( @@ -216,19 +235,33 @@ if(ENABLE_MPI) ) target_link_libraries(testRectGrid_MPI3 PRIVATE nextsimlib doctest::doctest) - add_executable(testModelMetadata_MPI3 "ModelMetadata_test.cpp" "MainMPI.cpp") + add_executable(testModelMetadataCB_MPI3 "ModelMetadataCB_test.cpp" "MainMPI.cpp") + target_compile_definitions( + testModelMetadataCB_MPI3 + PRIVATE + USE_MPI + TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" + TEST_FILE_SOURCE=\"${CMAKE_CURRENT_SOURCE_DIR}\" + ) + target_include_directories( + testModelMetadataCB_MPI3 + PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" + ) + target_link_libraries(testModelMetadataCB_MPI3 PRIVATE nextsimlib doctest::doctest) + + add_executable(testModelMetadataPB_MPI3 "ModelMetadataPB_test.cpp" "MainMPI.cpp") target_compile_definitions( - testModelMetadata_MPI3 + testModelMetadataPB_MPI3 PRIVATE USE_MPI TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" TEST_FILE_SOURCE=\"${CMAKE_CURRENT_SOURCE_DIR}\" ) target_include_directories( - testModelMetadata_MPI3 + testModelMetadataPB_MPI3 PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" ) - target_link_libraries(testModelMetadata_MPI3 PRIVATE nextsimlib doctest::doctest) + target_link_libraries(testModelMetadataPB_MPI3 PRIVATE nextsimlib doctest::doctest) add_executable(testConfigOutput_MPI2 "ConfigOutput_test.cpp" "MainMPI.cpp") target_compile_definitions( @@ -239,10 +272,12 @@ if(ENABLE_MPI) target_link_libraries(testConfigOutput_MPI2 PRIVATE nextsimlib doctest::doctest) set(MPI_TESTS - testHaloExchange_MPI3 + testHaloExchangeCB_MPI3 + testHaloExchangePB_MPI3 testParaGrid_MPI2 testRectGrid_MPI3 - testModelMetadata_MPI3 + testModelMetadataCB_MPI3 + testModelMetadataPB_MPI3 testConfigOutput_MPI2 ) add_mpi_test("${MPI_TESTS}") diff --git a/core/test/ConfigOutput_test.cpp b/core/test/ConfigOutput_test.cpp index 7957fd795..784ee6bd5 100644 --- a/core/test/ConfigOutput_test.cpp +++ b/core/test/ConfigOutput_test.cpp @@ -1,7 +1,7 @@ /*! * @file ConfigOutput_test.cpp * - * @date 19 May 2025 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -21,6 +21,7 @@ #include "include/ModelArray.hpp" #include "include/ModelArrayRef.hpp" #include "include/ModelComponent.hpp" +#include "include/ModelMPI.hpp" #include "include/ModelMetadata.hpp" #include "include/ModelState.hpp" #include "include/NextsimModule.hpp" @@ -98,7 +99,12 @@ TEST_CASE("Test periodic output") ModelComponent::getStore().registerArray(Protected::H_SNOW, &hsnow); ModelComponent::getStore().registerArray(Protected::T_SURF, &tsurf); - ModelMetadata& meta = ModelMetadata::getInstance(); +#ifdef USE_MPI + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& meta = ModelMetadata::getInstance(partition_filename); +#else + auto& meta = ModelMetadata::getInstance(); +#endif // Set up the coordinates, but use arrays filled with zeros HField latlonData(ModelArray::Type::H); latlonData = 0.; @@ -114,10 +120,6 @@ TEST_CASE("Test periodic output") meta.extractCoordinates(modelCoordinates); meta.setTime(TimePoint("2020-01-01T00:00:00Z")); -#ifdef USE_MPI - meta.setMpiMetadata(test_comm); -#endif - IDiagnosticOutput& ido = Module::getImplementation(); tryConfigure(ido); @@ -154,7 +156,7 @@ TEST_CASE("Test periodic output") hsnow += hourIncr; ModelState state = { { { "top_melt", topMelt } }, {} }; - ido.outputState(state, meta); + ido.outputState(state); meta.incrementTime(Duration(3600.)); } } diff --git a/core/test/HaloExchangeCB_test.cpp b/core/test/HaloExchangeCB_test.cpp new file mode 100644 index 000000000..ac5e0848c --- /dev/null +++ b/core/test/HaloExchangeCB_test.cpp @@ -0,0 +1,98 @@ +/*! + * @file ModelMetadata_test.cpp + * + * @date 04 Jun 2025 + * @author Tom Meltzer + */ + +#include + +#include "ModelMPI.hpp" +#include "ModelMetadata.hpp" +#include "include/Halo.hpp" + +namespace Nextsim { + +const std::string testFilesDir = TEST_FILES_DIR; +const std::string file = testFilesDir + "/partition_metadata_3_cb.nc"; + +static const int DG = 3; +static const bool debug = false; + +void initializeHField(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, + size_t offsetY, int test_rank) +{ + // initialize with mock data + for (size_t j = 0; j < localNy; ++j) { + for (size_t i = 0; i < localNx; ++i) { + data(i + j * localNx) = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); + } + } +} + +TEST_SUITE_BEGIN("Halo exchange tests"); +MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) +{ + // test for a 3 proc grid + // ┌─┬─┐ + // │1│ │ + // ├─┤2│ + // │0│ │ + // └─┴─┘ (proc id) + + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance(file); + + const size_t nx = metadata.getGlobalExtentX(); + const size_t ny = metadata.getGlobalExtentY(); + const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const size_t offsetX = metadata.getLocalCornerX(); + const size_t offsetY = metadata.getLocalCornerY(); + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + + // create example 2D field on each process + auto testData = ModelArray::HField(); + testData.resize(); + + // create halo for testData model array + Halo halo(testData); + + // create and allocate temporary Eigen array + ModelArray::DataType innerData; + innerData.resize(halo.getInnerSize(), testData.nComponents()); + initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); + + // populate inner block of modelarray + halo.populateInnerBlock(innerData); + // exchange halos + halo.exchangeHalos(); + + std::array, 3> mockDataAllProcs = { + std::vector({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 110, 120, 130, 140, 150, 160, 370, + 0, 101, 111, 121, 131, 141, 151, 161, 371, 0, 102, 112, 122, 132, 142, 152, 162, 372, 0, + 103, 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, 244, 254, 264, 0 }), + std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 0, 204, 214, 224, 234, 244, + 254, 264, 374, 0, 205, 215, 225, 235, 245, 255, 265, 375, 0, 206, 216, 226, 236, 246, + 256, 266, 376, 0, 207, 217, 227, 237, 247, 257, 267, 377, 0, 208, 218, 228, 238, 248, + 258, 268, 378, 0, 0, 0, 0, 0, 0, 0, 0, 0 }), + std::vector({ 0, 0, 0, 0, 0, 160, 370, 380, 390, 0, 161, 371, 381, 391, 0, 162, 372, + 382, 392, 0, 163, 373, 383, 393, 0, 264, 374, 384, 394, 0, 265, 375, 385, 395, 0, 266, + 376, 386, 396, 0, 267, 377, 387, 397, 0, 268, 378, 388, 398, 0, 0, 0, 0, 0, 0 }), + }; + + // create mock eigen matrix for each process + ModelArray::DataType mockData; + mockData.resize(localNx * localNy, 1); + mockData + = Eigen::Map(mockDataAllProcs[test_rank].data(), mockData.size(), 1); + + for (size_t j = 0; j < localNy; j++) { + for (size_t i = 0; i < localNx; i++) { + REQUIRE(testData(i, j) == mockData(i + j * localNx)); + } + } +} +} diff --git a/core/test/HaloExchangePB_test.cpp b/core/test/HaloExchangePB_test.cpp new file mode 100644 index 000000000..e7f7f991e --- /dev/null +++ b/core/test/HaloExchangePB_test.cpp @@ -0,0 +1,100 @@ +/*! + * @file ModelMetadata_test.cpp + * + * @date 04 Jun 2025 + * @author Tom Meltzer + */ + +#include + +#include "ModelMPI.hpp" +#include "ModelMetadata.hpp" +#include "include/Halo.hpp" + +namespace Nextsim { + +const std::string testFilesDir = TEST_FILES_DIR; +const std::string file = testFilesDir + "/partition_metadata_3_pb.nc"; + +static const int DG = 3; +static const bool debug = false; + +void initializeHField(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, + size_t offsetY, int test_rank) +{ + // initialize with mock data + for (size_t j = 0; j < localNy; ++j) { + for (size_t i = 0; i < localNx; ++i) { + data(i + j * localNx) = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); + } + } +} + +TEST_SUITE_BEGIN("Halo exchange tests"); +MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditions", 3) +{ + // test for a 3 proc grid + // ┌─┬─┐ + // │1│ │ + // ├─┤2│ + // │0│ │ + // └─┴─┘ (proc id) + + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance(file); + + const size_t nx = metadata.getGlobalExtentX(); + const size_t ny = metadata.getGlobalExtentY(); + const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const size_t offsetX = metadata.getLocalCornerX(); + const size_t offsetY = metadata.getLocalCornerY(); + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + + // create example 2D field on each process + auto testData = ModelArray::HField(); + testData.resize(); + + // create halo for testData model array + Halo halo(testData); + + // create and allocate temporary Eigen array + ModelArray::DataType innerData; + innerData.resize(halo.getInnerSize(), testData.nComponents()); + initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); + + // populate inner block of modelarray + halo.populateInnerBlock(innerData); + // exchange halos + halo.exchangeHalos(); + + std::array, 3> mockDataAllProcs = { + std::vector({ 0, 208, 218, 228, 238, 248, 258, 268, 0, 390, 100, 110, 120, 130, 140, + 150, 160, 370, 391, 101, 111, 121, 131, 141, 151, 161, 371, 392, 102, 112, 122, 132, + 142, 152, 162, 372, 393, 103, 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, + 244, 254, 264, 0 }), + std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 394, 204, 214, 224, 234, 244, + 254, 264, 374, 395, 205, 215, 225, 235, 245, 255, 265, 375, 396, 206, 216, 226, 236, + 246, 256, 266, 376, 397, 207, 217, 227, 237, 247, 257, 267, 377, 398, 208, 218, 228, + 238, 248, 258, 268, 378, 0, 100, 110, 120, 130, 140, 150, 160, 0 }), + std::vector({ 0, 378, 388, 398, 0, 160, 370, 380, 390, 100, 161, 371, 381, 391, 101, + 162, 372, 382, 392, 102, 163, 373, 383, 393, 103, 264, 374, 384, 394, 204, 265, 375, + 385, 395, 205, 266, 376, 386, 396, 206, 267, 377, 387, 397, 207, 268, 378, 388, 398, + 208, 0, 370, 380, 390, 0 }), + }; + + // create mock eigen matrix for each process + ModelArray::DataType mockData; + mockData.resize(localNx * localNy, 1); + mockData + = Eigen::Map(mockDataAllProcs[test_rank].data(), mockData.size(), 1); + + for (size_t j = 0; j < localNy; j++) { + for (size_t i = 0; i < localNx; i++) { + REQUIRE(testData(i, j) == mockData(i + j * localNx)); + } + } +} +} diff --git a/core/test/HaloExchange_test.cpp b/core/test/HaloExchange_test.cpp index a442ca1f8..e69de29bb 100644 --- a/core/test/HaloExchange_test.cpp +++ b/core/test/HaloExchange_test.cpp @@ -1,163 +0,0 @@ -/*! - * @file ModelMetadata_test.cpp - * - * @date 19 May 2025 - * @author Tom Meltzer - */ - -#include - -#include "ModelMetadata.hpp" -#include "include/Halo.hpp" - -namespace Nextsim { - -const std::string testFilesDir = TEST_FILES_DIR; -const std::string file_cb = testFilesDir + "/partition_metadata_3_cb.nc"; -const std::string file_pb = testFilesDir + "/partition_metadata_3_pb.nc"; - -// TODO expand test for DG > 1 -static const int DG = 3; -static const bool debug = false; - -void initializeHField(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, - size_t offsetY, int test_rank) -{ - // initialize with mock data - for (size_t j = 0; j < localNy; ++j) { - for (size_t i = 0; i < localNx; ++i) { - data(i + j * localNx) = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); - } - } -} - -TEST_SUITE_BEGIN("Halo exchange tests"); -MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) -{ - // test for a 3 proc grid - // ┌─┬─┐ - // │1│ │ - // ├─┤2│ - // │0│ │ - // └─┴─┘ (proc id) - - ModelMetadata& metadata = ModelMetadata::getInstance(file_cb, test_comm); - - const size_t nx = metadata.globalExtentX; - const size_t ny = metadata.globalExtentY; - const size_t localNx = metadata.localExtentX + 2 * Halo::haloWidth; - const size_t localNy = metadata.localExtentY + 2 * Halo::haloWidth; - const size_t offsetX = metadata.localCornerX; - const size_t offsetY = metadata.localCornerY; - - ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); - ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); - - // create example 2D field on each process - auto testData = ModelArray::HField(); - testData.resize(); - - // create halo for testData model array - Halo halo(testData); - - // create and allocate temporary Eigen array - ModelArray::DataType innerData; - innerData.resize(halo.getInnerSize(), testData.nComponents()); - initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); - - // populate inner block of modelarray - halo.populateInnerBlock(innerData); - // exchange halos - halo.exchangeHalos(); - - std::array, 3> mockDataAllProcs = { - std::vector({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 110, 120, 130, 140, 150, 160, 370, - 0, 101, 111, 121, 131, 141, 151, 161, 371, 0, 102, 112, 122, 132, 142, 152, 162, 372, 0, - 103, 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, 244, 254, 264, 0 }), - std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 0, 204, 214, 224, 234, 244, - 254, 264, 374, 0, 205, 215, 225, 235, 245, 255, 265, 375, 0, 206, 216, 226, 236, 246, - 256, 266, 376, 0, 207, 217, 227, 237, 247, 257, 267, 377, 0, 208, 218, 228, 238, 248, - 258, 268, 378, 0, 0, 0, 0, 0, 0, 0, 0, 0 }), - std::vector({ 0, 0, 0, 0, 0, 160, 370, 380, 390, 0, 161, 371, 381, 391, 0, 162, 372, - 382, 392, 0, 163, 373, 383, 393, 0, 264, 374, 384, 394, 0, 265, 375, 385, 395, 0, 266, - 376, 386, 396, 0, 267, 377, 387, 397, 0, 268, 378, 388, 398, 0, 0, 0, 0, 0, 0 }), - }; - - // create mock eigen matrix for each process - ModelArray::DataType mockData; - mockData.resize(localNx * localNy, 1); - mockData - = Eigen::Map(mockDataAllProcs[test_rank].data(), mockData.size(), 1); - - for (size_t j = 0; j < localNy; j++) { - for (size_t i = 0; i < localNx; i++) { - REQUIRE(testData(i, j) == mockData(i + j * localNx)); - } - } -} -MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditions", 3) -{ - // test for a 3 proc grid - // ┌─┬─┐ - // │1│ │ - // ├─┤2│ - // │0│ │ - // └─┴─┘ (proc id) - - ModelMetadata& metadata = ModelMetadata::getInstance(file_pb, test_comm); - - const size_t nx = metadata.globalExtentX; - const size_t ny = metadata.globalExtentY; - const size_t localNx = metadata.localExtentX + 2 * Halo::haloWidth; - const size_t localNy = metadata.localExtentY + 2 * Halo::haloWidth; - const size_t offsetX = metadata.localCornerX; - const size_t offsetY = metadata.localCornerY; - - ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); - ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); - - // create example 2D field on each process - auto testData = ModelArray::HField(); - testData.resize(); - - // create halo for testData model array - Halo halo(testData); - - // create and allocate temporary Eigen array - ModelArray::DataType innerData; - innerData.resize(halo.getInnerSize(), testData.nComponents()); - initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); - - // populate inner block of modelarray - halo.populateInnerBlock(innerData); - // exchange halos - halo.exchangeHalos(); - - std::array, 3> mockDataAllProcs = { - std::vector({ 0, 208, 218, 228, 238, 248, 258, 268, 0, 390, 100, 110, 120, 130, 140, - 150, 160, 370, 391, 101, 111, 121, 131, 141, 151, 161, 371, 392, 102, 112, 122, 132, - 142, 152, 162, 372, 393, 103, 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, - 244, 254, 264, 0 }), - std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 394, 204, 214, 224, 234, 244, - 254, 264, 374, 395, 205, 215, 225, 235, 245, 255, 265, 375, 396, 206, 216, 226, 236, - 246, 256, 266, 376, 397, 207, 217, 227, 237, 247, 257, 267, 377, 398, 208, 218, 228, - 238, 248, 258, 268, 378, 0, 100, 110, 120, 130, 140, 150, 160, 0 }), - std::vector({ 0, 378, 388, 398, 0, 160, 370, 380, 390, 100, 161, 371, 381, 391, 101, - 162, 372, 382, 392, 102, 163, 373, 383, 393, 103, 264, 374, 384, 394, 204, 265, 375, - 385, 395, 205, 266, 376, 386, 396, 206, 267, 377, 387, 397, 207, 268, 378, 388, 398, - 208, 0, 370, 380, 390, 0 }), - }; - - // create mock eigen matrix for each process - ModelArray::DataType mockData; - mockData.resize(localNx * localNy, 1); - mockData - = Eigen::Map(mockDataAllProcs[test_rank].data(), mockData.size(), 1); - - for (size_t j = 0; j < localNy; j++) { - for (size_t i = 0; i < localNx; i++) { - REQUIRE(testData(i, j) == mockData(i + j * localNx)); - } - } -} -} diff --git a/core/test/ModelMetadataCB_test.cpp b/core/test/ModelMetadataCB_test.cpp new file mode 100644 index 000000000..636833e3b --- /dev/null +++ b/core/test/ModelMetadataCB_test.cpp @@ -0,0 +1,81 @@ +/*! + * @file ModelMetadata_test.cpp + * + * @date 04 Jun 2025 + * @author Tom Meltzer + */ + +#include +#include + +#include "ModelMPI.hpp" +#include "ModelMetadata.hpp" + +const std::string testFilesDir = TEST_FILES_DIR; +const std::string partitionFilenameCB = testFilesDir + "/partition_metadata_3_cb.nc"; + +namespace Nextsim { + +constexpr ModelMetadata::Edge BOTTOM = ModelMetadata::Edge::BOTTOM; +constexpr ModelMetadata::Edge RIGHT = ModelMetadata::Edge::RIGHT; +constexpr ModelMetadata::Edge TOP = ModelMetadata::Edge::TOP; +constexpr ModelMetadata::Edge LEFT = ModelMetadata::Edge::LEFT; + +typedef std::vector vec; + +// these tests are the same for closed boundary conditions (BC) and peridic BC +static void testNonPeriodicBC(int test_rank) +{ + auto& meta = ModelMetadata::getInstance(); + if (test_rank == 0) { + REQUIRE(meta.neighbourRanks[LEFT].size() == 0); + REQUIRE(meta.neighbourRanks[RIGHT] == vec { 2 }); + REQUIRE(meta.neighbourExtents[RIGHT] == vec { 4 }); + REQUIRE(meta.neighbourHaloSend[RIGHT] == vec { 15 }); + REQUIRE(meta.neighbourHaloRecv[RIGHT] == vec { 7 }); + REQUIRE(meta.neighbourRanks[BOTTOM].size() == 0); + REQUIRE(meta.neighbourRanks[TOP] == vec { 1 }); + REQUIRE(meta.neighbourExtents[TOP] == vec { 7 }); + REQUIRE(meta.neighbourHaloSend[TOP] == vec { 0 }); + REQUIRE(meta.neighbourHaloRecv[TOP] == vec { 11 }); + } else if (test_rank == 1) { + REQUIRE(meta.neighbourRanks[LEFT].size() == 0); + REQUIRE(meta.neighbourRanks[RIGHT] == vec { 2 }); + REQUIRE(meta.neighbourExtents[RIGHT] == vec { 5 }); + REQUIRE(meta.neighbourHaloSend[RIGHT] == vec { 19 }); + REQUIRE(meta.neighbourHaloRecv[RIGHT] == vec { 7 }); + REQUIRE(meta.neighbourRanks[BOTTOM] == vec { 0 }); + REQUIRE(meta.neighbourExtents[BOTTOM] == vec { 7 }); + REQUIRE(meta.neighbourHaloSend[BOTTOM] == vec { 11 }); + REQUIRE(meta.neighbourHaloRecv[BOTTOM] == vec { 0 }); + REQUIRE(meta.neighbourRanks[TOP].size() == 0); + } else if (test_rank == 2) { + REQUIRE(meta.neighbourRanks[LEFT] == vec { 0, 1 }); + REQUIRE(meta.neighbourExtents[LEFT] == vec { 4, 5 }); + REQUIRE(meta.neighbourHaloSend[LEFT] == vec { 7, 7 }); + REQUIRE(meta.neighbourHaloRecv[LEFT] == vec { 15, 19 }); + REQUIRE(meta.neighbourRanks[RIGHT].size() == 0); + REQUIRE(meta.neighbourRanks[BOTTOM].size() == 0); + REQUIRE(meta.neighbourRanks[TOP].size() == 0); + } +} + +TEST_SUITE_BEGIN("ModelMetadata"); +MPI_TEST_CASE("Test getPartitionMetadata closed boundary", 3) +{ + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& meta = ModelMetadata::getInstance(partitionFilenameCB); + REQUIRE(modelMPI.getComm() == test_comm); + // this metadata is specific to the non-periodic boundary conditions + testNonPeriodicBC(test_rank); + + // This metadata is specific to the periodic boundary conditions. + // They are all zero because the input metadata file `partitionFilenameCB` does not use periodic + // boundary conditions. + REQUIRE(meta.neighbourRanksPeriodic[LEFT].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[RIGHT].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[BOTTOM].size() == 0); + REQUIRE(meta.neighbourRanksPeriodic[TOP].size() == 0); +} + +} diff --git a/core/test/ModelMetadata_test.cpp b/core/test/ModelMetadataPB_test.cpp similarity index 82% rename from core/test/ModelMetadata_test.cpp rename to core/test/ModelMetadataPB_test.cpp index 975ea20cf..75a190910 100644 --- a/core/test/ModelMetadata_test.cpp +++ b/core/test/ModelMetadataPB_test.cpp @@ -1,17 +1,17 @@ /*! * @file ModelMetadata_test.cpp * - * @date 19 May 2025 + * @date 04 Jun 2025 * @author Tom Meltzer */ #include #include +#include "ModelMPI.hpp" #include "ModelMetadata.hpp" const std::string testFilesDir = TEST_FILES_DIR; -const std::string partitionFilenameCB = testFilesDir + "/partition_metadata_3_cb.nc"; const std::string partitionFilenamePB = testFilesDir + "/partition_metadata_3_pb.nc"; namespace Nextsim { @@ -24,8 +24,9 @@ constexpr ModelMetadata::Edge LEFT = ModelMetadata::Edge::LEFT; typedef std::vector vec; // these tests are the same for closed boundary conditions (BC) and peridic BC -static void testNonPeriodicBC(ModelMetadata& meta, int test_rank) +static void testNonPeriodicBC(int test_rank) { + auto& meta = ModelMetadata::getInstance(); if (test_rank == 0) { REQUIRE(meta.neighbourRanks[LEFT].size() == 0); REQUIRE(meta.neighbourRanks[RIGHT] == vec { 2 }); @@ -60,28 +61,13 @@ static void testNonPeriodicBC(ModelMetadata& meta, int test_rank) } TEST_SUITE_BEGIN("ModelMetadata"); -MPI_TEST_CASE("Test getPartitionMetadata closed boundary", 3) -{ - ModelMetadata& meta = ModelMetadata::getInstance(partitionFilenameCB, test_comm); - REQUIRE(meta.mpiComm == test_comm); - // this metadata is specific to the non-periodic boundary conditions - testNonPeriodicBC(meta, test_rank); - - // This metadata is specific to the periodic boundary conditions. - // They are all zero because the input metadata file `partitionFilenameCB` does not use periodic - // boundary conditions. - REQUIRE(meta.neighbourRanksPeriodic[LEFT].size() == 0); - REQUIRE(meta.neighbourRanksPeriodic[RIGHT].size() == 0); - REQUIRE(meta.neighbourRanksPeriodic[BOTTOM].size() == 0); - REQUIRE(meta.neighbourRanksPeriodic[TOP].size() == 0); -} - MPI_TEST_CASE("Test getPartitionMetadata periodic boundary", 3) { - ModelMetadata& meta = ModelMetadata::getInstance(partitionFilenamePB, test_comm); - REQUIRE(meta.mpiComm == test_comm); + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& meta = ModelMetadata::getInstance(partitionFilenamePB); + REQUIRE(modelMPI.getComm() == test_comm); // this metadata should be identical to the Closed Boundary version so we check it again - testNonPeriodicBC(meta, test_rank); + testNonPeriodicBC(test_rank); // this metadata is specific to the periodic boundary conditions if (test_rank == 0) { diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index 8cab375a7..9f3d80af1 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGrid_test.cpp * - * @date 23 May 2025 + * @date 04 Jun 2025 * @author Tim Spain * @author Tom Meltzer */ @@ -20,6 +20,7 @@ #include "include/ConfiguredModule.hpp" #include "include/Finalizer.hpp" #ifdef USE_MPI +#include "ModelMPI.hpp" #include "include/Halo.hpp" #endif #include "include/IStructure.hpp" @@ -197,9 +198,11 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") {} }; #ifdef USE_MPI - ModelMetadata& metadata = ModelMetadata::getInstance(partitionFilename, test_comm); + auto& modelMPI = ModelMPI::getInstance(test_comm); + // std::cout << "size = " << modelMPI.m_size << std::endl; + auto& metadata = ModelMetadata::getInstance(partitionFilename); #else - ModelMetadata& metadata = ModelMetadata::getInstance(); + auto& metadata = ModelMetadata::getInstance(); #endif metadata.setTime(TimePoint("2000-01-01T00:00:00Z")); @@ -207,7 +210,7 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") // coordinates is the correct way to add coordinates to a ModelState metadata.extractCoordinates(coordState); metadata.affixCoordinates(state); - grid.dumpModelState(state, metadata, filename, true); + grid.dumpModelState(state, filename, true); REQUIRE(std::filesystem::exists(std::filesystem::path(filename))); @@ -231,11 +234,7 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") ParaGridIO* readIO = new ParaGridIO(gridIn); gridIn.setIO(readIO); -#ifdef USE_MPI - ModelState ms = gridIn.getModelState(filename, metadata); -#else ModelState ms = gridIn.getModelState(filename); -#endif REQUIRE(ms.data.size() == state.data.size()); @@ -374,7 +373,10 @@ TEST_CASE("Write a diagnostic ParaGrid file") }, {} }; - ModelMetadata& metadata = ModelMetadata::getInstance(); +#ifdef USE_MPI + auto& modelMPI = ModelMPI::getInstance(); +#endif + auto& metadata = ModelMetadata::getInstance(); metadata.setTime(TimePoint("2000-01-01T00:00:00Z")); // The coordinates are passed through the metadata object as affix // coordinates is the correct way to add coordinates to a ModelState @@ -395,7 +397,7 @@ TEST_CASE("Write a diagnostic ParaGrid file") {} }; metadata.incrementTime(Duration(3600)); - grid.dumpModelState(state, metadata, diagFile, false); + grid.dumpModelState(state, diagFile, false); } pio->close(diagFile); @@ -499,11 +501,10 @@ TEST_CASE("Check an exception is thrown for an invalid file name") // MD5 hash of the current output of $ date std::string longRandomFilename("a44f5cc1f7934a8ae8dd03a95308745d.nc"); #ifdef USE_MPI - ModelMetadata& metadataIn = ModelMetadata::getInstance(); - REQUIRE_THROWS(state = gridIn.getModelState(longRandomFilename, metadataIn)); -#else - REQUIRE_THROWS(state = gridIn.getModelState(longRandomFilename)); + auto& modelMPI = ModelMPI::getInstance(); + auto& metadataIn = ModelMetadata::getInstance(); #endif + REQUIRE_THROWS(state = gridIn.getModelState(longRandomFilename)); Finalizer::finalize(); } @@ -543,20 +544,16 @@ TEST_CASE("Check if a file with the old dimension names can be read") // In the full model numbers of DG components are set at compile time, so they are not reset REQUIRE(ModelArray::nComponents(ModelArray::Type::DG) == DG); REQUIRE(ModelArray::nComponents(ModelArray::Type::VERTEX) == ModelArray::nCoords); - -#ifdef USE_MPI - ModelMetadata& metadata = ModelMetadata::getInstance(); - ModelState ms = gridIn.getModelState(inputFilename, metadata); -#else ModelState ms = gridIn.getModelState(inputFilename); -#endif - auto localNX = metadata.localExtentX; #ifdef USE_MPI + auto& modelMPI = ModelMPI::getInstance(); + auto& metadata = ModelMetadata::getInstance(); + auto localNX = metadata.getLocalExtentX(); REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[0] == localNX + 2 * Halo::haloWidth); REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[1] == ny + 2 * Halo::haloWidth); #else - REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[0] == localNX); + REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[0] == nx); REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[1] == ny); #endif @@ -564,5 +561,4 @@ TEST_CASE("Check if a file with the old dimension names can be read") } TEST_SUITE_END(); - } diff --git a/core/test/PrognosticDataIO_test.cpp b/core/test/PrognosticDataIO_test.cpp index f6dbd31f7..57038639a 100644 --- a/core/test/PrognosticDataIO_test.cpp +++ b/core/test/PrognosticDataIO_test.cpp @@ -1,7 +1,7 @@ /*! * @file PrognosticData_test.cpp * - * @date 24 Sep 2024 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -121,11 +121,11 @@ TEST_CASE("PrognosticData write test, including DG components") PrognosticData pData; pData.configure(); pData.setData(inData); - ModelMetadata meta; + auto& meta = ModelMetadata::getInstance(); meta.setTime(TimePoint("2010-01-01T00:00:00Z")); meta.extractCoordinates(state); // Do the write - pData.writeRestartFile(filename, meta); + pData.writeRestartFile(filename); // Read the data back ModelState readState = StructureFactory::stateFromFile(filename); diff --git a/core/test/PrognosticData_test.cpp b/core/test/PrognosticData_test.cpp index 6841af03a..473902948 100644 --- a/core/test/PrognosticData_test.cpp +++ b/core/test/PrognosticData_test.cpp @@ -1,7 +1,7 @@ /*! * @file PrognosticData_test.cpp * - * @date 7 Sep 2023 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -16,14 +16,14 @@ #include "include/UnescoFreezing.hpp" #include "include/constants.hpp" -#include #include +#include extern template class Module::Module; namespace Nextsim { -void PrognosticData::writeRestartFile(const std::string& filePath, const ModelMetadata&) const { } +void PrognosticData::writeRestartFile(const std::string& filePath) const { } TEST_SUITE_BEGIN("PrognosticData"); TEST_CASE("PrognosticData call order test") diff --git a/core/test/RectGrid_test.cpp b/core/test/RectGrid_test.cpp index 3fa4d770f..f9535331f 100644 --- a/core/test/RectGrid_test.cpp +++ b/core/test/RectGrid_test.cpp @@ -1,7 +1,7 @@ /*! * @file RectGrid_test.cpp * - * @date 19 May 2025 + * @date 04 Jun 2025 * @author Tim Spain */ @@ -15,6 +15,7 @@ #include "include/CommonRestartMetadata.hpp" #include "include/IStructure.hpp" +#include "include/ModelMPI.hpp" #include "include/RectGridIO.hpp" #include "include/RectangularGrid.hpp" #include "include/gridNames.hpp" @@ -33,7 +34,6 @@ const std::string date_string = "2000-01-01T00:00:00Z"; namespace Nextsim { TEST_SUITE_BEGIN("RectGrid"); #ifdef USE_MPI -// Number of ranks should not be hardcoded here MPI_TEST_CASE("Write and read a ModelState-based RectGrid restart file", 3) #else TEST_CASE("Write and read a ModelState-based RectGrid restart file") @@ -48,16 +48,51 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") double yFactor = 0.01; double xFactor = 0.0001; - // Create data for reference file - ModelArray::setDimensions(ModelArray::Type::H, { nx, ny }); +#ifdef USE_MPI + if (test_rank == 0) { + ModelArray::setDimension(ModelArray::Dimension::X, nx, 3, 0); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, 3, 0); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 4, 0); + ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, 4, 0); + } + if (test_rank == 1) { + ModelArray::setDimension(ModelArray::Dimension::X, nx, 3, 0); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, 4, 3); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 4, 0); + ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, 5, 3); + } + if (test_rank == 2) { + ModelArray::setDimension(ModelArray::Dimension::X, nx, 2, 3); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, ny, 0); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 2 + 1, 3); + ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, ny + 1, 0); + } +#else + ModelArray::setDimension(ModelArray::Dimension::X, nx); + ModelArray::setDimension(ModelArray::Dimension::Y, ny); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1); + ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1); +#endif + // Create data for reference file HField fractional(ModelArray::Type::H); HField mask(ModelArray::Type::H); - for (int j = 0; j < ny; ++j) { - for (int i = 0; i < nx; ++i) { - fractional(i, j) = j * yFactor + i * xFactor; - mask(i, j) - = (i - nx / 2) * (i - nx / 2) + (j - ny / 2) * (j - ny / 2) > (nx * ny) ? 0 : 1; + fractional.resize(); + mask.resize(); + auto dimX = ModelArray::Dimension::X; + auto startX = ModelArray::definedDimensions.at(dimX).start; + auto localNX = ModelArray::definedDimensions.at(dimX).localLength; + auto dimY = ModelArray::Dimension::Y; + auto startY = ModelArray::definedDimensions.at(dimY).start; + auto localNY = ModelArray::definedDimensions.at(dimY).localLength; + for (size_t j = 0; j < localNY; ++j) { + for (size_t i = 0; i < localNX; ++i) { + fractional(i, j) = (j + startY) * yFactor + (i + startX) * xFactor; + mask(i, j) = ((i + startX) - nx / 2) * ((i + startX) - nx / 2) + + ((j + startY) - ny / 2) * ((j + startY) - ny / 2) + > (nx * ny) + ? 0 + : 1; } } @@ -80,7 +115,12 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") }, {} }; - ModelMetadata& metadata = ModelMetadata::getInstance(); +#ifdef USE_MPI + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance(partition_filename); +#else + auto& metadata = ModelMetadata::getInstance(); +#endif metadata.setTime(TimePoint(date_string)); // Use x & y coordinates ModelArray x(ModelArray::Type::H); @@ -88,10 +128,10 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") // Use an anisotropic grid so we can differentiate the dimensions. double dx = 25.; double dy = 35.; - for (int j = 0; j < ny; ++j) { - double yy = j * dy; - for (int i = 0; i < nx; ++i) { - double xx = i * dx; + for (size_t j = 0; j < localNY; ++j) { + double yy = (j + startY) * dy; + for (size_t i = 0; i < localNX; ++i) { + double xx = (i + startX) * dx; x(i, j) = xx; y(i, j) = yy; } @@ -105,34 +145,7 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") metadata.extractCoordinates(coordState); // Then immediately extract them to the output state metadata.affixCoordinates(state); - -// Write reference file -#ifdef USE_MPI - // Create subcommunicator with only first rank - metadata.setMpiMetadata(test_comm); - int colour = MPI_UNDEFINED, key = 0; - MPI_Comm rank0Comm; - - if (metadata.mpiMyRank == 0) { - colour = 0; - } - MPI_Comm_split(test_comm, colour, key, &rank0Comm); - - // Write reference file serially on first MPI rank - if (metadata.mpiMyRank == 0) { - metadata.setMpiMetadata(rank0Comm); - metadata.globalExtentX = nx; - metadata.globalExtentY = ny; - metadata.localCornerX = 0; - metadata.localCornerY = 0; - metadata.localExtentX = nx; - metadata.localExtentY = ny; - grid.dumpModelState(state, metadata, filename); - MPI_Comm_free(&rank0Comm); - } -#else - grid.dumpModelState(state, metadata, filename); -#endif + grid.dumpModelState(state, filename); // Reset dimensions so it is possible to check if they // are read correctly from refeence file @@ -145,24 +158,21 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") // Read reference file gridIn.setIO(new RectGridIO(grid)); #ifdef USE_MPI - ModelMetadata& metadataIn = ModelMetadata::getInstance(partition_filename, test_comm); - metadataIn.setTime(TimePoint(date_string)); - ModelState ms = gridIn.getModelState(filename, metadataIn); -#else - ModelState ms = gridIn.getModelState(filename); + metadata.setTime(TimePoint(date_string)); #endif + ModelState ms = gridIn.getModelState(filename); // Check if dimensions and data from reference file are correct #ifdef USE_MPI - REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[0] == metadataIn.localExtentX); - REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[1] == metadataIn.localExtentY); + REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[0] == metadata.getLocalExtentX()); + REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[1] == metadata.getLocalExtentY()); #else REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[0] == nx); REQUIRE(ModelArray::dimensions(ModelArray::Type::H)[1] == ny); #endif #ifdef USE_MPI REQUIRE(ms.data.at("hice")(targetX, targetY) - == 1.0201 + metadataIn.localCornerY * yFactor + metadataIn.localCornerX * xFactor); + == 1.0201 + metadata.getLocalCornerY() * yFactor + metadata.getLocalCornerX() * xFactor); #else REQUIRE(ms.data.at("hice")(targetX, targetY) == 1.0201); #endif @@ -171,7 +181,7 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") #ifdef USE_MPI REQUIRE(ticeIn(targetX, targetY, 0U) - == -1.0201 - metadataIn.localCornerY * yFactor - metadataIn.localCornerX * xFactor); + == -1.0201 - metadata.getLocalCornerY() * yFactor - metadata.getLocalCornerX() * xFactor); #else REQUIRE(ticeIn(targetX, targetY) == -1.0201); #endif @@ -180,9 +190,9 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") REQUIRE(ms.data.count(xName) > 0); REQUIRE(ms.data.count(yName) > 0); #ifdef USE_MPI - REQUIRE(ms.data.at(xName)(1, 0) == dx * (metadataIn.localCornerX + 1)); - REQUIRE(ms.data.at(xName)(0, 1) == dx * metadataIn.localCornerX); - REQUIRE(ms.data.at(yName)(0, 1) == dy * (metadataIn.localCornerY + 1)); + REQUIRE(ms.data.at(xName)(1, 0) == dx * (metadata.getLocalCornerX() + 1)); + REQUIRE(ms.data.at(xName)(0, 1) == dx * metadata.getLocalCornerX()); + REQUIRE(ms.data.at(yName)(0, 1) == dy * (metadata.getLocalCornerY() + 1)); #else REQUIRE(ms.data.at(xName)(1, 0) == dx); REQUIRE(ms.data.at(xName)(0, 1) == 0); @@ -191,7 +201,7 @@ TEST_CASE("Write and read a ModelState-based RectGrid restart file") // Write file in parallel so it can be compared with one written serially #ifdef USE_MPI - gridIn.dumpModelState(ms, metadataIn, filename_parallel); + gridIn.dumpModelState(ms, filename_parallel); #endif std::remove(filename.c_str()); diff --git a/core/test/XiosRead_test.cpp b/core/test/XiosRead_test.cpp index ef300755f..a9ca8946a 100644 --- a/core/test/XiosRead_test.cpp +++ b/core/test/XiosRead_test.cpp @@ -1,7 +1,7 @@ /*! * @file XiosRead_test.cpp * @author Joe Wallwork - * @date 07 May 2025 + * @date 04 Jun 2025 * @brief Tests for XIOS read functionality * @details * This test is designed to test the file reading functionality of the C++ @@ -13,6 +13,7 @@ #include "StructureModule/include/ParametricGrid.hpp" #include "include/Finalizer.hpp" +#include "include/ModelMPI.hpp" #include "include/ModelMetadata.hpp" #include "include/NextsimModule.hpp" #include "include/ParaGridIO.hpp" @@ -20,6 +21,9 @@ #include +const std::string testFilesDir = TEST_FILES_DIR; +const std::string partitionFilename = testFilesDir + "/partition_metadata_2.nc"; + namespace Nextsim { /*! @@ -104,7 +108,8 @@ MPI_TEST_CASE("TestXiosRead", 2) REQUIRE(std::filesystem::exists("xios_test_input.nc")); // Create ModelMetadata instance - ModelMetadata metadata; + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance(partitionFilename); metadata.setTime(xiosHandler.getCalendarStart()); // Simulate 4 iterations (timesteps) diff --git a/core/test/XiosWrite_test.cpp b/core/test/XiosWrite_test.cpp index ff926f567..f9fdfe330 100644 --- a/core/test/XiosWrite_test.cpp +++ b/core/test/XiosWrite_test.cpp @@ -1,7 +1,7 @@ /*! * @file XiosWrite_test.cpp * @author Joe Wallwork - * @date 07 May 2025 + * @date 04 Jun 2025 * @brief Tests for XIOS write functionality * @details * This test is designed to test the file writing functionality of the C++ @@ -13,6 +13,7 @@ #include "StructureModule/include/ParametricGrid.hpp" #include "include/Finalizer.hpp" +#include "include/ModelMPI.hpp" #include "include/ModelMetadata.hpp" #include "include/NextsimModule.hpp" #include "include/ParaGridIO.hpp" @@ -20,6 +21,9 @@ #include +const std::string testFilesDir = TEST_FILES_DIR; +const std::string partitionFilename = testFilesDir + "/partition_metadata_2.nc"; + namespace Nextsim { /*! @@ -109,7 +113,8 @@ MPI_TEST_CASE("TestXiosWrite", 2) REQUIRE_FALSE(std::filesystem::exists("xios_test_output*.nc")); // Create ModelMetadata instance - ModelMetadata metadata; + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance(partitionFilename); metadata.setTime(xiosHandler.getCalendarStart()); // Simulate 4 iterations (timesteps) From da75bddb06eea8749a46ebe1175c53a09cba8830 Mon Sep 17 00:00:00 2001 From: tommelt Date: Wed, 4 Jun 2025 11:48:52 +0100 Subject: [PATCH 13/53] chore: remove unused code --- core/src/include/Halo.hpp | 2 -- core/src/include/ModelArraySlice.hpp | 23 ++--------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index c2a4d774d..8bc3e0ee0 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -151,11 +151,9 @@ class Halo { if (m_ma.getType() == ModelArray::Type::VERTEX) { // because vertex points lie along the domain boundaries we need offset the // slices by and additional row/column - // m_ma[m_innerSlicesVertexAdjusted.at(edge)].copyToBuffer(send[i], offset); tempBuffer(Eigen::seqN(beg, num), Eigen::all) = static_cast(m_ma[m_innerSlicesVertexAdjusted.at(edge)]); } else { - // m_ma[m_innerSlices.at(edge)].copyToBuffer(send[i], offset); tempBuffer(Eigen::seqN(beg, num), Eigen::all) = static_cast(m_ma[m_innerSlices.at(edge)]); } diff --git a/core/src/include/ModelArraySlice.hpp b/core/src/include/ModelArraySlice.hpp index 0f7a49028..716863422 100644 --- a/core/src/include/ModelArraySlice.hpp +++ b/core/src/include/ModelArraySlice.hpp @@ -189,14 +189,13 @@ class ModelArraySlice { * @param buffer The target of the copying. The buffer type must provide a forward operator. * The buffer object must provide at least as many elements as exist in the * slice. - * @param startIndex Starting index in the target buffer where data will be copied. * @return A reference to the updated buffer object. */ - template T& copyToBuffer(T& buffer, size_t startIndex = 0) + template T& copyToBuffer(T& buffer) { // make no especial attempt at efficiency here SliceIter thisIter(slice, data.dimensions()); - auto biter = std::next(buffer.begin(), startIndex); + auto biter = buffer.begin(); while (!thisIter.isEnd()) { // If the buffer ends before the slice, throw an exception @@ -209,24 +208,6 @@ class ModelArraySlice { } return buffer; } - /*! - */ - template void copyFromBuffer(T& buffer, size_t startIndex = 0) - { - // make no especial attempt at efficiency here - SliceIter thisIter(slice, data.dimensions()); - auto biter = std::next(buffer.begin(), startIndex); - - while (!thisIter.isEnd()) { - // If the buffer ends before the slice, throw an exception - if (biter == buffer.end()) { - throw std::length_error("ModelArraySlice::copyToBuffer(T): buffer exhausted"); - } - data[thisIter.index()] = *biter; - ++thisIter; - ++biter; - } - } private: // Copies data between any two objects which accept indexing by the Eigen seqN function. This From d841540f898820a838dc4a3ebfd1f9ff82b2e57a Mon Sep 17 00:00:00 2001 From: tommelt Date: Tue, 10 Jun 2025 10:59:45 +0100 Subject: [PATCH 14/53] feat: only write inner block to disk --- core/src/ParaGridIO.cpp | 99 ++++++++++++++++++++++++++++++++------- core/src/include/Halo.hpp | 21 ++++++++- 2 files changed, 100 insertions(+), 20 deletions(-) diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index b73531c94..6c68bc4f2 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGridIO.cpp * - * @date 04 Jun 2025 + * @date 10 Jun 2025 * @author Tim Spain */ @@ -209,7 +209,7 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) // populate temp Eigen array with data from netCDF file var.getVar(start, count, tempData.data()); // populate inner block of modelarray with data from tempData - halo.populateInnerBlock(tempData); + halo.setInnerBlock(tempData); halo.exchangeHalos(); #else var.getVar(start, count, &data[0]); @@ -253,17 +253,29 @@ ModelState ParaGridIO::readForcingTimeStatic( --targetTIndex; // ASSUME all forcings are HFields: finite volume fields on the same // grid as ice thickness - std::vector indexArray = { targetTIndex }; - std::vector extentArray = { 1 }; + std::vector indexArray; + std::vector extentArray; // Loop over the dimensions of H - const std::vector& dimensions - = ModelArray::typeDimensions.at(ModelArray::Type::H); - for (auto riter = dimensions.rbegin(); riter != dimensions.rend(); ++riter) { + using Dim = ModelArray::Dimension; + for (Dim dt : ModelArray::typeDimensions.at(ModelArray::Type::H)) { + auto dim = ModelArray::definedDimensions.at(dt); + auto startIndex = dim.start; + auto localLength = dim.localLength; +#ifdef USE_MPI + if (dt == Dim::X or dt == Dim::Y) { + localLength = localLength - 2 * Halo::haloWidth; + } +#endif indexArray.push_back(0); - extentArray.push_back(ModelArray::definedDimensions.at(*riter).localLength); + extentArray.push_back(localLength); } + indexArray.push_back(targetTIndex); + extentArray.push_back(1); + std::reverse(indexArray.begin(), indexArray.end()); + std::reverse(extentArray.begin(), extentArray.end()); + auto availableForcings = dataGroup.getVars(); for (const std::string& varName : forcings) { // Don't try to read non-existent data @@ -275,7 +287,19 @@ ModelState ParaGridIO::readForcingTimeStatic( ModelArray& data = state.data.at(varName); data.resize(); +#ifdef USE_MPI + Halo halo(data); + // create and allocate temporary Eigen array + ModelArray::DataType tempData; + tempData.resize(halo.getInnerSize(), data.nComponents()); + // populate temp Eigen array with data from netCDF file + var.getVar(indexArray, extentArray, tempData.data()); + // populate inner block of modelarray with data from tempData + halo.setInnerBlock(tempData); + halo.exchangeHalos(); +#else var.getVar(indexArray, extentArray, &data[0]); +#endif } ncFile.close(); } catch (const netCDF::exceptions::NcException& nce) { @@ -329,7 +353,8 @@ void ParaGridIO::dumpModelState(const ModelState& state, const std::string& file dimMap.at(entry.second).push_back(ncFromMAMap.at(entry.first)); } - // Assume that all fields in the supplied ModelState are necessary, and so write them to file. + // Assume that all fields in the supplied ModelState are necessary, and so write them to + // file. for (auto entry : state.data) { // Get the type, then relevant vector of NetCDF dimensions ModelArray::Type type = entry.second.getType(); @@ -340,10 +365,19 @@ void ParaGridIO::dumpModelState(const ModelState& state, const std::string& file start.push_back(0); count.push_back(ncomps); } + using Dim = ModelArray::Dimension; for (ModelArray::Dimension dt : entry.second.typeDimensions.at(type)) { auto dim = entry.second.definedDimensions.at(dt); + size_t localLength = dim.localLength; +#ifdef USE_MPI + if (dt == Dim::X or dt == Dim::XVERTEX) { + localLength = localLength - 2 * Halo::haloWidth; + } else if (dt == Dim::Y or dt == Dim::YVERTEX) { + localLength = localLength - 2 * Halo::haloWidth; + } +#endif start.push_back(dim.start); - count.push_back(dim.localLength); + count.push_back(localLength); } // dims are looped in [dg], x, y, [z] order so start and count // order must be reveresed to match order netcdf expects @@ -353,7 +387,15 @@ void ParaGridIO::dumpModelState(const ModelState& state, const std::string& file std::vector& ncDims = dimMap.at(type); netCDF::NcVar var(dataGroup.addVar(entry.first, netCDF::ncDouble, ncDims)); var.putAtt(mdiName, netCDF::ncDouble, MissingData::value()); + +#ifdef USE_MPI + Halo halo(entry.second); + ModelArray::DataType tempData; + halo.getInnerBlock(tempData); + var.putVar(start, count, tempData.data()); +#else var.putVar(start, count, entry.second.getData()); +#endif } ncFile.close(); @@ -429,11 +471,18 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& start.push_back(0); count.push_back(ncomps); } + using Dim = ModelArray::Dimension; for (auto dt : entry.second) { auto dim = ModelArray::definedDimensions.at(dt); + auto localLength = dim.localLength; +#ifdef USE_MPI + if (dt == Dim::X or dt == Dim::Y) { + localLength = localLength - 2 * Halo::haloWidth; + } +#endif ncDims.push_back(ncFromMAMap.at(dt)); start.push_back(dim.start); - count.push_back(dim.localLength); + count.push_back(localLength); } // Deal with VERTEX in each case @@ -465,11 +514,15 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& maskDims.push_back(ncFromMAMap.at(maDim)); } maskIndexes = { 0, 0 }; - maskExtents = { ModelArray::definedDimensions - .at(ModelArray::typeDimensions.at(ModelArray::Type::H)[0]) - .localLength, - ModelArray::definedDimensions.at(ModelArray::typeDimensions.at(ModelArray::Type::H)[1]) - .localLength }; + for (auto dt : ModelArray::typeDimensions.at(ModelArray::Type::H)) { + auto dim = ModelArray::definedDimensions.at(dt); + auto localLength = dim.localLength; +#ifdef USE_MPI + localLength = localLength - 2 * Halo::haloWidth; +#endif + maskIndexes.push_back(0); + maskExtents.push_back(localLength); + } } // Put the time axis variable @@ -495,8 +548,13 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& // No missing data #ifdef USE_MPI netCDF::setVariableCollective(var, dataGroup); -#endif + Halo halo(entry.second); + ModelArray::DataType tempData; + halo.getInnerBlock(tempData); + var.putVar(maskIndexes, maskExtents, tempData.data()); +#else var.putVar(maskIndexes, maskExtents, entry.second.getData()); +#endif } else { std::vector& ncDims = dimMap.at(type); @@ -507,8 +565,13 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& var.putAtt(mdiName, netCDF::ncDouble, MissingData::value()); #ifdef USE_MPI netCDF::setVariableCollective(var, dataGroup); -#endif + Halo halo(entry.second); + ModelArray::DataType tempData; + halo.getInnerBlock(tempData); + var.putVar(startMap.at(type), countMap.at(type), tempData.data()); +#else var.putVar(startMap.at(type), countMap.at(type), entry.second.getData()); +#endif } } } diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index 8bc3e0ee0..c3d83db23 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -1,7 +1,7 @@ /*! * @file Halo.hpp * - * @date 04 Jun 2025 + * @date 10 Jun 2025 * @author Tom Meltzer */ @@ -259,7 +259,7 @@ class Halo { * * @params ma ModelArray which we intend to update across MPI ranks */ - void populateInnerBlock(ModelArray::DataType& tempData) + void setInnerBlock(ModelArray::DataType& tempData) { ArraySlicer::Slice::VBounds innerBlock, allBlock; innerBlock = { { 1, -1 }, { 1, -1 } }; @@ -272,6 +272,23 @@ class Halo { m_ma[innerBlock].copyFromSlicedBuffer(tempData, wholeBlock); } + /*! + * @brief Get inner block of ModelArray from tempData + * + * @params ma ModelArray which we intend to update across MPI ranks + */ + void getInnerBlock(ModelArray::DataType& tempData) + { + tempData.resize(m_innerNx * m_innerNy, m_numComps); + ArraySlicer::Slice::VBounds innerBlock, allBlock; + innerBlock = { { 1, -1 }, { 1, -1 } }; + allBlock = { {}, {} }; + ArraySlicer::SliceIter wholeBlock(allBlock, m_ma.innerDimensions()); + + // copy temp data to the central block of the main modelarray + m_ma[innerBlock].copyToSlicedBuffer(tempData, wholeBlock); + } + /*! * @brief Update a ModelArray with data from * From e57ce150b4cff877c6467dcd2e92a0c837df8abb Mon Sep 17 00:00:00 2001 From: tommelt Date: Tue, 10 Jun 2025 11:00:32 +0100 Subject: [PATCH 15/53] test: update halo tests --- core/test/HaloExchangeCB_test.cpp | 4 ++-- core/test/HaloExchangePB_test.cpp | 4 ++-- core/test/HaloExchange_test.cpp | 0 3 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 core/test/HaloExchange_test.cpp diff --git a/core/test/HaloExchangeCB_test.cpp b/core/test/HaloExchangeCB_test.cpp index ac5e0848c..b0567904f 100644 --- a/core/test/HaloExchangeCB_test.cpp +++ b/core/test/HaloExchangeCB_test.cpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata_test.cpp * - * @date 04 Jun 2025 + * @date 10 Jun 2025 * @author Tom Meltzer */ @@ -66,7 +66,7 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); // populate inner block of modelarray - halo.populateInnerBlock(innerData); + halo.setInnerBlock(innerData); // exchange halos halo.exchangeHalos(); diff --git a/core/test/HaloExchangePB_test.cpp b/core/test/HaloExchangePB_test.cpp index e7f7f991e..b0a505bd9 100644 --- a/core/test/HaloExchangePB_test.cpp +++ b/core/test/HaloExchangePB_test.cpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata_test.cpp * - * @date 04 Jun 2025 + * @date 10 Jun 2025 * @author Tom Meltzer */ @@ -66,7 +66,7 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditio initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); // populate inner block of modelarray - halo.populateInnerBlock(innerData); + halo.setInnerBlock(innerData); // exchange halos halo.exchangeHalos(); diff --git a/core/test/HaloExchange_test.cpp b/core/test/HaloExchange_test.cpp deleted file mode 100644 index e69de29bb..000000000 From baea9628660663292cf571fb7e2d31441e6aa2cb Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 16 Jun 2025 10:35:24 +0100 Subject: [PATCH 16/53] bug: forcing data is now offset correctly --- core/src/ParaGridIO.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index 6c68bc4f2..c796d52f8 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGridIO.cpp * - * @date 10 Jun 2025 + * @date 16 Jun 2025 * @author Tim Spain */ @@ -267,7 +267,7 @@ ModelState ParaGridIO::readForcingTimeStatic( localLength = localLength - 2 * Halo::haloWidth; } #endif - indexArray.push_back(0); + indexArray.push_back(startIndex); extentArray.push_back(localLength); } From 0bbf09aeb8c3f519c9ca32b86c0d6107c1b1ea32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20=C3=96rn=20=C3=93lason?= Date: Fri, 13 Jun 2025 10:32:00 +0200 Subject: [PATCH 17/53] Set all ModelArray values to zero on resize() We're using resize() as a general initialisation call, and setting everything to zero at start is probably a good idea in general. There is a question if we should then rename resize() to something like init(). --- core/src/include/ModelArray.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/include/ModelArray.hpp b/core/src/include/ModelArray.hpp index a0e8de7f0..dcbbf1977 100644 --- a/core/src/include/ModelArray.hpp +++ b/core/src/include/ModelArray.hpp @@ -1,7 +1,7 @@ /*! * @file ModelArray.hpp * - * @date 31 Oct 2024 + * @date 13 Jun 2025 * @author Tim Spain */ @@ -375,10 +375,10 @@ class ModelArray { { if (size() != trueSize()) { if (hasDoF(type)) { - m_data.resize( + m_data.setZero( m_sz.at(type), definedDimensions.at(componentMap.at(type)).localLength); } else { - m_data.resize(m_sz.at(type), Eigen::NoChange); + m_data.setZero(m_sz.at(type), Eigen::NoChange); } } } From 786c157b7431107fbdf7ae766d6bd72a38320e73 Mon Sep 17 00:00:00 2001 From: tommelt Date: Thu, 19 Jun 2025 11:14:11 +0100 Subject: [PATCH 18/53] feat: refactor periodic and non-periodic metadata --- core/src/ModelMetadata.cpp | 122 ++++++++++++----------------- core/src/include/ModelMetadata.hpp | 21 ++--- 2 files changed, 63 insertions(+), 80 deletions(-) diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index 888cf2c46..289efd53a 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata.cpp * - * @date 04 Jun 2025 + * @date 19 Jun 2025 * @author Tim Spain * @author Tom Meltzer */ @@ -17,7 +17,9 @@ #include "include/Xios.hpp" #endif #include "mpi.h" +#include #include +#include #include #ifdef USE_MPI @@ -50,77 +52,57 @@ void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) auto& modelMPI = ModelMPI::getInstance(); auto mpiSize = modelMPI.getSize(); auto mpiMyRank = modelMPI.getRank(); - for (auto edge : edges) { - size_t nStart = 0; // start point in metadata arrays - size_t count = 0; // number of elements to read from metadata arrays - std::vector numNeighbours = std::vector(mpiSize, 0); - std::vector offsets = std::vector(mpiSize, 0); - - // non-periodic neighbours - varName = edgeNames[edge] + "_neighbours"; - neighbourGroup.getVar(varName).getVar( - { 0 }, { static_cast(mpiSize) }, &numNeighbours[0]); - - // compute start index for each process - MPI_Exscan(&numNeighbours[mpiMyRank], &nStart, 1, MPI_INT, MPI_SUM, modelMPI.getComm()); - // how many elements to read for each process - count = numNeighbours[mpiMyRank]; - - if (count) { - // initialize neighbour info to zero and correct size - neighbourRanks[edge].resize(count, 0); - neighbourExtents[edge].resize(count, 0); - neighbourHaloSend[edge].resize(count, 0); - neighbourHaloRecv[edge].resize(count, 0); - - varName = edgeNames[edge] + "_neighbour_ids"; - neighbourGroup.getVar(varName).getVar({ nStart }, { count }, &neighbourRanks[edge][0]); - - varName = edgeNames[edge] + "_neighbour_halos"; - neighbourGroup.getVar(varName).getVar( - { nStart }, { count }, &neighbourExtents[edge][0]); - - varName = edgeNames[edge] + "_neighbour_halo_send"; - neighbourGroup.getVar(varName).getVar( - { nStart }, { count }, &neighbourHaloSend[edge][0]); - - varName = edgeNames[edge] + "_neighbour_halo_recv"; - neighbourGroup.getVar(varName).getVar( - { nStart }, { count }, &neighbourHaloRecv[edge][0]); + enum BoundaryType { nonPeriodic, periodic }; + for (BoundaryType btype : { nonPeriodic, periodic }) { + // Use btype as needed + std::array suffixes = { "_neighbour_ids", "_neighbour_halos", + "_neighbour_halo_send", "_neighbour_halo_recv" }; + if (btype == periodic) { + for (auto& suffix : suffixes) { + suffix += "_periodic"; + } } - - // periodic neighbours - varName = edgeNames[edge] + "_neighbours_periodic"; - neighbourGroup.getVar(varName).getVar( - { 0 }, { static_cast(mpiSize) }, &numNeighbours[0]); - - // compute start index for each process - MPI_Exscan(&numNeighbours[mpiMyRank], &nStart, 1, MPI_INT, MPI_SUM, modelMPI.getComm()); - // how many elements to read for each process - count = numNeighbours[mpiMyRank]; - - if (count) { - // initialize neighbour info to zero and correct size - neighbourRanksPeriodic[edge].resize(count, 0); - neighbourExtentsPeriodic[edge].resize(count, 0); - neighbourHaloSendPeriodic[edge].resize(count, 0); - neighbourHaloRecvPeriodic[edge].resize(count, 0); - - varName = edgeNames[edge] + "_neighbour_ids_periodic"; - neighbourGroup.getVar(varName).getVar( - { nStart }, { count }, &neighbourRanksPeriodic[edge][0]); - - varName = edgeNames[edge] + "_neighbour_halos_periodic"; - neighbourGroup.getVar(varName).getVar( - { nStart }, { count }, &neighbourExtentsPeriodic[edge][0]); - - varName = edgeNames[edge] + "_neighbour_halo_send_periodic"; - neighbourGroup.getVar(varName).getVar( - { nStart }, { count }, &neighbourHaloSendPeriodic[edge][0]); - - varName = edgeNames[edge] + "_neighbour_halo_recv_periodic"; + for (auto edge : edges) { + size_t nStart = 0; // start point in metadata arrays + size_t count = 0; // number of elements to read from metadata arrays + std::vector numNeighbours = std::vector(mpiSize, 0); + std::vector offsets = std::vector(mpiSize, 0); + std::vector>> arrays; + + if (btype == nonPeriodic) { + arrays = { neighbourRanks[edge], neighbourExtents[edge], neighbourHaloSend[edge], + neighbourHaloRecv[edge] }; + } else if (btype == periodic) { + arrays = { neighbourRanksPeriodic[edge], neighbourExtentsPeriodic[edge], + neighbourHaloSendPeriodic[edge], neighbourHaloRecvPeriodic[edge] }; + } + + varName = edgeNames[edge] + "_neighbours"; + if (btype == periodic) { + varName += "_periodic"; + } neighbourGroup.getVar(varName).getVar( - { nStart }, { count }, &neighbourHaloRecvPeriodic[edge][0]); + { 0 }, { static_cast(mpiSize) }, numNeighbours.data()); + + // compute start index for each process + MPI_Exscan(&numNeighbours[mpiMyRank], &nStart, 1, MPI_INT, MPI_SUM, modelMPI.getComm()); + if (mpiMyRank == 0) { + // MPI_Exscan is undefined on the first rank. So to be safe we manually set nStart + // to 0. (see e.g., https://www.open-mpi.org/doc/v4.1/man3/MPI_Exscan.3.php) + nStart = 0; + } + // how many elements to read for each process + count = numNeighbours[mpiMyRank]; + + if (count) { + // initialize neighbour info to zero + for (size_t i = 0; i < arrays.size(); ++i) { + arrays[i].get().resize(count, 0); + varName = edgeNames[edge] + suffixes[i]; + neighbourGroup.getVar(varName).getVar( + { nStart }, { count }, arrays[i].get().data()); + } + } } } } diff --git a/core/src/include/ModelMetadata.hpp b/core/src/include/ModelMetadata.hpp index b61d96ad9..4e30e69de 100644 --- a/core/src/include/ModelMetadata.hpp +++ b/core/src/include/ModelMetadata.hpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata.hpp * - * @date 04 Jun 2025 + * @date 19 Jun 2025 * @author Tim Spain * @author Tom Meltzer */ @@ -154,15 +154,16 @@ class ModelMetadata { // An array to allow the edges to be accessed in the correct order. static constexpr std::array edges = { BOTTOM, RIGHT, TOP, LEFT }; std::array edgeNames = { "bottom", "right", "top", "left" }; - // mpi rank ID and extent for each edge direction - std::array, N_EDGE> neighbourRanks; - std::array, N_EDGE> neighbourExtents; - std::array, N_EDGE> neighbourHaloSend; - std::array, N_EDGE> neighbourHaloRecv; - std::array, N_EDGE> neighbourRanksPeriodic; - std::array, N_EDGE> neighbourExtentsPeriodic; - std::array, N_EDGE> neighbourHaloSendPeriodic; - std::array, N_EDGE> neighbourHaloRecvPeriodic; + + typedef std::array, N_EDGE> neighbourArray; + neighbourArray neighbourRanks; + neighbourArray neighbourExtents; + neighbourArray neighbourHaloSend; + neighbourArray neighbourHaloRecv; + neighbourArray neighbourRanksPeriodic; + neighbourArray neighbourExtentsPeriodic; + neighbourArray neighbourHaloSendPeriodic; + neighbourArray neighbourHaloRecvPeriodic; #endif private: From 6ae20c8562385dfa71eef971011c4141b6333a94 Mon Sep 17 00:00:00 2001 From: tommelt Date: Tue, 15 Jul 2025 19:06:13 +0100 Subject: [PATCH 19/53] wip: initial working impl of eigenSlice still writing proper test --- core/src/include/EigenSlice.hpp | 130 ++++++++++++++++++++++ core/src/include/ModelArray.hpp | 4 +- core/src/include/ModelArraySlice.hpp | 4 +- core/test/CMakeLists.txt | 18 +++ core/test/EigenSliceCB_test.cpp | 158 +++++++++++++++++++++++++++ dynamics/src/include/dgVector.hpp | 6 +- 6 files changed, 317 insertions(+), 3 deletions(-) create mode 100644 core/src/include/EigenSlice.hpp create mode 100644 core/test/EigenSliceCB_test.cpp diff --git a/core/src/include/EigenSlice.hpp b/core/src/include/EigenSlice.hpp new file mode 100644 index 000000000..e3f85798c --- /dev/null +++ b/core/src/include/EigenSlice.hpp @@ -0,0 +1,130 @@ +/*! + * @file EigenSlice.hpp + * + * @date 15 Jul 2025 + * @author Tom Meltzer + */ + +#ifndef EIGENSLICE_HPP +#define EIGENSLICE_HPP + +#include "include/ModelArray.hpp" +#include "include/ModelArraySlice.hpp" +#include "include/Slice.hpp" +#include "include/dgVector.hpp" +#include +#include +#include + +#ifndef DGCOMP +#define DGCOMP 3 +#endif + +using Slice = ArraySlicer::Slice; +using SliceIter = ArraySlicer::SliceIter; + +namespace Nextsim { + +/** + * @class EigenSlice + * @brief Provides a view and slicing operations for Eigen-based data structures. + * + * This class enables slicing and manipulation of Eigen matrix-like or array-like objects, + * such as those used in DGVector and ModelArray. It supports copying between slices, + * printing reshaped data, and provides an interface for working with multi-dimensional + * data in a flexible way. + * + * @tparam Derived The Eigen type derived from Eigen::DenseBase. + * + * @note The class is designed to work with both matrix-like and array-like Eigen objects, + * depending on the instantiation. + */ +template class EigenSlice { +private: + // Depending on instatiation this can either be + // * matrix-like object for DGVector + // * array-like object for ModelArray + Eigen::DenseBase& data; + + Slice slice; + using MultiDim = std::vector; + + // spatial dimensions and DoF + const MultiDim dimensions; + +public: + explicit EigenSlice(ModelArray& ma, const Slice& sl) + : data(ma.m_data) + , dimensions({ ma.dimensions()[0], ma.dimensions()[1], ma.nComponents() }) + , slice(sl) + { + } + + explicit EigenSlice(DGVector& dgv, const Slice& sl, const ParametricMesh& smesh) + : data(dgv) + , dimensions({ smesh.nx, smesh.ny, DGCOMP }) + , slice(sl) + { + } + + /*! + * @brief Copies data from EigenSlice to target buffer + * + * @param target The target buffer + * @return A reference to the original EigenSlice object. + */ + template const EigenSlice& copyToSlicedBuffer(EigenSlice& target) const + { + SliceIter iter(slice, dimensions); + SliceIter targetIter(target.slice, target.dimensions); + + ModelArraySlice::copySliceWithIters(data, iter, target.data, targetIter); + // Return this, even though it is unchanged. The code looks weird if + // the return value is the target buffer. + return *this; + } + + /*! + * @brief Copies data to EigenSlice from source buffer + * + * @param source The source buffer + * @return A reference to the updated EigenSlice object. + */ + template EigenSlice& copyFromSlicedBuffer(const EigenSlice& source) + { + SliceIter iter(slice, dimensions); + SliceIter sourceIter(source.slice, source.dimensions); + + ModelArraySlice::copySliceWithIters(source.data, sourceIter, data, iter); + return *this; + } + + /** + * @brief Prints each column of the data as a reshaped 2D matrix. + * + * Iterates over all columns of the internal Eigen data object, reshaping each column + * into a matrix of size (dimX, dimY) as specified by the dimensions member. + * Each reshaped column is printed to the standard output, prefixed by its DG element index. + */ + void print() + { + // Assuming data is a 2D Eigen object and dimensions = { rows, cols } + size_t dimX = dimensions[0]; + size_t dimY = dimensions[1]; + + // Reshape and print each column + for (size_t col = 0; col < data.cols(); col++) { + std::cout << "DG element " << col << std::endl; + std::cout << data.col(col).reshaped(dimX, dimY) << std::endl; + } + } + +private: + // We need to add different Templated versions explicitly as friend + // to allow access to private variables, as intended. + template friend class EigenSlice; +}; + +} // namespace Nextsim + +#endif /* EIGENSLICE_HPP */ diff --git a/core/src/include/ModelArray.hpp b/core/src/include/ModelArray.hpp index dcbbf1977..66f5acc1a 100644 --- a/core/src/include/ModelArray.hpp +++ b/core/src/include/ModelArray.hpp @@ -1,7 +1,7 @@ /*! * @file ModelArray.hpp * - * @date 13 Jun 2025 + * @date 15 Jul 2025 * @author Tim Spain */ @@ -26,6 +26,7 @@ class Slice; namespace Nextsim { class ModelArraySlice; +template class EigenSlice; class ConstModelArraySlice; /* * Set the storage order to row major. This matches with DGVector when there is @@ -687,6 +688,7 @@ class ModelArray { // ModelArraySlice needs access to the internals for fast slcing friend ModelArraySlice; + template friend class EigenSlice; }; #include "include/ModelArrayTypedefs.hpp" diff --git a/core/src/include/ModelArraySlice.hpp b/core/src/include/ModelArraySlice.hpp index 716863422..29d88e409 100644 --- a/core/src/include/ModelArraySlice.hpp +++ b/core/src/include/ModelArraySlice.hpp @@ -1,7 +1,7 @@ /*! * @file ModelArraySlice.hpp * - * @date Nov 8, 2024 + * @date 15 Jul 2025 * @author Tim Spain */ @@ -18,6 +18,7 @@ namespace Nextsim { class MASIter; class ModelArraySlice; class ConstModelArraySlice; +template class EigenSlice; std::ostream& operator<<(std::ostream& os, const MASIter& it); /*! @@ -282,6 +283,7 @@ class ModelArraySlice { friend MASIter; friend ConstModelArraySlice; + template friend class EigenSlice; private: static void copyBetweenMAandMASlice( diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index c78933116..31707814a 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -3,6 +3,7 @@ set(COMMON_INCLUDE_DIRS "../../core/src" "../../core/src/modules" "../../core/src/include" + "../../dynamics/src" ) set(PHYSICS_INCLUDE_DIRS "../../physics/src" "../../physics/src/modules") @@ -176,6 +177,23 @@ if(ENABLE_MPI) add_mpi_test("${XIOS_TESTS}") else() + add_executable(testEigenSliceCB_MPI3 + "EigenSliceCB_test.cpp" + "MainMPI.cpp" + "../src/ModelArray.cpp" + "../src/ModelArraySlice.cpp" + ) + target_compile_definitions(testEigenSliceCB_MPI3 PRIVATE USE_MPI + TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\") + target_include_directories( + testEigenSliceCB_MPI3 PRIVATE + ${MODEL_INCLUDE_DIR} + "${ModulesRoot}/StructureModule" + "../src" + "../../dynamics/src" + ) + target_link_libraries(testEigenSliceCB_MPI3 PRIVATE nextsimlib doctest::doctest) + add_executable(testHaloExchangeCB_MPI3 "HaloExchangeCB_test.cpp" "MainMPI.cpp" diff --git a/core/test/EigenSliceCB_test.cpp b/core/test/EigenSliceCB_test.cpp new file mode 100644 index 000000000..c21372c0e --- /dev/null +++ b/core/test/EigenSliceCB_test.cpp @@ -0,0 +1,158 @@ +/*! + * @file ModelMetadata_test.cpp + * + * @date 15 Jul 2025 + * @author Tom Meltzer + */ + +#include + +#include "ModelMPI.hpp" +#include "ModelMetadata.hpp" +#include "include/DGModelArray.hpp" +#include "include/EigenSlice.hpp" +#include "include/Halo.hpp" +#include "include/ParametricMesh.hpp" + +namespace Nextsim { + +const std::string testFilesDir = TEST_FILES_DIR; +const std::string file = testFilesDir + "/partition_metadata_3_cb.nc"; + +static const int DG = 3; +static const bool debug = false; + +void initializeHField(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, + size_t offsetY, int test_rank) +{ + // initialize with mock data + for (size_t j = 0; j < localNy; ++j) { + for (size_t i = 0; i < localNx; ++i) { + data(i + j * localNx) = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); + } + } +} + +void initializeDGField(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, + size_t offsetY, int test_rank) +{ + // initialize with mock data + for (size_t j = 0; j < localNy; ++j) { + for (size_t i = 0; i < localNx; ++i) { + for (size_t k = 0; k < DG; k++) { + data(i + j * localNx, k) + = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY) + 1000 * (k + 1); + } + } + } +} + +TEST_SUITE_BEGIN("Halo exchange tests"); +MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) +{ + // test for a 3 proc grid + // ┌─┬─┐ + // │1│ │ + // ├─┤2│ + // │0│ │ + // └─┴─┘ (proc id) + + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance(file); + + const size_t nx = metadata.getGlobalExtentX(); + const size_t ny = metadata.getGlobalExtentY(); + const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const size_t offsetX = metadata.getLocalCornerX(); + const size_t offsetY = metadata.getLocalCornerY(); + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + ModelArray::setDimension(ModelArray::Dimension::DG, DG, DG, 0); + + // create example 2D field on each process + auto testData = ModelArray::HField(); + testData.resize(); + + initializeHField(testData, localNx, localNy, offsetX, offsetY, test_rank); + + using Slice = ArraySlicer::Slice; + Slice sl { { { 1, -1 }, { 1, -1 } } }; + + EigenSlice maSlice(testData, sl); + + maSlice.print(); + + auto testDG = ModelArray::DGField(); + testDG.resize(); + + initializeDGField(testDG, localNx, localNy, offsetX, offsetY, test_rank); + + Slice sdg { { { 1, -1 }, { 1, -1 }, { 0, -1 } } }; + EigenSlice dgSlice(testDG, sdg); + + dgSlice.print(); + + ParametricMesh smesh(CARTESIAN); + smesh.nx = localNx; + smesh.ny = localNy; + smesh.nnodes = localNx * localNy; + smesh.nelements = localNx * localNy; + smesh.vertices.resize(smesh.nelements, Eigen::NoChange); + for (size_t i = 0; i < localNx; ++i) { + for (size_t j = 0; j < localNy; ++j) { + smesh.vertices(i * localNy + j, 0) = i; + smesh.vertices(i * localNy + j, 1) = j; + } + } + DGVector dest(smesh); + dest.setZero(); + + EigenSlice::EigenDGVector> dgvSlice(dest, sdg, smesh); + + dgvSlice.print(); + + dgSlice.copyToSlicedBuffer(dgvSlice); + + dgvSlice.print(); + + // create halo for testData model array + Halo halo(testData); + + // create and allocate temporary Eigen array + ModelArray::DataType innerData; + innerData.resize(halo.getInnerSize(), testData.nComponents()); + initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); + + // populate inner block of modelarray + halo.setInnerBlock(innerData); + // exchange halos + halo.exchangeHalos(); + + std::array, 3> mockDataAllProcs = { + std::vector({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 110, 120, 130, 140, 150, 160, 370, + 0, 101, 111, 121, 131, 141, 151, 161, 371, 0, 102, 112, 122, 132, 142, 152, 162, 372, 0, + 103, 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, 244, 254, 264, 0 }), + std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 0, 204, 214, 224, 234, 244, + 254, 264, 374, 0, 205, 215, 225, 235, 245, 255, 265, 375, 0, 206, 216, 226, 236, 246, + 256, 266, 376, 0, 207, 217, 227, 237, 247, 257, 267, 377, 0, 208, 218, 228, 238, 248, + 258, 268, 378, 0, 0, 0, 0, 0, 0, 0, 0, 0 }), + std::vector({ 0, 0, 0, 0, 0, 160, 370, 380, 390, 0, 161, 371, 381, 391, 0, 162, 372, + 382, 392, 0, 163, 373, 383, 393, 0, 264, 374, 384, 394, 0, 265, 375, 385, 395, 0, 266, + 376, 386, 396, 0, 267, 377, 387, 397, 0, 268, 378, 388, 398, 0, 0, 0, 0, 0, 0 }), + }; + + // create mock eigen matrix for each process + ModelArray::DataType mockData; + mockData.resize(localNx * localNy, 1); + mockData + = Eigen::Map(mockDataAllProcs[test_rank].data(), mockData.size(), 1); + + for (size_t j = 0; j < localNy; j++) { + for (size_t i = 0; i < localNx; i++) { + REQUIRE(testData(i, j) == mockData(i + j * localNx)); + } + } +} +} diff --git a/dynamics/src/include/dgVector.hpp b/dynamics/src/include/dgVector.hpp index 1087bdf88..8a4a9d568 100644 --- a/dynamics/src/include/dgVector.hpp +++ b/dynamics/src/include/dgVector.hpp @@ -1,6 +1,6 @@ /*! * @file dgVector.hpp - * @date 24 Sep 2024 + * @date 15 Jul 2025 * @author Thomas Richter */ @@ -14,6 +14,8 @@ namespace Nextsim { // #define CELLDOFS(DGdegree) (DGdegree == 0 ? 1 : (DGdegree == 1 ? 3 : (DGdegree == 2 ? 6 : -1))) +template class EigenSlice; + template class LocalDGVector : public Eigen::Matrix { public: // required by Eigen @@ -127,6 +129,8 @@ class DGVector : public Eigen::Matrix::operator+=(other); return *this; } + + template friend class EigenSlice; }; //! data set to store the type of the edges From 58c10773d0ea41aebec876de15fb1c03c86a1d00 Mon Sep 17 00:00:00 2001 From: tommelt Date: Wed, 16 Jul 2025 07:53:09 +0100 Subject: [PATCH 20/53] wip: weird memory bug for DGField --- core/test/EigenSliceCB_test.cpp | 196 +++++++++++++++++--------------- 1 file changed, 104 insertions(+), 92 deletions(-) diff --git a/core/test/EigenSliceCB_test.cpp b/core/test/EigenSliceCB_test.cpp index c21372c0e..571914e2e 100644 --- a/core/test/EigenSliceCB_test.cpp +++ b/core/test/EigenSliceCB_test.cpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata_test.cpp * - * @date 15 Jul 2025 + * @date 16 Jul 2025 * @author Tom Meltzer */ @@ -22,33 +22,32 @@ const std::string file = testFilesDir + "/partition_metadata_3_cb.nc"; static const int DG = 3; static const bool debug = false; -void initializeHField(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, - size_t offsetY, int test_rank) -{ - // initialize with mock data - for (size_t j = 0; j < localNy; ++j) { - for (size_t i = 0; i < localNx; ++i) { - data(i + j * localNx) = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); - } - } -} +using Slice = ArraySlicer::Slice; -void initializeDGField(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, - size_t offsetY, int test_rank) +void initializeData(ModelArray& ma, int test_rank) { + auto& metadata = ModelMetadata::getInstance(); + + const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const size_t offsetX = metadata.getLocalCornerX(); + const size_t offsetY = metadata.getLocalCornerY(); + + auto dof = ma.nComponents(); + // initialize with mock data for (size_t j = 0; j < localNy; ++j) { for (size_t i = 0; i < localNx; ++i) { - for (size_t k = 0; k < DG; k++) { - data(i + j * localNx, k) + for (size_t k = 0; k < dof; ++k) { + ma.components({ i, j })[k] = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY) + 1000 * (k + 1); } } } } -TEST_SUITE_BEGIN("Halo exchange tests"); -MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) +TEST_SUITE_BEGIN("EigenSlice tests"); +MPI_TEST_CASE("test EigenSlice on a 3 proc grid", 3) { // test for a 3 proc grid // ┌─┬─┐ @@ -71,88 +70,101 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); ModelArray::setDimension(ModelArray::Dimension::DG, DG, DG, 0); - // create example 2D field on each process - auto testData = ModelArray::HField(); - testData.resize(); - - initializeHField(testData, localNx, localNy, offsetX, offsetY, test_rank); - - using Slice = ArraySlicer::Slice; - Slice sl { { { 1, -1 }, { 1, -1 } } }; + // HField tests + { + // create example 2D field on each process + auto source = ModelArray::HField(); + auto target = ModelArray::HField(); + source.resize(); + target.resize(); + target = -1; + + initializeData(source, test_rank); + + // check we can copy the middle block from one to the other + Slice sl { { { 1, -1 }, { 1, -1 }, {} } }; + EigenSlice sourceSlice(source, sl); + EigenSlice targetSlice(target, sl); + + // sourceSlice.print(); + // targetSlice.print(); + sourceSlice.copyToSlicedBuffer(targetSlice); + // targetSlice.print(); + + REQUIRE(target(2, 3) == source(2, 3)); + REQUIRE(target(0, 3) == -1); + } - EigenSlice maSlice(testData, sl); + // DGField tests + { + // create example 2D field on each process + auto source = ModelArray::DGField(); + auto target = ModelArray::DGField(); + source.resize(); + target.resize(); + target = -1; + + initializeData(source, test_rank); + + // check we can copy the middle block from one to the other + Slice sl { { { 1, -1 }, { 1, -1 }, { 0, -1 } } }; + EigenSlice sourceSlice(source, sl); + EigenSlice targetSlice(target, sl); + + sourceSlice.print(); + targetSlice.print(); + targetSlice.copyFromSlicedBuffer(sourceSlice); + targetSlice.print(); + + REQUIRE(target.components({ 2, 3 })[1] == source.components({ 2, 3 })[1]); + REQUIRE(target.components({ 0, 3 })[1] == -1); + } - maSlice.print(); + { + auto source = ModelArray::DGField(); + source.resize(); + initializeData(source, test_rank); + + // check we can copy the middle block from one to the other + Slice sl { { { 1, -1 }, { 1, -1 }, { 0, -1 } } }; + EigenSlice sourceSlice(source, sl); + sourceSlice.print(); + + ParametricMesh smesh(CARTESIAN); + smesh.nx = localNx; + smesh.ny = localNy; + smesh.nnodes = localNx * localNy; + smesh.nelements = localNx * localNy; + smesh.vertices.resize(smesh.nelements, Eigen::NoChange); + for (size_t i = 0; i < localNx; ++i) { + for (size_t j = 0; j < localNy; ++j) { + smesh.vertices(i * localNy + j, 0) = i; + smesh.vertices(i * localNy + j, 1) = j; + } + } + DGVector target(smesh); + target.setZero(); - auto testDG = ModelArray::DGField(); - testDG.resize(); + EigenSlice::EigenDGVector> targetSlice(target, sl, smesh); - initializeDGField(testDG, localNx, localNy, offsetX, offsetY, test_rank); + auto ele = target(1, 1); + ele = target(0, 0); - Slice sdg { { { 1, -1 }, { 1, -1 }, { 0, -1 } } }; - EigenSlice dgSlice(testDG, sdg); + targetSlice.print(); + targetSlice.copyFromSlicedBuffer(sourceSlice); + targetSlice.print(); - dgSlice.print(); + ele = target(1, 1); + ele = target(0, 0); - ParametricMesh smesh(CARTESIAN); - smesh.nx = localNx; - smesh.ny = localNy; - smesh.nnodes = localNx * localNy; - smesh.nelements = localNx * localNy; - smesh.vertices.resize(smesh.nelements, Eigen::NoChange); - for (size_t i = 0; i < localNx; ++i) { - for (size_t j = 0; j < localNy; ++j) { - smesh.vertices(i * localNy + j, 0) = i; - smesh.vertices(i * localNy + j, 1) = j; - } - } - DGVector dest(smesh); - dest.setZero(); - - EigenSlice::EigenDGVector> dgvSlice(dest, sdg, smesh); - - dgvSlice.print(); - - dgSlice.copyToSlicedBuffer(dgvSlice); - - dgvSlice.print(); - - // create halo for testData model array - Halo halo(testData); - - // create and allocate temporary Eigen array - ModelArray::DataType innerData; - innerData.resize(halo.getInnerSize(), testData.nComponents()); - initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); - - // populate inner block of modelarray - halo.setInnerBlock(innerData); - // exchange halos - halo.exchangeHalos(); - - std::array, 3> mockDataAllProcs = { - std::vector({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 110, 120, 130, 140, 150, 160, 370, - 0, 101, 111, 121, 131, 141, 151, 161, 371, 0, 102, 112, 122, 132, 142, 152, 162, 372, 0, - 103, 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, 244, 254, 264, 0 }), - std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 0, 204, 214, 224, 234, 244, - 254, 264, 374, 0, 205, 215, 225, 235, 245, 255, 265, 375, 0, 206, 216, 226, 236, 246, - 256, 266, 376, 0, 207, 217, 227, 237, 247, 257, 267, 377, 0, 208, 218, 228, 238, 248, - 258, 268, 378, 0, 0, 0, 0, 0, 0, 0, 0, 0 }), - std::vector({ 0, 0, 0, 0, 0, 160, 370, 380, 390, 0, 161, 371, 381, 391, 0, 162, 372, - 382, 392, 0, 163, 373, 383, 393, 0, 264, 374, 384, 394, 0, 265, 375, 385, 395, 0, 266, - 376, 386, 396, 0, 267, 377, 387, 397, 0, 268, 378, 388, 398, 0, 0, 0, 0, 0, 0 }), - }; - - // create mock eigen matrix for each process - ModelArray::DataType mockData; - mockData.resize(localNx * localNy, 1); - mockData - = Eigen::Map(mockDataAllProcs[test_rank].data(), mockData.size(), 1); - - for (size_t j = 0; j < localNy; j++) { - for (size_t i = 0; i < localNx; i++) { - REQUIRE(testData(i, j) == mockData(i + j * localNx)); - } + REQUIRE(target(2, 3) == source.components({ 2, 3 })[1]); + REQUIRE(target(0, 0) == -1); } + + // for (size_t j = 0; j < localNy; j++) { + // for (size_t i = 0; i < localNx; i++) { + // REQUIRE(testData(i, j) == mockData(i + j * localNx)); + // } + // } } } From 34977060d67b22604772b0108c35df949c6638e7 Mon Sep 17 00:00:00 2001 From: tommelt Date: Wed, 16 Jul 2025 08:12:15 +0100 Subject: [PATCH 21/53] wip: weird memory bug for DGField --- core/test/EigenSliceCB_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/test/EigenSliceCB_test.cpp b/core/test/EigenSliceCB_test.cpp index 571914e2e..572eb20fb 100644 --- a/core/test/EigenSliceCB_test.cpp +++ b/core/test/EigenSliceCB_test.cpp @@ -107,13 +107,13 @@ MPI_TEST_CASE("test EigenSlice on a 3 proc grid", 3) initializeData(source, test_rank); // check we can copy the middle block from one to the other - Slice sl { { { 1, -1 }, { 1, -1 }, { 0, -1 } } }; + Slice sl { { { 1, -1 }, { 1, -1 }, {} } }; EigenSlice sourceSlice(source, sl); EigenSlice targetSlice(target, sl); sourceSlice.print(); targetSlice.print(); - targetSlice.copyFromSlicedBuffer(sourceSlice); + sourceSlice.copyToSlicedBuffer(targetSlice); targetSlice.print(); REQUIRE(target.components({ 2, 3 })[1] == source.components({ 2, 3 })[1]); From 02f27114beae99d6b27ca012c53c98b6c1d385e0 Mon Sep 17 00:00:00 2001 From: tommelt Date: Wed, 16 Jul 2025 21:12:47 +0100 Subject: [PATCH 22/53] wip: tidied eigenslice test --- core/src/include/EigenSlice.hpp | 6 +- core/test/EigenSliceCB_test.cpp | 192 +++++++++++++++++--------------- 2 files changed, 106 insertions(+), 92 deletions(-) diff --git a/core/src/include/EigenSlice.hpp b/core/src/include/EigenSlice.hpp index e3f85798c..88de6125a 100644 --- a/core/src/include/EigenSlice.hpp +++ b/core/src/include/EigenSlice.hpp @@ -1,7 +1,7 @@ /*! * @file EigenSlice.hpp * - * @date 15 Jul 2025 + * @date 16 Jul 2025 * @author Tom Meltzer */ @@ -55,14 +55,14 @@ template class EigenSlice { public: explicit EigenSlice(ModelArray& ma, const Slice& sl) : data(ma.m_data) - , dimensions({ ma.dimensions()[0], ma.dimensions()[1], ma.nComponents() }) + , dimensions(ma.dimensions()) , slice(sl) { } explicit EigenSlice(DGVector& dgv, const Slice& sl, const ParametricMesh& smesh) : data(dgv) - , dimensions({ smesh.nx, smesh.ny, DGCOMP }) + , dimensions({ smesh.nx, smesh.ny }) , slice(sl) { } diff --git a/core/test/EigenSliceCB_test.cpp b/core/test/EigenSliceCB_test.cpp index 572eb20fb..5de23c078 100644 --- a/core/test/EigenSliceCB_test.cpp +++ b/core/test/EigenSliceCB_test.cpp @@ -6,6 +6,7 @@ */ #include +#include #include "ModelMPI.hpp" #include "ModelMetadata.hpp" @@ -47,14 +48,8 @@ void initializeData(ModelArray& ma, int test_rank) } TEST_SUITE_BEGIN("EigenSlice tests"); -MPI_TEST_CASE("test EigenSlice on a 3 proc grid", 3) +MPI_TEST_CASE("test EigenSlice for HField", 3) { - // test for a 3 proc grid - // ┌─┬─┐ - // │1│ │ - // ├─┤2│ - // │0│ │ - // └─┴─┘ (proc id) auto& modelMPI = ModelMPI::getInstance(test_comm); auto& metadata = ModelMetadata::getInstance(file); @@ -70,101 +65,120 @@ MPI_TEST_CASE("test EigenSlice on a 3 proc grid", 3) ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); ModelArray::setDimension(ModelArray::Dimension::DG, DG, DG, 0); - // HField tests - { - // create example 2D field on each process - auto source = ModelArray::HField(); - auto target = ModelArray::HField(); - source.resize(); - target.resize(); - target = -1; - - initializeData(source, test_rank); - - // check we can copy the middle block from one to the other - Slice sl { { { 1, -1 }, { 1, -1 }, {} } }; - EigenSlice sourceSlice(source, sl); - EigenSlice targetSlice(target, sl); - - // sourceSlice.print(); - // targetSlice.print(); - sourceSlice.copyToSlicedBuffer(targetSlice); - // targetSlice.print(); - - REQUIRE(target(2, 3) == source(2, 3)); - REQUIRE(target(0, 3) == -1); - } - - // DGField tests - { - // create example 2D field on each process - auto source = ModelArray::DGField(); - auto target = ModelArray::DGField(); - source.resize(); - target.resize(); - target = -1; + // create example 2D field on each process + auto source = ModelArray::HField(); + auto target = ModelArray::HField(); + source.resize(); + target.resize(); + target = -1; - initializeData(source, test_rank); + initializeData(source, test_rank); - // check we can copy the middle block from one to the other - Slice sl { { { 1, -1 }, { 1, -1 }, {} } }; - EigenSlice sourceSlice(source, sl); - EigenSlice targetSlice(target, sl); + // check we can copy the middle block from one to the other + Slice sl { { { 1, -1 }, { 1, -1 } } }; + EigenSlice sourceSlice(source, sl); + EigenSlice targetSlice(target, sl); - sourceSlice.print(); - targetSlice.print(); - sourceSlice.copyToSlicedBuffer(targetSlice); + sourceSlice.copyToSlicedBuffer(targetSlice); + if (debug) { + std::cout << "HField" << std::endl; targetSlice.print(); - - REQUIRE(target.components({ 2, 3 })[1] == source.components({ 2, 3 })[1]); - REQUIRE(target.components({ 0, 3 })[1] == -1); } - { - auto source = ModelArray::DGField(); - source.resize(); - initializeData(source, test_rank); - - // check we can copy the middle block from one to the other - Slice sl { { { 1, -1 }, { 1, -1 }, { 0, -1 } } }; - EigenSlice sourceSlice(source, sl); - sourceSlice.print(); - - ParametricMesh smesh(CARTESIAN); - smesh.nx = localNx; - smesh.ny = localNy; - smesh.nnodes = localNx * localNy; - smesh.nelements = localNx * localNy; - smesh.vertices.resize(smesh.nelements, Eigen::NoChange); - for (size_t i = 0; i < localNx; ++i) { - for (size_t j = 0; j < localNy; ++j) { - smesh.vertices(i * localNy + j, 0) = i; - smesh.vertices(i * localNy + j, 1) = j; - } - } - DGVector target(smesh); - target.setZero(); + REQUIRE(target(2, 3) == source(2, 3)); + REQUIRE(target(0, 3) == -1); +} - EigenSlice::EigenDGVector> targetSlice(target, sl, smesh); +MPI_TEST_CASE("test EigenSlice for DGField", 3) +{ + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance(); - auto ele = target(1, 1); - ele = target(0, 0); + const size_t nx = metadata.getGlobalExtentX(); + const size_t ny = metadata.getGlobalExtentY(); + const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const size_t offsetX = metadata.getLocalCornerX(); + const size_t offsetY = metadata.getLocalCornerY(); + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + ModelArray::setDimension(ModelArray::Dimension::DG, DG, DG, 0); + + // create example 2D field on each process + auto source = ModelArray::DGField(); + auto target = ModelArray::DGField(); + source.resize(); + target.resize(); + target = -1; + + initializeData(source, test_rank); + + // check we can copy the middle block from one to the other + Slice sl { { { 1, -1 }, { 1, -1 } } }; + EigenSlice sourceSlice(source, sl); + EigenSlice targetSlice(target, sl); + + sourceSlice.copyToSlicedBuffer(targetSlice); + if (debug) { + std::cout << "DGField" << std::endl; targetSlice.print(); - targetSlice.copyFromSlicedBuffer(sourceSlice); - targetSlice.print(); + } + + REQUIRE(target.components({ 2, 3 })[1] == source.components({ 2, 3 })[1]); + REQUIRE(target.components({ 0, 3 })[1] == -1); +} + +MPI_TEST_CASE("test EigenSlice for DGVector", 3) +{ + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance(); + + const size_t nx = metadata.getGlobalExtentX(); + const size_t ny = metadata.getGlobalExtentY(); + const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const size_t offsetX = metadata.getLocalCornerX(); + const size_t offsetY = metadata.getLocalCornerY(); - ele = target(1, 1); - ele = target(0, 0); + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + ModelArray::setDimension(ModelArray::Dimension::DG, DG, DG, 0); - REQUIRE(target(2, 3) == source.components({ 2, 3 })[1]); - REQUIRE(target(0, 0) == -1); + auto fake_data = ModelArray::DGField(); + fake_data.resize(); + initializeData(fake_data, test_rank); + + ParametricMesh smesh(CARTESIAN); + smesh.nx = localNx; + smesh.ny = localNy; + smesh.nnodes = localNx * localNy; + smesh.nelements = localNx * localNy; + smesh.vertices.resize(smesh.nelements, Eigen::NoChange); + for (size_t i = 0; i < localNx; ++i) { + for (size_t j = 0; j < localNy; ++j) { + smesh.vertices(i * localNy + j, 0) = i; + smesh.vertices(i * localNy + j, 1) = j; + } + } + DGVector source(smesh); + DGModelArray::ma2dg(fake_data, source); + DGVector target(smesh); + fake_data = -1.; + DGModelArray::ma2dg(fake_data, target); + + // check we can copy the middle block from one to the other + Slice sl { { { 1, -1 }, { 1, -1 } } }; + EigenSlice::EigenDGVector> sourceSlice(source, sl, smesh); + EigenSlice::EigenDGVector> targetSlice(target, sl, smesh); + + sourceSlice.copyToSlicedBuffer(targetSlice); + if (debug) { + std::cout << "DGVector" << std::endl; + targetSlice.print(); } - // for (size_t j = 0; j < localNy; j++) { - // for (size_t i = 0; i < localNx; i++) { - // REQUIRE(testData(i, j) == mockData(i + j * localNx)); - // } - // } + REQUIRE(target(localNx + 1, 1) == source(localNx + 1, 1)); + REQUIRE(target(0, 0) == -1); } } From d7224c6b705f9dc5edf02d31a27f7e64b65ab1c8 Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 4 Aug 2025 16:20:10 +0100 Subject: [PATCH 23/53] wip: fix testParaGrid_MPI2 --- core/src/ParaGridIO.cpp | 18 +- core/test/ParaGridIO_input_test.nc | Bin 21498 -> 21426 bytes core/test/ParaGridIO_input_test.py | 26 +-- core/test/ParaGrid_test.cpp | 253 +++++++++++++---------------- 4 files changed, 143 insertions(+), 154 deletions(-) diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index c796d52f8..ef80c9e77 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGridIO.cpp * - * @date 16 Jun 2025 + * @date 04 Aug 2025 * @author Tim Spain */ @@ -182,9 +182,10 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) size_t startIndex = dim.start; size_t localLength = dim.localLength; #ifdef USE_MPI - if (dt == Dim::X or dt == Dim::XVERTEX) { + if (dt == Dim::X or dt == Dim::Y) { localLength = localLength - 2 * Halo::haloWidth; - } else if (dt == Dim::Y or dt == Dim::YVERTEX) { + } + if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { localLength = localLength - 2 * Halo::haloWidth; } #endif @@ -266,6 +267,9 @@ ModelState ParaGridIO::readForcingTimeStatic( if (dt == Dim::X or dt == Dim::Y) { localLength = localLength - 2 * Halo::haloWidth; } + if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { + localLength = localLength - 2 * Halo::haloWidth; + } #endif indexArray.push_back(startIndex); extentArray.push_back(localLength); @@ -370,9 +374,10 @@ void ParaGridIO::dumpModelState(const ModelState& state, const std::string& file auto dim = entry.second.definedDimensions.at(dt); size_t localLength = dim.localLength; #ifdef USE_MPI - if (dt == Dim::X or dt == Dim::XVERTEX) { + if (dt == Dim::X or dt == Dim::Y) { localLength = localLength - 2 * Halo::haloWidth; - } else if (dt == Dim::Y or dt == Dim::YVERTEX) { + } + if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { localLength = localLength - 2 * Halo::haloWidth; } #endif @@ -479,6 +484,9 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& if (dt == Dim::X or dt == Dim::Y) { localLength = localLength - 2 * Halo::haloWidth; } + if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { + localLength = localLength - 2 * Halo::haloWidth; + } #endif ncDims.push_back(ncFromMAMap.at(dt)); start.push_back(dim.start); diff --git a/core/test/ParaGridIO_input_test.nc b/core/test/ParaGridIO_input_test.nc index b29526765ff98cacbbe049fa1e3c191d1f6249e4..defcb19c540bd1685bf030d6fdeec48d72694730 100644 GIT binary patch delta 887 zcmbu7OH30%7{_;}+jbTeDuS+kKwE*7hjptZ;se~Mn5CMQ7SnD-s0ScoK)@IuiB>qM zcp;R}7zqh-F&q%0-Kg=PsV9s9g9k&{Rf*y<#59*X%8tzW=?SKCN+4+4toB2J8 z5~HZ!nv#a8L)~4oj&21f>?aimpmYr;BDX;XnJzn?rl3(@rm0o=f;_ez%;30Tx zXt0`0DQ78CGnXp#d1bGh4|T@fYex)f_M%Pv34_M{Y}@?o8R$W|14M>SA|L`?WE0E~ z9t5ryGg(TU>&S!=?)m`V0?%v&T6pQd^f9i5m_>p<3jsGz;FU$BMIh5EL7tUB70nv0 zA}s>LG@GF6r`aOS7U|q=lc0)zMg zXfwA0*EH?nb+HSCf*)+Gyh(v%X%2EhW#J9;)uqXW)nuMuO(uUPU*gmyqA{b z<<$$lkHP`zU!oa;!6Dy6KGHYjhQ#zP;ar*m~qoL|* z#2{vcwW9RT^`Ih1l=17+c&#m=cWQQxlBl@M$UE)(#H3znHW1J z&t~>v`Ejy9VDoEce?~^v$=0m$j7pQES!DzbbTU%XOl=MI42|@RE|naK+B}8TlaX^K zJH(K*$C*v`>4v5bIv7D^OB$kkYJwtK-HY(=qbhK%`cVM z7$sr4IU({4aQ@_rni`W0RKBnje%h5Y`GB^_(ANcjl}+8~=PApy|~H9IR= z=-Om&W!cHgR0Z^BJnrs-IN6?&Q3a%q3Fv0HB{(b zt0BQ+Hg~n+W=oB7Mn!ZZ{zCy=9O!;8RuGSKvVzttmN^1zxS)nz)dm|jd5yLJ%gb2> zu~5%(PS)1W1bJ|BoQ{B8wTk_bkRVrAMg~R(nAtEI=+Q<-waJ@wBn08sL4CpjjKAyL zn>Sh1N=!Bn^qAZp=sEdDp!;O?AdkuAKzuyNbFxIR`{eXs4`&7?2Z%0XC~XU&8=RrE X2bA`O&<=qR`am$0ALcOmRe%Qoe+U5( diff --git a/core/test/ParaGridIO_input_test.py b/core/test/ParaGridIO_input_test.py index 12b932c04..c5af897cc 100644 --- a/core/test/ParaGridIO_input_test.py +++ b/core/test/ParaGridIO_input_test.py @@ -12,26 +12,26 @@ target_structure = "parametric_rectangular" - nx = 9 - ny = 11 + nx = 10 + ny = 9 element_shape = (nx, ny) x1d = np.arange(nx) y1d = np.arange(ny) - + element_x = np.tile(x1d, (ny, 1)) element_y = np.transpose(np.tile(y1d, (nx, 1))) - + time_data = 10 * element_x + element_y field_name = "index2d" - + out_file = "ParaGridIO_input_test.nc" out_root = netCDF4.Dataset(out_file, "w", format="NETCDF4") structgrp = out_root.createGroup("structure") structgrp.type = target_structure - + metagrp = out_root.createGroup("metadata") metagrp.type = target_structure - confgrp = metagrp.createGroup("configuration") # But add nothing to it + confgrp = metagrp.createGroup("configuration") # But add nothing to it timegrp = metagrp.createGroup("time") # Use the start time as the timestamp for the file formatted = timegrp.createVariable("formatted", str) @@ -41,23 +41,23 @@ the_time = 0 time_attr[:] = the_time time_attr.units = "seconds since 1970-01-01T00:00:00Z" - + datagrp = out_root.createGroup("data") xDim = datagrp.createDimension("x", nx) yDim = datagrp.createDimension("y", ny) tDim = datagrp.createDimension("time", None) - + # Position and time variables nc_lons = datagrp.createVariable("longitude", "f8", ("y", "x")) nc_lons[:, :] = element_x nc_lats = datagrp.createVariable("latitude", "f8", ("y", "x")) nc_lats[:, :] = element_y - + nc_times = datagrp.createVariable("time", "f8", ("time")) - - #(unix_times_e, era5_times) = create_era5_times(start_time, stop_time) + + # (unix_times_e, era5_times) = create_era5_times(start_time, stop_time) # For each field and time, get the corresponding file name for each dataset - # get the source data + # get the source data data = datagrp.createVariable(field_name, "f8", ("time", "y", "x")) data[0, :, :] = time_data # 'fill' the time axis diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index 9f3d80af1..7fcfe8764 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGrid_test.cpp * - * @date 04 Jun 2025 + * @date 04 Aug 2025 * @author Tim Spain * @author Tom Meltzer */ @@ -59,42 +59,46 @@ const double scale = 1e5; namespace Nextsim { -size_t c = 0; - -void initializeTestData(HField& hfield, DGField& dgfield, HField& mask) +void initializeTestData( + HField& frac, DGField& fracDG, HField& mask, VertexField& coordinates, HField& x, HField& y) { - hfield.resize(); - dgfield.resize(); - mask.resize(); auto dimX = ModelArray::Dimension::X; auto startX = ModelArray::definedDimensions.at(dimX).start; auto localNX = ModelArray::definedDimensions.at(dimX).localLength; - for (size_t j = 0; j < ny; ++j) { - for (size_t i = 0; i < localNX; ++i) { - hfield(i, j) = j * yFactor + (i + startX) * xFactor; - mask(i, j) - = ((i + startX) - nx / 2) * ((i + startX) - nx / 2) + (j - ny / 2) * (j - ny / 2) - > (nx * ny) - ? 0 - : 1; + auto dimY = ModelArray::Dimension::Y; + auto localNY = ModelArray::definedDimensions.at(dimY).localLength; + + // In the following loops we only set the "inner" data + + // Hfield's, DGField and mask + for (size_t j = 0; j < localNY - 2 * Halo::haloWidth; ++j) { + double yy = scale * (j - float(ny) / 2); + for (size_t i = 0; i < localNX - 2 * Halo::haloWidth; ++i) { + double xx = scale * ((i + startX) - float(nx) / 2); + x(i + Halo::haloWidth, j + Halo::haloWidth) = xx; + y(i + Halo::haloWidth, j + Halo::haloWidth) = yy; + frac(i + Halo::haloWidth, j + Halo::haloWidth) = j * yFactor + (i + startX) * xFactor; + mask(i + Halo::haloWidth, j + Halo::haloWidth) = i + startX > j ? 0 : 1; for (size_t d = 0; d < DG; ++d) { - dgfield.components({ i, j })[d] = hfield(i, j) + d; + fracDG.components({ i + Halo::haloWidth, j + Halo::haloWidth })[d] + = frac(i + Halo::haloWidth, j + Halo::haloWidth) + d; } } } -}; -void initializeTestCoordinates(VertexField& coordinates) -{ - auto dimXVertex = ModelArray::Dimension::XVERTEX; - auto localNXVertex = ModelArray::definedDimensions.at(dimXVertex).localLength; - auto startXVertex = ModelArray::definedDimensions.at(dimXVertex).start; - for (size_t i = 0; i < localNXVertex; ++i) { - for (size_t j = 0; j < ny + 1; ++j) { - double x = (i + startXVertex) - 0.5 - float(nx) / 2; + dimX = ModelArray::Dimension::XVERTEX; + startX = ModelArray::definedDimensions.at(dimX).start; + localNX = ModelArray::definedDimensions.at(dimX).localLength; + dimY = ModelArray::Dimension::YVERTEX; + localNY = ModelArray::definedDimensions.at(dimY).localLength; + + // Vetex coordinates + for (size_t i = 0; i < localNX - 2 * Halo::haloWidth; ++i) { + for (size_t j = 0; j < localNY - 2 * Halo::haloWidth; ++j) { + double x = (i + startX) - 0.5 - float(nx) / 2; double y = j - 0.5 - float(ny) / 2; - coordinates.components({ i, j })[0] = x * scale; - coordinates.components({ i, j })[1] = y * scale; + coordinates.components({ i + Halo::haloWidth, j + Halo::haloWidth })[0] = x * scale; + coordinates.components({ i + Halo::haloWidth, j + Halo::haloWidth })[1] = y * scale; } } }; @@ -115,17 +119,25 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") grid.setIO(pio); #ifdef USE_MPI - if (test_rank == 0) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 4, 0); - ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 4 + 1, 0); - } - if (test_rank == 1) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 6, 4); - ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 6 + 1, 4); - } - ModelArray::setDimension(ModelArray::Dimension::Y, ny, ny, 0); - ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, ny + 1, 0); + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance(partitionFilename); + + const auto localNX = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const auto offsetX = metadata.getLocalCornerX(); + const auto localNY = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const auto offsetY = metadata.getLocalCornerY(); + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNX, offsetX); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, localNX + 1, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNY, offsetY); + ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, localNY + 1, offsetY); #else + auto& metadata = ModelMetadata::getInstance(); + + const auto localNX = nx; + const size_t offsetX = 0; + const auto localNY = ny; + const size_t offsetY = 0; ModelArray::setDimension(ModelArray::Dimension::X, nx); ModelArray::setDimension(ModelArray::Dimension::Y, ny); ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1); @@ -139,42 +151,29 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") HField fractional(ModelArray::Type::H); DGField fractionalDG(ModelArray::Type::DG); HField mask(ModelArray::Type::H); - initializeTestData(fractional, fractionalDG, mask); + VertexField coordinates(ModelArray::Type::VERTEX); + HField x; + HField y; + + // Initialize (resize and set to zero) all ModelArrays + ModelArray* arrays[] = { &fractional, &fractionalDG, &mask, &coordinates, &x, &y }; + for (auto arr : arrays) { + arr->resize(); + *arr = 0.; + } + + // populate model arrays with dummy data + initializeTestData(fractional, fractionalDG, mask, coordinates, x, y); DGField hice = fractionalDG + 10; DGField cice = fractionalDG + 20; DGField hsnow = fractionalDG + 30; DGField damage = fractionalDG * 0.; HField sss = fractional; - VertexField coordinates(ModelArray::Type::VERTEX); - initializeTestCoordinates(coordinates); REQUIRE(coordinates.components({ 3, 8 })[0] - coordinates.components({ 2, 8 })[0] == scale); REQUIRE(coordinates.components({ 3, 8 })[1] - coordinates.components({ 3, 7 })[1] == scale); - // MPI domain is only split in x-direction for this test - // the following will be set correctly with MPI ON and OFF - auto dimX = ModelArray::Dimension::X; - auto startX = ModelArray::definedDimensions.at(dimX).start; - auto localNX = ModelArray::definedDimensions.at(dimX).localLength; - auto dimXVertex = ModelArray::Dimension::XVERTEX; - auto localNXVertex = ModelArray::definedDimensions.at(dimXVertex).localLength; - auto startXVertex = ModelArray::definedDimensions.at(dimXVertex).start; - - HField x; - HField y; - x.resize(); - y.resize(); - // Element coordinates - for (size_t j = 0; j < ny; ++j) { - double yy = scale * (j - float(ny) / 2); - for (size_t i = 0; i < localNX; ++i) { - double xx = scale * ((i + startX) - float(nx) / 2); - x(i, j) = xx; - y(i, j) = yy; - } - } - HField gridAzimuth; double gridAzimuth0 = 45.; gridAzimuth = gridAzimuth0; @@ -197,14 +196,6 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") }, {} }; -#ifdef USE_MPI - auto& modelMPI = ModelMPI::getInstance(test_comm); - // std::cout << "size = " << modelMPI.m_size << std::endl; - auto& metadata = ModelMetadata::getInstance(partitionFilename); -#else - auto& metadata = ModelMetadata::getInstance(); -#endif - metadata.setTime(TimePoint("2000-01-01T00:00:00Z")); // The coordinates are passed through the metadata object as affix // coordinates is the correct way to add coordinates to a ModelState @@ -240,15 +231,8 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") ModelArray& hiceRef = ms.data.at(hiceName); REQUIRE(hiceRef.nDimensions() == 2); - // TODO need to decide how non-MPI code should be handled i.e., will we only ever run with - // MPI=ON? even if it's mpirun -n 1... -#ifdef USE_MPI - REQUIRE(hiceRef.dimensions()[0] == localNX + 2 * Halo::haloWidth); - REQUIRE(hiceRef.dimensions()[1] == ny + 2 * Halo::haloWidth); -#else REQUIRE(hiceRef.dimensions()[0] == localNX); - REQUIRE(hiceRef.dimensions()[1] == ny); -#endif + REQUIRE(hiceRef.dimensions()[1] == localNY); REQUIRE(ModelArray::nComponents(ModelArray::Type::DG) == DG); REQUIRE(hiceRef.nComponents() == DG); @@ -256,18 +240,15 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") ModelArray& coordRef = ms.data.at(coordsName); REQUIRE(coordRef.nDimensions() == 2); REQUIRE(coordRef.nComponents() == 2); -#ifdef USE_MPI - REQUIRE(coordRef.dimensions()[0] == localNXVertex + 2 * Halo::haloWidth); - REQUIRE(coordRef.dimensions()[1] == ny + 1 + 2 * Halo::haloWidth); -#else - REQUIRE(coordRef.dimensions()[0] == localNXVertex); - REQUIRE(coordRef.dimensions()[1] == ny + 1); -#endif + REQUIRE(coordRef.dimensions()[0] == localNX + 1); + REQUIRE(coordRef.dimensions()[1] == localNY + 1); REQUIRE(coordRef.components({ 3, 8 })[0] - coordRef.components({ 2, 8 })[0] == scale); REQUIRE(coordRef.components({ 3, 8 })[1] - coordRef.components({ 3, 7 })[1] == scale); REQUIRE(ms.data.count(xName) > 0); ModelArray& xRef = ms.data.at(xName); + auto testa = xRef(3, 8); + auto testb = coordRef.components({ 3, 7 })[0]; REQUIRE(xRef(3, 8) == coordRef.components({ 3, 7 })[0] + scale / 2); REQUIRE(ms.data.count(yName) > 0); @@ -298,17 +279,26 @@ TEST_CASE("Write a diagnostic ParaGrid file") grid.setIO(pio); #ifdef USE_MPI - if (test_rank == 0) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 4, 0); - ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 4 + 1, 0); - } - if (test_rank == 1) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 6, 4); - ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, 6 + 1, 4); - } - ModelArray::setDimension(ModelArray::Dimension::Y, ny, ny, 0); - ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, ny + 1, 0); + auto& modelMPI = ModelMPI::getInstance(); + auto& metadata = ModelMetadata::getInstance(); + + const auto localNX = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const auto offsetX = metadata.getLocalCornerX(); + const auto localNY = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const auto offsetY = metadata.getLocalCornerY(); + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNX, offsetX); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, localNX + 1, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNY, offsetY); + ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, localNY + 1, offsetY); #else + auto& metadata = ModelMetadata::getInstance(); + + const auto localNX = nx; + const size_t offsetX = 0; + const auto localNY = ny; + const size_t offsetY = 0; + ModelArray::setDimension(ModelArray::Dimension::X, nx); ModelArray::setDimension(ModelArray::Dimension::Y, ny); ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1); @@ -319,40 +309,28 @@ TEST_CASE("Write a diagnostic ParaGrid file") ModelArray::setNComponents(ModelArray::Type::DGSTRESS, DGSTRESS); ModelArray::setNComponents(ModelArray::Type::VERTEX, ModelArray::nCoords); - // MPI domain is only split in x-direction for this test - // the following will be set correctly with MPI ON and OFF - auto dimX = ModelArray::Dimension::X; - auto startX = ModelArray::definedDimensions.at(dimX).start; - auto localNX = ModelArray::definedDimensions.at(dimX).localLength; - auto dimXVertex = ModelArray::Dimension::XVERTEX; - HField fractional(ModelArray::Type::H); DGField fractionalDG(ModelArray::Type::DG); HField mask(ModelArray::Type::H); - initializeTestData(fractional, fractionalDG, mask); + VertexField coordinates(ModelArray::Type::VERTEX); + HField x; + HField y; + + // Initialize (resize and set to zero) all ModelArrays + ModelArray* arrays[] = { &fractional, &fractionalDG, &mask, &coordinates, &x, &y }; + for (auto arr : arrays) { + arr->resize(); + *arr = 0.; + } + + // populate model arrays with dummy data + initializeTestData(fractional, fractionalDG, mask, coordinates, x, y); REQUIRE(fractional.nDimensions() == 2); DGField hice = fractionalDG + 10; DGField cice = fractionalDG + 20; - VertexField coordinates(ModelArray::Type::VERTEX); - initializeTestCoordinates(coordinates); - - HField x; - HField y; - x.resize(); - y.resize(); - // Element coordinates - for (size_t j = 0; j < ny; ++j) { - double yy = scale * (j - float(ny) / 2); - for (size_t i = 0; i < localNX; ++i) { - double xx = scale * ((i + startX) - float(nx) / 2); - x(i, j) = xx; - y(i, j) = yy; - } - } - HField gridAzimuth; double gridAzimuth0 = 45.; gridAzimuth = gridAzimuth0; @@ -373,10 +351,6 @@ TEST_CASE("Write a diagnostic ParaGrid file") }, {} }; -#ifdef USE_MPI - auto& modelMPI = ModelMPI::getInstance(); -#endif - auto& metadata = ModelMetadata::getInstance(); metadata.setTime(TimePoint("2000-01-01T00:00:00Z")); // The coordinates are passed through the metadata object as affix // coordinates is the correct way to add coordinates to a ModelState @@ -454,26 +428,33 @@ TEST_CASE("Test array ordering") REQUIRE(Module::getImplementation().structureType() == "parametric_rectangular"); - size_t nx = 9; - size_t ny = 11; - double xFactor = 10; #ifdef USE_MPI - if (test_rank == 0) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 4, 0); - } - if (test_rank == 1) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 5, 4); - } - ModelArray::setDimension(ModelArray::Dimension::Y, ny, ny, 0); + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance(partitionFilename); + + const auto localNX = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const auto offsetX = metadata.getLocalCornerX(); + const auto localNY = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const auto offsetY = metadata.getLocalCornerY(); + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNX, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNY, offsetY); #else + auto& metadata = ModelMetadata::getInstance(); + + const auto localNX = nx; + const size_t offsetX = 0; + const auto localNY = ny; + const size_t offsetY = 0; ModelArray::setDimension(ModelArray::Dimension::X, nx); ModelArray::setDimension(ModelArray::Dimension::Y, ny); #endif HField index2d(ModelArray::Type::H); index2d.resize(); + index2d = 0.; std::string fieldName = "index2d"; std::set fields = { fieldName }; TimePoint time; @@ -481,7 +462,7 @@ TEST_CASE("Test array ordering") ModelState state = ParaGridIO::readForcingTimeStatic(fields, time, inputFilename); REQUIRE(state.data.count(fieldName) > 0); index2d = state.data.at(fieldName); - REQUIRE(index2d(3, 5) == 35); + REQUIRE(index2d(3 + Halo::haloWidth, 5 + Halo::haloWidth) == (offsetX + 3) * xFactor + 5.); Finalizer::finalize(); } From 271ce05a8034725a33dde8c29e79201ee5b15e2e Mon Sep 17 00:00:00 2001 From: tommelt Date: Tue, 19 Aug 2025 12:13:32 +0100 Subject: [PATCH 24/53] wip: eigen slice dump before removing it --- core/src/include/EigenSlice.hpp | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/core/src/include/EigenSlice.hpp b/core/src/include/EigenSlice.hpp index 88de6125a..bc51c6e9b 100644 --- a/core/src/include/EigenSlice.hpp +++ b/core/src/include/EigenSlice.hpp @@ -1,7 +1,7 @@ /*! * @file EigenSlice.hpp * - * @date 16 Jul 2025 + * @date 19 Aug 2025 * @author Tom Meltzer */ @@ -49,13 +49,16 @@ template class EigenSlice { Slice slice; using MultiDim = std::vector; - // spatial dimensions and DoF + // spatial dimensions const MultiDim dimensions; + // non-spatial components e.g., DG. + const size_t nComponents; public: explicit EigenSlice(ModelArray& ma, const Slice& sl) : data(ma.m_data) , dimensions(ma.dimensions()) + , nComponents(ma.nComponents()) , slice(sl) { } @@ -63,10 +66,34 @@ template class EigenSlice { explicit EigenSlice(DGVector& dgv, const Slice& sl, const ParametricMesh& smesh) : data(dgv) , dimensions({ smesh.nx, smesh.ny }) + , nComponents(DGCOMP) , slice(sl) { } + explicit EigenSlice( + ModelArray::DataType& array, const Slice& sl, const MultiDim& dims, const size_t& nComps) + : data(array) + , dimensions(dims) + , nComponents(nComps) + , slice(sl) + { + } + + /** + * @brief Returns the spatial dimensions of the data. + * + * @return A const reference to the vector of spatial dimensions. + */ + const MultiDim& getDimensions() const { return dimensions; } + + /** + * @brief Returns the number of non-spatial components (e.g., DG components). + * + * @return The number of components as a size_t. + */ + size_t getNComponents() const { return nComponents; } + /*! * @brief Copies data from EigenSlice to target buffer * From ea17449c25cb13c94e3b604562e0b47c6a684967 Mon Sep 17 00:00:00 2001 From: tommelt Date: Tue, 19 Aug 2025 15:37:11 +0100 Subject: [PATCH 25/53] wip: remove eigenslice --- core/src/include/EigenSlice.hpp | 157 --------------------------- core/test/CMakeLists.txt | 17 --- core/test/EigenSliceCB_test.cpp | 184 -------------------------------- 3 files changed, 358 deletions(-) delete mode 100644 core/src/include/EigenSlice.hpp delete mode 100644 core/test/EigenSliceCB_test.cpp diff --git a/core/src/include/EigenSlice.hpp b/core/src/include/EigenSlice.hpp deleted file mode 100644 index bc51c6e9b..000000000 --- a/core/src/include/EigenSlice.hpp +++ /dev/null @@ -1,157 +0,0 @@ -/*! - * @file EigenSlice.hpp - * - * @date 19 Aug 2025 - * @author Tom Meltzer - */ - -#ifndef EIGENSLICE_HPP -#define EIGENSLICE_HPP - -#include "include/ModelArray.hpp" -#include "include/ModelArraySlice.hpp" -#include "include/Slice.hpp" -#include "include/dgVector.hpp" -#include -#include -#include - -#ifndef DGCOMP -#define DGCOMP 3 -#endif - -using Slice = ArraySlicer::Slice; -using SliceIter = ArraySlicer::SliceIter; - -namespace Nextsim { - -/** - * @class EigenSlice - * @brief Provides a view and slicing operations for Eigen-based data structures. - * - * This class enables slicing and manipulation of Eigen matrix-like or array-like objects, - * such as those used in DGVector and ModelArray. It supports copying between slices, - * printing reshaped data, and provides an interface for working with multi-dimensional - * data in a flexible way. - * - * @tparam Derived The Eigen type derived from Eigen::DenseBase. - * - * @note The class is designed to work with both matrix-like and array-like Eigen objects, - * depending on the instantiation. - */ -template class EigenSlice { -private: - // Depending on instatiation this can either be - // * matrix-like object for DGVector - // * array-like object for ModelArray - Eigen::DenseBase& data; - - Slice slice; - using MultiDim = std::vector; - - // spatial dimensions - const MultiDim dimensions; - // non-spatial components e.g., DG. - const size_t nComponents; - -public: - explicit EigenSlice(ModelArray& ma, const Slice& sl) - : data(ma.m_data) - , dimensions(ma.dimensions()) - , nComponents(ma.nComponents()) - , slice(sl) - { - } - - explicit EigenSlice(DGVector& dgv, const Slice& sl, const ParametricMesh& smesh) - : data(dgv) - , dimensions({ smesh.nx, smesh.ny }) - , nComponents(DGCOMP) - , slice(sl) - { - } - - explicit EigenSlice( - ModelArray::DataType& array, const Slice& sl, const MultiDim& dims, const size_t& nComps) - : data(array) - , dimensions(dims) - , nComponents(nComps) - , slice(sl) - { - } - - /** - * @brief Returns the spatial dimensions of the data. - * - * @return A const reference to the vector of spatial dimensions. - */ - const MultiDim& getDimensions() const { return dimensions; } - - /** - * @brief Returns the number of non-spatial components (e.g., DG components). - * - * @return The number of components as a size_t. - */ - size_t getNComponents() const { return nComponents; } - - /*! - * @brief Copies data from EigenSlice to target buffer - * - * @param target The target buffer - * @return A reference to the original EigenSlice object. - */ - template const EigenSlice& copyToSlicedBuffer(EigenSlice& target) const - { - SliceIter iter(slice, dimensions); - SliceIter targetIter(target.slice, target.dimensions); - - ModelArraySlice::copySliceWithIters(data, iter, target.data, targetIter); - // Return this, even though it is unchanged. The code looks weird if - // the return value is the target buffer. - return *this; - } - - /*! - * @brief Copies data to EigenSlice from source buffer - * - * @param source The source buffer - * @return A reference to the updated EigenSlice object. - */ - template EigenSlice& copyFromSlicedBuffer(const EigenSlice& source) - { - SliceIter iter(slice, dimensions); - SliceIter sourceIter(source.slice, source.dimensions); - - ModelArraySlice::copySliceWithIters(source.data, sourceIter, data, iter); - return *this; - } - - /** - * @brief Prints each column of the data as a reshaped 2D matrix. - * - * Iterates over all columns of the internal Eigen data object, reshaping each column - * into a matrix of size (dimX, dimY) as specified by the dimensions member. - * Each reshaped column is printed to the standard output, prefixed by its DG element index. - */ - void print() - { - // Assuming data is a 2D Eigen object and dimensions = { rows, cols } - size_t dimX = dimensions[0]; - size_t dimY = dimensions[1]; - - // Reshape and print each column - for (size_t col = 0; col < data.cols(); col++) { - std::cout << "DG element " << col << std::endl; - std::cout << data.col(col).reshaped(dimX, dimY) << std::endl; - } - } - -private: - // We need to add different Templated versions explicitly as friend - // to allow access to private variables, as intended. - template friend class EigenSlice; -}; - -} // namespace Nextsim - -#endif /* EIGENSLICE_HPP */ diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index 31707814a..8a4e104f0 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -177,23 +177,6 @@ if(ENABLE_MPI) add_mpi_test("${XIOS_TESTS}") else() - add_executable(testEigenSliceCB_MPI3 - "EigenSliceCB_test.cpp" - "MainMPI.cpp" - "../src/ModelArray.cpp" - "../src/ModelArraySlice.cpp" - ) - target_compile_definitions(testEigenSliceCB_MPI3 PRIVATE USE_MPI - TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\") - target_include_directories( - testEigenSliceCB_MPI3 PRIVATE - ${MODEL_INCLUDE_DIR} - "${ModulesRoot}/StructureModule" - "../src" - "../../dynamics/src" - ) - target_link_libraries(testEigenSliceCB_MPI3 PRIVATE nextsimlib doctest::doctest) - add_executable(testHaloExchangeCB_MPI3 "HaloExchangeCB_test.cpp" "MainMPI.cpp" diff --git a/core/test/EigenSliceCB_test.cpp b/core/test/EigenSliceCB_test.cpp deleted file mode 100644 index 5de23c078..000000000 --- a/core/test/EigenSliceCB_test.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/*! - * @file ModelMetadata_test.cpp - * - * @date 16 Jul 2025 - * @author Tom Meltzer - */ - -#include -#include - -#include "ModelMPI.hpp" -#include "ModelMetadata.hpp" -#include "include/DGModelArray.hpp" -#include "include/EigenSlice.hpp" -#include "include/Halo.hpp" -#include "include/ParametricMesh.hpp" - -namespace Nextsim { - -const std::string testFilesDir = TEST_FILES_DIR; -const std::string file = testFilesDir + "/partition_metadata_3_cb.nc"; - -static const int DG = 3; -static const bool debug = false; - -using Slice = ArraySlicer::Slice; - -void initializeData(ModelArray& ma, int test_rank) -{ - auto& metadata = ModelMetadata::getInstance(); - - const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; - const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; - const size_t offsetX = metadata.getLocalCornerX(); - const size_t offsetY = metadata.getLocalCornerY(); - - auto dof = ma.nComponents(); - - // initialize with mock data - for (size_t j = 0; j < localNy; ++j) { - for (size_t i = 0; i < localNx; ++i) { - for (size_t k = 0; k < dof; ++k) { - ma.components({ i, j })[k] - = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY) + 1000 * (k + 1); - } - } - } -} - -TEST_SUITE_BEGIN("EigenSlice tests"); -MPI_TEST_CASE("test EigenSlice for HField", 3) -{ - - auto& modelMPI = ModelMPI::getInstance(test_comm); - auto& metadata = ModelMetadata::getInstance(file); - - const size_t nx = metadata.getGlobalExtentX(); - const size_t ny = metadata.getGlobalExtentY(); - const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; - const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; - const size_t offsetX = metadata.getLocalCornerX(); - const size_t offsetY = metadata.getLocalCornerY(); - - ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); - ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); - ModelArray::setDimension(ModelArray::Dimension::DG, DG, DG, 0); - - // create example 2D field on each process - auto source = ModelArray::HField(); - auto target = ModelArray::HField(); - source.resize(); - target.resize(); - target = -1; - - initializeData(source, test_rank); - - // check we can copy the middle block from one to the other - Slice sl { { { 1, -1 }, { 1, -1 } } }; - EigenSlice sourceSlice(source, sl); - EigenSlice targetSlice(target, sl); - - sourceSlice.copyToSlicedBuffer(targetSlice); - if (debug) { - std::cout << "HField" << std::endl; - targetSlice.print(); - } - - REQUIRE(target(2, 3) == source(2, 3)); - REQUIRE(target(0, 3) == -1); -} - -MPI_TEST_CASE("test EigenSlice for DGField", 3) -{ - auto& modelMPI = ModelMPI::getInstance(test_comm); - auto& metadata = ModelMetadata::getInstance(); - - const size_t nx = metadata.getGlobalExtentX(); - const size_t ny = metadata.getGlobalExtentY(); - const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; - const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; - const size_t offsetX = metadata.getLocalCornerX(); - const size_t offsetY = metadata.getLocalCornerY(); - - ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); - ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); - ModelArray::setDimension(ModelArray::Dimension::DG, DG, DG, 0); - - // create example 2D field on each process - auto source = ModelArray::DGField(); - auto target = ModelArray::DGField(); - source.resize(); - target.resize(); - target = -1; - - initializeData(source, test_rank); - - // check we can copy the middle block from one to the other - Slice sl { { { 1, -1 }, { 1, -1 } } }; - EigenSlice sourceSlice(source, sl); - EigenSlice targetSlice(target, sl); - - sourceSlice.copyToSlicedBuffer(targetSlice); - if (debug) { - std::cout << "DGField" << std::endl; - targetSlice.print(); - } - - REQUIRE(target.components({ 2, 3 })[1] == source.components({ 2, 3 })[1]); - REQUIRE(target.components({ 0, 3 })[1] == -1); -} - -MPI_TEST_CASE("test EigenSlice for DGVector", 3) -{ - auto& modelMPI = ModelMPI::getInstance(test_comm); - auto& metadata = ModelMetadata::getInstance(); - - const size_t nx = metadata.getGlobalExtentX(); - const size_t ny = metadata.getGlobalExtentY(); - const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; - const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; - const size_t offsetX = metadata.getLocalCornerX(); - const size_t offsetY = metadata.getLocalCornerY(); - - ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); - ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); - ModelArray::setDimension(ModelArray::Dimension::DG, DG, DG, 0); - - auto fake_data = ModelArray::DGField(); - fake_data.resize(); - initializeData(fake_data, test_rank); - - ParametricMesh smesh(CARTESIAN); - smesh.nx = localNx; - smesh.ny = localNy; - smesh.nnodes = localNx * localNy; - smesh.nelements = localNx * localNy; - smesh.vertices.resize(smesh.nelements, Eigen::NoChange); - for (size_t i = 0; i < localNx; ++i) { - for (size_t j = 0; j < localNy; ++j) { - smesh.vertices(i * localNy + j, 0) = i; - smesh.vertices(i * localNy + j, 1) = j; - } - } - DGVector source(smesh); - DGModelArray::ma2dg(fake_data, source); - DGVector target(smesh); - fake_data = -1.; - DGModelArray::ma2dg(fake_data, target); - - // check we can copy the middle block from one to the other - Slice sl { { { 1, -1 }, { 1, -1 } } }; - EigenSlice::EigenDGVector> sourceSlice(source, sl, smesh); - EigenSlice::EigenDGVector> targetSlice(target, sl, smesh); - - sourceSlice.copyToSlicedBuffer(targetSlice); - if (debug) { - std::cout << "DGVector" << std::endl; - targetSlice.print(); - } - - REQUIRE(target(localNx + 1, 1) == source(localNx + 1, 1)); - REQUIRE(target(0, 0) == -1); -} -} From 59b25efdfb9c64b8a0dab64895ed49295b1c0d81 Mon Sep 17 00:00:00 2001 From: tommelt Date: Tue, 19 Aug 2025 15:50:30 +0100 Subject: [PATCH 26/53] wip: halo exchange now supports all field types * DGFields * HFields * VertexFields * DGVectors --- core/src/include/Halo.hpp | 242 +++++++++++++++++--------- core/test/HaloExchangeCB_test.cpp | 263 +++++++++++++++++++++++++---- core/test/HaloExchangePB_test.cpp | 270 ++++++++++++++++++++++++++---- 3 files changed, 632 insertions(+), 143 deletions(-) diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index c3d83db23..3c4f4bd30 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -1,7 +1,7 @@ /*! * @file Halo.hpp * - * @date 10 Jun 2025 + * @date 19 Aug 2025 * @author Tom Meltzer */ @@ -10,7 +10,6 @@ #include #include -#include #include #include @@ -21,6 +20,10 @@ #include "include/ModelMetadata.hpp" #include "mpi.h" +#ifndef HALOWIDTH +#define HALOWIDTH 1 +#endif + #ifndef DGCOMP #define DGCOMP 3 #endif @@ -45,42 +48,74 @@ class Halo { /*! * @brief Constructs a halo object */ - Halo(ModelArray& ma) - : m_ma(ma) + Halo(size_t numComps, bool isVertex = false) + : m_numComps(numComps) + , isVertex(isVertex) + { + setSpatialDims(); + intializeHaloMetadata(); + } + + void setSpatialDims() { - m_innerNx = ma.innerDimensions()[0]; - m_innerNy = ma.innerDimensions()[1]; - m_perimeterLength = 2 * m_innerNx + 2 * m_innerNy; - m_numComps = m_ma.nComponents(); + auto& metadata = ModelMetadata::getInstance(); + + // spatial dimension of domain + m_innerNx = metadata.getLocalExtentX(); + m_innerNy = metadata.getLocalExtentY(); + + // extend dimensions by 1 for vertex fields + if (isVertex) { + m_innerNx += 1; + m_innerNy += 1; + } + + // inner dimension of domain excluding the halo cells + m_Nx = m_innerNx + 2 * haloWidth; + m_Ny = m_innerNy + 2 * haloWidth; + } + + void intializeHaloMetadata() + { + // number of halo cells (should be general for any halo width) + m_numHaloCells = 2 * haloWidth * (m_innerNx + m_innerNy + 2 * haloWidth); + + // need send / recv buffers for each componenet (e.g., each DGCOMP) send.resize(m_numComps); recv.resize(m_numComps); for (size_t i = 0; i < m_numComps; i++) { - send[i].resize(m_perimeterLength, 0.0); - recv[i].resize(m_perimeterLength, 0.0); + // allocate size and initialize to zero + send[i].resize(m_numHaloCells, 0.0); + recv[i].resize(m_numHaloCells, 0.0); } - m_edgeLengths = { m_innerNx, m_innerNy, m_innerNx, m_innerNy }; // order is Bottom + + // order is Bottom, Right, Top, Left + m_edgeLengths = { m_innerNx, m_innerNy, m_innerNx, m_innerNy }; m_outerSlices = { - { Edge::LEFT, VBounds({ { 0 }, { 1, m_innerNy + haloWidth } }) }, + { Edge::BOTTOM, VBounds({ { 1, m_innerNx + haloWidth }, { 0 } }) }, { Edge::RIGHT, VBounds({ { -1 }, { 1, m_innerNy + haloWidth } }) }, { Edge::TOP, VBounds({ { 1, m_innerNx + haloWidth }, { -1 } }) }, - { Edge::BOTTOM, VBounds({ { 1, m_innerNx + haloWidth }, { 0 } }) }, - }; - m_innerSlices = { - { Edge::LEFT, VBounds({ { 1 }, { 1, m_innerNy + haloWidth } }) }, - { Edge::RIGHT, VBounds({ { -2 }, { 1, m_innerNy + haloWidth } }) }, - { Edge::TOP, VBounds({ { 1, m_innerNx + haloWidth }, { -2 } }) }, - { Edge::BOTTOM, VBounds({ { 1, m_innerNx + haloWidth }, { 1 } }) }, - }; - m_innerSlicesVertexAdjusted = { - { Edge::LEFT, VBounds({ { 2 }, { 1, m_innerNy + haloWidth } }) }, - { Edge::RIGHT, VBounds({ { -3 }, { 1, m_innerNy + haloWidth } }) }, - { Edge::TOP, VBounds({ { 1, m_innerNx + haloWidth }, { -3 } }) }, - { Edge::BOTTOM, VBounds({ { 1, m_innerNx + haloWidth }, { 2 } }) }, + { Edge::LEFT, VBounds({ { 0 }, { 1, m_innerNy + haloWidth } }) }, }; + if (isVertex) { + m_innerSlices = { + { Edge::BOTTOM, VBounds({ { 1, m_innerNx + haloWidth }, { 2 } }) }, + { Edge::RIGHT, VBounds({ { -3 }, { 1, m_innerNy + haloWidth } }) }, + { Edge::TOP, VBounds({ { 1, m_innerNx + haloWidth }, { -3 } }) }, + { Edge::LEFT, VBounds({ { 2 }, { 1, m_innerNy + haloWidth } }) }, + }; + } else { + m_innerSlices = { + { Edge::BOTTOM, VBounds({ { 1, m_innerNx + haloWidth }, { 1 } }) }, + { Edge::RIGHT, VBounds({ { -2 }, { 1, m_innerNy + haloWidth } }) }, + { Edge::TOP, VBounds({ { 1, m_innerNx + haloWidth }, { -2 } }) }, + { Edge::LEFT, VBounds({ { 1 }, { 1, m_innerNy + haloWidth } }) }, + }; + } } - static const size_t haloWidth = 1; // how many cells wide is the halo region + static const size_t haloWidth = HALOWIDTH; // how many cells wide is the halo region private: using Slice = ArraySlicer::Slice; @@ -90,18 +125,18 @@ class Halo { const typedef ArraySlicer::SliceIter::MultiDim MultiDim; const MultiDim m_haloDims; - ModelArray& m_ma; // reference to modelarray + + size_t m_Nx; // local extent including halo cells in x-direction + size_t m_Ny; // local extent including halo cells in y-direction size_t m_innerNx; // local extent in x-direction size_t m_innerNy; // local extent in y-direction - size_t m_perimeterLength; // length of perimeter of domain + size_t m_numHaloCells; // number of halo cells size_t m_numComps; // number of DG components + std::array m_edgeLengths; // array containing length of each edge std::array edges = ModelMetadata::edges; // array of edge enums std::map m_outerSlices; std::map m_innerSlices; - std::map m_innerSlicesVertexAdjusted; - MPI_Win m_win; // RMA memory window object (used for sharing send buffers between ranks) - std::map oppositeEdge = { { Edge::LEFT, Edge::RIGHT }, { Edge::RIGHT, Edge::LEFT }, @@ -109,6 +144,38 @@ class Halo { { Edge::BOTTOM, Edge::TOP }, }; // map to opposite edge + /** + * @brief Return true if the provided edge is vertical (LEFT or RIGHT). + * + * @param edge Edge enum to test + * @return true if edge is LEFT or RIGHT, false otherwise + */ + static inline bool isVertical(const Edge edge) + { + return (edge == Edge::LEFT) || (edge == Edge::RIGHT); + } + + /** + * @brief Return true if the provided edge is horizontal (TOP or BOTTOM). + * + * @param edge Edge enum to test + * @return true if edge is TOP or BOTTOM, false otherwise + */ + static inline bool isHorizontal(const Edge edge) + { + return (edge == Edge::TOP) || (edge == Edge::BOTTOM); + } + + MPI_Win m_win; // RMA memory window object (used for sharing send buffers between ranks) + + bool isVertex; // some ModelArrays can be of type VERTEX + + std::vector> + send; // buffer to store halo region that will be read by other ranks + std::vector> + recv; // buffer to store halo region which is read from other ranks + ModelArray::DataType tempBuffer; + /*! * @brief Open memory window to exchange send buffer between MPI ranks. * @@ -119,7 +186,7 @@ class Halo { { // create a RMA memory window which all ranks will be able to access auto& modelMPI = ModelMPI::getInstance(); - MPI_Win_create(&send[idx][0], m_perimeterLength * sizeof(double), sizeof(double), + MPI_Win_create(&send[idx][0], m_numHaloCells * sizeof(double), sizeof(double), MPI_INFO_NULL, modelMPI.getComm(), &m_win); // remove fence and check that no proceding RMA calls have been made MPI_Win_fence(MPI_MODE_NOPRECEDE, m_win); @@ -142,26 +209,35 @@ class Halo { /*! * @brief Populate send buffer with halo data of the specified ModelArray */ - void populateSendBuffers() + template void populateSendBuffers(S& source) { - tempBuffer.resize(m_perimeterLength, m_numComps); + tempBuffer.resize(m_numHaloCells, m_numComps); + tempBuffer = 0.; + for (auto edge : edges) { size_t beg = std::accumulate(m_edgeLengths.begin(), m_edgeLengths.begin() + edge, 0); size_t num = m_edgeLengths.at(edge); - if (m_ma.getType() == ModelArray::Type::VERTEX) { - // because vertex points lie along the domain boundaries we need offset the - // slices by and additional row/column - tempBuffer(Eigen::seqN(beg, num), Eigen::all) - = static_cast(m_ma[m_innerSlicesVertexAdjusted.at(edge)]); + + Slice sourceSlice = m_innerSlices.at(edge); + SliceIter sourceIter(sourceSlice, { m_Nx, m_Ny }); + + if (isVertical(edge)) { + Slice tempBufferSlice = { { {}, { beg, beg + num } } }; + // spatial dims are flattened into 1-D. + SliceIter tempBufferIter(tempBufferSlice, { 1, m_numHaloCells }); + ModelArraySlice::copySliceWithIters(source, sourceIter, tempBuffer, tempBufferIter); } else { - tempBuffer(Eigen::seqN(beg, num), Eigen::all) - = static_cast(m_ma[m_innerSlices.at(edge)]); + Slice tempBufferSlice = { { { beg, beg + num }, {} } }; + // spatial dims are flattened into 1-D. + SliceIter tempBufferIter(tempBufferSlice, { m_numHaloCells, 1 }); + ModelArraySlice::copySliceWithIters(source, sourceIter, tempBuffer, tempBufferIter); } } - // we need to copy into std vector send buffer because MPI doesn't work with Eigen Arrays + // we need to copy into std vector send buffer because MPI doesn't work with Eigen + // Arrays for (size_t i = 0; i < m_numComps; i++) { typedef Eigen::Map MapType; - MapType map(send[i].data(), m_perimeterLength, 1); + MapType map(send[i].data(), m_numHaloCells, 1); // map is connected with the send buffer so the following line sets the data in send map = tempBuffer.col(i); } @@ -190,7 +266,7 @@ class Halo { size_t count = metadata.neighbourExtents[edge][i]; size_t disp = metadata.neighbourHaloSend[edge][i]; size_t recvOffset = metadata.neighbourHaloRecv[edge][i]; - if (m_ma.getType() == ModelArray::Type::VERTEX) { + if (isVertex) { vertexAdjustedPositions( count = count, disp = disp, recvOffset = recvOffset, edge = edge); } @@ -210,7 +286,7 @@ class Halo { size_t count = metadata.neighbourExtentsPeriodic[edge][i]; size_t disp = metadata.neighbourHaloSendPeriodic[edge][i]; size_t recvOffset = metadata.neighbourHaloRecvPeriodic[edge][i]; - if (m_ma.getType() == ModelArray::Type::VERTEX) { + if (isVertex) { vertexAdjustedPositions( count = count, disp = disp, recvOffset = recvOffset, edge = edge); } @@ -220,15 +296,15 @@ class Halo { } } - // close memory window (essentially make sure all communications are done before moving - // on) + // close memory window (essentially make sure all communications are done before + // moving on) closeMemoryWindow(); } // copy from the recv std vector into an eigen array for (size_t i = 0; i < m_numComps; i++) { typedef Eigen::Map MapType; - MapType map(recv[i].data(), m_perimeterLength, 1); + MapType map(recv[i].data(), m_numHaloCells, 1); // map is connected with the recv buffer so the following line copies the data into // tempBuffer tempBuffer.col(i) = map; @@ -243,50 +319,38 @@ class Halo { } public: - std::vector> - send; // buffer to store halo region that will be read by other ranks - std::vector> - recv; // buffer to store halo region which is read from other ranks - ModelArray::DataType tempBuffer; - /*! * @brief Returns size of the inner flattened array */ size_t getInnerSize() { return m_innerNx * m_innerNy; } /*! - * @brief Populate inner block of ModelArray from tempData + * @brief Get inner block of ModelArray from tempData * * @params ma ModelArray which we intend to update across MPI ranks */ - void setInnerBlock(ModelArray::DataType& tempData) + template void getInnerBlock(S& source, T& target) { - ArraySlicer::Slice::VBounds innerBlock, allBlock; - innerBlock = { { 1, -1 }, { 1, -1 } }; - allBlock = { {}, {} }; - ArraySlicer::SliceIter wholeBlock(allBlock, m_ma.innerDimensions()); + ArraySlicer::Slice::VBounds sourceSlice, targetSlice; + sourceSlice = { { HALOWIDTH, -HALOWIDTH }, { HALOWIDTH, -HALOWIDTH } }; + targetSlice = { {}, {} }; + ArraySlicer::SliceIter sourceIter(sourceSlice, { m_Nx, m_Ny }); + ArraySlicer::SliceIter targetIter(targetSlice, { m_innerNx, m_innerNy }); - m_ma = 0.; // TODO -- should this be removed? It does mean that mask is zero by default - - // copy temp data to the central block of the main modelarray - m_ma[innerBlock].copyFromSlicedBuffer(tempData, wholeBlock); + ModelArraySlice::copySliceWithIters(source, sourceIter, target, targetIter); } - /*! - * @brief Get inner block of ModelArray from tempData - * - * @params ma ModelArray which we intend to update across MPI ranks - */ - void getInnerBlock(ModelArray::DataType& tempData) + template void setInnerBlock(S& source, T& target) { - tempData.resize(m_innerNx * m_innerNy, m_numComps); - ArraySlicer::Slice::VBounds innerBlock, allBlock; - innerBlock = { { 1, -1 }, { 1, -1 } }; - allBlock = { {}, {} }; - ArraySlicer::SliceIter wholeBlock(allBlock, m_ma.innerDimensions()); - - // copy temp data to the central block of the main modelarray - m_ma[innerBlock].copyToSlicedBuffer(tempData, wholeBlock); + ArraySlicer::Slice::VBounds sourceSlice, targetSlice; + sourceSlice = { {}, {} }; + targetSlice = { { HALOWIDTH, -HALOWIDTH }, { HALOWIDTH, -HALOWIDTH } }; + ArraySlicer::SliceIter sourceIter(sourceSlice, { m_innerNx, m_innerNy }); + ArraySlicer::SliceIter targetIter(targetSlice, { m_Nx, m_Ny }); + + // target = 0.; // everything outside the inner block should be initialized to zero. + + ModelArraySlice::copySliceWithIters(source, sourceIter, target, targetIter); } /*! @@ -306,17 +370,29 @@ class Halo { * │ │x│x│ │ (empty) = unused data in DGVector * └─┴─┴─┴─┘ */ - void exchangeHalos() + template void exchangeHalos(T& target) { - populateSendBuffers(); + populateSendBuffers(target); populateRecvBuffers(); for (auto edge : edges) { size_t beg = std::accumulate(m_edgeLengths.begin(), m_edgeLengths.begin() + edge, 0); size_t num = m_edgeLengths.at(edge); - // m_ma[m_outerSlices.at(edge)] = tempBuffer(Eigen::seqN(beg, num), Eigen::all); - m_ma[m_outerSlices.at(edge)] - = ModelArray::DataType(tempBuffer(Eigen::seqN(beg, num), Eigen::all)); + + Slice targetSlice = m_outerSlices.at(edge); + SliceIter targetIter(targetSlice, { m_Nx, m_Ny }); + + if (isVertical(edge)) { + Slice tempBufferSlice = { { {}, { beg, beg + num } } }; + // spatial dims are flattened into 1-D. + SliceIter tempBufferIter(tempBufferSlice, { 1, m_numHaloCells }); + ModelArraySlice::copySliceWithIters(tempBuffer, tempBufferIter, target, targetIter); + } else { + Slice tempBufferSlice = { { { beg, beg + num }, {} } }; + // spatial dims are flattened into 1-D. + SliceIter tempBufferIter(tempBufferSlice, { m_numHaloCells, 1 }); + ModelArraySlice::copySliceWithIters(tempBuffer, tempBufferIter, target, targetIter); + } } } }; diff --git a/core/test/HaloExchangeCB_test.cpp b/core/test/HaloExchangeCB_test.cpp index b0567904f..4d707ef76 100644 --- a/core/test/HaloExchangeCB_test.cpp +++ b/core/test/HaloExchangeCB_test.cpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata_test.cpp * - * @date 10 Jun 2025 + * @date 19 Aug 2025 * @author Tom Meltzer */ @@ -9,6 +9,7 @@ #include "ModelMPI.hpp" #include "ModelMetadata.hpp" +#include "include/DGModelArray.hpp" #include "include/Halo.hpp" namespace Nextsim { @@ -19,13 +20,30 @@ const std::string file = testFilesDir + "/partition_metadata_3_cb.nc"; static const int DG = 3; static const bool debug = false; -void initializeHField(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, - size_t offsetY, int test_rank) +// reference data for each process +static std::array, 3> refDataAllProcs = { + std::vector({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 110, 120, 130, 140, 150, 160, 370, 0, + 101, 111, 121, 131, 141, 151, 161, 371, 0, 102, 112, 122, 132, 142, 152, 162, 372, 0, 103, + 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, 244, 254, 264, 0 }), + std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 0, 204, 214, 224, 234, 244, 254, + 264, 374, 0, 205, 215, 225, 235, 245, 255, 265, 375, 0, 206, 216, 226, 236, 246, 256, 266, + 376, 0, 207, 217, 227, 237, 247, 257, 267, 377, 0, 208, 218, 228, 238, 248, 258, 268, 378, + 0, 0, 0, 0, 0, 0, 0, 0, 0 }), + std::vector({ 0, 0, 0, 0, 0, 160, 370, 380, 390, 0, 161, 371, 381, 391, 0, 162, 372, + 382, 392, 0, 163, 373, 383, 393, 0, 264, 374, 384, 394, 0, 265, 375, 385, 395, 0, 266, 376, + 386, 396, 0, 267, 377, 387, 397, 0, 268, 378, 388, 398, 0, 0, 0, 0, 0, 0 }), +}; + +void initializeTestData(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, + size_t offsetY, size_t numComps, int test_rank) { - // initialize with mock data + // initialize with test data for (size_t j = 0; j < localNy; ++j) { for (size_t i = 0; i < localNx; ++i) { - data(i + j * localNx) = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); + for (size_t d = 0; d < numComps; ++d) { + data(d + i * numComps + j * localNx * numComps) + = (d + 1) * 1000 + (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); + } } } } @@ -52,46 +70,233 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, localNx + 1, offsetX); + ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, localNy + 1, offsetY); // create example 2D field on each process auto testData = ModelArray::HField(); testData.resize(); + testData = 0.; // create halo for testData model array - Halo halo(testData); + Halo halo(testData.nComponents()); // create and allocate temporary Eigen array ModelArray::DataType innerData; innerData.resize(halo.getInnerSize(), testData.nComponents()); - initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); + initializeTestData( + innerData, localNx - 2, localNy - 2, offsetX, offsetY, testData.nComponents(), test_rank); // populate inner block of modelarray - halo.setInnerBlock(innerData); + halo.setInnerBlock(innerData, testData.getDataRef()); // exchange halos - halo.exchangeHalos(); - - std::array, 3> mockDataAllProcs = { - std::vector({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 110, 120, 130, 140, 150, 160, 370, - 0, 101, 111, 121, 131, 141, 151, 161, 371, 0, 102, 112, 122, 132, 142, 152, 162, 372, 0, - 103, 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, 244, 254, 264, 0 }), - std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 0, 204, 214, 224, 234, 244, - 254, 264, 374, 0, 205, 215, 225, 235, 245, 255, 265, 375, 0, 206, 216, 226, 236, 246, - 256, 266, 376, 0, 207, 217, 227, 237, 247, 257, 267, 377, 0, 208, 218, 228, 238, 248, - 258, 268, 378, 0, 0, 0, 0, 0, 0, 0, 0, 0 }), - std::vector({ 0, 0, 0, 0, 0, 160, 370, 380, 390, 0, 161, 371, 381, 391, 0, 162, 372, - 382, 392, 0, 163, 373, 383, 393, 0, 264, 374, 384, 394, 0, 265, 375, 385, 395, 0, 266, - 376, 386, 396, 0, 267, 377, 387, 397, 0, 268, 378, 388, 398, 0, 0, 0, 0, 0, 0 }), - }; - - // create mock eigen matrix for each process - ModelArray::DataType mockData; - mockData.resize(localNx * localNy, 1); - mockData - = Eigen::Map(mockDataAllProcs[test_rank].data(), mockData.size(), 1); + halo.exchangeHalos(testData.getDataRef()); + + // initialize reference data for each proc + ModelArray::DataType refData; + refData.resize(localNx * localNy, 1); + refData + = Eigen::Map(refDataAllProcs[test_rank].data(), refData.size(), 1); + + for (size_t j = 0; j < localNy; j++) { + for (size_t i = 0; i < localNx; i++) { + if (refData(i + j * localNx) > 0) { + REQUIRE(testData(i, j) == 1000. + refData(i + j * localNx)); + } else { + REQUIRE(testData(i, j) == 0.); + } + } + } + + VertexField coordinates = ModelArray::VertexField(); + coordinates.resize(); + coordinates = 0.; + + Halo haloVertex(coordinates.nComponents(), true); + + // Vetex coordinates + auto localNxVertex = localNx + 1; + auto localNyVertex = localNy + 1; + for (size_t i = 0; i < localNxVertex - 2 * Halo::haloWidth; ++i) { + for (size_t j = 0; j < localNyVertex - 2 * Halo::haloWidth; ++j) { + double x = (i + offsetX) - 0.5 - float(nx) / 2; + double y = (j + offsetY) - 0.5 - float(ny) / 2; + coordinates.components({ i + Halo::haloWidth, j + Halo::haloWidth })[0] = x * 100.; + coordinates.components({ i + Halo::haloWidth, j + Halo::haloWidth })[1] = y * 100.; + } + } + + haloVertex.exchangeHalos(coordinates.getDataRef()); + + std::vector refDataVertex; + + if (test_rank == 0) { + refDataVertex = std::vector({ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., -550., -500., -450., -500., -350., -500., -250., + -500., -150., -500., -50., -500., 50., -500., 150., -500., 250., -500., 0., 0., -550., + -400., -450., -400., -350., -400., -250., -400., -150., -400., -50., -400., 50., -400., + 150., -400., 250., -400., 0., 0., -550., -300., -450., -300., -350., -300., -250., + -300., -150., -300., -50., -300., 50., -300., 150., -300., 250., -300., 0., 0., -550., + -200., -450., -200., -350., -200., -250., -200., -150., -200., -50., -200., 50., -200., + 150., -200., 250., -200., 0., 0., -550., -100., -450., -100., -350., -100., -250., + -100., -150., -100., -50., -100., 50., -100., 150., -100., 250., -100., 0., 0., -550., + 0., -450., 0., -350., 0., -250., 0., -150., 0., -50., 0., 50., 0., 150., 0., 0., 0. }); + } + if (test_rank == 1) { + refDataVertex = std::vector({ 0., 0., -550., -200., -450., -200., -350., -200., + -250., -200., -150., -200., -50., -200., 50., -200., 150., -200., 0., 0., 0., 0., -550., + -100., -450., -100., -350., -100., -250., -100., -150., -100., -50., -100., 50., -100., + 150., -100., 250., -100., 0., 0., -550., 0., -450., 0., -350., 0., -250., 0., -150., 0., + -50., 0., 50., 0., 150., 0., 250., 0., 0., 0., -550., 100., -450., 100., -350., 100., + -250., 100., -150., 100., -50., 100., 50., 100., 150., 100., 250., 100., 0., 0., -550., + 200., -450., 200., -350., 200., -250., 200., -150., 200., -50., 200., 50., 200., 150., + 200., 250., 200., 0., 0., -550., 300., -450., 300., -350., 300., -250., 300., -150., + 300., -50., 300., 50., 300., 150., 300., 250., 300., 0., 0., -550., 400., -450., 400., + -350., 400., -250., 400., -150., 400., -50., 400., 50., 400., 150., 400., 250., 400., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. }); + } + if (test_rank == 2) { + refDataVertex = std::vector({ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 50., + -500., 150., -500., 250., -500., 350., -500., 450., -500., 0., 0., 50., -400., 150., + -400., 250., -400., 350., -400., 450., -400., 0., 0., 50., -300., 150., -300., 250., + -300., 350., -300., 450., -300., 0., 0., 50., -200., 150., -200., 250., -200., 350., + -200., 450., -200., 0., 0., 50., -100., 150., -100., 250., -100., 350., -100., 450., + -100., 0., 0., 50., 0., 150., 0., 250., 0., 350., 0., 450., 0., 0., 0., 50., 100., 150., + 100., 250., 100., 350., 100., 450., 100., 0., 0., 50., 200., 150., 200., 250., 200., + 350., 200., 450., 200., 0., 0., 50., 300., 150., 300., 250., 300., 350., 300., 450., + 300., 0., 0., 50., 400., 150., 400., 250., 400., 350., 400., 450., 400., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. }); + } + + auto coordRef = coordinates.getDataRef(); + for (size_t j = 0; j < localNyVertex; j++) { + for (size_t i = 0; i < localNxVertex; i++) { + for (size_t coord = 0; coord < 2; coord++) { + REQUIRE(coordRef(i + j * localNxVertex, coord) + == refDataVertex[coord + i * 2 + j * localNxVertex * 2]); + } + } + } +} + +MPI_TEST_CASE("DGField", 3) +{ + auto& modelMPI = ModelMPI::getInstance(); + auto& metadata = ModelMetadata::getInstance(); + + const size_t nx = metadata.getGlobalExtentX(); + const size_t ny = metadata.getGlobalExtentY(); + const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const size_t offsetX = metadata.getLocalCornerX(); + const size_t offsetY = metadata.getLocalCornerY(); + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + ModelArray::setNComponents(ModelArray::Type::DG, DG); + + // create example 2D field on each process + auto testData = ModelArray::DGField(); + testData.resize(); + testData = 0.; + + // create halo for testData model array + Halo halo(testData.nComponents()); + + // create and allocate temporary Eigen array + ModelArray::DataType innerData; + innerData.resize(halo.getInnerSize(), testData.nComponents()); + initializeTestData( + innerData, localNx - 2, localNy - 2, offsetX, offsetY, testData.nComponents(), test_rank); + + // populate inner block of modelarray + halo.setInnerBlock(innerData, testData.getDataRef()); + // exchange halos + halo.exchangeHalos(testData.getDataRef()); + + // initialize reference data for each proc + ModelArray::DataType refData; + refData.resize(localNx * localNy, 1); + refData + = Eigen::Map(refDataAllProcs[test_rank].data(), refData.size(), 1); + + for (size_t j = 0; j < localNy; j++) { + for (size_t i = 0; i < localNx; i++) { + for (size_t d = 0; d < DG; ++d) { + if (refData(i + j * localNx) > 0) { + REQUIRE(testData.components({ i, j })[d] + == (d + 1) * 1000. + refData(i + j * localNx)); + } else { + REQUIRE(testData.components({ i, j })[d] == 0.); + } + } + } + } +} + +MPI_TEST_CASE("DGVector", 3) +{ + auto& modelMPI = ModelMPI::getInstance(); + auto& metadata = ModelMetadata::getInstance(); + + const size_t nx = metadata.getGlobalExtentX(); + const size_t ny = metadata.getGlobalExtentY(); + const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const size_t offsetX = metadata.getLocalCornerX(); + const size_t offsetY = metadata.getLocalCornerY(); + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + ModelArray::setNComponents(ModelArray::Type::DG, DG); + + ParametricMesh smesh(CARTESIAN); + smesh.nx = localNx; + smesh.ny = localNy; + smesh.nnodes = localNx * localNy; + smesh.nelements = localNx * localNy; + smesh.vertices.resize(smesh.nelements, Eigen::NoChange); + for (size_t i = 0; i < localNx; ++i) { + for (size_t j = 0; j < localNy; ++j) { + smesh.vertices(i * localNy + j, 0) = i; + smesh.vertices(i * localNy + j, 1) = j; + } + } + + // create example DGVector + DGVector testData(smesh); + testData.zero(); + + // create halo for testData model array + Halo halo(DG); + + // create and allocate temporary Eigen array + ModelArray::DataType innerData; + innerData.resize(halo.getInnerSize(), DG); + initializeTestData(innerData, localNx - 2, localNy - 2, offsetX, offsetY, DG, test_rank); + + // populate inner block of modelarray + halo.setInnerBlock(innerData, testData); + + // exchange halos + halo.exchangeHalos(testData); + + // initialize reference data for each proc + ModelArray::DataType refData; + refData.resize(localNx * localNy, 1); + refData + = Eigen::Map(refDataAllProcs[test_rank].data(), refData.size(), 1); for (size_t j = 0; j < localNy; j++) { for (size_t i = 0; i < localNx; i++) { - REQUIRE(testData(i, j) == mockData(i + j * localNx)); + for (size_t d = 0; d < DG; ++d) { + if (refData(i + j * localNx) > 0) { + REQUIRE( + testData(i + j * localNx, d) == (d + 1) * 1000. + refData(i + j * localNx)); + } else { + REQUIRE(testData(i + j * localNx, d) == 0.); + } + } } } } diff --git a/core/test/HaloExchangePB_test.cpp b/core/test/HaloExchangePB_test.cpp index b0a505bd9..d2218d32a 100644 --- a/core/test/HaloExchangePB_test.cpp +++ b/core/test/HaloExchangePB_test.cpp @@ -1,7 +1,7 @@ /*! * @file ModelMetadata_test.cpp * - * @date 10 Jun 2025 + * @date 19 Aug 2025 * @author Tom Meltzer */ @@ -9,6 +9,7 @@ #include "ModelMPI.hpp" #include "ModelMetadata.hpp" +#include "include/DGModelArray.hpp" #include "include/Halo.hpp" namespace Nextsim { @@ -19,13 +20,32 @@ const std::string file = testFilesDir + "/partition_metadata_3_pb.nc"; static const int DG = 3; static const bool debug = false; -void initializeHField(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, - size_t offsetY, int test_rank) +// reference data for each process +static std::array, 3> refDataAllProcs = { + std::vector( + { 0, 208, 218, 228, 238, 248, 258, 268, 0, 390, 100, 110, 120, 130, 140, 150, 160, 370, 391, + 101, 111, 121, 131, 141, 151, 161, 371, 392, 102, 112, 122, 132, 142, 152, 162, 372, + 393, 103, 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, 244, 254, 264, 0 }), + std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 394, 204, 214, 224, 234, 244, + 254, 264, 374, 395, 205, 215, 225, 235, 245, 255, 265, 375, 396, 206, 216, 226, 236, 246, + 256, 266, 376, 397, 207, 217, 227, 237, 247, 257, 267, 377, 398, 208, 218, 228, 238, 248, + 258, 268, 378, 0, 100, 110, 120, 130, 140, 150, 160, 0 }), + std::vector({ 0, 378, 388, 398, 0, 160, 370, 380, 390, 100, 161, 371, 381, 391, 101, + 162, 372, 382, 392, 102, 163, 373, 383, 393, 103, 264, 374, 384, 394, 204, 265, 375, 385, + 395, 205, 266, 376, 386, 396, 206, 267, 377, 387, 397, 207, 268, 378, 388, 398, 208, 0, 370, + 380, 390, 0 }), +}; + +void initializeTestData(ModelArray::DataType& data, size_t localNx, size_t localNy, size_t offsetX, + size_t offsetY, size_t numComps, int test_rank) { - // initialize with mock data + // initialize with test data for (size_t j = 0; j < localNy; ++j) { for (size_t i = 0; i < localNx; ++i) { - data(i + j * localNx) = (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); + for (size_t d = 0; d < numComps; ++d) { + data(d + i * numComps + j * localNx * numComps) + = (d + 1) * 1000 + (test_rank + 1) * 100 + (i + offsetX) * 10 + (j + offsetY); + } } } } @@ -52,48 +72,236 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditio ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, localNx + 1, offsetX); + ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, localNy + 1, offsetY); // create example 2D field on each process auto testData = ModelArray::HField(); testData.resize(); + testData = 0.; // create halo for testData model array - Halo halo(testData); + Halo halo(testData.nComponents()); // create and allocate temporary Eigen array ModelArray::DataType innerData; innerData.resize(halo.getInnerSize(), testData.nComponents()); - initializeHField(innerData, localNx - 2, localNy - 2, offsetX, offsetY, test_rank); + initializeTestData( + innerData, localNx - 2, localNy - 2, offsetX, offsetY, testData.nComponents(), test_rank); // populate inner block of modelarray - halo.setInnerBlock(innerData); + halo.setInnerBlock(innerData, testData.getDataRef()); // exchange halos - halo.exchangeHalos(); - - std::array, 3> mockDataAllProcs = { - std::vector({ 0, 208, 218, 228, 238, 248, 258, 268, 0, 390, 100, 110, 120, 130, 140, - 150, 160, 370, 391, 101, 111, 121, 131, 141, 151, 161, 371, 392, 102, 112, 122, 132, - 142, 152, 162, 372, 393, 103, 113, 123, 133, 143, 153, 163, 373, 0, 204, 214, 224, 234, - 244, 254, 264, 0 }), - std::vector({ 0, 103, 113, 123, 133, 143, 153, 163, 0, 394, 204, 214, 224, 234, 244, - 254, 264, 374, 395, 205, 215, 225, 235, 245, 255, 265, 375, 396, 206, 216, 226, 236, - 246, 256, 266, 376, 397, 207, 217, 227, 237, 247, 257, 267, 377, 398, 208, 218, 228, - 238, 248, 258, 268, 378, 0, 100, 110, 120, 130, 140, 150, 160, 0 }), - std::vector({ 0, 378, 388, 398, 0, 160, 370, 380, 390, 100, 161, 371, 381, 391, 101, - 162, 372, 382, 392, 102, 163, 373, 383, 393, 103, 264, 374, 384, 394, 204, 265, 375, - 385, 395, 205, 266, 376, 386, 396, 206, 267, 377, 387, 397, 207, 268, 378, 388, 398, - 208, 0, 370, 380, 390, 0 }), - }; - - // create mock eigen matrix for each process - ModelArray::DataType mockData; - mockData.resize(localNx * localNy, 1); - mockData - = Eigen::Map(mockDataAllProcs[test_rank].data(), mockData.size(), 1); + halo.exchangeHalos(testData.getDataRef()); + + // initialize reference data for each proc + ModelArray::DataType refData; + refData.resize(localNx * localNy, 1); + refData + = Eigen::Map(refDataAllProcs[test_rank].data(), refData.size(), 1); + + for (size_t j = 0; j < localNy; j++) { + for (size_t i = 0; i < localNx; i++) { + if (refData(i + j * localNx) > 0) { + REQUIRE(testData(i, j) == 1000. + refData(i + j * localNx)); + } else { + REQUIRE(testData(i, j) == 0.); + } + } + } + + VertexField coordinates = ModelArray::VertexField(); + coordinates.resize(); + coordinates = 0.; + + Halo haloVertex(coordinates.nComponents(), true); + + // Vetex coordinates + auto localNxVertex = localNx + 1; + auto localNyVertex = localNy + 1; + for (size_t i = 0; i < localNxVertex - 2 * Halo::haloWidth; ++i) { + for (size_t j = 0; j < localNyVertex - 2 * Halo::haloWidth; ++j) { + double x = (i + offsetX) - 0.5 - float(nx) / 2; + double y = (j + offsetY) - 0.5 - float(ny) / 2; + coordinates.components({ i + Halo::haloWidth, j + Halo::haloWidth })[0] = x * 100.; + coordinates.components({ i + Halo::haloWidth, j + Halo::haloWidth })[1] = y * 100.; + } + } + + haloVertex.exchangeHalos(coordinates.getDataRef()); + + std::vector refDataVertex; + + if (test_rank == 0) { + refDataVertex = std::vector({ 0., 0., -550., 300., -450., 300., -350., 300., -250., + 300., -150., 300., -50., 300., 50., 300., 150., 300., 0., 0., 350., -500., -550., -500., + -450., -500., -350., -500., -250., -500., -150., -500., -50., -500., 50., -500., 150., + -500., 250., -500., 350., -400., -550., -400., -450., -400., -350., -400., -250., -400., + -150., -400., -50., -400., 50., -400., 150., -400., 250., -400., 350., -300., -550., + -300., -450., -300., -350., -300., -250., -300., -150., -300., -50., -300., 50., -300., + 150., -300., 250., -300., 350., -200., -550., -200., -450., -200., -350., -200., -250., + -200., -150., -200., -50., -200., 50., -200., 150., -200., 250., -200., 350., -100., + -550., -100., -450., -100., -350., -100., -250., -100., -150., -100., -50., -100., 50., + -100., 150., -100., 250., -100., 0., 0., -550., 0., -450., 0., -350., 0., -250., 0., + -150., 0., -50., 0., 50., 0., 150., 0., 0., 0. }); + } + if (test_rank == 1) { + refDataVertex = std::vector({ 0., 0., -550., -200., -450., -200., -350., -200., + -250., -200., -150., -200., -50., -200., 50., -200., 150., -200., 0., 0., 350., -100., + -550., -100., -450., -100., -350., -100., -250., -100., -150., -100., -50., -100., 50., + -100., 150., -100., 250., -100., 350., 0., -550., 0., -450., 0., -350., 0., -250., 0., + -150., 0., -50., 0., 50., 0., 150., 0., 250., 0., 350., 100., -550., 100., -450., 100., + -350., 100., -250., 100., -150., 100., -50., 100., 50., 100., 150., 100., 250., 100., + 350., 200., -550., 200., -450., 200., -350., 200., -250., 200., -150., 200., -50., 200., + 50., 200., 150., 200., 250., 200., 350., 300., -550., 300., -450., 300., -350., 300., + -250., 300., -150., 300., -50., 300., 50., 300., 150., 300., 250., 300., 350., 400., + -550., 400., -450., 400., -350., 400., -250., 400., -150., 400., -50., 400., 50., 400., + 150., 400., 250., 400., 0., 0., -550., -400., -450., -400., -350., -400., -250., -400., + -150., -400., -50., -400., 50., -400., 150., -400., 0., 0. }); + } + if (test_rank == 2) { + refDataVertex = std::vector({ 0., 0., 150., 300., 250., 300., 350., 300., 450., + 300., 0., 0., 50., -500., 150., -500., 250., -500., 350., -500., 450., -500., -450., + -500., 50., -400., 150., -400., 250., -400., 350., -400., 450., -400., -450., -400., + 50., -300., 150., -300., 250., -300., 350., -300., 450., -300., -450., -300., 50., + -200., 150., -200., 250., -200., 350., -200., 450., -200., -450., -200., 50., -100., + 150., -100., 250., -100., 350., -100., 450., -100., -450., -100., 50., 0., 150., 0., + 250., 0., 350., 0., 450., 0., -450., 0., 50., 100., 150., 100., 250., 100., 350., 100., + 450., 100., -450., 100., 50., 200., 150., 200., 250., 200., 350., 200., 450., 200., + -450., 200., 50., 300., 150., 300., 250., 300., 350., 300., 450., 300., -450., 300., + 50., 400., 150., 400., 250., 400., 350., 400., 450., 400., -450., 400., 0., 0., 150., + -400., 250., -400., 350., -400., 450., -400., 0., 0. }); + } + + auto coordRef = coordinates.getDataRef(); + for (size_t j = 0; j < localNyVertex; j++) { + for (size_t i = 0; i < localNxVertex; i++) { + for (size_t coord = 0; coord < 2; coord++) { + REQUIRE(coordRef(i + j * localNxVertex, coord) + == refDataVertex[coord + i * 2 + j * localNxVertex * 2]); + } + } + } +} + +MPI_TEST_CASE("DGField", 3) +{ + auto& modelMPI = ModelMPI::getInstance(); + auto& metadata = ModelMetadata::getInstance(); + + const size_t nx = metadata.getGlobalExtentX(); + const size_t ny = metadata.getGlobalExtentY(); + const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const size_t offsetX = metadata.getLocalCornerX(); + const size_t offsetY = metadata.getLocalCornerY(); + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + ModelArray::setNComponents(ModelArray::Type::DG, DG); + + // create example 2D field on each process + auto testData = ModelArray::DGField(); + testData.resize(); + testData = 0.; + + // create halo for testData model array + Halo halo(testData.nComponents()); + + // create and allocate temporary Eigen array + ModelArray::DataType innerData; + innerData.resize(halo.getInnerSize(), testData.nComponents()); + initializeTestData( + innerData, localNx - 2, localNy - 2, offsetX, offsetY, testData.nComponents(), test_rank); + + // populate inner block of modelarray + halo.setInnerBlock(innerData, testData.getDataRef()); + // exchange halos + halo.exchangeHalos(testData.getDataRef()); + + // initialize reference data for each proc + ModelArray::DataType refData; + refData.resize(localNx * localNy, 1); + refData + = Eigen::Map(refDataAllProcs[test_rank].data(), refData.size(), 1); + + for (size_t j = 0; j < localNy; j++) { + for (size_t i = 0; i < localNx; i++) { + for (size_t d = 0; d < DG; ++d) { + if (refData(i + j * localNx) > 0) { + REQUIRE(testData.components({ i, j })[d] + == (d + 1) * 1000. + refData(i + j * localNx)); + } else { + REQUIRE(testData.components({ i, j })[d] == 0.); + } + } + } + } +} + +MPI_TEST_CASE("DGVector", 3) +{ + auto& modelMPI = ModelMPI::getInstance(); + auto& metadata = ModelMetadata::getInstance(); + + const size_t nx = metadata.getGlobalExtentX(); + const size_t ny = metadata.getGlobalExtentY(); + const size_t localNx = metadata.getLocalExtentX() + 2 * Halo::haloWidth; + const size_t localNy = metadata.getLocalExtentY() + 2 * Halo::haloWidth; + const size_t offsetX = metadata.getLocalCornerX(); + const size_t offsetY = metadata.getLocalCornerY(); + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNx, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNy, offsetY); + ModelArray::setNComponents(ModelArray::Type::DG, DG); + + ParametricMesh smesh(CARTESIAN); + smesh.nx = localNx; + smesh.ny = localNy; + smesh.nnodes = localNx * localNy; + smesh.nelements = localNx * localNy; + smesh.vertices.resize(smesh.nelements, Eigen::NoChange); + for (size_t i = 0; i < localNx; ++i) { + for (size_t j = 0; j < localNy; ++j) { + smesh.vertices(i * localNy + j, 0) = i; + smesh.vertices(i * localNy + j, 1) = j; + } + } + + // create example DGVector + DGVector testData(smesh); + testData.zero(); + + // create halo for testData model array + Halo halo(DG); + + // create and allocate temporary Eigen array + ModelArray::DataType innerData; + innerData.resize(halo.getInnerSize(), DG); + initializeTestData(innerData, localNx - 2, localNy - 2, offsetX, offsetY, DG, test_rank); + + // populate inner block of modelarray + halo.setInnerBlock(innerData, testData); + + // exchange halos + halo.exchangeHalos(testData); + + // initialize reference data for each proc + ModelArray::DataType refData; + refData.resize(localNx * localNy, 1); + refData + = Eigen::Map(refDataAllProcs[test_rank].data(), refData.size(), 1); for (size_t j = 0; j < localNy; j++) { for (size_t i = 0; i < localNx; i++) { - REQUIRE(testData(i, j) == mockData(i + j * localNx)); + for (size_t d = 0; d < DG; ++d) { + if (refData(i + j * localNx) > 0) { + REQUIRE( + testData(i + j * localNx, d) == (d + 1) * 1000. + refData(i + j * localNx)); + } else { + REQUIRE(testData(i + j * localNx, d) == 0.); + } + } } } } From 1be823030bb104b854c01189bb7695f9882d967c Mon Sep 17 00:00:00 2001 From: tommelt Date: Tue, 19 Aug 2025 17:12:42 +0100 Subject: [PATCH 27/53] wip: fix most halo but some tests still broken --- core/src/ParaGridIO.cpp | 54 +++++++++++++++------------- core/src/include/ModelArray.hpp | 43 +++++++++++----------- core/src/include/ModelArraySlice.hpp | 6 ++-- dynamics/src/include/dgVector.hpp | 6 +--- 4 files changed, 57 insertions(+), 52 deletions(-) diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index ef80c9e77..59a2a9d7a 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGridIO.cpp * - * @date 04 Aug 2025 + * @date 19 Aug 2025 * @author Tim Spain */ @@ -140,8 +140,8 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) localLength = dim.getSize(); start = 0; } - ModelArray::setDimension(dimType, dim.getSize() + 2 * Halo::haloWidth, - localLength + 2 * Halo::haloWidth, start); + ModelArray::setDimension( + dimType, dim.getSize() + 2 * HALOWIDTH, localLength + 2 * HALOWIDTH, start); #else ModelArray::setDimension(dimType, dim.getSize()); #endif @@ -183,10 +183,10 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) size_t localLength = dim.localLength; #ifdef USE_MPI if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * Halo::haloWidth; + localLength = localLength - 2 * HALOWIDTH; } if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { - localLength = localLength - 2 * Halo::haloWidth; + localLength = localLength - 2 * HALOWIDTH; } #endif start.push_back(startIndex); @@ -203,15 +203,15 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) // need to check what happens for non-H-field modelarrays // need to figure out what happens w.r.t to coords in non-periodic and periodic case - Halo halo(data); + Halo halo(data.nComponents(), type == ModelArray::Type::VERTEX); // create and allocate temporary Eigen array ModelArray::DataType tempData; tempData.resize(halo.getInnerSize(), data.nComponents()); // populate temp Eigen array with data from netCDF file var.getVar(start, count, tempData.data()); // populate inner block of modelarray with data from tempData - halo.setInnerBlock(tempData); - halo.exchangeHalos(); + halo.setInnerBlock(tempData, data.getDataRef()); + halo.exchangeHalos(data.getDataRef()); #else var.getVar(start, count, &data[0]); #endif @@ -265,10 +265,10 @@ ModelState ParaGridIO::readForcingTimeStatic( auto localLength = dim.localLength; #ifdef USE_MPI if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * Halo::haloWidth; + localLength = localLength - 2 * HALOWIDTH; } if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { - localLength = localLength - 2 * Halo::haloWidth; + localLength = localLength - 2 * HALOWIDTH; } #endif indexArray.push_back(startIndex); @@ -292,15 +292,15 @@ ModelState ParaGridIO::readForcingTimeStatic( data.resize(); #ifdef USE_MPI - Halo halo(data); + Halo halo(data.nComponents(), false); // create and allocate temporary Eigen array ModelArray::DataType tempData; tempData.resize(halo.getInnerSize(), data.nComponents()); // populate temp Eigen array with data from netCDF file var.getVar(indexArray, extentArray, tempData.data()); // populate inner block of modelarray with data from tempData - halo.setInnerBlock(tempData); - halo.exchangeHalos(); + halo.setInnerBlock(tempData, data.getDataRef()); + halo.exchangeHalos(data.getDataRef()); #else var.getVar(indexArray, extentArray, &data[0]); #endif @@ -375,10 +375,10 @@ void ParaGridIO::dumpModelState(const ModelState& state, const std::string& file size_t localLength = dim.localLength; #ifdef USE_MPI if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * Halo::haloWidth; + localLength = localLength - 2 * HALOWIDTH; } if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { - localLength = localLength - 2 * Halo::haloWidth; + localLength = localLength - 2 * HALOWIDTH; } #endif start.push_back(dim.start); @@ -394,9 +394,11 @@ void ParaGridIO::dumpModelState(const ModelState& state, const std::string& file var.putAtt(mdiName, netCDF::ncDouble, MissingData::value()); #ifdef USE_MPI - Halo halo(entry.second); + auto& data = entry.second; + Halo halo(data.nComponents(), type == ModelArray::Type::VERTEX); ModelArray::DataType tempData; - halo.getInnerBlock(tempData); + tempData.resize(halo.getInnerSize(), data.nComponents()); + halo.getInnerBlock(data.getDataRef(), tempData); var.putVar(start, count, tempData.data()); #else var.putVar(start, count, entry.second.getData()); @@ -482,10 +484,10 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& auto localLength = dim.localLength; #ifdef USE_MPI if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * Halo::haloWidth; + localLength = localLength - 2 * HALOWIDTH; } if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { - localLength = localLength - 2 * Halo::haloWidth; + localLength = localLength - 2 * HALOWIDTH; } #endif ncDims.push_back(ncFromMAMap.at(dt)); @@ -526,7 +528,7 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& auto dim = ModelArray::definedDimensions.at(dt); auto localLength = dim.localLength; #ifdef USE_MPI - localLength = localLength - 2 * Halo::haloWidth; + localLength = localLength - 2 * HALOWIDTH; #endif maskIndexes.push_back(0); maskExtents.push_back(localLength); @@ -556,9 +558,11 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& // No missing data #ifdef USE_MPI netCDF::setVariableCollective(var, dataGroup); - Halo halo(entry.second); + auto& data = entry.second; + Halo halo(data.nComponents(), type == ModelArray::Type::VERTEX); ModelArray::DataType tempData; - halo.getInnerBlock(tempData); + tempData.resize(halo.getInnerSize(), data.nComponents()); + halo.getInnerBlock(data.getDataRef(), tempData); var.putVar(maskIndexes, maskExtents, tempData.data()); #else var.putVar(maskIndexes, maskExtents, entry.second.getData()); @@ -573,9 +577,11 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& var.putAtt(mdiName, netCDF::ncDouble, MissingData::value()); #ifdef USE_MPI netCDF::setVariableCollective(var, dataGroup); - Halo halo(entry.second); + auto& data = entry.second; + Halo halo(data.nComponents(), type == ModelArray::Type::VERTEX); ModelArray::DataType tempData; - halo.getInnerBlock(tempData); + tempData.resize(halo.getInnerSize(), data.nComponents()); + halo.getInnerBlock(data.getDataRef(), tempData); var.putVar(startMap.at(type), countMap.at(type), tempData.data()); #else var.putVar(startMap.at(type), countMap.at(type), entry.second.getData()); diff --git a/core/src/include/ModelArray.hpp b/core/src/include/ModelArray.hpp index 66f5acc1a..0695032b9 100644 --- a/core/src/include/ModelArray.hpp +++ b/core/src/include/ModelArray.hpp @@ -1,7 +1,7 @@ /*! * @file ModelArray.hpp * - * @date 15 Jul 2025 + * @date 19 Aug 2025 * @author Tim Spain */ @@ -19,14 +19,19 @@ #include "indexer.hpp" +#ifndef HALOWIDTH +#define HALOWIDTH 1 +#endif + namespace ArraySlicer { class Slice; +// class SliceIter; } namespace Nextsim { class ModelArraySlice; -template class EigenSlice; +class Halo; class ConstModelArraySlice; /* * Set the storage order to row major. This matches with DGVector when there is @@ -60,6 +65,7 @@ using Indexer::indexer; class ModelArray { public: using Slice = ArraySlicer::Slice; + // using SliceIter = ArraySlicer::SliceIter; // Forward defines make Eclipse less red and squiggly enum class Type; enum class Dimension; @@ -298,23 +304,17 @@ class ModelArray { //! Returns a vector of the size of each dimension of the specified type of ModelArray. static const MultiDim& dimensions(Type type) { return m_dims.at(type); } #ifdef USE_MPI - //! Returns the total number of elements of this type of ModelArray. - const MultiDim innerDimensions() { return innerDimensions(type); } - - //! Returns a vector of the size of each dimension of the specified type of ModelArray. - MultiDim innerDimensions(Type type) - { - using Dim = ModelArray::Dimension; - std::array haloTypes = { Dim::X, Dim::Y, Dim::XVERTEX, Dim::YVERTEX }; - auto dimTypes = typeDimensions.at(type); - auto dims = m_dims.at(type); - for (size_t i = 0; i < dims.size(); i++) { - if (std::count(haloTypes.begin(), haloTypes.end(), dimTypes[i])) { - dims[i] = dims[i] - 2; - } - } - return dims; - } + /** + * @brief Sets the inner block of the ModelArray data from a given source. + * + * @details + * Copies the inner block from the provided source data into the ModelArray's internal data + * buffer. The inner block is defined by slicing off HALOWIDTH elements from each boundary. The + * method initializes the entire data buffer to zero before copying the inner block. + * + * @param source The source DataType (Eigen array) from which to copy the inner block. + */ + void setInnerBlock(DataType& source); #endif //! Returns the total number of elements of this type of ModelArray. @@ -329,6 +329,9 @@ class ModelArray { //! Returns a read-only pointer to the underlying data buffer. const double* getData() const { return m_data.data(); } + //! Returns a reference to the underlying ModelArray::DataType object. + ModelArray::DataType& getDataRef() { return m_data; } + //! Returns a const reference to the Eigen data const DataType& data() const { return m_data; } //! Returns the (enum of) the ModelArray::Type of this. @@ -688,7 +691,7 @@ class ModelArray { // ModelArraySlice needs access to the internals for fast slcing friend ModelArraySlice; - template friend class EigenSlice; + friend Halo; }; #include "include/ModelArrayTypedefs.hpp" diff --git a/core/src/include/ModelArraySlice.hpp b/core/src/include/ModelArraySlice.hpp index 29d88e409..9a90d67fe 100644 --- a/core/src/include/ModelArraySlice.hpp +++ b/core/src/include/ModelArraySlice.hpp @@ -1,7 +1,7 @@ /*! * @file ModelArraySlice.hpp * - * @date 15 Jul 2025 + * @date 19 Aug 2025 * @author Tim Spain */ @@ -18,7 +18,7 @@ namespace Nextsim { class MASIter; class ModelArraySlice; class ConstModelArraySlice; -template class EigenSlice; +class Halo; std::ostream& operator<<(std::ostream& os, const MASIter& it); /*! @@ -283,7 +283,7 @@ class ModelArraySlice { friend MASIter; friend ConstModelArraySlice; - template friend class EigenSlice; + friend Halo; private: static void copyBetweenMAandMASlice( diff --git a/dynamics/src/include/dgVector.hpp b/dynamics/src/include/dgVector.hpp index 8a4a9d568..285a17afb 100644 --- a/dynamics/src/include/dgVector.hpp +++ b/dynamics/src/include/dgVector.hpp @@ -1,6 +1,6 @@ /*! * @file dgVector.hpp - * @date 15 Jul 2025 + * @date 19 Aug 2025 * @author Thomas Richter */ @@ -14,8 +14,6 @@ namespace Nextsim { // #define CELLDOFS(DGdegree) (DGdegree == 0 ? 1 : (DGdegree == 1 ? 3 : (DGdegree == 2 ? 6 : -1))) -template class EigenSlice; - template class LocalDGVector : public Eigen::Matrix { public: // required by Eigen @@ -129,8 +127,6 @@ class DGVector : public Eigen::Matrix::operator+=(other); return *this; } - - template friend class EigenSlice; }; //! data set to store the type of the edges From afc3d55e0f80ff4275a99bd53620016a106adf28 Mon Sep 17 00:00:00 2001 From: tommelt Date: Wed, 20 Aug 2025 13:49:13 +0100 Subject: [PATCH 28/53] test: ConfigOutput now uses partition_metadata for example --- core/test/ConfigOutput_test.cpp | 64 +++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/core/test/ConfigOutput_test.cpp b/core/test/ConfigOutput_test.cpp index 784ee6bd5..783a91870 100644 --- a/core/test/ConfigOutput_test.cpp +++ b/core/test/ConfigOutput_test.cpp @@ -1,7 +1,7 @@ /*! * @file ConfigOutput_test.cpp * - * @date 04 Jun 2025 + * @date 21 Aug 2025 * @author Tim Spain */ @@ -26,6 +26,10 @@ #include "include/ModelState.hpp" #include "include/NextsimModule.hpp" #include "include/gridNames.hpp" +#ifdef USE_MPI +#include "ModelMPI.hpp" +#include "include/Halo.hpp" +#endif #include #include @@ -49,20 +53,30 @@ MPI_TEST_CASE("Test periodic output", 2) TEST_CASE("Test periodic output") #endif { - size_t nx = 2; - size_t ny = 5; + size_t nx = 10; + size_t ny = 9; #ifdef USE_MPI - if (test_rank == 0) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 1, 0); - } - if (test_rank == 1) { - ModelArray::setDimension(ModelArray::Dimension::X, nx, 1, 1); - } - ModelArray::setDimension(ModelArray::Dimension::Y, ny, ny, 0); + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& meta = ModelMetadata::getInstance(partition_filename); + + const auto localNX = meta.getLocalExtentX() + 2 * Halo::haloWidth; + const auto offsetX = meta.getLocalCornerX(); + const auto localNY = meta.getLocalExtentY() + 2 * Halo::haloWidth; + const auto offsetY = meta.getLocalCornerY(); + + ModelArray::setDimension(ModelArray::Dimension::X, nx, localNX, offsetX); + ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nx + 1, localNX + 1, offsetX); + ModelArray::setDimension(ModelArray::Dimension::Y, ny, localNY, offsetY); + ModelArray::setDimension(ModelArray::Dimension::YVERTEX, ny + 1, localNY + 1, offsetY); #else + auto& meta = ModelMetadata::getInstance(); ModelArray::setDimension(ModelArray::Dimension::X, nx); ModelArray::setDimension(ModelArray::Dimension::Y, ny); + + auto offsetX = 0; + auto localNX = nx; + auto localNY = ny; #endif Module::Module::setImplementation("Nextsim::ConfigOutput"); @@ -94,17 +108,17 @@ TEST_CASE("Test periodic output") tsurf.resize(); topMelt.resize(); + hice = 0.; + cice = 0.; + hsnow = 0.; + tsurf = 0.; + topMelt = 0.; + ModelComponent::getStore().registerArray(Protected::H_ICE, &hice); ModelComponent::getStore().registerArray(Protected::C_ICE, &cice); ModelComponent::getStore().registerArray(Protected::H_SNOW, &hsnow); ModelComponent::getStore().registerArray(Protected::T_SURF, &tsurf); -#ifdef USE_MPI - auto& modelMPI = ModelMPI::getInstance(test_comm); - auto& meta = ModelMetadata::getInstance(partition_filename); -#else - auto& meta = ModelMetadata::getInstance(); -#endif // Set up the coordinates, but use arrays filled with zeros HField latlonData(ModelArray::Type::H); latlonData = 0.; @@ -123,17 +137,13 @@ TEST_CASE("Test periodic output") IDiagnosticOutput& ido = Module::getImplementation(); tryConfigure(ido); - auto dimX = ModelArray::Dimension::X; - auto startX = ModelArray::definedDimensions.at(dimX).start; - auto localNX = ModelArray::definedDimensions.at(dimX).localLength; - - for (size_t j = 0; j < ny; ++j) { - for (size_t i = 0; i < localNX; ++i) { - hice(i, j) = 0 + 0.01 * (j * nx + (i + startX)); - cice(i, j) = 0.1 + 0.01 * (j * nx + (i + startX)); - hsnow(i, j) = 0.2 + 0.01 * (j * nx + (i + startX)); - tsurf(i, j) = 0.4 + 0.01 * (j * nx + (i + startX)); - topMelt(i, j) = 0.6 + 0.01 * (j * nx + (i + startX)); + for (size_t j = 0; j < localNY - 2 * HALOWIDTH; ++j) { + for (size_t i = 0; i < localNX - 2 * HALOWIDTH; ++i) { + hice(i + 1, j + 1) = 0 + 0.01 * (j * nx + (i + offsetX)); + cice(i + 1, j + 1) = 0.1 + 0.01 * (j * nx + (i + offsetX)); + hsnow(i + 1, j + 1) = 0.2 + 0.01 * (j * nx + (i + offsetX)); + tsurf(i + 1, j + 1) = 0.4 + 0.01 * (j * nx + (i + offsetX)); + topMelt(i + 1, j + 1) = 0.6 + 0.01 * (j * nx + (i + offsetX)); } } std::vector diagFiles; From 604bee4961a40d74719820af749787359fbf328e Mon Sep 17 00:00:00 2001 From: tommelt Date: Thu, 21 Aug 2025 11:34:45 +0100 Subject: [PATCH 29/53] test: fix paragrid test to run for serial case --- core/test/ParaGrid_test.cpp | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index 7fcfe8764..4cddd4a61 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -1,7 +1,7 @@ /*! * @file ParaGrid_test.cpp * - * @date 04 Aug 2025 + * @date 21 Aug 2025 * @author Tim Spain * @author Tom Meltzer */ @@ -67,21 +67,26 @@ void initializeTestData( auto localNX = ModelArray::definedDimensions.at(dimX).localLength; auto dimY = ModelArray::Dimension::Y; auto localNY = ModelArray::definedDimensions.at(dimY).localLength; +#ifdef USE_MPI + auto haloWidth = Halo::haloWidth; +#else + auto haloWidth = 0; +#endif // In the following loops we only set the "inner" data // Hfield's, DGField and mask - for (size_t j = 0; j < localNY - 2 * Halo::haloWidth; ++j) { + for (size_t j = 0; j < localNY - 2 * haloWidth; ++j) { double yy = scale * (j - float(ny) / 2); - for (size_t i = 0; i < localNX - 2 * Halo::haloWidth; ++i) { + for (size_t i = 0; i < localNX - 2 * haloWidth; ++i) { double xx = scale * ((i + startX) - float(nx) / 2); - x(i + Halo::haloWidth, j + Halo::haloWidth) = xx; - y(i + Halo::haloWidth, j + Halo::haloWidth) = yy; - frac(i + Halo::haloWidth, j + Halo::haloWidth) = j * yFactor + (i + startX) * xFactor; - mask(i + Halo::haloWidth, j + Halo::haloWidth) = i + startX > j ? 0 : 1; + x(i + haloWidth, j + haloWidth) = xx; + y(i + haloWidth, j + haloWidth) = yy; + frac(i + haloWidth, j + haloWidth) = j * yFactor + (i + startX) * xFactor; + mask(i + haloWidth, j + haloWidth) = i + startX > j ? 0 : 1; for (size_t d = 0; d < DG; ++d) { - fracDG.components({ i + Halo::haloWidth, j + Halo::haloWidth })[d] - = frac(i + Halo::haloWidth, j + Halo::haloWidth) + d; + fracDG.components({ i + haloWidth, j + haloWidth })[d] + = frac(i + haloWidth, j + haloWidth) + d; } } } @@ -93,12 +98,12 @@ void initializeTestData( localNY = ModelArray::definedDimensions.at(dimY).localLength; // Vetex coordinates - for (size_t i = 0; i < localNX - 2 * Halo::haloWidth; ++i) { - for (size_t j = 0; j < localNY - 2 * Halo::haloWidth; ++j) { + for (size_t i = 0; i < localNX - 2 * haloWidth; ++i) { + for (size_t j = 0; j < localNY - 2 * haloWidth; ++j) { double x = (i + startX) - 0.5 - float(nx) / 2; double y = j - 0.5 - float(ny) / 2; - coordinates.components({ i + Halo::haloWidth, j + Halo::haloWidth })[0] = x * scale; - coordinates.components({ i + Halo::haloWidth, j + Halo::haloWidth })[1] = y * scale; + coordinates.components({ i + haloWidth, j + haloWidth })[0] = x * scale; + coordinates.components({ i + haloWidth, j + haloWidth })[1] = y * scale; } } }; @@ -462,7 +467,11 @@ TEST_CASE("Test array ordering") ModelState state = ParaGridIO::readForcingTimeStatic(fields, time, inputFilename); REQUIRE(state.data.count(fieldName) > 0); index2d = state.data.at(fieldName); +#ifdef USE_MPI REQUIRE(index2d(3 + Halo::haloWidth, 5 + Halo::haloWidth) == (offsetX + 3) * xFactor + 5.); +#else + REQUIRE(index2d(3, 5) == (offsetX + 3) * xFactor + 5.); +#endif Finalizer::finalize(); } From 2135cd19414955b0b319ce0953273a91229efc50 Mon Sep 17 00:00:00 2001 From: tommelt Date: Thu, 21 Aug 2025 11:39:18 +0100 Subject: [PATCH 30/53] test: remove physic tests from MPI as they are serial --- physics/test/CMakeLists.txt | 103 +++++++++------------------------ physics/test/ERA5Atm_test.cpp | 24 +------- physics/test/TOPAZOcn_test.cpp | 17 +----- 3 files changed, 32 insertions(+), 112 deletions(-) diff --git a/physics/test/CMakeLists.txt b/physics/test/CMakeLists.txt index b1d3b32df..af5e6cbe2 100644 --- a/physics/test/CMakeLists.txt +++ b/physics/test/CMakeLists.txt @@ -1,51 +1,18 @@ -set(COMMON_INCLUDE_DIRS - "../../core/src/discontinuousgalerkin" - "../../core/src" - "../../core/src/modules" - "../src" - "../src/modules" -) - -set(ModulesRoot "../src/modules") -set(CoreModulesRoot "../../core/src/modules") - -# Generate the boundary test data files -execute_process( - COMMAND "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/era5_test_data.py" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" -) -execute_process( - COMMAND "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/topaz_test_data.py" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" -) - -include_directories(${COMMON_INCLUDE_DIRS}) - -if(ENABLE_MPI) - add_executable(testERA5Atm_MPI1 "ERA5Atm_test.cpp" "../../core/test/MainMPI.cpp") - target_compile_definitions( - testERA5Atm_MPI1 - PRIVATE USE_MPI TEST_FILES_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\" - ) - target_include_directories(testERA5Atm_MPI1 PRIVATE "${ModulesRoot}/AtmosphereBoundaryModule") - target_link_libraries(testERA5Atm_MPI1 PRIVATE nextsimlib doctest::doctest) - - add_executable(testTOPAZOcn_MPI1 "TOPAZOcn_test.cpp" "../../core/test/MainMPI.cpp") - target_include_directories(testTOPAZOcn_MPI1 PRIVATE "${ModulesRoot}/OceanBoundaryModule") - target_compile_definitions( - testTOPAZOcn_MPI1 - PRIVATE USE_MPI TEST_FILES_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\" - ) - target_link_libraries(testTOPAZOcn_MPI1 PRIVATE nextsimlib doctest::doctest) - - # In the MPI tests it's important to include the "-ns" flag which tells - # doctest to fail if test has been skipped. Without this, the test will - # technically pass if we run with fewer ranks than requested. - add_test(NAME testERA5Atm_MPI1 - COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 1 testERA5Atm_MPI1 -ns) - add_test(NAME testTOPAZOcn_MPI1 COMMAND - ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 1 testTOPAZOcn_MPI1 -ns) -else() +if(NOT ENABLE_MPI) + set(COMMON_INCLUDE_DIRS "../../core/src/discontinuousgalerkin" "../../core/src" + "../../core/src/modules" "../src" "../src/modules") + + set(ModulesRoot "../src/modules") + set(CoreModulesRoot "../../core/src/modules") + + # Generate the boundary test data files + execute_process(COMMAND "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/era5_test_data.py" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") + execute_process(COMMAND "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/topaz_test_data.py" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") + + include_directories(${COMMON_INCLUDE_DIRS}) + add_executable(testERA5Atm "ERA5Atm_test.cpp") target_compile_definitions(testERA5Atm PRIVATE TEST_FILES_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\") target_include_directories(testERA5Atm PRIVATE "${ModulesRoot}/AtmosphereBoundaryModule") @@ -57,37 +24,27 @@ else() target_link_libraries(testTOPAZOcn PRIVATE nextsimlib doctest::doctest) add_executable(testIceGrowth "IceGrowth_test.cpp") - target_include_directories( - testIceGrowth - PRIVATE "${ModulesRoot}/OceanBoundaryModule" "${CoreModulesRoot}/FreezingPointModule" - ) + target_include_directories(testIceGrowth PRIVATE "${ModulesRoot}/OceanBoundaryModule" + "${CoreModulesRoot}/FreezingPointModule") target_link_libraries(testIceGrowth PRIVATE nextsimlib doctest::doctest) add_executable(testThermoWinton "ThermoWintonTemperature_test.cpp") - target_include_directories( - testThermoWinton - PRIVATE "${ModulesRoot}/IceThermodynamicsModule" "${ModulesRoot}/OceanBoundaryModule" - ) + target_include_directories(testThermoWinton PRIVATE "${ModulesRoot}/IceThermodynamicsModule" + "${ModulesRoot}/OceanBoundaryModule") target_link_libraries(testThermoWinton PRIVATE nextsimlib doctest::doctest) add_executable(testFEFluxes "FiniteElementFluxes_test.cpp") target_include_directories( testFEFluxes - PRIVATE - "${ModulesRoot}/FluxCalculationModule" - "${ModulesRoot}/OceanBoundaryModule" - "${CoreModulesRoot}/FreezingPointModule" - ) + PRIVATE "${ModulesRoot}/FluxCalculationModule" "${ModulesRoot}/OceanBoundaryModule" + "${CoreModulesRoot}/FreezingPointModule") target_link_libraries(testFEFluxes PRIVATE nextsimlib doctest::doctest) add_executable(testBIOHFluxes "BasicIceOceanFlux_test.cpp") target_include_directories( testBIOHFluxes - PRIVATE - "${ModulesRoot}/IceOceanHeatFluxModule" - "${ModulesRoot}/OceanBoundaryModule" - "${CoreModulesRoot}/FreezingPointModule" - ) + PRIVATE "${ModulesRoot}/IceOceanHeatFluxModule" "${ModulesRoot}/OceanBoundaryModule" + "${CoreModulesRoot}/FreezingPointModule") target_link_libraries(testBIOHFluxes PRIVATE nextsimlib doctest::doctest) add_executable(testSpecHum "SpecificHumidity_test.cpp") @@ -115,16 +72,13 @@ else() add_executable(testBenchmarkBoundaries "BenchmarkBoundaries_test.cpp") target_include_directories( - testBenchmarkBoundaries - PRIVATE "${ModulesRoot}/AtmosphereBoundaryModule" "${ModulesRoot}/OceanBoundaryModule" - ) + testBenchmarkBoundaries PRIVATE "${ModulesRoot}/AtmosphereBoundaryModule" + "${ModulesRoot}/OceanBoundaryModule") target_link_libraries(testBenchmarkBoundaries PRIVATE nextsimlib doctest::doctest) add_executable(testDamageHealing "DamageHealing_test.cpp") - target_include_directories( - testDamageHealing - PRIVATE "${ModulesRoot}/DamageHealingModule" "${ModulesRoot}/DamageHealingModule" - ) + target_include_directories(testDamageHealing PRIVATE "${ModulesRoot}/DamageHealingModule" + "${ModulesRoot}/DamageHealingModule") target_link_libraries(testDamageHealing PRIVATE nextsimlib doctest::doctest) set(TEST_EXECUTABLES @@ -141,8 +95,7 @@ else() testSlabOcn testUniformOcean testBenchmarkBoundaries - testDamageHealing - ) + testDamageHealing) foreach(test_exec IN LISTS TEST_EXECUTABLES) add_test(NAME ${test_exec} COMMAND ${test_exec}) diff --git a/physics/test/ERA5Atm_test.cpp b/physics/test/ERA5Atm_test.cpp index 42fb53b9d..530e9f6c4 100644 --- a/physics/test/ERA5Atm_test.cpp +++ b/physics/test/ERA5Atm_test.cpp @@ -1,16 +1,12 @@ /*! * @file ERA5Atm_test.cpp * - * @date 7 Sep 2023 + * @date 21 Aug 2025 * @author Tim Spain */ -#ifdef USE_MPI -#include -#else #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include -#endif #include "include/ERA5Atmosphere.hpp" @@ -34,24 +30,17 @@ namespace Nextsim { class NullFlux : public IFluxCalculation { public: NullFlux() - : IFluxCalculation() + : IFluxCalculation() { } void update(const TimestepTime&) override { } } nullFlux; -std::unique_ptr setNullFlux() -{ - return std::make_unique(); -} +std::unique_ptr setNullFlux() { return std::make_unique(); } TEST_SUITE_BEGIN("ERA5Atmosphere"); -#ifdef USE_MPI -MPI_TEST_CASE("ERA5Atmosphere construction test", 1) -#else TEST_CASE("ERA5Atmosphere construction test") -#endif { const std::string filePath = "era5_test128x128.nc"; const std::string orig_file = std::string(TEST_FILES_DIR) + "/" + filePath; @@ -63,17 +52,10 @@ TEST_CASE("ERA5Atmosphere construction test") size_t nxvertex = nx + 1; size_t nyvertex = ny + 1; -#ifdef USE_MPI - ModelArray::setDimension(ModelArray::Dimension::X, nx, nx, 0); - ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nxvertex, nxvertex, 0); - ModelArray::setDimension(ModelArray::Dimension::Y, ny, ny, 0); - ModelArray::setDimension(ModelArray::Dimension::YVERTEX, nyvertex, nyvertex, 0); -#else ModelArray::setDimension(ModelArray::Dimension::X, nx); ModelArray::setDimension(ModelArray::Dimension::Y, ny); ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nxvertex); ModelArray::setDimension(ModelArray::Dimension::YVERTEX, nyvertex); -#endif ERA5Atmosphere e5; diff --git a/physics/test/TOPAZOcn_test.cpp b/physics/test/TOPAZOcn_test.cpp index 86f4e99af..051b2e8f5 100644 --- a/physics/test/TOPAZOcn_test.cpp +++ b/physics/test/TOPAZOcn_test.cpp @@ -1,16 +1,12 @@ /*! * @file ERA5Atm_test.cpp * - * @date 23 Aug 2024 + * @date 21 Aug 2025 * @author Tim Spain */ -#ifdef USE_MPI -#include -#else #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include -#endif #include "include/TOPAZOcean.hpp" @@ -27,11 +23,7 @@ namespace Nextsim { TEST_SUITE_BEGIN("TOPAZOcean"); -#ifdef USE_MPI -MPI_TEST_CASE("TOPAZOcean test", 1) -#else TEST_CASE("TOPAZOcean test") -#endif { const std::string filePath = "topaz_test128x128.nc"; const std::string orig_file = std::string(TEST_FILES_DIR) + "/" + filePath; @@ -43,17 +35,10 @@ TEST_CASE("TOPAZOcean test") size_t nxvertex = nx + 1; size_t nyvertex = ny + 1; -#ifdef USE_MPI - ModelArray::setDimension(ModelArray::Dimension::X, nx, nx, 0); - ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nxvertex, nxvertex, 0); - ModelArray::setDimension(ModelArray::Dimension::Y, ny, ny, 0); - ModelArray::setDimension(ModelArray::Dimension::YVERTEX, nyvertex, nyvertex, 0); -#else ModelArray::setDimension(ModelArray::Dimension::X, nx); ModelArray::setDimension(ModelArray::Dimension::Y, ny); ModelArray::setDimension(ModelArray::Dimension::XVERTEX, nxvertex); ModelArray::setDimension(ModelArray::Dimension::YVERTEX, nyvertex); -#endif TOPAZOcean topaz; topaz.configure(); From f142a56632d41da888d14876b151c91fbe4f77ee Mon Sep 17 00:00:00 2001 From: tommelt Date: Thu, 21 Aug 2025 12:14:43 +0100 Subject: [PATCH 31/53] test: remove frontmatter date and file --- core/src/CommandLineParser.cpp | 4 +--- core/src/CommonRestartMetadata.cpp | 4 +--- core/src/ConfigurationHelpPrinter.cpp | 4 +--- core/src/Configurator.cpp | 4 +--- core/src/ConfiguredModule.cpp | 4 +--- core/src/DevStep.cpp | 4 +--- core/src/FileCallbackCloser.cpp | 4 +--- core/src/Finalizer.cpp | 4 +--- core/src/Iterator.cpp | 4 +--- core/src/Logged.cpp | 4 +--- core/src/Model.cpp | 4 +--- core/src/ModelArray.cpp | 4 +--- core/src/ModelArraySlice.cpp | 4 +--- core/src/ModelComponent.cpp | 4 +--- core/src/ModelConfig.cpp | 4 +--- core/src/ModelMPI.cpp | 4 +--- core/src/ModelMetadata.cpp | 4 +--- core/src/NetcdfMetadataConfiguration.cpp | 4 +--- core/src/PDWriter.cpp | 4 +--- core/src/ParaGridIO.cpp | 4 +--- core/src/ParaGridIO_Xios.cpp | 4 +--- core/src/PrognosticData.cpp | 4 +--- core/src/RectGridIO.cpp | 4 +--- core/src/StructureFactory.cpp | 4 +--- core/src/Time.cpp | 4 +--- core/src/Xios.cpp | 4 +--- core/src/discontinuousgalerkin/ModelArrayDetails.cpp | 4 +--- core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp | 4 +--- core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp | 4 +--- core/src/finitevolume/ModelArrayDetails.cpp | 4 +--- core/src/finitevolume/include/ModelArrayDetails.hpp | 4 +--- core/src/finitevolume/include/ModelArrayTypedefs.hpp | 4 +--- core/src/include/Chrono.hpp | 4 +--- core/src/include/CommandLineParser.hpp | 4 +--- core/src/include/CommonRestartMetadata.hpp | 4 +--- core/src/include/ConfigMap.hpp | 4 +--- core/src/include/ConfigurationHelp.hpp | 4 +--- core/src/include/ConfigurationHelpPrinter.hpp | 4 +--- core/src/include/Configurator.hpp | 4 +--- core/src/include/Configured.hpp | 4 +--- core/src/include/ConfiguredModule.hpp | 4 +--- core/src/include/DevStep.hpp | 4 +--- core/src/include/EnumWrapper.hpp | 4 +--- core/src/include/FileCallbackCloser.hpp | 4 +--- core/src/include/Finalizer.hpp | 4 +--- core/src/include/Halo.hpp | 4 +--- core/src/include/IModelStep.hpp | 4 +--- core/src/include/Iterator.hpp | 4 +--- core/src/include/Logged.hpp | 4 +--- core/src/include/MissingData.hpp | 4 +--- core/src/include/Model.hpp | 4 +--- core/src/include/ModelArray.hpp | 4 +--- core/src/include/ModelArrayRef.hpp | 4 +--- core/src/include/ModelArrayReferenceStore.hpp | 4 +--- core/src/include/ModelArraySlice.hpp | 4 +--- core/src/include/ModelComponent.hpp | 4 +--- core/src/include/ModelConfig.hpp | 4 +--- core/src/include/ModelMPI.hpp | 4 +--- core/src/include/ModelMetadata.hpp | 4 +--- core/src/include/ModelState.hpp | 4 +--- core/src/include/Module.hpp | 4 +--- core/src/include/MonthlyCubicBSpline.hpp | 4 +--- core/src/include/NetcdfMetadataConfiguration.hpp | 4 +--- core/src/include/NextsimModule.hpp | 4 +--- core/src/include/OutputSpec.hpp | 4 +--- core/src/include/ParaGridIO.hpp | 4 +--- core/src/include/PrognosticData.hpp | 4 +--- core/src/include/RectGridIO.hpp | 4 +--- core/src/include/Slice.hpp | 4 +--- core/src/include/StructureFactory.hpp | 4 +--- core/src/include/TextTag.hpp | 4 +--- core/src/include/Time.hpp | 4 +--- core/src/include/Xios.hpp | 4 +--- core/src/include/constants.hpp | 4 +--- core/src/include/gridNames.hpp | 4 +--- core/src/include/indexer.hpp | 4 +--- core/src/include/xios_c_interface.hpp | 4 +--- core/src/main.cpp | 4 +--- core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp | 4 +--- core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp | 4 +--- .../modules/DiagnosticOutputModule/include/ConfigOutput.hpp | 4 +--- core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp | 4 +--- .../modules/DiagnosticOutputModule/include/SimpleOutput.hpp | 4 +--- core/src/modules/DynamicsModule/BBMDynamics.cpp | 4 +--- core/src/modules/DynamicsModule/MEVPDynamics.cpp | 4 +--- core/src/modules/DynamicsModule/include/BBMDynamics.hpp | 4 +--- core/src/modules/DynamicsModule/include/DummyDynamics.hpp | 4 +--- core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp | 4 +--- core/src/modules/DynamicsModule/include/MEVPDynamics.hpp | 4 +--- .../modules/FreezingPointModule/include/LinearFreezing.hpp | 4 +--- .../modules/FreezingPointModule/include/UnescoFreezing.hpp | 4 +--- core/src/modules/StructureModule/ParametricGrid.cpp | 4 +--- core/src/modules/StructureModule/RectangularGrid.cpp | 4 +--- core/src/modules/StructureModule/include/ParametricGrid.hpp | 4 +--- core/src/modules/StructureModule/include/RectangularGrid.hpp | 4 +--- core/src/modules/include/IDiagnosticOutput.hpp | 4 +--- core/src/modules/include/IDynamics.hpp | 4 +--- core/src/modules/include/IFreezingPoint.hpp | 4 +--- core/src/modules/include/IStructure.hpp | 4 +--- core/test/ArgV.cpp | 4 +--- core/test/ArgV.hpp | 4 +--- core/test/CommandLineParser_test.cpp | 4 +--- core/test/ConfigOutput_test.cpp | 4 +--- core/test/Configurator_test.cpp | 4 +--- core/test/DynamicsModuleForPDtest.cpp | 4 +--- core/test/FileCallbackCloser_test.cpp | 4 +--- core/test/Finalizer_test.cpp | 4 +--- core/test/HaloExchangeCB_test.cpp | 4 +--- core/test/HaloExchangePB_test.cpp | 4 +--- core/test/Iterator_test.cpp | 4 +--- core/test/Logged_test.cpp | 4 +--- core/test/ModelArrayRefDebug_test.cpp | 4 +--- core/test/ModelArrayRef_test.cpp | 4 +--- core/test/ModelArraySlice_test.cpp | 4 +--- core/test/ModelArray_test.cpp | 4 +--- core/test/ModelComponent_test.cpp | 4 +--- core/test/ModelMetadataCB_test.cpp | 4 +--- core/test/ModelMetadataPB_test.cpp | 4 +--- core/test/MonthlyCubicBSpline_test.cpp | 4 +--- core/test/PDTestDynamics.hpp | 4 +--- core/test/ParaGrid_test.cpp | 4 +--- core/test/PrognosticDataIO_test.cpp | 4 +--- core/test/PrognosticData_test.cpp | 4 +--- core/test/RectGrid_test.cpp | 4 +--- core/test/Slice_test.cpp | 4 +--- core/test/Time_test.cpp | 4 +--- core/test/XiosAxis_test.cpp | 4 +--- core/test/XiosCalendar_test.cpp | 4 +--- core/test/XiosDomain_test.cpp | 4 +--- core/test/XiosField_test.cpp | 4 +--- core/test/XiosFile_test.cpp | 4 +--- core/test/XiosGrid_test.cpp | 4 +--- core/test/XiosRead_test.cpp | 4 +--- core/test/XiosWrite_test.cpp | 4 +--- core/test/testmodelarraydetails/ModelArrayDetails.cpp | 4 +--- core/test/testmodelarraydetails/include/ModelArrayDetails.hpp | 4 +--- .../test/testmodelarraydetails/include/ModelArrayTypedefs.hpp | 4 +--- dynamics/src/CGDynamicsKernel.cpp | 4 +--- dynamics/src/DGTransport.cpp | 4 +--- dynamics/src/DummyDynamicsKernel.cpp | 4 +--- dynamics/src/DynamicsKernel.cpp | 4 +--- dynamics/src/MEVPStressUpdateStep.cpp | 4 +--- dynamics/src/ParametricMap.cpp | 4 +--- dynamics/src/ParametricMesh.cpp | 4 +--- dynamics/src/ParametricTools.cpp | 4 +--- dynamics/src/include/BBMDynamicsKernel.hpp | 4 +--- dynamics/src/include/BBMParameters.hpp | 4 +--- dynamics/src/include/BBMStressUpdateStep.hpp | 4 +--- dynamics/src/include/BrittleCGDynamicsKernel.hpp | 4 +--- dynamics/src/include/CGDynamicsKernel.hpp | 4 +--- dynamics/src/include/CGModelArray.hpp | 4 +--- dynamics/src/include/CheckPoints.hpp | 4 +--- dynamics/src/include/DGModelArray.hpp | 4 +--- dynamics/src/include/DGTransport.hpp | 4 +--- dynamics/src/include/DummyDynamicsKernel.hpp | 4 +--- dynamics/src/include/DynamicsKernel.hpp | 4 +--- dynamics/src/include/DynamicsParameters.hpp | 4 +--- dynamics/src/include/FreeDriftDynamicsKernel.hpp | 4 +--- dynamics/src/include/IDynamicsUpdate.hpp | 4 +--- dynamics/src/include/Interpolations.hpp | 4 +--- dynamics/src/include/MEVPDynamicsKernel.hpp | 4 +--- dynamics/src/include/MEVPStressUpdateStep.hpp | 4 +--- dynamics/src/include/NextsimDynamics.hpp | 4 +--- dynamics/src/include/ParametricMap.hpp | 4 +--- dynamics/src/include/ParametricMesh.hpp | 4 +--- dynamics/src/include/ParametricTools.hpp | 4 +--- dynamics/src/include/StressUpdateStep.hpp | 4 +--- dynamics/src/include/Tools.hpp | 4 +--- dynamics/src/include/VPCGDynamicsKernel.hpp | 4 +--- dynamics/src/include/VPParameters.hpp | 4 +--- dynamics/src/include/VectorManipulations.hpp | 4 +--- dynamics/src/include/cgVector.hpp | 4 +--- dynamics/src/include/dgBasisFunctionsGaussPoints.hpp | 4 +--- dynamics/src/include/dgInitial.hpp | 4 +--- dynamics/src/include/dgLimit.hpp | 4 +--- dynamics/src/include/dgLimiters.hpp | 4 +--- dynamics/src/include/dgVector.hpp | 4 +--- dynamics/src/include/dgVectorHolder.hpp | 4 +--- dynamics/src/include/dgVisu.hpp | 4 +--- dynamics/test/AdvectionPeriodicBC_test.cpp | 4 +--- dynamics/test/Advection_test.cpp | 4 +--- dynamics/test/CGModelArray_test.cpp | 4 +--- dynamics/test/DGModelArray_test.cpp | 4 +--- dynamics/test/FakeSmeshData.cpp | 4 +--- dynamics/test/FakeSmeshData.hpp | 4 +--- dynamics/test/ParametricMeshArea_test.cpp | 4 +--- dynamics/test/ParametricMesh_test.cpp | 4 +--- dynamics/test/dgVectorHolder_test.cpp | 4 +--- physics/src/BenchmarkCoordinates.cpp | 4 +--- physics/src/IceGrowth.cpp | 4 +--- physics/src/IceMinima.cpp | 4 +--- physics/src/SlabOcean.cpp | 4 +--- physics/src/include/BenchmarkCoordinates.hpp | 4 +--- physics/src/include/IceGrowth.hpp | 4 +--- physics/src/include/IceMinima.hpp | 4 +--- physics/src/include/SlabOcean.hpp | 4 +--- .../modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp | 4 +--- .../modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp | 4 +--- .../AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp | 4 +--- .../src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp | 4 +--- .../AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp | 4 +--- .../AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp | 4 +--- .../AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp | 4 +--- .../include/ConstantAtmosphereBoundary.hpp | 4 +--- .../AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp | 4 +--- .../include/FluxConfiguredAtmosphere.hpp | 4 +--- .../AtmosphereBoundaryModule/include/MU71Atmosphere.hpp | 2 +- physics/src/modules/DamageHealingModule/ConstantHealing.cpp | 4 +--- .../modules/DamageHealingModule/include/ConstantHealing.hpp | 4 +--- physics/src/modules/DamageHealingModule/include/NoHealing.hpp | 4 +--- .../src/modules/FluxCalculationModule/FiniteElementFluxes.cpp | 4 +--- .../FluxCalculationModule/include/FiniteElementFluxes.hpp | 4 +--- .../FluxCalculationModule/include/ISpecificHumidity.hpp | 2 +- physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp | 4 +--- physics/src/modules/IceAlbedoModule/MU71Albedo.cpp | 4 +--- physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp | 4 +--- physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp | 4 +--- physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp | 4 +--- physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp | 4 +--- physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp | 4 +--- physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp | 4 +--- physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp | 4 +--- physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp | 4 +--- .../modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp | 4 +--- .../IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp | 4 +--- physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp | 4 +--- physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp | 4 +--- .../include/DummyIceThermodynamics.hpp | 4 +--- .../modules/IceThermodynamicsModule/include/ThermoIce0.hpp | 4 +--- .../modules/IceThermodynamicsModule/include/ThermoWinton.hpp | 4 +--- physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp | 4 +--- .../modules/LateralIceSpreadModule/include/DummyIceSpread.hpp | 4 +--- .../modules/LateralIceSpreadModule/include/HiblerSpread.hpp | 4 +--- physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp | 4 +--- physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp | 4 +--- .../src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp | 4 +--- .../src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp | 4 +--- physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp | 4 +--- physics/src/modules/OceanBoundaryModule/UniformOcean.cpp | 4 +--- .../modules/OceanBoundaryModule/include/BenchmarkOcean.hpp | 4 +--- .../modules/OceanBoundaryModule/include/ConfiguredOcean.hpp | 4 +--- .../OceanBoundaryModule/include/ConstantOceanBoundary.hpp | 4 +--- .../OceanBoundaryModule/include/FluxConfiguredOcean.hpp | 4 +--- .../src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp | 4 +--- .../src/modules/OceanBoundaryModule/include/UniformOcean.hpp | 4 +--- physics/src/modules/include/IAtmosphereBoundary.hpp | 4 +--- physics/src/modules/include/IDamageHealing.hpp | 4 +--- physics/src/modules/include/IFluxCalculation.hpp | 4 +--- physics/src/modules/include/IIceAlbedo.hpp | 2 +- physics/src/modules/include/IIceOceanHeatFlux.hpp | 2 +- physics/src/modules/include/IIceThermodynamics.hpp | 4 +--- physics/src/modules/include/ILateralIceSpread.hpp | 4 +--- physics/src/modules/include/IOceanBoundary.hpp | 4 +--- physics/test/BasicIceOceanFlux_test.cpp | 4 +--- physics/test/BenchmarkBoundaries_test.cpp | 4 +--- physics/test/ConstantOceanBoundary_test.cpp | 4 +--- physics/test/DamageHealing_test.cpp | 4 +--- physics/test/ERA5Atm_test.cpp | 4 +--- physics/test/FiniteElementFluxes_test.cpp | 4 +--- physics/test/IceGrowth_test.cpp | 4 +--- physics/test/IceMinima_test.cpp | 4 +--- physics/test/SlabOcean_test.cpp | 4 +--- physics/test/TOPAZOcn_test.cpp | 4 +--- physics/test/ThermoIce0Temperature_test.cpp | 4 +--- physics/test/ThermoIce0_test.cpp | 4 +--- physics/test/ThermoWintonTemperature_test.cpp | 4 +--- physics/test/UniformOcean_test.cpp | 4 +--- 267 files changed, 267 insertions(+), 793 deletions(-) diff --git a/core/src/CommandLineParser.cpp b/core/src/CommandLineParser.cpp index 2eb06fd9b..8391972e7 100644 --- a/core/src/CommandLineParser.cpp +++ b/core/src/CommandLineParser.cpp @@ -1,10 +1,8 @@ /*! - * @file CommandLineParser.cpp * - * @date Jan 29, 2025 * @author Tim Spain * @author Tim Williams - */ +*/ #include "include/CommandLineParser.hpp" diff --git a/core/src/CommonRestartMetadata.cpp b/core/src/CommonRestartMetadata.cpp index 45a78c520..dfd7526ca 100644 --- a/core/src/CommonRestartMetadata.cpp +++ b/core/src/CommonRestartMetadata.cpp @@ -1,9 +1,7 @@ /*! - * @file CommonRestartMetadata.cpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #include "include/CommonRestartMetadata.hpp" #include "include/ModelMetadata.hpp" diff --git a/core/src/ConfigurationHelpPrinter.cpp b/core/src/ConfigurationHelpPrinter.cpp index f93dc1130..af08dfc54 100644 --- a/core/src/ConfigurationHelpPrinter.cpp +++ b/core/src/ConfigurationHelpPrinter.cpp @@ -1,9 +1,7 @@ /*! - * @file ConfigurationHelpPrinter.cpp * - * @date Aug 18, 2022 * @author Tim Spain - */ +*/ #include "include/ConfigurationHelpPrinter.hpp" diff --git a/core/src/Configurator.cpp b/core/src/Configurator.cpp index 4d6b92a46..2feb608b3 100644 --- a/core/src/Configurator.cpp +++ b/core/src/Configurator.cpp @@ -1,9 +1,7 @@ /*! - * @file Configurator.cpp * - * @date Oct 8, 2021 * @author Tim Spain - */ +*/ #include "include/Configurator.hpp" diff --git a/core/src/ConfiguredModule.cpp b/core/src/ConfiguredModule.cpp index 9a725a8a8..32c732bd5 100644 --- a/core/src/ConfiguredModule.cpp +++ b/core/src/ConfiguredModule.cpp @@ -1,9 +1,7 @@ /*! - * @file ConfiguredModule.cpp * - * @date Oct 29, 2021 * @author Tim Spain - */ +*/ #include "include/ConfiguredModule.hpp" diff --git a/core/src/DevStep.cpp b/core/src/DevStep.cpp index c144046f9..e1bb10500 100644 --- a/core/src/DevStep.cpp +++ b/core/src/DevStep.cpp @@ -1,9 +1,7 @@ /*! - * @file DevStep.cpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #include "include/DevStep.hpp" diff --git a/core/src/FileCallbackCloser.cpp b/core/src/FileCallbackCloser.cpp index 89dd595ca..3ded1a2a7 100644 --- a/core/src/FileCallbackCloser.cpp +++ b/core/src/FileCallbackCloser.cpp @@ -1,9 +1,7 @@ /*! - * @file FileCallbackCloser.cpp * - * @date 15 May 2023 * @author Tim Spain - */ +*/ #include "include/FileCallbackCloser.hpp" diff --git a/core/src/Finalizer.cpp b/core/src/Finalizer.cpp index aadf929d7..ed94a09d2 100644 --- a/core/src/Finalizer.cpp +++ b/core/src/Finalizer.cpp @@ -1,9 +1,7 @@ /*! - * @file Finalizer.cpp * - * @date Sep 11, 2024 * @author Tim Spain - */ +*/ #include "include/Finalizer.hpp" diff --git a/core/src/Iterator.cpp b/core/src/Iterator.cpp index c3aac5749..af16958eb 100644 --- a/core/src/Iterator.cpp +++ b/core/src/Iterator.cpp @@ -1,8 +1,6 @@ /*! - * @file Iterator.cpp - * @date 11 Aug 2021 * @author Tim Spain - */ +*/ #include "include/Iterator.hpp" diff --git a/core/src/Logged.cpp b/core/src/Logged.cpp index a761b0212..b191dbf0b 100644 --- a/core/src/Logged.cpp +++ b/core/src/Logged.cpp @@ -1,8 +1,6 @@ /*! - * @file Logged.cpp - * @date 12 Aug 2021 * @author Tim Spain - */ +*/ #include "include/Logged.hpp" diff --git a/core/src/Model.cpp b/core/src/Model.cpp index a860f4b53..8cd8200bf 100644 --- a/core/src/Model.cpp +++ b/core/src/Model.cpp @@ -1,9 +1,7 @@ /*! - * @file Model.cpp - * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet - */ +*/ #include "include/Model.hpp" diff --git a/core/src/ModelArray.cpp b/core/src/ModelArray.cpp index 58e26d0ee..e0d890b5e 100644 --- a/core/src/ModelArray.cpp +++ b/core/src/ModelArray.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelArray.cpp * - * @date Feb 24, 2022 * @author Tim Spain - */ +*/ #include "include/ModelArray.hpp" diff --git a/core/src/ModelArraySlice.cpp b/core/src/ModelArraySlice.cpp index 32b663e60..a0791c775 100644 --- a/core/src/ModelArraySlice.cpp +++ b/core/src/ModelArraySlice.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelArraySlice.cpp * - * @date Nov 11, 2024 * @author Tim Spain - */ +*/ #include "include/ModelArraySlice.hpp" diff --git a/core/src/ModelComponent.cpp b/core/src/ModelComponent.cpp index 9ff81e9bd..9c3a7cb66 100644 --- a/core/src/ModelComponent.cpp +++ b/core/src/ModelComponent.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelComponent.cpp * - * @date 25 Apr 2025 * @author Tim Spain - */ +*/ #include "include/ModelComponent.hpp" diff --git a/core/src/ModelConfig.cpp b/core/src/ModelConfig.cpp index ea7c67976..14f0bd785 100644 --- a/core/src/ModelConfig.cpp +++ b/core/src/ModelConfig.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelConfig.cpp * - * @date 14 Apr 2023 * @author Tim Spain - */ +*/ #include "include/ModelConfig.hpp" #include "include/MissingData.hpp" diff --git a/core/src/ModelMPI.cpp b/core/src/ModelMPI.cpp index 94dd30300..2e03327de 100644 --- a/core/src/ModelMPI.cpp +++ b/core/src/ModelMPI.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelMPI.cpp * - * @date 04 Jun 2025 * @author Tom Meltzer - */ +*/ #ifdef USE_MPI #include "include/ModelMPI.hpp" diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index 289efd53a..e4fe2a824 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -1,10 +1,8 @@ /*! - * @file ModelMetadata.cpp * - * @date 19 Jun 2025 * @author Tim Spain * @author Tom Meltzer - */ +*/ #include "include/ModelMetadata.hpp" diff --git a/core/src/NetcdfMetadataConfiguration.cpp b/core/src/NetcdfMetadataConfiguration.cpp index f6354b972..67f343887 100644 --- a/core/src/NetcdfMetadataConfiguration.cpp +++ b/core/src/NetcdfMetadataConfiguration.cpp @@ -1,9 +1,7 @@ /*! - * @file NetcdfMetadataConfiguration.cpp * - * @date Aug 29, 2022 * @author Tim Spain - */ +*/ #include "include/NetcdfMetadataConfiguration.hpp" diff --git a/core/src/PDWriter.cpp b/core/src/PDWriter.cpp index 11ee58200..f2fff8872 100644 --- a/core/src/PDWriter.cpp +++ b/core/src/PDWriter.cpp @@ -1,9 +1,7 @@ /*! - * @file PDWriter.cpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #include "include/PrognosticData.hpp" diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index 59a2a9d7a..9ada98ccb 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -1,9 +1,7 @@ /*! - * @file ParaGridIO.cpp * - * @date 19 Aug 2025 * @author Tim Spain - */ +*/ #include "include/ParaGridIO.hpp" diff --git a/core/src/ParaGridIO_Xios.cpp b/core/src/ParaGridIO_Xios.cpp index 5548cb7cf..18403333d 100644 --- a/core/src/ParaGridIO_Xios.cpp +++ b/core/src/ParaGridIO_Xios.cpp @@ -1,10 +1,8 @@ /*! - * @file ParaGridIO_Xios.cpp * - * @date 04 Jun 2025 * @author Tim Spain * @author Joe Wallwork - */ +*/ #include "include/ParaGridIO.hpp" diff --git a/core/src/PrognosticData.cpp b/core/src/PrognosticData.cpp index c711c60fc..20fed4b30 100644 --- a/core/src/PrognosticData.cpp +++ b/core/src/PrognosticData.cpp @@ -1,10 +1,8 @@ /*! - * @file PrognosticData.cpp * - * @date 21 Nov 2024 * @author Tim Spain * @author Einar Ólason - */ +*/ #include "include/PrognosticData.hpp" diff --git a/core/src/RectGridIO.cpp b/core/src/RectGridIO.cpp index aca553b90..d8fa7746e 100644 --- a/core/src/RectGridIO.cpp +++ b/core/src/RectGridIO.cpp @@ -1,10 +1,8 @@ /*! - * @file RectGridIO.cpp * - * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet - */ +*/ #include "include/RectGridIO.hpp" diff --git a/core/src/StructureFactory.cpp b/core/src/StructureFactory.cpp index 0d7e933ae..fc0c9b7ed 100644 --- a/core/src/StructureFactory.cpp +++ b/core/src/StructureFactory.cpp @@ -1,10 +1,8 @@ /*! - * @file StructureFactory.cpp * - * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet - */ +*/ #include "include/StructureFactory.hpp" diff --git a/core/src/Time.cpp b/core/src/Time.cpp index d3c84fe9f..019727639 100644 --- a/core/src/Time.cpp +++ b/core/src/Time.cpp @@ -1,9 +1,7 @@ /*! - * @file Time.cpp * - * @date 5 August, 2024 * @author Tim Spain - */ +*/ #include "include/Time.hpp" diff --git a/core/src/Xios.cpp b/core/src/Xios.cpp index fa5ffc2ec..671145b01 100644 --- a/core/src/Xios.cpp +++ b/core/src/Xios.cpp @@ -1,9 +1,7 @@ /*! - * @file Xios.cpp * @author Tom Meltzer * @author Joe Wallwork * @author Adeleke Bankole - * @date 12 May 2025 * @brief XIOS interface implementation * @details * @@ -30,7 +28,7 @@ * period = ... * filename = ... * field_names = ... - */ +*/ #include #if USE_XIOS diff --git a/core/src/discontinuousgalerkin/ModelArrayDetails.cpp b/core/src/discontinuousgalerkin/ModelArrayDetails.cpp index 5483999ec..f5e963a03 100644 --- a/core/src/discontinuousgalerkin/ModelArrayDetails.cpp +++ b/core/src/discontinuousgalerkin/ModelArrayDetails.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayDetails.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #include "include/ModelArray.hpp" diff --git a/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp b/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp index 5d28351c5..2447fa221 100644 --- a/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp +++ b/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayDetails.hpp * - * @date Oct 19, 2022 * @author Tim Spain - */ +*/ #ifndef MODELARRAYDETAILS_HPP #define MODELARRAYDETAILS_HPP diff --git a/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp b/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp index 98cf202d2..099429725 100644 --- a/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp +++ b/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayTypedefs.hpp * - * @date Oct 19, 2022 * @author Tim Spain - */ +*/ // An inclusion file of ModelArray typedefs for Discontinuous Galerkin models. diff --git a/core/src/finitevolume/ModelArrayDetails.cpp b/core/src/finitevolume/ModelArrayDetails.cpp index bcc89de17..b8e405ffe 100644 --- a/core/src/finitevolume/ModelArrayDetails.cpp +++ b/core/src/finitevolume/ModelArrayDetails.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayDetails.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #include "include/ModelArray.hpp" diff --git a/core/src/finitevolume/include/ModelArrayDetails.hpp b/core/src/finitevolume/include/ModelArrayDetails.hpp index 03fa536f1..54ac4bce1 100644 --- a/core/src/finitevolume/include/ModelArrayDetails.hpp +++ b/core/src/finitevolume/include/ModelArrayDetails.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayDetails.hpp * - * @date Oct 19, 2022 * @author Tim Spain - */ +*/ #ifndef MODELARRAYDETAILS_HPP #define MODELARRAYDETAILS_HPP diff --git a/core/src/finitevolume/include/ModelArrayTypedefs.hpp b/core/src/finitevolume/include/ModelArrayTypedefs.hpp index 33b02944a..f0531d4c7 100644 --- a/core/src/finitevolume/include/ModelArrayTypedefs.hpp +++ b/core/src/finitevolume/include/ModelArrayTypedefs.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayTypedefs.hpp * - * @date Oct 19, 2022 * @author Tim Spain - */ +*/ // An inclusion file of ModelArray typedefs for finite volume models. diff --git a/core/src/include/Chrono.hpp b/core/src/include/Chrono.hpp index 414baf465..5d22607f2 100644 --- a/core/src/include/Chrono.hpp +++ b/core/src/include/Chrono.hpp @@ -1,9 +1,7 @@ /*! - * @file Chrono.hpp * - * @date Oct 28, 2021 * @author Tim Spain - */ +*/ #ifndef SRC_INCLUDE_CHRONO_HPP_ #define SRC_INCLUDE_CHRONO_HPP_ diff --git a/core/src/include/CommandLineParser.hpp b/core/src/include/CommandLineParser.hpp index 40650a274..dfc9be431 100644 --- a/core/src/include/CommandLineParser.hpp +++ b/core/src/include/CommandLineParser.hpp @@ -1,9 +1,7 @@ /*! - * @file CommandLineParser.hpp * - * @date Oct 8, 2021 * @author Tim Spain - */ +*/ #ifndef COMMANDLINEPARSER_HPP #define COMMANDLINEPARSER_HPP diff --git a/core/src/include/CommonRestartMetadata.hpp b/core/src/include/CommonRestartMetadata.hpp index 144e54099..175cafcd9 100644 --- a/core/src/include/CommonRestartMetadata.hpp +++ b/core/src/include/CommonRestartMetadata.hpp @@ -1,9 +1,7 @@ /*! - * @file CommonRestartMetadata.hpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #ifndef COMMONRESTARTMETADATA_HPP #define COMMONRESTARTMETADATA_HPP diff --git a/core/src/include/ConfigMap.hpp b/core/src/include/ConfigMap.hpp index 5c2ca49e0..e350a4ee9 100644 --- a/core/src/include/ConfigMap.hpp +++ b/core/src/include/ConfigMap.hpp @@ -1,9 +1,7 @@ /*! - * @file ConfigMap.hpp * - * @date Aug 19, 2022 * @author Tim Spain - */ +*/ #ifndef CONFIGMAP_HPP #define CONFIGMAP_HPP diff --git a/core/src/include/ConfigurationHelp.hpp b/core/src/include/ConfigurationHelp.hpp index bd7b49bd8..a5623687b 100644 --- a/core/src/include/ConfigurationHelp.hpp +++ b/core/src/include/ConfigurationHelp.hpp @@ -1,9 +1,7 @@ /*! - * @file ConfigurationHelp.hpp * - * @date 20 Nov 2024 * @author Tim Spain - */ +*/ #ifndef CONFIGURATIONHELP_HPP #define CONFIGURATIONHELP_HPP diff --git a/core/src/include/ConfigurationHelpPrinter.hpp b/core/src/include/ConfigurationHelpPrinter.hpp index 2f99ae8e3..4e2ff60e9 100644 --- a/core/src/include/ConfigurationHelpPrinter.hpp +++ b/core/src/include/ConfigurationHelpPrinter.hpp @@ -1,9 +1,7 @@ /*! - * @file ConfigurationHelpPrinter.hpp * - * @date Aug 18, 2022 * @author Tim Spain - */ +*/ #ifndef CONFIGURATIONHELPPRINTER_HPP #define CONFIGURATIONHELPPRINTER_HPP diff --git a/core/src/include/Configurator.hpp b/core/src/include/Configurator.hpp index 55d0b420d..09e81162c 100644 --- a/core/src/include/Configurator.hpp +++ b/core/src/include/Configurator.hpp @@ -1,9 +1,7 @@ /*! - * @file Configurator.hpp * - * @date Oct 8, 2021 * @author Tim Spain - */ +*/ #ifndef CONFIGURATOR_HPP #define CONFIGURATOR_HPP diff --git a/core/src/include/Configured.hpp b/core/src/include/Configured.hpp index 4f4a98958..4cd7fc87a 100644 --- a/core/src/include/Configured.hpp +++ b/core/src/include/Configured.hpp @@ -1,9 +1,7 @@ /*! - * @file Configured.hpp * - * @date Oct 8, 2021 * @author Tim Spain - */ +*/ #ifndef CONFIGURED_HPP #define CONFIGURED_HPP diff --git a/core/src/include/ConfiguredModule.hpp b/core/src/include/ConfiguredModule.hpp index 9c0269bdf..8a4f002af 100644 --- a/core/src/include/ConfiguredModule.hpp +++ b/core/src/include/ConfiguredModule.hpp @@ -1,9 +1,7 @@ /*! - * @file ConfiguredModule.hpp * - * @date Oct 29, 2021 * @author Tim Spain - */ +*/ #ifndef CONFIGUREDMODULE_HPP #define CONFIGUREDMODULE_HPP diff --git a/core/src/include/DevStep.hpp b/core/src/include/DevStep.hpp index a9b85de0f..54d936667 100644 --- a/core/src/include/DevStep.hpp +++ b/core/src/include/DevStep.hpp @@ -1,9 +1,7 @@ /*! - * @file DevStep.hpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #ifndef DEVSTEP_HPP #define DEVSTEP_HPP diff --git a/core/src/include/EnumWrapper.hpp b/core/src/include/EnumWrapper.hpp index 146e77a89..d1aa72c0a 100644 --- a/core/src/include/EnumWrapper.hpp +++ b/core/src/include/EnumWrapper.hpp @@ -1,9 +1,7 @@ /*! - * @file EnumWrapper.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef ENUMWRAPPER_HPP #define ENUMWRAPPER_HPP diff --git a/core/src/include/FileCallbackCloser.hpp b/core/src/include/FileCallbackCloser.hpp index 8756a1e10..4378f31fe 100644 --- a/core/src/include/FileCallbackCloser.hpp +++ b/core/src/include/FileCallbackCloser.hpp @@ -1,9 +1,7 @@ /*! - * @file FileCallbackCloser.hpp * - * @date 15 May 2023 * @author Tim Spain - */ +*/ #ifndef FILECALLBACKCLOSER_HPP #define FILECALLBACKCLOSER_HPP diff --git a/core/src/include/Finalizer.hpp b/core/src/include/Finalizer.hpp index 4e5bea88d..07bb7bfe1 100644 --- a/core/src/include/Finalizer.hpp +++ b/core/src/include/Finalizer.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelFinalizer.hpp * - * @date Sep 3, 2024 * @author Tim Spain - */ +*/ #ifndef FINALIZER_HPP #define FINALIZER_HPP diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index 3c4f4bd30..05f5d2f9a 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -1,9 +1,7 @@ /*! - * @file Halo.hpp * - * @date 19 Aug 2025 * @author Tom Meltzer - */ +*/ #ifndef HALO_HPP #define HALO_HPP diff --git a/core/src/include/IModelStep.hpp b/core/src/include/IModelStep.hpp index 7b744af86..8ae589d33 100644 --- a/core/src/include/IModelStep.hpp +++ b/core/src/include/IModelStep.hpp @@ -1,9 +1,7 @@ /*! - * @file IModelStep.hpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #ifndef IMODELSTEP_HPP #define IMODELSTEP_HPP diff --git a/core/src/include/Iterator.hpp b/core/src/include/Iterator.hpp index f3c00128a..53c429bf1 100644 --- a/core/src/include/Iterator.hpp +++ b/core/src/include/Iterator.hpp @@ -1,8 +1,6 @@ /*! - * @file Iterator.hpp - * @date 11 Aug 2021 * @author Tim Spain - */ +*/ #ifndef SRC_INCLUDE_ITERATOR_HPP #define SRC_INCLUDE_ITERATOR_HPP diff --git a/core/src/include/Logged.hpp b/core/src/include/Logged.hpp index 5f1069778..3937cfbe1 100644 --- a/core/src/include/Logged.hpp +++ b/core/src/include/Logged.hpp @@ -1,8 +1,6 @@ /*! - * @file Logged.hpp - * @date 12 Aug 2021 * @author Tim Spain - */ +*/ #ifndef SRC_INCLUDE_LOGGED_HPP #define SRC_INCLUDE_LOGGED_HPP diff --git a/core/src/include/MissingData.hpp b/core/src/include/MissingData.hpp index 501f6f029..3354312a1 100644 --- a/core/src/include/MissingData.hpp +++ b/core/src/include/MissingData.hpp @@ -1,9 +1,7 @@ /*! - * @file MissingData.hpp * - * @date Jun 14, 2022 * @author Tim Spain - */ +*/ #ifndef MISSINGDATA_HPP #define MISSINGDATA_HPP diff --git a/core/src/include/Model.hpp b/core/src/include/Model.hpp index c165c5681..ee9635d22 100644 --- a/core/src/include/Model.hpp +++ b/core/src/include/Model.hpp @@ -1,9 +1,7 @@ /*! - * @file Model.hpp - * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet - */ +*/ #ifndef MODEL_HPP #define MODEL_HPP diff --git a/core/src/include/ModelArray.hpp b/core/src/include/ModelArray.hpp index 0695032b9..88c0a325c 100644 --- a/core/src/include/ModelArray.hpp +++ b/core/src/include/ModelArray.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelArray.hpp * - * @date 19 Aug 2025 * @author Tim Spain - */ +*/ #ifndef MODELARRAY_HPP #define MODELARRAY_HPP diff --git a/core/src/include/ModelArrayRef.hpp b/core/src/include/ModelArrayRef.hpp index 02a750196..9bf188503 100644 --- a/core/src/include/ModelArrayRef.hpp +++ b/core/src/include/ModelArrayRef.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayRef.hpp * - * @date 22 Feb 2023 * @author Tim Spain - */ +*/ #ifndef MODELARRAYREF_HPP #define MODELARRAYREF_HPP diff --git a/core/src/include/ModelArrayReferenceStore.hpp b/core/src/include/ModelArrayReferenceStore.hpp index d653873b0..bc21d898f 100644 --- a/core/src/include/ModelArrayReferenceStore.hpp +++ b/core/src/include/ModelArrayReferenceStore.hpp @@ -1,9 +1,7 @@ /*! - * @file MARStore.hpp * - * @date 30 Aug 2023 * @author Tim Spain - */ +*/ #ifndef MARSTORE_HPP #define MARSTORE_HPP diff --git a/core/src/include/ModelArraySlice.hpp b/core/src/include/ModelArraySlice.hpp index 9a90d67fe..9a9afd2c3 100644 --- a/core/src/include/ModelArraySlice.hpp +++ b/core/src/include/ModelArraySlice.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelArraySlice.hpp * - * @date 19 Aug 2025 * @author Tim Spain - */ +*/ #ifndef MODELARRAYSLICE_HPP #define MODELARRAYSLICE_HPP diff --git a/core/src/include/ModelComponent.hpp b/core/src/include/ModelComponent.hpp index 6f8d43257..787cead45 100644 --- a/core/src/include/ModelComponent.hpp +++ b/core/src/include/ModelComponent.hpp @@ -1,10 +1,8 @@ /*! - * @file ModelComponent.hpp * - * @date 11 Feb 2025 * @author Tim Spain * @author Einar Ólason - */ +*/ #ifndef MODELCOMPONENT_HPP #define MODELCOMPONENT_HPP diff --git a/core/src/include/ModelConfig.hpp b/core/src/include/ModelConfig.hpp index 5933e18ee..b676993b5 100644 --- a/core/src/include/ModelConfig.hpp +++ b/core/src/include/ModelConfig.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelConfig.hpp * - * @date 14 Apr 2023 * @author Tim Spain - */ +*/ #ifndef MODELCONFIG_HPP #define MODELCONFIG_HPP diff --git a/core/src/include/ModelMPI.hpp b/core/src/include/ModelMPI.hpp index b6624aa0f..f46f17881 100644 --- a/core/src/include/ModelMPI.hpp +++ b/core/src/include/ModelMPI.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelMPI.hpp * - * @date 04 Jun 2025 * @author Tom Meltzer - */ +*/ #ifndef MODELMPI_HPP #define MODELMPI_HPP diff --git a/core/src/include/ModelMetadata.hpp b/core/src/include/ModelMetadata.hpp index 4e30e69de..30cbf970d 100644 --- a/core/src/include/ModelMetadata.hpp +++ b/core/src/include/ModelMetadata.hpp @@ -1,10 +1,8 @@ /*! - * @file ModelMetadata.hpp * - * @date 19 Jun 2025 * @author Tim Spain * @author Tom Meltzer - */ +*/ #ifndef MODELMETADATA_HPP #define MODELMETADATA_HPP diff --git a/core/src/include/ModelState.hpp b/core/src/include/ModelState.hpp index d73305805..ae0e1bc87 100644 --- a/core/src/include/ModelState.hpp +++ b/core/src/include/ModelState.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelState.hpp * - * @date Feb 28, 2022 * @author Tim Spain - */ +*/ #ifndef MODELSTATE_HPP #define MODELSTATE_HPP diff --git a/core/src/include/Module.hpp b/core/src/include/Module.hpp index 7cd8baf96..7c1362cfd 100644 --- a/core/src/include/Module.hpp +++ b/core/src/include/Module.hpp @@ -1,9 +1,7 @@ /*! - * @file Module.hpp * - * @date 23 Sep 2024 * @author Tim Spain - */ +*/ #ifndef MODULE_HPP #define MODULE_HPP diff --git a/core/src/include/MonthlyCubicBSpline.hpp b/core/src/include/MonthlyCubicBSpline.hpp index a2e036e72..ace9a636f 100644 --- a/core/src/include/MonthlyCubicBSpline.hpp +++ b/core/src/include/MonthlyCubicBSpline.hpp @@ -1,9 +1,7 @@ /*! - * @file MonthlyCubicBSpline.hpp * - * @date Oct 14, 2022 * @author Einar Örn Ólason - */ +*/ #ifndef MONTHLYCUBICBSPLINE_HPP #define MONTHLYCUBICBSPLINE_HPP diff --git a/core/src/include/NetcdfMetadataConfiguration.hpp b/core/src/include/NetcdfMetadataConfiguration.hpp index 7295dc161..81bd976d3 100644 --- a/core/src/include/NetcdfMetadataConfiguration.hpp +++ b/core/src/include/NetcdfMetadataConfiguration.hpp @@ -1,9 +1,7 @@ /*! - * @file NetcdfMetadataConfiguration.hpp * - * @date Aug 29, 2022 * @author Tim Spain - */ +*/ #ifndef NETCDFMETADATACONFIGURATION_HPP #define NETCDFMETADATACONFIGURATION_HPP diff --git a/core/src/include/NextsimModule.hpp b/core/src/include/NextsimModule.hpp index 56f99850d..f1149014d 100644 --- a/core/src/include/NextsimModule.hpp +++ b/core/src/include/NextsimModule.hpp @@ -1,9 +1,7 @@ /*! - * @file NextsimModule.hpp * - * @date Sep 13, 2024 * @author Tim Spain - */ +*/ #ifndef NEXTSIMMODULE_HPP #define NEXTSIMMODULE_HPP diff --git a/core/src/include/OutputSpec.hpp b/core/src/include/OutputSpec.hpp index 0645f60e5..3eac519d0 100644 --- a/core/src/include/OutputSpec.hpp +++ b/core/src/include/OutputSpec.hpp @@ -1,9 +1,7 @@ /*! - * @file OutputSpec.hpp * - * @date Aug 25, 2022 * @author Tim Spain - */ +*/ #ifndef OUTPUTSPEC_HPP #define OUTPUTSPEC_HPP diff --git a/core/src/include/ParaGridIO.hpp b/core/src/include/ParaGridIO.hpp index e0468f72b..e28341989 100644 --- a/core/src/include/ParaGridIO.hpp +++ b/core/src/include/ParaGridIO.hpp @@ -1,9 +1,7 @@ /*! - * @file ParaGridIO.hpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #ifndef PARAGRIDIO_HPP #define PARAGRIDIO_HPP diff --git a/core/src/include/PrognosticData.hpp b/core/src/include/PrognosticData.hpp index 5b562dd29..9d9a8732d 100644 --- a/core/src/include/PrognosticData.hpp +++ b/core/src/include/PrognosticData.hpp @@ -1,9 +1,7 @@ /*! - * @file PrognosticData.hpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #ifndef PROGNOSTICDATA_HPP #define PROGNOSTICDATA_HPP diff --git a/core/src/include/RectGridIO.hpp b/core/src/include/RectGridIO.hpp index 22ef26c9a..b7c999aa4 100644 --- a/core/src/include/RectGridIO.hpp +++ b/core/src/include/RectGridIO.hpp @@ -1,10 +1,8 @@ /*! - * @file RectGridIO.hpp * - * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet - */ +*/ #ifndef RECTGRIDIO_HPP #define RECTGRIDIO_HPP diff --git a/core/src/include/Slice.hpp b/core/src/include/Slice.hpp index 00add3c38..99d43a194 100644 --- a/core/src/include/Slice.hpp +++ b/core/src/include/Slice.hpp @@ -1,9 +1,7 @@ /*! - * @file Slice.hpp * - * @date 4 Nov 2023 * @author Tim Spain - */ +*/ #ifndef SLICE_HPP #define SLICE_HPP diff --git a/core/src/include/StructureFactory.hpp b/core/src/include/StructureFactory.hpp index 9b2b9c5a4..18a44c7f5 100644 --- a/core/src/include/StructureFactory.hpp +++ b/core/src/include/StructureFactory.hpp @@ -1,10 +1,8 @@ /*! - * @file StructureFactory.hpp * - * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet - */ +*/ #ifndef STRUCTUREFACTORY_HPP #define STRUCTUREFACTORY_HPP diff --git a/core/src/include/TextTag.hpp b/core/src/include/TextTag.hpp index 09ae5dbac..32d9d26ff 100644 --- a/core/src/include/TextTag.hpp +++ b/core/src/include/TextTag.hpp @@ -1,9 +1,7 @@ /*! - * @file TextTag.hpp * - * @date 27 Feb 2023 * @author Tim Spain - */ +*/ #ifndef TEXTTAG_HPP #define TEXTTAG_HPP diff --git a/core/src/include/Time.hpp b/core/src/include/Time.hpp index 7753f1890..28dc64951 100644 --- a/core/src/include/Time.hpp +++ b/core/src/include/Time.hpp @@ -1,9 +1,7 @@ /*! - * @file Time.hpp * - * @date Mar 15, 2022 * @author Tim Spain - */ +*/ #ifndef TIME_HPP #define TIME_HPP diff --git a/core/src/include/Xios.hpp b/core/src/include/Xios.hpp index a021bb25c..16d65c028 100644 --- a/core/src/include/Xios.hpp +++ b/core/src/include/Xios.hpp @@ -1,15 +1,13 @@ /*! - * @file Xios.hpp * @author Tom Meltzer * @author Joe Wallwork * @author Adeleke Bankole - * @date 12 May 2025 * @brief XIOS interface header * @details * * Header file for XIOS interface * - */ +*/ #ifndef SRC_INCLUDE_XIOS_HPP #define SRC_INCLUDE_XIOS_HPP diff --git a/core/src/include/constants.hpp b/core/src/include/constants.hpp index 930c02077..0e267e152 100644 --- a/core/src/include/constants.hpp +++ b/core/src/include/constants.hpp @@ -1,8 +1,6 @@ /*! - * @file constants.hpp - * @date 05 Dec 2024 * @author Tim Spain - */ +*/ #ifndef SRC_INCLUDE_CONSTANTS_HPP #define SRC_INCLUDE_CONSTANTS_HPP diff --git a/core/src/include/gridNames.hpp b/core/src/include/gridNames.hpp index c6c68695f..5df1ae682 100644 --- a/core/src/include/gridNames.hpp +++ b/core/src/include/gridNames.hpp @@ -1,9 +1,7 @@ /*! - * @file gridNames.hpp * - * @date Aug 23, 2024 * @author Tim Spain - */ +*/ #ifndef GRIDNAMES_HPP #define GRIDNAMES_HPP diff --git a/core/src/include/indexer.hpp b/core/src/include/indexer.hpp index c14b25b76..209efcceb 100644 --- a/core/src/include/indexer.hpp +++ b/core/src/include/indexer.hpp @@ -1,9 +1,7 @@ /*! - * @file indexer.hpp * - * @date Nov 5, 2024 * @author Tim Spain - */ +*/ #ifndef INDEXER_HPP #define INDEXER_HPP diff --git a/core/src/include/xios_c_interface.hpp b/core/src/include/xios_c_interface.hpp index 11713b637..ee00d43c8 100644 --- a/core/src/include/xios_c_interface.hpp +++ b/core/src/include/xios_c_interface.hpp @@ -1,8 +1,6 @@ /*! - * @file xios_c_interface.hpp * @author Tom Meltzer * @author Joe Wallwork - * @date 09 Dec 2024 * @brief C interface for XIOS library * @details * This interface is based on an earlier version provided by Laurent as part of @@ -12,7 +10,7 @@ * This can be expanded as we add more XIOS functionality to the nextSIM-DG XIOS * C++ interface `Xios.cpp`. * - */ +*/ #ifndef XIOS_C_INTERFACE #define XIOS_C_INTERFACE diff --git a/core/src/main.cpp b/core/src/main.cpp index 9314b0b1a..363a84062 100644 --- a/core/src/main.cpp +++ b/core/src/main.cpp @@ -1,9 +1,7 @@ /*! - * @file main.cpp - * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet - */ +*/ #include #ifdef USE_MPI diff --git a/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp b/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp index f96e9f89c..850b19ef0 100644 --- a/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp +++ b/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp @@ -1,9 +1,7 @@ /*! - * @file ConfigOutput.cpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #include "include/ConfigOutput.hpp" #include "include/FileCallbackCloser.hpp" diff --git a/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp b/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp index aca1ebaf4..1eb36cb22 100644 --- a/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp +++ b/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp @@ -1,9 +1,7 @@ /*! - * @file SimpleOutput.cpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #include "include/SimpleOutput.hpp" diff --git a/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp index 12b221d62..a924aa22b 100644 --- a/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp @@ -1,9 +1,7 @@ /*! - * @file ConfigOutput.hpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #ifndef CONFIGOUTPUT_HPP #define CONFIGOUTPUT_HPP diff --git a/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp index 6351daae3..f51f0f6cb 100644 --- a/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp @@ -1,9 +1,7 @@ /*! - * @file NoOutput.hpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #ifndef NOOUTPUT_HPP #define NOOUTPUT_HPP diff --git a/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp index ea383fd16..6c197af84 100644 --- a/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp @@ -1,9 +1,7 @@ /*! - * @file SimpleOutput.hpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #ifndef SIMPLEOUTPUT_HPP #define SIMPLEOUTPUT_HPP diff --git a/core/src/modules/DynamicsModule/BBMDynamics.cpp b/core/src/modules/DynamicsModule/BBMDynamics.cpp index 7186d5580..18559b7f7 100644 --- a/core/src/modules/DynamicsModule/BBMDynamics.cpp +++ b/core/src/modules/DynamicsModule/BBMDynamics.cpp @@ -1,10 +1,8 @@ /*! - * @file BBMDynamics.cpp * - * @date 05 Dec 2024 * @author Tim Spain * @author Einar Ólason - */ +*/ #include "include/BBMDynamics.hpp" #include "include/constants.hpp" diff --git a/core/src/modules/DynamicsModule/MEVPDynamics.cpp b/core/src/modules/DynamicsModule/MEVPDynamics.cpp index 1c7879771..1334d9227 100644 --- a/core/src/modules/DynamicsModule/MEVPDynamics.cpp +++ b/core/src/modules/DynamicsModule/MEVPDynamics.cpp @@ -1,11 +1,9 @@ /*! - * @file MEVPDynamics.cpp * - * @date 05 Dec 2024 * @author Tim Spain * @author Piotr Minakowski * @author Einar Ólason - */ +*/ #include "include/MEVPDynamics.hpp" #include "include/constants.hpp" diff --git a/core/src/modules/DynamicsModule/include/BBMDynamics.hpp b/core/src/modules/DynamicsModule/include/BBMDynamics.hpp index 3f538b789..f821e5739 100644 --- a/core/src/modules/DynamicsModule/include/BBMDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/BBMDynamics.hpp @@ -1,9 +1,7 @@ /*! - * @file BBMDynamics.hpp * - * @date 27 Mar 2025 * @author Tim Spain - */ +*/ #ifndef BBMDYNAMICS_HPP #define BBMDYNAMICS_HPP diff --git a/core/src/modules/DynamicsModule/include/DummyDynamics.hpp b/core/src/modules/DynamicsModule/include/DummyDynamics.hpp index d7c45da20..212e8b96d 100644 --- a/core/src/modules/DynamicsModule/include/DummyDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/DummyDynamics.hpp @@ -1,9 +1,7 @@ /*! - * @file DummyDynamics.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef DUMMYDYNAMICS_HPP #define DUMMYDYNAMICS_HPP diff --git a/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp b/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp index 5b3ae64c1..d5c1ef4a7 100644 --- a/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp @@ -1,9 +1,7 @@ /*! - * @file FreeDriftDynamics.hpp * - * @date 19 Nov 2024 * @author Tim Spain - */ +*/ #ifndef FREEDRIFTDYNAMICS_HPP #define FREEDRIFTDYNAMICS_HPP diff --git a/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp b/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp index 2d6aa3683..430c1a4f4 100644 --- a/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp @@ -1,11 +1,9 @@ /*! - * @file MEVPDynamics.hpp * - * @date 27 Mar 2025 * @author Tim Spain * @author Piotr Minakowski * @author Einar Ólason - */ +*/ #ifndef MEVPDYNAMICS_HPP #define MEVPDYNAMICS_HPP diff --git a/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp b/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp index 8765644cc..d76d986f0 100644 --- a/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp +++ b/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp @@ -1,9 +1,7 @@ /*! - * @file LinearFreezing.hpp * - * @date Nov 10, 2021 * @author Tim Spain - */ +*/ #ifndef LINEARFREEZING_HPP #define LINEARFREEZING_HPP diff --git a/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp b/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp index 6fca603fa..4443c4796 100644 --- a/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp +++ b/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp @@ -1,9 +1,7 @@ /*! - * @file UnescoFreezing.hpp * - * @date Nov 10, 2021 * @author Tim Spain - */ +*/ #ifndef UNESCOFREEZING_HPP #define UNESCOFREEZING_HPP diff --git a/core/src/modules/StructureModule/ParametricGrid.cpp b/core/src/modules/StructureModule/ParametricGrid.cpp index cc3731d45..502160b06 100644 --- a/core/src/modules/StructureModule/ParametricGrid.cpp +++ b/core/src/modules/StructureModule/ParametricGrid.cpp @@ -1,9 +1,7 @@ /*! - * @file ParametricGrid.cpp * - * @date Oct 24, 2022 * @author Tim Spain - */ +*/ #include "include/ParametricGrid.hpp" diff --git a/core/src/modules/StructureModule/RectangularGrid.cpp b/core/src/modules/StructureModule/RectangularGrid.cpp index e6e5221b7..54761d9e3 100644 --- a/core/src/modules/StructureModule/RectangularGrid.cpp +++ b/core/src/modules/StructureModule/RectangularGrid.cpp @@ -1,9 +1,7 @@ /*! - * @file RectangularGrid.cpp * - * @date Feb 7, 2022 * @author Tim Spain - */ +*/ #include "include/RectangularGrid.hpp" diff --git a/core/src/modules/StructureModule/include/ParametricGrid.hpp b/core/src/modules/StructureModule/include/ParametricGrid.hpp index 6f9f234f8..03fe32d01 100644 --- a/core/src/modules/StructureModule/include/ParametricGrid.hpp +++ b/core/src/modules/StructureModule/include/ParametricGrid.hpp @@ -1,10 +1,8 @@ /*! - * @file ParametricGrid.hpp * - * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet - */ +*/ #ifndef PARAMETRICGRID_HPP #define PARAMETRICGRID_HPP diff --git a/core/src/modules/StructureModule/include/RectangularGrid.hpp b/core/src/modules/StructureModule/include/RectangularGrid.hpp index 85e0169c4..cbcc18361 100644 --- a/core/src/modules/StructureModule/include/RectangularGrid.hpp +++ b/core/src/modules/StructureModule/include/RectangularGrid.hpp @@ -1,10 +1,8 @@ /*! - * @file RectangularGrid.hpp * - * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet - */ +*/ #ifndef RECTANGULARGRID_HPP #define RECTANGULARGRID_HPP diff --git a/core/src/modules/include/IDiagnosticOutput.hpp b/core/src/modules/include/IDiagnosticOutput.hpp index ca62650e1..29d9e8fca 100644 --- a/core/src/modules/include/IDiagnosticOutput.hpp +++ b/core/src/modules/include/IDiagnosticOutput.hpp @@ -1,9 +1,7 @@ /*! - * @file IDiagnosticOutput.hpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #ifndef IDIAGNOSTICOUTPUT_HPP #define IDIAGNOSTICOUTPUT_HPP diff --git a/core/src/modules/include/IDynamics.hpp b/core/src/modules/include/IDynamics.hpp index 164ccfd6b..13c4adcbc 100644 --- a/core/src/modules/include/IDynamics.hpp +++ b/core/src/modules/include/IDynamics.hpp @@ -1,9 +1,7 @@ /*! - * @file IDynamics.hpp * - * @date 06 Dec 2024 * @author Tim Spain - */ +*/ #ifndef IDYNAMICS_HPP #define IDYNAMICS_HPP diff --git a/core/src/modules/include/IFreezingPoint.hpp b/core/src/modules/include/IFreezingPoint.hpp index efaaeb5c1..fb6ad78b2 100644 --- a/core/src/modules/include/IFreezingPoint.hpp +++ b/core/src/modules/include/IFreezingPoint.hpp @@ -1,9 +1,7 @@ /*! - * @file IFreezingPoint.hpp * - * @date Nov 9, 2021 * @author Tim Spain - */ +*/ #ifndef SRC_INCLUDE_IFREEZINGPOINT_HPP_ #define SRC_INCLUDE_IFREEZINGPOINT_HPP_ diff --git a/core/src/modules/include/IStructure.hpp b/core/src/modules/include/IStructure.hpp index 980d11c59..fb6ae237a 100644 --- a/core/src/modules/include/IStructure.hpp +++ b/core/src/modules/include/IStructure.hpp @@ -1,10 +1,8 @@ /*! - * @file IStructure.hpp * - * @date 04 Jun 2025 * @author Tim Spain * @author Kacper Kornet - */ +*/ #ifndef ISTRUCTURE_HPP #define ISTRUCTURE_HPP diff --git a/core/test/ArgV.cpp b/core/test/ArgV.cpp index c10a1ca4e..bd2eaac5b 100644 --- a/core/test/ArgV.cpp +++ b/core/test/ArgV.cpp @@ -1,9 +1,7 @@ /*! - * @file ArgV.cpp * - * @date Oct 11, 2021 * @author Tim Spain - */ +*/ #include "ArgV.hpp" diff --git a/core/test/ArgV.hpp b/core/test/ArgV.hpp index 4f18dccac..331f9592a 100644 --- a/core/test/ArgV.hpp +++ b/core/test/ArgV.hpp @@ -1,9 +1,7 @@ /*! - * @file ArgV.hpp * - * @date Oct 11, 2021 * @author Tim Spain - */ +*/ #include #include diff --git a/core/test/CommandLineParser_test.cpp b/core/test/CommandLineParser_test.cpp index 6160be004..d206e0394 100644 --- a/core/test/CommandLineParser_test.cpp +++ b/core/test/CommandLineParser_test.cpp @@ -1,9 +1,7 @@ /*! - * @file CommandLineParser_test.cpp * - * @date Oct 8, 2021 * @author Tim Spain - */ +*/ #include "ArgV.hpp" #include "CommandLineParser.hpp" diff --git a/core/test/ConfigOutput_test.cpp b/core/test/ConfigOutput_test.cpp index 783a91870..d6c410495 100644 --- a/core/test/ConfigOutput_test.cpp +++ b/core/test/ConfigOutput_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ConfigOutput_test.cpp * - * @date 21 Aug 2025 * @author Tim Spain - */ +*/ #ifdef USE_MPI #include diff --git a/core/test/Configurator_test.cpp b/core/test/Configurator_test.cpp index b1e3dc4b9..9be38acb7 100644 --- a/core/test/Configurator_test.cpp +++ b/core/test/Configurator_test.cpp @@ -1,9 +1,7 @@ /*! - * @file Configurator_test.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #include "ArgV.hpp" #include "Configurator.hpp" diff --git a/core/test/DynamicsModuleForPDtest.cpp b/core/test/DynamicsModuleForPDtest.cpp index f862d555d..c4c654bb7 100644 --- a/core/test/DynamicsModuleForPDtest.cpp +++ b/core/test/DynamicsModuleForPDtest.cpp @@ -1,9 +1,7 @@ /*! - * @file DynamicsModuleForPDtest.cpp * - * @date 5 May 2023 * @author Tim Spain - */ +*/ #include "include/IDynamics.hpp" #include "include/NextsimModule.hpp" diff --git a/core/test/FileCallbackCloser_test.cpp b/core/test/FileCallbackCloser_test.cpp index 6eb3fda6f..1a24979a8 100644 --- a/core/test/FileCallbackCloser_test.cpp +++ b/core/test/FileCallbackCloser_test.cpp @@ -1,9 +1,7 @@ /*! - * @file FileCallbackCloser_test.cpp * - * @date 15 May 2023 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/Finalizer_test.cpp b/core/test/Finalizer_test.cpp index 020cdd655..57c2265d0 100644 --- a/core/test/Finalizer_test.cpp +++ b/core/test/Finalizer_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelFinalizer_test.cpp * - * @date Sep 3, 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/HaloExchangeCB_test.cpp b/core/test/HaloExchangeCB_test.cpp index 4d707ef76..fbe4104d6 100644 --- a/core/test/HaloExchangeCB_test.cpp +++ b/core/test/HaloExchangeCB_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelMetadata_test.cpp * - * @date 19 Aug 2025 * @author Tom Meltzer - */ +*/ #include diff --git a/core/test/HaloExchangePB_test.cpp b/core/test/HaloExchangePB_test.cpp index d2218d32a..f60522e32 100644 --- a/core/test/HaloExchangePB_test.cpp +++ b/core/test/HaloExchangePB_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelMetadata_test.cpp * - * @date 19 Aug 2025 * @author Tom Meltzer - */ +*/ #include diff --git a/core/test/Iterator_test.cpp b/core/test/Iterator_test.cpp index 0b084bb27..7d932a84f 100644 --- a/core/test/Iterator_test.cpp +++ b/core/test/Iterator_test.cpp @@ -1,8 +1,6 @@ /*! - * @file Iterator_test.cpp - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #include "Iterator.hpp" diff --git a/core/test/Logged_test.cpp b/core/test/Logged_test.cpp index 8c1c298f7..d75496c83 100644 --- a/core/test/Logged_test.cpp +++ b/core/test/Logged_test.cpp @@ -1,8 +1,6 @@ /*! - * @file Logged_test.cpp - * @date 12 Aug 2021 * @author Tim Spain - */ +*/ #include "Logged.hpp" diff --git a/core/test/ModelArrayRefDebug_test.cpp b/core/test/ModelArrayRefDebug_test.cpp index 6c684bfcd..fce6a27a7 100644 --- a/core/test/ModelArrayRefDebug_test.cpp +++ b/core/test/ModelArrayRefDebug_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayRefDebug_test.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/ModelArrayRef_test.cpp b/core/test/ModelArrayRef_test.cpp index d148f6a82..38773075a 100644 --- a/core/test/ModelArrayRef_test.cpp +++ b/core/test/ModelArrayRef_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayRef_test.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/ModelArraySlice_test.cpp b/core/test/ModelArraySlice_test.cpp index b3c2448bc..589b62f0c 100644 --- a/core/test/ModelArraySlice_test.cpp +++ b/core/test/ModelArraySlice_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelArraySlice_test.cpp * - * @date Nov 8, 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/ModelArray_test.cpp b/core/test/ModelArray_test.cpp index 61500bacd..804e0c637 100644 --- a/core/test/ModelArray_test.cpp +++ b/core/test/ModelArray_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelData_test.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/ModelComponent_test.cpp b/core/test/ModelComponent_test.cpp index a50a84938..3d2254c2c 100644 --- a/core/test/ModelComponent_test.cpp +++ b/core/test/ModelComponent_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelComponent_test.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/ModelMetadataCB_test.cpp b/core/test/ModelMetadataCB_test.cpp index 636833e3b..f566eeda1 100644 --- a/core/test/ModelMetadataCB_test.cpp +++ b/core/test/ModelMetadataCB_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelMetadata_test.cpp * - * @date 04 Jun 2025 * @author Tom Meltzer - */ +*/ #include #include diff --git a/core/test/ModelMetadataPB_test.cpp b/core/test/ModelMetadataPB_test.cpp index 75a190910..437ada1e8 100644 --- a/core/test/ModelMetadataPB_test.cpp +++ b/core/test/ModelMetadataPB_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelMetadata_test.cpp * - * @date 04 Jun 2025 * @author Tom Meltzer - */ +*/ #include #include diff --git a/core/test/MonthlyCubicBSpline_test.cpp b/core/test/MonthlyCubicBSpline_test.cpp index 9746d74b3..b7cdda7d8 100644 --- a/core/test/MonthlyCubicBSpline_test.cpp +++ b/core/test/MonthlyCubicBSpline_test.cpp @@ -1,9 +1,7 @@ /*! - * @file MonthlyCubicBSpline.hpp * - * @date Nov 7, 2023 * @author Einar Örn Ólason - */ +*/ #include "include/MonthlyCubicBSpline.hpp" diff --git a/core/test/PDTestDynamics.hpp b/core/test/PDTestDynamics.hpp index dd91ff4db..282e6f707 100644 --- a/core/test/PDTestDynamics.hpp +++ b/core/test/PDTestDynamics.hpp @@ -1,9 +1,7 @@ /*! - * @file PDTestDynamics.hpp * - * @date Jan 21, 2025 * @author Tim Spain - */ +*/ #ifndef PDTESTDYNAMICS_HPP #define PDTESTDYNAMICS_HPP diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index 4cddd4a61..36d455a4e 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -1,10 +1,8 @@ /*! - * @file ParaGrid_test.cpp * - * @date 21 Aug 2025 * @author Tim Spain * @author Tom Meltzer - */ +*/ #include "ModelArray.hpp" #include diff --git a/core/test/PrognosticDataIO_test.cpp b/core/test/PrognosticDataIO_test.cpp index 57038639a..4f1341a73 100644 --- a/core/test/PrognosticDataIO_test.cpp +++ b/core/test/PrognosticDataIO_test.cpp @@ -1,9 +1,7 @@ /*! - * @file PrognosticData_test.cpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/PrognosticData_test.cpp b/core/test/PrognosticData_test.cpp index 473902948..de86df2ab 100644 --- a/core/test/PrognosticData_test.cpp +++ b/core/test/PrognosticData_test.cpp @@ -1,9 +1,7 @@ /*! - * @file PrognosticData_test.cpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/RectGrid_test.cpp b/core/test/RectGrid_test.cpp index f9535331f..a56b76de9 100644 --- a/core/test/RectGrid_test.cpp +++ b/core/test/RectGrid_test.cpp @@ -1,9 +1,7 @@ /*! - * @file RectGrid_test.cpp * - * @date 04 Jun 2025 * @author Tim Spain - */ +*/ #ifdef USE_MPI #include diff --git a/core/test/Slice_test.cpp b/core/test/Slice_test.cpp index 5a09c28bf..1f3847a66 100644 --- a/core/test/Slice_test.cpp +++ b/core/test/Slice_test.cpp @@ -1,9 +1,7 @@ /*! - * @file Slice_test.cpp * - * @date 5 Nov 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/Time_test.cpp b/core/test/Time_test.cpp index 3ad7dfc5c..67cfb5c0a 100644 --- a/core/test/Time_test.cpp +++ b/core/test/Time_test.cpp @@ -1,9 +1,7 @@ /*! - * @file Time_test.cpp * - * @date 5 August, 2024 * @author Tim Spain - */ +*/ #include "include/Time.hpp" diff --git a/core/test/XiosAxis_test.cpp b/core/test/XiosAxis_test.cpp index 24ca5c3a0..bc4ca405a 100644 --- a/core/test/XiosAxis_test.cpp +++ b/core/test/XiosAxis_test.cpp @@ -1,14 +1,12 @@ /*! - * @file XiosAxis_test.cpp * @author Joe Wallwork * @author Adeleke Bankole - * @date 23 Apr 2025 * @brief Tests for XIOS axes * @details * This test is designed to test axis functionality of the C++ interface * for XIOS. * - */ +*/ #include #undef INFO diff --git a/core/test/XiosCalendar_test.cpp b/core/test/XiosCalendar_test.cpp index 916d9f592..54bbefb1d 100644 --- a/core/test/XiosCalendar_test.cpp +++ b/core/test/XiosCalendar_test.cpp @@ -1,14 +1,12 @@ /*! - * @file XiosCalendar_test.cpp * @author Joe Wallwork * @author Adeleke Bankole - * @date 06 May 2025 * @brief Tests for XIOS calendars * @details * This test is designed to test calendar functionality of the C++ interface * for XIOS. * - */ +*/ #include #undef INFO diff --git a/core/test/XiosDomain_test.cpp b/core/test/XiosDomain_test.cpp index d17195654..9b534628d 100644 --- a/core/test/XiosDomain_test.cpp +++ b/core/test/XiosDomain_test.cpp @@ -1,14 +1,12 @@ /*! - * @file XiosDomain_test.cpp * @author Joe Wallwork * @author Adeleke Bankole - * @date 29 Apr 2025 * @brief Tests for XIOS domains * @details * This test is designed to test domain functionality of the C++ interface * for XIOS. * - */ +*/ #include #undef INFO diff --git a/core/test/XiosField_test.cpp b/core/test/XiosField_test.cpp index 6d63d510d..454b3dc87 100644 --- a/core/test/XiosField_test.cpp +++ b/core/test/XiosField_test.cpp @@ -1,14 +1,12 @@ /*! - * @file XiosField_test.cpp * @author Joe Wallwork * @author Adeleke Bankole - * @date 07 May 2025 * @brief Tests for XIOS fields * @details * This test is designed to test field functionality of the C++ interface * for XIOS. * - */ +*/ #include #undef INFO diff --git a/core/test/XiosFile_test.cpp b/core/test/XiosFile_test.cpp index bf885838d..7a2630f48 100644 --- a/core/test/XiosFile_test.cpp +++ b/core/test/XiosFile_test.cpp @@ -1,14 +1,12 @@ /*! - * @file XiosFile_test.cpp * @author Joe Wallwork * @author Adeleke Bankole - * @date 12 May 2025 * @brief Tests for XIOS file * @details * This test is designed to test file functionality of the C++ interface * for XIOS. * - */ +*/ #include #undef INFO diff --git a/core/test/XiosGrid_test.cpp b/core/test/XiosGrid_test.cpp index 1a027f938..2fd7c714f 100644 --- a/core/test/XiosGrid_test.cpp +++ b/core/test/XiosGrid_test.cpp @@ -1,14 +1,12 @@ /*! - * @file XiosGrid_test.cpp * @author Joe Wallwork * @author Adeleke Bankole - * @date 23 Apr 2025 * @brief Tests for XIOS grid * @details * This test is designed to test grid functionality of the C++ interface * for XIOS. * - */ +*/ #include #undef INFO diff --git a/core/test/XiosRead_test.cpp b/core/test/XiosRead_test.cpp index a9ca8946a..7d92565ec 100644 --- a/core/test/XiosRead_test.cpp +++ b/core/test/XiosRead_test.cpp @@ -1,13 +1,11 @@ /*! - * @file XiosRead_test.cpp * @author Joe Wallwork - * @date 04 Jun 2025 * @brief Tests for XIOS read functionality * @details * This test is designed to test the file reading functionality of the C++ * interface for XIOS. * - */ +*/ #include #undef INFO diff --git a/core/test/XiosWrite_test.cpp b/core/test/XiosWrite_test.cpp index f9fdfe330..7cee0749c 100644 --- a/core/test/XiosWrite_test.cpp +++ b/core/test/XiosWrite_test.cpp @@ -1,13 +1,11 @@ /*! - * @file XiosWrite_test.cpp * @author Joe Wallwork - * @date 04 Jun 2025 * @brief Tests for XIOS write functionality * @details * This test is designed to test the file writing functionality of the C++ * interface for XIOS. * - */ +*/ #include #undef INFO diff --git a/core/test/testmodelarraydetails/ModelArrayDetails.cpp b/core/test/testmodelarraydetails/ModelArrayDetails.cpp index 2f9ff97b7..7b185cd86 100644 --- a/core/test/testmodelarraydetails/ModelArrayDetails.cpp +++ b/core/test/testmodelarraydetails/ModelArrayDetails.cpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayDetails.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #include "include/ModelArray.hpp" diff --git a/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp b/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp index 4b2a06871..bc96bb6ea 100644 --- a/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp +++ b/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayDetails.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef MODELARRAYDETAILS_HPP #define MODELARRAYDETAILS_HPP diff --git a/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp b/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp index 7d5b64240..d4a8b0203 100644 --- a/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp +++ b/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp @@ -1,9 +1,7 @@ /*! - * @file ModelArrayTypedefs.hpp * - * @date Oct 19, 2022 * @author Tim Spain - */ +*/ typedef ModelArray OneDField; typedef ModelArray TwoDField; diff --git a/dynamics/src/CGDynamicsKernel.cpp b/dynamics/src/CGDynamicsKernel.cpp index 2d01649f3..e7ed45983 100644 --- a/dynamics/src/CGDynamicsKernel.cpp +++ b/dynamics/src/CGDynamicsKernel.cpp @@ -1,10 +1,8 @@ /*! - * @file CGDynamicsKernel.cpp * - * @date 27 Mar 2025 * @author Tim Spain * @author Robert Jendersie - */ +*/ /* * The implementation of DynamicsKernel which uses continuous Galerkin (CG) numerics. diff --git a/dynamics/src/DGTransport.cpp b/dynamics/src/DGTransport.cpp index b42294c75..2455e4d59 100644 --- a/dynamics/src/DGTransport.cpp +++ b/dynamics/src/DGTransport.cpp @@ -1,8 +1,6 @@ /*! - * @file DGTransport.cpp - * @date July 10, 2022 * @author Thomas Richter - */ +*/ #include "DGTransport.hpp" #include "Interpolations.hpp" diff --git a/dynamics/src/DummyDynamicsKernel.cpp b/dynamics/src/DummyDynamicsKernel.cpp index f2f699dc9..b231ce7d9 100644 --- a/dynamics/src/DummyDynamicsKernel.cpp +++ b/dynamics/src/DummyDynamicsKernel.cpp @@ -1,9 +1,7 @@ /*! - * @file DummyDynamicsKernel.cpp * - * @date 17 Feb 2023 * @author Tim Spain - */ +*/ #include "include/DummyDynamicsKernel.hpp" diff --git a/dynamics/src/DynamicsKernel.cpp b/dynamics/src/DynamicsKernel.cpp index b318bd05b..aead532f7 100644 --- a/dynamics/src/DynamicsKernel.cpp +++ b/dynamics/src/DynamicsKernel.cpp @@ -1,9 +1,7 @@ /*! - * @file DynamicsKernel.cpp * - * @date Jan 31, 2024 * @author Tim Spain - */ +*/ #include "include/DynamicsKernel.hpp" diff --git a/dynamics/src/MEVPStressUpdateStep.cpp b/dynamics/src/MEVPStressUpdateStep.cpp index b1f353242..51bbb5ae2 100644 --- a/dynamics/src/MEVPStressUpdateStep.cpp +++ b/dynamics/src/MEVPStressUpdateStep.cpp @@ -1,9 +1,7 @@ /*! - * @file MEVPStressUpdateStep.cpp * - * @date Feb 1, 2024 * @author Tim Spain - */ +*/ #include "MEVPStressUpdateStep.hpp" diff --git a/dynamics/src/ParametricMap.cpp b/dynamics/src/ParametricMap.cpp index d1318bd86..539dc974b 100644 --- a/dynamics/src/ParametricMap.cpp +++ b/dynamics/src/ParametricMap.cpp @@ -1,9 +1,7 @@ /*! - * @file ParametricMap.cpp * - * @date 19 Feb 2025 * @author Thomas Richter - */ +*/ #include "ParametricMap.hpp" #include "ParametricTools.hpp" diff --git a/dynamics/src/ParametricMesh.cpp b/dynamics/src/ParametricMesh.cpp index 158ee7844..4da4fc15b 100644 --- a/dynamics/src/ParametricMesh.cpp +++ b/dynamics/src/ParametricMesh.cpp @@ -1,8 +1,6 @@ /*! - * @file ParametricMesh.hpp - * @date 18 Mar 2025 * @author Thomas Richter - */ +*/ #include "ParametricMesh.hpp" diff --git a/dynamics/src/ParametricTools.cpp b/dynamics/src/ParametricTools.cpp index e52107272..997e6f3e8 100644 --- a/dynamics/src/ParametricTools.cpp +++ b/dynamics/src/ParametricTools.cpp @@ -1,8 +1,6 @@ /*! - * @file ParametricTools.cpp - * @date July 28, 2022 * @author Thomas Richter - */ +*/ #include "ParametricTools.hpp" #include "codeGenerationCGinGauss.hpp" diff --git a/dynamics/src/include/BBMDynamicsKernel.hpp b/dynamics/src/include/BBMDynamicsKernel.hpp index d7210ff64..2ed1246d4 100644 --- a/dynamics/src/include/BBMDynamicsKernel.hpp +++ b/dynamics/src/include/BBMDynamicsKernel.hpp @@ -1,10 +1,8 @@ /*! - * @file BBMDynamicsKernel.hpp * - * @date 09 Nov 2024 * @author Tim Spain * @author Piotr Minakowski - */ +*/ #ifndef BBMDYNAMICSKERNEL_HPP #define BBMDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/BBMParameters.hpp b/dynamics/src/include/BBMParameters.hpp index 2110a10a7..35a12450f 100644 --- a/dynamics/src/include/BBMParameters.hpp +++ b/dynamics/src/include/BBMParameters.hpp @@ -1,9 +1,7 @@ /*! - * @file BBMParameters.hpp - * @date 19 Nov 2024 * @author Tim Spain * @author Piotr Minakowski - */ +*/ #ifndef __MEBPARAMETERS_HPP #define __MEBPARAMETERS_HPP diff --git a/dynamics/src/include/BBMStressUpdateStep.hpp b/dynamics/src/include/BBMStressUpdateStep.hpp index 0eeb8a9b4..e384a4137 100644 --- a/dynamics/src/include/BBMStressUpdateStep.hpp +++ b/dynamics/src/include/BBMStressUpdateStep.hpp @@ -1,9 +1,7 @@ /*! - * @file BBMStressUpdateStep.hpp * - * @date 06 Dec 2024 * @author Tim Spain - */ +*/ #ifndef BBMSTRESSUPDATESTEP_HPP #define BBMSTRESSUPDATESTEP_HPP diff --git a/dynamics/src/include/BrittleCGDynamicsKernel.hpp b/dynamics/src/include/BrittleCGDynamicsKernel.hpp index 005693ff9..d0a66d12d 100644 --- a/dynamics/src/include/BrittleCGDynamicsKernel.hpp +++ b/dynamics/src/include/BrittleCGDynamicsKernel.hpp @@ -1,11 +1,9 @@ /*! - * @file BrittleCGDynamicsKernel.hpp * - * @date 27 Mar 2025 * @author Tim Spain * @author Einar Ólason * @author Robert Jendersie - */ +*/ #ifndef BRITTLECGDYNAMICSKERNEL_HPP #define BRITTLECGDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/CGDynamicsKernel.hpp b/dynamics/src/include/CGDynamicsKernel.hpp index f705f57d0..a56a95474 100644 --- a/dynamics/src/include/CGDynamicsKernel.hpp +++ b/dynamics/src/include/CGDynamicsKernel.hpp @@ -1,10 +1,8 @@ /*! - * @file CGDynamicsKernel.hpp * - * @date 27 Mar 2025 * @author Tim Spain * @author Robert Jendersie - */ +*/ #ifndef CGDYNAMICSKERNEL_HPP #define CGDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/CGModelArray.hpp b/dynamics/src/include/CGModelArray.hpp index d01a9426c..38ae24826 100644 --- a/dynamics/src/include/CGModelArray.hpp +++ b/dynamics/src/include/CGModelArray.hpp @@ -1,9 +1,7 @@ /*! - * @file CGModelArray.hpp * - * @date Oct 13, 2022 * @author Tim Spain - */ +*/ #ifndef CGMODELARRAY_HPP #define CGMODELARRAY_HPP diff --git a/dynamics/src/include/CheckPoints.hpp b/dynamics/src/include/CheckPoints.hpp index f12e7eaa0..4b30f66f4 100644 --- a/dynamics/src/include/CheckPoints.hpp +++ b/dynamics/src/include/CheckPoints.hpp @@ -1,8 +1,6 @@ /*! - * @file CheckPoints.hpp - * @date 1 Jun 2022 * @author Piotr Minakowski - */ +*/ #ifndef __CHECKPOINTS_HPP #define __CHECKPOINTS_HPP diff --git a/dynamics/src/include/DGModelArray.hpp b/dynamics/src/include/DGModelArray.hpp index 55ceb815a..e213c1f46 100644 --- a/dynamics/src/include/DGModelArray.hpp +++ b/dynamics/src/include/DGModelArray.hpp @@ -1,9 +1,7 @@ /*! - * @file DGModelArray.hpp * - * @date Oct 6, 2022 * @author Tim Spain - */ +*/ #ifndef DGMODELARRAY_HPP #define DGMODELARRAY_HPP diff --git a/dynamics/src/include/DGTransport.hpp b/dynamics/src/include/DGTransport.hpp index 16564b365..5a966782c 100644 --- a/dynamics/src/include/DGTransport.hpp +++ b/dynamics/src/include/DGTransport.hpp @@ -1,8 +1,6 @@ /*! - * @file DGTransport.hpp - * @date Dec 5, 2022 * @author Thomas Richter - */ +*/ #ifndef __DGTRANSPORT_HPP #define __DGTRANSPORT_HPP diff --git a/dynamics/src/include/DummyDynamicsKernel.hpp b/dynamics/src/include/DummyDynamicsKernel.hpp index 24d6fbd5c..67518f95b 100644 --- a/dynamics/src/include/DummyDynamicsKernel.hpp +++ b/dynamics/src/include/DummyDynamicsKernel.hpp @@ -1,10 +1,8 @@ /*! - * @file DummyDynamicsKernel.hpp * - * @date 17 Feb 2023 * @author Tim Spain * @author Piotr Minakowski - */ +*/ #ifndef DUMMYDYNAMICSKERNEL_HPP #define DUMMYDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/DynamicsKernel.hpp b/dynamics/src/include/DynamicsKernel.hpp index 8c8e95ad1..ce480646c 100644 --- a/dynamics/src/include/DynamicsKernel.hpp +++ b/dynamics/src/include/DynamicsKernel.hpp @@ -1,9 +1,7 @@ /*! - * @file DynamicsKernel.hpp * - * @date Jan 5, 2024 * @author Tim Spain - */ +*/ #ifndef DYNAMICSKERNEL_HPP #define DYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/DynamicsParameters.hpp b/dynamics/src/include/DynamicsParameters.hpp index 75fa96888..dcb07fc49 100644 --- a/dynamics/src/include/DynamicsParameters.hpp +++ b/dynamics/src/include/DynamicsParameters.hpp @@ -1,11 +1,9 @@ /*! - * @file DynamicsParameters.hpp * - * @date 19 Nov 2024 * @author Tim Spain * @author Thomas Richter * - */ +*/ #ifndef DYNAMICSPARAMETERS_HPP #define DYNAMICSPARAMETERS_HPP diff --git a/dynamics/src/include/FreeDriftDynamicsKernel.hpp b/dynamics/src/include/FreeDriftDynamicsKernel.hpp index 207b963b0..dbfcc57ab 100644 --- a/dynamics/src/include/FreeDriftDynamicsKernel.hpp +++ b/dynamics/src/include/FreeDriftDynamicsKernel.hpp @@ -1,14 +1,12 @@ /*! - * @file FreeDriftDynamicsKernel.hpp * * Implementation of "classic free drift", where we ignore all \rho h terms in the momentum * equation. This is equivalent to assuming that the ice is very thin. * - * @date 27 Mar 2025 * @author Tim Spain * @author Einar Ólason * @author Robert Jendersie - */ +*/ #ifndef FREEDRIFTDYNAMICSKERNEL_HPP #define FREEDRIFTDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/IDynamicsUpdate.hpp b/dynamics/src/include/IDynamicsUpdate.hpp index d90758437..c32a44dd1 100644 --- a/dynamics/src/include/IDynamicsUpdate.hpp +++ b/dynamics/src/include/IDynamicsUpdate.hpp @@ -1,9 +1,7 @@ /*! - * @file IDynamicsUpdate.hpp * - * @date Jan 19, 2024 * @author Tim Spain - */ +*/ #ifndef IDYNAMICSUPDATE_HPP #define IDYNAMICSUPDATE_HPP diff --git a/dynamics/src/include/Interpolations.hpp b/dynamics/src/include/Interpolations.hpp index 67e8f4379..1ad444781 100644 --- a/dynamics/src/include/Interpolations.hpp +++ b/dynamics/src/include/Interpolations.hpp @@ -1,8 +1,6 @@ /*! - * @file Interpolations.hpp - * @date Aug 9 2022 * @author Thomas Richter - */ +*/ #ifndef __INTERPOLATIONS_HPP #define __INTERPOLATIONS_HPP diff --git a/dynamics/src/include/MEVPDynamicsKernel.hpp b/dynamics/src/include/MEVPDynamicsKernel.hpp index 58f70618c..941f83a98 100644 --- a/dynamics/src/include/MEVPDynamicsKernel.hpp +++ b/dynamics/src/include/MEVPDynamicsKernel.hpp @@ -1,10 +1,8 @@ /*! - * @file MEVPDynamicsKernel.hpp * - * @date 17 Feb 2023 * @author Tim Spain * @author Piotr Minakowski - */ +*/ #ifndef MEVPDYNAMICSKERNEL_HPP #define MEVPDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/MEVPStressUpdateStep.hpp b/dynamics/src/include/MEVPStressUpdateStep.hpp index 84594b253..5f088d7ad 100644 --- a/dynamics/src/include/MEVPStressUpdateStep.hpp +++ b/dynamics/src/include/MEVPStressUpdateStep.hpp @@ -1,9 +1,7 @@ /*! - * @file MEVPStressUpdateStep.hpp * - * @date 19 Nov 2024 * @author Tim Spain - */ +*/ #ifndef MEVPSTRESSUPDATESTEP_HPP #define MEVPSTRESSUPDATESTEP_HPP diff --git a/dynamics/src/include/NextsimDynamics.hpp b/dynamics/src/include/NextsimDynamics.hpp index 12ba3be5c..12b8db5d8 100644 --- a/dynamics/src/include/NextsimDynamics.hpp +++ b/dynamics/src/include/NextsimDynamics.hpp @@ -1,8 +1,6 @@ /*! - * @file NextsimDynamics.hpp - * @date Dec 13, 2022 * @author Thomas Richter - */ +*/ #ifndef __NEXTSIMDYNAMICS_HPP #define __NEXTSIMDYNAMICS_HPP diff --git a/dynamics/src/include/ParametricMap.hpp b/dynamics/src/include/ParametricMap.hpp index 3e4360938..f15a7b54f 100644 --- a/dynamics/src/include/ParametricMap.hpp +++ b/dynamics/src/include/ParametricMap.hpp @@ -1,8 +1,6 @@ /*! - * @file ParametricMap.hpp - * @date 19 Feb 2025 * @author Thomas Richter - */ +*/ #ifndef __PARAMETRICMAP_HPP #define __PARAMETRICMAP_HPP diff --git a/dynamics/src/include/ParametricMesh.hpp b/dynamics/src/include/ParametricMesh.hpp index 25e566cf1..73575ad55 100644 --- a/dynamics/src/include/ParametricMesh.hpp +++ b/dynamics/src/include/ParametricMesh.hpp @@ -1,8 +1,6 @@ /*! - * @file ParametricMesh.hpp - * @date 09 Jan 2025 * @author Thomas Richter - */ +*/ #ifndef __PARAMETRICMESH_HPP #define __PARAMETRICMESH_HPP diff --git a/dynamics/src/include/ParametricTools.hpp b/dynamics/src/include/ParametricTools.hpp index 774ad46bb..761e58df4 100644 --- a/dynamics/src/include/ParametricTools.hpp +++ b/dynamics/src/include/ParametricTools.hpp @@ -1,8 +1,6 @@ /*! - * @file ParametricTools.hpp - * @date 24 Sep 2024 * @author Thomas Richter - */ +*/ #ifndef __PARAMETRICTOOLS_HPP #define __PARAMETRICTOOLS_HPP diff --git a/dynamics/src/include/StressUpdateStep.hpp b/dynamics/src/include/StressUpdateStep.hpp index 2a2e7af52..9553ed4c4 100644 --- a/dynamics/src/include/StressUpdateStep.hpp +++ b/dynamics/src/include/StressUpdateStep.hpp @@ -1,9 +1,7 @@ /*! - * @file StressUpdateStep.hpp * - * @date Feb 1, 2024 * @author Tim Spain - */ +*/ #ifndef STRESSUPDATESTEP_HPP #define STRESSUPDATESTEP_HPP diff --git a/dynamics/src/include/Tools.hpp b/dynamics/src/include/Tools.hpp index 609222971..b2a737b29 100644 --- a/dynamics/src/include/Tools.hpp +++ b/dynamics/src/include/Tools.hpp @@ -1,8 +1,6 @@ /*! - * @file Tools.hpp - * @date 24 Sep 2024 * @author Piotr Minakowski - */ +*/ #ifndef __TOOLS_HPP #define __TOOLS_HPP diff --git a/dynamics/src/include/VPCGDynamicsKernel.hpp b/dynamics/src/include/VPCGDynamicsKernel.hpp index 4393a9dee..ca67def6b 100644 --- a/dynamics/src/include/VPCGDynamicsKernel.hpp +++ b/dynamics/src/include/VPCGDynamicsKernel.hpp @@ -1,10 +1,8 @@ /*! - * @file VPCGDynamicsKernel.hpp * - * @date 27 Mar 2025 * @author Tim Spain * @author Robert Jendersie - */ +*/ #ifndef VPCGDYNAMICSKERNEL_HPP #define VPCGDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/VPParameters.hpp b/dynamics/src/include/VPParameters.hpp index 2d05a4389..36d9c04e4 100644 --- a/dynamics/src/include/VPParameters.hpp +++ b/dynamics/src/include/VPParameters.hpp @@ -1,9 +1,7 @@ /*! - * @file VPParameters.hpp - * @date 19 Nov 2024 * @author Tim Spain * @author Thomas Richter - */ +*/ #ifndef __VPPARAMETERS_HPP #define __VPPARAMETERS_HPP diff --git a/dynamics/src/include/VectorManipulations.hpp b/dynamics/src/include/VectorManipulations.hpp index 87013428e..3bfee9e1b 100644 --- a/dynamics/src/include/VectorManipulations.hpp +++ b/dynamics/src/include/VectorManipulations.hpp @@ -1,8 +1,6 @@ /*! - * @file VectorManupulations.hpp - * @date 24 Sep 2024 * @author Thomas Richter - */ +*/ #ifndef __VECTORMANIPULATIONS_HPP #define __VECTORMANIPULATIONS_HPP diff --git a/dynamics/src/include/cgVector.hpp b/dynamics/src/include/cgVector.hpp index 6c4f9aee7..e0f83c377 100644 --- a/dynamics/src/include/cgVector.hpp +++ b/dynamics/src/include/cgVector.hpp @@ -1,8 +1,6 @@ /*! - * @file cgVector.hpp - * @date 1 Mar 2022 * @author Thomas Richter - */ +*/ #ifndef __CGVECTOR_HPP #define __CGVECTOR_HPP diff --git a/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp b/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp index acd5ff25b..ffadd0312 100644 --- a/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp +++ b/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp @@ -1,8 +1,6 @@ /*! - * @file dgBasisFunctionsGausspoints.hpp - * @date 1 Mar 2022 * @author Thomas Richter - */ +*/ #ifndef __BASISFUNCTIONSGUASSPOINTS_HPP #define __BASISFUNCTIONSGUASSPOINTS_HPP diff --git a/dynamics/src/include/dgInitial.hpp b/dynamics/src/include/dgInitial.hpp index f757980d3..b7474e235 100644 --- a/dynamics/src/include/dgInitial.hpp +++ b/dynamics/src/include/dgInitial.hpp @@ -1,8 +1,6 @@ /*! - * @file dgInitial.hpp - * @date July 10 2022 * @author Thomas Richter - */ +*/ #ifndef __DGINITIAL_HPP #define __DGINITIAL_HPP diff --git a/dynamics/src/include/dgLimit.hpp b/dynamics/src/include/dgLimit.hpp index 330606e73..dde93533b 100644 --- a/dynamics/src/include/dgLimit.hpp +++ b/dynamics/src/include/dgLimit.hpp @@ -1,8 +1,6 @@ /*! - * @file dgLimit.hpp - * @date 30 April 2022 * @author Thomas Richter - */ +*/ #ifndef __DGLIMIT_HPP #define __DGLIMIT_HPP diff --git a/dynamics/src/include/dgLimiters.hpp b/dynamics/src/include/dgLimiters.hpp index 47c5664cd..2a162197c 100644 --- a/dynamics/src/include/dgLimiters.hpp +++ b/dynamics/src/include/dgLimiters.hpp @@ -1,8 +1,6 @@ /*! - * @file dgLimiters.hpp - * @date 1 Mar 2022 * @author Piotr Minakowski - */ +*/ #ifndef __LIMITERS_HPP #define __LIMITERS_HPP diff --git a/dynamics/src/include/dgVector.hpp b/dynamics/src/include/dgVector.hpp index 285a17afb..0927003e5 100644 --- a/dynamics/src/include/dgVector.hpp +++ b/dynamics/src/include/dgVector.hpp @@ -1,8 +1,6 @@ /*! - * @file dgVector.hpp - * @date 19 Aug 2025 * @author Thomas Richter - */ +*/ #ifndef __DGVECTOR_HPP #define __DGVECTOR_HPP diff --git a/dynamics/src/include/dgVectorHolder.hpp b/dynamics/src/include/dgVectorHolder.hpp index 5aeae737e..e696b7f1d 100644 --- a/dynamics/src/include/dgVectorHolder.hpp +++ b/dynamics/src/include/dgVectorHolder.hpp @@ -1,9 +1,7 @@ /*! - * @file dgVectorHolder.hpp * - * @date Feb 4, 2025 * @author Tim Spain - */ +*/ #ifndef DGVECTORHOLDER_HPP #define DGVECTORHOLDER_HPP diff --git a/dynamics/src/include/dgVisu.hpp b/dynamics/src/include/dgVisu.hpp index 14f78ecc5..e630e25df 100644 --- a/dynamics/src/include/dgVisu.hpp +++ b/dynamics/src/include/dgVisu.hpp @@ -1,8 +1,6 @@ /*! - * @file dgVisu.hpp - * @date 24 Sep 2024 * @author Thomas Richter - */ +*/ #ifndef __DGVISU_HPP #define __DGVISU_HPP diff --git a/dynamics/test/AdvectionPeriodicBC_test.cpp b/dynamics/test/AdvectionPeriodicBC_test.cpp index d271c3502..c36b1e480 100644 --- a/dynamics/test/AdvectionPeriodicBC_test.cpp +++ b/dynamics/test/AdvectionPeriodicBC_test.cpp @@ -1,8 +1,6 @@ /*! - * @file AdvectionPeriodicBC_test.cpp - * @date 19 August 2024 * @author Thomas Richter - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/Advection_test.cpp b/dynamics/test/Advection_test.cpp index cea1ee0c3..4d17ddbbf 100644 --- a/dynamics/test/Advection_test.cpp +++ b/dynamics/test/Advection_test.cpp @@ -1,8 +1,6 @@ /*! - * @file Advection_test.cpp - * @date 19 August 2024 * @author Thomas Richter - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/CGModelArray_test.cpp b/dynamics/test/CGModelArray_test.cpp index f0938328f..a02ce70c5 100644 --- a/dynamics/test/CGModelArray_test.cpp +++ b/dynamics/test/CGModelArray_test.cpp @@ -1,12 +1,10 @@ /*! - * @file DGModelArray_test.cpp * * @brief Test that the functions to convert from the dynamics code CGVector * to and from ModelArray function correctly. * - * @date Oct 6, 2022 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/DGModelArray_test.cpp b/dynamics/test/DGModelArray_test.cpp index 590bb53f8..830f56107 100644 --- a/dynamics/test/DGModelArray_test.cpp +++ b/dynamics/test/DGModelArray_test.cpp @@ -1,12 +1,10 @@ /*! - * @file DGModelArray_test.cpp * * @brief Test that the functions to convert from the dynamics code DGVector * to and from ModelArray function correctly. * - * @date Oct 6, 2022 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/FakeSmeshData.cpp b/dynamics/test/FakeSmeshData.cpp index 27dfd5aa0..83a07b51c 100644 --- a/dynamics/test/FakeSmeshData.cpp +++ b/dynamics/test/FakeSmeshData.cpp @@ -1,9 +1,7 @@ /*! - * @file FakeSmeshData.cpp * - * @date Dec 14, 2023 * @author Tim Spain - */ +*/ #include "../test/FakeSmeshData.hpp" diff --git a/dynamics/test/FakeSmeshData.hpp b/dynamics/test/FakeSmeshData.hpp index a90f51181..04d1ec7d3 100644 --- a/dynamics/test/FakeSmeshData.hpp +++ b/dynamics/test/FakeSmeshData.hpp @@ -1,9 +1,7 @@ /*! - * @file FakeSmeshData.hpp * - * @date Dec 14, 2023 * @author Tim Spain - */ +*/ #ifndef FAKESMESHDATA_HPP #define FAKESMESHDATA_HPP diff --git a/dynamics/test/ParametricMeshArea_test.cpp b/dynamics/test/ParametricMeshArea_test.cpp index 677ceead7..a60365088 100644 --- a/dynamics/test/ParametricMeshArea_test.cpp +++ b/dynamics/test/ParametricMeshArea_test.cpp @@ -1,11 +1,9 @@ /*! - * @file ParametricMesh_test.cpp * * @brief Test the ParametricMesh class, especially processing from ModelArray files. * - * @date 09 Jan 2025 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/ParametricMesh_test.cpp b/dynamics/test/ParametricMesh_test.cpp index 28d1d243d..3a3f43a2c 100644 --- a/dynamics/test/ParametricMesh_test.cpp +++ b/dynamics/test/ParametricMesh_test.cpp @@ -1,11 +1,9 @@ /*! - * @file ParametricMesh_test.cpp * * @brief Test the ParametricMesh class, especially processing from ModelArray files. * - * @date Dec 15, 2023 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/dgVectorHolder_test.cpp b/dynamics/test/dgVectorHolder_test.cpp index b9f1c3cbf..0aec461f5 100644 --- a/dynamics/test/dgVectorHolder_test.cpp +++ b/dynamics/test/dgVectorHolder_test.cpp @@ -1,9 +1,7 @@ /*! - * @file DGVectorHolder_test.cpp * - * @date Feb 4, 2025 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/src/BenchmarkCoordinates.cpp b/physics/src/BenchmarkCoordinates.cpp index 682ad88db..9f1a63ede 100644 --- a/physics/src/BenchmarkCoordinates.cpp +++ b/physics/src/BenchmarkCoordinates.cpp @@ -1,9 +1,7 @@ /*! - * @file BenchmarkCoordinates.cpp * - * @date 26 Sept 2023 * @author Tim Spain - */ +*/ #include "include/BenchmarkCoordinates.hpp" diff --git a/physics/src/IceGrowth.cpp b/physics/src/IceGrowth.cpp index 8f0d2feac..16b5d2ded 100644 --- a/physics/src/IceGrowth.cpp +++ b/physics/src/IceGrowth.cpp @@ -1,10 +1,8 @@ /*! - * @file IceGrowth.cpp * - * @date 20 Nov 2024 * @author Tim Spain * @author Einar Ólason - */ +*/ #include "include/IceGrowth.hpp" diff --git a/physics/src/IceMinima.cpp b/physics/src/IceMinima.cpp index 63d773cc8..8f8c38baf 100644 --- a/physics/src/IceMinima.cpp +++ b/physics/src/IceMinima.cpp @@ -1,9 +1,7 @@ /*! - * @file IceMinima.cpp * - * @date 8 Feb 2023 * @author Tim Spain - */ +*/ #include "include/IceMinima.hpp" diff --git a/physics/src/SlabOcean.cpp b/physics/src/SlabOcean.cpp index e3cac52ad..5e70d56e0 100644 --- a/physics/src/SlabOcean.cpp +++ b/physics/src/SlabOcean.cpp @@ -1,9 +1,7 @@ /*! - * @file SlabOcean.cpp * - * @date 29 Apr 2025 * @author Tim Spain - */ +*/ #include "include/SlabOcean.hpp" diff --git a/physics/src/include/BenchmarkCoordinates.hpp b/physics/src/include/BenchmarkCoordinates.hpp index b8414d7e0..eaef7ff8d 100644 --- a/physics/src/include/BenchmarkCoordinates.hpp +++ b/physics/src/include/BenchmarkCoordinates.hpp @@ -1,9 +1,7 @@ /*! - * @file BenchmarkCoordinates.hpp * - * @date 26 Sept 2023 * @author Tim Spain - */ +*/ #ifndef BENCHMARKCOORDINATES_HPP #define BENCHMARKCOORDINATES_HPP diff --git a/physics/src/include/IceGrowth.hpp b/physics/src/include/IceGrowth.hpp index e01593b55..5d993996d 100644 --- a/physics/src/include/IceGrowth.hpp +++ b/physics/src/include/IceGrowth.hpp @@ -1,10 +1,8 @@ /*! - * @file IceGrowth.hpp * - * @date Jul 5, 2022 * @author Tim Spain * @author Einar Ólason - */ +*/ #ifndef ICEGROWTH_HPP #define ICEGROWTH_HPP diff --git a/physics/src/include/IceMinima.hpp b/physics/src/include/IceMinima.hpp index c6afe5ed7..2537a10cf 100644 --- a/physics/src/include/IceMinima.hpp +++ b/physics/src/include/IceMinima.hpp @@ -1,9 +1,7 @@ /*! - * @file IceMinima.hpp * - * @date 8 Feb 2023 * @author Tim Spain - */ +*/ #ifndef ICEMINIMA_HPP #define ICEMINIMA_HPP diff --git a/physics/src/include/SlabOcean.hpp b/physics/src/include/SlabOcean.hpp index d17debbf8..67b2ea493 100644 --- a/physics/src/include/SlabOcean.hpp +++ b/physics/src/include/SlabOcean.hpp @@ -1,9 +1,7 @@ /*! - * @file SlabOcean.hpp * - * @date 29 Apr 2025 * @author Tim Spain - */ +*/ #ifndef SLABOCEAN_HPP #define SLABOCEAN_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp index 44cc7acf8..62c76f43a 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp @@ -1,9 +1,7 @@ /*! - * @file BenchmarkAtmosphere.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #include "include/BenchmarkAtmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp index fd1821bc4..8e574acd5 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp @@ -1,9 +1,7 @@ /*! - * @file ConfiguredAtmosphere.cpp * - * @date 20 Nov 2024 * @author Tim Spain - */ +*/ #include "include/ConfiguredAtmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp b/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp index 2db1b8114..ceba8b34b 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp @@ -1,9 +1,7 @@ /*! - * @file ConstantAtmosphereBoundary.cpp * - * @date Sep 22, 2022 * @author Tim Spain - */ +*/ #include "include/ConstantAtmosphereBoundary.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp index 0d17c0789..72965b3be 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp @@ -1,9 +1,7 @@ /*! - * @file ERA5Atmosphere.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #include "include/ERA5Atmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp index accda7fd3..a0318fd82 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp @@ -1,9 +1,7 @@ /*! - * @file FluxConfiguredAtmosphere.cpp * - * @date 20 Nov 2024 * @author Tim Spain - */ +*/ #include "include/FluxConfiguredAtmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp index d99ef6e62..247f9119c 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp @@ -1,9 +1,7 @@ /*! - * @file BenchmarkAtmosphere.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef BENCHMARKATMOSPHERE_HPP #define BENCHMARKATMOSPHERE_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp index d0776f091..c06a2a42d 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp @@ -1,9 +1,7 @@ /*! - * @file ConfiguredAtmosphere.hpp * - * @date Aug 31, 2022 * @author Tim Spain - */ +*/ #ifndef CONFIGUREDATMOSPHERE_HPP #define CONFIGUREDATMOSPHERE_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp index 7dfb7f9f8..672ac6594 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp @@ -1,9 +1,7 @@ /*! - * @file ConstantAtmosphereBoundary.hpp * - * @date Sep 22, 2022 * @author Tim Spain - */ +*/ #ifndef CONSTANTATMOSPHEREBOUNDARY_HPP #define CONSTANTATMOSPHEREBOUNDARY_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp index 81a78a573..6b96d91ae 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp @@ -1,9 +1,7 @@ /*! - * @file ERA5Atmosphere.hpp * - * @date Nov 25, 2022 * @author Tim Spain - */ +*/ #ifndef ERA5ATMOSPHERE_HPP #define ERA5ATMOSPHERE_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp index f55718455..8e7e9bf54 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp @@ -1,9 +1,7 @@ /*! - * @file FluxConfiguredAtmosphere.hpp * - * @date Sep 29, 2022 * @author Tim Spain - */ +*/ #ifndef FLUXCONFIGUREDATMOSPHERE_HPP #define FLUXCONFIGUREDATMOSPHERE_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/MU71Atmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/MU71Atmosphere.hpp index ff3467b55..ffa2a11dd 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/MU71Atmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/MU71Atmosphere.hpp @@ -16,7 +16,7 @@ namespace Nextsim { /*! * @brief The implementation class for the a seasonal atmospheric fluxes following Maykut and * Untersteiener's (1971) table 1. Only useful for comparison with that paper and derived setups. - */ +*/ class MU71Atmosphere : public IAtmosphereBoundary, public Configured { public: diff --git a/physics/src/modules/DamageHealingModule/ConstantHealing.cpp b/physics/src/modules/DamageHealingModule/ConstantHealing.cpp index 7e9d242fd..3ce50ce83 100644 --- a/physics/src/modules/DamageHealingModule/ConstantHealing.cpp +++ b/physics/src/modules/DamageHealingModule/ConstantHealing.cpp @@ -1,9 +1,7 @@ /*! - * @file ConstantHealing.hpp * - * @date 21 Nov 2024 * @author Einar Ólason - */ +*/ #include "include/ConstantHealing.hpp" diff --git a/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp b/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp index 2e71d9759..95615ce2a 100644 --- a/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp +++ b/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp @@ -1,9 +1,7 @@ /*! - * @file ConstantHealing.hpp * - * @date Jun 3, 2024 * @author Einar Ólason - */ +*/ #ifndef CONSTANTHEALING_HPP #define CONSTANTHEALING_HPP diff --git a/physics/src/modules/DamageHealingModule/include/NoHealing.hpp b/physics/src/modules/DamageHealingModule/include/NoHealing.hpp index 620f1e178..37cda16dc 100644 --- a/physics/src/modules/DamageHealingModule/include/NoHealing.hpp +++ b/physics/src/modules/DamageHealingModule/include/NoHealing.hpp @@ -1,11 +1,9 @@ /*! - * @file HoHealing.hpp * * This class has no corresponding implementation, just this header file * - * @date 21 Nov 2024 * @author Einar Ólason - */ +*/ #ifndef NOHEALING_HPP #define NOHEALING_HPP diff --git a/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp b/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp index 171bbe12c..470b80bf9 100644 --- a/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp +++ b/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp @@ -1,9 +1,7 @@ /*! - * @file FiniteElementFluxes.cpp * - * @date 11 Feb 2025 * @author Tim Spain - */ +*/ #include "include/FiniteElementFluxes.hpp" diff --git a/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp b/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp index eed4bd07d..5b23eea8d 100644 --- a/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp +++ b/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp @@ -1,9 +1,7 @@ /*! - * @file FiniteElementFluxes.hpp * - * @date 25 Feb 2025 * @author Tim Spain - */ +*/ #ifndef FINITEELEMENTFLUXES_HPP #define FINITEELEMENTFLUXES_HPP diff --git a/physics/src/modules/FluxCalculationModule/include/ISpecificHumidity.hpp b/physics/src/modules/FluxCalculationModule/include/ISpecificHumidity.hpp index 284128e6e..a069cb9e3 100644 --- a/physics/src/modules/FluxCalculationModule/include/ISpecificHumidity.hpp +++ b/physics/src/modules/FluxCalculationModule/include/ISpecificHumidity.hpp @@ -21,7 +21,7 @@ class ISpecificHumidity { * * @param temperature Temperature of the water vapour [˚C] * @param pressure Hydrostatic pressure [Pa] - */ +*/ virtual double operator()(double temperature, double pressure) const = 0; /*! * @brief Calculates humidity over sea water. diff --git a/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp b/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp index 396f0ddb0..ae4734bc7 100644 --- a/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp @@ -1,9 +1,7 @@ /*! - * @file CCSMIceAlbedo.cpp * - * @date 20 Nov 2024 * @author Tim Spain - */ +*/ #include "include/CCSMIceAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp b/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp index c27a2df57..ea904974d 100644 --- a/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp +++ b/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp @@ -1,9 +1,7 @@ /*! - * @file MU71Albedo.cpp * - * @date Wed 24 Aug 2022 08:05:49 CEST * @author Einar Örn Ólason - */ +*/ #include "include/MU71Albedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp b/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp index d13c54eb5..c18242e26 100644 --- a/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp @@ -1,9 +1,7 @@ /*! - * @file SMU2IceAlbedo.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #include "include/SMU2IceAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp b/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp index 5ba446ec3..647406a01 100644 --- a/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp @@ -1,9 +1,7 @@ /*! - * @file SMUIceAlbedo.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #include "include/SMUIceAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp b/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp index 3a09c1c35..b92bdf9f8 100644 --- a/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp @@ -1,10 +1,8 @@ /*! - * @file WintonAlbedo.cpp * - * @date 20 Nov 2024 * @author Tim Spain * @author Einar Ólason - */ +*/ #include "include/WintonAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp index 5492e9ce7..2b2d6ea2e 100644 --- a/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp @@ -1,9 +1,7 @@ /*! - * @file CCSMIceAlbedo.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef CCSMICEALBEDO_HPP #define CCSMICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp b/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp index 5a66d5657..1b520dde6 100644 --- a/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp @@ -1,9 +1,7 @@ /*! - * @file MU71Albedo.hpp * - * @date Wed 24 Aug 2022 08:00:31 CEST * @author Einar Örn Ólason - */ +*/ #ifndef SEASONALICEALBEDO_HPP #define SEASONALICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp index 4907e9a4b..9f5bad996 100644 --- a/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp @@ -1,9 +1,7 @@ /*! - * @file SMU2IceAlbedo.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef SRC_INCLUDE_SMU2ICEALBEDO_HPP #define SRC_INCLUDE_SMU2ICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp index 970d4c2c9..dd59eaa72 100644 --- a/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp @@ -1,9 +1,7 @@ /*! - * @file SMUIceAlbedo.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef SRC_INCLUDE_SMUICEALBEDO_HPP #define SRC_INCLUDE_SMUICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp index 83ad68e77..fa296da87 100644 --- a/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp @@ -1,10 +1,8 @@ /*! - * @file WintonAlbedo.hpp * - * @date Sep 11, 2024 * @author Tim Spain * @author Einar Ólason - */ +*/ #ifndef WINTONALBEDO_HPP #define WINTONALBEDO_HPP diff --git a/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp b/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp index a0d743222..e72f0e7da 100644 --- a/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp +++ b/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp @@ -1,9 +1,7 @@ /*! - * @file BasicIceOceanHeatFlux.cpp * - * @date 07 Feb 2025 * @author Tim Spain - */ +*/ #include "include/BasicIceOceanHeatFlux.hpp" diff --git a/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp b/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp index 2f799eeb0..03dbbbf33 100644 --- a/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp +++ b/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp @@ -1,9 +1,7 @@ /*! - * @file BasicIceOceanHeatFlux.hpp * - * @date Oct 19, 2021 * @author Tim Spain - */ +*/ #ifndef BASICICEOCEANHEATFLUX_HPP #define BASICICEOCEANHEATFLUX_HPP diff --git a/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp b/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp index 9330698a0..488304b4a 100644 --- a/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp +++ b/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp @@ -1,9 +1,7 @@ /*! - * @file ThermoIce0.cpp * - * @date 07 Feb 2025 * @author Tim Spain - */ +*/ #include "include/ThermoIce0.hpp" diff --git a/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp b/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp index 76a4db26d..fe900d841 100644 --- a/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp +++ b/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp @@ -1,9 +1,7 @@ /*! - * @file ThermoWinton.cpp * - * @date 20 Nov 2024 * @author Tim Spain - */ +*/ #include "include/Slice.hpp" #include "include/ThermoWinton.hpp" diff --git a/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp b/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp index 482aacfee..ad339028c 100644 --- a/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp +++ b/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp @@ -1,9 +1,7 @@ /*! - * @file DummyIceThermodynamics.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef DUMMYICETHERMODYNAMICS_HPP #define DUMMYICETHERMODYNAMICS_HPP diff --git a/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp b/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp index 9516baea5..a99d18c52 100644 --- a/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp +++ b/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp @@ -1,9 +1,7 @@ /*! - * @file ThermoIce0.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef THERMOICE0HPP #define THERMOICE0HPP diff --git a/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp b/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp index d0dc75082..13529d676 100644 --- a/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp +++ b/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp @@ -1,9 +1,7 @@ /*! - * @file ThermoWinton.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef THERMOWINTON_HPP #define THERMOWINTON_HPP diff --git a/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp b/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp index b30821b37..f7c16a345 100644 --- a/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp +++ b/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp @@ -1,9 +1,7 @@ /*! - * @file HiblerSpread.cpp * - * @date 20 Nov 2024 * @author Tim Spain - */ +*/ #include "include/HiblerSpread.hpp" diff --git a/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp b/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp index ef92c43e4..25d1639b7 100644 --- a/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp +++ b/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp @@ -1,9 +1,7 @@ /*! - * @file DummyIceSpread.hpp * - * @date 18 Apr 2023 * @author Tim Spain - */ +*/ #ifndef DUMMYICESPREAD_HPP #define DUMMYICESPREAD_HPP diff --git a/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp b/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp index 1014945fb..4b7018459 100644 --- a/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp +++ b/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp @@ -1,9 +1,7 @@ /*! - * @file HiblerSpread.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef HIBLERSPREAD_HPP #define HIBLERSPREAD_HPP diff --git a/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp b/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp index 5567b5ca3..8883b9455 100644 --- a/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp @@ -1,9 +1,7 @@ /*! - * @file BenchmarkOcean.cpp * - * @date 23 Aug 2024 * @author Tim Spain - */ +*/ #include "include/BenchmarkOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp b/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp index a5c7d86f8..1d58226a4 100644 --- a/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp @@ -1,9 +1,7 @@ /*! - * @file ConfiguredOcean.cpp * - * @date 10 Feb 2025 * @author Tim Spain - */ +*/ #include "include/ConfiguredOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp b/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp index 33b86ccec..09395171c 100644 --- a/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp +++ b/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp @@ -1,9 +1,7 @@ /*! - * @file ConstantOceanBoundary.cpp * - * @date Aug 23, 2024 * @author Tim Spain - */ +*/ #include "include/ConstantOceanBoundary.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp b/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp index 84716eeb3..b645bc94b 100644 --- a/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp @@ -1,9 +1,7 @@ /*! - * @file FluxConfiguredOcean.cpp * - * @date 06 Dec 2024 * @author Tim Spain - */ +*/ #include "include/FluxConfiguredOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp b/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp index 259df1761..47a459514 100644 --- a/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp @@ -1,9 +1,7 @@ /*! - * @file TOPAZOcean.cpp * - * @date 10 Feb 2025 * @author Tim Spain - */ +*/ #include "include/TOPAZOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp b/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp index fbf789fb9..0a8d88e96 100644 --- a/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp @@ -1,9 +1,7 @@ /*! - * @file UniformOcean.cpp * - * @date 06 Dec 2024 * @author Tim Spain - */ +*/ #include "include/UniformOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp index 24517e477..f46e6b517 100644 --- a/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp @@ -1,9 +1,7 @@ /*! - * @file BenchmarkOcean.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef BENCHMARKOCEAN_HPP #define BENCHMARKOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp index f2b54d21e..81f28776a 100644 --- a/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp @@ -1,9 +1,7 @@ /*! - * @file ConfiguredOcean.hpp * - * @date Aug 31, 2022 * @author Tim Spain - */ +*/ #ifndef CONFIGUREDOCEAN_HPP #define CONFIGUREDOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp b/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp index 46a0637a2..3b2059468 100644 --- a/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp @@ -1,9 +1,7 @@ /*! - * @file ConstantOceanBoundary.hpp * - * @date Sep 26, 2022 * @author Tim Spain - */ +*/ #ifndef CONSTANTOCEANBOUNDARY_HPP #define CONSTANTOCEANBOUNDARY_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp index 0faeec677..1bd372589 100644 --- a/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp @@ -1,9 +1,7 @@ /*! - * @file FluxConfiguredOcean.hpp * - * @date Sep 29, 2022 * @author Tim Spain - */ +*/ #ifndef FLUXCONFIGUREDOCEAN_HPP #define FLUXCONFIGUREDOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp index 2831e912b..3f3a00002 100644 --- a/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp @@ -1,9 +1,7 @@ /*! - * @file TOPAZOcean.hpp * - * @date Nov 25, 2022 * @author Tim Spain - */ +*/ #ifndef TOPAZOCEAN_HPP #define TOPAZOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp index 79bf2abd8..50f136afe 100644 --- a/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp @@ -1,9 +1,7 @@ /*! - * @file UniformOcean.hpp * - * @date 30 Mar 2023 * @author Tim Spain - */ +*/ #ifndef UNIFORMOCEAN_HPP #define UNIFORMOCEAN_HPP diff --git a/physics/src/modules/include/IAtmosphereBoundary.hpp b/physics/src/modules/include/IAtmosphereBoundary.hpp index 061075e0b..4c0547de9 100644 --- a/physics/src/modules/include/IAtmosphereBoundary.hpp +++ b/physics/src/modules/include/IAtmosphereBoundary.hpp @@ -1,9 +1,7 @@ /*! - * @file IAtmosphereBoundary.hpp * - * @date 11 Feb 2025 * @author Tim Spain - */ +*/ #include "include/ModelArrayRef.hpp" #include "include/ModelComponent.hpp" diff --git a/physics/src/modules/include/IDamageHealing.hpp b/physics/src/modules/include/IDamageHealing.hpp index abb77d9b5..97e1fb437 100644 --- a/physics/src/modules/include/IDamageHealing.hpp +++ b/physics/src/modules/include/IDamageHealing.hpp @@ -1,9 +1,7 @@ /*! - * @file IDamageHealing.hpp * - * @date 21 Nov 2024 * @author Einar Ólason - */ +*/ #ifndef IDAMAGEHEALING_HPP #define IDAMAGEHEALING_HPP diff --git a/physics/src/modules/include/IFluxCalculation.hpp b/physics/src/modules/include/IFluxCalculation.hpp index 246ad4033..240b1a28c 100644 --- a/physics/src/modules/include/IFluxCalculation.hpp +++ b/physics/src/modules/include/IFluxCalculation.hpp @@ -1,9 +1,7 @@ /*! - * @file IFluxCalculation.hpp * - * @date 11 Feb 2025 * @author Tim Spain - */ +*/ #ifndef IFLUXCALCULATION_HPP #define IFLUXCALCULATION_HPP diff --git a/physics/src/modules/include/IIceAlbedo.hpp b/physics/src/modules/include/IIceAlbedo.hpp index 022ade11d..80e420c0c 100644 --- a/physics/src/modules/include/IIceAlbedo.hpp +++ b/physics/src/modules/include/IIceAlbedo.hpp @@ -25,7 +25,7 @@ class IIceAlbedo { * @param snowThickness The true snow thickness on top of the ice. * @param i0 The fraction of short-wave radiation that can penetrate bare ice (not taking snow * cover into account). - */ +*/ virtual std::tuple surfaceShortWaveBalance( double temperature, double snowThickness, double i0) = 0; diff --git a/physics/src/modules/include/IIceOceanHeatFlux.hpp b/physics/src/modules/include/IIceOceanHeatFlux.hpp index 6cb177c08..eadb9d2a6 100644 --- a/physics/src/modules/include/IIceOceanHeatFlux.hpp +++ b/physics/src/modules/include/IIceOceanHeatFlux.hpp @@ -35,7 +35,7 @@ class IIceOceanHeatFlux : public ModelComponent { * Updates the ice ocean heat flux calculation for the timestep. * * @param tStep The object containing the timestep start and duration times. - */ +*/ virtual void update(const TimestepTime&) = 0; protected: diff --git a/physics/src/modules/include/IIceThermodynamics.hpp b/physics/src/modules/include/IIceThermodynamics.hpp index c35909fac..c5a06ca48 100644 --- a/physics/src/modules/include/IIceThermodynamics.hpp +++ b/physics/src/modules/include/IIceThermodynamics.hpp @@ -1,9 +1,7 @@ /*! - * @file IIceThermodynamics.hpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #ifndef IICETHERMODYNAMICS_HPP #define IICETHERMODYNAMICS_HPP diff --git a/physics/src/modules/include/ILateralIceSpread.hpp b/physics/src/modules/include/ILateralIceSpread.hpp index 34ce376c0..315132b9b 100644 --- a/physics/src/modules/include/ILateralIceSpread.hpp +++ b/physics/src/modules/include/ILateralIceSpread.hpp @@ -1,10 +1,8 @@ /*! - * @file ILateralIceSpread.hpp * - * @date Jul 5, 2022 * @author Tim Spain * @author Einar Ólason - */ +*/ #ifndef ILATERALICESPREAD_HPP #define ILATERALICESPREAD_HPP diff --git a/physics/src/modules/include/IOceanBoundary.hpp b/physics/src/modules/include/IOceanBoundary.hpp index 728d2b065..7611f2a70 100644 --- a/physics/src/modules/include/IOceanBoundary.hpp +++ b/physics/src/modules/include/IOceanBoundary.hpp @@ -1,9 +1,7 @@ /*! - * @file IOceanBoundary.hpp * - * @date 29 Apr 2025 * @author Tim Spain - */ +*/ #ifndef IOCEANBOUNDARY_HPP #define IOCEANBOUNDARY_HPP diff --git a/physics/test/BasicIceOceanFlux_test.cpp b/physics/test/BasicIceOceanFlux_test.cpp index b0e6be26e..b6ec9163d 100644 --- a/physics/test/BasicIceOceanFlux_test.cpp +++ b/physics/test/BasicIceOceanFlux_test.cpp @@ -1,9 +1,7 @@ /*! - * @file BasicIceOceanFlux_test.cpp * - * @date Sep 29, 2022 * @author Tim Spain - */ +*/ // Does this class need testing? Not really, but it got removed from // FiniteElementFluxes_test and I thought the tests should continue to exist diff --git a/physics/test/BenchmarkBoundaries_test.cpp b/physics/test/BenchmarkBoundaries_test.cpp index c57a5a978..29fbe44f1 100644 --- a/physics/test/BenchmarkBoundaries_test.cpp +++ b/physics/test/BenchmarkBoundaries_test.cpp @@ -1,9 +1,7 @@ /*! - * @file BenchmarkBoundaries_test.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/ConstantOceanBoundary_test.cpp b/physics/test/ConstantOceanBoundary_test.cpp index b2f05024e..311633c08 100644 --- a/physics/test/ConstantOceanBoundary_test.cpp +++ b/physics/test/ConstantOceanBoundary_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ConstantOceanBoundary_test.cpp * - * @date 7 Sep 2023 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/DamageHealing_test.cpp b/physics/test/DamageHealing_test.cpp index 268af7f07..fb7af4e8d 100644 --- a/physics/test/DamageHealing_test.cpp +++ b/physics/test/DamageHealing_test.cpp @@ -1,9 +1,7 @@ /*! - * @file DamageHealing_test.cpp * - * @date 22 Nov 2024 * @author Einar Ólason - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/ERA5Atm_test.cpp b/physics/test/ERA5Atm_test.cpp index 530e9f6c4..55ccbf8ae 100644 --- a/physics/test/ERA5Atm_test.cpp +++ b/physics/test/ERA5Atm_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ERA5Atm_test.cpp * - * @date 21 Aug 2025 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/FiniteElementFluxes_test.cpp b/physics/test/FiniteElementFluxes_test.cpp index e82f0de71..64de18b38 100644 --- a/physics/test/FiniteElementFluxes_test.cpp +++ b/physics/test/FiniteElementFluxes_test.cpp @@ -1,9 +1,7 @@ /*! - * @file FiniteElementFluxes_test.cpp * - * @date 11 Feb 2025 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/IceGrowth_test.cpp b/physics/test/IceGrowth_test.cpp index cdf4a54a8..60e443ca9 100644 --- a/physics/test/IceGrowth_test.cpp +++ b/physics/test/IceGrowth_test.cpp @@ -1,9 +1,7 @@ /*! - * @file IceGrowth_test.cpp * - * @date 22 Nov 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/IceMinima_test.cpp b/physics/test/IceMinima_test.cpp index 8f0d104fd..7a2cb7bf6 100644 --- a/physics/test/IceMinima_test.cpp +++ b/physics/test/IceMinima_test.cpp @@ -1,9 +1,7 @@ /*! - * @file IceMinima_test.cpp * - * @date 25 May 2023 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/SlabOcean_test.cpp b/physics/test/SlabOcean_test.cpp index 8a20c31b2..b3d48a774 100644 --- a/physics/test/SlabOcean_test.cpp +++ b/physics/test/SlabOcean_test.cpp @@ -1,9 +1,7 @@ /*! - * @file SlabOcean_test.cpp * - * @date 10 Feb 2025 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/TOPAZOcn_test.cpp b/physics/test/TOPAZOcn_test.cpp index 051b2e8f5..32e2ad837 100644 --- a/physics/test/TOPAZOcn_test.cpp +++ b/physics/test/TOPAZOcn_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ERA5Atm_test.cpp * - * @date 21 Aug 2025 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/ThermoIce0Temperature_test.cpp b/physics/test/ThermoIce0Temperature_test.cpp index eb839550c..4efd5e445 100644 --- a/physics/test/ThermoIce0Temperature_test.cpp +++ b/physics/test/ThermoIce0Temperature_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ThermoIce0Temperature_test.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/ThermoIce0_test.cpp b/physics/test/ThermoIce0_test.cpp index 9bcd5c62f..d185b22d3 100644 --- a/physics/test/ThermoIce0_test.cpp +++ b/physics/test/ThermoIce0_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ThermoIce0Temperature_test.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/ThermoWintonTemperature_test.cpp b/physics/test/ThermoWintonTemperature_test.cpp index 8e33f32bb..8c339f86e 100644 --- a/physics/test/ThermoWintonTemperature_test.cpp +++ b/physics/test/ThermoWintonTemperature_test.cpp @@ -1,9 +1,7 @@ /*! - * @file ThermoWintonTemperature_test.cpp * - * @date 24 Sep 2024 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/UniformOcean_test.cpp b/physics/test/UniformOcean_test.cpp index 0ab10e9a8..1130416b4 100644 --- a/physics/test/UniformOcean_test.cpp +++ b/physics/test/UniformOcean_test.cpp @@ -1,9 +1,7 @@ /*! - * @file UniformOcean_test.cpp * - * @date 30 Mar 2023 * @author Tim Spain - */ +*/ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include From 4ca7363e2e2aba17feeb23de2f063f0c49909332 Mon Sep 17 00:00:00 2001 From: tommelt Date: Thu, 21 Aug 2025 14:01:54 +0100 Subject: [PATCH 32/53] test: remove frontmatter blank lines --- core/src/CommandLineParser.cpp | 3 +-- core/src/CommonRestartMetadata.cpp | 3 +-- core/src/ConfigurationHelpPrinter.cpp | 3 +-- core/src/Configurator.cpp | 3 +-- core/src/ConfiguredModule.cpp | 3 +-- core/src/DevStep.cpp | 3 +-- core/src/FileCallbackCloser.cpp | 3 +-- core/src/Finalizer.cpp | 3 +-- core/src/Iterator.cpp | 2 +- core/src/Logged.cpp | 2 +- core/src/Model.cpp | 2 +- core/src/ModelArray.cpp | 3 +-- core/src/ModelArraySlice.cpp | 3 +-- core/src/ModelComponent.cpp | 3 +-- core/src/ModelConfig.cpp | 3 +-- core/src/ModelMPI.cpp | 3 +-- core/src/ModelMetadata.cpp | 3 +-- core/src/NetcdfMetadataConfiguration.cpp | 3 +-- core/src/PDWriter.cpp | 3 +-- core/src/ParaGridIO.cpp | 3 +-- core/src/ParaGridIO_Xios.cpp | 3 +-- core/src/PrognosticData.cpp | 3 +-- core/src/RectGridIO.cpp | 3 +-- core/src/StructureFactory.cpp | 3 +-- core/src/Time.cpp | 3 +-- core/src/Xios.cpp | 2 +- core/src/discontinuousgalerkin/ModelArrayDetails.cpp | 3 +-- core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp | 3 +-- core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp | 3 +-- core/src/finitevolume/ModelArrayDetails.cpp | 3 +-- core/src/finitevolume/include/ModelArrayDetails.hpp | 3 +-- core/src/finitevolume/include/ModelArrayTypedefs.hpp | 3 +-- core/src/include/Chrono.hpp | 3 +-- core/src/include/CommandLineParser.hpp | 3 +-- core/src/include/CommonRestartMetadata.hpp | 3 +-- core/src/include/ConfigMap.hpp | 3 +-- core/src/include/ConfigurationHelp.hpp | 3 +-- core/src/include/ConfigurationHelpPrinter.hpp | 3 +-- core/src/include/Configurator.hpp | 3 +-- core/src/include/Configured.hpp | 3 +-- core/src/include/ConfiguredModule.hpp | 3 +-- core/src/include/DevStep.hpp | 3 +-- core/src/include/EnumWrapper.hpp | 3 +-- core/src/include/FileCallbackCloser.hpp | 3 +-- core/src/include/Finalizer.hpp | 3 +-- core/src/include/Halo.hpp | 3 +-- core/src/include/IModelStep.hpp | 3 +-- core/src/include/Iterator.hpp | 2 +- core/src/include/Logged.hpp | 2 +- core/src/include/MissingData.hpp | 3 +-- core/src/include/Model.hpp | 2 +- core/src/include/ModelArray.hpp | 3 +-- core/src/include/ModelArrayRef.hpp | 3 +-- core/src/include/ModelArrayReferenceStore.hpp | 3 +-- core/src/include/ModelArraySlice.hpp | 3 +-- core/src/include/ModelComponent.hpp | 3 +-- core/src/include/ModelConfig.hpp | 3 +-- core/src/include/ModelMPI.hpp | 3 +-- core/src/include/ModelMetadata.hpp | 3 +-- core/src/include/ModelState.hpp | 3 +-- core/src/include/Module.hpp | 3 +-- core/src/include/MonthlyCubicBSpline.hpp | 3 +-- core/src/include/NetcdfMetadataConfiguration.hpp | 3 +-- core/src/include/NextsimModule.hpp | 3 +-- core/src/include/OutputSpec.hpp | 3 +-- core/src/include/ParaGridIO.hpp | 3 +-- core/src/include/PrognosticData.hpp | 3 +-- core/src/include/RectGridIO.hpp | 3 +-- core/src/include/Slice.hpp | 3 +-- core/src/include/StructureFactory.hpp | 3 +-- core/src/include/TextTag.hpp | 3 +-- core/src/include/Time.hpp | 3 +-- core/src/include/Xios.hpp | 4 +--- core/src/include/constants.hpp | 2 +- core/src/include/gridNames.hpp | 3 +-- core/src/include/indexer.hpp | 3 +-- core/src/include/xios_c_interface.hpp | 4 +--- core/src/main.cpp | 2 +- core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp | 3 +-- core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp | 3 +-- .../modules/DiagnosticOutputModule/include/ConfigOutput.hpp | 3 +-- core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp | 3 +-- .../modules/DiagnosticOutputModule/include/SimpleOutput.hpp | 3 +-- core/src/modules/DynamicsModule/BBMDynamics.cpp | 3 +-- core/src/modules/DynamicsModule/MEVPDynamics.cpp | 3 +-- core/src/modules/DynamicsModule/include/BBMDynamics.hpp | 3 +-- core/src/modules/DynamicsModule/include/DummyDynamics.hpp | 3 +-- core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp | 3 +-- core/src/modules/DynamicsModule/include/MEVPDynamics.hpp | 3 +-- .../modules/FreezingPointModule/include/LinearFreezing.hpp | 3 +-- .../modules/FreezingPointModule/include/UnescoFreezing.hpp | 3 +-- core/src/modules/StructureModule/ParametricGrid.cpp | 3 +-- core/src/modules/StructureModule/RectangularGrid.cpp | 3 +-- core/src/modules/StructureModule/include/ParametricGrid.hpp | 3 +-- core/src/modules/StructureModule/include/RectangularGrid.hpp | 3 +-- core/src/modules/include/IDiagnosticOutput.hpp | 3 +-- core/src/modules/include/IDynamics.hpp | 3 +-- core/src/modules/include/IFreezingPoint.hpp | 3 +-- core/src/modules/include/IStructure.hpp | 3 +-- core/test/ArgV.cpp | 3 +-- core/test/ArgV.hpp | 3 +-- core/test/CommandLineParser_test.cpp | 3 +-- core/test/ConfigOutput_test.cpp | 3 +-- core/test/Configurator_test.cpp | 3 +-- core/test/DynamicsModuleForPDtest.cpp | 3 +-- core/test/FileCallbackCloser_test.cpp | 3 +-- core/test/Finalizer_test.cpp | 3 +-- core/test/HaloExchangeCB_test.cpp | 3 +-- core/test/HaloExchangePB_test.cpp | 3 +-- core/test/Iterator_test.cpp | 2 +- core/test/Logged_test.cpp | 2 +- core/test/ModelArrayRefDebug_test.cpp | 3 +-- core/test/ModelArrayRef_test.cpp | 3 +-- core/test/ModelArraySlice_test.cpp | 3 +-- core/test/ModelArray_test.cpp | 3 +-- core/test/ModelComponent_test.cpp | 3 +-- core/test/ModelMetadataCB_test.cpp | 3 +-- core/test/ModelMetadataPB_test.cpp | 3 +-- core/test/MonthlyCubicBSpline_test.cpp | 3 +-- core/test/PDTestDynamics.hpp | 3 +-- core/test/ParaGrid_test.cpp | 3 +-- core/test/PrognosticDataIO_test.cpp | 3 +-- core/test/PrognosticData_test.cpp | 3 +-- core/test/RectGrid_test.cpp | 3 +-- core/test/Slice_test.cpp | 3 +-- core/test/Time_test.cpp | 3 +-- core/test/XiosAxis_test.cpp | 3 +-- core/test/XiosCalendar_test.cpp | 3 +-- core/test/XiosDomain_test.cpp | 3 +-- core/test/XiosField_test.cpp | 3 +-- core/test/XiosFile_test.cpp | 3 +-- core/test/XiosGrid_test.cpp | 3 +-- core/test/XiosRead_test.cpp | 3 +-- core/test/XiosWrite_test.cpp | 3 +-- core/test/testmodelarraydetails/ModelArrayDetails.cpp | 3 +-- core/test/testmodelarraydetails/include/ModelArrayDetails.hpp | 3 +-- .../test/testmodelarraydetails/include/ModelArrayTypedefs.hpp | 3 +-- dynamics/src/CGDynamicsKernel.cpp | 3 +-- dynamics/src/DGTransport.cpp | 2 +- dynamics/src/DummyDynamicsKernel.cpp | 3 +-- dynamics/src/DynamicsKernel.cpp | 3 +-- dynamics/src/MEVPStressUpdateStep.cpp | 3 +-- dynamics/src/ParametricMap.cpp | 3 +-- dynamics/src/ParametricMesh.cpp | 2 +- dynamics/src/ParametricTools.cpp | 2 +- dynamics/src/include/BBMDynamicsKernel.hpp | 3 +-- dynamics/src/include/BBMParameters.hpp | 2 +- dynamics/src/include/BBMStressUpdateStep.hpp | 3 +-- dynamics/src/include/BrittleCGDynamicsKernel.hpp | 3 +-- dynamics/src/include/CGDynamicsKernel.hpp | 3 +-- dynamics/src/include/CGModelArray.hpp | 3 +-- dynamics/src/include/CheckPoints.hpp | 2 +- dynamics/src/include/DGModelArray.hpp | 3 +-- dynamics/src/include/DGTransport.hpp | 2 +- dynamics/src/include/DummyDynamicsKernel.hpp | 3 +-- dynamics/src/include/DynamicsKernel.hpp | 3 +-- dynamics/src/include/DynamicsParameters.hpp | 4 +--- dynamics/src/include/FreeDriftDynamicsKernel.hpp | 4 +--- dynamics/src/include/IDynamicsUpdate.hpp | 3 +-- dynamics/src/include/Interpolations.hpp | 2 +- dynamics/src/include/MEVPDynamicsKernel.hpp | 3 +-- dynamics/src/include/MEVPStressUpdateStep.hpp | 3 +-- dynamics/src/include/NextsimDynamics.hpp | 2 +- dynamics/src/include/ParametricMap.hpp | 2 +- dynamics/src/include/ParametricMesh.hpp | 2 +- dynamics/src/include/ParametricTools.hpp | 2 +- dynamics/src/include/StressUpdateStep.hpp | 3 +-- dynamics/src/include/Tools.hpp | 2 +- dynamics/src/include/VPCGDynamicsKernel.hpp | 3 +-- dynamics/src/include/VPParameters.hpp | 2 +- dynamics/src/include/VectorManipulations.hpp | 2 +- dynamics/src/include/cgVector.hpp | 2 +- dynamics/src/include/dgBasisFunctionsGaussPoints.hpp | 2 +- dynamics/src/include/dgInitial.hpp | 2 +- dynamics/src/include/dgLimit.hpp | 2 +- dynamics/src/include/dgLimiters.hpp | 2 +- dynamics/src/include/dgVector.hpp | 2 +- dynamics/src/include/dgVectorHolder.hpp | 3 +-- dynamics/src/include/dgVisu.hpp | 2 +- dynamics/test/AdvectionPeriodicBC_test.cpp | 2 +- dynamics/test/Advection_test.cpp | 2 +- dynamics/test/CGModelArray_test.cpp | 4 +--- dynamics/test/DGModelArray_test.cpp | 4 +--- dynamics/test/FakeSmeshData.cpp | 3 +-- dynamics/test/FakeSmeshData.hpp | 3 +-- dynamics/test/ParametricMeshArea_test.cpp | 4 +--- dynamics/test/ParametricMesh_test.cpp | 4 +--- dynamics/test/dgVectorHolder_test.cpp | 3 +-- physics/src/BenchmarkCoordinates.cpp | 3 +-- physics/src/IceGrowth.cpp | 3 +-- physics/src/IceMinima.cpp | 3 +-- physics/src/SlabOcean.cpp | 3 +-- physics/src/include/BenchmarkCoordinates.hpp | 3 +-- physics/src/include/IceGrowth.hpp | 3 +-- physics/src/include/IceMinima.hpp | 3 +-- physics/src/include/SlabOcean.hpp | 3 +-- .../modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp | 3 +-- .../modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp | 3 +-- .../AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp | 3 +-- .../src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp | 3 +-- .../AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp | 3 +-- .../AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp | 3 +-- .../AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp | 3 +-- .../include/ConstantAtmosphereBoundary.hpp | 3 +-- .../AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp | 3 +-- .../include/FluxConfiguredAtmosphere.hpp | 3 +-- .../AtmosphereBoundaryModule/include/MU71Atmosphere.hpp | 2 +- physics/src/modules/DamageHealingModule/ConstantHealing.cpp | 3 +-- .../modules/DamageHealingModule/include/ConstantHealing.hpp | 3 +-- physics/src/modules/DamageHealingModule/include/NoHealing.hpp | 4 +--- .../src/modules/FluxCalculationModule/FiniteElementFluxes.cpp | 3 +-- .../FluxCalculationModule/include/FiniteElementFluxes.hpp | 3 +-- .../FluxCalculationModule/include/ISpecificHumidity.hpp | 2 +- physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp | 3 +-- physics/src/modules/IceAlbedoModule/MU71Albedo.cpp | 3 +-- physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp | 3 +-- physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp | 3 +-- physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp | 3 +-- physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp | 3 +-- physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp | 3 +-- physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp | 3 +-- physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp | 3 +-- physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp | 3 +-- .../modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp | 3 +-- .../IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp | 3 +-- physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp | 3 +-- physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp | 3 +-- .../include/DummyIceThermodynamics.hpp | 3 +-- .../modules/IceThermodynamicsModule/include/ThermoIce0.hpp | 3 +-- .../modules/IceThermodynamicsModule/include/ThermoWinton.hpp | 3 +-- physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp | 3 +-- .../modules/LateralIceSpreadModule/include/DummyIceSpread.hpp | 3 +-- .../modules/LateralIceSpreadModule/include/HiblerSpread.hpp | 3 +-- physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp | 3 +-- physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp | 3 +-- .../src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp | 3 +-- .../src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp | 3 +-- physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp | 3 +-- physics/src/modules/OceanBoundaryModule/UniformOcean.cpp | 3 +-- .../modules/OceanBoundaryModule/include/BenchmarkOcean.hpp | 3 +-- .../modules/OceanBoundaryModule/include/ConfiguredOcean.hpp | 3 +-- .../OceanBoundaryModule/include/ConstantOceanBoundary.hpp | 3 +-- .../OceanBoundaryModule/include/FluxConfiguredOcean.hpp | 3 +-- .../src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp | 3 +-- .../src/modules/OceanBoundaryModule/include/UniformOcean.hpp | 3 +-- physics/src/modules/include/IAtmosphereBoundary.hpp | 3 +-- physics/src/modules/include/IDamageHealing.hpp | 3 +-- physics/src/modules/include/IFluxCalculation.hpp | 3 +-- physics/src/modules/include/IIceAlbedo.hpp | 2 +- physics/src/modules/include/IIceOceanHeatFlux.hpp | 2 +- physics/src/modules/include/IIceThermodynamics.hpp | 3 +-- physics/src/modules/include/ILateralIceSpread.hpp | 3 +-- physics/src/modules/include/IOceanBoundary.hpp | 3 +-- physics/test/BasicIceOceanFlux_test.cpp | 3 +-- physics/test/BenchmarkBoundaries_test.cpp | 3 +-- physics/test/ConstantOceanBoundary_test.cpp | 3 +-- physics/test/DamageHealing_test.cpp | 3 +-- physics/test/ERA5Atm_test.cpp | 3 +-- physics/test/FiniteElementFluxes_test.cpp | 3 +-- physics/test/IceGrowth_test.cpp | 3 +-- physics/test/IceMinima_test.cpp | 3 +-- physics/test/SlabOcean_test.cpp | 3 +-- physics/test/TOPAZOcn_test.cpp | 3 +-- physics/test/ThermoIce0Temperature_test.cpp | 3 +-- physics/test/ThermoIce0_test.cpp | 3 +-- physics/test/ThermoWintonTemperature_test.cpp | 3 +-- physics/test/UniformOcean_test.cpp | 3 +-- 267 files changed, 267 insertions(+), 505 deletions(-) diff --git a/core/src/CommandLineParser.cpp b/core/src/CommandLineParser.cpp index 8391972e7..da7b4f7f8 100644 --- a/core/src/CommandLineParser.cpp +++ b/core/src/CommandLineParser.cpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Tim Williams -*/ + */ #include "include/CommandLineParser.hpp" diff --git a/core/src/CommonRestartMetadata.cpp b/core/src/CommonRestartMetadata.cpp index dfd7526ca..578762b93 100644 --- a/core/src/CommonRestartMetadata.cpp +++ b/core/src/CommonRestartMetadata.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/CommonRestartMetadata.hpp" #include "include/ModelMetadata.hpp" diff --git a/core/src/ConfigurationHelpPrinter.cpp b/core/src/ConfigurationHelpPrinter.cpp index af08dfc54..4828cdb01 100644 --- a/core/src/ConfigurationHelpPrinter.cpp +++ b/core/src/ConfigurationHelpPrinter.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ConfigurationHelpPrinter.hpp" diff --git a/core/src/Configurator.cpp b/core/src/Configurator.cpp index 2feb608b3..ff55fef30 100644 --- a/core/src/Configurator.cpp +++ b/core/src/Configurator.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/Configurator.hpp" diff --git a/core/src/ConfiguredModule.cpp b/core/src/ConfiguredModule.cpp index 32c732bd5..9b9dae567 100644 --- a/core/src/ConfiguredModule.cpp +++ b/core/src/ConfiguredModule.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ConfiguredModule.hpp" diff --git a/core/src/DevStep.cpp b/core/src/DevStep.cpp index e1bb10500..79e03cb15 100644 --- a/core/src/DevStep.cpp +++ b/core/src/DevStep.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/DevStep.hpp" diff --git a/core/src/FileCallbackCloser.cpp b/core/src/FileCallbackCloser.cpp index 3ded1a2a7..9ae1b930e 100644 --- a/core/src/FileCallbackCloser.cpp +++ b/core/src/FileCallbackCloser.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/FileCallbackCloser.hpp" diff --git a/core/src/Finalizer.cpp b/core/src/Finalizer.cpp index ed94a09d2..0d12a2232 100644 --- a/core/src/Finalizer.cpp +++ b/core/src/Finalizer.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/Finalizer.hpp" diff --git a/core/src/Iterator.cpp b/core/src/Iterator.cpp index af16958eb..67b279c6c 100644 --- a/core/src/Iterator.cpp +++ b/core/src/Iterator.cpp @@ -1,6 +1,6 @@ /*! * @author Tim Spain -*/ + */ #include "include/Iterator.hpp" diff --git a/core/src/Logged.cpp b/core/src/Logged.cpp index b191dbf0b..7000368f1 100644 --- a/core/src/Logged.cpp +++ b/core/src/Logged.cpp @@ -1,6 +1,6 @@ /*! * @author Tim Spain -*/ + */ #include "include/Logged.hpp" diff --git a/core/src/Model.cpp b/core/src/Model.cpp index 8cd8200bf..73075a73a 100644 --- a/core/src/Model.cpp +++ b/core/src/Model.cpp @@ -1,7 +1,7 @@ /*! * @author Tim Spain * @author Kacper Kornet -*/ + */ #include "include/Model.hpp" diff --git a/core/src/ModelArray.cpp b/core/src/ModelArray.cpp index e0d890b5e..4f6039b22 100644 --- a/core/src/ModelArray.cpp +++ b/core/src/ModelArray.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ModelArray.hpp" diff --git a/core/src/ModelArraySlice.cpp b/core/src/ModelArraySlice.cpp index a0791c775..40a2caacf 100644 --- a/core/src/ModelArraySlice.cpp +++ b/core/src/ModelArraySlice.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ModelArraySlice.hpp" diff --git a/core/src/ModelComponent.cpp b/core/src/ModelComponent.cpp index 9c3a7cb66..7efc7260b 100644 --- a/core/src/ModelComponent.cpp +++ b/core/src/ModelComponent.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ModelComponent.hpp" diff --git a/core/src/ModelConfig.cpp b/core/src/ModelConfig.cpp index 14f0bd785..a863d32dc 100644 --- a/core/src/ModelConfig.cpp +++ b/core/src/ModelConfig.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ModelConfig.hpp" #include "include/MissingData.hpp" diff --git a/core/src/ModelMPI.cpp b/core/src/ModelMPI.cpp index 2e03327de..346bcb4e0 100644 --- a/core/src/ModelMPI.cpp +++ b/core/src/ModelMPI.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tom Meltzer -*/ + */ #ifdef USE_MPI #include "include/ModelMPI.hpp" diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index e4fe2a824..ad0b675cf 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Tom Meltzer -*/ + */ #include "include/ModelMetadata.hpp" diff --git a/core/src/NetcdfMetadataConfiguration.cpp b/core/src/NetcdfMetadataConfiguration.cpp index 67f343887..7bb2a2447 100644 --- a/core/src/NetcdfMetadataConfiguration.cpp +++ b/core/src/NetcdfMetadataConfiguration.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/NetcdfMetadataConfiguration.hpp" diff --git a/core/src/PDWriter.cpp b/core/src/PDWriter.cpp index f2fff8872..616c30f84 100644 --- a/core/src/PDWriter.cpp +++ b/core/src/PDWriter.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/PrognosticData.hpp" diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index 9ada98ccb..ec10d53bd 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ParaGridIO.hpp" diff --git a/core/src/ParaGridIO_Xios.cpp b/core/src/ParaGridIO_Xios.cpp index 18403333d..fc3ac9785 100644 --- a/core/src/ParaGridIO_Xios.cpp +++ b/core/src/ParaGridIO_Xios.cpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Joe Wallwork -*/ + */ #include "include/ParaGridIO.hpp" diff --git a/core/src/PrognosticData.cpp b/core/src/PrognosticData.cpp index 20fed4b30..1605d91f1 100644 --- a/core/src/PrognosticData.cpp +++ b/core/src/PrognosticData.cpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Einar Ólason -*/ + */ #include "include/PrognosticData.hpp" diff --git a/core/src/RectGridIO.cpp b/core/src/RectGridIO.cpp index d8fa7746e..d96f58cb4 100644 --- a/core/src/RectGridIO.cpp +++ b/core/src/RectGridIO.cpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Kacper Kornet -*/ + */ #include "include/RectGridIO.hpp" diff --git a/core/src/StructureFactory.cpp b/core/src/StructureFactory.cpp index fc0c9b7ed..5fd541384 100644 --- a/core/src/StructureFactory.cpp +++ b/core/src/StructureFactory.cpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Kacper Kornet -*/ + */ #include "include/StructureFactory.hpp" diff --git a/core/src/Time.cpp b/core/src/Time.cpp index 019727639..90064c8e9 100644 --- a/core/src/Time.cpp +++ b/core/src/Time.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/Time.hpp" diff --git a/core/src/Xios.cpp b/core/src/Xios.cpp index 671145b01..071ffec4a 100644 --- a/core/src/Xios.cpp +++ b/core/src/Xios.cpp @@ -28,7 +28,7 @@ * period = ... * filename = ... * field_names = ... -*/ + */ #include #if USE_XIOS diff --git a/core/src/discontinuousgalerkin/ModelArrayDetails.cpp b/core/src/discontinuousgalerkin/ModelArrayDetails.cpp index f5e963a03..350c359a6 100644 --- a/core/src/discontinuousgalerkin/ModelArrayDetails.cpp +++ b/core/src/discontinuousgalerkin/ModelArrayDetails.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ModelArray.hpp" diff --git a/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp b/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp index 2447fa221..9d4e3b23c 100644 --- a/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp +++ b/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MODELARRAYDETAILS_HPP #define MODELARRAYDETAILS_HPP diff --git a/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp b/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp index 099429725..c4d29f9ed 100644 --- a/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp +++ b/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ // An inclusion file of ModelArray typedefs for Discontinuous Galerkin models. diff --git a/core/src/finitevolume/ModelArrayDetails.cpp b/core/src/finitevolume/ModelArrayDetails.cpp index b8e405ffe..384a378f9 100644 --- a/core/src/finitevolume/ModelArrayDetails.cpp +++ b/core/src/finitevolume/ModelArrayDetails.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ModelArray.hpp" diff --git a/core/src/finitevolume/include/ModelArrayDetails.hpp b/core/src/finitevolume/include/ModelArrayDetails.hpp index 54ac4bce1..ae9707d7d 100644 --- a/core/src/finitevolume/include/ModelArrayDetails.hpp +++ b/core/src/finitevolume/include/ModelArrayDetails.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MODELARRAYDETAILS_HPP #define MODELARRAYDETAILS_HPP diff --git a/core/src/finitevolume/include/ModelArrayTypedefs.hpp b/core/src/finitevolume/include/ModelArrayTypedefs.hpp index f0531d4c7..e89869f30 100644 --- a/core/src/finitevolume/include/ModelArrayTypedefs.hpp +++ b/core/src/finitevolume/include/ModelArrayTypedefs.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ // An inclusion file of ModelArray typedefs for finite volume models. diff --git a/core/src/include/Chrono.hpp b/core/src/include/Chrono.hpp index 5d22607f2..d2d4f8b60 100644 --- a/core/src/include/Chrono.hpp +++ b/core/src/include/Chrono.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef SRC_INCLUDE_CHRONO_HPP_ #define SRC_INCLUDE_CHRONO_HPP_ diff --git a/core/src/include/CommandLineParser.hpp b/core/src/include/CommandLineParser.hpp index dfc9be431..aef2039bf 100644 --- a/core/src/include/CommandLineParser.hpp +++ b/core/src/include/CommandLineParser.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef COMMANDLINEPARSER_HPP #define COMMANDLINEPARSER_HPP diff --git a/core/src/include/CommonRestartMetadata.hpp b/core/src/include/CommonRestartMetadata.hpp index 175cafcd9..3acfdd17c 100644 --- a/core/src/include/CommonRestartMetadata.hpp +++ b/core/src/include/CommonRestartMetadata.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef COMMONRESTARTMETADATA_HPP #define COMMONRESTARTMETADATA_HPP diff --git a/core/src/include/ConfigMap.hpp b/core/src/include/ConfigMap.hpp index e350a4ee9..0dd554ed3 100644 --- a/core/src/include/ConfigMap.hpp +++ b/core/src/include/ConfigMap.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CONFIGMAP_HPP #define CONFIGMAP_HPP diff --git a/core/src/include/ConfigurationHelp.hpp b/core/src/include/ConfigurationHelp.hpp index a5623687b..1f73e9364 100644 --- a/core/src/include/ConfigurationHelp.hpp +++ b/core/src/include/ConfigurationHelp.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CONFIGURATIONHELP_HPP #define CONFIGURATIONHELP_HPP diff --git a/core/src/include/ConfigurationHelpPrinter.hpp b/core/src/include/ConfigurationHelpPrinter.hpp index 4e2ff60e9..f9b8ae7da 100644 --- a/core/src/include/ConfigurationHelpPrinter.hpp +++ b/core/src/include/ConfigurationHelpPrinter.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CONFIGURATIONHELPPRINTER_HPP #define CONFIGURATIONHELPPRINTER_HPP diff --git a/core/src/include/Configurator.hpp b/core/src/include/Configurator.hpp index 09e81162c..0d48e286b 100644 --- a/core/src/include/Configurator.hpp +++ b/core/src/include/Configurator.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CONFIGURATOR_HPP #define CONFIGURATOR_HPP diff --git a/core/src/include/Configured.hpp b/core/src/include/Configured.hpp index 4cd7fc87a..a13f3e60c 100644 --- a/core/src/include/Configured.hpp +++ b/core/src/include/Configured.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CONFIGURED_HPP #define CONFIGURED_HPP diff --git a/core/src/include/ConfiguredModule.hpp b/core/src/include/ConfiguredModule.hpp index 8a4f002af..9d0b7495f 100644 --- a/core/src/include/ConfiguredModule.hpp +++ b/core/src/include/ConfiguredModule.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CONFIGUREDMODULE_HPP #define CONFIGUREDMODULE_HPP diff --git a/core/src/include/DevStep.hpp b/core/src/include/DevStep.hpp index 54d936667..1b1f3a34f 100644 --- a/core/src/include/DevStep.hpp +++ b/core/src/include/DevStep.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef DEVSTEP_HPP #define DEVSTEP_HPP diff --git a/core/src/include/EnumWrapper.hpp b/core/src/include/EnumWrapper.hpp index d1aa72c0a..cacfd0ebd 100644 --- a/core/src/include/EnumWrapper.hpp +++ b/core/src/include/EnumWrapper.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef ENUMWRAPPER_HPP #define ENUMWRAPPER_HPP diff --git a/core/src/include/FileCallbackCloser.hpp b/core/src/include/FileCallbackCloser.hpp index 4378f31fe..bbdd61f42 100644 --- a/core/src/include/FileCallbackCloser.hpp +++ b/core/src/include/FileCallbackCloser.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef FILECALLBACKCLOSER_HPP #define FILECALLBACKCLOSER_HPP diff --git a/core/src/include/Finalizer.hpp b/core/src/include/Finalizer.hpp index 07bb7bfe1..91a248742 100644 --- a/core/src/include/Finalizer.hpp +++ b/core/src/include/Finalizer.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef FINALIZER_HPP #define FINALIZER_HPP diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index 05f5d2f9a..2ee947634 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tom Meltzer -*/ + */ #ifndef HALO_HPP #define HALO_HPP diff --git a/core/src/include/IModelStep.hpp b/core/src/include/IModelStep.hpp index 8ae589d33..a6609dbcd 100644 --- a/core/src/include/IModelStep.hpp +++ b/core/src/include/IModelStep.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef IMODELSTEP_HPP #define IMODELSTEP_HPP diff --git a/core/src/include/Iterator.hpp b/core/src/include/Iterator.hpp index 53c429bf1..3794c2752 100644 --- a/core/src/include/Iterator.hpp +++ b/core/src/include/Iterator.hpp @@ -1,6 +1,6 @@ /*! * @author Tim Spain -*/ + */ #ifndef SRC_INCLUDE_ITERATOR_HPP #define SRC_INCLUDE_ITERATOR_HPP diff --git a/core/src/include/Logged.hpp b/core/src/include/Logged.hpp index 3937cfbe1..530085c58 100644 --- a/core/src/include/Logged.hpp +++ b/core/src/include/Logged.hpp @@ -1,6 +1,6 @@ /*! * @author Tim Spain -*/ + */ #ifndef SRC_INCLUDE_LOGGED_HPP #define SRC_INCLUDE_LOGGED_HPP diff --git a/core/src/include/MissingData.hpp b/core/src/include/MissingData.hpp index 3354312a1..e41cb52c3 100644 --- a/core/src/include/MissingData.hpp +++ b/core/src/include/MissingData.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MISSINGDATA_HPP #define MISSINGDATA_HPP diff --git a/core/src/include/Model.hpp b/core/src/include/Model.hpp index ee9635d22..c2495c8b0 100644 --- a/core/src/include/Model.hpp +++ b/core/src/include/Model.hpp @@ -1,7 +1,7 @@ /*! * @author Tim Spain * @author Kacper Kornet -*/ + */ #ifndef MODEL_HPP #define MODEL_HPP diff --git a/core/src/include/ModelArray.hpp b/core/src/include/ModelArray.hpp index 88c0a325c..4b49b508f 100644 --- a/core/src/include/ModelArray.hpp +++ b/core/src/include/ModelArray.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MODELARRAY_HPP #define MODELARRAY_HPP diff --git a/core/src/include/ModelArrayRef.hpp b/core/src/include/ModelArrayRef.hpp index 9bf188503..447905300 100644 --- a/core/src/include/ModelArrayRef.hpp +++ b/core/src/include/ModelArrayRef.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MODELARRAYREF_HPP #define MODELARRAYREF_HPP diff --git a/core/src/include/ModelArrayReferenceStore.hpp b/core/src/include/ModelArrayReferenceStore.hpp index bc21d898f..fb1c75618 100644 --- a/core/src/include/ModelArrayReferenceStore.hpp +++ b/core/src/include/ModelArrayReferenceStore.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MARSTORE_HPP #define MARSTORE_HPP diff --git a/core/src/include/ModelArraySlice.hpp b/core/src/include/ModelArraySlice.hpp index 9a9afd2c3..9332aa2a8 100644 --- a/core/src/include/ModelArraySlice.hpp +++ b/core/src/include/ModelArraySlice.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MODELARRAYSLICE_HPP #define MODELARRAYSLICE_HPP diff --git a/core/src/include/ModelComponent.hpp b/core/src/include/ModelComponent.hpp index 787cead45..eaaf0b53e 100644 --- a/core/src/include/ModelComponent.hpp +++ b/core/src/include/ModelComponent.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Einar Ólason -*/ + */ #ifndef MODELCOMPONENT_HPP #define MODELCOMPONENT_HPP diff --git a/core/src/include/ModelConfig.hpp b/core/src/include/ModelConfig.hpp index b676993b5..32d19dc4c 100644 --- a/core/src/include/ModelConfig.hpp +++ b/core/src/include/ModelConfig.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MODELCONFIG_HPP #define MODELCONFIG_HPP diff --git a/core/src/include/ModelMPI.hpp b/core/src/include/ModelMPI.hpp index f46f17881..63b181e16 100644 --- a/core/src/include/ModelMPI.hpp +++ b/core/src/include/ModelMPI.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tom Meltzer -*/ + */ #ifndef MODELMPI_HPP #define MODELMPI_HPP diff --git a/core/src/include/ModelMetadata.hpp b/core/src/include/ModelMetadata.hpp index 30cbf970d..203cb845e 100644 --- a/core/src/include/ModelMetadata.hpp +++ b/core/src/include/ModelMetadata.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Tom Meltzer -*/ + */ #ifndef MODELMETADATA_HPP #define MODELMETADATA_HPP diff --git a/core/src/include/ModelState.hpp b/core/src/include/ModelState.hpp index ae0e1bc87..aa2df3758 100644 --- a/core/src/include/ModelState.hpp +++ b/core/src/include/ModelState.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MODELSTATE_HPP #define MODELSTATE_HPP diff --git a/core/src/include/Module.hpp b/core/src/include/Module.hpp index 7c1362cfd..b329fa80f 100644 --- a/core/src/include/Module.hpp +++ b/core/src/include/Module.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MODULE_HPP #define MODULE_HPP diff --git a/core/src/include/MonthlyCubicBSpline.hpp b/core/src/include/MonthlyCubicBSpline.hpp index ace9a636f..11a310295 100644 --- a/core/src/include/MonthlyCubicBSpline.hpp +++ b/core/src/include/MonthlyCubicBSpline.hpp @@ -1,7 +1,6 @@ /*! - * * @author Einar Örn Ólason -*/ + */ #ifndef MONTHLYCUBICBSPLINE_HPP #define MONTHLYCUBICBSPLINE_HPP diff --git a/core/src/include/NetcdfMetadataConfiguration.hpp b/core/src/include/NetcdfMetadataConfiguration.hpp index 81bd976d3..edc6dddc2 100644 --- a/core/src/include/NetcdfMetadataConfiguration.hpp +++ b/core/src/include/NetcdfMetadataConfiguration.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef NETCDFMETADATACONFIGURATION_HPP #define NETCDFMETADATACONFIGURATION_HPP diff --git a/core/src/include/NextsimModule.hpp b/core/src/include/NextsimModule.hpp index f1149014d..4eb2dee9b 100644 --- a/core/src/include/NextsimModule.hpp +++ b/core/src/include/NextsimModule.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef NEXTSIMMODULE_HPP #define NEXTSIMMODULE_HPP diff --git a/core/src/include/OutputSpec.hpp b/core/src/include/OutputSpec.hpp index 3eac519d0..e9530972a 100644 --- a/core/src/include/OutputSpec.hpp +++ b/core/src/include/OutputSpec.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef OUTPUTSPEC_HPP #define OUTPUTSPEC_HPP diff --git a/core/src/include/ParaGridIO.hpp b/core/src/include/ParaGridIO.hpp index e28341989..48a4fc23e 100644 --- a/core/src/include/ParaGridIO.hpp +++ b/core/src/include/ParaGridIO.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef PARAGRIDIO_HPP #define PARAGRIDIO_HPP diff --git a/core/src/include/PrognosticData.hpp b/core/src/include/PrognosticData.hpp index 9d9a8732d..f3fbe434b 100644 --- a/core/src/include/PrognosticData.hpp +++ b/core/src/include/PrognosticData.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef PROGNOSTICDATA_HPP #define PROGNOSTICDATA_HPP diff --git a/core/src/include/RectGridIO.hpp b/core/src/include/RectGridIO.hpp index b7c999aa4..35cd14ca8 100644 --- a/core/src/include/RectGridIO.hpp +++ b/core/src/include/RectGridIO.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Kacper Kornet -*/ + */ #ifndef RECTGRIDIO_HPP #define RECTGRIDIO_HPP diff --git a/core/src/include/Slice.hpp b/core/src/include/Slice.hpp index 99d43a194..b179c4946 100644 --- a/core/src/include/Slice.hpp +++ b/core/src/include/Slice.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef SLICE_HPP #define SLICE_HPP diff --git a/core/src/include/StructureFactory.hpp b/core/src/include/StructureFactory.hpp index 18a44c7f5..5bd822fb1 100644 --- a/core/src/include/StructureFactory.hpp +++ b/core/src/include/StructureFactory.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Kacper Kornet -*/ + */ #ifndef STRUCTUREFACTORY_HPP #define STRUCTUREFACTORY_HPP diff --git a/core/src/include/TextTag.hpp b/core/src/include/TextTag.hpp index 32d9d26ff..e8ff86f0c 100644 --- a/core/src/include/TextTag.hpp +++ b/core/src/include/TextTag.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef TEXTTAG_HPP #define TEXTTAG_HPP diff --git a/core/src/include/Time.hpp b/core/src/include/Time.hpp index 28dc64951..4046de06f 100644 --- a/core/src/include/Time.hpp +++ b/core/src/include/Time.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef TIME_HPP #define TIME_HPP diff --git a/core/src/include/Xios.hpp b/core/src/include/Xios.hpp index 16d65c028..a8e43fd10 100644 --- a/core/src/include/Xios.hpp +++ b/core/src/include/Xios.hpp @@ -4,10 +4,8 @@ * @author Adeleke Bankole * @brief XIOS interface header * @details - * * Header file for XIOS interface - * -*/ + */ #ifndef SRC_INCLUDE_XIOS_HPP #define SRC_INCLUDE_XIOS_HPP diff --git a/core/src/include/constants.hpp b/core/src/include/constants.hpp index 0e267e152..e50b9e7ac 100644 --- a/core/src/include/constants.hpp +++ b/core/src/include/constants.hpp @@ -1,6 +1,6 @@ /*! * @author Tim Spain -*/ + */ #ifndef SRC_INCLUDE_CONSTANTS_HPP #define SRC_INCLUDE_CONSTANTS_HPP diff --git a/core/src/include/gridNames.hpp b/core/src/include/gridNames.hpp index 5df1ae682..b67d16344 100644 --- a/core/src/include/gridNames.hpp +++ b/core/src/include/gridNames.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef GRIDNAMES_HPP #define GRIDNAMES_HPP diff --git a/core/src/include/indexer.hpp b/core/src/include/indexer.hpp index 209efcceb..a30db39d4 100644 --- a/core/src/include/indexer.hpp +++ b/core/src/include/indexer.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef INDEXER_HPP #define INDEXER_HPP diff --git a/core/src/include/xios_c_interface.hpp b/core/src/include/xios_c_interface.hpp index ee00d43c8..813bece76 100644 --- a/core/src/include/xios_c_interface.hpp +++ b/core/src/include/xios_c_interface.hpp @@ -6,11 +6,9 @@ * This interface is based on an earlier version provided by Laurent as part of * the https://github.com/nextsimhub/xios_cpp_toy repo. This C interface is * designed to connect with the underlying Fortran interface of XIOS 2. - * * This can be expanded as we add more XIOS functionality to the nextSIM-DG XIOS * C++ interface `Xios.cpp`. - * -*/ + */ #ifndef XIOS_C_INTERFACE #define XIOS_C_INTERFACE diff --git a/core/src/main.cpp b/core/src/main.cpp index 363a84062..eaac6c661 100644 --- a/core/src/main.cpp +++ b/core/src/main.cpp @@ -1,7 +1,7 @@ /*! * @author Tim Spain * @author Kacper Kornet -*/ + */ #include #ifdef USE_MPI diff --git a/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp b/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp index 850b19ef0..bef4302e1 100644 --- a/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp +++ b/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ConfigOutput.hpp" #include "include/FileCallbackCloser.hpp" diff --git a/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp b/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp index 1eb36cb22..f817c9508 100644 --- a/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp +++ b/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/SimpleOutput.hpp" diff --git a/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp index a924aa22b..9afcff914 100644 --- a/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CONFIGOUTPUT_HPP #define CONFIGOUTPUT_HPP diff --git a/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp index f51f0f6cb..5a755e6b7 100644 --- a/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef NOOUTPUT_HPP #define NOOUTPUT_HPP diff --git a/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp index 6c197af84..6d079cacd 100644 --- a/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef SIMPLEOUTPUT_HPP #define SIMPLEOUTPUT_HPP diff --git a/core/src/modules/DynamicsModule/BBMDynamics.cpp b/core/src/modules/DynamicsModule/BBMDynamics.cpp index 18559b7f7..65ab479cd 100644 --- a/core/src/modules/DynamicsModule/BBMDynamics.cpp +++ b/core/src/modules/DynamicsModule/BBMDynamics.cpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Einar Ólason -*/ + */ #include "include/BBMDynamics.hpp" #include "include/constants.hpp" diff --git a/core/src/modules/DynamicsModule/MEVPDynamics.cpp b/core/src/modules/DynamicsModule/MEVPDynamics.cpp index 1334d9227..ac63b561f 100644 --- a/core/src/modules/DynamicsModule/MEVPDynamics.cpp +++ b/core/src/modules/DynamicsModule/MEVPDynamics.cpp @@ -1,9 +1,8 @@ /*! - * * @author Tim Spain * @author Piotr Minakowski * @author Einar Ólason -*/ + */ #include "include/MEVPDynamics.hpp" #include "include/constants.hpp" diff --git a/core/src/modules/DynamicsModule/include/BBMDynamics.hpp b/core/src/modules/DynamicsModule/include/BBMDynamics.hpp index f821e5739..ccb013938 100644 --- a/core/src/modules/DynamicsModule/include/BBMDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/BBMDynamics.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef BBMDYNAMICS_HPP #define BBMDYNAMICS_HPP diff --git a/core/src/modules/DynamicsModule/include/DummyDynamics.hpp b/core/src/modules/DynamicsModule/include/DummyDynamics.hpp index 212e8b96d..2959535a2 100644 --- a/core/src/modules/DynamicsModule/include/DummyDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/DummyDynamics.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef DUMMYDYNAMICS_HPP #define DUMMYDYNAMICS_HPP diff --git a/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp b/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp index d5c1ef4a7..bae6576f5 100644 --- a/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef FREEDRIFTDYNAMICS_HPP #define FREEDRIFTDYNAMICS_HPP diff --git a/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp b/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp index 430c1a4f4..a41223dab 100644 --- a/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp @@ -1,9 +1,8 @@ /*! - * * @author Tim Spain * @author Piotr Minakowski * @author Einar Ólason -*/ + */ #ifndef MEVPDYNAMICS_HPP #define MEVPDYNAMICS_HPP diff --git a/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp b/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp index d76d986f0..f6cc576c6 100644 --- a/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp +++ b/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef LINEARFREEZING_HPP #define LINEARFREEZING_HPP diff --git a/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp b/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp index 4443c4796..09ba3de17 100644 --- a/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp +++ b/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef UNESCOFREEZING_HPP #define UNESCOFREEZING_HPP diff --git a/core/src/modules/StructureModule/ParametricGrid.cpp b/core/src/modules/StructureModule/ParametricGrid.cpp index 502160b06..948e67e85 100644 --- a/core/src/modules/StructureModule/ParametricGrid.cpp +++ b/core/src/modules/StructureModule/ParametricGrid.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ParametricGrid.hpp" diff --git a/core/src/modules/StructureModule/RectangularGrid.cpp b/core/src/modules/StructureModule/RectangularGrid.cpp index 54761d9e3..30222dffa 100644 --- a/core/src/modules/StructureModule/RectangularGrid.cpp +++ b/core/src/modules/StructureModule/RectangularGrid.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/RectangularGrid.hpp" diff --git a/core/src/modules/StructureModule/include/ParametricGrid.hpp b/core/src/modules/StructureModule/include/ParametricGrid.hpp index 03fe32d01..e5422c25f 100644 --- a/core/src/modules/StructureModule/include/ParametricGrid.hpp +++ b/core/src/modules/StructureModule/include/ParametricGrid.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Kacper Kornet -*/ + */ #ifndef PARAMETRICGRID_HPP #define PARAMETRICGRID_HPP diff --git a/core/src/modules/StructureModule/include/RectangularGrid.hpp b/core/src/modules/StructureModule/include/RectangularGrid.hpp index cbcc18361..591c77165 100644 --- a/core/src/modules/StructureModule/include/RectangularGrid.hpp +++ b/core/src/modules/StructureModule/include/RectangularGrid.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Kacper Kornet -*/ + */ #ifndef RECTANGULARGRID_HPP #define RECTANGULARGRID_HPP diff --git a/core/src/modules/include/IDiagnosticOutput.hpp b/core/src/modules/include/IDiagnosticOutput.hpp index 29d9e8fca..8989f158b 100644 --- a/core/src/modules/include/IDiagnosticOutput.hpp +++ b/core/src/modules/include/IDiagnosticOutput.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef IDIAGNOSTICOUTPUT_HPP #define IDIAGNOSTICOUTPUT_HPP diff --git a/core/src/modules/include/IDynamics.hpp b/core/src/modules/include/IDynamics.hpp index 13c4adcbc..eadef566c 100644 --- a/core/src/modules/include/IDynamics.hpp +++ b/core/src/modules/include/IDynamics.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef IDYNAMICS_HPP #define IDYNAMICS_HPP diff --git a/core/src/modules/include/IFreezingPoint.hpp b/core/src/modules/include/IFreezingPoint.hpp index fb6ad78b2..2b6488cd5 100644 --- a/core/src/modules/include/IFreezingPoint.hpp +++ b/core/src/modules/include/IFreezingPoint.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef SRC_INCLUDE_IFREEZINGPOINT_HPP_ #define SRC_INCLUDE_IFREEZINGPOINT_HPP_ diff --git a/core/src/modules/include/IStructure.hpp b/core/src/modules/include/IStructure.hpp index fb6ae237a..1127f62c9 100644 --- a/core/src/modules/include/IStructure.hpp +++ b/core/src/modules/include/IStructure.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Kacper Kornet -*/ + */ #ifndef ISTRUCTURE_HPP #define ISTRUCTURE_HPP diff --git a/core/test/ArgV.cpp b/core/test/ArgV.cpp index bd2eaac5b..24c6dd159 100644 --- a/core/test/ArgV.cpp +++ b/core/test/ArgV.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "ArgV.hpp" diff --git a/core/test/ArgV.hpp b/core/test/ArgV.hpp index 331f9592a..b4f01ac9f 100644 --- a/core/test/ArgV.hpp +++ b/core/test/ArgV.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include #include diff --git a/core/test/CommandLineParser_test.cpp b/core/test/CommandLineParser_test.cpp index d206e0394..7b7dbcfa6 100644 --- a/core/test/CommandLineParser_test.cpp +++ b/core/test/CommandLineParser_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "ArgV.hpp" #include "CommandLineParser.hpp" diff --git a/core/test/ConfigOutput_test.cpp b/core/test/ConfigOutput_test.cpp index d6c410495..d9761a05a 100644 --- a/core/test/ConfigOutput_test.cpp +++ b/core/test/ConfigOutput_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifdef USE_MPI #include diff --git a/core/test/Configurator_test.cpp b/core/test/Configurator_test.cpp index 9be38acb7..a021e2035 100644 --- a/core/test/Configurator_test.cpp +++ b/core/test/Configurator_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "ArgV.hpp" #include "Configurator.hpp" diff --git a/core/test/DynamicsModuleForPDtest.cpp b/core/test/DynamicsModuleForPDtest.cpp index c4c654bb7..b6318bfce 100644 --- a/core/test/DynamicsModuleForPDtest.cpp +++ b/core/test/DynamicsModuleForPDtest.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/IDynamics.hpp" #include "include/NextsimModule.hpp" diff --git a/core/test/FileCallbackCloser_test.cpp b/core/test/FileCallbackCloser_test.cpp index 1a24979a8..134325f45 100644 --- a/core/test/FileCallbackCloser_test.cpp +++ b/core/test/FileCallbackCloser_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/Finalizer_test.cpp b/core/test/Finalizer_test.cpp index 57c2265d0..d7c1937e0 100644 --- a/core/test/Finalizer_test.cpp +++ b/core/test/Finalizer_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/HaloExchangeCB_test.cpp b/core/test/HaloExchangeCB_test.cpp index fbe4104d6..9af72d981 100644 --- a/core/test/HaloExchangeCB_test.cpp +++ b/core/test/HaloExchangeCB_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tom Meltzer -*/ + */ #include diff --git a/core/test/HaloExchangePB_test.cpp b/core/test/HaloExchangePB_test.cpp index f60522e32..86ad1def8 100644 --- a/core/test/HaloExchangePB_test.cpp +++ b/core/test/HaloExchangePB_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tom Meltzer -*/ + */ #include diff --git a/core/test/Iterator_test.cpp b/core/test/Iterator_test.cpp index 7d932a84f..e4cd16647 100644 --- a/core/test/Iterator_test.cpp +++ b/core/test/Iterator_test.cpp @@ -1,6 +1,6 @@ /*! * @author Tim Spain -*/ + */ #include "Iterator.hpp" diff --git a/core/test/Logged_test.cpp b/core/test/Logged_test.cpp index d75496c83..0b1979007 100644 --- a/core/test/Logged_test.cpp +++ b/core/test/Logged_test.cpp @@ -1,6 +1,6 @@ /*! * @author Tim Spain -*/ + */ #include "Logged.hpp" diff --git a/core/test/ModelArrayRefDebug_test.cpp b/core/test/ModelArrayRefDebug_test.cpp index fce6a27a7..5624e1c67 100644 --- a/core/test/ModelArrayRefDebug_test.cpp +++ b/core/test/ModelArrayRefDebug_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/ModelArrayRef_test.cpp b/core/test/ModelArrayRef_test.cpp index 38773075a..a55275404 100644 --- a/core/test/ModelArrayRef_test.cpp +++ b/core/test/ModelArrayRef_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/ModelArraySlice_test.cpp b/core/test/ModelArraySlice_test.cpp index 589b62f0c..6580b37e2 100644 --- a/core/test/ModelArraySlice_test.cpp +++ b/core/test/ModelArraySlice_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/ModelArray_test.cpp b/core/test/ModelArray_test.cpp index 804e0c637..f5d0a330d 100644 --- a/core/test/ModelArray_test.cpp +++ b/core/test/ModelArray_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/ModelComponent_test.cpp b/core/test/ModelComponent_test.cpp index 3d2254c2c..7741d9739 100644 --- a/core/test/ModelComponent_test.cpp +++ b/core/test/ModelComponent_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/ModelMetadataCB_test.cpp b/core/test/ModelMetadataCB_test.cpp index f566eeda1..e3aa6c5de 100644 --- a/core/test/ModelMetadataCB_test.cpp +++ b/core/test/ModelMetadataCB_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tom Meltzer -*/ + */ #include #include diff --git a/core/test/ModelMetadataPB_test.cpp b/core/test/ModelMetadataPB_test.cpp index 437ada1e8..aabb7d2c2 100644 --- a/core/test/ModelMetadataPB_test.cpp +++ b/core/test/ModelMetadataPB_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tom Meltzer -*/ + */ #include #include diff --git a/core/test/MonthlyCubicBSpline_test.cpp b/core/test/MonthlyCubicBSpline_test.cpp index b7cdda7d8..0743631dc 100644 --- a/core/test/MonthlyCubicBSpline_test.cpp +++ b/core/test/MonthlyCubicBSpline_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Einar Örn Ólason -*/ + */ #include "include/MonthlyCubicBSpline.hpp" diff --git a/core/test/PDTestDynamics.hpp b/core/test/PDTestDynamics.hpp index 282e6f707..f4dfb72c2 100644 --- a/core/test/PDTestDynamics.hpp +++ b/core/test/PDTestDynamics.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef PDTESTDYNAMICS_HPP #define PDTESTDYNAMICS_HPP diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index 36d455a4e..bb6cafe56 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Tom Meltzer -*/ + */ #include "ModelArray.hpp" #include diff --git a/core/test/PrognosticDataIO_test.cpp b/core/test/PrognosticDataIO_test.cpp index 4f1341a73..ed512de9d 100644 --- a/core/test/PrognosticDataIO_test.cpp +++ b/core/test/PrognosticDataIO_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/PrognosticData_test.cpp b/core/test/PrognosticData_test.cpp index de86df2ab..5c89dbe9e 100644 --- a/core/test/PrognosticData_test.cpp +++ b/core/test/PrognosticData_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/RectGrid_test.cpp b/core/test/RectGrid_test.cpp index a56b76de9..70b7a734d 100644 --- a/core/test/RectGrid_test.cpp +++ b/core/test/RectGrid_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifdef USE_MPI #include diff --git a/core/test/Slice_test.cpp b/core/test/Slice_test.cpp index 1f3847a66..48e0d9351 100644 --- a/core/test/Slice_test.cpp +++ b/core/test/Slice_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/core/test/Time_test.cpp b/core/test/Time_test.cpp index 67cfb5c0a..09678b69e 100644 --- a/core/test/Time_test.cpp +++ b/core/test/Time_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/Time.hpp" diff --git a/core/test/XiosAxis_test.cpp b/core/test/XiosAxis_test.cpp index bc4ca405a..0c57f4571 100644 --- a/core/test/XiosAxis_test.cpp +++ b/core/test/XiosAxis_test.cpp @@ -5,8 +5,7 @@ * @details * This test is designed to test axis functionality of the C++ interface * for XIOS. - * -*/ + */ #include #undef INFO diff --git a/core/test/XiosCalendar_test.cpp b/core/test/XiosCalendar_test.cpp index 54bbefb1d..03a17cc9b 100644 --- a/core/test/XiosCalendar_test.cpp +++ b/core/test/XiosCalendar_test.cpp @@ -5,8 +5,7 @@ * @details * This test is designed to test calendar functionality of the C++ interface * for XIOS. - * -*/ + */ #include #undef INFO diff --git a/core/test/XiosDomain_test.cpp b/core/test/XiosDomain_test.cpp index 9b534628d..68a1bb5eb 100644 --- a/core/test/XiosDomain_test.cpp +++ b/core/test/XiosDomain_test.cpp @@ -5,8 +5,7 @@ * @details * This test is designed to test domain functionality of the C++ interface * for XIOS. - * -*/ + */ #include #undef INFO diff --git a/core/test/XiosField_test.cpp b/core/test/XiosField_test.cpp index 454b3dc87..dc932aac2 100644 --- a/core/test/XiosField_test.cpp +++ b/core/test/XiosField_test.cpp @@ -5,8 +5,7 @@ * @details * This test is designed to test field functionality of the C++ interface * for XIOS. - * -*/ + */ #include #undef INFO diff --git a/core/test/XiosFile_test.cpp b/core/test/XiosFile_test.cpp index 7a2630f48..6c5e0b578 100644 --- a/core/test/XiosFile_test.cpp +++ b/core/test/XiosFile_test.cpp @@ -5,8 +5,7 @@ * @details * This test is designed to test file functionality of the C++ interface * for XIOS. - * -*/ + */ #include #undef INFO diff --git a/core/test/XiosGrid_test.cpp b/core/test/XiosGrid_test.cpp index 2fd7c714f..0fe102b8a 100644 --- a/core/test/XiosGrid_test.cpp +++ b/core/test/XiosGrid_test.cpp @@ -5,8 +5,7 @@ * @details * This test is designed to test grid functionality of the C++ interface * for XIOS. - * -*/ + */ #include #undef INFO diff --git a/core/test/XiosRead_test.cpp b/core/test/XiosRead_test.cpp index 7d92565ec..fd24ca3ee 100644 --- a/core/test/XiosRead_test.cpp +++ b/core/test/XiosRead_test.cpp @@ -4,8 +4,7 @@ * @details * This test is designed to test the file reading functionality of the C++ * interface for XIOS. - * -*/ + */ #include #undef INFO diff --git a/core/test/XiosWrite_test.cpp b/core/test/XiosWrite_test.cpp index 7cee0749c..afa69402f 100644 --- a/core/test/XiosWrite_test.cpp +++ b/core/test/XiosWrite_test.cpp @@ -4,8 +4,7 @@ * @details * This test is designed to test the file writing functionality of the C++ * interface for XIOS. - * -*/ + */ #include #undef INFO diff --git a/core/test/testmodelarraydetails/ModelArrayDetails.cpp b/core/test/testmodelarraydetails/ModelArrayDetails.cpp index 7b185cd86..6478475b9 100644 --- a/core/test/testmodelarraydetails/ModelArrayDetails.cpp +++ b/core/test/testmodelarraydetails/ModelArrayDetails.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ModelArray.hpp" diff --git a/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp b/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp index bc96bb6ea..5598f0d9f 100644 --- a/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp +++ b/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MODELARRAYDETAILS_HPP #define MODELARRAYDETAILS_HPP diff --git a/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp b/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp index d4a8b0203..99d946645 100644 --- a/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp +++ b/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ typedef ModelArray OneDField; typedef ModelArray TwoDField; diff --git a/dynamics/src/CGDynamicsKernel.cpp b/dynamics/src/CGDynamicsKernel.cpp index e7ed45983..edbb0624f 100644 --- a/dynamics/src/CGDynamicsKernel.cpp +++ b/dynamics/src/CGDynamicsKernel.cpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Robert Jendersie -*/ + */ /* * The implementation of DynamicsKernel which uses continuous Galerkin (CG) numerics. diff --git a/dynamics/src/DGTransport.cpp b/dynamics/src/DGTransport.cpp index 2455e4d59..cd07ef69e 100644 --- a/dynamics/src/DGTransport.cpp +++ b/dynamics/src/DGTransport.cpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #include "DGTransport.hpp" #include "Interpolations.hpp" diff --git a/dynamics/src/DummyDynamicsKernel.cpp b/dynamics/src/DummyDynamicsKernel.cpp index b231ce7d9..62b6b299f 100644 --- a/dynamics/src/DummyDynamicsKernel.cpp +++ b/dynamics/src/DummyDynamicsKernel.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/DummyDynamicsKernel.hpp" diff --git a/dynamics/src/DynamicsKernel.cpp b/dynamics/src/DynamicsKernel.cpp index aead532f7..12e004c94 100644 --- a/dynamics/src/DynamicsKernel.cpp +++ b/dynamics/src/DynamicsKernel.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/DynamicsKernel.hpp" diff --git a/dynamics/src/MEVPStressUpdateStep.cpp b/dynamics/src/MEVPStressUpdateStep.cpp index 51bbb5ae2..bfa76c7fd 100644 --- a/dynamics/src/MEVPStressUpdateStep.cpp +++ b/dynamics/src/MEVPStressUpdateStep.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "MEVPStressUpdateStep.hpp" diff --git a/dynamics/src/ParametricMap.cpp b/dynamics/src/ParametricMap.cpp index 539dc974b..3417aa7c6 100644 --- a/dynamics/src/ParametricMap.cpp +++ b/dynamics/src/ParametricMap.cpp @@ -1,7 +1,6 @@ /*! - * * @author Thomas Richter -*/ + */ #include "ParametricMap.hpp" #include "ParametricTools.hpp" diff --git a/dynamics/src/ParametricMesh.cpp b/dynamics/src/ParametricMesh.cpp index 4da4fc15b..c72c3291b 100644 --- a/dynamics/src/ParametricMesh.cpp +++ b/dynamics/src/ParametricMesh.cpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #include "ParametricMesh.hpp" diff --git a/dynamics/src/ParametricTools.cpp b/dynamics/src/ParametricTools.cpp index 997e6f3e8..d05f8451d 100644 --- a/dynamics/src/ParametricTools.cpp +++ b/dynamics/src/ParametricTools.cpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #include "ParametricTools.hpp" #include "codeGenerationCGinGauss.hpp" diff --git a/dynamics/src/include/BBMDynamicsKernel.hpp b/dynamics/src/include/BBMDynamicsKernel.hpp index 2ed1246d4..92f55f4dc 100644 --- a/dynamics/src/include/BBMDynamicsKernel.hpp +++ b/dynamics/src/include/BBMDynamicsKernel.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Piotr Minakowski -*/ + */ #ifndef BBMDYNAMICSKERNEL_HPP #define BBMDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/BBMParameters.hpp b/dynamics/src/include/BBMParameters.hpp index 35a12450f..7736ad700 100644 --- a/dynamics/src/include/BBMParameters.hpp +++ b/dynamics/src/include/BBMParameters.hpp @@ -1,7 +1,7 @@ /*! * @author Tim Spain * @author Piotr Minakowski -*/ + */ #ifndef __MEBPARAMETERS_HPP #define __MEBPARAMETERS_HPP diff --git a/dynamics/src/include/BBMStressUpdateStep.hpp b/dynamics/src/include/BBMStressUpdateStep.hpp index e384a4137..4f296c009 100644 --- a/dynamics/src/include/BBMStressUpdateStep.hpp +++ b/dynamics/src/include/BBMStressUpdateStep.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef BBMSTRESSUPDATESTEP_HPP #define BBMSTRESSUPDATESTEP_HPP diff --git a/dynamics/src/include/BrittleCGDynamicsKernel.hpp b/dynamics/src/include/BrittleCGDynamicsKernel.hpp index d0a66d12d..848ed71b5 100644 --- a/dynamics/src/include/BrittleCGDynamicsKernel.hpp +++ b/dynamics/src/include/BrittleCGDynamicsKernel.hpp @@ -1,9 +1,8 @@ /*! - * * @author Tim Spain * @author Einar Ólason * @author Robert Jendersie -*/ + */ #ifndef BRITTLECGDYNAMICSKERNEL_HPP #define BRITTLECGDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/CGDynamicsKernel.hpp b/dynamics/src/include/CGDynamicsKernel.hpp index a56a95474..eb05817d2 100644 --- a/dynamics/src/include/CGDynamicsKernel.hpp +++ b/dynamics/src/include/CGDynamicsKernel.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Robert Jendersie -*/ + */ #ifndef CGDYNAMICSKERNEL_HPP #define CGDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/CGModelArray.hpp b/dynamics/src/include/CGModelArray.hpp index 38ae24826..c5ce4579d 100644 --- a/dynamics/src/include/CGModelArray.hpp +++ b/dynamics/src/include/CGModelArray.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CGMODELARRAY_HPP #define CGMODELARRAY_HPP diff --git a/dynamics/src/include/CheckPoints.hpp b/dynamics/src/include/CheckPoints.hpp index 4b30f66f4..f75d60568 100644 --- a/dynamics/src/include/CheckPoints.hpp +++ b/dynamics/src/include/CheckPoints.hpp @@ -1,6 +1,6 @@ /*! * @author Piotr Minakowski -*/ + */ #ifndef __CHECKPOINTS_HPP #define __CHECKPOINTS_HPP diff --git a/dynamics/src/include/DGModelArray.hpp b/dynamics/src/include/DGModelArray.hpp index e213c1f46..127f17d21 100644 --- a/dynamics/src/include/DGModelArray.hpp +++ b/dynamics/src/include/DGModelArray.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef DGMODELARRAY_HPP #define DGMODELARRAY_HPP diff --git a/dynamics/src/include/DGTransport.hpp b/dynamics/src/include/DGTransport.hpp index 5a966782c..925bbc084 100644 --- a/dynamics/src/include/DGTransport.hpp +++ b/dynamics/src/include/DGTransport.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __DGTRANSPORT_HPP #define __DGTRANSPORT_HPP diff --git a/dynamics/src/include/DummyDynamicsKernel.hpp b/dynamics/src/include/DummyDynamicsKernel.hpp index 67518f95b..03836e9dd 100644 --- a/dynamics/src/include/DummyDynamicsKernel.hpp +++ b/dynamics/src/include/DummyDynamicsKernel.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Piotr Minakowski -*/ + */ #ifndef DUMMYDYNAMICSKERNEL_HPP #define DUMMYDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/DynamicsKernel.hpp b/dynamics/src/include/DynamicsKernel.hpp index ce480646c..fbc2de01f 100644 --- a/dynamics/src/include/DynamicsKernel.hpp +++ b/dynamics/src/include/DynamicsKernel.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef DYNAMICSKERNEL_HPP #define DYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/DynamicsParameters.hpp b/dynamics/src/include/DynamicsParameters.hpp index dcb07fc49..62cf4cc59 100644 --- a/dynamics/src/include/DynamicsParameters.hpp +++ b/dynamics/src/include/DynamicsParameters.hpp @@ -1,9 +1,7 @@ /*! - * * @author Tim Spain * @author Thomas Richter - * -*/ + */ #ifndef DYNAMICSPARAMETERS_HPP #define DYNAMICSPARAMETERS_HPP diff --git a/dynamics/src/include/FreeDriftDynamicsKernel.hpp b/dynamics/src/include/FreeDriftDynamicsKernel.hpp index dbfcc57ab..85d845d69 100644 --- a/dynamics/src/include/FreeDriftDynamicsKernel.hpp +++ b/dynamics/src/include/FreeDriftDynamicsKernel.hpp @@ -1,12 +1,10 @@ /*! - * * Implementation of "classic free drift", where we ignore all \rho h terms in the momentum * equation. This is equivalent to assuming that the ice is very thin. - * * @author Tim Spain * @author Einar Ólason * @author Robert Jendersie -*/ + */ #ifndef FREEDRIFTDYNAMICSKERNEL_HPP #define FREEDRIFTDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/IDynamicsUpdate.hpp b/dynamics/src/include/IDynamicsUpdate.hpp index c32a44dd1..ebb1364f0 100644 --- a/dynamics/src/include/IDynamicsUpdate.hpp +++ b/dynamics/src/include/IDynamicsUpdate.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef IDYNAMICSUPDATE_HPP #define IDYNAMICSUPDATE_HPP diff --git a/dynamics/src/include/Interpolations.hpp b/dynamics/src/include/Interpolations.hpp index 1ad444781..0794c7c5f 100644 --- a/dynamics/src/include/Interpolations.hpp +++ b/dynamics/src/include/Interpolations.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __INTERPOLATIONS_HPP #define __INTERPOLATIONS_HPP diff --git a/dynamics/src/include/MEVPDynamicsKernel.hpp b/dynamics/src/include/MEVPDynamicsKernel.hpp index 941f83a98..10ddea862 100644 --- a/dynamics/src/include/MEVPDynamicsKernel.hpp +++ b/dynamics/src/include/MEVPDynamicsKernel.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Piotr Minakowski -*/ + */ #ifndef MEVPDYNAMICSKERNEL_HPP #define MEVPDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/MEVPStressUpdateStep.hpp b/dynamics/src/include/MEVPStressUpdateStep.hpp index 5f088d7ad..dcbd3f017 100644 --- a/dynamics/src/include/MEVPStressUpdateStep.hpp +++ b/dynamics/src/include/MEVPStressUpdateStep.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef MEVPSTRESSUPDATESTEP_HPP #define MEVPSTRESSUPDATESTEP_HPP diff --git a/dynamics/src/include/NextsimDynamics.hpp b/dynamics/src/include/NextsimDynamics.hpp index 12b8db5d8..2a32d5273 100644 --- a/dynamics/src/include/NextsimDynamics.hpp +++ b/dynamics/src/include/NextsimDynamics.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __NEXTSIMDYNAMICS_HPP #define __NEXTSIMDYNAMICS_HPP diff --git a/dynamics/src/include/ParametricMap.hpp b/dynamics/src/include/ParametricMap.hpp index f15a7b54f..f0351fd01 100644 --- a/dynamics/src/include/ParametricMap.hpp +++ b/dynamics/src/include/ParametricMap.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __PARAMETRICMAP_HPP #define __PARAMETRICMAP_HPP diff --git a/dynamics/src/include/ParametricMesh.hpp b/dynamics/src/include/ParametricMesh.hpp index 73575ad55..0cb06dc69 100644 --- a/dynamics/src/include/ParametricMesh.hpp +++ b/dynamics/src/include/ParametricMesh.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __PARAMETRICMESH_HPP #define __PARAMETRICMESH_HPP diff --git a/dynamics/src/include/ParametricTools.hpp b/dynamics/src/include/ParametricTools.hpp index 761e58df4..cb60cee42 100644 --- a/dynamics/src/include/ParametricTools.hpp +++ b/dynamics/src/include/ParametricTools.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __PARAMETRICTOOLS_HPP #define __PARAMETRICTOOLS_HPP diff --git a/dynamics/src/include/StressUpdateStep.hpp b/dynamics/src/include/StressUpdateStep.hpp index 9553ed4c4..0d14579be 100644 --- a/dynamics/src/include/StressUpdateStep.hpp +++ b/dynamics/src/include/StressUpdateStep.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef STRESSUPDATESTEP_HPP #define STRESSUPDATESTEP_HPP diff --git a/dynamics/src/include/Tools.hpp b/dynamics/src/include/Tools.hpp index b2a737b29..51049c2c0 100644 --- a/dynamics/src/include/Tools.hpp +++ b/dynamics/src/include/Tools.hpp @@ -1,6 +1,6 @@ /*! * @author Piotr Minakowski -*/ + */ #ifndef __TOOLS_HPP #define __TOOLS_HPP diff --git a/dynamics/src/include/VPCGDynamicsKernel.hpp b/dynamics/src/include/VPCGDynamicsKernel.hpp index ca67def6b..89b0bfe08 100644 --- a/dynamics/src/include/VPCGDynamicsKernel.hpp +++ b/dynamics/src/include/VPCGDynamicsKernel.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Robert Jendersie -*/ + */ #ifndef VPCGDYNAMICSKERNEL_HPP #define VPCGDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/VPParameters.hpp b/dynamics/src/include/VPParameters.hpp index 36d9c04e4..07e190680 100644 --- a/dynamics/src/include/VPParameters.hpp +++ b/dynamics/src/include/VPParameters.hpp @@ -1,7 +1,7 @@ /*! * @author Tim Spain * @author Thomas Richter -*/ + */ #ifndef __VPPARAMETERS_HPP #define __VPPARAMETERS_HPP diff --git a/dynamics/src/include/VectorManipulations.hpp b/dynamics/src/include/VectorManipulations.hpp index 3bfee9e1b..c1801c6f6 100644 --- a/dynamics/src/include/VectorManipulations.hpp +++ b/dynamics/src/include/VectorManipulations.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __VECTORMANIPULATIONS_HPP #define __VECTORMANIPULATIONS_HPP diff --git a/dynamics/src/include/cgVector.hpp b/dynamics/src/include/cgVector.hpp index e0f83c377..21efbc57d 100644 --- a/dynamics/src/include/cgVector.hpp +++ b/dynamics/src/include/cgVector.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __CGVECTOR_HPP #define __CGVECTOR_HPP diff --git a/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp b/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp index ffadd0312..69f0c0fbe 100644 --- a/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp +++ b/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __BASISFUNCTIONSGUASSPOINTS_HPP #define __BASISFUNCTIONSGUASSPOINTS_HPP diff --git a/dynamics/src/include/dgInitial.hpp b/dynamics/src/include/dgInitial.hpp index b7474e235..927418511 100644 --- a/dynamics/src/include/dgInitial.hpp +++ b/dynamics/src/include/dgInitial.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __DGINITIAL_HPP #define __DGINITIAL_HPP diff --git a/dynamics/src/include/dgLimit.hpp b/dynamics/src/include/dgLimit.hpp index dde93533b..1f615cd6e 100644 --- a/dynamics/src/include/dgLimit.hpp +++ b/dynamics/src/include/dgLimit.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __DGLIMIT_HPP #define __DGLIMIT_HPP diff --git a/dynamics/src/include/dgLimiters.hpp b/dynamics/src/include/dgLimiters.hpp index 2a162197c..4dc222927 100644 --- a/dynamics/src/include/dgLimiters.hpp +++ b/dynamics/src/include/dgLimiters.hpp @@ -1,6 +1,6 @@ /*! * @author Piotr Minakowski -*/ + */ #ifndef __LIMITERS_HPP #define __LIMITERS_HPP diff --git a/dynamics/src/include/dgVector.hpp b/dynamics/src/include/dgVector.hpp index 0927003e5..f0bd85cc5 100644 --- a/dynamics/src/include/dgVector.hpp +++ b/dynamics/src/include/dgVector.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __DGVECTOR_HPP #define __DGVECTOR_HPP diff --git a/dynamics/src/include/dgVectorHolder.hpp b/dynamics/src/include/dgVectorHolder.hpp index e696b7f1d..f6613be4d 100644 --- a/dynamics/src/include/dgVectorHolder.hpp +++ b/dynamics/src/include/dgVectorHolder.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef DGVECTORHOLDER_HPP #define DGVECTORHOLDER_HPP diff --git a/dynamics/src/include/dgVisu.hpp b/dynamics/src/include/dgVisu.hpp index e630e25df..f360cd9c1 100644 --- a/dynamics/src/include/dgVisu.hpp +++ b/dynamics/src/include/dgVisu.hpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #ifndef __DGVISU_HPP #define __DGVISU_HPP diff --git a/dynamics/test/AdvectionPeriodicBC_test.cpp b/dynamics/test/AdvectionPeriodicBC_test.cpp index c36b1e480..65aaac228 100644 --- a/dynamics/test/AdvectionPeriodicBC_test.cpp +++ b/dynamics/test/AdvectionPeriodicBC_test.cpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/Advection_test.cpp b/dynamics/test/Advection_test.cpp index 4d17ddbbf..35ec240a6 100644 --- a/dynamics/test/Advection_test.cpp +++ b/dynamics/test/Advection_test.cpp @@ -1,6 +1,6 @@ /*! * @author Thomas Richter -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/CGModelArray_test.cpp b/dynamics/test/CGModelArray_test.cpp index a02ce70c5..712646633 100644 --- a/dynamics/test/CGModelArray_test.cpp +++ b/dynamics/test/CGModelArray_test.cpp @@ -1,10 +1,8 @@ /*! - * * @brief Test that the functions to convert from the dynamics code CGVector * to and from ModelArray function correctly. - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/DGModelArray_test.cpp b/dynamics/test/DGModelArray_test.cpp index 830f56107..33e3f0274 100644 --- a/dynamics/test/DGModelArray_test.cpp +++ b/dynamics/test/DGModelArray_test.cpp @@ -1,10 +1,8 @@ /*! - * * @brief Test that the functions to convert from the dynamics code DGVector * to and from ModelArray function correctly. - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/FakeSmeshData.cpp b/dynamics/test/FakeSmeshData.cpp index 83a07b51c..9583601b0 100644 --- a/dynamics/test/FakeSmeshData.cpp +++ b/dynamics/test/FakeSmeshData.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "../test/FakeSmeshData.hpp" diff --git a/dynamics/test/FakeSmeshData.hpp b/dynamics/test/FakeSmeshData.hpp index 04d1ec7d3..e2fdd308c 100644 --- a/dynamics/test/FakeSmeshData.hpp +++ b/dynamics/test/FakeSmeshData.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef FAKESMESHDATA_HPP #define FAKESMESHDATA_HPP diff --git a/dynamics/test/ParametricMeshArea_test.cpp b/dynamics/test/ParametricMeshArea_test.cpp index a60365088..0e72466a2 100644 --- a/dynamics/test/ParametricMeshArea_test.cpp +++ b/dynamics/test/ParametricMeshArea_test.cpp @@ -1,9 +1,7 @@ /*! - * * @brief Test the ParametricMesh class, especially processing from ModelArray files. - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/ParametricMesh_test.cpp b/dynamics/test/ParametricMesh_test.cpp index 3a3f43a2c..f51af184d 100644 --- a/dynamics/test/ParametricMesh_test.cpp +++ b/dynamics/test/ParametricMesh_test.cpp @@ -1,9 +1,7 @@ /*! - * * @brief Test the ParametricMesh class, especially processing from ModelArray files. - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/dynamics/test/dgVectorHolder_test.cpp b/dynamics/test/dgVectorHolder_test.cpp index 0aec461f5..60d698b1a 100644 --- a/dynamics/test/dgVectorHolder_test.cpp +++ b/dynamics/test/dgVectorHolder_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/src/BenchmarkCoordinates.cpp b/physics/src/BenchmarkCoordinates.cpp index 9f1a63ede..78ea9f8d5 100644 --- a/physics/src/BenchmarkCoordinates.cpp +++ b/physics/src/BenchmarkCoordinates.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/BenchmarkCoordinates.hpp" diff --git a/physics/src/IceGrowth.cpp b/physics/src/IceGrowth.cpp index 16b5d2ded..5bd651f6a 100644 --- a/physics/src/IceGrowth.cpp +++ b/physics/src/IceGrowth.cpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Einar Ólason -*/ + */ #include "include/IceGrowth.hpp" diff --git a/physics/src/IceMinima.cpp b/physics/src/IceMinima.cpp index 8f8c38baf..c6923b65c 100644 --- a/physics/src/IceMinima.cpp +++ b/physics/src/IceMinima.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/IceMinima.hpp" diff --git a/physics/src/SlabOcean.cpp b/physics/src/SlabOcean.cpp index 5e70d56e0..e7a86be7b 100644 --- a/physics/src/SlabOcean.cpp +++ b/physics/src/SlabOcean.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/SlabOcean.hpp" diff --git a/physics/src/include/BenchmarkCoordinates.hpp b/physics/src/include/BenchmarkCoordinates.hpp index eaef7ff8d..f2ae56db4 100644 --- a/physics/src/include/BenchmarkCoordinates.hpp +++ b/physics/src/include/BenchmarkCoordinates.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef BENCHMARKCOORDINATES_HPP #define BENCHMARKCOORDINATES_HPP diff --git a/physics/src/include/IceGrowth.hpp b/physics/src/include/IceGrowth.hpp index 5d993996d..32f5ac767 100644 --- a/physics/src/include/IceGrowth.hpp +++ b/physics/src/include/IceGrowth.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Einar Ólason -*/ + */ #ifndef ICEGROWTH_HPP #define ICEGROWTH_HPP diff --git a/physics/src/include/IceMinima.hpp b/physics/src/include/IceMinima.hpp index 2537a10cf..f64d1a24e 100644 --- a/physics/src/include/IceMinima.hpp +++ b/physics/src/include/IceMinima.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef ICEMINIMA_HPP #define ICEMINIMA_HPP diff --git a/physics/src/include/SlabOcean.hpp b/physics/src/include/SlabOcean.hpp index 67b2ea493..a5041f2a0 100644 --- a/physics/src/include/SlabOcean.hpp +++ b/physics/src/include/SlabOcean.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef SLABOCEAN_HPP #define SLABOCEAN_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp index 62c76f43a..27ec9879c 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/BenchmarkAtmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp index 8e574acd5..edd93917e 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ConfiguredAtmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp b/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp index ceba8b34b..86a4c04c3 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ConstantAtmosphereBoundary.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp index 72965b3be..1eb49dd34 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ERA5Atmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp index a0318fd82..ca76c7cfc 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/FluxConfiguredAtmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp index 247f9119c..35a16aa50 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef BENCHMARKATMOSPHERE_HPP #define BENCHMARKATMOSPHERE_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp index c06a2a42d..fe2f35ddb 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CONFIGUREDATMOSPHERE_HPP #define CONFIGUREDATMOSPHERE_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp index 672ac6594..39eee2d45 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CONSTANTATMOSPHEREBOUNDARY_HPP #define CONSTANTATMOSPHEREBOUNDARY_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp index 6b96d91ae..2bd5fb000 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef ERA5ATMOSPHERE_HPP #define ERA5ATMOSPHERE_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp index 8e7e9bf54..c0fe55b6e 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef FLUXCONFIGUREDATMOSPHERE_HPP #define FLUXCONFIGUREDATMOSPHERE_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/MU71Atmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/MU71Atmosphere.hpp index ffa2a11dd..ff3467b55 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/MU71Atmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/MU71Atmosphere.hpp @@ -16,7 +16,7 @@ namespace Nextsim { /*! * @brief The implementation class for the a seasonal atmospheric fluxes following Maykut and * Untersteiener's (1971) table 1. Only useful for comparison with that paper and derived setups. -*/ + */ class MU71Atmosphere : public IAtmosphereBoundary, public Configured { public: diff --git a/physics/src/modules/DamageHealingModule/ConstantHealing.cpp b/physics/src/modules/DamageHealingModule/ConstantHealing.cpp index 3ce50ce83..771f918f0 100644 --- a/physics/src/modules/DamageHealingModule/ConstantHealing.cpp +++ b/physics/src/modules/DamageHealingModule/ConstantHealing.cpp @@ -1,7 +1,6 @@ /*! - * * @author Einar Ólason -*/ + */ #include "include/ConstantHealing.hpp" diff --git a/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp b/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp index 95615ce2a..2ba7ac41e 100644 --- a/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp +++ b/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp @@ -1,7 +1,6 @@ /*! - * * @author Einar Ólason -*/ + */ #ifndef CONSTANTHEALING_HPP #define CONSTANTHEALING_HPP diff --git a/physics/src/modules/DamageHealingModule/include/NoHealing.hpp b/physics/src/modules/DamageHealingModule/include/NoHealing.hpp index 37cda16dc..6451c3b88 100644 --- a/physics/src/modules/DamageHealingModule/include/NoHealing.hpp +++ b/physics/src/modules/DamageHealingModule/include/NoHealing.hpp @@ -1,9 +1,7 @@ /*! - * * This class has no corresponding implementation, just this header file - * * @author Einar Ólason -*/ + */ #ifndef NOHEALING_HPP #define NOHEALING_HPP diff --git a/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp b/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp index 470b80bf9..bf188c630 100644 --- a/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp +++ b/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/FiniteElementFluxes.hpp" diff --git a/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp b/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp index 5b23eea8d..79562172c 100644 --- a/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp +++ b/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef FINITEELEMENTFLUXES_HPP #define FINITEELEMENTFLUXES_HPP diff --git a/physics/src/modules/FluxCalculationModule/include/ISpecificHumidity.hpp b/physics/src/modules/FluxCalculationModule/include/ISpecificHumidity.hpp index a069cb9e3..91a1f8ab4 100644 --- a/physics/src/modules/FluxCalculationModule/include/ISpecificHumidity.hpp +++ b/physics/src/modules/FluxCalculationModule/include/ISpecificHumidity.hpp @@ -21,7 +21,7 @@ class ISpecificHumidity { * * @param temperature Temperature of the water vapour [˚C] * @param pressure Hydrostatic pressure [Pa] -*/ + */ virtual double operator()(double temperature, double pressure) const = 0; /*! * @brief Calculates humidity over sea water. diff --git a/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp b/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp index ae4734bc7..c455caacb 100644 --- a/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/CCSMIceAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp b/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp index ea904974d..55ed47d65 100644 --- a/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp +++ b/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp @@ -1,7 +1,6 @@ /*! - * * @author Einar Örn Ólason -*/ + */ #include "include/MU71Albedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp b/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp index c18242e26..a392b82e9 100644 --- a/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/SMU2IceAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp b/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp index 647406a01..9aaa57124 100644 --- a/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/SMUIceAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp b/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp index b92bdf9f8..0ebf29c5a 100644 --- a/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Einar Ólason -*/ + */ #include "include/WintonAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp index 2b2d6ea2e..e41188bde 100644 --- a/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CCSMICEALBEDO_HPP #define CCSMICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp b/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp index 1b520dde6..da2c6e4ec 100644 --- a/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp @@ -1,7 +1,6 @@ /*! - * * @author Einar Örn Ólason -*/ + */ #ifndef SEASONALICEALBEDO_HPP #define SEASONALICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp index 9f5bad996..552d1da86 100644 --- a/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef SRC_INCLUDE_SMU2ICEALBEDO_HPP #define SRC_INCLUDE_SMU2ICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp index dd59eaa72..3ecde0236 100644 --- a/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef SRC_INCLUDE_SMUICEALBEDO_HPP #define SRC_INCLUDE_SMUICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp index fa296da87..f3c8c118a 100644 --- a/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Einar Ólason -*/ + */ #ifndef WINTONALBEDO_HPP #define WINTONALBEDO_HPP diff --git a/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp b/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp index e72f0e7da..22fa56fb7 100644 --- a/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp +++ b/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/BasicIceOceanHeatFlux.hpp" diff --git a/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp b/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp index 03dbbbf33..d6da51d57 100644 --- a/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp +++ b/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef BASICICEOCEANHEATFLUX_HPP #define BASICICEOCEANHEATFLUX_HPP diff --git a/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp b/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp index 488304b4a..b9252a101 100644 --- a/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp +++ b/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ThermoIce0.hpp" diff --git a/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp b/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp index fe900d841..597c1c2a0 100644 --- a/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp +++ b/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/Slice.hpp" #include "include/ThermoWinton.hpp" diff --git a/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp b/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp index ad339028c..281a59f4b 100644 --- a/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp +++ b/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef DUMMYICETHERMODYNAMICS_HPP #define DUMMYICETHERMODYNAMICS_HPP diff --git a/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp b/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp index a99d18c52..9d9093bc8 100644 --- a/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp +++ b/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef THERMOICE0HPP #define THERMOICE0HPP diff --git a/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp b/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp index 13529d676..4362a404e 100644 --- a/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp +++ b/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef THERMOWINTON_HPP #define THERMOWINTON_HPP diff --git a/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp b/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp index f7c16a345..e27af8001 100644 --- a/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp +++ b/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/HiblerSpread.hpp" diff --git a/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp b/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp index 25d1639b7..0ebe23792 100644 --- a/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp +++ b/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef DUMMYICESPREAD_HPP #define DUMMYICESPREAD_HPP diff --git a/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp b/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp index 4b7018459..98750138d 100644 --- a/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp +++ b/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef HIBLERSPREAD_HPP #define HIBLERSPREAD_HPP diff --git a/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp b/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp index 8883b9455..7f30892a1 100644 --- a/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/BenchmarkOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp b/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp index 1d58226a4..d05b0b1f6 100644 --- a/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ConfiguredOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp b/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp index 09395171c..5141bba93 100644 --- a/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp +++ b/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ConstantOceanBoundary.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp b/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp index b645bc94b..49c10885f 100644 --- a/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/FluxConfiguredOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp b/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp index 47a459514..a11dec3ea 100644 --- a/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/TOPAZOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp b/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp index 0a8d88e96..a101f1281 100644 --- a/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/UniformOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp index f46e6b517..72e429849 100644 --- a/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef BENCHMARKOCEAN_HPP #define BENCHMARKOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp index 81f28776a..ab062adbc 100644 --- a/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CONFIGUREDOCEAN_HPP #define CONFIGUREDOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp b/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp index 3b2059468..d6e3244b9 100644 --- a/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef CONSTANTOCEANBOUNDARY_HPP #define CONSTANTOCEANBOUNDARY_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp index 1bd372589..6f5ae9a7b 100644 --- a/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef FLUXCONFIGUREDOCEAN_HPP #define FLUXCONFIGUREDOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp index 3f3a00002..4c3fc4695 100644 --- a/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef TOPAZOCEAN_HPP #define TOPAZOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp index 50f136afe..4f77d805d 100644 --- a/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef UNIFORMOCEAN_HPP #define UNIFORMOCEAN_HPP diff --git a/physics/src/modules/include/IAtmosphereBoundary.hpp b/physics/src/modules/include/IAtmosphereBoundary.hpp index 4c0547de9..2378d3a8c 100644 --- a/physics/src/modules/include/IAtmosphereBoundary.hpp +++ b/physics/src/modules/include/IAtmosphereBoundary.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #include "include/ModelArrayRef.hpp" #include "include/ModelComponent.hpp" diff --git a/physics/src/modules/include/IDamageHealing.hpp b/physics/src/modules/include/IDamageHealing.hpp index 97e1fb437..5b91eed4e 100644 --- a/physics/src/modules/include/IDamageHealing.hpp +++ b/physics/src/modules/include/IDamageHealing.hpp @@ -1,7 +1,6 @@ /*! - * * @author Einar Ólason -*/ + */ #ifndef IDAMAGEHEALING_HPP #define IDAMAGEHEALING_HPP diff --git a/physics/src/modules/include/IFluxCalculation.hpp b/physics/src/modules/include/IFluxCalculation.hpp index 240b1a28c..4de1761b2 100644 --- a/physics/src/modules/include/IFluxCalculation.hpp +++ b/physics/src/modules/include/IFluxCalculation.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef IFLUXCALCULATION_HPP #define IFLUXCALCULATION_HPP diff --git a/physics/src/modules/include/IIceAlbedo.hpp b/physics/src/modules/include/IIceAlbedo.hpp index 80e420c0c..a1016677b 100644 --- a/physics/src/modules/include/IIceAlbedo.hpp +++ b/physics/src/modules/include/IIceAlbedo.hpp @@ -25,7 +25,7 @@ class IIceAlbedo { * @param snowThickness The true snow thickness on top of the ice. * @param i0 The fraction of short-wave radiation that can penetrate bare ice (not taking snow * cover into account). -*/ + */ virtual std::tuple surfaceShortWaveBalance( double temperature, double snowThickness, double i0) = 0; diff --git a/physics/src/modules/include/IIceOceanHeatFlux.hpp b/physics/src/modules/include/IIceOceanHeatFlux.hpp index eadb9d2a6..25db02256 100644 --- a/physics/src/modules/include/IIceOceanHeatFlux.hpp +++ b/physics/src/modules/include/IIceOceanHeatFlux.hpp @@ -35,7 +35,7 @@ class IIceOceanHeatFlux : public ModelComponent { * Updates the ice ocean heat flux calculation for the timestep. * * @param tStep The object containing the timestep start and duration times. -*/ + */ virtual void update(const TimestepTime&) = 0; protected: diff --git a/physics/src/modules/include/IIceThermodynamics.hpp b/physics/src/modules/include/IIceThermodynamics.hpp index c5a06ca48..1bc798a04 100644 --- a/physics/src/modules/include/IIceThermodynamics.hpp +++ b/physics/src/modules/include/IIceThermodynamics.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef IICETHERMODYNAMICS_HPP #define IICETHERMODYNAMICS_HPP diff --git a/physics/src/modules/include/ILateralIceSpread.hpp b/physics/src/modules/include/ILateralIceSpread.hpp index 315132b9b..e6f01f6c9 100644 --- a/physics/src/modules/include/ILateralIceSpread.hpp +++ b/physics/src/modules/include/ILateralIceSpread.hpp @@ -1,8 +1,7 @@ /*! - * * @author Tim Spain * @author Einar Ólason -*/ + */ #ifndef ILATERALICESPREAD_HPP #define ILATERALICESPREAD_HPP diff --git a/physics/src/modules/include/IOceanBoundary.hpp b/physics/src/modules/include/IOceanBoundary.hpp index 7611f2a70..23e5e9985 100644 --- a/physics/src/modules/include/IOceanBoundary.hpp +++ b/physics/src/modules/include/IOceanBoundary.hpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #ifndef IOCEANBOUNDARY_HPP #define IOCEANBOUNDARY_HPP diff --git a/physics/test/BasicIceOceanFlux_test.cpp b/physics/test/BasicIceOceanFlux_test.cpp index b6ec9163d..b1fccdf34 100644 --- a/physics/test/BasicIceOceanFlux_test.cpp +++ b/physics/test/BasicIceOceanFlux_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ // Does this class need testing? Not really, but it got removed from // FiniteElementFluxes_test and I thought the tests should continue to exist diff --git a/physics/test/BenchmarkBoundaries_test.cpp b/physics/test/BenchmarkBoundaries_test.cpp index 29fbe44f1..5cd286ac3 100644 --- a/physics/test/BenchmarkBoundaries_test.cpp +++ b/physics/test/BenchmarkBoundaries_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/ConstantOceanBoundary_test.cpp b/physics/test/ConstantOceanBoundary_test.cpp index 311633c08..ba5dd4618 100644 --- a/physics/test/ConstantOceanBoundary_test.cpp +++ b/physics/test/ConstantOceanBoundary_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/DamageHealing_test.cpp b/physics/test/DamageHealing_test.cpp index fb7af4e8d..3e92c54f8 100644 --- a/physics/test/DamageHealing_test.cpp +++ b/physics/test/DamageHealing_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Einar Ólason -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/ERA5Atm_test.cpp b/physics/test/ERA5Atm_test.cpp index 55ccbf8ae..0ed8523c8 100644 --- a/physics/test/ERA5Atm_test.cpp +++ b/physics/test/ERA5Atm_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/FiniteElementFluxes_test.cpp b/physics/test/FiniteElementFluxes_test.cpp index 64de18b38..de8f949ad 100644 --- a/physics/test/FiniteElementFluxes_test.cpp +++ b/physics/test/FiniteElementFluxes_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/IceGrowth_test.cpp b/physics/test/IceGrowth_test.cpp index 60e443ca9..5055997b3 100644 --- a/physics/test/IceGrowth_test.cpp +++ b/physics/test/IceGrowth_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/IceMinima_test.cpp b/physics/test/IceMinima_test.cpp index 7a2cb7bf6..59bf5e481 100644 --- a/physics/test/IceMinima_test.cpp +++ b/physics/test/IceMinima_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/SlabOcean_test.cpp b/physics/test/SlabOcean_test.cpp index b3d48a774..b60767ffc 100644 --- a/physics/test/SlabOcean_test.cpp +++ b/physics/test/SlabOcean_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/TOPAZOcn_test.cpp b/physics/test/TOPAZOcn_test.cpp index 32e2ad837..3acb1cba1 100644 --- a/physics/test/TOPAZOcn_test.cpp +++ b/physics/test/TOPAZOcn_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/ThermoIce0Temperature_test.cpp b/physics/test/ThermoIce0Temperature_test.cpp index 4efd5e445..544cdaa56 100644 --- a/physics/test/ThermoIce0Temperature_test.cpp +++ b/physics/test/ThermoIce0Temperature_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/ThermoIce0_test.cpp b/physics/test/ThermoIce0_test.cpp index d185b22d3..a589018e0 100644 --- a/physics/test/ThermoIce0_test.cpp +++ b/physics/test/ThermoIce0_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/ThermoWintonTemperature_test.cpp b/physics/test/ThermoWintonTemperature_test.cpp index 8c339f86e..910fd7bc4 100644 --- a/physics/test/ThermoWintonTemperature_test.cpp +++ b/physics/test/ThermoWintonTemperature_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include diff --git a/physics/test/UniformOcean_test.cpp b/physics/test/UniformOcean_test.cpp index 1130416b4..eb9a5f22a 100644 --- a/physics/test/UniformOcean_test.cpp +++ b/physics/test/UniformOcean_test.cpp @@ -1,7 +1,6 @@ /*! - * * @author Tim Spain -*/ + */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include From 5ea65d0e96d7e1ed0369083023203c7e721e0442 Mon Sep 17 00:00:00 2001 From: tommelt Date: Thu, 21 Aug 2025 14:45:47 +0100 Subject: [PATCH 33/53] test: author ensure 2 spaces --- core/src/CommandLineParser.cpp | 4 ++-- core/src/CommonRestartMetadata.cpp | 2 +- core/src/ConfigurationHelpPrinter.cpp | 2 +- core/src/Configurator.cpp | 2 +- core/src/ConfiguredModule.cpp | 2 +- core/src/DevStep.cpp | 2 +- core/src/FileCallbackCloser.cpp | 2 +- core/src/Finalizer.cpp | 2 +- core/src/Iterator.cpp | 2 +- core/src/Logged.cpp | 2 +- core/src/Model.cpp | 4 ++-- core/src/ModelArray.cpp | 2 +- core/src/ModelArraySlice.cpp | 2 +- core/src/ModelComponent.cpp | 2 +- core/src/ModelConfig.cpp | 2 +- core/src/ModelMPI.cpp | 2 +- core/src/ModelMetadata.cpp | 4 ++-- core/src/NetcdfMetadataConfiguration.cpp | 2 +- core/src/PDWriter.cpp | 2 +- core/src/ParaGridIO.cpp | 2 +- core/src/ParaGridIO_Xios.cpp | 4 ++-- core/src/PrognosticData.cpp | 4 ++-- core/src/RectGridIO.cpp | 4 ++-- core/src/StructureFactory.cpp | 4 ++-- core/src/Time.cpp | 2 +- core/src/discontinuousgalerkin/ModelArrayDetails.cpp | 2 +- .../src/discontinuousgalerkin/include/ModelArrayDetails.hpp | 2 +- .../discontinuousgalerkin/include/ModelArrayTypedefs.hpp | 2 +- core/src/finitevolume/ModelArrayDetails.cpp | 2 +- core/src/finitevolume/include/ModelArrayDetails.hpp | 2 +- core/src/finitevolume/include/ModelArrayTypedefs.hpp | 2 +- core/src/include/Chrono.hpp | 2 +- core/src/include/CommandLineParser.hpp | 2 +- core/src/include/CommonRestartMetadata.hpp | 2 +- core/src/include/ConfigMap.hpp | 2 +- core/src/include/ConfigurationHelp.hpp | 2 +- core/src/include/ConfigurationHelpPrinter.hpp | 2 +- core/src/include/Configurator.hpp | 2 +- core/src/include/Configured.hpp | 2 +- core/src/include/ConfiguredModule.hpp | 2 +- core/src/include/DevStep.hpp | 2 +- core/src/include/EnumWrapper.hpp | 2 +- core/src/include/FileCallbackCloser.hpp | 2 +- core/src/include/Finalizer.hpp | 2 +- core/src/include/Halo.hpp | 2 +- core/src/include/IModelStep.hpp | 2 +- core/src/include/Iterator.hpp | 2 +- core/src/include/Logged.hpp | 2 +- core/src/include/MissingData.hpp | 2 +- core/src/include/Model.hpp | 4 ++-- core/src/include/ModelArray.hpp | 2 +- core/src/include/ModelArrayRef.hpp | 2 +- core/src/include/ModelArrayReferenceStore.hpp | 2 +- core/src/include/ModelArraySlice.hpp | 2 +- core/src/include/ModelComponent.hpp | 4 ++-- core/src/include/ModelConfig.hpp | 2 +- core/src/include/ModelMPI.hpp | 2 +- core/src/include/ModelMetadata.hpp | 4 ++-- core/src/include/ModelState.hpp | 2 +- core/src/include/Module.hpp | 2 +- core/src/include/MonthlyCubicBSpline.hpp | 2 +- core/src/include/NetcdfMetadataConfiguration.hpp | 2 +- core/src/include/NextsimModule.hpp | 2 +- core/src/include/OutputSpec.hpp | 2 +- core/src/include/ParaGridIO.hpp | 2 +- core/src/include/PrognosticData.hpp | 2 +- core/src/include/RectGridIO.hpp | 4 ++-- core/src/include/Slice.hpp | 2 +- core/src/include/StructureFactory.hpp | 4 ++-- core/src/include/TextTag.hpp | 2 +- core/src/include/Time.hpp | 2 +- core/src/include/constants.hpp | 2 +- core/src/include/gridNames.hpp | 2 +- core/src/include/indexer.hpp | 2 +- core/src/main.cpp | 4 ++-- core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp | 2 +- core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp | 2 +- .../modules/DiagnosticOutputModule/include/ConfigOutput.hpp | 2 +- .../src/modules/DiagnosticOutputModule/include/NoOutput.hpp | 2 +- .../modules/DiagnosticOutputModule/include/SimpleOutput.hpp | 2 +- core/src/modules/DynamicsModule/BBMDynamics.cpp | 4 ++-- core/src/modules/DynamicsModule/MEVPDynamics.cpp | 6 +++--- core/src/modules/DynamicsModule/include/BBMDynamics.hpp | 2 +- core/src/modules/DynamicsModule/include/DummyDynamics.hpp | 2 +- .../modules/DynamicsModule/include/FreeDriftDynamics.hpp | 2 +- core/src/modules/DynamicsModule/include/MEVPDynamics.hpp | 6 +++--- .../modules/FreezingPointModule/include/LinearFreezing.hpp | 2 +- .../modules/FreezingPointModule/include/UnescoFreezing.hpp | 2 +- core/src/modules/StructureModule/ParametricGrid.cpp | 2 +- core/src/modules/StructureModule/RectangularGrid.cpp | 2 +- core/src/modules/StructureModule/include/ParametricGrid.hpp | 4 ++-- .../src/modules/StructureModule/include/RectangularGrid.hpp | 4 ++-- core/src/modules/include/IDiagnosticOutput.hpp | 2 +- core/src/modules/include/IDynamics.hpp | 2 +- core/src/modules/include/IFreezingPoint.hpp | 2 +- core/src/modules/include/IStructure.hpp | 4 ++-- core/test/ArgV.cpp | 2 +- core/test/ArgV.hpp | 2 +- core/test/CommandLineParser_test.cpp | 2 +- core/test/ConfigOutput_test.cpp | 2 +- core/test/Configurator_test.cpp | 2 +- core/test/DynamicsModuleForPDtest.cpp | 2 +- core/test/FileCallbackCloser_test.cpp | 2 +- core/test/Finalizer_test.cpp | 2 +- core/test/HaloExchangeCB_test.cpp | 2 +- core/test/HaloExchangePB_test.cpp | 2 +- core/test/Iterator_test.cpp | 2 +- core/test/Logged_test.cpp | 2 +- core/test/ModelArrayRefDebug_test.cpp | 2 +- core/test/ModelArrayRef_test.cpp | 2 +- core/test/ModelArraySlice_test.cpp | 2 +- core/test/ModelArray_test.cpp | 2 +- core/test/ModelComponent_test.cpp | 2 +- core/test/ModelMetadataCB_test.cpp | 2 +- core/test/ModelMetadataPB_test.cpp | 2 +- core/test/MonthlyCubicBSpline_test.cpp | 2 +- core/test/PDTestDynamics.hpp | 2 +- core/test/ParaGrid_test.cpp | 4 ++-- core/test/PrognosticDataIO_test.cpp | 2 +- core/test/PrognosticData_test.cpp | 2 +- core/test/RectGrid_test.cpp | 2 +- core/test/Slice_test.cpp | 2 +- core/test/Time_test.cpp | 2 +- core/test/testmodelarraydetails/ModelArrayDetails.cpp | 2 +- .../testmodelarraydetails/include/ModelArrayDetails.hpp | 2 +- .../testmodelarraydetails/include/ModelArrayTypedefs.hpp | 2 +- dynamics/src/CGDynamicsKernel.cpp | 4 ++-- dynamics/src/DGTransport.cpp | 2 +- dynamics/src/DummyDynamicsKernel.cpp | 2 +- dynamics/src/DynamicsKernel.cpp | 2 +- dynamics/src/MEVPStressUpdateStep.cpp | 2 +- dynamics/src/ParametricMap.cpp | 2 +- dynamics/src/ParametricMesh.cpp | 2 +- dynamics/src/ParametricTools.cpp | 2 +- dynamics/src/include/BBMDynamicsKernel.hpp | 4 ++-- dynamics/src/include/BBMParameters.hpp | 4 ++-- dynamics/src/include/BBMStressUpdateStep.hpp | 2 +- dynamics/src/include/BrittleCGDynamicsKernel.hpp | 6 +++--- dynamics/src/include/CGDynamicsKernel.hpp | 4 ++-- dynamics/src/include/CGModelArray.hpp | 2 +- dynamics/src/include/CheckPoints.hpp | 2 +- dynamics/src/include/DGModelArray.hpp | 2 +- dynamics/src/include/DummyDynamicsKernel.hpp | 4 ++-- dynamics/src/include/DynamicsKernel.hpp | 2 +- dynamics/src/include/DynamicsParameters.hpp | 4 ++-- dynamics/src/include/FreeDriftDynamicsKernel.hpp | 6 +++--- dynamics/src/include/IDynamicsUpdate.hpp | 2 +- dynamics/src/include/Interpolations.hpp | 2 +- dynamics/src/include/MEVPDynamicsKernel.hpp | 4 ++-- dynamics/src/include/MEVPStressUpdateStep.hpp | 2 +- dynamics/src/include/ParametricMesh.hpp | 2 +- dynamics/src/include/StressUpdateStep.hpp | 2 +- dynamics/src/include/Tools.hpp | 2 +- dynamics/src/include/VPCGDynamicsKernel.hpp | 4 ++-- dynamics/src/include/VPParameters.hpp | 4 ++-- dynamics/src/include/VectorManipulations.hpp | 2 +- dynamics/src/include/cgVector.hpp | 2 +- dynamics/src/include/dgBasisFunctionsGaussPoints.hpp | 2 +- dynamics/src/include/dgInitial.hpp | 2 +- dynamics/src/include/dgLimit.hpp | 2 +- dynamics/src/include/dgLimiters.hpp | 2 +- dynamics/src/include/dgVector.hpp | 2 +- dynamics/src/include/dgVectorHolder.hpp | 2 +- dynamics/src/include/dgVisu.hpp | 2 +- dynamics/test/AdvectionPeriodicBC_test.cpp | 2 +- dynamics/test/Advection_test.cpp | 2 +- dynamics/test/CGModelArray_test.cpp | 2 +- dynamics/test/DGModelArray_test.cpp | 2 +- dynamics/test/FakeSmeshData.cpp | 2 +- dynamics/test/FakeSmeshData.hpp | 2 +- dynamics/test/ParametricMeshArea_test.cpp | 2 +- dynamics/test/ParametricMesh_test.cpp | 2 +- dynamics/test/dgVectorHolder_test.cpp | 2 +- physics/src/BenchmarkCoordinates.cpp | 2 +- physics/src/IceGrowth.cpp | 4 ++-- physics/src/IceMinima.cpp | 2 +- physics/src/SlabOcean.cpp | 2 +- physics/src/include/BenchmarkCoordinates.hpp | 2 +- physics/src/include/IceGrowth.hpp | 4 ++-- physics/src/include/IceMinima.hpp | 2 +- physics/src/include/SlabOcean.hpp | 2 +- .../AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp | 2 +- .../AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp | 2 +- .../AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp | 2 +- .../src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp | 2 +- .../AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp | 2 +- .../include/BenchmarkAtmosphere.hpp | 2 +- .../include/ConfiguredAtmosphere.hpp | 2 +- .../include/ConstantAtmosphereBoundary.hpp | 2 +- .../AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp | 2 +- .../include/FluxConfiguredAtmosphere.hpp | 2 +- physics/src/modules/DamageHealingModule/ConstantHealing.cpp | 2 +- .../modules/DamageHealingModule/include/ConstantHealing.hpp | 2 +- .../src/modules/DamageHealingModule/include/NoHealing.hpp | 2 +- .../modules/FluxCalculationModule/FiniteElementFluxes.cpp | 2 +- .../FluxCalculationModule/include/FiniteElementFluxes.hpp | 2 +- physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp | 2 +- physics/src/modules/IceAlbedoModule/MU71Albedo.cpp | 2 +- physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp | 2 +- physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp | 2 +- physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp | 4 ++-- .../src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp | 2 +- physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp | 2 +- .../src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp | 2 +- .../src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp | 2 +- .../src/modules/IceAlbedoModule/include/WintonAlbedo.hpp | 4 ++-- .../IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp | 2 +- .../include/BasicIceOceanHeatFlux.hpp | 2 +- physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp | 2 +- .../src/modules/IceThermodynamicsModule/ThermoWinton.cpp | 2 +- .../include/DummyIceThermodynamics.hpp | 2 +- .../modules/IceThermodynamicsModule/include/ThermoIce0.hpp | 2 +- .../IceThermodynamicsModule/include/ThermoWinton.hpp | 2 +- physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp | 2 +- .../LateralIceSpreadModule/include/DummyIceSpread.hpp | 2 +- .../modules/LateralIceSpreadModule/include/HiblerSpread.hpp | 2 +- physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp | 2 +- physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp | 2 +- .../modules/OceanBoundaryModule/ConstantOceanBoundary.cpp | 2 +- .../src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp | 2 +- physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp | 2 +- physics/src/modules/OceanBoundaryModule/UniformOcean.cpp | 2 +- .../modules/OceanBoundaryModule/include/BenchmarkOcean.hpp | 2 +- .../modules/OceanBoundaryModule/include/ConfiguredOcean.hpp | 2 +- .../OceanBoundaryModule/include/ConstantOceanBoundary.hpp | 2 +- .../OceanBoundaryModule/include/FluxConfiguredOcean.hpp | 2 +- .../src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp | 2 +- .../modules/OceanBoundaryModule/include/UniformOcean.hpp | 2 +- physics/src/modules/include/IAtmosphereBoundary.hpp | 2 +- physics/src/modules/include/IDamageHealing.hpp | 2 +- physics/src/modules/include/IFluxCalculation.hpp | 2 +- physics/src/modules/include/IIceThermodynamics.hpp | 2 +- physics/src/modules/include/ILateralIceSpread.hpp | 4 ++-- physics/src/modules/include/IOceanBoundary.hpp | 2 +- physics/test/BasicIceOceanFlux_test.cpp | 2 +- physics/test/BenchmarkBoundaries_test.cpp | 2 +- physics/test/ConstantOceanBoundary_test.cpp | 2 +- physics/test/DamageHealing_test.cpp | 2 +- physics/test/ERA5Atm_test.cpp | 2 +- physics/test/FiniteElementFluxes_test.cpp | 2 +- physics/test/IceGrowth_test.cpp | 2 +- physics/test/IceMinima_test.cpp | 2 +- physics/test/SlabOcean_test.cpp | 2 +- physics/test/TOPAZOcn_test.cpp | 2 +- physics/test/ThermoIce0Temperature_test.cpp | 2 +- physics/test/ThermoIce0_test.cpp | 2 +- physics/test/ThermoWintonTemperature_test.cpp | 2 +- physics/test/UniformOcean_test.cpp | 2 +- 248 files changed, 288 insertions(+), 288 deletions(-) diff --git a/core/src/CommandLineParser.cpp b/core/src/CommandLineParser.cpp index da7b4f7f8..ca05fdd9d 100644 --- a/core/src/CommandLineParser.cpp +++ b/core/src/CommandLineParser.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Tim Williams + * @author Tim Spain + * @author Tim Williams */ #include "include/CommandLineParser.hpp" diff --git a/core/src/CommonRestartMetadata.cpp b/core/src/CommonRestartMetadata.cpp index 578762b93..be4011f20 100644 --- a/core/src/CommonRestartMetadata.cpp +++ b/core/src/CommonRestartMetadata.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/CommonRestartMetadata.hpp" diff --git a/core/src/ConfigurationHelpPrinter.cpp b/core/src/ConfigurationHelpPrinter.cpp index 4828cdb01..849321b5e 100644 --- a/core/src/ConfigurationHelpPrinter.cpp +++ b/core/src/ConfigurationHelpPrinter.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ConfigurationHelpPrinter.hpp" diff --git a/core/src/Configurator.cpp b/core/src/Configurator.cpp index ff55fef30..7c4b3f5fd 100644 --- a/core/src/Configurator.cpp +++ b/core/src/Configurator.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/Configurator.hpp" diff --git a/core/src/ConfiguredModule.cpp b/core/src/ConfiguredModule.cpp index 9b9dae567..57f52e369 100644 --- a/core/src/ConfiguredModule.cpp +++ b/core/src/ConfiguredModule.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ConfiguredModule.hpp" diff --git a/core/src/DevStep.cpp b/core/src/DevStep.cpp index 79e03cb15..04f692fb7 100644 --- a/core/src/DevStep.cpp +++ b/core/src/DevStep.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/DevStep.hpp" diff --git a/core/src/FileCallbackCloser.cpp b/core/src/FileCallbackCloser.cpp index 9ae1b930e..e7e02ac69 100644 --- a/core/src/FileCallbackCloser.cpp +++ b/core/src/FileCallbackCloser.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/FileCallbackCloser.hpp" diff --git a/core/src/Finalizer.cpp b/core/src/Finalizer.cpp index 0d12a2232..0c633228f 100644 --- a/core/src/Finalizer.cpp +++ b/core/src/Finalizer.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/Finalizer.hpp" diff --git a/core/src/Iterator.cpp b/core/src/Iterator.cpp index 67b279c6c..19e0bbc9b 100644 --- a/core/src/Iterator.cpp +++ b/core/src/Iterator.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/Iterator.hpp" diff --git a/core/src/Logged.cpp b/core/src/Logged.cpp index 7000368f1..37b212f95 100644 --- a/core/src/Logged.cpp +++ b/core/src/Logged.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/Logged.hpp" diff --git a/core/src/Model.cpp b/core/src/Model.cpp index 73075a73a..4d1eebc5f 100644 --- a/core/src/Model.cpp +++ b/core/src/Model.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Kacper Kornet + * @author Tim Spain + * @author Kacper Kornet */ #include "include/Model.hpp" diff --git a/core/src/ModelArray.cpp b/core/src/ModelArray.cpp index 4f6039b22..a3da1e2cc 100644 --- a/core/src/ModelArray.cpp +++ b/core/src/ModelArray.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ModelArray.hpp" diff --git a/core/src/ModelArraySlice.cpp b/core/src/ModelArraySlice.cpp index 40a2caacf..c8aaef4d1 100644 --- a/core/src/ModelArraySlice.cpp +++ b/core/src/ModelArraySlice.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ModelArraySlice.hpp" diff --git a/core/src/ModelComponent.cpp b/core/src/ModelComponent.cpp index 7efc7260b..f74081f19 100644 --- a/core/src/ModelComponent.cpp +++ b/core/src/ModelComponent.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ModelComponent.hpp" diff --git a/core/src/ModelConfig.cpp b/core/src/ModelConfig.cpp index a863d32dc..d3f0b7815 100644 --- a/core/src/ModelConfig.cpp +++ b/core/src/ModelConfig.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ModelConfig.hpp" diff --git a/core/src/ModelMPI.cpp b/core/src/ModelMPI.cpp index 346bcb4e0..ed5affc34 100644 --- a/core/src/ModelMPI.cpp +++ b/core/src/ModelMPI.cpp @@ -1,5 +1,5 @@ /*! - * @author Tom Meltzer + * @author Tom Meltzer */ #ifdef USE_MPI diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index ad0b675cf..868f74926 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Tom Meltzer + * @author Tim Spain + * @author Tom Meltzer */ #include "include/ModelMetadata.hpp" diff --git a/core/src/NetcdfMetadataConfiguration.cpp b/core/src/NetcdfMetadataConfiguration.cpp index 7bb2a2447..d91edc347 100644 --- a/core/src/NetcdfMetadataConfiguration.cpp +++ b/core/src/NetcdfMetadataConfiguration.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/NetcdfMetadataConfiguration.hpp" diff --git a/core/src/PDWriter.cpp b/core/src/PDWriter.cpp index 616c30f84..b0ca79708 100644 --- a/core/src/PDWriter.cpp +++ b/core/src/PDWriter.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/PrognosticData.hpp" diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index ec10d53bd..6b7570198 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ParaGridIO.hpp" diff --git a/core/src/ParaGridIO_Xios.cpp b/core/src/ParaGridIO_Xios.cpp index fc3ac9785..bc8df03ff 100644 --- a/core/src/ParaGridIO_Xios.cpp +++ b/core/src/ParaGridIO_Xios.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Joe Wallwork + * @author Tim Spain + * @author Joe Wallwork */ #include "include/ParaGridIO.hpp" diff --git a/core/src/PrognosticData.cpp b/core/src/PrognosticData.cpp index 1605d91f1..29bb4d976 100644 --- a/core/src/PrognosticData.cpp +++ b/core/src/PrognosticData.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Einar Ólason + * @author Tim Spain + * @author Einar Ólason */ #include "include/PrognosticData.hpp" diff --git a/core/src/RectGridIO.cpp b/core/src/RectGridIO.cpp index d96f58cb4..a61094fa9 100644 --- a/core/src/RectGridIO.cpp +++ b/core/src/RectGridIO.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Kacper Kornet + * @author Tim Spain + * @author Kacper Kornet */ #include "include/RectGridIO.hpp" diff --git a/core/src/StructureFactory.cpp b/core/src/StructureFactory.cpp index 5fd541384..3200a0dbd 100644 --- a/core/src/StructureFactory.cpp +++ b/core/src/StructureFactory.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Kacper Kornet + * @author Tim Spain + * @author Kacper Kornet */ #include "include/StructureFactory.hpp" diff --git a/core/src/Time.cpp b/core/src/Time.cpp index 90064c8e9..9fa6c7a67 100644 --- a/core/src/Time.cpp +++ b/core/src/Time.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/Time.hpp" diff --git a/core/src/discontinuousgalerkin/ModelArrayDetails.cpp b/core/src/discontinuousgalerkin/ModelArrayDetails.cpp index 350c359a6..0e7ab6e8c 100644 --- a/core/src/discontinuousgalerkin/ModelArrayDetails.cpp +++ b/core/src/discontinuousgalerkin/ModelArrayDetails.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ModelArray.hpp" diff --git a/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp b/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp index 9d4e3b23c..5b8be1abe 100644 --- a/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp +++ b/core/src/discontinuousgalerkin/include/ModelArrayDetails.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MODELARRAYDETAILS_HPP diff --git a/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp b/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp index c4d29f9ed..f083f3cda 100644 --- a/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp +++ b/core/src/discontinuousgalerkin/include/ModelArrayTypedefs.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ // An inclusion file of ModelArray typedefs for Discontinuous Galerkin models. diff --git a/core/src/finitevolume/ModelArrayDetails.cpp b/core/src/finitevolume/ModelArrayDetails.cpp index 384a378f9..33d888fd5 100644 --- a/core/src/finitevolume/ModelArrayDetails.cpp +++ b/core/src/finitevolume/ModelArrayDetails.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ModelArray.hpp" diff --git a/core/src/finitevolume/include/ModelArrayDetails.hpp b/core/src/finitevolume/include/ModelArrayDetails.hpp index ae9707d7d..0462dde80 100644 --- a/core/src/finitevolume/include/ModelArrayDetails.hpp +++ b/core/src/finitevolume/include/ModelArrayDetails.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MODELARRAYDETAILS_HPP diff --git a/core/src/finitevolume/include/ModelArrayTypedefs.hpp b/core/src/finitevolume/include/ModelArrayTypedefs.hpp index e89869f30..9d30a346a 100644 --- a/core/src/finitevolume/include/ModelArrayTypedefs.hpp +++ b/core/src/finitevolume/include/ModelArrayTypedefs.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ // An inclusion file of ModelArray typedefs for finite volume models. diff --git a/core/src/include/Chrono.hpp b/core/src/include/Chrono.hpp index d2d4f8b60..6b01c2228 100644 --- a/core/src/include/Chrono.hpp +++ b/core/src/include/Chrono.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef SRC_INCLUDE_CHRONO_HPP_ diff --git a/core/src/include/CommandLineParser.hpp b/core/src/include/CommandLineParser.hpp index aef2039bf..31b340e7e 100644 --- a/core/src/include/CommandLineParser.hpp +++ b/core/src/include/CommandLineParser.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef COMMANDLINEPARSER_HPP diff --git a/core/src/include/CommonRestartMetadata.hpp b/core/src/include/CommonRestartMetadata.hpp index 3acfdd17c..846e0597c 100644 --- a/core/src/include/CommonRestartMetadata.hpp +++ b/core/src/include/CommonRestartMetadata.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef COMMONRESTARTMETADATA_HPP diff --git a/core/src/include/ConfigMap.hpp b/core/src/include/ConfigMap.hpp index 0dd554ed3..a9e7b8121 100644 --- a/core/src/include/ConfigMap.hpp +++ b/core/src/include/ConfigMap.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CONFIGMAP_HPP diff --git a/core/src/include/ConfigurationHelp.hpp b/core/src/include/ConfigurationHelp.hpp index 1f73e9364..c84b8d17d 100644 --- a/core/src/include/ConfigurationHelp.hpp +++ b/core/src/include/ConfigurationHelp.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CONFIGURATIONHELP_HPP diff --git a/core/src/include/ConfigurationHelpPrinter.hpp b/core/src/include/ConfigurationHelpPrinter.hpp index f9b8ae7da..68eebf9e4 100644 --- a/core/src/include/ConfigurationHelpPrinter.hpp +++ b/core/src/include/ConfigurationHelpPrinter.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CONFIGURATIONHELPPRINTER_HPP diff --git a/core/src/include/Configurator.hpp b/core/src/include/Configurator.hpp index 0d48e286b..156ce1fc9 100644 --- a/core/src/include/Configurator.hpp +++ b/core/src/include/Configurator.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CONFIGURATOR_HPP diff --git a/core/src/include/Configured.hpp b/core/src/include/Configured.hpp index a13f3e60c..6cf371a4c 100644 --- a/core/src/include/Configured.hpp +++ b/core/src/include/Configured.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CONFIGURED_HPP diff --git a/core/src/include/ConfiguredModule.hpp b/core/src/include/ConfiguredModule.hpp index 9d0b7495f..96b6678df 100644 --- a/core/src/include/ConfiguredModule.hpp +++ b/core/src/include/ConfiguredModule.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CONFIGUREDMODULE_HPP diff --git a/core/src/include/DevStep.hpp b/core/src/include/DevStep.hpp index 1b1f3a34f..90d13c829 100644 --- a/core/src/include/DevStep.hpp +++ b/core/src/include/DevStep.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef DEVSTEP_HPP diff --git a/core/src/include/EnumWrapper.hpp b/core/src/include/EnumWrapper.hpp index cacfd0ebd..c871088dd 100644 --- a/core/src/include/EnumWrapper.hpp +++ b/core/src/include/EnumWrapper.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef ENUMWRAPPER_HPP diff --git a/core/src/include/FileCallbackCloser.hpp b/core/src/include/FileCallbackCloser.hpp index bbdd61f42..a7dc8fe46 100644 --- a/core/src/include/FileCallbackCloser.hpp +++ b/core/src/include/FileCallbackCloser.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef FILECALLBACKCLOSER_HPP diff --git a/core/src/include/Finalizer.hpp b/core/src/include/Finalizer.hpp index 91a248742..bfdaf48bf 100644 --- a/core/src/include/Finalizer.hpp +++ b/core/src/include/Finalizer.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef FINALIZER_HPP diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index 2ee947634..56876da1f 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -1,5 +1,5 @@ /*! - * @author Tom Meltzer + * @author Tom Meltzer */ #ifndef HALO_HPP diff --git a/core/src/include/IModelStep.hpp b/core/src/include/IModelStep.hpp index a6609dbcd..9456febce 100644 --- a/core/src/include/IModelStep.hpp +++ b/core/src/include/IModelStep.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef IMODELSTEP_HPP diff --git a/core/src/include/Iterator.hpp b/core/src/include/Iterator.hpp index 3794c2752..850fd255d 100644 --- a/core/src/include/Iterator.hpp +++ b/core/src/include/Iterator.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef SRC_INCLUDE_ITERATOR_HPP diff --git a/core/src/include/Logged.hpp b/core/src/include/Logged.hpp index 530085c58..9916d86bd 100644 --- a/core/src/include/Logged.hpp +++ b/core/src/include/Logged.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef SRC_INCLUDE_LOGGED_HPP diff --git a/core/src/include/MissingData.hpp b/core/src/include/MissingData.hpp index e41cb52c3..3c5836cbb 100644 --- a/core/src/include/MissingData.hpp +++ b/core/src/include/MissingData.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MISSINGDATA_HPP diff --git a/core/src/include/Model.hpp b/core/src/include/Model.hpp index c2495c8b0..3e3d63635 100644 --- a/core/src/include/Model.hpp +++ b/core/src/include/Model.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Kacper Kornet + * @author Tim Spain + * @author Kacper Kornet */ #ifndef MODEL_HPP diff --git a/core/src/include/ModelArray.hpp b/core/src/include/ModelArray.hpp index 4b49b508f..75538d2f5 100644 --- a/core/src/include/ModelArray.hpp +++ b/core/src/include/ModelArray.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MODELARRAY_HPP diff --git a/core/src/include/ModelArrayRef.hpp b/core/src/include/ModelArrayRef.hpp index 447905300..16b60cd97 100644 --- a/core/src/include/ModelArrayRef.hpp +++ b/core/src/include/ModelArrayRef.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MODELARRAYREF_HPP diff --git a/core/src/include/ModelArrayReferenceStore.hpp b/core/src/include/ModelArrayReferenceStore.hpp index fb1c75618..d77529dc0 100644 --- a/core/src/include/ModelArrayReferenceStore.hpp +++ b/core/src/include/ModelArrayReferenceStore.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MARSTORE_HPP diff --git a/core/src/include/ModelArraySlice.hpp b/core/src/include/ModelArraySlice.hpp index 9332aa2a8..6ec558864 100644 --- a/core/src/include/ModelArraySlice.hpp +++ b/core/src/include/ModelArraySlice.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MODELARRAYSLICE_HPP diff --git a/core/src/include/ModelComponent.hpp b/core/src/include/ModelComponent.hpp index eaaf0b53e..8e42a8664 100644 --- a/core/src/include/ModelComponent.hpp +++ b/core/src/include/ModelComponent.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Einar Ólason + * @author Tim Spain + * @author Einar Ólason */ #ifndef MODELCOMPONENT_HPP diff --git a/core/src/include/ModelConfig.hpp b/core/src/include/ModelConfig.hpp index 32d19dc4c..12df0f700 100644 --- a/core/src/include/ModelConfig.hpp +++ b/core/src/include/ModelConfig.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MODELCONFIG_HPP diff --git a/core/src/include/ModelMPI.hpp b/core/src/include/ModelMPI.hpp index 63b181e16..ed351b9d4 100644 --- a/core/src/include/ModelMPI.hpp +++ b/core/src/include/ModelMPI.hpp @@ -1,5 +1,5 @@ /*! - * @author Tom Meltzer + * @author Tom Meltzer */ #ifndef MODELMPI_HPP diff --git a/core/src/include/ModelMetadata.hpp b/core/src/include/ModelMetadata.hpp index 203cb845e..dd6ba8d2d 100644 --- a/core/src/include/ModelMetadata.hpp +++ b/core/src/include/ModelMetadata.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Tom Meltzer + * @author Tim Spain + * @author Tom Meltzer */ #ifndef MODELMETADATA_HPP diff --git a/core/src/include/ModelState.hpp b/core/src/include/ModelState.hpp index aa2df3758..3f85d3107 100644 --- a/core/src/include/ModelState.hpp +++ b/core/src/include/ModelState.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MODELSTATE_HPP diff --git a/core/src/include/Module.hpp b/core/src/include/Module.hpp index b329fa80f..70c55f1f2 100644 --- a/core/src/include/Module.hpp +++ b/core/src/include/Module.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MODULE_HPP diff --git a/core/src/include/MonthlyCubicBSpline.hpp b/core/src/include/MonthlyCubicBSpline.hpp index 11a310295..3c5180fd8 100644 --- a/core/src/include/MonthlyCubicBSpline.hpp +++ b/core/src/include/MonthlyCubicBSpline.hpp @@ -1,5 +1,5 @@ /*! - * @author Einar Örn Ólason + * @author Einar Örn Ólason */ #ifndef MONTHLYCUBICBSPLINE_HPP diff --git a/core/src/include/NetcdfMetadataConfiguration.hpp b/core/src/include/NetcdfMetadataConfiguration.hpp index edc6dddc2..d79d67f98 100644 --- a/core/src/include/NetcdfMetadataConfiguration.hpp +++ b/core/src/include/NetcdfMetadataConfiguration.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef NETCDFMETADATACONFIGURATION_HPP diff --git a/core/src/include/NextsimModule.hpp b/core/src/include/NextsimModule.hpp index 4eb2dee9b..2c07acce5 100644 --- a/core/src/include/NextsimModule.hpp +++ b/core/src/include/NextsimModule.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef NEXTSIMMODULE_HPP diff --git a/core/src/include/OutputSpec.hpp b/core/src/include/OutputSpec.hpp index e9530972a..0f6162b83 100644 --- a/core/src/include/OutputSpec.hpp +++ b/core/src/include/OutputSpec.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef OUTPUTSPEC_HPP diff --git a/core/src/include/ParaGridIO.hpp b/core/src/include/ParaGridIO.hpp index 48a4fc23e..6d541063d 100644 --- a/core/src/include/ParaGridIO.hpp +++ b/core/src/include/ParaGridIO.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef PARAGRIDIO_HPP diff --git a/core/src/include/PrognosticData.hpp b/core/src/include/PrognosticData.hpp index f3fbe434b..768042623 100644 --- a/core/src/include/PrognosticData.hpp +++ b/core/src/include/PrognosticData.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef PROGNOSTICDATA_HPP diff --git a/core/src/include/RectGridIO.hpp b/core/src/include/RectGridIO.hpp index 35cd14ca8..de709608c 100644 --- a/core/src/include/RectGridIO.hpp +++ b/core/src/include/RectGridIO.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Kacper Kornet + * @author Tim Spain + * @author Kacper Kornet */ #ifndef RECTGRIDIO_HPP diff --git a/core/src/include/Slice.hpp b/core/src/include/Slice.hpp index b179c4946..74c93374b 100644 --- a/core/src/include/Slice.hpp +++ b/core/src/include/Slice.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef SLICE_HPP diff --git a/core/src/include/StructureFactory.hpp b/core/src/include/StructureFactory.hpp index 5bd822fb1..e7f22332c 100644 --- a/core/src/include/StructureFactory.hpp +++ b/core/src/include/StructureFactory.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Kacper Kornet + * @author Tim Spain + * @author Kacper Kornet */ #ifndef STRUCTUREFACTORY_HPP diff --git a/core/src/include/TextTag.hpp b/core/src/include/TextTag.hpp index e8ff86f0c..fce9ebd8b 100644 --- a/core/src/include/TextTag.hpp +++ b/core/src/include/TextTag.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef TEXTTAG_HPP diff --git a/core/src/include/Time.hpp b/core/src/include/Time.hpp index 4046de06f..4db081d03 100644 --- a/core/src/include/Time.hpp +++ b/core/src/include/Time.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef TIME_HPP diff --git a/core/src/include/constants.hpp b/core/src/include/constants.hpp index e50b9e7ac..316f0bef3 100644 --- a/core/src/include/constants.hpp +++ b/core/src/include/constants.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef SRC_INCLUDE_CONSTANTS_HPP diff --git a/core/src/include/gridNames.hpp b/core/src/include/gridNames.hpp index b67d16344..03b59232c 100644 --- a/core/src/include/gridNames.hpp +++ b/core/src/include/gridNames.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef GRIDNAMES_HPP diff --git a/core/src/include/indexer.hpp b/core/src/include/indexer.hpp index a30db39d4..b03bea186 100644 --- a/core/src/include/indexer.hpp +++ b/core/src/include/indexer.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef INDEXER_HPP diff --git a/core/src/main.cpp b/core/src/main.cpp index eaac6c661..b2ba28f21 100644 --- a/core/src/main.cpp +++ b/core/src/main.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Kacper Kornet + * @author Tim Spain + * @author Kacper Kornet */ #include diff --git a/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp b/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp index bef4302e1..f18dbc128 100644 --- a/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp +++ b/core/src/modules/DiagnosticOutputModule/ConfigOutput.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ConfigOutput.hpp" diff --git a/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp b/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp index f817c9508..44d68e3ee 100644 --- a/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp +++ b/core/src/modules/DiagnosticOutputModule/SimpleOutput.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/SimpleOutput.hpp" diff --git a/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp index 9afcff914..f93dd55db 100644 --- a/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/ConfigOutput.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CONFIGOUTPUT_HPP diff --git a/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp index 5a755e6b7..95e6c5e46 100644 --- a/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/NoOutput.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef NOOUTPUT_HPP diff --git a/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp b/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp index 6d079cacd..c05f1eae9 100644 --- a/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp +++ b/core/src/modules/DiagnosticOutputModule/include/SimpleOutput.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef SIMPLEOUTPUT_HPP diff --git a/core/src/modules/DynamicsModule/BBMDynamics.cpp b/core/src/modules/DynamicsModule/BBMDynamics.cpp index 65ab479cd..8dccb4c75 100644 --- a/core/src/modules/DynamicsModule/BBMDynamics.cpp +++ b/core/src/modules/DynamicsModule/BBMDynamics.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Einar Ólason + * @author Tim Spain + * @author Einar Ólason */ #include "include/BBMDynamics.hpp" diff --git a/core/src/modules/DynamicsModule/MEVPDynamics.cpp b/core/src/modules/DynamicsModule/MEVPDynamics.cpp index ac63b561f..80153fcaf 100644 --- a/core/src/modules/DynamicsModule/MEVPDynamics.cpp +++ b/core/src/modules/DynamicsModule/MEVPDynamics.cpp @@ -1,7 +1,7 @@ /*! - * @author Tim Spain - * @author Piotr Minakowski - * @author Einar Ólason + * @author Tim Spain + * @author Piotr Minakowski + * @author Einar Ólason */ #include "include/MEVPDynamics.hpp" diff --git a/core/src/modules/DynamicsModule/include/BBMDynamics.hpp b/core/src/modules/DynamicsModule/include/BBMDynamics.hpp index ccb013938..5b87709a9 100644 --- a/core/src/modules/DynamicsModule/include/BBMDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/BBMDynamics.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef BBMDYNAMICS_HPP diff --git a/core/src/modules/DynamicsModule/include/DummyDynamics.hpp b/core/src/modules/DynamicsModule/include/DummyDynamics.hpp index 2959535a2..b516aaaed 100644 --- a/core/src/modules/DynamicsModule/include/DummyDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/DummyDynamics.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef DUMMYDYNAMICS_HPP diff --git a/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp b/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp index bae6576f5..9a173bd60 100644 --- a/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef FREEDRIFTDYNAMICS_HPP diff --git a/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp b/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp index a41223dab..4c38b91bd 100644 --- a/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp +++ b/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp @@ -1,7 +1,7 @@ /*! - * @author Tim Spain - * @author Piotr Minakowski - * @author Einar Ólason + * @author Tim Spain + * @author Piotr Minakowski + * @author Einar Ólason */ #ifndef MEVPDYNAMICS_HPP diff --git a/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp b/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp index f6cc576c6..be1e61c27 100644 --- a/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp +++ b/core/src/modules/FreezingPointModule/include/LinearFreezing.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef LINEARFREEZING_HPP diff --git a/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp b/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp index 09ba3de17..d94660c2f 100644 --- a/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp +++ b/core/src/modules/FreezingPointModule/include/UnescoFreezing.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef UNESCOFREEZING_HPP diff --git a/core/src/modules/StructureModule/ParametricGrid.cpp b/core/src/modules/StructureModule/ParametricGrid.cpp index 948e67e85..e94e0e271 100644 --- a/core/src/modules/StructureModule/ParametricGrid.cpp +++ b/core/src/modules/StructureModule/ParametricGrid.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ParametricGrid.hpp" diff --git a/core/src/modules/StructureModule/RectangularGrid.cpp b/core/src/modules/StructureModule/RectangularGrid.cpp index 30222dffa..1451fff75 100644 --- a/core/src/modules/StructureModule/RectangularGrid.cpp +++ b/core/src/modules/StructureModule/RectangularGrid.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/RectangularGrid.hpp" diff --git a/core/src/modules/StructureModule/include/ParametricGrid.hpp b/core/src/modules/StructureModule/include/ParametricGrid.hpp index e5422c25f..d5054ae01 100644 --- a/core/src/modules/StructureModule/include/ParametricGrid.hpp +++ b/core/src/modules/StructureModule/include/ParametricGrid.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Kacper Kornet + * @author Tim Spain + * @author Kacper Kornet */ #ifndef PARAMETRICGRID_HPP diff --git a/core/src/modules/StructureModule/include/RectangularGrid.hpp b/core/src/modules/StructureModule/include/RectangularGrid.hpp index 591c77165..d4b35b705 100644 --- a/core/src/modules/StructureModule/include/RectangularGrid.hpp +++ b/core/src/modules/StructureModule/include/RectangularGrid.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Kacper Kornet + * @author Tim Spain + * @author Kacper Kornet */ #ifndef RECTANGULARGRID_HPP diff --git a/core/src/modules/include/IDiagnosticOutput.hpp b/core/src/modules/include/IDiagnosticOutput.hpp index 8989f158b..33a294734 100644 --- a/core/src/modules/include/IDiagnosticOutput.hpp +++ b/core/src/modules/include/IDiagnosticOutput.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef IDIAGNOSTICOUTPUT_HPP diff --git a/core/src/modules/include/IDynamics.hpp b/core/src/modules/include/IDynamics.hpp index eadef566c..bf9e3a959 100644 --- a/core/src/modules/include/IDynamics.hpp +++ b/core/src/modules/include/IDynamics.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef IDYNAMICS_HPP diff --git a/core/src/modules/include/IFreezingPoint.hpp b/core/src/modules/include/IFreezingPoint.hpp index 2b6488cd5..c037e87b4 100644 --- a/core/src/modules/include/IFreezingPoint.hpp +++ b/core/src/modules/include/IFreezingPoint.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef SRC_INCLUDE_IFREEZINGPOINT_HPP_ diff --git a/core/src/modules/include/IStructure.hpp b/core/src/modules/include/IStructure.hpp index 1127f62c9..806e19b05 100644 --- a/core/src/modules/include/IStructure.hpp +++ b/core/src/modules/include/IStructure.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Kacper Kornet + * @author Tim Spain + * @author Kacper Kornet */ #ifndef ISTRUCTURE_HPP diff --git a/core/test/ArgV.cpp b/core/test/ArgV.cpp index 24c6dd159..6918876ac 100644 --- a/core/test/ArgV.cpp +++ b/core/test/ArgV.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "ArgV.hpp" diff --git a/core/test/ArgV.hpp b/core/test/ArgV.hpp index b4f01ac9f..44f57a172 100644 --- a/core/test/ArgV.hpp +++ b/core/test/ArgV.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include diff --git a/core/test/CommandLineParser_test.cpp b/core/test/CommandLineParser_test.cpp index 7b7dbcfa6..b0a3dee5d 100644 --- a/core/test/CommandLineParser_test.cpp +++ b/core/test/CommandLineParser_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "ArgV.hpp" diff --git a/core/test/ConfigOutput_test.cpp b/core/test/ConfigOutput_test.cpp index d9761a05a..4979ef4b2 100644 --- a/core/test/ConfigOutput_test.cpp +++ b/core/test/ConfigOutput_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifdef USE_MPI diff --git a/core/test/Configurator_test.cpp b/core/test/Configurator_test.cpp index a021e2035..2a8aa1592 100644 --- a/core/test/Configurator_test.cpp +++ b/core/test/Configurator_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "ArgV.hpp" diff --git a/core/test/DynamicsModuleForPDtest.cpp b/core/test/DynamicsModuleForPDtest.cpp index b6318bfce..f19dbd86c 100644 --- a/core/test/DynamicsModuleForPDtest.cpp +++ b/core/test/DynamicsModuleForPDtest.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/IDynamics.hpp" diff --git a/core/test/FileCallbackCloser_test.cpp b/core/test/FileCallbackCloser_test.cpp index 134325f45..7f1d8eed5 100644 --- a/core/test/FileCallbackCloser_test.cpp +++ b/core/test/FileCallbackCloser_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/core/test/Finalizer_test.cpp b/core/test/Finalizer_test.cpp index d7c1937e0..b7937f60f 100644 --- a/core/test/Finalizer_test.cpp +++ b/core/test/Finalizer_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/core/test/HaloExchangeCB_test.cpp b/core/test/HaloExchangeCB_test.cpp index 9af72d981..d5c2b974f 100644 --- a/core/test/HaloExchangeCB_test.cpp +++ b/core/test/HaloExchangeCB_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tom Meltzer + * @author Tom Meltzer */ #include diff --git a/core/test/HaloExchangePB_test.cpp b/core/test/HaloExchangePB_test.cpp index 86ad1def8..f9569046f 100644 --- a/core/test/HaloExchangePB_test.cpp +++ b/core/test/HaloExchangePB_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tom Meltzer + * @author Tom Meltzer */ #include diff --git a/core/test/Iterator_test.cpp b/core/test/Iterator_test.cpp index e4cd16647..3bd72ed5d 100644 --- a/core/test/Iterator_test.cpp +++ b/core/test/Iterator_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "Iterator.hpp" diff --git a/core/test/Logged_test.cpp b/core/test/Logged_test.cpp index 0b1979007..7d39b4b44 100644 --- a/core/test/Logged_test.cpp +++ b/core/test/Logged_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "Logged.hpp" diff --git a/core/test/ModelArrayRefDebug_test.cpp b/core/test/ModelArrayRefDebug_test.cpp index 5624e1c67..e6e7183f1 100644 --- a/core/test/ModelArrayRefDebug_test.cpp +++ b/core/test/ModelArrayRefDebug_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/core/test/ModelArrayRef_test.cpp b/core/test/ModelArrayRef_test.cpp index a55275404..cf5e034b5 100644 --- a/core/test/ModelArrayRef_test.cpp +++ b/core/test/ModelArrayRef_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/core/test/ModelArraySlice_test.cpp b/core/test/ModelArraySlice_test.cpp index 6580b37e2..6151c45c9 100644 --- a/core/test/ModelArraySlice_test.cpp +++ b/core/test/ModelArraySlice_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/core/test/ModelArray_test.cpp b/core/test/ModelArray_test.cpp index f5d0a330d..6aceef542 100644 --- a/core/test/ModelArray_test.cpp +++ b/core/test/ModelArray_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/core/test/ModelComponent_test.cpp b/core/test/ModelComponent_test.cpp index 7741d9739..3b22b8ffc 100644 --- a/core/test/ModelComponent_test.cpp +++ b/core/test/ModelComponent_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/core/test/ModelMetadataCB_test.cpp b/core/test/ModelMetadataCB_test.cpp index e3aa6c5de..debfe1bce 100644 --- a/core/test/ModelMetadataCB_test.cpp +++ b/core/test/ModelMetadataCB_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tom Meltzer + * @author Tom Meltzer */ #include diff --git a/core/test/ModelMetadataPB_test.cpp b/core/test/ModelMetadataPB_test.cpp index aabb7d2c2..1c46a98d4 100644 --- a/core/test/ModelMetadataPB_test.cpp +++ b/core/test/ModelMetadataPB_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tom Meltzer + * @author Tom Meltzer */ #include diff --git a/core/test/MonthlyCubicBSpline_test.cpp b/core/test/MonthlyCubicBSpline_test.cpp index 0743631dc..fae34cbb9 100644 --- a/core/test/MonthlyCubicBSpline_test.cpp +++ b/core/test/MonthlyCubicBSpline_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Einar Örn Ólason + * @author Einar Örn Ólason */ #include "include/MonthlyCubicBSpline.hpp" diff --git a/core/test/PDTestDynamics.hpp b/core/test/PDTestDynamics.hpp index f4dfb72c2..adbb8e89b 100644 --- a/core/test/PDTestDynamics.hpp +++ b/core/test/PDTestDynamics.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef PDTESTDYNAMICS_HPP diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index bb6cafe56..b91432700 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Tom Meltzer + * @author Tim Spain + * @author Tom Meltzer */ #include "ModelArray.hpp" diff --git a/core/test/PrognosticDataIO_test.cpp b/core/test/PrognosticDataIO_test.cpp index ed512de9d..8d8f078f3 100644 --- a/core/test/PrognosticDataIO_test.cpp +++ b/core/test/PrognosticDataIO_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/core/test/PrognosticData_test.cpp b/core/test/PrognosticData_test.cpp index 5c89dbe9e..741907d75 100644 --- a/core/test/PrognosticData_test.cpp +++ b/core/test/PrognosticData_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/core/test/RectGrid_test.cpp b/core/test/RectGrid_test.cpp index 70b7a734d..4c161e64d 100644 --- a/core/test/RectGrid_test.cpp +++ b/core/test/RectGrid_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifdef USE_MPI diff --git a/core/test/Slice_test.cpp b/core/test/Slice_test.cpp index 48e0d9351..3078f5be1 100644 --- a/core/test/Slice_test.cpp +++ b/core/test/Slice_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/core/test/Time_test.cpp b/core/test/Time_test.cpp index 09678b69e..054e2fac6 100644 --- a/core/test/Time_test.cpp +++ b/core/test/Time_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/Time.hpp" diff --git a/core/test/testmodelarraydetails/ModelArrayDetails.cpp b/core/test/testmodelarraydetails/ModelArrayDetails.cpp index 6478475b9..2b71dbad9 100644 --- a/core/test/testmodelarraydetails/ModelArrayDetails.cpp +++ b/core/test/testmodelarraydetails/ModelArrayDetails.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ModelArray.hpp" diff --git a/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp b/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp index 5598f0d9f..963ddc0a5 100644 --- a/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp +++ b/core/test/testmodelarraydetails/include/ModelArrayDetails.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MODELARRAYDETAILS_HPP diff --git a/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp b/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp index 99d946645..c28231eee 100644 --- a/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp +++ b/core/test/testmodelarraydetails/include/ModelArrayTypedefs.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ typedef ModelArray OneDField; diff --git a/dynamics/src/CGDynamicsKernel.cpp b/dynamics/src/CGDynamicsKernel.cpp index edbb0624f..6a525285e 100644 --- a/dynamics/src/CGDynamicsKernel.cpp +++ b/dynamics/src/CGDynamicsKernel.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Robert Jendersie + * @author Tim Spain + * @author Robert Jendersie */ /* diff --git a/dynamics/src/DGTransport.cpp b/dynamics/src/DGTransport.cpp index cd07ef69e..fd92eff6c 100644 --- a/dynamics/src/DGTransport.cpp +++ b/dynamics/src/DGTransport.cpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #include "DGTransport.hpp" diff --git a/dynamics/src/DummyDynamicsKernel.cpp b/dynamics/src/DummyDynamicsKernel.cpp index 62b6b299f..219c8e58d 100644 --- a/dynamics/src/DummyDynamicsKernel.cpp +++ b/dynamics/src/DummyDynamicsKernel.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/DummyDynamicsKernel.hpp" diff --git a/dynamics/src/DynamicsKernel.cpp b/dynamics/src/DynamicsKernel.cpp index 12e004c94..fd1d98f98 100644 --- a/dynamics/src/DynamicsKernel.cpp +++ b/dynamics/src/DynamicsKernel.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/DynamicsKernel.hpp" diff --git a/dynamics/src/MEVPStressUpdateStep.cpp b/dynamics/src/MEVPStressUpdateStep.cpp index bfa76c7fd..55fdaffc3 100644 --- a/dynamics/src/MEVPStressUpdateStep.cpp +++ b/dynamics/src/MEVPStressUpdateStep.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "MEVPStressUpdateStep.hpp" diff --git a/dynamics/src/ParametricMap.cpp b/dynamics/src/ParametricMap.cpp index 3417aa7c6..5e7db9e4d 100644 --- a/dynamics/src/ParametricMap.cpp +++ b/dynamics/src/ParametricMap.cpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #include "ParametricMap.hpp" diff --git a/dynamics/src/ParametricMesh.cpp b/dynamics/src/ParametricMesh.cpp index c72c3291b..dd6ada8a9 100644 --- a/dynamics/src/ParametricMesh.cpp +++ b/dynamics/src/ParametricMesh.cpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #include "ParametricMesh.hpp" diff --git a/dynamics/src/ParametricTools.cpp b/dynamics/src/ParametricTools.cpp index d05f8451d..094198d08 100644 --- a/dynamics/src/ParametricTools.cpp +++ b/dynamics/src/ParametricTools.cpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #include "ParametricTools.hpp" diff --git a/dynamics/src/include/BBMDynamicsKernel.hpp b/dynamics/src/include/BBMDynamicsKernel.hpp index 92f55f4dc..0747439ae 100644 --- a/dynamics/src/include/BBMDynamicsKernel.hpp +++ b/dynamics/src/include/BBMDynamicsKernel.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Piotr Minakowski + * @author Tim Spain + * @author Piotr Minakowski */ #ifndef BBMDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/BBMParameters.hpp b/dynamics/src/include/BBMParameters.hpp index 7736ad700..85e1b9c5a 100644 --- a/dynamics/src/include/BBMParameters.hpp +++ b/dynamics/src/include/BBMParameters.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Piotr Minakowski + * @author Tim Spain + * @author Piotr Minakowski */ #ifndef __MEBPARAMETERS_HPP diff --git a/dynamics/src/include/BBMStressUpdateStep.hpp b/dynamics/src/include/BBMStressUpdateStep.hpp index 4f296c009..bf39f0708 100644 --- a/dynamics/src/include/BBMStressUpdateStep.hpp +++ b/dynamics/src/include/BBMStressUpdateStep.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef BBMSTRESSUPDATESTEP_HPP diff --git a/dynamics/src/include/BrittleCGDynamicsKernel.hpp b/dynamics/src/include/BrittleCGDynamicsKernel.hpp index 848ed71b5..f52087b8b 100644 --- a/dynamics/src/include/BrittleCGDynamicsKernel.hpp +++ b/dynamics/src/include/BrittleCGDynamicsKernel.hpp @@ -1,7 +1,7 @@ /*! - * @author Tim Spain - * @author Einar Ólason - * @author Robert Jendersie + * @author Tim Spain + * @author Einar Ólason + * @author Robert Jendersie */ #ifndef BRITTLECGDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/CGDynamicsKernel.hpp b/dynamics/src/include/CGDynamicsKernel.hpp index eb05817d2..3513c02b1 100644 --- a/dynamics/src/include/CGDynamicsKernel.hpp +++ b/dynamics/src/include/CGDynamicsKernel.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Robert Jendersie + * @author Tim Spain + * @author Robert Jendersie */ #ifndef CGDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/CGModelArray.hpp b/dynamics/src/include/CGModelArray.hpp index c5ce4579d..710113d5f 100644 --- a/dynamics/src/include/CGModelArray.hpp +++ b/dynamics/src/include/CGModelArray.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CGMODELARRAY_HPP diff --git a/dynamics/src/include/CheckPoints.hpp b/dynamics/src/include/CheckPoints.hpp index f75d60568..bce6cb4a7 100644 --- a/dynamics/src/include/CheckPoints.hpp +++ b/dynamics/src/include/CheckPoints.hpp @@ -1,5 +1,5 @@ /*! - * @author Piotr Minakowski + * @author Piotr Minakowski */ #ifndef __CHECKPOINTS_HPP diff --git a/dynamics/src/include/DGModelArray.hpp b/dynamics/src/include/DGModelArray.hpp index 127f17d21..638fbed65 100644 --- a/dynamics/src/include/DGModelArray.hpp +++ b/dynamics/src/include/DGModelArray.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef DGMODELARRAY_HPP diff --git a/dynamics/src/include/DummyDynamicsKernel.hpp b/dynamics/src/include/DummyDynamicsKernel.hpp index 03836e9dd..9e786c31f 100644 --- a/dynamics/src/include/DummyDynamicsKernel.hpp +++ b/dynamics/src/include/DummyDynamicsKernel.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Piotr Minakowski + * @author Tim Spain + * @author Piotr Minakowski */ #ifndef DUMMYDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/DynamicsKernel.hpp b/dynamics/src/include/DynamicsKernel.hpp index fbc2de01f..de2a2fdc2 100644 --- a/dynamics/src/include/DynamicsKernel.hpp +++ b/dynamics/src/include/DynamicsKernel.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef DYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/DynamicsParameters.hpp b/dynamics/src/include/DynamicsParameters.hpp index 62cf4cc59..178832160 100644 --- a/dynamics/src/include/DynamicsParameters.hpp +++ b/dynamics/src/include/DynamicsParameters.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Thomas Richter + * @author Tim Spain + * @author Thomas Richter */ #ifndef DYNAMICSPARAMETERS_HPP diff --git a/dynamics/src/include/FreeDriftDynamicsKernel.hpp b/dynamics/src/include/FreeDriftDynamicsKernel.hpp index 85d845d69..819f10414 100644 --- a/dynamics/src/include/FreeDriftDynamicsKernel.hpp +++ b/dynamics/src/include/FreeDriftDynamicsKernel.hpp @@ -1,9 +1,9 @@ /*! * Implementation of "classic free drift", where we ignore all \rho h terms in the momentum * equation. This is equivalent to assuming that the ice is very thin. - * @author Tim Spain - * @author Einar Ólason - * @author Robert Jendersie + * @author Tim Spain + * @author Einar Ólason + * @author Robert Jendersie */ #ifndef FREEDRIFTDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/IDynamicsUpdate.hpp b/dynamics/src/include/IDynamicsUpdate.hpp index ebb1364f0..bc8b91e70 100644 --- a/dynamics/src/include/IDynamicsUpdate.hpp +++ b/dynamics/src/include/IDynamicsUpdate.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef IDYNAMICSUPDATE_HPP diff --git a/dynamics/src/include/Interpolations.hpp b/dynamics/src/include/Interpolations.hpp index 0794c7c5f..88b02d381 100644 --- a/dynamics/src/include/Interpolations.hpp +++ b/dynamics/src/include/Interpolations.hpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #ifndef __INTERPOLATIONS_HPP diff --git a/dynamics/src/include/MEVPDynamicsKernel.hpp b/dynamics/src/include/MEVPDynamicsKernel.hpp index 10ddea862..7ebcf5e8f 100644 --- a/dynamics/src/include/MEVPDynamicsKernel.hpp +++ b/dynamics/src/include/MEVPDynamicsKernel.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Piotr Minakowski + * @author Tim Spain + * @author Piotr Minakowski */ #ifndef MEVPDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/MEVPStressUpdateStep.hpp b/dynamics/src/include/MEVPStressUpdateStep.hpp index dcbd3f017..f2148b9e1 100644 --- a/dynamics/src/include/MEVPStressUpdateStep.hpp +++ b/dynamics/src/include/MEVPStressUpdateStep.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef MEVPSTRESSUPDATESTEP_HPP diff --git a/dynamics/src/include/ParametricMesh.hpp b/dynamics/src/include/ParametricMesh.hpp index 0cb06dc69..c22ed1f65 100644 --- a/dynamics/src/include/ParametricMesh.hpp +++ b/dynamics/src/include/ParametricMesh.hpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #ifndef __PARAMETRICMESH_HPP diff --git a/dynamics/src/include/StressUpdateStep.hpp b/dynamics/src/include/StressUpdateStep.hpp index 0d14579be..9db21c57f 100644 --- a/dynamics/src/include/StressUpdateStep.hpp +++ b/dynamics/src/include/StressUpdateStep.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef STRESSUPDATESTEP_HPP diff --git a/dynamics/src/include/Tools.hpp b/dynamics/src/include/Tools.hpp index 51049c2c0..eb772936c 100644 --- a/dynamics/src/include/Tools.hpp +++ b/dynamics/src/include/Tools.hpp @@ -1,5 +1,5 @@ /*! - * @author Piotr Minakowski + * @author Piotr Minakowski */ #ifndef __TOOLS_HPP diff --git a/dynamics/src/include/VPCGDynamicsKernel.hpp b/dynamics/src/include/VPCGDynamicsKernel.hpp index 89b0bfe08..1cdc216fa 100644 --- a/dynamics/src/include/VPCGDynamicsKernel.hpp +++ b/dynamics/src/include/VPCGDynamicsKernel.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Robert Jendersie + * @author Tim Spain + * @author Robert Jendersie */ #ifndef VPCGDYNAMICSKERNEL_HPP diff --git a/dynamics/src/include/VPParameters.hpp b/dynamics/src/include/VPParameters.hpp index 07e190680..2e76caeaa 100644 --- a/dynamics/src/include/VPParameters.hpp +++ b/dynamics/src/include/VPParameters.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Thomas Richter + * @author Tim Spain + * @author Thomas Richter */ #ifndef __VPPARAMETERS_HPP diff --git a/dynamics/src/include/VectorManipulations.hpp b/dynamics/src/include/VectorManipulations.hpp index c1801c6f6..d42c6a4a6 100644 --- a/dynamics/src/include/VectorManipulations.hpp +++ b/dynamics/src/include/VectorManipulations.hpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #ifndef __VECTORMANIPULATIONS_HPP diff --git a/dynamics/src/include/cgVector.hpp b/dynamics/src/include/cgVector.hpp index 21efbc57d..14582b41a 100644 --- a/dynamics/src/include/cgVector.hpp +++ b/dynamics/src/include/cgVector.hpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #ifndef __CGVECTOR_HPP diff --git a/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp b/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp index 69f0c0fbe..318711ece 100644 --- a/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp +++ b/dynamics/src/include/dgBasisFunctionsGaussPoints.hpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #ifndef __BASISFUNCTIONSGUASSPOINTS_HPP diff --git a/dynamics/src/include/dgInitial.hpp b/dynamics/src/include/dgInitial.hpp index 927418511..3a2303e51 100644 --- a/dynamics/src/include/dgInitial.hpp +++ b/dynamics/src/include/dgInitial.hpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #ifndef __DGINITIAL_HPP diff --git a/dynamics/src/include/dgLimit.hpp b/dynamics/src/include/dgLimit.hpp index 1f615cd6e..d9ae8073f 100644 --- a/dynamics/src/include/dgLimit.hpp +++ b/dynamics/src/include/dgLimit.hpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #ifndef __DGLIMIT_HPP diff --git a/dynamics/src/include/dgLimiters.hpp b/dynamics/src/include/dgLimiters.hpp index 4dc222927..cb4ea1f96 100644 --- a/dynamics/src/include/dgLimiters.hpp +++ b/dynamics/src/include/dgLimiters.hpp @@ -1,5 +1,5 @@ /*! - * @author Piotr Minakowski + * @author Piotr Minakowski */ #ifndef __LIMITERS_HPP diff --git a/dynamics/src/include/dgVector.hpp b/dynamics/src/include/dgVector.hpp index f0bd85cc5..951d2c2d7 100644 --- a/dynamics/src/include/dgVector.hpp +++ b/dynamics/src/include/dgVector.hpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #ifndef __DGVECTOR_HPP diff --git a/dynamics/src/include/dgVectorHolder.hpp b/dynamics/src/include/dgVectorHolder.hpp index f6613be4d..8b87a3160 100644 --- a/dynamics/src/include/dgVectorHolder.hpp +++ b/dynamics/src/include/dgVectorHolder.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef DGVECTORHOLDER_HPP diff --git a/dynamics/src/include/dgVisu.hpp b/dynamics/src/include/dgVisu.hpp index f360cd9c1..e7209bce3 100644 --- a/dynamics/src/include/dgVisu.hpp +++ b/dynamics/src/include/dgVisu.hpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #ifndef __DGVISU_HPP diff --git a/dynamics/test/AdvectionPeriodicBC_test.cpp b/dynamics/test/AdvectionPeriodicBC_test.cpp index 65aaac228..763fc501a 100644 --- a/dynamics/test/AdvectionPeriodicBC_test.cpp +++ b/dynamics/test/AdvectionPeriodicBC_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/dynamics/test/Advection_test.cpp b/dynamics/test/Advection_test.cpp index 35ec240a6..b4f430e88 100644 --- a/dynamics/test/Advection_test.cpp +++ b/dynamics/test/Advection_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Thomas Richter + * @author Thomas Richter */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/dynamics/test/CGModelArray_test.cpp b/dynamics/test/CGModelArray_test.cpp index 712646633..7eb312606 100644 --- a/dynamics/test/CGModelArray_test.cpp +++ b/dynamics/test/CGModelArray_test.cpp @@ -1,7 +1,7 @@ /*! * @brief Test that the functions to convert from the dynamics code CGVector * to and from ModelArray function correctly. - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/dynamics/test/DGModelArray_test.cpp b/dynamics/test/DGModelArray_test.cpp index 33e3f0274..4d945020c 100644 --- a/dynamics/test/DGModelArray_test.cpp +++ b/dynamics/test/DGModelArray_test.cpp @@ -1,7 +1,7 @@ /*! * @brief Test that the functions to convert from the dynamics code DGVector * to and from ModelArray function correctly. - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/dynamics/test/FakeSmeshData.cpp b/dynamics/test/FakeSmeshData.cpp index 9583601b0..535af9475 100644 --- a/dynamics/test/FakeSmeshData.cpp +++ b/dynamics/test/FakeSmeshData.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "../test/FakeSmeshData.hpp" diff --git a/dynamics/test/FakeSmeshData.hpp b/dynamics/test/FakeSmeshData.hpp index e2fdd308c..946159cc6 100644 --- a/dynamics/test/FakeSmeshData.hpp +++ b/dynamics/test/FakeSmeshData.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef FAKESMESHDATA_HPP diff --git a/dynamics/test/ParametricMeshArea_test.cpp b/dynamics/test/ParametricMeshArea_test.cpp index 0e72466a2..d67bb7495 100644 --- a/dynamics/test/ParametricMeshArea_test.cpp +++ b/dynamics/test/ParametricMeshArea_test.cpp @@ -1,6 +1,6 @@ /*! * @brief Test the ParametricMesh class, especially processing from ModelArray files. - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/dynamics/test/ParametricMesh_test.cpp b/dynamics/test/ParametricMesh_test.cpp index f51af184d..360466e13 100644 --- a/dynamics/test/ParametricMesh_test.cpp +++ b/dynamics/test/ParametricMesh_test.cpp @@ -1,6 +1,6 @@ /*! * @brief Test the ParametricMesh class, especially processing from ModelArray files. - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/dynamics/test/dgVectorHolder_test.cpp b/dynamics/test/dgVectorHolder_test.cpp index 60d698b1a..c42db9d93 100644 --- a/dynamics/test/dgVectorHolder_test.cpp +++ b/dynamics/test/dgVectorHolder_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/src/BenchmarkCoordinates.cpp b/physics/src/BenchmarkCoordinates.cpp index 78ea9f8d5..88c494438 100644 --- a/physics/src/BenchmarkCoordinates.cpp +++ b/physics/src/BenchmarkCoordinates.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/BenchmarkCoordinates.hpp" diff --git a/physics/src/IceGrowth.cpp b/physics/src/IceGrowth.cpp index 5bd651f6a..f0b1c403f 100644 --- a/physics/src/IceGrowth.cpp +++ b/physics/src/IceGrowth.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Einar Ólason + * @author Tim Spain + * @author Einar Ólason */ #include "include/IceGrowth.hpp" diff --git a/physics/src/IceMinima.cpp b/physics/src/IceMinima.cpp index c6923b65c..0e1344c4d 100644 --- a/physics/src/IceMinima.cpp +++ b/physics/src/IceMinima.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/IceMinima.hpp" diff --git a/physics/src/SlabOcean.cpp b/physics/src/SlabOcean.cpp index e7a86be7b..3f16491f0 100644 --- a/physics/src/SlabOcean.cpp +++ b/physics/src/SlabOcean.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/SlabOcean.hpp" diff --git a/physics/src/include/BenchmarkCoordinates.hpp b/physics/src/include/BenchmarkCoordinates.hpp index f2ae56db4..9e7a26ea1 100644 --- a/physics/src/include/BenchmarkCoordinates.hpp +++ b/physics/src/include/BenchmarkCoordinates.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef BENCHMARKCOORDINATES_HPP diff --git a/physics/src/include/IceGrowth.hpp b/physics/src/include/IceGrowth.hpp index 32f5ac767..a2b5f7096 100644 --- a/physics/src/include/IceGrowth.hpp +++ b/physics/src/include/IceGrowth.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Einar Ólason + * @author Tim Spain + * @author Einar Ólason */ #ifndef ICEGROWTH_HPP diff --git a/physics/src/include/IceMinima.hpp b/physics/src/include/IceMinima.hpp index f64d1a24e..3626c6d31 100644 --- a/physics/src/include/IceMinima.hpp +++ b/physics/src/include/IceMinima.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef ICEMINIMA_HPP diff --git a/physics/src/include/SlabOcean.hpp b/physics/src/include/SlabOcean.hpp index a5041f2a0..409ee150a 100644 --- a/physics/src/include/SlabOcean.hpp +++ b/physics/src/include/SlabOcean.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef SLABOCEAN_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp index 27ec9879c..5676677e1 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/BenchmarkAtmosphere.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/BenchmarkAtmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp index edd93917e..e245ed50b 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/ConfiguredAtmosphere.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ConfiguredAtmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp b/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp index 86a4c04c3..9e6c4a567 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/ConstantAtmosphereBoundary.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ConstantAtmosphereBoundary.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp index 1eb49dd34..7cf69b167 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ERA5Atmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp index ca76c7cfc..e9ea907c4 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/FluxConfiguredAtmosphere.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/FluxConfiguredAtmosphere.hpp" diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp index 35a16aa50..0ed25af23 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/BenchmarkAtmosphere.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef BENCHMARKATMOSPHERE_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp index fe2f35ddb..68ea60edc 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/ConfiguredAtmosphere.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CONFIGUREDATMOSPHERE_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp index 39eee2d45..c7027b6f7 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/ConstantAtmosphereBoundary.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CONSTANTATMOSPHEREBOUNDARY_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp index 2bd5fb000..fa9abe8de 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/ERA5Atmosphere.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef ERA5ATMOSPHERE_HPP diff --git a/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp b/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp index c0fe55b6e..1a21c6df1 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp +++ b/physics/src/modules/AtmosphereBoundaryModule/include/FluxConfiguredAtmosphere.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef FLUXCONFIGUREDATMOSPHERE_HPP diff --git a/physics/src/modules/DamageHealingModule/ConstantHealing.cpp b/physics/src/modules/DamageHealingModule/ConstantHealing.cpp index 771f918f0..b7b46ed64 100644 --- a/physics/src/modules/DamageHealingModule/ConstantHealing.cpp +++ b/physics/src/modules/DamageHealingModule/ConstantHealing.cpp @@ -1,5 +1,5 @@ /*! - * @author Einar Ólason + * @author Einar Ólason */ #include "include/ConstantHealing.hpp" diff --git a/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp b/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp index 2ba7ac41e..5ce412018 100644 --- a/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp +++ b/physics/src/modules/DamageHealingModule/include/ConstantHealing.hpp @@ -1,5 +1,5 @@ /*! - * @author Einar Ólason + * @author Einar Ólason */ #ifndef CONSTANTHEALING_HPP diff --git a/physics/src/modules/DamageHealingModule/include/NoHealing.hpp b/physics/src/modules/DamageHealingModule/include/NoHealing.hpp index 6451c3b88..2e664f7ff 100644 --- a/physics/src/modules/DamageHealingModule/include/NoHealing.hpp +++ b/physics/src/modules/DamageHealingModule/include/NoHealing.hpp @@ -1,6 +1,6 @@ /*! * This class has no corresponding implementation, just this header file - * @author Einar Ólason + * @author Einar Ólason */ #ifndef NOHEALING_HPP diff --git a/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp b/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp index bf188c630..e9330e085 100644 --- a/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp +++ b/physics/src/modules/FluxCalculationModule/FiniteElementFluxes.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/FiniteElementFluxes.hpp" diff --git a/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp b/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp index 79562172c..67f28ed87 100644 --- a/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp +++ b/physics/src/modules/FluxCalculationModule/include/FiniteElementFluxes.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef FINITEELEMENTFLUXES_HPP diff --git a/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp b/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp index c455caacb..4dcc64c79 100644 --- a/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/CCSMIceAlbedo.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/CCSMIceAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp b/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp index 55ed47d65..0a09b632b 100644 --- a/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp +++ b/physics/src/modules/IceAlbedoModule/MU71Albedo.cpp @@ -1,5 +1,5 @@ /*! - * @author Einar Örn Ólason + * @author Einar Örn Ólason */ #include "include/MU71Albedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp b/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp index a392b82e9..402352efe 100644 --- a/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/SMU2IceAlbedo.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/SMU2IceAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp b/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp index 9aaa57124..b98f19f94 100644 --- a/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/SMUIceAlbedo.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/SMUIceAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp b/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp index 0ebf29c5a..79555b60c 100644 --- a/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp +++ b/physics/src/modules/IceAlbedoModule/WintonAlbedo.cpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Einar Ólason + * @author Tim Spain + * @author Einar Ólason */ #include "include/WintonAlbedo.hpp" diff --git a/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp index e41188bde..3090b8ac0 100644 --- a/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/CCSMIceAlbedo.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CCSMICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp b/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp index da2c6e4ec..71866f4da 100644 --- a/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/MU71Albedo.hpp @@ -1,5 +1,5 @@ /*! - * @author Einar Örn Ólason + * @author Einar Örn Ólason */ #ifndef SEASONALICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp index 552d1da86..652e5de28 100644 --- a/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/SMU2IceAlbedo.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef SRC_INCLUDE_SMU2ICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp index 3ecde0236..3320a73c5 100644 --- a/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/SMUIceAlbedo.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef SRC_INCLUDE_SMUICEALBEDO_HPP diff --git a/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp b/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp index f3c8c118a..226ccec2d 100644 --- a/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp +++ b/physics/src/modules/IceAlbedoModule/include/WintonAlbedo.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Einar Ólason + * @author Tim Spain + * @author Einar Ólason */ #ifndef WINTONALBEDO_HPP diff --git a/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp b/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp index 22fa56fb7..3c4c3a2b9 100644 --- a/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp +++ b/physics/src/modules/IceOceanHeatFluxModule/BasicIceOceanHeatFlux.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/BasicIceOceanHeatFlux.hpp" diff --git a/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp b/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp index d6da51d57..aff31a0a1 100644 --- a/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp +++ b/physics/src/modules/IceOceanHeatFluxModule/include/BasicIceOceanHeatFlux.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef BASICICEOCEANHEATFLUX_HPP diff --git a/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp b/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp index b9252a101..fba2587a6 100644 --- a/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp +++ b/physics/src/modules/IceThermodynamicsModule/ThermoIce0.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ThermoIce0.hpp" diff --git a/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp b/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp index 597c1c2a0..5c9895b98 100644 --- a/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp +++ b/physics/src/modules/IceThermodynamicsModule/ThermoWinton.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/Slice.hpp" diff --git a/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp b/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp index 281a59f4b..67c5fc15e 100644 --- a/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp +++ b/physics/src/modules/IceThermodynamicsModule/include/DummyIceThermodynamics.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef DUMMYICETHERMODYNAMICS_HPP diff --git a/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp b/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp index 9d9093bc8..d7113425f 100644 --- a/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp +++ b/physics/src/modules/IceThermodynamicsModule/include/ThermoIce0.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef THERMOICE0HPP diff --git a/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp b/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp index 4362a404e..5dcc7ac76 100644 --- a/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp +++ b/physics/src/modules/IceThermodynamicsModule/include/ThermoWinton.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef THERMOWINTON_HPP diff --git a/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp b/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp index e27af8001..cf13b2d49 100644 --- a/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp +++ b/physics/src/modules/LateralIceSpreadModule/HiblerSpread.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/HiblerSpread.hpp" diff --git a/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp b/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp index 0ebe23792..550513868 100644 --- a/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp +++ b/physics/src/modules/LateralIceSpreadModule/include/DummyIceSpread.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef DUMMYICESPREAD_HPP diff --git a/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp b/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp index 98750138d..8c91bd52b 100644 --- a/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp +++ b/physics/src/modules/LateralIceSpreadModule/include/HiblerSpread.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef HIBLERSPREAD_HPP diff --git a/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp b/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp index 7f30892a1..1e0b6c547 100644 --- a/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/BenchmarkOcean.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/BenchmarkOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp b/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp index d05b0b1f6..b9b3f22b8 100644 --- a/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/ConfiguredOcean.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ConfiguredOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp b/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp index 5141bba93..5a531c295 100644 --- a/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp +++ b/physics/src/modules/OceanBoundaryModule/ConstantOceanBoundary.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ConstantOceanBoundary.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp b/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp index 49c10885f..3709892fd 100644 --- a/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/FluxConfiguredOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp b/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp index a11dec3ea..1af80bbc6 100644 --- a/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/TOPAZOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp b/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp index a101f1281..081bac873 100644 --- a/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/UniformOcean.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/UniformOcean.hpp" diff --git a/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp index 72e429849..ef8081bd0 100644 --- a/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/BenchmarkOcean.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef BENCHMARKOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp index ab062adbc..5d2346884 100644 --- a/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/ConfiguredOcean.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CONFIGUREDOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp b/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp index d6e3244b9..a20c3f0ab 100644 --- a/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/ConstantOceanBoundary.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef CONSTANTOCEANBOUNDARY_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp index 6f5ae9a7b..4ff86db9b 100644 --- a/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/FluxConfiguredOcean.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef FLUXCONFIGUREDOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp index 4c3fc4695..bfd11c824 100644 --- a/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/TOPAZOcean.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef TOPAZOCEAN_HPP diff --git a/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp b/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp index 4f77d805d..d30daa181 100644 --- a/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp +++ b/physics/src/modules/OceanBoundaryModule/include/UniformOcean.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef UNIFORMOCEAN_HPP diff --git a/physics/src/modules/include/IAtmosphereBoundary.hpp b/physics/src/modules/include/IAtmosphereBoundary.hpp index 2378d3a8c..f5dfe322a 100644 --- a/physics/src/modules/include/IAtmosphereBoundary.hpp +++ b/physics/src/modules/include/IAtmosphereBoundary.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #include "include/ModelArrayRef.hpp" diff --git a/physics/src/modules/include/IDamageHealing.hpp b/physics/src/modules/include/IDamageHealing.hpp index 5b91eed4e..35cb72334 100644 --- a/physics/src/modules/include/IDamageHealing.hpp +++ b/physics/src/modules/include/IDamageHealing.hpp @@ -1,5 +1,5 @@ /*! - * @author Einar Ólason + * @author Einar Ólason */ #ifndef IDAMAGEHEALING_HPP diff --git a/physics/src/modules/include/IFluxCalculation.hpp b/physics/src/modules/include/IFluxCalculation.hpp index 4de1761b2..7daa90350 100644 --- a/physics/src/modules/include/IFluxCalculation.hpp +++ b/physics/src/modules/include/IFluxCalculation.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef IFLUXCALCULATION_HPP diff --git a/physics/src/modules/include/IIceThermodynamics.hpp b/physics/src/modules/include/IIceThermodynamics.hpp index 1bc798a04..c25368512 100644 --- a/physics/src/modules/include/IIceThermodynamics.hpp +++ b/physics/src/modules/include/IIceThermodynamics.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef IICETHERMODYNAMICS_HPP diff --git a/physics/src/modules/include/ILateralIceSpread.hpp b/physics/src/modules/include/ILateralIceSpread.hpp index e6f01f6c9..3897d63fe 100644 --- a/physics/src/modules/include/ILateralIceSpread.hpp +++ b/physics/src/modules/include/ILateralIceSpread.hpp @@ -1,6 +1,6 @@ /*! - * @author Tim Spain - * @author Einar Ólason + * @author Tim Spain + * @author Einar Ólason */ #ifndef ILATERALICESPREAD_HPP diff --git a/physics/src/modules/include/IOceanBoundary.hpp b/physics/src/modules/include/IOceanBoundary.hpp index 23e5e9985..fdbe41e69 100644 --- a/physics/src/modules/include/IOceanBoundary.hpp +++ b/physics/src/modules/include/IOceanBoundary.hpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #ifndef IOCEANBOUNDARY_HPP diff --git a/physics/test/BasicIceOceanFlux_test.cpp b/physics/test/BasicIceOceanFlux_test.cpp index b1fccdf34..cbb8e00df 100644 --- a/physics/test/BasicIceOceanFlux_test.cpp +++ b/physics/test/BasicIceOceanFlux_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ // Does this class need testing? Not really, but it got removed from diff --git a/physics/test/BenchmarkBoundaries_test.cpp b/physics/test/BenchmarkBoundaries_test.cpp index 5cd286ac3..a1145e622 100644 --- a/physics/test/BenchmarkBoundaries_test.cpp +++ b/physics/test/BenchmarkBoundaries_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/ConstantOceanBoundary_test.cpp b/physics/test/ConstantOceanBoundary_test.cpp index ba5dd4618..d2d671f6e 100644 --- a/physics/test/ConstantOceanBoundary_test.cpp +++ b/physics/test/ConstantOceanBoundary_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/DamageHealing_test.cpp b/physics/test/DamageHealing_test.cpp index 3e92c54f8..3839a6f9e 100644 --- a/physics/test/DamageHealing_test.cpp +++ b/physics/test/DamageHealing_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Einar Ólason + * @author Einar Ólason */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/ERA5Atm_test.cpp b/physics/test/ERA5Atm_test.cpp index 0ed8523c8..e04ff46cf 100644 --- a/physics/test/ERA5Atm_test.cpp +++ b/physics/test/ERA5Atm_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/FiniteElementFluxes_test.cpp b/physics/test/FiniteElementFluxes_test.cpp index de8f949ad..19c95799b 100644 --- a/physics/test/FiniteElementFluxes_test.cpp +++ b/physics/test/FiniteElementFluxes_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/IceGrowth_test.cpp b/physics/test/IceGrowth_test.cpp index 5055997b3..979b53de7 100644 --- a/physics/test/IceGrowth_test.cpp +++ b/physics/test/IceGrowth_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/IceMinima_test.cpp b/physics/test/IceMinima_test.cpp index 59bf5e481..f97a67e65 100644 --- a/physics/test/IceMinima_test.cpp +++ b/physics/test/IceMinima_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/SlabOcean_test.cpp b/physics/test/SlabOcean_test.cpp index b60767ffc..c4cb3e612 100644 --- a/physics/test/SlabOcean_test.cpp +++ b/physics/test/SlabOcean_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/TOPAZOcn_test.cpp b/physics/test/TOPAZOcn_test.cpp index 3acb1cba1..1c39eeb1d 100644 --- a/physics/test/TOPAZOcn_test.cpp +++ b/physics/test/TOPAZOcn_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/ThermoIce0Temperature_test.cpp b/physics/test/ThermoIce0Temperature_test.cpp index 544cdaa56..b735a2443 100644 --- a/physics/test/ThermoIce0Temperature_test.cpp +++ b/physics/test/ThermoIce0Temperature_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/ThermoIce0_test.cpp b/physics/test/ThermoIce0_test.cpp index a589018e0..0db00e91b 100644 --- a/physics/test/ThermoIce0_test.cpp +++ b/physics/test/ThermoIce0_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/ThermoWintonTemperature_test.cpp b/physics/test/ThermoWintonTemperature_test.cpp index 910fd7bc4..39b402a1f 100644 --- a/physics/test/ThermoWintonTemperature_test.cpp +++ b/physics/test/ThermoWintonTemperature_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/physics/test/UniformOcean_test.cpp b/physics/test/UniformOcean_test.cpp index eb9a5f22a..c7fffca52 100644 --- a/physics/test/UniformOcean_test.cpp +++ b/physics/test/UniformOcean_test.cpp @@ -1,5 +1,5 @@ /*! - * @author Tim Spain + * @author Tim Spain */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN From ae15458720062aab779f0a5b95b54fa340f4640e Mon Sep 17 00:00:00 2001 From: tommelt Date: Tue, 26 Aug 2025 16:01:06 +0100 Subject: [PATCH 34/53] tests: XIOS now uses metadata/MPI singletons --- core/src/ParaGridIO_Xios.cpp | 2 - core/src/Xios.cpp | 37 ++++---- core/src/include/Xios.hpp | 3 +- core/test/CMakeLists.txt | 3 +- core/test/XiosFile_test.cpp | 6 +- core/test/XiosGrid_test.cpp | 6 +- core/test/XiosRead_test.cpp | 12 +-- core/test/XiosWrite_test.cpp | 14 +-- core/test/xios_test_partition_metadata_2.cdl | 98 +++++++++++++++----- 9 files changed, 110 insertions(+), 71 deletions(-) diff --git a/core/src/ParaGridIO_Xios.cpp b/core/src/ParaGridIO_Xios.cpp index 1d7c535e7..534b5c808 100644 --- a/core/src/ParaGridIO_Xios.cpp +++ b/core/src/ParaGridIO_Xios.cpp @@ -8,7 +8,6 @@ #include "include/CommonRestartMetadata.hpp" #include "include/FileCallbackCloser.hpp" #include "include/Finalizer.hpp" -#include "include/Halo.hpp" #include "include/Logged.hpp" #include "include/MissingData.hpp" #include "include/ModelMPI.hpp" @@ -202,7 +201,6 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& // Set the initial time to be zero (assigned above) // Piecewise construction is necessary to correctly construct the file handle/time index // pair -#ifdef USE_MPI auto& modelMPI = ModelMPI::getInstance(); openFilesAndIndices.emplace(std::piecewise_construct, std::make_tuple(filePath), std::forward_as_tuple(std::piecewise_construct, diff --git a/core/src/Xios.cpp b/core/src/Xios.cpp index 26b46598b..84b382646 100644 --- a/core/src/Xios.cpp +++ b/core/src/Xios.cpp @@ -34,6 +34,7 @@ #include "StructureModule/include/ParametricGrid.hpp" #include "include/Finalizer.hpp" +#include "include/ModelMPI.hpp" #include "include/ModelMetadata.hpp" #include "include/ParallelNetcdfFile.hpp" #include "include/Xios.hpp" @@ -626,15 +627,15 @@ xios::CDomain* Xios::getDomain() * * If the domain ID is 'xy_domain' then a grid called 'grid_2D' will automatically be created with * this domain. - * - * @param metadata ModelMetadata object containing the partition metadata */ -void Xios::affixModelMetadata(ModelMetadata& metadata) +void Xios::affixModelMetadata() { + auto& metadata = ModelMetadata::getInstance(); // Initial read of the NetCDF file to deduce the dimensions if (inputFilename.length() > 0) { try { - netCDF::NcFilePar ncFile(inputFilename, netCDF::NcFile::read, metadata.mpiComm); + auto& modelMPI = ModelMPI::getInstance(); + netCDF::NcFilePar ncFile(inputFilename, netCDF::NcFile::read, modelMPI.getComm()); // Dimensions and DG components std::multimap dimMap = ncFile.getDims(); @@ -664,17 +665,17 @@ void Xios::affixModelMetadata(ModelMetadata& metadata) size_t localLength = 0; size_t start = 0; if (dimType == ModelArray::Dimension::X) { - localLength = metadata.localExtentX; - start = metadata.localCornerX; + localLength = metadata.getLocalExtentX(); + start = metadata.getLocalCornerX(); } else if (dimType == ModelArray::Dimension::Y) { - localLength = metadata.localExtentY; - start = metadata.localCornerY; + localLength = metadata.getLocalExtentY(); + start = metadata.getLocalCornerY(); } else if (dimType == ModelArray::Dimension::XVERTEX) { - localLength = metadata.localExtentX + 1; - start = metadata.localCornerX; + localLength = metadata.getLocalExtentX() + 1; + start = metadata.getLocalCornerX(); } else if (dimType == ModelArray::Dimension::YVERTEX) { - localLength = metadata.localExtentY + 1; - start = metadata.localCornerY; + localLength = metadata.getLocalExtentY() + 1; + start = metadata.getLocalCornerY(); } else { localLength = dim.getSize(); start = 0; @@ -722,33 +723,33 @@ void Xios::affixModelMetadata(ModelMetadata& metadata) } // Set global sizes - cxios_set_domain_ni_glo(domain, (int)metadata.globalExtentX); + cxios_set_domain_ni_glo(domain, (int)metadata.getGlobalExtentX()); if (!cxios_is_defined_domain_ni_glo(domain)) { throw std::runtime_error("Xios: Failed to set global x-size for domain '" + domainId + "'"); } - cxios_set_domain_nj_glo(domain, (int)metadata.globalExtentY); + cxios_set_domain_nj_glo(domain, (int)metadata.getGlobalExtentY()); if (!cxios_is_defined_domain_nj_glo(domain)) { throw std::runtime_error("Xios: Failed to set global y-size for domain '" + domainId + "'"); } // Set local starts - cxios_set_domain_ibegin(domain, (int)metadata.localCornerX); + cxios_set_domain_ibegin(domain, (int)metadata.getLocalCornerX()); if (!cxios_is_defined_domain_ibegin(domain)) { throw std::runtime_error( "Xios: Failed to set local starting x-index for domain '" + domainId + "'"); } - cxios_set_domain_jbegin(domain, (int)metadata.localCornerY); + cxios_set_domain_jbegin(domain, (int)metadata.getLocalCornerY()); if (!cxios_is_defined_domain_jbegin(domain)) { throw std::runtime_error( "Xios: Failed to set local starting y-index for domain '" + domainId + "'"); } // Set local sizes - cxios_set_domain_ni(domain, (int)metadata.localExtentX); + cxios_set_domain_ni(domain, (int)metadata.getLocalExtentX()); if (!cxios_is_defined_domain_ni(domain)) { throw std::runtime_error("Xios: Failed to set local x-size for domain '" + domainId + "'"); } - cxios_set_domain_nj(domain, (int)metadata.localExtentY); + cxios_set_domain_nj(domain, (int)metadata.getLocalExtentY()); if (!cxios_is_defined_domain_nj(domain)) { throw std::runtime_error("Xios: Failed to set local y-size for domain '" + domainId + "'"); } diff --git a/core/src/include/Xios.hpp b/core/src/include/Xios.hpp index a74b7bf25..87ce5460f 100644 --- a/core/src/include/Xios.hpp +++ b/core/src/include/Xios.hpp @@ -25,7 +25,6 @@ namespace Nextsim { // Forward declarations to avoid circular dependencies -class ModelMetadata; class ParaGridIO; void enableXios(); @@ -92,7 +91,7 @@ class Xios : public Configured { std::vector getAxisValues(const std::string axisId); /* Domain */ - void affixModelMetadata(ModelMetadata& metadata); + void affixModelMetadata(); /* Grid */ void createGrid(const std::string gridId); diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index 90c742931..e730f7081 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -168,8 +168,7 @@ if(ENABLE_MPI) target_link_libraries(testXiosRead_MPI2 PRIVATE nextsimlib doctest::doctest) add_executable(testXiosWrite_MPI2 "XiosWrite_test.cpp" "MainMPI.cpp") - target_compile_definitions(testXiosWrite_MPI2 PRIVATE USE_XIOS - TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\") + target_compile_definitions(testXiosWrite_MPI2 PRIVATE USE_XIOS) target_include_directories( testXiosWrite_MPI2 PRIVATE "${MODEL_INCLUDE_DIR}" "${XIOS_INCLUDE_LIST}" "${ModulesRoot}/StructureModule" diff --git a/core/test/XiosFile_test.cpp b/core/test/XiosFile_test.cpp index 646642ede..f14ef0d2d 100644 --- a/core/test/XiosFile_test.cpp +++ b/core/test/XiosFile_test.cpp @@ -12,6 +12,7 @@ #include "StructureModule/include/ParametricGrid.hpp" #include "include/Configurator.hpp" #include "include/Finalizer.hpp" +#include "include/ModelMPI.hpp" #include "include/ModelMetadata.hpp" #include "include/Xios.hpp" @@ -48,11 +49,12 @@ MPI_TEST_CASE("TestXiosFile", 2) Configurator::addStream(std::move(pcstream)); // Create ModelMetadata instance based off a partition metadata file - ModelMetadata metadata("xios_test_partition_metadata_2.nc", test_comm); + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance("xios_test_partition_metadata_2.nc"); // Get the Xios singleton instance and check it's initialized Xios& xiosHandler = Xios::getInstance(); - xiosHandler.affixModelMetadata(metadata); + xiosHandler.affixModelMetadata(); REQUIRE(xiosHandler.isInitialized()); REQUIRE(xiosHandler.getClientMPISize() == 2); diff --git a/core/test/XiosGrid_test.cpp b/core/test/XiosGrid_test.cpp index a11362f96..0b92dd0e5 100644 --- a/core/test/XiosGrid_test.cpp +++ b/core/test/XiosGrid_test.cpp @@ -10,6 +10,7 @@ #undef INFO #include "include/Finalizer.hpp" +#include "include/ModelMPI.hpp" #include "include/ModelMetadata.hpp" #include "include/Xios.hpp" @@ -29,11 +30,12 @@ MPI_TEST_CASE("TestXiosGrid", 2) enableXios(); // Create ModelMetadata instance based off a partition metadata file - ModelMetadata metadata("xios_test_partition_metadata_2.nc", test_comm); + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance("xios_test_partition_metadata_2.nc"); // Get the Xios singleton instance and check it's initialized Xios& xiosHandler = Xios::getInstance(); - xiosHandler.affixModelMetadata(metadata); + xiosHandler.affixModelMetadata(); REQUIRE(xiosHandler.isInitialized()); REQUIRE(xiosHandler.getClientMPISize() == 2); diff --git a/core/test/XiosRead_test.cpp b/core/test/XiosRead_test.cpp index ce7bcb2db..51c2da3f5 100644 --- a/core/test/XiosRead_test.cpp +++ b/core/test/XiosRead_test.cpp @@ -20,7 +20,6 @@ #include const std::string testFilesDir = TEST_FILES_DIR; -const std::string partitionFilename = testFilesDir + "/partition_metadata_2.nc"; const std::string filename = testFilesDir + "/xios_test_input.nc"; namespace Nextsim { @@ -59,8 +58,9 @@ MPI_TEST_CASE("TestXiosRead", 2) // Create ModelMetadata instance based off a partition metadata file // NOTE: ModelArray dimensions are determined from the input file, if present - ModelMetadata metadata("xios_test_partition_metadata_2.nc", test_comm); - xiosHandler.affixModelMetadata(metadata); + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance("xios_test_partition_metadata_2.nc"); + xiosHandler.affixModelMetadata(); // Create fields on the two grids // NOTE: Fields are created when the XIOS handler is constructed @@ -88,10 +88,6 @@ MPI_TEST_CASE("TestXiosRead", 2) // Check the input file exists REQUIRE(std::filesystem::exists(filename)); - // Create ModelMetadata instance - auto& modelMPI = ModelMPI::getInstance(test_comm); - auto& metadata = ModelMetadata::getInstance(partitionFilename); - // Deduce the local lengths of the two dimensions const size_t nx = ModelArray::definedDimensions.at(ModelArray::Dimension::X).localLength; const size_t ny = ModelArray::definedDimensions.at(ModelArray::Dimension::Y).localLength; @@ -102,7 +98,7 @@ MPI_TEST_CASE("TestXiosRead", 2) // Update the current timestep and verify it's updated in XIOS metadata.incrementTime(timestep); REQUIRE(xiosHandler.getCalendarStep() == ts); - ModelState state = grid.getModelState(filename, metadata); + ModelState state = grid.getModelState(filename); for (auto& entry : state.data) { for (size_t j = 0; j < ny; ++j) { for (size_t i = 0; i < nx; ++i) { diff --git a/core/test/XiosWrite_test.cpp b/core/test/XiosWrite_test.cpp index 79689fc5c..0152f3add 100644 --- a/core/test/XiosWrite_test.cpp +++ b/core/test/XiosWrite_test.cpp @@ -19,9 +19,6 @@ #include -const std::string testFilesDir = TEST_FILES_DIR; -const std::string partitionFilename = testFilesDir + "/partition_metadata_2.nc"; - namespace Nextsim { /*! @@ -57,8 +54,9 @@ MPI_TEST_CASE("TestXiosWrite", 2) REQUIRE(xiosHandler.getClientMPISize() == 2); // Create ModelMetadata instance based off a partition metadata file - ModelMetadata metadata("xios_test_partition_metadata_2.nc", test_comm); - xiosHandler.affixModelMetadata(metadata); + auto& modelMPI = ModelMPI::getInstance(test_comm); + auto& metadata = ModelMetadata::getInstance("xios_test_partition_metadata_2.nc"); + xiosHandler.affixModelMetadata(); // Set ModelArray dimensions const size_t nx_glo = 4; @@ -105,17 +103,13 @@ MPI_TEST_CASE("TestXiosWrite", 2) // Check a file with the expected name doesn't exist yet REQUIRE_FALSE(std::filesystem::exists("xios_test_output*.nc")); - // Create ModelMetadata instance - auto& modelMPI = ModelMPI::getInstance(test_comm); - auto& metadata = ModelMetadata::getInstance(partitionFilename); - // Simulate 4 iterations (timesteps) metadata.setTime(xiosHandler.getCalendarStart()); for (int ts = 1; ts <= 4; ts++) { // Update the current timestep and verify it's updated in XIOS metadata.incrementTime(timestep); REQUIRE(xiosHandler.getCalendarStep() == ts); - grid.dumpModelState(state, metadata, "xios_test_output", true); + grid.dumpModelState(state, "xios_test_output", true); } // Check the files have indeed been created then remove it diff --git a/core/test/xios_test_partition_metadata_2.cdl b/core/test/xios_test_partition_metadata_2.cdl index 4a43fd9b8..b242c500c 100644 --- a/core/test/xios_test_partition_metadata_2.cdl +++ b/core/test/xios_test_partition_metadata_2.cdl @@ -3,58 +3,106 @@ dimensions: NX = 4 ; NY = 2 ; P = 2 ; - T = UNLIMITED ; // (0 currently) - B = UNLIMITED ; // (0 currently) L = 1 ; R = 1 ; + B = UNLIMITED ; // (0 currently) + T = UNLIMITED ; // (0 currently) + L_periodic = UNLIMITED ; // (0 currently) + R_periodic = UNLIMITED ; // (0 currently) + B_periodic = UNLIMITED ; // (0 currently) + T_periodic = UNLIMITED ; // (0 currently) group: bounding_boxes { variables: int domain_x(P) ; - int domain_y(P) ; int domain_extent_x(P) ; + int domain_y(P) ; int domain_extent_y(P) ; data: domain_x = 0, 2 ; - domain_y = 0, 0 ; - domain_extent_x = 2, 2 ; + domain_y = 0, 0 ; + domain_extent_y = 2, 2 ; } // group bounding_boxes group: connectivity { variables: - int top_neighbors(P) ; - int top_neighbor_ids(T) ; - int top_neighbor_halos(T) ; - int bottom_neighbors(P) ; - int bottom_neighbor_ids(B) ; - int bottom_neighbor_halos(B) ; - int left_neighbors(P) ; - int left_neighbor_ids(L) ; - int left_neighbor_halos(L) ; - int right_neighbors(P) ; - int right_neighbor_ids(R) ; - int right_neighbor_halos(R) ; + int left_neighbours(P) ; + int left_neighbour_ids(L) ; + int left_neighbour_halos(L) ; + int left_neighbour_halo_send(L) ; + int left_neighbour_halo_recv(L) ; + int right_neighbours(P) ; + int right_neighbour_ids(R) ; + int right_neighbour_halos(R) ; + int right_neighbour_halo_send(R) ; + int right_neighbour_halo_recv(R) ; + int bottom_neighbours(P) ; + int bottom_neighbour_ids(B) ; + int bottom_neighbour_halos(B) ; + int bottom_neighbour_halo_send(B) ; + int bottom_neighbour_halo_recv(B) ; + int top_neighbours(P) ; + int top_neighbour_ids(T) ; + int top_neighbour_halos(T) ; + int top_neighbour_halo_send(T) ; + int top_neighbour_halo_recv(T) ; + int left_neighbours_periodic(P) ; + int left_neighbour_ids_periodic(L_periodic) ; + int left_neighbour_halos_periodic(L_periodic) ; + int left_neighbour_halo_send_periodic(L_periodic) ; + int left_neighbour_halo_recv_periodic(L_periodic) ; + int right_neighbours_periodic(P) ; + int right_neighbour_ids_periodic(R_periodic) ; + int right_neighbour_halos_periodic(R_periodic) ; + int right_neighbour_halo_send_periodic(R_periodic) ; + int right_neighbour_halo_recv_periodic(R_periodic) ; + int bottom_neighbours_periodic(P) ; + int bottom_neighbour_ids_periodic(B_periodic) ; + int bottom_neighbour_halos_periodic(B_periodic) ; + int bottom_neighbour_halo_send_periodic(B_periodic) ; + int bottom_neighbour_halo_recv_periodic(B_periodic) ; + int top_neighbours_periodic(P) ; + int top_neighbour_ids_periodic(T_periodic) ; + int top_neighbour_halos_periodic(T_periodic) ; + int top_neighbour_halo_send_periodic(T_periodic) ; + int top_neighbour_halo_recv_periodic(T_periodic) ; data: - top_neighbors = 0, 0 ; + left_neighbours = 0, 1 ; + + left_neighbour_ids = 0 ; + + left_neighbour_halos = 2 ; + + left_neighbour_halo_send = 2 ; + + left_neighbour_halo_recv = 6 ; + + right_neighbours = 1, 0 ; + + right_neighbour_ids = 1 ; + + right_neighbour_halos = 2 ; + + right_neighbour_halo_send = 6 ; - bottom_neighbors = 0, 0 ; + right_neighbour_halo_recv = 2 ; - left_neighbors = 0, 1 ; + bottom_neighbours = 0, 0 ; - left_neighbor_ids = 0 ; + top_neighbours = 0, 0 ; - left_neighbor_halos = 2 ; + left_neighbours_periodic = 0, 0 ; - right_neighbors = 1, 0 ; + right_neighbours_periodic = 0, 0 ; - right_neighbor_ids = 1 ; + bottom_neighbours_periodic = 0, 0 ; - right_neighbor_halos = 2 ; + top_neighbours_periodic = 0, 0 ; } // group connectivity } From aa02b7be7760010a51992386b43223f168e714b8 Mon Sep 17 00:00:00 2001 From: tommelt Date: Tue, 26 Aug 2025 17:06:46 +0100 Subject: [PATCH 35/53] docs: add doc strings to halo.hpp --- core/src/include/Halo.hpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index 56876da1f..c40ff25b5 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -53,6 +53,13 @@ class Halo { intializeHaloMetadata(); } + /** + * @brief Sets the spatial dimensions of the domain + * + * This function sets the inner dimensions of the computational domain based on metadata, + * adjusts dimensions for vertex fields if necessary, and calculates total dimensions + * including halo cells. + */ void setSpatialDims() { auto& metadata = ModelMetadata::getInstance(); @@ -72,6 +79,17 @@ class Halo { m_Ny = m_innerNy + 2 * haloWidth; } + /** + * @brief Initializes halo metadata including buffers and slice information + * + * Sets up the send/receive buffers for each component and defines the boundary + * slices for halo exchanges. Handles both vertex and non-vertex cases. + * + * - Calculates total number of halo cells based on halo width + * - Allocates send/receive buffers for each component + * - Defines edge lengths + * - Sets up inner and outer slices for Bottom, Right, Top, Left edges + */ void intializeHaloMetadata() { // number of halo cells (should be general for any halo width) @@ -308,7 +326,18 @@ class Halo { } } - void vertexAdjustedPositions(size_t& count, size_t& disp, size_t& recvOffset, Edge& edge) + /** + * @brief Adjusts positions and offsets for vertex communications in the halo region + * + * Updates the count, displacement and receive offset values for vertex communications + * across halo boundaries according to the halo width and specified edge. + * + * @param[in,out] count The count of elements to be communicated, increased by haloWidth + * @param[in,out] disp The displacement value, adjusted based on opposite edge + * @param[in,out] recvOffset The receive offset, adjusted based on edge + * @param[in] edge The edge along which communication occurs + */ + void vertexAdjustedPositions(size_t& count, size_t& disp, size_t& recvOffset, const Edge& edge) { count = count + haloWidth; disp = disp + oppositeEdge.at(edge) * haloWidth; From 6863c7a81179f3d7ead92bbf49afa598dd37ba9c Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 1 Sep 2025 16:33:41 +0100 Subject: [PATCH 36/53] bug: make sure halo region is initialized to zero --- core/src/include/Halo.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index c40ff25b5..c6786da7b 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -374,7 +374,7 @@ class Halo { ArraySlicer::SliceIter sourceIter(sourceSlice, { m_innerNx, m_innerNy }); ArraySlicer::SliceIter targetIter(targetSlice, { m_Nx, m_Ny }); - // target = 0.; // everything outside the inner block should be initialized to zero. + target.setZero(); // everything outside the inner block should be initialized to zero. ModelArraySlice::copySliceWithIters(source, sourceIter, target, targetIter); } From cae32e7e7adf10d8b9ba4413b5c1a11a68f7663a Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 1 Sep 2025 16:34:27 +0100 Subject: [PATCH 37/53] feat: use Halo::haloWidth instead of HALOWIDTH --- core/src/ParaGridIO.cpp | 22 +++++++++++----------- core/src/include/Halo.hpp | 4 ++-- core/src/include/ModelArray.hpp | 17 ----------------- 3 files changed, 13 insertions(+), 30 deletions(-) diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index 76af6b77a..39ec198a3 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -134,8 +134,8 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) localLength = dim.getSize(); start = 0; } - ModelArray::setDimension( - dimType, dim.getSize() + 2 * HALOWIDTH, localLength + 2 * HALOWIDTH, start); + ModelArray::setDimension(dimType, dim.getSize() + 2 * Halo::haloWidth, + localLength + 2 * Halo::haloWidth, start); #else ModelArray::setDimension(dimType, dim.getSize()); #endif @@ -176,10 +176,10 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) size_t localLength = dim.localLength; #ifdef USE_MPI if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * HALOWIDTH; + localLength = localLength - 2 * Halo::haloWidth; } if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { - localLength = localLength - 2 * HALOWIDTH; + localLength = localLength - 2 * Halo::haloWidth; } #endif start.push_back(startIndex); @@ -256,10 +256,10 @@ ModelState ParaGridIO::readForcingTimeStatic( auto localLength = dim.localLength; #ifdef USE_MPI if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * HALOWIDTH; + localLength = localLength - 2 * Halo::haloWidth; } if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { - localLength = localLength - 2 * HALOWIDTH; + localLength = localLength - 2 * Halo::haloWidth; } #endif indexArray.push_back(startIndex); @@ -364,10 +364,10 @@ void ParaGridIO::dumpModelState(const ModelState& state, const std::string& file size_t localLength = dim.localLength; #ifdef USE_MPI if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * HALOWIDTH; + localLength = localLength - 2 * Halo::haloWidth; } if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { - localLength = localLength - 2 * HALOWIDTH; + localLength = localLength - 2 * Halo::haloWidth; } #endif start.push_back(dim.start); @@ -466,10 +466,10 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& auto localLength = dim.localLength; #ifdef USE_MPI if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * HALOWIDTH; + localLength = localLength - 2 * Halo::haloWidth; } if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { - localLength = localLength - 2 * HALOWIDTH; + localLength = localLength - 2 * Halo::haloWidth; } #endif ncDims.push_back(ncFromMAMap.at(dt)); @@ -510,7 +510,7 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& auto dim = ModelArray::definedDimensions.at(dt); auto localLength = dim.localLength; #ifdef USE_MPI - localLength = localLength - 2 * HALOWIDTH; + localLength = localLength - 2 * Halo::haloWidth; #endif maskIndexes.push_back(0); maskExtents.push_back(localLength); diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index c6786da7b..d0ef99d5c 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -358,7 +358,7 @@ class Halo { template void getInnerBlock(S& source, T& target) { ArraySlicer::Slice::VBounds sourceSlice, targetSlice; - sourceSlice = { { HALOWIDTH, -HALOWIDTH }, { HALOWIDTH, -HALOWIDTH } }; + sourceSlice = { { haloWidth, -haloWidth }, { haloWidth, -haloWidth } }; targetSlice = { {}, {} }; ArraySlicer::SliceIter sourceIter(sourceSlice, { m_Nx, m_Ny }); ArraySlicer::SliceIter targetIter(targetSlice, { m_innerNx, m_innerNy }); @@ -370,7 +370,7 @@ class Halo { { ArraySlicer::Slice::VBounds sourceSlice, targetSlice; sourceSlice = { {}, {} }; - targetSlice = { { HALOWIDTH, -HALOWIDTH }, { HALOWIDTH, -HALOWIDTH } }; + targetSlice = { { haloWidth, -haloWidth }, { haloWidth, -haloWidth } }; ArraySlicer::SliceIter sourceIter(sourceSlice, { m_innerNx, m_innerNy }); ArraySlicer::SliceIter targetIter(targetSlice, { m_Nx, m_Ny }); diff --git a/core/src/include/ModelArray.hpp b/core/src/include/ModelArray.hpp index 75538d2f5..032de1588 100644 --- a/core/src/include/ModelArray.hpp +++ b/core/src/include/ModelArray.hpp @@ -16,10 +16,6 @@ #include "indexer.hpp" -#ifndef HALOWIDTH -#define HALOWIDTH 1 -#endif - namespace ArraySlicer { class Slice; // class SliceIter; @@ -300,19 +296,6 @@ class ModelArray { const MultiDim& dimensions() const { return dimensions(type); } //! Returns a vector of the size of each dimension of the specified type of ModelArray. static const MultiDim& dimensions(Type type) { return m_dims.at(type); } -#ifdef USE_MPI - /** - * @brief Sets the inner block of the ModelArray data from a given source. - * - * @details - * Copies the inner block from the provided source data into the ModelArray's internal data - * buffer. The inner block is defined by slicing off HALOWIDTH elements from each boundary. The - * method initializes the entire data buffer to zero before copying the inner block. - * - * @param source The source DataType (Eigen array) from which to copy the inner block. - */ - void setInnerBlock(DataType& source); -#endif //! Returns the total number of elements of this type of ModelArray. size_t size() const { return size(type); } From bed5b93ee4d8aebfe59582419a42638dee6de4f7 Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 1 Sep 2025 16:41:50 +0100 Subject: [PATCH 38/53] bug: remove erroneous mpi include --- core/src/ModelMetadata.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index 74ed090a7..ddeac1b6a 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -13,7 +13,6 @@ #include "include/Xios.hpp" #endif #include "include/gridNames.hpp" -#include "mpi.h" #include #include #include From 8502246b03e20e1e0985016583125ba4766d80b9 Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 1 Sep 2025 16:49:14 +0100 Subject: [PATCH 39/53] chore: remove stale comments --- core/src/ModelMetadata.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index ddeac1b6a..d9dfeccad 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -103,10 +103,8 @@ void ModelMetadata::readNeighbourData(netCDF::NcFile& ncFile) } } -// rename void ModelMetadata::getPartitionMetadata(std::string partitionFile) { - // TODO: Move the reading of the partition file to its own class netCDF::NcFile ncFile(partitionFile, netCDF::NcFile::read); int sizes = ncFile.getDim("L").getSize(); int nBoxes = ncFile.getDim("P").getSize(); From 6191a330c6829473147f7faf828d42fb7fe3055d Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 1 Sep 2025 16:50:32 +0100 Subject: [PATCH 40/53] chore: remove stale comments --- dynamics/src/ParametricMesh.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/dynamics/src/ParametricMesh.cpp b/dynamics/src/ParametricMesh.cpp index 126ead2e0..a430d58ee 100644 --- a/dynamics/src/ParametricMesh.cpp +++ b/dynamics/src/ParametricMesh.cpp @@ -180,7 +180,6 @@ void ParametricMesh::readmesh(std::string fname) void ParametricMesh::coordinatesFromModelArray(const ModelArray& coords) { // Fill in the array sizes from the ModelArray dimensions - // TODO check do we need to make any additional changes here nx = ModelArray::size(ModelArray::Dimension::X); ny = ModelArray::size(ModelArray::Dimension::Y); nelements = nx * ny; From e36db5463d31146effc40fc85b49e08c98b92deb Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 1 Sep 2025 18:43:39 +0100 Subject: [PATCH 41/53] chore: remove unnecessary ifdefs --- core/src/include/Halo.hpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index d0ef99d5c..6c0f9c3ce 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -21,18 +21,6 @@ #define HALOWIDTH 1 #endif -#ifndef DGCOMP -#define DGCOMP 3 -#endif - -#ifndef DGSTRESSCOMP -#define DGSTRESSCOMP 8 -#endif - -#ifndef CGDEGREE -#define CGDEGREE 2 -#endif - namespace Nextsim { /*! From 6a4b03a93288a39dbcb107adcef87ea1292fc68c Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 1 Sep 2025 18:44:10 +0100 Subject: [PATCH 42/53] feat: change constructor of halo to use datatype --- core/src/ParaGridIO.cpp | 10 +++++----- core/src/include/Halo.hpp | 20 ++++++++++++++++---- core/test/CMakeLists.txt | 14 +++++++++++--- core/test/ConfigOutput_test.cpp | 16 ++++++++++++++-- core/test/HaloExchangeCB_test.cpp | 8 ++++---- core/test/HaloExchangePB_test.cpp | 8 ++++---- 6 files changed, 54 insertions(+), 22 deletions(-) diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index 39ec198a3..545b16903 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -196,7 +196,7 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) // need to check what happens for non-H-field modelarrays // need to figure out what happens w.r.t to coords in non-periodic and periodic case - Halo halo(data.nComponents(), type == ModelArray::Type::VERTEX); + Halo halo(data); // create and allocate temporary Eigen array ModelArray::DataType tempData; tempData.resize(halo.getInnerSize(), data.nComponents()); @@ -283,7 +283,7 @@ ModelState ParaGridIO::readForcingTimeStatic( data.resize(); #ifdef USE_MPI - Halo halo(data.nComponents(), false); + Halo halo(data); // create and allocate temporary Eigen array ModelArray::DataType tempData; tempData.resize(halo.getInnerSize(), data.nComponents()); @@ -384,7 +384,7 @@ void ParaGridIO::dumpModelState(const ModelState& state, const std::string& file #ifdef USE_MPI auto& data = entry.second; - Halo halo(data.nComponents(), type == ModelArray::Type::VERTEX); + Halo halo(data); ModelArray::DataType tempData; tempData.resize(halo.getInnerSize(), data.nComponents()); halo.getInnerBlock(data.getDataRef(), tempData); @@ -544,7 +544,7 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& #ifdef USE_MPI netCDF::setVariableCollective(var, ncFile); auto& data = entry.second; - Halo halo(data.nComponents(), type == ModelArray::Type::VERTEX); + Halo halo(data); ModelArray::DataType tempData; tempData.resize(halo.getInnerSize(), data.nComponents()); halo.getInnerBlock(data.getDataRef(), tempData); @@ -563,7 +563,7 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& #ifdef USE_MPI netCDF::setVariableCollective(var, ncFile); auto& data = entry.second; - Halo halo(data.nComponents(), type == ModelArray::Type::VERTEX); + Halo halo(data); ModelArray::DataType tempData; tempData.resize(halo.getInnerSize(), data.nComponents()); halo.getInnerBlock(data.getDataRef(), tempData); diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index 6c0f9c3ce..67b2b152d 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -11,6 +11,7 @@ #include #include "Slice.hpp" +#include "dgVector.hpp" #include "include/ModelArray.hpp" #include "include/ModelArraySlice.hpp" #include "include/ModelMPI.hpp" @@ -31,12 +32,23 @@ namespace Nextsim { class Halo { public: /*! - * @brief Constructs a halo object + * @brief Constructs a halo object from ModelArray */ - Halo(size_t numComps, bool isVertex = false) - : m_numComps(numComps) - , isVertex(isVertex) + Halo(ModelArray& ma) { + m_numComps = ma.nComponents(); + isVertex = ma.getType() == ModelArray::Type::VERTEX; + setSpatialDims(); + intializeHaloMetadata(); + } + + /*! + * @brief Constructs a halo object from DGVector + */ + template Halo(DGVector& dgv) + { + m_numComps = N; + isVertex = false; setSpatialDims(); intializeHaloMetadata(); } diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index e730f7081..0947fe507 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -201,6 +201,7 @@ if(ENABLE_MPI) "${ModulesRoot}/StructureModule" "../src" "../../dynamics/src" + "../../dynamics/src/include" ) target_link_libraries(testHaloExchangeCB_MPI3 PRIVATE nextsimlib doctest::doctest) @@ -218,6 +219,7 @@ if(ENABLE_MPI) "${ModulesRoot}/StructureModule" "../src" "../../dynamics/src" + "../../dynamics/src/include" ) target_link_libraries(testHaloExchangePB_MPI3 PRIVATE nextsimlib doctest::doctest) @@ -230,8 +232,10 @@ if(ENABLE_MPI) TEST_FILE_SOURCE=\"${CMAKE_CURRENT_SOURCE_DIR}\" ) target_include_directories( - testParaGrid_MPI2 - PRIVATE ${MODEL_INCLUDE_DIR} "${ModulesRoot}/StructureModule" + testParaGrid_MPI2 PRIVATE + ${MODEL_INCLUDE_DIR} + "${ModulesRoot}/StructureModule" + "../../dynamics/src/include" ) target_link_libraries(testParaGrid_MPI2 PRIVATE nextsimlib doctest::doctest) @@ -279,7 +283,11 @@ if(ENABLE_MPI) testConfigOutput_MPI2 PRIVATE USE_MPI TEST_FILES_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" ) - target_include_directories(testConfigOutput_MPI2 PRIVATE ${MODEL_INCLUDE_DIR}) + target_include_directories( + testConfigOutput_MPI2 PRIVATE + ${MODEL_INCLUDE_DIR} + "../../dynamics/src/include" + ) target_link_libraries(testConfigOutput_MPI2 PRIVATE nextsimlib doctest::doctest) set(MPI_TESTS diff --git a/core/test/ConfigOutput_test.cpp b/core/test/ConfigOutput_test.cpp index e30d73af0..ae96cb2af 100644 --- a/core/test/ConfigOutput_test.cpp +++ b/core/test/ConfigOutput_test.cpp @@ -133,8 +133,9 @@ TEST_CASE("Test periodic output") IDiagnosticOutput& ido = Module::getImplementation(); tryConfigure(ido); - for (size_t j = 0; j < localNY - 2 * HALOWIDTH; ++j) { - for (size_t i = 0; i < localNX - 2 * HALOWIDTH; ++i) { +#ifdef USE_MPI + for (size_t j = 0; j < localNY - 2 * Halo::haloWidth; ++j) { + for (size_t i = 0; i < localNX - 2 * Halo::haloWidth; ++i) { hice(i + 1, j + 1) = 0 + 0.01 * (j * nx + (i + offsetX)); cice(i + 1, j + 1) = 0.1 + 0.01 * (j * nx + (i + offsetX)); hsnow(i + 1, j + 1) = 0.2 + 0.01 * (j * nx + (i + offsetX)); @@ -142,6 +143,17 @@ TEST_CASE("Test periodic output") topMelt(i + 1, j + 1) = 0.6 + 0.01 * (j * nx + (i + offsetX)); } } +#else + for (size_t j = 0; j < localNY; ++j) { + for (size_t i = 0; i < localNX; ++i) { + hice(i, j) = 0 + 0.01 * (j * nx + (i + offsetX)); + cice(i, j) = 0.1 + 0.01 * (j * nx + (i + offsetX)); + hsnow(i, j) = 0.2 + 0.01 * (j * nx + (i + offsetX)); + tsurf(i, j) = 0.4 + 0.01 * (j * nx + (i + offsetX)); + topMelt(i, j) = 0.6 + 0.01 * (j * nx + (i + offsetX)); + } + } +#endif std::vector diagFiles; const std::string pfx = "diag01"; const std::string sfx = ".nc"; diff --git a/core/test/HaloExchangeCB_test.cpp b/core/test/HaloExchangeCB_test.cpp index d5c2b974f..9cddcbecb 100644 --- a/core/test/HaloExchangeCB_test.cpp +++ b/core/test/HaloExchangeCB_test.cpp @@ -76,7 +76,7 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) testData = 0.; // create halo for testData model array - Halo halo(testData.nComponents()); + Halo halo(testData); // create and allocate temporary Eigen array ModelArray::DataType innerData; @@ -109,7 +109,7 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid", 3) coordinates.resize(); coordinates = 0.; - Halo haloVertex(coordinates.nComponents(), true); + Halo haloVertex(coordinates); // Vetex coordinates auto localNxVertex = localNx + 1; @@ -198,7 +198,7 @@ MPI_TEST_CASE("DGField", 3) testData = 0.; // create halo for testData model array - Halo halo(testData.nComponents()); + Halo halo(testData); // create and allocate temporary Eigen array ModelArray::DataType innerData; @@ -265,7 +265,7 @@ MPI_TEST_CASE("DGVector", 3) testData.zero(); // create halo for testData model array - Halo halo(DG); + Halo halo(testData); // create and allocate temporary Eigen array ModelArray::DataType innerData; diff --git a/core/test/HaloExchangePB_test.cpp b/core/test/HaloExchangePB_test.cpp index f9569046f..9c5c2b7e5 100644 --- a/core/test/HaloExchangePB_test.cpp +++ b/core/test/HaloExchangePB_test.cpp @@ -78,7 +78,7 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditio testData = 0.; // create halo for testData model array - Halo halo(testData.nComponents()); + Halo halo(testData); // create and allocate temporary Eigen array ModelArray::DataType innerData; @@ -111,7 +111,7 @@ MPI_TEST_CASE("test halo exchange on 3 proc grid with periodic boundary conditio coordinates.resize(); coordinates = 0.; - Halo haloVertex(coordinates.nComponents(), true); + Halo haloVertex(coordinates); // Vetex coordinates auto localNxVertex = localNx + 1; @@ -203,7 +203,7 @@ MPI_TEST_CASE("DGField", 3) testData = 0.; // create halo for testData model array - Halo halo(testData.nComponents()); + Halo halo(testData); // create and allocate temporary Eigen array ModelArray::DataType innerData; @@ -270,7 +270,7 @@ MPI_TEST_CASE("DGVector", 3) testData.zero(); // create halo for testData model array - Halo halo(DG); + Halo halo(testData); // create and allocate temporary Eigen array ModelArray::DataType innerData; From dc5d3208880bed806236b9e21e82707209f00468 Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 1 Sep 2025 18:49:44 +0100 Subject: [PATCH 43/53] docs: add description to halo tests --- core/test/HaloExchangeCB_test.cpp | 8 ++++++++ core/test/HaloExchangePB_test.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/core/test/HaloExchangeCB_test.cpp b/core/test/HaloExchangeCB_test.cpp index 9cddcbecb..3d5ffc7c5 100644 --- a/core/test/HaloExchangeCB_test.cpp +++ b/core/test/HaloExchangeCB_test.cpp @@ -1,5 +1,13 @@ /*! * @author Tom Meltzer + * @brief Test halo exchange class for Closed Boundaries (CB) + * @details + * + * Test halo exchange class for Closed Boundaries (CB) on following fields: + * - HField + * - VertexField + * - DGField + * - DGVector */ #include diff --git a/core/test/HaloExchangePB_test.cpp b/core/test/HaloExchangePB_test.cpp index 9c5c2b7e5..d256c0f47 100644 --- a/core/test/HaloExchangePB_test.cpp +++ b/core/test/HaloExchangePB_test.cpp @@ -1,5 +1,13 @@ /*! * @author Tom Meltzer + * @brief Test halo exchange class for Periodic Boundaries (PB) + * @details + * + * Test halo exchange class for Periodic Boundaries (PB) on following fields: + * - HField + * - VertexField + * - DGField + * - DGVector */ #include From f38263bf0c9ec20c67a9c4e3c4c97bf072b36c91 Mon Sep 17 00:00:00 2001 From: tommelt Date: Fri, 19 Sep 2025 12:26:48 +0100 Subject: [PATCH 44/53] feat: add isDimLateral to simplify logic in paragridIO --- core/src/ParaGridIO.cpp | 34 +++++++++++++++++----------------- core/src/include/Halo.hpp | 15 +++++++++++++++ 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index 545b16903..a17151906 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -175,10 +175,9 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) size_t startIndex = dim.start; size_t localLength = dim.localLength; #ifdef USE_MPI - if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * Halo::haloWidth; - } - if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { + // Halo cells (which only exist in the lateral direction) are not included in netCDF + // files. Only read/write the inner block + if (Halo::isDimLateral(dt)) { localLength = localLength - 2 * Halo::haloWidth; } #endif @@ -255,10 +254,9 @@ ModelState ParaGridIO::readForcingTimeStatic( auto startIndex = dim.start; auto localLength = dim.localLength; #ifdef USE_MPI - if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * Halo::haloWidth; - } - if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { + // Halo cells (which only exist in the lateral direction) are not included in netCDF + // files. Only read/write the inner block + if (Halo::isDimLateral(dt)) { localLength = localLength - 2 * Halo::haloWidth; } #endif @@ -363,10 +361,9 @@ void ParaGridIO::dumpModelState(const ModelState& state, const std::string& file auto dim = entry.second.definedDimensions.at(dt); size_t localLength = dim.localLength; #ifdef USE_MPI - if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * Halo::haloWidth; - } - if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { + // Halo cells (which only exist in the lateral direction) are not included in netCDF + // files. Only read/write the inner block + if (Halo::isDimLateral(dt)) { localLength = localLength - 2 * Halo::haloWidth; } #endif @@ -465,10 +462,9 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& auto dim = ModelArray::definedDimensions.at(dt); auto localLength = dim.localLength; #ifdef USE_MPI - if (dt == Dim::X or dt == Dim::Y) { - localLength = localLength - 2 * Halo::haloWidth; - } - if (dt == Dim::XVERTEX or dt == Dim::YVERTEX) { + // Halo cells (which only exist in the lateral direction) are not included in netCDF + // files. Only read/write the inner block + if (Halo::isDimLateral(dt)) { localLength = localLength - 2 * Halo::haloWidth; } #endif @@ -510,7 +506,11 @@ void ParaGridIO::writeDiagnosticTime(const ModelState& state, const std::string& auto dim = ModelArray::definedDimensions.at(dt); auto localLength = dim.localLength; #ifdef USE_MPI - localLength = localLength - 2 * Halo::haloWidth; + // Halo cells (which only exist in the lateral direction) are not included in netCDF + // files. Only read/write the inner block + if (Halo::isDimLateral(dt)) { + localLength = localLength - 2 * Halo::haloWidth; + } #endif maskIndexes.push_back(0); maskExtents.push_back(localLength); diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index 67b2b152d..2d02ba9c6 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -345,6 +345,21 @@ class Halo { } public: + /** + * @brief Check if dimension is in the lateral direction i.e., X, Y, XVERTEX, or YVERTEX + * + * Determines whether a dimension represents a lateral (horizontal) direction, + * which includes both cell centers and vertices in X and Y dimensions. + * + * @param dim The dimension to check + * @return true if dimension is X, Y, XVERTEX, or YVERTEX, false otherwise + */ + static const bool isDimLateral(const ModelArray::Dimension dim) + { + return dim == ModelArray::Dimension::X || dim == ModelArray::Dimension::Y + || dim == ModelArray::Dimension::XVERTEX || dim == ModelArray::Dimension::YVERTEX; + } + /*! * @brief Returns size of the inner flattened array */ From 80f159bbaf60ea7063ddec7ac0a29045b64e9cba Mon Sep 17 00:00:00 2001 From: tommelt Date: Fri, 19 Sep 2025 12:29:07 +0100 Subject: [PATCH 45/53] chore: remove old TODO --- core/src/ParaGridIO.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index a17151906..0f683ca37 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -190,11 +190,6 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) std::reverse(count.begin(), count.end()); #ifdef USE_MPI - // TODO - // at this point we should add the halo exchange logic for each modelarray - // need to check what happens for non-H-field modelarrays - // need to figure out what happens w.r.t to coords in non-periodic and periodic case - Halo halo(data); // create and allocate temporary Eigen array ModelArray::DataType tempData; From 9ebbb9cd2da333b8b89e07d55051fd1db94111c6 Mon Sep 17 00:00:00 2001 From: tommelt Date: Fri, 19 Sep 2025 13:40:09 +0100 Subject: [PATCH 46/53] chore: remove unused file --- core/test/XiosDomain_test.cpp | 110 ---------------------------------- 1 file changed, 110 deletions(-) delete mode 100644 core/test/XiosDomain_test.cpp diff --git a/core/test/XiosDomain_test.cpp b/core/test/XiosDomain_test.cpp deleted file mode 100644 index 68a1bb5eb..000000000 --- a/core/test/XiosDomain_test.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/*! - * @author Joe Wallwork - * @author Adeleke Bankole - * @brief Tests for XIOS domains - * @details - * This test is designed to test domain functionality of the C++ interface - * for XIOS. - */ -#include -#undef INFO - -#include "StructureModule/include/ParametricGrid.hpp" -#include "include/Finalizer.hpp" -#include "include/Xios.hpp" - -namespace Nextsim { - -/*! - * TestXiosDomain - * - * This function tests the domain functionality of the C++ interface for XIOS. It - * needs to be run with 4 ranks i.e., - * - * `mpirun -n 4 ./testXiosDomain_MPI4` - * - */ -MPI_TEST_CASE("TestXiosDomain", 4) -{ - enableXios(); - - // Get the Xios singleton instance and check it's initialized - Xios& xiosHandler = Xios::getInstance(); - REQUIRE(xiosHandler.isInitialized()); - const size_t size = xiosHandler.getClientMPISize(); - REQUIRE(size == 4); - const size_t rank = xiosHandler.getClientMPIRank(); - - // --- Tests for domain API - const std::string domainId = "domain_A"; - REQUIRE_THROWS_WITH(xiosHandler.getDomainType(domainId), "Xios: Undefined domain 'domain_A'"); - xiosHandler.createDomain(domainId); - REQUIRE_THROWS_WITH( - xiosHandler.createDomain(domainId), "Xios: Domain 'domain_A' already exists"); - // Domain type - REQUIRE_THROWS_WITH( - xiosHandler.getDomainType(domainId), "Xios: Undefined type for domain 'domain_A'"); - const std::string domainType = "rectilinear"; - xiosHandler.setDomainType(domainId, domainType); - REQUIRE(xiosHandler.getDomainType(domainId) == domainType); - // Global number of points in x-direction - REQUIRE_THROWS_WITH(xiosHandler.getDomainGlobalXSize(domainId), - "Xios: Undefined global x-size for domain 'domain_A'"); - const size_t nx_glo = 4; - xiosHandler.setDomainGlobalXSize(domainId, nx_glo); - REQUIRE(xiosHandler.getDomainGlobalXSize(domainId) == nx_glo); - // Global number of points in y-direction - REQUIRE_THROWS_WITH(xiosHandler.getDomainGlobalYSize(domainId), - "Xios: Undefined global y-size for domain 'domain_A'"); - const size_t ny_glo = 2; - xiosHandler.setDomainGlobalYSize(domainId, ny_glo); - REQUIRE(xiosHandler.getDomainGlobalYSize(domainId) == ny_glo); - // Local number of points in x-direction - REQUIRE_THROWS_WITH(xiosHandler.getDomainLocalXSize(domainId), - "Xios: Undefined local x-size for domain 'domain_A'"); - const size_t nx = nx_glo / size; - xiosHandler.setDomainLocalXSize(domainId, nx); - REQUIRE(xiosHandler.getDomainLocalXSize(domainId) == nx); - // Local number of points in y-direction - REQUIRE_THROWS_WITH(xiosHandler.getDomainLocalYSize(domainId), - "Xios: Undefined local y-size for domain 'domain_A'"); - const size_t ny = ny_glo; - xiosHandler.setDomainLocalYSize(domainId, ny); - REQUIRE(xiosHandler.getDomainLocalYSize(domainId) == ny); - // Local starting x-index - REQUIRE_THROWS_WITH(xiosHandler.getDomainLocalXStart(domainId), - "Xios: Undefined local starting x-index for domain 'domain_A'"); - const size_t x0 = nx * rank; - xiosHandler.setDomainLocalXStart(domainId, x0); - REQUIRE(xiosHandler.getDomainLocalXStart(domainId) == x0); - // Local starting y-index - REQUIRE_THROWS_WITH(xiosHandler.getDomainLocalYStart(domainId), - "Xios: Undefined local starting y-index for domain 'domain_A'"); - const size_t y0 = 0; - xiosHandler.setDomainLocalYStart(domainId, y0); - REQUIRE(xiosHandler.getDomainLocalYStart(domainId) == y0); - // Local x-values - REQUIRE_THROWS_WITH(xiosHandler.getDomainLocalXValues(domainId), - "Xios: Undefined local x-values for domain 'domain_A'"); - REQUIRE_THROWS_AS(xiosHandler.getDomainLocalXValues(domainId), std::runtime_error); - std::vector vx { -1.0 + rank, -0.5 + rank }; - xiosHandler.setDomainLocalXValues(domainId, vx); - std::vector vxOut = xiosHandler.getDomainLocalXValues(domainId); - for (size_t i = 0; i < nx; i++) { - REQUIRE(vxOut[i] == doctest::Approx(vx[i])); - } - // Local y-values - REQUIRE_THROWS_WITH(xiosHandler.getDomainLocalYValues(domainId), - "Xios: Undefined local y-values for domain 'domain_A'"); - std::vector vy { -1.0, 1.0 }; - xiosHandler.setDomainLocalYValues(domainId, vy); - std::vector vyOut = xiosHandler.getDomainLocalYValues(domainId); - for (size_t j = 0; j < ny; j++) { - REQUIRE(vyOut[j] == doctest::Approx(vy[j])); - } - - xiosHandler.close_context_definition(); - xiosHandler.context_finalize(); - Finalizer::finalize(); -} -} From 769b0e0d95818c827e46cefca431cec889d1f1ac Mon Sep 17 00:00:00 2001 From: tommelt Date: Fri, 19 Sep 2025 13:47:06 +0100 Subject: [PATCH 47/53] chore: remove duplicate include --- core/test/ConfigOutput_test.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/core/test/ConfigOutput_test.cpp b/core/test/ConfigOutput_test.cpp index ae96cb2af..9b373be43 100644 --- a/core/test/ConfigOutput_test.cpp +++ b/core/test/ConfigOutput_test.cpp @@ -18,7 +18,6 @@ #include "include/ModelArray.hpp" #include "include/ModelArrayRef.hpp" #include "include/ModelComponent.hpp" -#include "include/ModelMPI.hpp" #include "include/ModelMetadata.hpp" #include "include/ModelState.hpp" #include "include/NextsimModule.hpp" From 1830de1be18004a3a4c15c68911f6bc59f720d5a Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 29 Sep 2025 15:08:24 +0100 Subject: [PATCH 48/53] feat: add runtime error if partition file is empty --- core/src/ModelMetadata.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/ModelMetadata.cpp b/core/src/ModelMetadata.cpp index d9dfeccad..8088176f5 100644 --- a/core/src/ModelMetadata.cpp +++ b/core/src/ModelMetadata.cpp @@ -36,6 +36,10 @@ const std::string& ModelMetadata::structureName() const #ifdef USE_MPI ModelMetadata::ModelMetadata(std::string partitionFile) { + if (partitionFile.empty()) { + throw std::runtime_error( + "ModelMetadata :: getInstance() called without partition file in MPI build."); + } getPartitionMetadata(partitionFile); static bool doneOnce = doOnce(); isInitialized = true; From c6830626fea652a2e88a71a015017dcf4a1badbf Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 29 Sep 2025 15:41:33 +0100 Subject: [PATCH 49/53] bugfix: globalLength shouldnt be padded with Halo cells --- core/src/ParaGridIO.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index 0f683ca37..1cf09a517 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -134,8 +134,10 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) localLength = dim.getSize(); start = 0; } - ModelArray::setDimension(dimType, dim.getSize() + 2 * Halo::haloWidth, - localLength + 2 * Halo::haloWidth, start); + // globalLength doesnt need to be padded with halo cells but localLength does + // setDimension(dim, globalLength, localLength, start) + ModelArray::setDimension( + dimType, dim.getSize(), localLength + 2 * Halo::haloWidth, start); #else ModelArray::setDimension(dimType, dim.getSize()); #endif From ae334ca92155b14e35dddf4222833a3fbb283af9 Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 29 Sep 2025 15:56:39 +0100 Subject: [PATCH 50/53] docs: add doxygen info Halo, ModelMPI and ModelMetadata --- core/src/include/Halo.hpp | 10 ++++++++++ core/src/include/ModelMPI.hpp | 6 ++++++ core/src/include/ModelMetadata.hpp | 11 +++++++++++ 3 files changed, 27 insertions(+) diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index 2d02ba9c6..ac14eebe1 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -1,5 +1,15 @@ /*! * @author Tom Meltzer + * @brief Halo exchange class + * @details + * + * Halo exchange class + * + * All functionality for halo exchange between MPI ranks is contained in this class. + * + * Halo supports the main data structures of NextSim e.g., ModelArray and DGVector. + * + * The halos are exchange via one-sided MPI communication using RMA. */ #ifndef HALO_HPP diff --git a/core/src/include/ModelMPI.hpp b/core/src/include/ModelMPI.hpp index ed351b9d4..8c01412e1 100644 --- a/core/src/include/ModelMPI.hpp +++ b/core/src/include/ModelMPI.hpp @@ -1,5 +1,11 @@ /*! * @author Tom Meltzer + * @brief Model MPI singleton + * @details + * + * Model MPI singleton + * + * MPI metadata is stored in the singleton. */ #ifndef MODELMPI_HPP diff --git a/core/src/include/ModelMetadata.hpp b/core/src/include/ModelMetadata.hpp index 71a5366b5..e12b70bf5 100644 --- a/core/src/include/ModelMetadata.hpp +++ b/core/src/include/ModelMetadata.hpp @@ -1,5 +1,16 @@ /*! * @author Tim Spain + * @author Tom Meltzer + * @brief Model metadata as a singleton class + * @details + * + * Model metadata as a singleton class + * + * This class holds the metadata pertaining to the model as a whole, as well as the MPI metadata + * which is used for halo exchange. + * + * The first time getInstance() is called, the class is initialized. If compiled with MPI then a + * partition file must be supplied. */ #ifndef MODELMETADATA_HPP From 4c39c885d616c7cfde7096facf4adfec8dc51408 Mon Sep 17 00:00:00 2001 From: tommelt Date: Thu, 2 Oct 2025 09:31:52 +0100 Subject: [PATCH 51/53] docs: fix typo in comment ParaGrid_test.cpp Co-authored-by: Joe Wallwork <22053413+jwallwork23@users.noreply.github.com> --- core/test/ParaGrid_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index f4acb2bd4..e5608c2e1 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -70,7 +70,7 @@ void initializeTestData( // In the following loops we only set the "inner" data - // Hfield's, DGField and mask + // HFields, DGField and mask for (size_t j = 0; j < localNY - 2 * haloWidth; ++j) { double yy = scale * (j - float(ny) / 2); for (size_t i = 0; i < localNX - 2 * haloWidth; ++i) { From 231126c02a8a04c4c3153ed4684a1bef3c2c57ed Mon Sep 17 00:00:00 2001 From: tommelt Date: Thu, 2 Oct 2025 09:40:01 +0100 Subject: [PATCH 52/53] docs: fix typos raised by Joe in PR review --- core/src/include/Halo.hpp | 8 +++----- core/test/ConfigOutput_test.cpp | 1 + core/test/ModelMetadataCB_test.cpp | 5 +++++ core/test/ModelMetadataPB_test.cpp | 5 +++++ core/test/ParaGrid_test.cpp | 4 ++-- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/core/src/include/Halo.hpp b/core/src/include/Halo.hpp index ac14eebe1..327ec000b 100644 --- a/core/src/include/Halo.hpp +++ b/core/src/include/Halo.hpp @@ -36,8 +36,6 @@ namespace Nextsim { /*! * @brief A class to facilitate halo exchange between MPI ranks - * - * @details */ class Halo { public: @@ -105,7 +103,7 @@ class Halo { // number of halo cells (should be general for any halo width) m_numHaloCells = 2 * haloWidth * (m_innerNx + m_innerNy + 2 * haloWidth); - // need send / recv buffers for each componenet (e.g., each DGCOMP) + // need send / recv buffers for each component (e.g., each DGCOMP) send.resize(m_numComps); recv.resize(m_numComps); for (size_t i = 0; i < m_numComps; i++) { @@ -204,7 +202,7 @@ class Halo { /*! * @brief Open memory window to exchange send buffer between MPI ranks. * - * @ details this is not intended to be used manually. It should only be called as part of the + * @details this is not intended to be used manually. It should only be called as part of the * update method. */ void openMemoryWindow(size_t idx) @@ -220,7 +218,7 @@ class Halo { /*! * @brief Initialise memory window to exchange send buffer between MPI ranks. * - * @ details this is not intended to be used manually. It should only be called as part of the + * @details this is not intended to be used manually. It should only be called as part of the * update method. */ void closeMemoryWindow() diff --git a/core/test/ConfigOutput_test.cpp b/core/test/ConfigOutput_test.cpp index 9b373be43..e47c2fa3c 100644 --- a/core/test/ConfigOutput_test.cpp +++ b/core/test/ConfigOutput_test.cpp @@ -133,6 +133,7 @@ TEST_CASE("Test periodic output") tryConfigure(ido); #ifdef USE_MPI + // offset indices by 1 (haloWidth) so only the "inner" data is initialized for (size_t j = 0; j < localNY - 2 * Halo::haloWidth; ++j) { for (size_t i = 0; i < localNX - 2 * Halo::haloWidth; ++i) { hice(i + 1, j + 1) = 0 + 0.01 * (j * nx + (i + offsetX)); diff --git a/core/test/ModelMetadataCB_test.cpp b/core/test/ModelMetadataCB_test.cpp index debfe1bce..1e1493ed2 100644 --- a/core/test/ModelMetadataCB_test.cpp +++ b/core/test/ModelMetadataCB_test.cpp @@ -1,5 +1,10 @@ /*! * @author Tom Meltzer + * @brief Test ModelMetadata class for Closed Boundaries (CB) + * @details + * + * Test ModelMetadata class for Closed Boundaries (CB). Check that it correctly reads the + * partition metadata from a netCDF file and populates the relevant member variables. */ #include diff --git a/core/test/ModelMetadataPB_test.cpp b/core/test/ModelMetadataPB_test.cpp index 1c46a98d4..e128776cf 100644 --- a/core/test/ModelMetadataPB_test.cpp +++ b/core/test/ModelMetadataPB_test.cpp @@ -1,5 +1,10 @@ /*! * @author Tom Meltzer + * @brief Test ModelMetadata class for Periodic Boundaries (PB) + * @details + * + * Test ModelMetadata class for Periodic Boundaries (PB). Check that it correctly reads the + * partition metadata from a netCDF file and populates the relevant member variables. */ #include diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index e5608c2e1..c2d248fc6 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -162,7 +162,7 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") *arr = 0.; } - // populate model arrays with dummy data + // populate model arrays with example data initializeTestData(fractional, fractionalDG, mask, coordinates, x, y); DGField hice = fractionalDG + 10; @@ -323,7 +323,7 @@ TEST_CASE("Write a diagnostic ParaGrid file") *arr = 0.; } - // populate model arrays with dummy data + // populate model arrays with example data initializeTestData(fractional, fractionalDG, mask, coordinates, x, y); REQUIRE(fractional.nDimensions() == 2); From 069d0b927324399a7c757f94bb63b32a08f749bd Mon Sep 17 00:00:00 2001 From: tommelt Date: Thu, 2 Oct 2025 10:13:31 +0100 Subject: [PATCH 53/53] fix: fix Model.cpp after merge of develop --- core/src/Model.cpp | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/core/src/Model.cpp b/core/src/Model.cpp index 8e16a020c..240a2358a 100644 --- a/core/src/Model.cpp +++ b/core/src/Model.cpp @@ -55,25 +55,6 @@ void Model::configure() // Configure logging Logged::configure(); - // Start/stop times. Run length will override stop time, if present. - std::string startTimeStr - = Configured::getConfiguration(keyMap.at(STARTTIME_KEY), std::string()); - std::string stopTimeStr = Configured::getConfiguration(keyMap.at(STOPTIME_KEY), std::string()); - std::string runLengthStr - = Configured::getConfiguration(keyMap.at(RUNLENGTH_KEY), std::string()); - std::string stepStr = Configured::getConfiguration(keyMap.at(TIMESTEP_KEY), std::string()); - - if (runLengthStr.empty()) { - if (stopTimeStr.empty()) { - throw std::invalid_argument(std::string("At least one of ") + keyMap.at(STOPTIME_KEY) - + " or " + keyMap.at(RUNLENGTH_KEY) + " must be set"); - } else { - m_etadata.setTimes(startTimeStr, TimePoint(stopTimeStr), stepStr); - } - } else { - m_etadata.setTimes(startTimeStr, Duration(runLengthStr), stepStr); - } - iterator.setStartStopStep(m_etadata.startTime(), m_etadata.stopTime(), m_etadata.stepLength()); // Configure the missing data value MissingData::setValue( Configured::getConfiguration(keyMap.at(MISSINGVALUE_KEY), MissingData::defaultValue)); @@ -95,10 +76,25 @@ void Model::configure() auto& metadata = ModelMetadata::getInstance(); #endif - // Set the time correspond to the current (initial) model state - TimePoint timeNow = iterator.parseAndSet(ModelConfig::startTimeStr, ModelConfig::stopTimeStr, - ModelConfig::durationStr, ModelConfig::stepStr); - metadata.setTime(timeNow); + // Start/stop times. Run length will override stop time, if present. + std::string startTimeStr + = Configured::getConfiguration(keyMap.at(STARTTIME_KEY), std::string()); + std::string stopTimeStr = Configured::getConfiguration(keyMap.at(STOPTIME_KEY), std::string()); + std::string runLengthStr + = Configured::getConfiguration(keyMap.at(RUNLENGTH_KEY), std::string()); + std::string stepStr = Configured::getConfiguration(keyMap.at(TIMESTEP_KEY), std::string()); + + if (runLengthStr.empty()) { + if (stopTimeStr.empty()) { + throw std::invalid_argument(std::string("At least one of ") + keyMap.at(STOPTIME_KEY) + + " or " + keyMap.at(RUNLENGTH_KEY) + " must be set"); + } else { + metadata.setTimes(startTimeStr, TimePoint(stopTimeStr), stepStr); + } + } else { + metadata.setTimes(startTimeStr, Duration(runLengthStr), stepStr); + } + iterator.setStartStopStep(metadata.startTime(), metadata.stopTime(), metadata.stepLength()); ModelState initialState(StructureFactory::stateFromFile(initialFileName));