Class ParaGridIO

Inheritance Relationships

Base Type

Class Documentation

class ParaGridIO : public Nextsim::ParametricGrid::IParaGridIO

A class to perform input and output for the ParametricGrid class. unlike the other GridIO classes, this will hold non-restart files open to accumulate data until closed using the close function.

Public Types

using NetCDFFileType = netCDF::NcFile

Public Functions

ParaGridIO(ParametricGrid &grid)
virtual ~ParaGridIO()
virtual ModelState getModelState(const std::string &filePath) override

Retrieves the ModelState from a restart file of the parametric_grid type.

Parameters:

filePath – The file path containing the file to be read.

virtual void dumpModelState(const ModelState &state, const std::string &filePath) override

Writes the ModelState to a given file location from the provided model data.

@params state The model state and configuration object. creation model time). @params filePath The path for the restart file.

inline virtual ModelState readForcingTime(const std::set<std::string> &forcings, const TimePoint &time, const std::string &filePath) override

Reads forcings from a ParameticGrid flavoured file.

Parameters:
  • forcings – The names of the forcings required.

  • time – The time for which to get the forcings.

  • filePath – Path to the file to read.

virtual void writeDiagnosticTime(const ModelState &state, const std::string &filePath) override

Writes diagnostic data to a file.

Parameters:
  • state – The state to write to the file.

  • filePath – Path of the file to write to.

Public Static Functions

static void close(const std::string &filePath)

Closes an open diagnostic file. Does nothing when provided with a restart file name.

Parameters:

filePath – The path to the file to be closed.

static ModelState readForcingTimeStatic(const std::set<std::string> &forcings, const TimePoint &time, const std::string &filePath)