diff --git a/core/src/ParaGridIO_Xios.cpp b/core/src/ParaGridIO_Xios.cpp index d96b894a4..f9e27e19a 100644 --- a/core/src/ParaGridIO_Xios.cpp +++ b/core/src/ParaGridIO_Xios.cpp @@ -78,6 +78,14 @@ ModelState ParaGridIO::getModelState(const std::string& filePath, ModelMetadata& #endif } +ModelState ParaGridIO::readForcingTimeStatic( + const std::set& forcings, const TimePoint& time, const std::string& filePath) +{ + ModelState state; + throw std::runtime_error("XIOS implementation of readForcingTimeStatic incomplete"); // TODO-JGW + return state; +} + /*! * @brief Writes the ModelState to a given file location from the provided * model data and metadata. diff --git a/core/src/include/ParaGridIO_Xios.hpp b/core/src/include/ParaGridIO_Xios.hpp index 02fbd2e44..9fb2847c9 100644 --- a/core/src/include/ParaGridIO_Xios.hpp +++ b/core/src/include/ParaGridIO_Xios.hpp @@ -72,6 +72,9 @@ class ParaGridIO : public ParametricGrid::IParaGridIO { */ void writeDiagnosticTime( const ModelState& state, const ModelMetadata& meta, const std::string& filePath) override; + + static ModelState readForcingTimeStatic( + const std::set& forcings, const TimePoint& time, const std::string& filePath); }; } /* namespace Nextsim */ diff --git a/core/test/ConfigOutput_test.cpp b/core/test/ConfigOutput_test.cpp index facbc8e57..c912ece7e 100644 --- a/core/test/ConfigOutput_test.cpp +++ b/core/test/ConfigOutput_test.cpp @@ -1,7 +1,7 @@ /*! * @file ConfigOutput_test.cpp * - * @date 24 Sep 2024 + * @date 31 Oct 2024 * @author Tim Spain */ @@ -21,8 +21,8 @@ #include "include/ModelComponent.hpp" #include "include/ModelMetadata.hpp" #include "include/ModelState.hpp" -#include "include/NextsimModule.hpp" #include "include/NZLevels.hpp" +#include "include/NextsimModule.hpp" #include "include/gridNames.hpp" #include @@ -144,7 +144,7 @@ TEST_CASE("Test periodic output") hsnow += hourIncr; ModelState state; - ido.outputState(meta); + ido.outputState(meta); // FIXME-JGW: XIOS impl fails here meta.incrementTime(Duration(3600.)); } } diff --git a/core/test/ParaGrid_test.cpp b/core/test/ParaGrid_test.cpp index a840fa14b..7a19d7715 100644 --- a/core/test/ParaGrid_test.cpp +++ b/core/test/ParaGrid_test.cpp @@ -255,7 +255,7 @@ TEST_CASE("Write and read a ModelState-based ParaGrid restart file") #ifdef USE_MPI ModelMetadata metadataIn(partitionFilename, test_comm); metadataIn.setTime(TimePoint(dateString)); - ModelState ms = gridIn.getModelState(filename, metadataIn); + ModelState ms = gridIn.getModelState(filename, metadataIn); // FIXME-JGW: XIOS impl fails here #else ModelState ms = gridIn.getModelState(filename); #endif @@ -520,14 +520,11 @@ TEST_CASE("Test array ordering") std::set fields = { fieldName }; TimePoint time; -#ifdef USE_XIOS - throw std::runtime_error("XIOS implementation incomplete"); // TODO-JGW -#else + // FIXME-JGW: XIOS impl fails here ModelState state = ParaGridIO::readForcingTimeStatic(fields, time, inputFilename); REQUIRE(state.data.count(fieldName) > 0); index2d = state.data.at(fieldName); REQUIRE(index2d(3, 5) == 35); -#endif } #ifdef USE_MPI @@ -610,7 +607,8 @@ TEST_CASE("Check if a file with the old dimension names can be read") metadata.localExtentX = 1; metadata.localExtentY = ny; metadata.setTime(TimePoint(dateString)); - ModelState ms = gridIn.getModelState(inputFilename, metadata); + ModelState ms + = gridIn.getModelState(inputFilename, metadata); // FIXME-JGW: XIOS impl fails here #else ModelState ms = gridIn.getModelState(inputFilename); #endif diff --git a/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp b/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp index 7f30d4a29..c8afe29a2 100644 --- a/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp +++ b/physics/src/modules/AtmosphereBoundaryModule/ERA5Atmosphere.cpp @@ -64,9 +64,6 @@ void ERA5Atmosphere::update(const TimestepTime& tst) std::set forcings = { "tair", "dew2m", "pair", "sw_in", "lw_in", "wind_speed", "u", "v" }; -#ifdef USE_XIOS - throw std::runtime_error("XIOS implementation incomplete"); // TODO-JGW -#else ModelState state = ParaGridIO::readForcingTimeStatic(forcings, tst.start, filePath); tair = state.data.at("tair"); tdew = state.data.at("dew2m"); @@ -80,7 +77,6 @@ void ERA5Atmosphere::update(const TimestepTime& tst) emp = 0; // FIXME get E - P data fluxImpl->update(tst); -#endif } void ERA5Atmosphere::setFilePath(const std::string& filePathIn) { filePath = filePathIn; } diff --git a/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp b/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp index a849b4054..016f00749 100644 --- a/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp +++ b/physics/src/modules/OceanBoundaryModule/TOPAZOcean.cpp @@ -63,9 +63,6 @@ void TOPAZOcean::updateBefore(const TimestepTime& tst) // TODO: Get more authoritative names for the forcings std::set forcings = { "sst", "sss", "mld", "u", "v" }; -#ifdef USE_XIOS - throw std::runtime_error("XIOS implementation incomplete"); // TODO-JGW -#else ModelState state = ParaGridIO::readForcingTimeStatic(forcings, tst.start, filePath); sstExt = state.data.at("sst"); sssExt = state.data.at("sss"); @@ -79,7 +76,6 @@ void TOPAZOcean::updateBefore(const TimestepTime& tst) TimestepTime()); Module::getImplementation().update(tst); -#endif } void TOPAZOcean::updateAfter(const TimestepTime& tst)