netxsimdg
Loading...
Searching...
No Matches
Nextsim::ParaGridIO Class Reference

#include <ParaGridIO.hpp>

Inheritance diagram for Nextsim::ParaGridIO:
Inheritance graph
Collaboration diagram for Nextsim::ParaGridIO:
Collaboration graph

Public Member Functions

 ParaGridIO (ParametricGrid &grid)
 
ModelState getModelState (const std::string &filePath) override
 
void dumpModelState (const ModelState &state, const ModelMetadata &meta, const std::string &filePath) override
 Writes the ModelState to a given file location from the provided model data and metadata.
 
ModelState readForcingTime (const std::set< std::string > &forcings, const TimePoint &time, const std::string &filePath) override
 Reads forcings from a ParameticGrid flavoured file.
 
void writeDiagnosticTime (const ModelState &state, const ModelMetadata &meta, const std::string &filePath) override
 Writes diagnostic data to a file.
 
- Public Member Functions inherited from Nextsim::ParametricGrid::IParaGridIO
 IParaGridIO (ParametricGrid &grid)
 

Static Public Member Functions

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

Detailed Description

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.

Definition at line 24 of file ParaGridIO.hpp.

Constructor & Destructor Documentation

◆ ParaGridIO()

Nextsim::ParaGridIO::ParaGridIO ( ParametricGrid & grid)
inline

Definition at line 26 of file ParaGridIO.hpp.

Member Function Documentation

◆ close()

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

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

Parameters
filePathThe path to the file to be closed.

Definition at line 365 of file ParaGridIO.cpp.

◆ dumpModelState()

void Nextsim::ParaGridIO::dumpModelState ( const ModelState & state,
const ModelMetadata & meta,
const std::string & filePath )
overridevirtual

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

@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.

Implements Nextsim::ParametricGrid::IParaGridIO.

Definition at line 182 of file ParaGridIO.cpp.

Here is the call graph for this function:

◆ getModelState()

ModelState Nextsim::ParaGridIO::getModelState ( const std::string & filePath)
overridevirtual

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

Parameters
filePathThe file path containing the file to be read.

Implements Nextsim::ParametricGrid::IParaGridIO.

Definition at line 70 of file ParaGridIO.cpp.

Here is the call graph for this function:

◆ readForcingTime()

ModelState Nextsim::ParaGridIO::readForcingTime ( const std::set< std::string > & forcings,
const TimePoint & time,
const std::string & filePath )
inlineoverridevirtual

Reads forcings from a ParameticGrid flavoured file.

Parameters
forcingsThe names of the forcings required.
timeThe time for which to get the forcings.
filePathPath to the file to read.

Implements Nextsim::ParametricGrid::IParaGridIO.

Definition at line 59 of file ParaGridIO.hpp.

◆ readForcingTimeStatic()

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

Definition at line 131 of file ParaGridIO.cpp.

◆ writeDiagnosticTime()

void Nextsim::ParaGridIO::writeDiagnosticTime ( const ModelState & state,
const ModelMetadata & meta,
const std::string & filePath )
overridevirtual

Writes diagnostic data to a file.

Parameters
stateThe state to write to the file.
timeThe time of the passed data.
filePathPath of the file to write to.

Implements Nextsim::ParametricGrid::IParaGridIO.

Definition at line 237 of file ParaGridIO.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: